diff --git a/src/bb-ipn.php b/src/bb-ipn.php index 0fa9ea9bb..d8243a8e3 100644 --- a/src/bb-ipn.php +++ b/src/bb-ipn.php @@ -52,7 +52,6 @@ try { // redirect to invoice if gateways requires if(isset($_GET['bb_redirect']) && isset($_GET['bb_invoice_hash'])) { $url = $di['url']->link('invoice/'.$_GET['bb_invoice_hash']); - var_dump($url);exit; header("Location: $url"); exit; } else { diff --git a/src/bb-library/Server/Manager/Virtualmin.php b/src/bb-library/Server/Manager/Virtualmin.php index bf0f76c2f..ee8a6414e 100644 --- a/src/bb-library/Server/Manager/Virtualmin.php +++ b/src/bb-library/Server/Manager/Virtualmin.php @@ -40,9 +40,9 @@ class Server_Manager_Virtualmin extends Server_Manager public function getLoginUrl() { if ($this->_config['secure']) { - return 'http://'.$this->_config['host'] . ':' . $this->_config['port'] . '/'; + return 'https://'.$this->_config['host'] . ':' . $this->_config['port'] . '/'; } else { - return 'https://'.$this->_config['host'] . ':' . $this->_config['port'] . '/'; + return 'http://'.$this->_config['host'] . ':' . $this->_config['port'] . '/'; } } @@ -710,4 +710,4 @@ class Server_Manager_Virtualmin extends Server_Manager return false; } -} \ No newline at end of file +} diff --git a/src/bb-modules/Email/Service.php b/src/bb-modules/Email/Service.php index cc5d33955..082447f7a 100644 --- a/src/bb-modules/Email/Service.php +++ b/src/bb-modules/Email/Service.php @@ -304,8 +304,7 @@ class Service implements \Box\InjectionAwareInterface $this->_logEmailToDb($email); //Logging to DB - $systemService = $this->di['mod_service']('system'); - $settings = $systemService->getEmailSettings(); + $settings = $this->di['mod_config']('email'); $transport = $this->di['array_get']($settings, 'mailer', 'sendmail'); if (APPLICATION_ENV == 'testing') { diff --git a/src/bb-modules/Extension/Service.php b/src/bb-modules/Extension/Service.php index 0de63d922..681f68a8e 100644 --- a/src/bb-modules/Extension/Service.php +++ b/src/bb-modules/Extension/Service.php @@ -192,8 +192,9 @@ class Service implements InjectionAwareInterface foreach ($result as $key => $value){ $iconPath = 'images/icons/middlenav/cog.png'; - if ($value['icon_url']){ - $iconPath = $this->di['config']['url'].$value['icon_url']; + $icon_url = $this->di['array_get']($value, 'icon_url'); + if ($icon_url){ + $iconPath = $this->di['config']['url'].$icon_url; } $result[$key]['icon_url'] = $iconPath; } diff --git a/src/bb-modules/Invoice/Service.php b/src/bb-modules/Invoice/Service.php index 2bd988ca4..c0692454f 100644 --- a/src/bb-modules/Invoice/Service.php +++ b/src/bb-modules/Invoice/Service.php @@ -1227,7 +1227,7 @@ class Service implements InjectionAwareInterface $invoice_info = __("Invoice number: ") . $invoice['nr'] . "\n" . __("Invoice date: ") . $invoiceDate . "\n" . __("Due date: ") . strftime($localeDateFormat, strtotime($invoice['due_at'])) . "\n" . - __("Invoice status: ") . $invoice['status']; + __("Invoice status: ") . ucfirst($invoice['status']); $pdf->SetFont('DejaVu', 'B', $font_size); $pdf->text($left + 15, 75, __("Invoice")); $pdf->SetFont('DejaVu', '', $font_size); @@ -1248,7 +1248,7 @@ class Service implements InjectionAwareInterface $pdf->SetXY(75, 70); $pdf->MultiCell(60, 10, "\n" . $company_info, 0, "L", 0); - $buyer_info = __("Name: ") . $invoice['buyer']['first_name'] . $invoice['buyer']['last_name'] . "\n" . + $buyer_info = __("Name: ") . $invoice['buyer']['first_name'].' ' . $invoice['buyer']['last_name'] . "\n" . __("Company: ") . $invoice['buyer']['company'] . "\n" . __("Address: ") . $invoice['buyer']['address'] . "\n" . __("Company VAT: ") . $invoice['seller']['company_vat'] . "\n" . diff --git a/src/bb-modules/Order/html_client/mod_order_list.phtml b/src/bb-modules/Order/html_client/mod_order_list.phtml index 6f05e1771..74ca5d430 100644 --- a/src/bb-modules/Order/html_client/mod_order_list.phtml +++ b/src/bb-modules/Order/html_client/mod_order_list.phtml @@ -42,9 +42,7 @@ {% trans 'The list is empty' %} - {% endfor %} - diff --git a/src/bb-modules/Page/html_client/mod_page_signup.phtml b/src/bb-modules/Page/html_client/mod_page_signup.phtml index bde8eef08..37f3f2b3e 100644 --- a/src/bb-modules/Page/html_client/mod_page_signup.phtml +++ b/src/bb-modules/Page/html_client/mod_page_signup.phtml @@ -232,7 +232,7 @@ bb.msg(data.error.message, 'error'); } } else { - bb.redirect('/'); + bb.redirect("{{ constant('BB_URL') }}"); } } }); diff --git a/src/bb-modules/Servicedomain/html_admin/mod_servicedomain_order.phtml b/src/bb-modules/Servicedomain/html_admin/mod_servicedomain_order.phtml index 6a2459cdc..459fb5dc5 100644 --- a/src/bb-modules/Servicedomain/html_admin/mod_servicedomain_order.phtml +++ b/src/bb-modules/Servicedomain/html_admin/mod_servicedomain_order.phtml @@ -9,7 +9,7 @@
-
+
  • {{ mf.selectboxtld('config[register_tld]', guest.serviceDomain_tlds({"allow_register":1})) }}
  • @@ -21,7 +21,7 @@
    -
    +
    • {{ mf.selectboxtld('config[transfer_tld]', guest.serviceDomain_tlds({"allow_transfer":1})) }}
    • diff --git a/src/bb-modules/Servicelicense/Server.php b/src/bb-modules/Servicelicense/Server.php index 28f2f2bd1..dcc2fc1f5 100644 --- a/src/bb-modules/Servicelicense/Server.php +++ b/src/bb-modules/Servicelicense/Server.php @@ -77,15 +77,20 @@ class Server implements \Box\InjectionAwareInterface private function getIp($checkProxy = true) { - $ip = NULL; + $ip = null; if ($checkProxy && $this->getServer('HTTP_CLIENT_IP') != null) { $ip = $this->getServer('HTTP_CLIENT_IP'); - } else if ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) { - $ip = $this->getServer('HTTP_X_FORWARDED_FOR'); } else { - $ip = $this->getServer('REMOTE_ADDR'); + if ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) { + $ip = $this->getServer('HTTP_X_FORWARDED_FOR'); + } else { + $ip = $this->getServer('REMOTE_ADDR'); + } } + $ips_arr = explode(',', $ip); + $ip = trim($ips_arr[0]); + return $ip; } diff --git a/src/bb-modules/Support/Service.php b/src/bb-modules/Support/Service.php index 3c0ec364e..c762026e9 100644 --- a/src/bb-modules/Support/Service.php +++ b/src/bb-modules/Support/Service.php @@ -863,6 +863,16 @@ class Service implements \Box\InjectionAwareInterface //@todo validate task params $rel_id = $this->di['array_get']($data, 'rel_id', NULL); $rel_type = $this->di['array_get']($data, 'rel_type', NULL); + + + if (!is_null($rel_id) && $rel_type == \Model_SupportTicket::REL_TYPE_ORDER) { + $orderService = $this->di['mod_service']('order'); + $o = $orderService->findForClientById($client, $rel_id); + if (!$o instanceof \Model_ClientOrder) { + throw new \Box_Exception('Order ID does not exist'); + } + } + $rel_task = $this->di['array_get']($data, 'rel_task', NULL); $rel_new_value = $this->di['array_get']($data, 'rel_new_value', NULL); $rel_status = isset($data['rel_task']) ? \Model_SupportTicket::REL_STATUS_PENDING : \Model_SupportTicket::REL_STATUS_COMPLETE; diff --git a/src/bb-modules/System/Service.php b/src/bb-modules/System/Service.php index 186aea5cf..23bffa446 100644 --- a/src/bb-modules/System/Service.php +++ b/src/bb-modules/System/Service.php @@ -735,7 +735,7 @@ class Service "GF" => "French Guiana", "PF" => "French Polynesia", "GA" => "Gabon", - "GB" => "Great Britain", + "GB" => "United Kingdom", "GM" => "Gambia", "GE" => "Georgia", "DE" => "Germany", @@ -1538,30 +1538,6 @@ class Service return $this->di['db']->getAssoc($query); } - public function getEmailSettings() - { - $params = array( - 'mailer', - 'smtp_authentication', - 'smtp_security', - 'smtp_port', - 'smtp_username', - 'smtp_password', - 'smtp_host', - ); - $res = $this->_getMultipleParams($params); - - return array( - 'mailer' => $this->di['array_get']($res, 'mailer', 'sendmail'), - 'smtp_authentication' => (isset($res['smtp_authentication']) && $res['smtp_authentication']) ? 'login' : NULL, - 'smtp_host' => $this->di['array_get']($res, 'smtp_host'), - 'smtp_security' => (isset($res['smtp_security']) && $res['smtp_security'] != 'no') ? $res['smtp_security'] : NULL, - 'smtp_port' => $this->di['array_get']($res, 'smtp_port'), - 'smtp_username' => $this->di['array_get']($res, 'smtp_username'), - 'smtp_password' => $this->di['array_get']($res, 'smtp_password'), - ); - } - public function getVersion() { return \Box_Version::VERSION; diff --git a/src/bb-modules/System/html_admin/mod_system_settings.phtml b/src/bb-modules/System/html_admin/mod_system_settings.phtml index c263b66dc..79bafb7cb 100644 --- a/src/bb-modules/System/html_admin/mod_system_settings.phtml +++ b/src/bb-modules/System/html_admin/mod_system_settings.phtml @@ -157,7 +157,7 @@ AD=Andorra AO=Angola AI=Anguilla AQ=Antarctica -AG=Antigua And Barbuda +AG=Antigua and Barbuda AR=Argentina AM=Armenia AW=Aruba @@ -175,10 +175,10 @@ BJ=Benin BM=Bermuda BT=Bhutan BO=Bolivia -BA=Bosnia And Herzegowina +BA=Bosnia and Herzegovina BW=Botswana BR=Brazil -BN=Brunei Darussalam +BN=Brunei BG=Bulgaria BF=Burkina Faso BI=Burundi @@ -195,7 +195,8 @@ CX=Christmas Island CC=Cocos (Keeling) Islands CO=Colombia KM=Comoros -CG=Congo +CG=Congo - Brazzaville +CD=Congo - Kinshasa CK=Cook Islands CR=Costa Rica CI=Cote D'Ivoire @@ -219,8 +220,10 @@ FO=Faroe Islands FJ=Fiji FI=Finland FR=France +GF=French Guiana +PF=French Polynesia GA=Gabon -GB=Great Britain +GB=United Kingdom GM=Gambia GE=Georgia DE=Germany @@ -254,18 +257,19 @@ JO=Jordan KZ=Kazakhstan KE=Kenya KI=Kiribati -KR=Korea, Republic Of KW=Kuwait KG=Kyrgyzstan +LA=Laos LV=Latvia LB=Lebanon LS=Lesotho LR=Liberia -LY=Libyan Arab Jamahiriya +LY=Libya LI=Liechtenstein LT=Lithuania LU=Luxembourg MO=Macau +MK=Macedonia MG=Madagascar MW=Malawi MY=Malaysia @@ -278,13 +282,14 @@ MR=Mauritania MU=Mauritius YT=Mayotte MX=Mexico -MD=Moldova, Republic Of +MD=Moldova MC=Monaco MN=Mongolia +ME=Montenegro MS=Montserrat MA=Morocco MZ=Mozambique -MM=Myanmar +MM=Myanmar (Burma) NA=Namibia NR=Nauru NP=Nepal @@ -307,14 +312,14 @@ PG=Papua New Guinea PY=Paraguay PE=Peru PH=Philippines -PN=Pitcairn +PN=Pitcairn Islands PL=Poland PT=Portugal PR=Puerto Rico QA=Qatar RE=Reunion RO=Romania -RU=Russian Federation +RU=Russia RW=Rwanda KN=Saint Kitts And Nevis LC=Saint Lucia @@ -323,6 +328,7 @@ SM=San Marino ST=Sao Tome And Principe SA=Saudi Arabia SN=Senegal +RS=Serbia SC=Seychelles SL=Sierra Leone SG=Singapore @@ -331,6 +337,7 @@ SI=Slovenia SB=Solomon Islands SO=Somalia ZA=South Africa +KR=South Korea ES=Spain LK=Sri Lanka SH=St. Helena @@ -340,7 +347,7 @@ SR=Suriname SZ=Swaziland SE=Sweden CH=Switzerland -SY=Syrian Arab Republic +SY=Syria TW=Taiwan TJ=Tajikistan TZ=Tanzania @@ -348,11 +355,11 @@ TH=Thailand TG=Togo TK=Tokelau TO=Tonga -TT=Trinidad And Tobago +TT=Trinidad and Tobago TN=Tunisia TR=Turkey TM=Turkmenistan -TC=Turks And Caicos Islands +TC=Turks and Caicos Islands TV=Tuvalu UG=Uganda UA=Ukraine @@ -360,9 +367,9 @@ AE=United Arab Emirates UY=Uruguay UZ=Uzbekistan VU=Vanuatu +VA=Vatican City VE=Venezuela -VN=Viet Nam -VG=Virgin Islands (British) +VN=Vietnam VI=Virgin Islands (U.S.) EH=Western Sahara YE=Yemen diff --git a/src/bb-themes/huraga/html/layout_default.phtml b/src/bb-themes/huraga/html/layout_default.phtml index 250a6cdde..a9762b214 100644 --- a/src/bb-themes/huraga/html/layout_default.phtml +++ b/src/bb-themes/huraga/html/layout_default.phtml @@ -52,71 +52,73 @@
      -
      -
        - {% set languages = guest.extension_languages %} - {% if languages|length > 1 %} - {% set currentLang = guest.system_locale %} - {% set countryCode = currentLang | slice(3, 2) %} -
      • -
        - - - {{ countryCode }} - + {% if settings.show_page_header %} +
        +
          + {% set languages = guest.extension_languages %} + {% if languages|length > 1 %} + {% set currentLang = guest.system_locale %} + {% set countryCode = currentLang | slice(3, 2) %} +
        • +
          + + + {{ countryCode }} + + +
            + {% for lang in languages %} + {% set countryCode = lang | slice(3, 2) %} + {% if lang != currentLang %} +
          • {{ lang | trans }}
          • + {% endif %} + {% endfor %} +
          +
          +
        • + + {% endif %} + + {% if settings.top_menu_dashboard %} +
        • + {% trans 'Dashboard' %} +
        • + {% endif %} + {% if settings.top_menu_order %} +
        • + {% trans 'Order services' %} +
        • + {% endif %} + {% if settings.top_menu_profile %} +
        • + {% trans 'Profile' %} +
        • + {% endif %} + + {% if settings.top_menu_signout %} +
        • + {% trans 'Sign out' %} +
        • + {% endif %} +
        +
        + + {% if settings.show_company_logo %} + {% if company.logo_url %} +

        + + {{company.name}} -
          - {% for lang in languages %} - {% set countryCode = lang | slice(3, 2) %} - {% if lang != currentLang %} -
        • {{ lang | trans }}
        • - {% endif %} - {% endfor %} -
        -

        -
      • - +

        + + {% endif %} {% endif %} - {% if settings.top_menu_dashboard %} -
      • - {% trans 'Dashboard' %} -
      • + {% if settings.show_company_name %} +

        {{company.name}}

        {% endif %} - {% if settings.top_menu_order %} -
      • - {% trans 'Order services' %} -
      • - {% endif %} - {% if settings.top_menu_profile %} -
      • - {% trans 'Profile' %} -
      • - {% endif %} - - {% if settings.top_menu_signout %} -
      • - {% trans 'Sign out' %} -
      • - {% endif %} -
      -
      - - {% if settings.show_company_logo %} - {% if company.logo_url %} -

      - - {{company.name}} - -

      -

      {% endif %} - {% endif %} - - {% if settings.show_company_name %} -

      {{company.name}}

      - {% endif %} -
      +
      diff --git a/src/bb-themes/huraga/html/partial_pagination.phtml b/src/bb-themes/huraga/html/partial_pagination.phtml index 50430ed6c..4c37084f1 100644 --- a/src/bb-themes/huraga/html/partial_pagination.phtml +++ b/src/bb-themes/huraga/html/partial_pagination.phtml @@ -4,11 +4,11 @@
      • - « + «
      • - +
      • {% for i in 1..list.pages %} @@ -22,11 +22,11 @@ {% endfor %}
      • - +
      • - » + »
      diff --git a/src/install/layout.phtml b/src/install/layout.phtml index 12f92a345..05649f8fb 100644 --- a/src/install/layout.phtml +++ b/src/install/layout.phtml @@ -5,7 +5,7 @@ BoxBilling setup - + diff --git a/tests/bb-modules/Email/ServiceTest.php b/tests/bb-modules/Email/ServiceTest.php index 7b5851123..f2ef01a87 100644 --- a/tests/bb-modules/Email/ServiceTest.php +++ b/tests/bb-modules/Email/ServiceTest.php @@ -551,15 +551,12 @@ class ServiceTest extends \BBTestCase 'smtp_password' => NULL, ); - $systemService = $this->getMockBuilder('\Box\Mod\System\Service')->setMethods(array('getEmailSettings'))->getMock(); - $systemService->expects($this->atLeastOnce()) - ->method('getEmailSettings') - ->will($this->returnValue($emailSettings)); - $di['db'] = $db; $di['mail'] = $mailMock; - $di['mod_service'] = $di->protect(function () use ($systemService) { - return $systemService; + + $config = array(); + $di['mod_config'] = $di->protect(function ($modName) use($config){ + return $config; }); $di['logger'] = $this->getMockBuilder('Box_Log')->getMock(); $di['array_get'] = $di->protect(function (array $array, $key, $default = null) use ($di) {