@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Constructor |
27 | 27 | * |
28 | - * @param $session_id Session id |
|
28 | + * @param string $session_id Session id |
|
29 | 29 | * @param $intranet Intranet |
30 | 30 | * |
31 | 31 | * @return void |
@@ -9,6 +9,9 @@ |
||
9 | 9 | */ |
10 | 10 | class Intraface_XMLRPC_CMS_Server0300 extends Intraface_XMLRPC_Server0100 |
11 | 11 | { |
12 | + /** |
|
13 | + * @param integer $site_id |
|
14 | + */ |
|
12 | 15 | private function factory($site_id) |
13 | 16 | { |
14 | 17 | if (!$this->kernel->weblogin->hasModuleAccess('cms')) { // -2 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | * niveau 9999 g�r at den ikke kan genkende den, og tager top_level. |
68 | 68 | * 0 der ellers skulle v�re topmenu virker af en m�rkelig grund ikke. Variablen er ikke registeret som sat! |
69 | 69 | */ |
70 | - $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
70 | + $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
71 | 71 | $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel' |
72 | 72 | $cmspage->value['sections'] = $cmspage->collect(); |
73 | 73 | $cmspage->value['comments'] = $cmspage->getComments(); |
@@ -9,6 +9,9 @@ |
||
9 | 9 | */ |
10 | 10 | class Intraface_XMLRPC_CMS_Server0300 extends Intraface_XMLRPC_Server0100 |
11 | 11 | { |
12 | + /** |
|
13 | + * @param integer $site_id |
|
14 | + */ |
|
12 | 15 | private function factory($site_id) |
13 | 16 | { |
14 | 17 | if (!$this->kernel->weblogin->hasModuleAccess('cms')) { // -2 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // level 9999 cannot be recognized, so we take top level |
64 | 64 | // 0 which should be top level does not work - the variable is not set |
65 | 65 | |
66 | - $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
66 | + $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
67 | 67 | $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel' |
68 | 68 | $cmspage->value['sections'] = $cmspage->collect(); |
69 | 69 | $cmspage->value['comments'] = $cmspage->getComments(); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $this->factory($site_id); |
146 | 146 | |
147 | 147 | $cmspage = new CMS_Page($this->site); |
148 | - $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
148 | + $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
149 | 149 | $value['sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel' |
150 | 150 | |
151 | 151 | return $this->prepareResponseData($value); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * |
62 | 62 | * @param struct $credentials Credentials to use the server |
63 | 63 | * |
64 | - * @return array |
|
64 | + * @return boolean |
|
65 | 65 | */ |
66 | 66 | protected function checkCredentials($credentials) |
67 | 67 | { |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | if (count($credentials) != 2) { // -4 |
71 | 71 | require_once 'XML/RPC2/Exception.php'; |
72 | - throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4); |
|
72 | + throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4); |
|
73 | 73 | } |
74 | 74 | if (empty($credentials['private_key'])) { // -5 |
75 | 75 | require_once 'XML/RPC2/Exception.php'; |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * |
62 | 62 | * @param struct $credentials Credentials to use the server |
63 | 63 | * |
64 | - * @return array |
|
64 | + * @return boolean |
|
65 | 65 | */ |
66 | 66 | protected function checkCredentials($credentials) |
67 | 67 | { |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | if (count($credentials) != 2) { // -4 |
71 | 71 | require_once 'XML/RPC2/Exception.php'; |
72 | - throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4); |
|
72 | + throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4); |
|
73 | 73 | } |
74 | 74 | if (empty($credentials['private_key'])) { // -5 |
75 | 75 | require_once 'XML/RPC2/Exception.php'; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | * @param string $text Extra text to the itemline |
261 | 261 | * @param integer $product_detail_id Product detail id |
262 | 262 | * |
263 | - * @return mixed |
|
263 | + * @return boolean |
|
264 | 264 | */ |
265 | 265 | public function changeProductInBasket($credentials, $product_id, $quantity, $text = '', $product_detail_id = 0) |
266 | 266 | { |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | * |
608 | 608 | * @param struct $credentials Credentials to use the server |
609 | 609 | * |
610 | - * @return array |
|
610 | + * @return boolean |
|
611 | 611 | */ |
612 | 612 | private function checkCredentials($credentials) |
613 | 613 | { |
@@ -57,34 +57,34 @@ discard block |
||
57 | 57 | |
58 | 58 | |
59 | 59 | // sublevel has to be used so other searches are not overwritten |
60 | - $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' . md5($this->credentials['session_id']), 'sublevel'); |
|
60 | + $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel'); |
|
61 | 61 | $debug2 = serialize($mixed); |
62 | 62 | if (isset($mixed['offset']) and array_key_exists('offset', $mixed) and is_numeric($mixed['offset'])) { |
63 | 63 | $product->getDBQuery()->useStored(true); |
64 | 64 | $product->getDBQuery()->setPagingOffset((int)$mixed['offset']); |
65 | - $debug2 .= 'offset ' . $mixed['offset']; |
|
65 | + $debug2 .= 'offset '.$mixed['offset']; |
|
66 | 66 | } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') { |
67 | 67 | $product->getDBQuery()->useStored(true); |
68 | 68 | $debug2 .= 'use_stored true'; |
69 | 69 | } else { |
70 | 70 | if (isset($mixed['search']) and array_key_exists('search', $mixed) and !empty($mixed['search'])) { |
71 | 71 | $product->getDBQuery()->setFilter('search', $mixed['search']); |
72 | - $debug2 .= 'search ' . $mixed['search']; |
|
72 | + $debug2 .= 'search '.$mixed['search']; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if (isset($mixed['keywords']) and array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) { |
76 | 76 | $product->getDBQuery()->setFilter('keywords', $mixed['keywords']); |
77 | - $debug2 .= 'keyword ' . $mixed['keywords']; |
|
77 | + $debug2 .= 'keyword '.$mixed['keywords']; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) { |
81 | 81 | $product->getDBQuery()->setFilter('ids', $mixed['ids']); |
82 | - $debug2 .= 'ids ' . implode(', ', $mixed['ids']); |
|
82 | + $debug2 .= 'ids '.implode(', ', $mixed['ids']); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | if (isset($mixed['sorting']) and array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) { |
86 | 86 | $product->getDBQuery()->setFilter('sorting', $mixed['sorting']); |
87 | - $debug2 .= 'sorting ' . $mixed['sorting']; |
|
87 | + $debug2 .= 'sorting '.$mixed['sorting']; |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | if (PEAR::isError($db)) { |
178 | 178 | require_once 'XML/RPC2/Exception.php'; |
179 | - throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1); |
|
179 | + throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | $featured = new Intraface_Webshop_FeaturedProducts($this->kernel->intranet, $db); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | if (!$order_id = $this->webshop->placeOrder($values)) { |
349 | 349 | require_once 'XML/RPC2/Exception.php'; |
350 | - throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
350 | + throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | return $order_id; |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | if (!$payment_id = $onlinepayment->save($values)) { |
386 | 386 | require_once 'XML/RPC2/Exception.php'; |
387 | - throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
387 | + throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | return $payment_id; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | if (!$payment_id = $onlinepayment->create()) { |
417 | 417 | require_once 'XML/RPC2/Exception.php'; |
418 | - throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
418 | + throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | return $payment_id; |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | |
445 | 445 | if (!$this->webshop->basket->saveAddress($values)) { |
446 | 446 | require_once 'XML/RPC2/Exception.php'; |
447 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
447 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | return true; |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $customer_coupon = $this->utf8Decode($customer_coupon); |
484 | 484 | if (!$this->webshop->basket->saveCustomerCoupon($customer_coupon)) { |
485 | 485 | require_once 'XML/RPC2/Exception.php'; |
486 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
486 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | return true; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $customer_ean = $this->utf8Decode($customer_ean); |
524 | 524 | if (!$this->webshop->basket->saveCustomerEan($customer_ean)) { |
525 | 525 | require_once 'XML/RPC2/Exception.php'; |
526 | - throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
526 | + throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
527 | 527 | } |
528 | 528 | |
529 | 529 | return true; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $customer_comment = $this->utf8Decode($customer_comment); |
564 | 564 | if (!$this->webshop->basket->saveCustomerComment($customer_comment)) { |
565 | 565 | require_once 'XML/RPC2/Exception.php'; |
566 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
566 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | return true; |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | |
616 | 616 | if (count($credentials) != 2) { // -4 |
617 | 617 | require_once 'XML/RPC2/Exception.php'; |
618 | - throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4); |
|
618 | + throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4); |
|
619 | 619 | } |
620 | 620 | if (empty($credentials['private_key'])) { // -5 |
621 | 621 | require_once 'XML/RPC2/Exception.php'; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | return $this->prepareResponseData($product->getRelatedProducts()); |
234 | 234 | } |
235 | 235 | |
236 | - /** |
|
236 | + /** |
|
237 | 237 | * Gets featured products |
238 | 238 | * |
239 | 239 | * Method is experimental and only used by discimport.dk. If you need to use it |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | } |
280 | 280 | |
281 | - /** |
|
281 | + /** |
|
282 | 282 | * Gets product keywords which can be used to sort ones webshop |
283 | 283 | * |
284 | 284 | * |
@@ -250,6 +250,7 @@ discard block |
||
250 | 250 | * Formats array to return from product list from Doctrine |
251 | 251 | * |
252 | 252 | * @param object $doctrine_products Doctrine_Collection |
253 | + * @param integer $attribute_id |
|
253 | 254 | * @return array with products |
254 | 255 | */ |
255 | 256 | private function createDoctrineProductsListArray($doctrine_products, $attribute_id = null) |
@@ -563,7 +564,6 @@ discard block |
||
563 | 564 | * |
564 | 565 | * @param struct $credentials Credentials to use the server |
565 | 566 | * @param integer $shop_id Id for the shop |
566 | - * @param integer $id Product id |
|
567 | 567 | * |
568 | 568 | * @return array |
569 | 569 | */ |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | * |
742 | 742 | * @param struct $credentials Credentials to use the server |
743 | 743 | * @param integer $shop_id Id for the shop |
744 | - * @param integer $produt_id Product id to add |
|
744 | + * @param integer $product_id Product id to add |
|
745 | 745 | * @param integer $product_variation_id Product variation id to change |
746 | 746 | * @param integer $quantity Optional quantity |
747 | 747 | * @param string $text Extra text to the itemline |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | * @param string $text Extra text to the itemline |
785 | 785 | * @param integer $product_detail_id Product detail id |
786 | 786 | * |
787 | - * @return mixed |
|
787 | + * @return boolean |
|
788 | 788 | */ |
789 | 789 | public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0) |
790 | 790 | { |
@@ -1238,6 +1238,7 @@ discard block |
||
1238 | 1238 | /** |
1239 | 1239 | * Initialize the webshop |
1240 | 1240 | * |
1241 | + * @param integer $shop_id |
|
1241 | 1242 | * @return void |
1242 | 1243 | */ |
1243 | 1244 | private function _factoryWebshop($shop_id) |
@@ -74,40 +74,40 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | // sublevel has to be used so other searches are not overwritten |
77 | - $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' . md5($this->credentials['session_id']), 'sublevel'); |
|
77 | + $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel'); |
|
78 | 78 | $debug2 = serialize($mixed); |
79 | 79 | if (isset($mixed['offset']) and is_numeric($mixed['offset']) and $mixed['offset'] > 0) { |
80 | 80 | $product->getDBQuery()->useStored(true); |
81 | 81 | $product->getDBQuery()->setPagingOffset((int)$mixed['offset']); |
82 | - $debug2 .= 'offset ' . $mixed['offset']; |
|
82 | + $debug2 .= 'offset '.$mixed['offset']; |
|
83 | 83 | } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') { |
84 | 84 | $product->getDBQuery()->useStored(true); |
85 | 85 | $debug2 .= 'use_stored true'; |
86 | 86 | } else { |
87 | 87 | if (array_key_exists('search', $mixed) and !empty($mixed['search'])) { |
88 | 88 | $product->getDBQuery()->setFilter('search', $mixed['search']); |
89 | - $debug2 .= 'search ' . $mixed['search']; |
|
89 | + $debug2 .= 'search '.$mixed['search']; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) { |
93 | 93 | $product->getDBQuery()->setFilter('keywords', $mixed['keywords']); |
94 | - $debug2 .= 'keyword ' . $mixed['keywords']; |
|
94 | + $debug2 .= 'keyword '.$mixed['keywords']; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | if (array_key_exists('category', $mixed) and !empty($mixed['category'])) { |
98 | 98 | $product->getDBQuery()->setFilter('shop_id', $shop_id); |
99 | 99 | $product->getDBQuery()->setFilter('category', $mixed['category']); |
100 | - $debug2 .= 'category ' . $mixed['category']; |
|
100 | + $debug2 .= 'category '.$mixed['category']; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) { |
104 | 104 | $product->getDBQuery()->setFilter('ids', $mixed['ids']); |
105 | - $debug2 .= 'ids ' . implode(', ', $mixed['ids']); |
|
105 | + $debug2 .= 'ids '.implode(', ', $mixed['ids']); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) { |
109 | 109 | $product->getDBQuery()->setFilter('sorting', $mixed['sorting']); |
110 | - $debug2 .= 'sorting ' . $mixed['sorting']; |
|
110 | + $debug2 .= 'sorting '.$mixed['sorting']; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | |
614 | 614 | if (PEAR::isError($db)) { |
615 | 615 | require_once 'XML/RPC2/Exception.php'; |
616 | - throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1); |
|
616 | + throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1); |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | $featured = new Intraface_modules_shop_FeaturedProducts($this->kernel->intranet, $this->webshop->getShop(), $db); |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | |
879 | 879 | if (!$order_id = $this->webshop->placeOrder($values)) { |
880 | 880 | require_once 'XML/RPC2/Exception.php'; |
881 | - throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
881 | + throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
882 | 882 | } |
883 | 883 | |
884 | 884 | return $this->prepareResponseData($this->webshop->getOrderIdentifierKey()); |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | |
909 | 909 | if (!$this->webshop->getBasket()->saveAddress($values)) { |
910 | 910 | require_once 'XML/RPC2/Exception.php'; |
911 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
911 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
912 | 912 | } |
913 | 913 | |
914 | 914 | return $this->prepareResponseData(true); |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | $customer_coupon = $this->processRequestData($customer_coupon); |
950 | 950 | if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) { |
951 | 951 | require_once 'XML/RPC2/Exception.php'; |
952 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
952 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
953 | 953 | } |
954 | 954 | |
955 | 955 | return $this->prepareResponseData(true); |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | $customer_ean = $this->processRequestData($customer_ean); |
991 | 991 | if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) { |
992 | 992 | require_once 'XML/RPC2/Exception.php'; |
993 | - throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
993 | + throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
994 | 994 | } |
995 | 995 | |
996 | 996 | return $this->prepareResponseData(true); |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | $customer_comment = $this->processRequestData($customer_comment); |
1033 | 1033 | if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) { |
1034 | 1034 | require_once 'XML/RPC2/Exception.php'; |
1035 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1035 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | return $this->prepareResponseData(true); |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | $payment_method = $this->processRequestData($payment_method); |
1092 | 1092 | if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) { |
1093 | 1093 | require_once 'XML/RPC2/Exception.php'; |
1094 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1094 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
1095 | 1095 | } |
1096 | 1096 | |
1097 | 1097 | return $this->prepareResponseData(true); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | return $this->prepareResponseData($product->getRelatedProducts()); |
234 | 234 | } |
235 | 235 | |
236 | - /** |
|
236 | + /** |
|
237 | 237 | * Gets featured products |
238 | 238 | * |
239 | 239 | * Method is experimental and only used by discimport.dk. If you need to use it |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | } |
280 | 280 | |
281 | - /** |
|
281 | + /** |
|
282 | 282 | * Gets product keywords which can be used to sort ones webshop |
283 | 283 | * |
284 | 284 | * |
@@ -212,7 +212,6 @@ discard block |
||
212 | 212 | * |
213 | 213 | * @param struct $credentials Credentials to use the server |
214 | 214 | * @param integer $shop_id Id for the shop |
215 | - * @param integer $id Product id |
|
216 | 215 | * |
217 | 216 | * @return array |
218 | 217 | */ |
@@ -328,7 +327,7 @@ discard block |
||
328 | 327 | * |
329 | 328 | * @param struct $credentials Credentials to use the server |
330 | 329 | * @param integer $shop_id Id for the shop |
331 | - * @param integer $produt_id Product id to add |
|
330 | + * @param integer $product_id Product id to add |
|
332 | 331 | * @param integer $product_variation_id Product variation id to change |
333 | 332 | * @param integer $quantity Optional quantity |
334 | 333 | * @param string $text Extra text to the itemline |
@@ -371,7 +370,7 @@ discard block |
||
371 | 370 | * @param string $text Extra text to the itemline |
372 | 371 | * @param integer $product_detail_id Product detail id |
373 | 372 | * |
374 | - * @return mixed |
|
373 | + * @return boolean |
|
375 | 374 | */ |
376 | 375 | public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0) |
377 | 376 | { |
@@ -791,6 +790,7 @@ discard block |
||
791 | 790 | /** |
792 | 791 | * Initialize the webshop |
793 | 792 | * |
793 | + * @param integer $shop_id |
|
794 | 794 | * @return void |
795 | 795 | */ |
796 | 796 | private function _factoryWebshop($shop_id) |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | return $this->prepareResponseData($product->getRelatedProducts()); |
234 | 234 | } |
235 | 235 | |
236 | - /** |
|
236 | + /** |
|
237 | 237 | * Gets featured products |
238 | 238 | * |
239 | 239 | * Method is experimental and only used by discimport.dk. If you need to use it |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | } |
280 | 280 | |
281 | - /** |
|
281 | + /** |
|
282 | 282 | * Gets product keywords which can be used to sort ones webshop |
283 | 283 | * |
284 | 284 | * |
@@ -60,40 +60,40 @@ discard block |
||
60 | 60 | |
61 | 61 | |
62 | 62 | // sublevel has to be used so other searches are not overwritten |
63 | - $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' . md5($this->credentials['session_id']), 'sublevel'); |
|
63 | + $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel'); |
|
64 | 64 | $debug2 = serialize($mixed); |
65 | 65 | if (isset($mixed['offset']) and array_key_exists('offset', $mixed) and is_numeric($mixed['offset'])) { |
66 | 66 | $product->getDBQuery()->useStored(true); |
67 | 67 | $product->getDBQuery()->setPagingOffset((int)$mixed['offset']); |
68 | - $debug2 .= 'offset ' . $mixed['offset']; |
|
68 | + $debug2 .= 'offset '.$mixed['offset']; |
|
69 | 69 | } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') { |
70 | 70 | $product->getDBQuery()->useStored(true); |
71 | 71 | $debug2 .= 'use_stored true'; |
72 | 72 | } else { |
73 | 73 | if (array_key_exists('search', $mixed) and !empty($mixed['search'])) { |
74 | 74 | $product->getDBQuery()->setFilter('search', $mixed['search']); |
75 | - $debug2 .= 'search ' . $mixed['search']; |
|
75 | + $debug2 .= 'search '.$mixed['search']; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if (array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) { |
79 | 79 | $product->getDBQuery()->setFilter('keywords', $mixed['keywords']); |
80 | - $debug2 .= 'keyword ' . $mixed['keywords']; |
|
80 | + $debug2 .= 'keyword '.$mixed['keywords']; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if (array_key_exists('category', $mixed) and !empty($mixed['category'])) { |
84 | 84 | $product->getDBQuery()->setFilter('shop_id', $shop_id); |
85 | 85 | $product->getDBQuery()->setFilter('category', $mixed['category']); |
86 | - $debug2 .= 'category ' . $mixed['category']; |
|
86 | + $debug2 .= 'category '.$mixed['category']; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) { |
90 | 90 | $product->getDBQuery()->setFilter('ids', $mixed['ids']); |
91 | - $debug2 .= 'ids ' . implode(', ', $mixed['ids']); |
|
91 | + $debug2 .= 'ids '.implode(', ', $mixed['ids']); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | if (array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) { |
95 | 95 | $product->getDBQuery()->setFilter('sorting', $mixed['sorting']); |
96 | - $debug2 .= 'sorting ' . $mixed['sorting']; |
|
96 | + $debug2 .= 'sorting '.$mixed['sorting']; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | 'name' => $variation->getName(), |
197 | 197 | 'attributes' => $attributes_array, |
198 | 198 | 'identifier' => $attribute_string, |
199 | - 'price_incl_vat' => round(($product->get('price') + $detail->getPriceDifference()) * (1 + $product->get('vat_percent')/100), 2), |
|
199 | + 'price_incl_vat' => round(($product->get('price') + $detail->getPriceDifference())*(1 + $product->get('vat_percent')/100), 2), |
|
200 | 200 | 'weight' => $product->get('weight') + $detail->getWeightDifference() |
201 | 201 | ), |
202 | 202 | 'stock' => $variation->getStock($product)->get() |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | if (PEAR::isError($db)) { |
258 | 258 | require_once 'XML/RPC2/Exception.php'; |
259 | - throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1); |
|
259 | + throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $featured = new Intraface_modules_shop_FeaturedProducts($this->kernel->intranet, $this->webshop->getShop(), $db); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | |
460 | 460 | if (!$order_id = $this->webshop->placeOrder($values)) { |
461 | 461 | require_once 'XML/RPC2/Exception.php'; |
462 | - throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
462 | + throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | return $this->prepareResponseData($this->webshop->getOrderIdentifierKey()); |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | |
490 | 490 | if (!$this->webshop->getBasket()->saveAddress($values)) { |
491 | 491 | require_once 'XML/RPC2/Exception.php'; |
492 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
492 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
493 | 493 | } |
494 | 494 | |
495 | 495 | return $this->prepareResponseData(true); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $customer_coupon = $this->processRequestData($customer_coupon); |
531 | 531 | if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) { |
532 | 532 | require_once 'XML/RPC2/Exception.php'; |
533 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
533 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | return $this->prepareResponseData(true); |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | $customer_ean = $this->processRequestData($customer_ean); |
572 | 572 | if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) { |
573 | 573 | require_once 'XML/RPC2/Exception.php'; |
574 | - throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
574 | + throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | return $this->prepareResponseData(true); |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | $customer_comment = $this->processRequestData($customer_comment); |
614 | 614 | if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) { |
615 | 615 | require_once 'XML/RPC2/Exception.php'; |
616 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
616 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | return $this->prepareResponseData(true); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | $payment_method = $this->processRequestData($payment_method); |
673 | 673 | if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) { |
674 | 674 | require_once 'XML/RPC2/Exception.php'; |
675 | - throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
675 | + throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4); |
|
676 | 676 | } |
677 | 677 | |
678 | 678 | return $this->prepareResponseData(true); |
@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | $this->value['saldo'] = 100; |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $type |
|
53 | + */ |
|
51 | 54 | function getSaldo($type, $date_from, $date_to) |
52 | 55 | { |
53 | 56 | |
@@ -79,6 +82,9 @@ discard block |
||
79 | 82 | return 1; |
80 | 83 | } |
81 | 84 | |
85 | + /** |
|
86 | + * @param integer $id |
|
87 | + */ |
|
82 | 88 | function getAccount($id) |
83 | 89 | { |
84 | 90 | return new FakeVatPeriodAccount(new FakeVatPeriodYear, $id); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | // ganges med -1 for at f� rigtigt fortegn til udregning |
106 | 106 | $this->value['saldo_vat_out'] = $account_vat_in->get('saldo'); |
107 | - $saldo_total += -1 * $this->value['saldo_vat_out']; // total |
|
107 | + $saldo_total += -1*$this->value['saldo_vat_out']; // total |
|
108 | 108 | |
109 | 109 | |
110 | 110 | // Moms af varek�b i udlandet |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // ganges med -1 for at f� rigtigt fortegn til udregning |
117 | 117 | $this->value['saldo_vat_abroad'] = $account_vat_abroad->get('saldo'); |
118 | - $saldo_total += -1 * $this->value['saldo_vat_abroad']; |
|
118 | + $saldo_total += -1*$this->value['saldo_vat_abroad']; |
|
119 | 119 | |
120 | 120 | // K�bsmoms |
121 | 121 | // K�bsmomsen inkluderer ogs� den udregnede moms af moms af varek�b i udlandet. |