diff --git a/.travis.yml b/.travis.yml index 63f7f52ee..df124d6a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,4 +53,4 @@ deploy: on: tags: true all_branches: true - php: 5.3 + php: 5.3 \ No newline at end of file diff --git a/build.xml b/build.xml index e53165fcc..c37e60803 100644 --- a/build.xml +++ b/build.xml @@ -90,7 +90,7 @@ - + diff --git a/src/bb-library/Box/TwigExtensions.php b/src/bb-library/Box/TwigExtensions.php index 2e9f44760..806bdef40 100644 --- a/src/bb-library/Box/TwigExtensions.php +++ b/src/bb-library/Box/TwigExtensions.php @@ -251,7 +251,7 @@ function twig_size_filter($value) function twig_markdown_filter(Twig_Environment $env, $value) { $markdownParser = new \Michelf\MarkdownExtra; - return $markdownParser->transform($value); + return $markdownParser->transform(htmlspecialchars($value, ENT_NOQUOTES)); } function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') diff --git a/src/bb-library/Model/ProductDomainTable.php b/src/bb-library/Model/ProductDomainTable.php index 1fe7bed78..dceae81d9 100644 --- a/src/bb-library/Model/ProductDomainTable.php +++ b/src/bb-library/Model/ProductDomainTable.php @@ -64,7 +64,9 @@ class Model_ProductDomainTable extends Model_ProductTable private function isFreeDomainSet($item) { - return isset($item['config']['free_domain']) && $item['config']['free_domain']; + if(isset($item['config']['free_domain']) && $item['config']['free_domain'] && isset($item['config']['free_domain_periods']) && in_array($item['config']['period'],$item['config']['free_domain_periods']) && isset($item['config']['free_tlds']) && in_array($item['config']['tld'],$item['config']['free_tlds'])) + { return true;} + else{ return false;} } private function registerDomainMatch($item, $config) diff --git a/src/bb-modules/Client/Service.php b/src/bb-modules/Client/Service.php index e8e906712..34bca119c 100644 --- a/src/bb-modules/Client/Service.php +++ b/src/bb-modules/Client/Service.php @@ -281,9 +281,9 @@ class Service implements InjectionAwareInterface $where = array(); $params = array(); if($search) { - $where[] = 'c.first_name LIKE %:first_name% OR c.last_name LIKE %:last_name% OR c.id LIKE :id'; - $params[':first_name'] = $search; - $params[':last_name'] = $search; + $where[] = 'c.first_name LIKE :first_name OR c.last_name LIKE :last_name OR c.id LIKE :id'; + $params[':first_name'] = "%".$search."%"; + $params[':last_name'] = "%".$search."%"; $params[':id'] = $search; } diff --git a/src/bb-modules/Kb/Service.php b/src/bb-modules/Kb/Service.php index b774394c2..5750b8fb6 100644 --- a/src/bb-modules/Kb/Service.php +++ b/src/bb-modules/Kb/Service.php @@ -46,7 +46,7 @@ class Service } if ($search) { - $sql .= " title LIKE :q OR content LIKE :q"; + $sql .= " AND title LIKE :q OR content LIKE :q"; $filter[':q'] = "%$search%"; } diff --git a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml index 0ca4442b3..92fcee6c5 100644 --- a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml +++ b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml @@ -4,6 +4,9 @@ {% trans 'Cart' %} {{ cart.items | length }} {% if cart.items %} + {% set cart = cart|merge({'total':0})%} + {% set temp_total_discount =0 %} + {% set temp_cart_total =0 %}
@@ -17,6 +20,7 @@ {% for i, item in cart.items %} + {% set temp_cart_total = temp_cart_total + (item.price*item.quantity) %} {{ item.title }} @@ -30,8 +34,14 @@ {% if item.discount_price %} + {% set temp_discount = (item.price * item.quantity ) %} + {% set temp_total_discount = temp_total_discount + temp_discount %} + {% set item = item|merge({'discount_price': temp_discount}) %} + {% set cart =cart|merge({'discount':temp_discount}) %} {{ (item.price * item.quantity) | money_convert }} {{ (item.price * item.quantity - item.discount_price) | money_convert }} + + {% else %} {{ (item.price * item.quantity) | money_convert }} {% endif %} @@ -97,6 +107,10 @@ {% endif %} {% endif %} + + {% set cart= cart|merge({'total':temp_cart_total})%} + {% set cart= cart|merge({'discount':temp_total_discount})%} + {% endfor %} @@ -137,7 +151,7 @@ {% if cart.discount >0 %} {% trans 'Subtotal:' %} - {{ (cart.total + cart.discount)| money_convert }} + {{ (cart.total)| money_convert }} {% trans 'Discount:' %} @@ -156,6 +170,7 @@ {% endif %} {% trans 'Total:' %} + {% set cart= cart|merge({'total':temp_cart_total - temp_total_discount})%} {{ (cart.total + tax_amount) | money_convert }} diff --git a/src/bb-modules/Servicecentovacast/Service.php b/src/bb-modules/Servicecentovacast/Service.php index d357b8012..d23d118f9 100644 --- a/src/bb-modules/Servicecentovacast/Service.php +++ b/src/bb-modules/Servicecentovacast/Service.php @@ -171,8 +171,8 @@ class Service implements \Box\InjectionAwareInterface 'timezone' => 'auto', 'allowproxy' => '0', 'charset' => 'ISO-8859-1', - 'servertype' => 'ShoutCast2', - 'sourcetype' => 'sctrans2', + 'servertype' => $pc['servertype'], + 'sourcetype' => $pc['sourcetype'], 'template' => $pc['template'], ); @@ -413,4 +413,4 @@ class Service implements \Box\InjectionAwareInterface { return $this->di['crypt']->encrypt($password, $this->_salt); } -} \ No newline at end of file +} diff --git a/src/bb-modules/Servicecentovacast/html_admin/mod_servicecentovacast_config.phtml b/src/bb-modules/Servicecentovacast/html_admin/mod_servicecentovacast_config.phtml index 73cf28986..0b7cc9633 100644 --- a/src/bb-modules/Servicecentovacast/html_admin/mod_servicecentovacast_config.phtml +++ b/src/bb-modules/Servicecentovacast/html_admin/mod_servicecentovacast_config.phtml @@ -21,6 +21,14 @@
+
+ +
+ +
+
+
+
@@ -56,7 +64,7 @@
- +
@@ -64,4 +72,4 @@ - \ No newline at end of file + diff --git a/src/bb-modules/Servicehosting/Service.php b/src/bb-modules/Servicehosting/Service.php index 5da294f15..47f3f3c18 100644 --- a/src/bb-modules/Servicehosting/Service.php +++ b/src/bb-modules/Servicehosting/Service.php @@ -260,7 +260,7 @@ class Service implements InjectionAwareInterface throw new \Box_Exception('Account password is missing or is not valid'); } - $u = $data['username']; + $u = strtolower($data['username']); if($this->_performOnService($order)){ list($adapter, $account) = $this->_getAM($model); diff --git a/src/bb-modules/Support/Service.php b/src/bb-modules/Support/Service.php index c762026e9..c2cebeafb 100644 --- a/src/bb-modules/Support/Service.php +++ b/src/bb-modules/Support/Service.php @@ -1156,12 +1156,12 @@ class Service implements \Box\InjectionAwareInterface { $data = $this->di['db']->toArray($model); $messages = array(); - $messagesArr = $this->di['db']->find('SupportPTicketMessage', 'support_p_ticket_id = :support_p_ticket_id', array(':support_p_ticket_id' => $model->id)); + $messagesArr = $this->di['db']->find('SupportPTicketMessage', 'support_p_ticket_id = :support_p_ticket_id ORDER BY id', array(':support_p_ticket_id' => $model->id)); foreach ($messagesArr as $msg) { $messages[] = $this->publicMessageToApiArray($msg); } - $first = $this->di['db']->findOne('SupportPTicketMessage', 'support_p_ticket_id = :support_p_ticket_id LIMIT 1', array(':support_p_ticket_id' => $model->id)); + $first = reset($messagesArr); if ($first instanceof \Model_SupportPTicketMessage) { $data['author'] = $this->publicMessageGetAuthorDetails($first); } else { diff --git a/src/bb-themes/admin_default/html/mod_order_manage.phtml b/src/bb-themes/admin_default/html/mod_order_manage.phtml index 87a0d2d68..bd6ffafa4 100644 --- a/src/bb-themes/admin_default/html/mod_order_manage.phtml +++ b/src/bb-themes/admin_default/html/mod_order_manage.phtml @@ -160,7 +160,7 @@
- +
diff --git a/src/bb-themes/admin_default/html/mod_servicehosting_config.phtml b/src/bb-themes/admin_default/html/mod_servicehosting_config.phtml index 062eb93de..a6be1befa 100644 --- a/src/bb-themes/admin_default/html/mod_servicehosting_config.phtml +++ b/src/bb-themes/admin_default/html/mod_servicehosting_config.phtml @@ -46,6 +46,23 @@
+ +
+ +
+ +
+
+
+
@@ -128,18 +145,23 @@ diff --git a/src/bb-themes/boxbilling/html/mod_cart_index.phtml b/src/bb-themes/boxbilling/html/mod_cart_index.phtml index 7f5861afd..12fde4e70 100644 --- a/src/bb-themes/boxbilling/html/mod_cart_index.phtml +++ b/src/bb-themes/boxbilling/html/mod_cart_index.phtml @@ -42,8 +42,8 @@ {{ item.period | period_title }} {% if item.discount_price %} - {{ item.price | money_convert }} - {{ (item.price - item.discount_price) | money_convert }} + {{ (item.price*item.quantity) | money_convert }} + {{ (item.price*item.quantity - item.discount_price*item.quantity) | money_convert }} {% else %} {{ item.price | money_convert }} {% endif %} @@ -96,7 +96,11 @@
{{ tax_amount | money_convert }}
{% endif %}

{% trans 'Total:' %}

-
{{ (cart.total + tax_amount) | money_convert }}
+
{% if cart.items[1].quantity > 1 and cart.items[1].discount_price%} + {{ (cart.total - (cart.items[1].price*(cart.items[1].quantity-1))) | money_convert }} + {%else%} + {{(cart.total + tax_amount) | money_convert }} + {%endif%}
{% set enough_in_balance = client.client_balance_get_total >= cart.total %} {% if cart.total and not enough_in_balance %} diff --git a/src/install/content_test.sql b/src/install/content_test.sql index ad413d07e..bbbe71d11 100644 --- a/src/install/content_test.sql +++ b/src/install/content_test.sql @@ -419,7 +419,7 @@ VALUES (7,3,7,NULL,'BoxBilling license','boxbilling-license','BoxBilling license','product',1,'enabled',0,0,'after_payment','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,70,'{\"prefix\":\"BOX-PRO-\", \"length\":25, \"plugin\":\"Default\"}','2012-01-01 12:00:00','2012-01-01 12:00:00','license'), (8,3,8,NULL,'Free BoxBilling license','free-license','Free BoxBilling license','product',1,'enabled',0,0,'after_order','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,70,'{\"prefix\":\"BOX-FREE-\", \"length\":25, \"plugin\":\"Default\"}','2012-01-01 12:00:00','2012-01-01 12:00:00','license'), (9,1,9,NULL,'My Demo software','boxbilling-software','My Demo software description','product',1,'enabled',0,0,'after_payment','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,60,'{\"filename\":\"test.txt\"}','2012-01-01 12:00:00','2012-01-01 12:00:00','downloadable'), - (10,2,10,NULL,'Shared Hosting','shared-hosting','Shared hosting description','product',1,'enabled',0,0,'after_payment','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,2,'{\"server_id\":\"1\", \"hosting_plan_id\":\"1\", \"reseller\":0}','2012-01-01 12:00:00','2012-01-01 12:00:00','hosting'), + (10,2,10,NULL,'Shared Hosting','shared-hosting','Shared hosting description','product',1,'enabled',0,0,'after_payment','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,2,'{\"server_id\":\"1\", \"hosting_plan_id\":\"1\", \"reseller\":0,\"free_domain_periods\":[\"3M\"],\"free_domain\":\"1\",\"free_tlds\":[\".com\"]}','2012-01-01 12:00:00','2012-01-01 12:00:00','hosting'), (11,2,11,NULL,'Gold Hosting','reseller-hosting','Reseller hosting description','product',1,'enabled',0,0,'after_payment','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,3,'{\"server_id\":\"1\", \"hosting_plan_id\":\"1\", \"reseller\":1}','2012-01-01 12:00:00','2012-01-01 12:00:00','hosting'), (12,5,NULL,NULL,'All domains','domain-checker','Choose domains','product',1,'enabled',0,0,'after_payment','[4,5,6]',NULL,0,0,0,NULL,NULL,NULL,1,'{\"all_tlds\":1}','2012-01-01 12:00:00','2012-01-01 12:00:00','domain'), (13,4,12,NULL,'Forum membership','forum-membership','Register for our forum membership','product',1,'enabled',0,0,'after_payment',NULL,NULL,0,0,0,NULL,NULL,NULL,10,NULL,'2012-01-01 12:00:00','2012-01-01 12:00:00','membership'); diff --git a/tests/fixtures/mod_cart.xml b/tests/fixtures/mod_cart.xml index ea339f62a..a7bbe31f3 100644 --- a/tests/fixtures/mod_cart.xml +++ b/tests/fixtures/mod_cart.xml @@ -45,7 +45,7 @@ - + diff --git a/tests/fixtures/orders.xml b/tests/fixtures/orders.xml index be15f0457..0820dab4f 100644 --- a/tests/fixtures/orders.xml +++ b/tests/fixtures/orders.xml @@ -41,7 +41,7 @@ - +