@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | return parent::dispatch(); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $backend |
|
| 31 | + */ |
|
| 29 | 32 | function setBackend($backend) |
| 30 | 33 | { |
| 31 | 34 | if ($backend == 'xmlrpcext') { |
@@ -74,6 +77,9 @@ discard block |
||
| 74 | 77 | return $backend; |
| 75 | 78 | } |
| 76 | 79 | |
| 80 | + /** |
|
| 81 | + * @return string |
|
| 82 | + */ |
|
| 77 | 83 | function getEncoding() |
| 78 | 84 | { |
| 79 | 85 | return $this->encoding = $this->backends[$this->getBackend()]; |
@@ -122,6 +128,9 @@ discard block |
||
| 122 | 128 | return ($this->backend == 'xmlrpcext'); |
| 123 | 129 | } |
| 124 | 130 | |
| 131 | + /** |
|
| 132 | + * @return string |
|
| 133 | + */ |
|
| 125 | 134 | function getResponse() |
| 126 | 135 | { |
| 127 | 136 | if ($this->isXmlRpcExt()) { |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $options = array( |
| 89 | - 'prefix' => $this->prefix . '.', |
|
| 89 | + 'prefix' => $this->prefix.'.', |
|
| 90 | 90 | 'encoding' => $this->getEncoding(), // $this->encoding |
| 91 | 91 | 'backend' => $this->getBackend()); |
| 92 | 92 | |
@@ -18,6 +18,9 @@ |
||
| 18 | 18 | private $subscriber; |
| 19 | 19 | private $credentials; |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param integer $list_id |
|
| 23 | + */ |
|
| 21 | 24 | private function factoryList($list_id) |
| 22 | 25 | { |
| 23 | 26 | $this->list = new NewsletterList($this->kernel, $list_id); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | if (!$this->subscriber->unsubscribe($email)) { |
| 75 | 75 | require_once 'XML/RPC2/Exception.php'; |
| 76 | - throw new XML_RPC2_FaultException('you could not unsubscribe with ' .$email, -4); |
|
| 76 | + throw new XML_RPC2_FaultException('you could not unsubscribe with '.$email, -4); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | return true; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | function getListIdFromOptinCode($credentials, $code) |
| 176 | 176 | { |
| 177 | 177 | $db = MDB2::singleton(DB_DSN); |
| 178 | - $result = $db->query('SELECT list_id FROM newsletter_subscriber WHERE code = ' . $db->quote($code, 'text')); |
|
| 178 | + $result = $db->query('SELECT list_id FROM newsletter_subscriber WHERE code = '.$db->quote($code, 'text')); |
|
| 179 | 179 | if ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
| 180 | 180 | return $row['list_id']; |
| 181 | 181 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | { |
| 194 | 194 | if (count($credentials) != 2) { // -4 |
| 195 | 195 | require_once 'XML/RPC2/Exception.php'; |
| 196 | - throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4); |
|
| 196 | + throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4); |
|
| 197 | 197 | } |
| 198 | 198 | if (empty($credentials['private_key'])) { // -5 |
| 199 | 199 | 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'; |
@@ -49,7 +49,6 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * Constructor |
| 51 | 51 | * |
| 52 | - * @param string $encoding The encoding wich the server recieves and returns data in |
|
| 53 | 52 | * |
| 54 | 53 | * @return void |
| 55 | 54 | */ |
@@ -62,7 +61,7 @@ discard block |
||
| 62 | 61 | * |
| 63 | 62 | * @param struct $credentials Credentials to use the server |
| 64 | 63 | * |
| 65 | - * @return array |
|
| 64 | + * @return boolean |
|
| 66 | 65 | */ |
| 67 | 66 | protected function checkCredentials($credentials) |
| 68 | 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'; |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | require_once 'Intraface/modules/accounting/Year.php'; |
| 16 | 16 | $year = new Year($this->kernel); |
| 17 | - $year->save(array('from_date' => date('Y') . '-01-01', 'to_date' => date('Y') . '-12-31', 'label' => 'test', 'locked' => 0, 'vat' => 1)); |
|
| 17 | + $year->save(array('from_date' => date('Y').'-01-01', 'to_date' => date('Y').'-12-31', 'label' => 'test', 'locked' => 0, 'vat' => 1)); |
|
| 18 | 18 | $year->createAccounts('standard'); |
| 19 | 19 | $year->setYear(); |
| 20 | 20 | } |
@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public function createInvoice() |
| 14 | 14 | { |
| 15 | - require_once dirname (__FILE__) . '/Contact.php'; |
|
| 15 | + require_once dirname(__FILE__).'/Contact.php'; |
|
| 16 | 16 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
| 17 | 17 | $contact_id = $contact->create(); |
| 18 | 18 | |
| 19 | - require_once dirname(__FILE__) . '/Product.php'; |
|
| 19 | + require_once dirname(__FILE__).'/Product.php'; |
|
| 20 | 20 | $product = new Install_Helper_Product($this->kernel, $this->db); |
| 21 | 21 | $product_id = $product->create(); |
| 22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | 'contact_id' => $contact_id, |
| 27 | 27 | 'description' => 'Test invoice', |
| 28 | 28 | 'this_date' => date('d-m-Y'), |
| 29 | - 'due_date' => date('d-m-Y', time()+14*60*60*24))); |
|
| 29 | + 'due_date' => date('d-m-Y', time() + 14*60*60*24))); |
|
| 30 | 30 | |
| 31 | 31 | $debtor->loadItem(); |
| 32 | 32 | $debtor->item->save(array('product_id' => $product_id, 'quantity' => 3, 'description' => 'Test description on product')); |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function createOrder() |
| 36 | 36 | { |
| 37 | - require_once dirname(__FILE__) . '/Contact.php'; |
|
| 37 | + require_once dirname(__FILE__).'/Contact.php'; |
|
| 38 | 38 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
| 39 | 39 | $contact_id = $contact->create(); |
| 40 | 40 | |
| 41 | - require_once dirname(__FILE__) . '/Product.php'; |
|
| 41 | + require_once dirname(__FILE__).'/Product.php'; |
|
| 42 | 42 | $product = new Install_Helper_Product($this->kernel, $this->db); |
| 43 | 43 | $product_id = $product->create(); |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | 'contact_id' => $contact_id, |
| 49 | 49 | 'description' => 'Test invoice', |
| 50 | 50 | 'this_date' => date('d-m-Y'), |
| 51 | - 'due_date' => date('d-m-Y', time()+14*60*60*24))); |
|
| 51 | + 'due_date' => date('d-m-Y', time() + 14*60*60*24))); |
|
| 52 | 52 | |
| 53 | 53 | $debtor->loadItem(); |
| 54 | 54 | $debtor->item->save(array('product_id' => $product_id, 'quantity' => 3, 'description' => 'Test description on product')); |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function createOrderFromShop() |
| 58 | 58 | { |
| 59 | - require_once dirname(__FILE__) . '/Contact.php'; |
|
| 59 | + require_once dirname(__FILE__).'/Contact.php'; |
|
| 60 | 60 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
| 61 | 61 | $contact_id = $contact->create(); |
| 62 | 62 | |
| 63 | - require_once dirname(__FILE__) . '/Product.php'; |
|
| 63 | + require_once dirname(__FILE__).'/Product.php'; |
|
| 64 | 64 | $product = new Install_Helper_Product($this->kernel, $this->db); |
| 65 | 65 | $product_id = $product->create(); |
| 66 | 66 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | 'contact_id' => $contact_id, |
| 71 | 71 | 'description' => 'From shop', |
| 72 | 72 | 'this_date' => date('d-m-Y'), |
| 73 | - 'due_date' => date('d-m-Y', time()+14*60*60*24)), 'webshop', 1); |
|
| 73 | + 'due_date' => date('d-m-Y', time() + 14*60*60*24)), 'webshop', 1); |
|
| 74 | 74 | |
| 75 | 75 | $debtor->loadItem(); |
| 76 | 76 | $debtor->item->save(array('product_id' => $product_id, 'quantity' => 3, 'description' => 'Test description on product')); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function loadPackages() |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/../database-module_package-values.sql'); |
|
| 22 | + $sql_structure = file_get_contents(dirname(__FILE__).'/../database-module_package-values.sql'); |
|
| 23 | 23 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
| 24 | 24 | |
| 25 | 25 | foreach ($sql_arr as $sql) { |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $variation->load(); |
| 97 | 97 | $detail = $variation->getDetail(); |
| 98 | 98 | $detail->price_difference = 0; /* Can be reimplemented: ($a1 * $a2); */ |
| 99 | - $detail->weight_difference = -1*($a1 * $a2); |
|
| 99 | + $detail->weight_difference = -1*($a1*$a2); |
|
| 100 | 100 | $detail->save(); |
| 101 | 101 | |
| 102 | 102 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function create() |
| 14 | 14 | { |
| 15 | - require_once dirname(__FILE__) . '/Contact.php'; |
|
| 15 | + require_once dirname(__FILE__).'/Contact.php'; |
|
| 16 | 16 | $contact = new Install_Helper_Contact($this->kernel, $this->db); |
| 17 | 17 | $contact_id = $contact->create(); |
| 18 | 18 | |