Finish 4.20

This commit is contained in:
4giedrius committed 2015-09-23 18:05:15 +03:00
commit 3bf960f76a
16 files changed
+126 -132

No files matched your search

-1
View File
@@ -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 {
+3 -3
View File
@@ -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;
}
}
}
+1 -2
View File
@@ -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') {
+3 -2
View File
@@ -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;
}
+2 -2
View File
@@ -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" .
@@ -42,9 +42,7 @@
<tr>
<td colspan="5">{% trans 'The list is empty' %}</td>
</tr>
{% endfor %}
</tbody>
</table>
@@ -232,7 +232,7 @@
bb.msg(data.error.message, 'error');
}
} else {
bb.redirect('/');
bb.redirect("{{ constant('BB_URL') }}");
}
}
});
@@ -9,7 +9,7 @@
<div class="rowElem domain-action domain-register">
<label>{% trans 'Register domain' %}:</label>
<div class="formRight moreFields">
<div class="formRight">
<ul>
<li style="width: 200px"><input type="text" name="config[register_sld]" value="{{ request.register_sld }}" placeholder="{% trans 'Domain name to register' %}"></li>
<li style="width: 90px">{{ mf.selectboxtld('config[register_tld]', guest.serviceDomain_tlds({"allow_register":1})) }}</li>
@@ -21,7 +21,7 @@
<div class="rowElem domain-action domain-transfer" style="display: none;">
<label>{% trans 'Transfer domain' %}:</label>
<div class="formRight moreFields">
<div class="formRight">
<ul>
<li style="width: 200px"><input type="text" name="config[transfer_sld]" value="{{ request.transfer_sld }}" placeholder="{% trans 'Domain name to transfer' %}"></li>
<li style="width: 90px">{{ mf.selectboxtld('config[transfer_tld]', guest.serviceDomain_tlds({"allow_transfer":1})) }}</li>
+9 -4
View File
@@ -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;
}
+10
View File
@@ -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;
+1 -25
View File
@@ -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;
@@ -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
+62 -60
View File
@@ -52,71 +52,73 @@
<div id="wrapper">
<header class="container" id="header">
<nav>
<ul class="f16">
{% set languages = guest.extension_languages %}
{% if languages|length > 1 %}
{% set currentLang = guest.system_locale %}
{% set countryCode = currentLang | slice(3, 2) %}
<li>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<span class="flag {{ countryCode | lower }}"></span>
{{ countryCode }}
<span class="caret"></span>
{% if settings.show_page_header %}
<nav>
<ul class="f16">
{% set languages = guest.extension_languages %}
{% if languages|length > 1 %}
{% set currentLang = guest.system_locale %}
{% set countryCode = currentLang | slice(3, 2) %}
<li>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<span class="flag {{ countryCode | lower }}"></span>
{{ countryCode }}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{% for lang in languages %}
{% set countryCode = lang | slice(3, 2) %}
{% if lang != currentLang %}
<li class="language_selector" data-language-code="{{ lang }}"><a href="javascript:;"> <span class="flag {{ countryCode | lower }}"></span> {{ lang | trans }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
</li>
{% endif %}
{% if settings.top_menu_dashboard %}
<li>
<a href="{{ ''|link }}" class="show-tip" title="{% trans 'Dashboard' %}">{% trans 'Dashboard' %}</a>
</li>
{% endif %}
{% if settings.top_menu_order %}
<li class="order-button">
<a href="#" class="show-tip" title="{% trans 'Order' %}">{% trans 'Order services' %}</a>
</li>
{% endif %}
{% if settings.top_menu_profile %}
<li>
<a href="{{ 'client/me'|link }}" class="show-tip" title="{% trans 'Profile' %}">{% trans 'Profile' %}</a>
</li>
{% endif %}
{% if settings.top_menu_signout %}
<li>
<a href="{{ 'client/logout' | link }}" class="show-tip" title="{% trans 'Sign out' %}">{% trans 'Sign out' %}</a>
</li>
{% endif %}
</ul>
</nav>
{% if settings.show_company_logo %}
{% if company.logo_url %}
<h1>
<a href="{{'/'|link }}">
<img src="{{company.logo_url}}" alt="{{company.name}}" title="{{company.name}}" style="max-height: 75px"/>
</a>
<ul class="dropdown-menu">
{% for lang in languages %}
{% set countryCode = lang | slice(3, 2) %}
{% if lang != currentLang %}
<li class="language_selector" data-language-code="{{ lang }}"><a href="javascript:;"> <span class="flag {{ countryCode | lower }}"></span> {{ lang | trans }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
</li>
<p></p>
</h1>
{% endif %}
{% endif %}
{% if settings.top_menu_dashboard %}
<li>
<a href="{{ ''|link }}" class="show-tip" title="{% trans 'Dashboard' %}">{% trans 'Dashboard' %}</a>
</li>
{% if settings.show_company_name %}
<p>{{company.name}}</p>
{% endif %}
{% if settings.top_menu_order %}
<li class="order-button">
<a href="#" class="show-tip" title="{% trans 'Order' %}">{% trans 'Order services' %}</a>
</li>
{% endif %}
{% if settings.top_menu_profile %}
<li>
<a href="{{ 'client/me'|link }}" class="show-tip" title="{% trans 'Profile' %}">{% trans 'Profile' %}</a>
</li>
{% endif %}
{% if settings.top_menu_signout %}
<li>
<a href="{{ 'client/logout' | link }}" class="show-tip" title="{% trans 'Sign out' %}">{% trans 'Sign out' %}</a>
</li>
{% endif %}
</ul>
</nav>
{% if settings.show_company_logo %}
{% if company.logo_url %}
<h1>
<a href="{{'/'|link }}">
<img src="{{company.logo_url}}" alt="{{company.name}}" title="{{company.name}}" style="max-height: 75px"/>
</a>
<p></p>
</h1>
{% endif %}
{% endif %}
{% if settings.show_company_name %}
<p>{{company.name}}</p>
{% endif %}
</header>
</header>
<section class="container" role="main">
<div class="navigation-block">
@@ -4,11 +4,11 @@
<div class="pagination pagination-centered">
<ul>
<li {% if not request.page or request.page == 1 %}class="disabled"{% endif %}>
<a href="{% if request.page and request.page != 1%}?page=1{% else %}#{% endif %}">«</a>
<a href="{% if request.page and request.page != 1%}?{% for k,v in {}|merge(request)|merge({'page': 1}) %}{{k}}={{v}}{% if loop.last == FALSE %}&{%endif%}{% endfor %}{% else %}#{% endif %}">«</a>
</li>
<li {% if not request.page or request.page == 1 %}class="disabled"{% endif %}>
<a href="{% if request.page and request.page != '1' %}?page={{ request.page - 1 }}{% else %}#{% endif %}"> <span class="awe-arrow-left"></span> </a>
<a href="{% if request.page and request.page != '1' %}?{% for k,v in {}|merge(request)|merge({'page': request.page - 1}) %}{{k}}={{v}}{% if loop.last == FALSE %}&{%endif%}{% endfor %}{% else %}#{% endif %}"> <span class="awe-arrow-left"></span> </a>
</li>
{% for i in 1..list.pages %}
@@ -22,11 +22,11 @@
{% endfor %}
<li {% if request.page == list.pages %}class="disabled"{% endif %}>
<a href="{% if request.page and request.page != list.pages %}?page={{ request.page + 1 }}{% elseif not request.page %}?page=2{% else %}#{% endif %}"><span class="awe-arrow-right"></span> </a>
<a href="{% if request.page and request.page != list.pages %}?{% for k,v in {}|merge(request)|merge({'page': request.page + 1}) %}{{k}}={{v}}{% if loop.last == FALSE %}&{%endif%}{% endfor %}{% elseif not request.page %}?{% for k,v in {}|merge(request)|merge({'page': 2}) %}{{k}}={{v}}{% if loop.last == FALSE %}&{%endif%}{% endfor %}{% else %}#{% endif %}"><span class="awe-arrow-right"></span> </a>
</li>
<li {% if request.page == list.pages %}class="disabled"{% endif %}>
<a href="{% if not request.page or request.page != list.pages %}?page={{ list.pages }}{% else %}#{% endif %}">»</a>
<a href="{% if not request.page or request.page != list.pages %}?{% for k,v in {}|merge(request)|merge({'page': list.pages}) %}{{k}}={{v}}{% if loop.last == FALSE %}&{%endif%}{% endfor %}{% else %}#{% endif %}">»</a>
</li>
</ul>
</div>
+1 -1
View File
@@ -5,7 +5,7 @@
<title>BoxBilling setup</title>
<base href="{{ constant('BB_URL_INSTALL') }}"/>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Cuprum" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Cuprum" rel="stylesheet" type="text/css" />
</head>
<body>
+4 -7
View File
@@ -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) {