Completed
Push — master ( 9d10c2...bf46e5 )
by Lars
05:14
created
src/Intraface/modules/invoice/Reminder.php 3 patches
Doc Comments   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,6 +36,9 @@  discard block
 block discarded – undo
36 36
         return $this->dbquery;
37 37
     }
38 38
 
39
+    /**
40
+     * @param string $type
41
+     */
39 42
     function getItems($type = null)
40 43
     {
41 44
         $this->loadItem();
@@ -297,7 +300,8 @@  discard block
 block discarded – undo
297 300
     /**
298 301
      * Sets status for the reminder
299 302
      *
300
-     * @return true / false
303
+     * @param string $status
304
+     * @return boolean / false
301 305
      */
302 306
     function setStatus($status)
303 307
     {
@@ -356,7 +360,7 @@  discard block
 block discarded – undo
356 360
     /**
357 361
      * returns DebtorAccount object
358 362
      *
359
-     * @return object DebtorAccount
363
+     * @return DebtorAccount DebtorAccount
360 364
      */
361 365
     public function getDebtorAccount()
362 366
     {
@@ -575,6 +579,11 @@  discard block
 block discarded – undo
575 579
      * @param object year stating year
576 580
      * @param integer voucher_number
577 581
      * @param string voucher_date
582
+     * @param Year $year
583
+     * @param integer $voucher_number
584
+     * @param string $voucher_date
585
+     * @param integer $credit_account_number
586
+     * @param Stub_Translation $translation
578 587
      * @return boolean true or false
579 588
      */
580 589
     function state($year, $voucher_number, $voucher_date, $credit_account_number, $translation)
@@ -687,7 +696,7 @@  discard block
 block discarded – undo
687 696
     /**
688 697
      * returns possible status types
689 698
      *
690
-     * @return array possible status types
699
+     * @return string[] possible status types
691 700
      */
692 701
     private static function getStatusTypes()
693 702
     {
@@ -702,7 +711,7 @@  discard block
 block discarded – undo
702 711
     /**
703 712
      * returns possible payment methods
704 713
      *
705
-     * @return array possible payment methods
714
+     * @return string[] possible payment methods
706 715
      */
707 716
     private static function getPaymentMethods()
708 717
     {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -722,9 +722,9 @@
 block discarded – undo
722 722
     function getPaymentInformation()
723 723
     {
724 724
         $info = array('bank_name'    => $this->kernel->setting->get("intranet", "bank_name"),
725
-                      'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"),
726
-                      'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"),
727
-                      'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number")
725
+                        'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"),
726
+                        'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"),
727
+                        'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number")
728 728
         );
729 729
 
730 730
         return $info;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     function isNumberFree($number)
128 128
     {
129
-        $sql = "SELECT id FROM invoice_reminder WHERE number = ".intval($number)." AND id != ".$this->id . " AND intranet_id = " . $this->kernel->intranet->get('id');
129
+        $sql = "SELECT id FROM invoice_reminder WHERE number = ".intval($number)." AND id != ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id');
130 130
         $this->db->query($sql);
131 131
         if ($this->db->nextRecord()) {
132 132
             return false;
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         }
340 340
 
341 341
         $db = new Db_Sql;
342
-        $db->query("UPDATE invoice_reminder SET status = ".$status_id.", ".$sql."  WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
342
+        $db->query("UPDATE invoice_reminder SET status = ".$status_id.", ".$sql."  WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
343 343
         $this->load();
344 344
         return true;
345 345
     }
@@ -477,14 +477,14 @@  discard block
 block discarded – undo
477 477
         }
478 478
         $db = new DB_Sql;
479 479
         $db->query("SELECT id
480
-            FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=" . $contact_id);
480
+            FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=".$contact_id);
481 481
         return $db->numRows();
482 482
     }
483 483
 
484 484
     function isFilledIn()
485 485
     {
486 486
         $db = new DB_Sql;
487
-        $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = " . $this->kernel->intranet->get('id'));
487
+        $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get('id'));
488 488
         return $db->numRows();
489 489
     }
490 490
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
     {
501 501
         // FIXME - check on date
502 502
         $db = new DB_Sql;
503
-        $db->query("UPDATE invoice_reminder SET date_stated = '" . $voucher_date . "', voucher_id = '".$voucher_id."' WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
503
+        $db->query("UPDATE invoice_reminder SET date_stated = '".$voucher_date."', voucher_id = '".$voucher_id."' WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
504 504
         return true;
505 505
     }
506 506
 
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 
648 648
         require_once 'Intraface/modules/accounting/VoucherFile.php';
649 649
         $voucher_file = new VoucherFile($voucher);
650
-        if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'reminder','belong_to_id'=>$this->get('id')))) {
650
+        if (!$voucher_file->save(array('description' => $text, 'belong_to'=>'reminder', 'belong_to_id'=>$this->get('id')))) {
651 651
             $this->error->merge($voucher_file->error->getMessage());
652 652
             $this->error->set('Filen blev ikke overflyttet');
653 653
         }
Please login to merge, or discard this patch.
src/Intraface/modules/invoice/ReminderGateway.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
 
9 9
 class OnlinePaymentDefault extends OnlinePayment
10 10
 {
11
+    /**
12
+     * @param integer $id
13
+     */
11 14
     function __construct($kernel, $id) {
12 15
 
13 16
         parent::__construct($kernel, $id);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     function findById($id)
26 26
     {
27
-        require_once dirname(__FILE__) . '/Reminder.php';
27
+        require_once dirname(__FILE__).'/Reminder.php';
28 28
         return new Reminder($this->kernel, $id);
29 29
     }
30 30
 
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
         }
40 40
         $db = new DB_Sql;
41 41
         $db->query("SELECT id
42
-            FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=" . $contact_id);
42
+            FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND active = 1 AND contact_id=".$contact_id);
43 43
         return $db->numRows();
44 44
     }
45 45
 
46 46
     function setNewContactId($old_contact_id, $new_contact_id)
47 47
     {
48 48
         $db = new DB_Sql;
49
-        $db->query('UPDATE invoice_reminder SET contact_id = ' . $new_contact_id . ' WHERE contact_id = ' . $old_contact_id);
49
+        $db->query('UPDATE invoice_reminder SET contact_id = '.$new_contact_id.' WHERE contact_id = '.$old_contact_id);
50 50
         return true;
51 51
     }
52 52
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     function isFilledIn()
158 158
     {
159 159
         $db = new DB_Sql;
160
-        $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = " . $this->kernel->intranet->get('id'));
160
+        $db->query("SELECT id FROM invoice_reminder WHERE intranet_id = ".$this->kernel->intranet->get('id'));
161 161
         return $db->numRows();
162 162
     }
163 163
 
Please login to merge, or discard this patch.
src/Intraface/modules/onlinepayment/OnlinePayment.php 3 patches
Doc Comments   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -298,6 +298,10 @@  discard block
 block discarded – undo
298 298
         return $this->id;
299 299
     }
300 300
 
301
+    /**
302
+     * @param string $belong_to
303
+     * @param integer $belong_to_id
304
+     */
301 305
     function changeBelongTo($belong_to, $belong_to_id)
302 306
     {
303 307
         if ($this->id == 0) {
@@ -321,6 +325,9 @@  discard block
 block discarded – undo
321 325
 
322 326
     }
323 327
 
328
+    /**
329
+     * @param string $status
330
+     */
324 331
     function setStatus($status)
325 332
     {
326 333
         if ($this->id == 0) {
@@ -582,7 +589,7 @@  discard block
 block discarded – undo
582 589
     /**
583 590
      * returns the possible status types
584 591
      *
585
-     * @return array with status types
592
+     * @return string[] with status types
586 593
      */
587 594
     static function getStatusTypes()
588 595
     {
@@ -598,7 +605,7 @@  discard block
 block discarded – undo
598 605
     /**
599 606
      * returns possible belong to types
600 607
      *
601
-     * @return array with belong to types
608
+     * @return string[] with belong to types
602 609
      */
603 610
     private function getBelongToTypes()
604 611
     {
@@ -611,7 +618,7 @@  discard block
 block discarded – undo
611 618
     /**
612 619
      * returns the implemented providers
613 620
      *
614
-     * @return array with providers
621
+     * @return string[] with providers
615 622
      */
616 623
     static function getImplementedProviders()
617 624
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      * @param array $input (belong_to, belong_to_id, transaction_number, transaction_status, amount)
134 134
      *
135 135
      * @return integer
136
-      */
136
+     */
137 137
     public function save($input)
138 138
     {
139 139
         $input = safeToDb($input);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         }
164 164
 
165 165
         if ($input['transaction_status'] == $this->transaction_status_authorized) {
166
-             $status_key = 2;
166
+                $status_key = 2;
167 167
         } else {
168 168
             $status_key = 1;
169 169
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -664,7 +664,7 @@
 block discarded – undo
664 664
 
665 665
     function getStatus()
666 666
     {
667
-        $status =  $this->getStatusTypes();
667
+        $status = $this->getStatusTypes();
668 668
         return $status[$this->value['status_key']];
669 669
     }
670 670
 }
Please login to merge, or discard this patch.
src/Intraface/modules/onlinepayment/provider/DanDomain.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
 
9 9
 class OnlinePaymentDefault extends OnlinePayment
10 10
 {
11
+    /**
12
+     * @param integer $id
13
+     */
11 14
     function __construct($kernel, $id) {
12 15
 
13 16
         parent::__construct($kernel, $id);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -142,8 +142,8 @@
 block discarded – undo
142 142
 
143 143
     function getSettings()
144 144
     {
145
-        $this->value['password'] =  $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.password');
146
-        $this->value['merchant_id'] =   $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.merchant_id');
145
+        $this->value['password'] = $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.password');
146
+        $this->value['merchant_id'] = $this->kernel->setting->get('intranet', 'onlinepayment.dandomain.merchant_id');
147 147
         return $this->value;
148 148
     }
149 149
 
Please login to merge, or discard this patch.
src/Intraface/modules/procurement/ProcurementItem.php 3 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,6 +58,8 @@  discard block
 block discarded – undo
58 58
      *
59 59
      * @param object Procurement
60 60
      * @param integer item id
61
+     * @param Procurement $procurement
62
+     * @param integer $id
61 63
      * @return void
62 64
      */
63 65
     public function __construct($procurement, $id)
@@ -201,7 +203,7 @@  discard block
 block discarded – undo
201 203
     /**
202 204
      * Gets the tax percent on the individual product
203 205
      *
204
-     * @return float
206
+     * @return integer
205 207
      */
206 208
     public function getProductTaxPercent()
207 209
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
             $product = new Product($this->procurement->kernel, $input["product_id"], $input['product_detail_id']);
235 235
 
236 236
             if (!is_object($product) || $product->get('id') == 0) {
237
-                 $this->error->set("Ugyldigt produkt");
237
+                    $this->error->set("Ugyldigt produkt");
238 238
             } else {
239 239
                 $product_detail_id = $product->get("detail_id");
240 240
             }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
         $product = new Product($this->procurement->kernel, $product_id);
348 348
 
349 349
         if (!is_object($product) || $product->get('id') == 0) {
350
-             throw new Excetion('Invalid product id');
350
+                throw new Excetion('Invalid product id');
351 351
         } else {
352 352
             $product_detail_id = $product->get("detail_id");
353 353
         }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $this->procurement = $procurement;
66 66
         $this->error = new Intraface_Error;
67
-        $this->id = (int) $id;
67
+        $this->id = (int)$id;
68 68
 
69 69
         if ($this->id > 0) {
70 70
             $this->load();
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         $db->query("SELECT procurement_item.* FROM procurement_item
88 88
                     INNER JOIN procurement ON procurement_item.procurement_id = procurement.id
89
-                    WHERE procurement_item.id = " . $this->id . " AND procurement.id = " . $this->procurement->get('id') . " AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id"));
89
+                    WHERE procurement_item.id = " . $this->id." AND procurement.id = ".$this->procurement->get('id')." AND procurement_item.intranet_id = ".$this->procurement->kernel->intranet->get("id"));
90 90
         if ($db->nextRecord()) {
91 91
             $this->value["id"] = $db->f("id");
92 92
             $this->value["product_id"] = $db->f("product_id");
@@ -282,20 +282,20 @@  discard block
 block discarded – undo
282 282
             exit;
283 283
         }
284 284
 
285
-        $sql = "product_id = " . $product->getId() . ",
286
-                product_detail_id = " . $product_detail_id . ",
287
-                product_variation_id = " . $variation_id . ",
288
-                product_variation_detail_id = " . $variation_detail_id . ",
289
-                quantity = " . $input["quantity"] . ",
285
+        $sql = "product_id = ".$product->getId().",
286
+                product_detail_id = " . $product_detail_id.",
287
+                product_variation_id = " . $variation_id.",
288
+                product_variation_detail_id = " . $variation_detail_id.",
289
+                quantity = " . $input["quantity"].",
290 290
                 unit_purchase_price = " . $input["unit_purchase_price"];
291 291
 
292 292
         $db = new DB_Sql;
293 293
 
294 294
         if ($this->id == 0) {
295
-            $db->query("INSERT INTO procurement_item SET " . $sql . ", intranet_id = " . $this->procurement->kernel->intranet->get("id") . ", procurement_id = " . $this->procurement->get("id") . ", active = 1");
295
+            $db->query("INSERT INTO procurement_item SET ".$sql.", intranet_id = ".$this->procurement->kernel->intranet->get("id").", procurement_id = ".$this->procurement->get("id").", active = 1");
296 296
             $this->id = $db->InsertedId();
297 297
         } else {
298
-            $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id"));
298
+            $db->query("UPDATE procurement_item SET ".$sql." WHERE id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")." AND intranet_id = ".$this->procurement->kernel->intranet->get("id"));
299 299
         }
300 300
 
301 301
         return $this->id;
@@ -323,10 +323,10 @@  discard block
 block discarded – undo
323 323
             return false;
324 324
         }
325 325
 
326
-        $sql = "unit_purchase_price = " . $unit_purchase_price->get();
326
+        $sql = "unit_purchase_price = ".$unit_purchase_price->get();
327 327
 
328 328
         $db = new DB_Sql;
329
-        $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id"));
329
+        $db->query("UPDATE procurement_item SET ".$sql." WHERE id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")." AND intranet_id = ".$this->procurement->kernel->intranet->get("id"));
330 330
         return true;
331 331
     }
332 332
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             product_variation_detail_id = ".$variation_detail_id;
377 377
 
378 378
         $db = new DB_Sql;
379
-        $db->query("UPDATE procurement_item SET " . $sql . " WHERE id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id") . " AND intranet_id = " . $this->procurement->kernel->intranet->get("id"));
379
+        $db->query("UPDATE procurement_item SET ".$sql." WHERE id = ".$this->id." AND procurement_id = ".$this->procurement->get("id")." AND intranet_id = ".$this->procurement->kernel->intranet->get("id"));
380 380
 
381 381
         return true;
382 382
     }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     public function delete()
389 389
     {
390 390
         $db = new DB_Sql;
391
-        $db->query("UPDATE procurement_item SET active = 0 WHERE intranet_id = " . $this->procurement->kernel->intranet->get('id') . " AND id = " . $this->id . " AND procurement_id = " . $this->procurement->get("id"));
391
+        $db->query("UPDATE procurement_item SET active = 0 WHERE intranet_id = ".$this->procurement->kernel->intranet->get('id')." AND id = ".$this->id." AND procurement_id = ".$this->procurement->get("id"));
392 392
         $this->id = 0;
393 393
 
394 394
         return 1;
@@ -402,13 +402,13 @@  discard block
 block discarded – undo
402 402
     public function getList()
403 403
     {
404 404
         $db = new DB_Sql;
405
-        $db->query("SELECT * FROM procurement_item WHERE active = 1 AND intranet_id = " . $this->procurement->kernel->intranet->get("id") . " AND procurement_id = " . $this->procurement->get("id") . " ORDER BY id ASC");
405
+        $db->query("SELECT * FROM procurement_item WHERE active = 1 AND intranet_id = ".$this->procurement->kernel->intranet->get("id")." AND procurement_id = ".$this->procurement->get("id")." ORDER BY id ASC");
406 406
         $i = 0;
407
-        $item = array ();
407
+        $item = array();
408 408
 
409 409
         if ($this->procurement->get("price_items") > 0) {
410 410
             // calculates shipment etc per item price kr
411
-            $calculated = $this->procurement->get("price_shipment_etc") / $this->procurement->get("price_items");
411
+            $calculated = $this->procurement->get("price_shipment_etc")/$this->procurement->get("price_items");
412 412
         } else {
413 413
             $calculated = 0;
414 414
         }
@@ -424,17 +424,17 @@  discard block
 block discarded – undo
424 424
                 $item[$i]["unit"] = $unit['plural'];
425 425
             }
426 426
             $item[$i]["unit_purchase_price"] = $db->f("unit_purchase_price");
427
-            $item[$i]["calculated_unit_price"] = $db->f("unit_purchase_price") + $db->f("unit_purchase_price") * $calculated;
427
+            $item[$i]["calculated_unit_price"] = $db->f("unit_purchase_price") + $db->f("unit_purchase_price")*$calculated;
428 428
             $item[$i]["quantity"] = $db->f("quantity");
429 429
             $item[$i]["vat"] = $product->get("vat");
430 430
             $item[$i]["product_id"] = $product->get("id");
431
-            $item[$i]["amount"] = $db->f("quantity") * $db->f("unit_purchase_price");
431
+            $item[$i]["amount"] = $db->f("quantity")*$db->f("unit_purchase_price");
432 432
 
433 433
             if ($product->get('has_variation')) {
434 434
                 $variation = $product->getVariation($db->f('product_variation_id'));
435 435
                 $detail = $variation->getDetail($db->f('product_variation_detail_id'));
436 436
                 $item[$i]["name"] = $product->get("name").' - '.$variation->getName();
437
-                $item[$i]["number"]= $product->get("number").'.'.$variation->getNumber();
437
+                $item[$i]["number"] = $product->get("number").'.'.$variation->getNumber();
438 438
                 $item[$i]["price"] = $detail->getPrice($product);
439 439
             } else {
440 440
                 $item[$i]["name"] = $product->get("name");
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
      */
452 452
     public function getQuantity($status, $product_id, $product_variation_id, $from_date = "")
453 453
     {
454
-        if (!in_array($status, array (
454
+        if (!in_array($status, array(
455 455
                 'ordered',
456 456
                 'delivered'
457 457
             ))) {
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
                         FROM procurement_item INNER JOIN procurement
466 466
                             ON procurement_item.procurement_id = procurement.id
467 467
                         WHERE procurement_item.active = 1 AND procurement.active = 1
468
-                            AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id") . " AND procurement.intranet_id = " . $this->procurement->kernel->intranet->get("id") . "
469
-                            AND procurement_item.product_id = " . $product_id . " AND procurement.status_key = 0
468
+                            AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id")." AND procurement.intranet_id = ".$this->procurement->kernel->intranet->get("id")."
469
+                            AND procurement_item.product_id = " . $product_id." AND procurement.status_key = 0
470 470
                             AND procurement_item.product_variation_id = ".$product_variation_id);
471 471
             $db->nextRecord(); // a post will always be present
472 472
             return intval($db->f("on_order"));
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
                         FROM procurement_item INNER JOIN procurement
477 477
                             ON procurement_item.procurement_id = procurement.id
478 478
                         WHERE procurement_item.active = 1 AND procurement.active = 1
479
-                            AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id") . " AND procurement.intranet_id = " . $this->procurement->kernel->intranet->get("id") . "
480
-                            AND procurement_item.product_id = " . $product_id . "
479
+                            AND procurement_item.intranet_id = " . $this->procurement->kernel->intranet->get("id")." AND procurement.intranet_id = ".$this->procurement->kernel->intranet->get("id")."
480
+                            AND procurement_item.product_id = " . $product_id."
481 481
                             AND procurement_item.product_variation_id = ".$product_variation_id."
482 482
                             AND procurement.status_key = 1
483
-                            AND procurement.date_recieved > \"" . $from_date . "\"");
483
+                            AND procurement.date_recieved > \"" . $from_date."\"");
484 484
             $db->nextRecord(); // a post will always be present
485 485
             return intval($db->f("stock_in"));
486 486
         }
Please login to merge, or discard this patch.
src/Intraface/modules/product/Variation/Detail.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      *
76 76
      * @param object Product
77 77
      *
78
-     * @return object Ilib_Variable_Float with price
78
+     * @return Ilib_Variable_Float Ilib_Variable_Float with price
79 79
      */
80 80
     public function getPrice($product)
81 81
     {
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
      * @todo Product should not be given as parameter, but defined as relation. Product needs to be made in doctrine
93 93
      *
94 94
      * @param object $currency Intraface_modules_currency_Currency
95
-     * @param integer $exchange_rage_id
95
+     * @param integer $exchange_rate_id
96 96
      * @param object $product Product
97 97
      *
98
-     * @return obejct Ilib_Variable_Float with price of the variation in given currency
98
+     * @return Ilib_Variable_Float Ilib_Variable_Float with price of the variation in given currency
99 99
      */
100 100
     public function getPriceInCurrency($currency, $exchange_rate_id = 0, $product)
101 101
     {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      *
110 110
      * @param object $product Product
111 111
      *
112
-     * @return object Ilib_Variable_Float with price including vat
112
+     * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat
113 113
      */
114 114
     public function getPriceIncludingVat($product)
115 115
     {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      * @param integer $exchange_rate_id
130 130
      * @param object product Product
131 131
      *
132
-     * @return object Ilib_Variable_Float with price including vat in given currency
132
+     * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat in given currency
133 133
      */
134 134
     public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id, $product)
135 135
     {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @param object Product
145 145
      *
146
-     * @return object Ilib_Variable_Float with price
146
+     * @return Ilib_Variable_Float Ilib_Variable_Float with price
147 147
      */
148 148
     public function getWeight($product)
149 149
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function getPriceInCurrency($currency, $exchange_rate_id = 0, $product)
101 101
     {
102
-        return new Ilib_Variable_Float(round($this->getPrice($product)->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2));
102
+        return new Ilib_Variable_Float(round($this->getPrice($product)->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2));
103 103
     }
104 104
 
105 105
     /**
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
     public function getPriceIncludingVat($product)
115 115
     {
116 116
         if (get_class($product) == 'Intraface_modules_product_ProductDoctrine') {
117
-            return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2) * (1 + $product->getDetails()->getVatPercent()->getAsIso()/100));
117
+            return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2)*(1 + $product->getDetails()->getVatPercent()->getAsIso()/100));
118 118
         } else {
119
-            return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2) * (1 + $product->get('vat_percent')/100));
119
+            return new Ilib_Variable_Float($this->getPrice($product)->getAsIso(2)*(1 + $product->get('vat_percent')/100));
120 120
         }
121 121
     }
122 122
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id, $product)
135 135
     {
136
-        return new Ilib_Variable_Float($this->getPriceIncludingVat($product)->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100));
136
+        return new Ilib_Variable_Float($this->getPriceIncludingVat($product)->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100));
137 137
     }
138 138
 
139 139
     /**
Please login to merge, or discard this patch.
src/Intraface/modules/shop/Basket.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      *
55 55
      * @param object $db         The webshop object
56 56
      * @param object $intranet   The webshop object
57
-     * @param object $webshop    The webshop object
57
+     * @param object $shop    The webshop object
58 58
      * @param string $session_id A session id
59 59
      *
60 60
      * @return void
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * @param integer $product_id Product to remove
105 105
      * @param integer $quantity   How many should be removed
106 106
      *
107
-     * @return boelean
107
+     * @return boolean
108 108
      */
109 109
     public function remove($product_id, $product_variation_id = 0, $quantity = 1)
110 110
     {
@@ -122,6 +122,7 @@  discard block
 block discarded – undo
122 122
      * @param integer $quantity         The quantity
123 123
      * @param string  $text             To add description to product, not yet implemented
124 124
      * @param integer $basketevaluation Wheter the product is from basketevaluation
125
+     * @param integer $product_variation_id
125 126
      *
126 127
      * @return boolean
127 128
      */
@@ -530,7 +531,7 @@  discard block
 block discarded – undo
530 531
     /**
531 532
      * Gets the total weight of the basket
532 533
      *
533
-     * @return float
534
+     * @return integer
534 535
      */
535 536
     public function getTotalWeight()
536 537
     {
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
         $this->resetItemCache();
70 70
 
71 71
         $this->conditions = array(
72
-            'session_id = ' . $this->db->quote($this->session_id, 'text'),
73
-            'shop_id = ' . $this->db->quote($this->webshop->getId(), 'integer'),
74
-            'intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer'));
72
+            'session_id = '.$this->db->quote($this->session_id, 'text'),
73
+            'shop_id = '.$this->db->quote($this->webshop->getId(), 'integer'),
74
+            'intranet_id = '.$this->db->quote($this->intranet->getId(), 'integer'));
75 75
 
76 76
         $this->cleanUp();
77 77
     }
78 78
 
79 79
     private function cleanUp()
80 80
     {
81
-        return $this->db->query("DELETE FROM basket WHERE DATE_ADD(date_changed, INTERVAL " . $this->db->quote(self::CLEAN_UP_AFTER, 'integer') . " HOUR) < NOW()");
81
+        return $this->db->query("DELETE FROM basket WHERE DATE_ADD(date_changed, INTERVAL ".$this->db->quote(self::CLEAN_UP_AFTER, 'integer')." HOUR) < NOW()");
82 82
     }
83 83
 
84 84
     /**
@@ -165,23 +165,23 @@  discard block
 block discarded – undo
165 165
                 FROM basket
166 166
                 WHERE product_id = ".$product_id."
167 167
                     AND product_variation_id = ".$product_variation_id."
168
-                    AND product_detail_id = " . $product_detail_id . "
169
-                    AND basketevaluation_product = " . $basketevaluation . "
168
+                    AND product_detail_id = " . $product_detail_id."
169
+                    AND basketevaluation_product = " . $basketevaluation."
170 170
                     AND " . $sql_extra);
171 171
 
172 172
         if ($db->nextRecord()) {
173 173
             if ($quantity == 0) {
174 174
                 $db->query("DELETE FROM basket
175
-                    WHERE id = ".$db->f('id') . "
176
-                        AND basketevaluation_product = " . $basketevaluation . "
175
+                    WHERE id = ".$db->f('id')."
176
+                        AND basketevaluation_product = " . $basketevaluation."
177 177
                         AND " . $sql_extra);
178 178
             } else {
179 179
                 $db->query("UPDATE basket SET
180 180
                     quantity = $quantity,
181 181
                     date_changed = NOW(),
182 182
                     text = '".$text."'
183
-                    WHERE id = ".$db->f('id') . "
184
-                        AND basketevaluation_product = " . $basketevaluation . "
183
+                    WHERE id = ".$db->f('id')."
184
+                        AND basketevaluation_product = " . $basketevaluation."
185 185
                         AND " . $sql_extra);
186 186
             }
187 187
             return true;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                         quantity = $quantity,
193 193
                         date_changed = NOW(),
194 194
                         text = '".$text."',
195
-                        basketevaluation_product = " . $basketevaluation . ",
195
+                        basketevaluation_product = " . $basketevaluation.",
196 196
                         product_id = ".$product_id.",
197 197
                         product_variation_id = ".$product_variation_id.",
198 198
                         product_detail_id = ".$product_detail_id.",
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
         settype($input['email'], 'string');
221 221
         settype($input['phone'], 'string');
222 222
 
223
-        $sql = "name = \"".safeToDb($input['name'])."\"," .
224
-            "contactperson = \"".safeToDb($input['contactperson'])."\", " .
225
-            "address = \"".safeToDb($input['address'])."\", " .
226
-            "postcode = \"".safeToDb($input['postcode'])."\", " .
223
+        $sql = "name = \"".safeToDb($input['name'])."\",".
224
+            "contactperson = \"".safeToDb($input['contactperson'])."\", ".
225
+            "address = \"".safeToDb($input['address'])."\", ".
226
+            "postcode = \"".safeToDb($input['postcode'])."\", ".
227 227
             "city = \"".safeToDb($input['city'])."\", ".
228 228
             "country = \"".safeToDb($input['country'])."\", ".
229 229
             "cvr = \"".safeToDb($input['cvr'])."\", ".
@@ -305,13 +305,13 @@  discard block
 block discarded – undo
305 305
         $sql_extra = implode(" AND ", $this->conditions);
306 306
 
307 307
         $db = new DB_Sql;
308
-        $db->query("SELECT id FROM basket_details WHERE " . $sql_extra. "
308
+        $db->query("SELECT id FROM basket_details WHERE ".$sql_extra."
309 309
                 AND intranet_id = " . $this->intranet->getId());
310 310
         if ($db->nextRecord()) {
311 311
             $db->query("UPDATE basket_details SET ".$sql.",
312 312
                 date_changed = NOW()
313
-                WHERE id = ".$db->f('id') . "
314
-                    AND " . $sql_extra . "
313
+                WHERE id = ".$db->f('id')."
314
+                    AND " . $sql_extra."
315 315
                     AND intranet_id = " . $this->intranet->getId());
316 316
             return true;
317 317
         } else {
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         $db = new DB_Sql;
340 340
         $db->query("SELECT *
341 341
             FROM basket_details
342
-            WHERE " . $sql_extra . "
342
+            WHERE " . $sql_extra."
343 343
                 AND intranet_id = " . $this->intranet->getId());
344 344
         if (!$db->nextRecord()) {
345 345
             return array();
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         $db = new DB_Sql;
370 370
         $db->query("SELECT customer_coupon
371 371
             FROM basket_details
372
-            WHERE " . $sql_extra . "
372
+            WHERE " . $sql_extra."
373 373
                 AND intranet_id = " . $this->intranet->getId());
374 374
         if (!$db->nextRecord()) {
375 375
             return array();
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         $db = new DB_Sql;
392 392
         $db->query("SELECT customer_ean
393 393
             FROM basket_details
394
-            WHERE " . $sql_extra . "
394
+            WHERE " . $sql_extra."
395 395
                 AND intranet_id = " . $this->intranet->getId());
396 396
         if (!$db->nextRecord()) {
397 397
             return array();
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         $db = new DB_Sql;
414 414
         $db->query("SELECT customer_comment
415 415
             FROM basket_details
416
-            WHERE " . $sql_extra . "
416
+            WHERE " . $sql_extra."
417 417
                 AND intranet_id = " . $this->intranet->getId());
418 418
         if (!$db->nextRecord()) {
419 419
             return array();
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $db = new DB_Sql;
436 436
         $db->query("SELECT payment_method_key
437 437
             FROM basket_details
438
-            WHERE " . $sql_extra . "
438
+            WHERE " . $sql_extra."
439 439
                 AND intranet_id = " . $this->intranet->getId());
440 440
         if (!$db->nextRecord() || $db->f('payment_method_key') == 0) {
441 441
             return array();
@@ -460,10 +460,10 @@  discard block
 block discarded – undo
460 460
         $db = new DB_Sql;
461 461
         $db->query("SELECT *
462 462
             FROM basket
463
-            WHERE " . $sql_extra . "
464
-                AND product_id = " . $product_id . "
463
+            WHERE " . $sql_extra."
464
+                AND product_id = " . $product_id."
465 465
                 AND product_variation_id = ".$product_variation_id."
466
-                AND intranet_id = " . $this->intranet->getId() . "
466
+                AND intranet_id = " . $this->intranet->getId()."
467 467
       AND quantity > 0 LIMIT 1");
468 468
 
469 469
         if (!$db->nextRecord()) {
@@ -574,9 +574,9 @@  discard block
 block discarded – undo
574 574
                 ON product.id = basket.product_id
575 575
             INNER JOIN product_detail
576 576
                 ON product.id = product_detail.product_id
577
-            WHERE " . $sql_extra . "
577
+            WHERE " . $sql_extra."
578 578
                 AND product_detail.active = 1
579
-                AND basket.intranet_id = " . $this->intranet->getId() . "
579
+                AND basket.intranet_id = " . $this->intranet->getId()."
580 580
             ORDER BY product_detail.vat DESC, basket.basketevaluation_product");
581 581
 
582 582
         $i = 0;
@@ -627,16 +627,16 @@  discard block
 block discarded – undo
627 627
 
628 628
             // basket specific
629 629
             $items[$i]['quantity'] = $db->f('quantity');
630
-            $items[$i]['totalweight'] = $items[$i]['weight'] * $db->f('quantity');
631
-            $items[$i]['totalprice'] = $db->f('quantity') * $items[$i]['price'];
632
-            $items[$i]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['price_incl_vat'];
630
+            $items[$i]['totalweight'] = $items[$i]['weight']*$db->f('quantity');
631
+            $items[$i]['totalprice'] = $db->f('quantity')*$items[$i]['price'];
632
+            $items[$i]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['price_incl_vat'];
633 633
 
634
-            $items[$i]['currency']['DKK']['totalprice'] = $db->f('quantity') * $items[$i]['currency']['DKK']['price'];
635
-            $items[$i]['currency']['DKK']['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['currency']['DKK']['price_incl_vat'];
634
+            $items[$i]['currency']['DKK']['totalprice'] = $db->f('quantity')*$items[$i]['currency']['DKK']['price'];
635
+            $items[$i]['currency']['DKK']['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['currency']['DKK']['price_incl_vat'];
636 636
             if (is_object($currencies) && $currencies->count() > 0) {
637 637
                 foreach ($currencies as $currency) {
638
-                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice'] = $db->f('quantity') * $items[$i]['currency'][$currency->getType()->getIsoCode()]['price'];
639
-                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['currency'][$currency->getType()->getIsoCode()]['price_incl_vat'];
638
+                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice'] = $db->f('quantity')*$items[$i]['currency'][$currency->getType()->getIsoCode()]['price'];
639
+                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['currency'][$currency->getType()->getIsoCode()]['price_incl_vat'];
640 640
                 }
641 641
             }
642 642
 
@@ -665,10 +665,10 @@  discard block
 block discarded – undo
665 665
     {
666 666
         $sql_extra = implode(" AND ", $this->conditions);
667 667
         $db = new DB_Sql;
668
-        $db->query("DELETE FROM basket " .
669
-                "WHERE basketevaluation_product = 1 " .
670
-                    "AND " . $sql_extra . " " .
671
-                    "AND intranet_id = " . $this->intranet->getId());
668
+        $db->query("DELETE FROM basket ".
669
+                "WHERE basketevaluation_product = 1 ".
670
+                    "AND ".$sql_extra." ".
671
+                    "AND intranet_id = ".$this->intranet->getId());
672 672
 
673 673
         $this->resetItemCache();
674 674
 
@@ -687,8 +687,8 @@  discard block
 block discarded – undo
687 687
 
688 688
         $sql_extra = implode(" AND ", $this->conditions);
689 689
         $db = new DB_Sql;
690
-        $db->query("UPDATE basket SET session_id = '' WHERE " . $sql_extra . " AND intranet_id = " . $this->intranet->getId());
691
-        $db->query("UPDATE basket_details SET session_id = '' WHERE " . $sql_extra . " AND intranet_id = " . $this->intranet->getId());
690
+        $db->query("UPDATE basket SET session_id = '' WHERE ".$sql_extra." AND intranet_id = ".$this->intranet->getId());
691
+        $db->query("UPDATE basket_details SET session_id = '' WHERE ".$sql_extra." AND intranet_id = ".$this->intranet->getId());
692 692
 
693 693
         return true;
694 694
     }
Please login to merge, or discard this patch.
src/Intraface/modules/shop/BasketEvaluation.php 3 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,6 @@  discard block
 block discarded – undo
34 34
     /**
35 35
      * Constructor
36 36
      *
37
-     * @param object $kernel Kernel registry
38 37
      * @param int    $id     Id of the BasketEvaluation
39 38
      *
40 39
      * @return void
@@ -106,6 +105,9 @@  discard block
 block discarded – undo
106 105
         return true;
107 106
     }
108 107
 
108
+    /**
109
+     * @param Struct $input
110
+     */
109 111
     function validate($input)
110 112
     {
111 113
         $validator = new Intraface_Validator($this->error);
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -147,15 +147,15 @@
 block discarded – undo
147 147
         }
148 148
 
149 149
         $sql = "running_index = ".$this->db->quote($input['running_index'], 'integer').", " .
150
-                 "evaluate_target_key = ".$this->db->quote($input['evaluate_target_key'], 'integer').", " .
151
-                 "evaluate_method_key = ".$this->db->quote($input['evaluate_method_key'], 'integer').", " .
152
-                 "evaluate_value = ".$this->db->quote($input['evaluate_value'], 'text').", " .
153
-                 "evaluate_value_case_sensitive = ".$this->db->quote($input['evaluate_value_case_sensitive'], 'integer').", " .
154
-                 "go_to_index_after = ".$this->db->quote($input['go_to_index_after'], 'integer').", " .
155
-                 "action_action_key = ".$this->db->quote($input['action_action_key'], 'integer').", " .
156
-                 "action_value = ".$this->db->quote($input['action_value'], 'text').", " .
157
-                 "action_quantity = ".$this->db->quote($input['action_quantity'], 'integer').", " .
158
-                 "action_unit_key = ".$this->db->quote($input['action_unit_key'], 'integer');
150
+                    "evaluate_target_key = ".$this->db->quote($input['evaluate_target_key'], 'integer').", " .
151
+                    "evaluate_method_key = ".$this->db->quote($input['evaluate_method_key'], 'integer').", " .
152
+                    "evaluate_value = ".$this->db->quote($input['evaluate_value'], 'text').", " .
153
+                    "evaluate_value_case_sensitive = ".$this->db->quote($input['evaluate_value_case_sensitive'], 'integer').", " .
154
+                    "go_to_index_after = ".$this->db->quote($input['go_to_index_after'], 'integer').", " .
155
+                    "action_action_key = ".$this->db->quote($input['action_action_key'], 'integer').", " .
156
+                    "action_value = ".$this->db->quote($input['action_value'], 'text').", " .
157
+                    "action_quantity = ".$this->db->quote($input['action_quantity'], 'integer').", " .
158
+                    "action_unit_key = ".$this->db->quote($input['action_unit_key'], 'integer');
159 159
 
160 160
         if ($this->id != 0) {
161 161
             $result = $this->db->exec("UPDATE webshop_basket_evaluation SET ".$sql." WHERE intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND id = ".$this->db->quote($this->id, 'integer')  . " AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer'));
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $this->shop     = $shop;
48 48
         $this->id       = (int)$id;
49 49
 
50
-        $this->value['settings'] = array (
50
+        $this->value['settings'] = array(
51 51
             'evaluate_target' => array(
52 52
                 0 => 'price',
53 53
                 1 => 'weight',
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
      */
86 86
     private function load()
87 87
     {
88
-        $result = $this->db->query("SELECT * FROM webshop_basket_evaluation WHERE active = 1 AND intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND id = ".$this->db->quote($this->id, 'integer') . " AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer'));
88
+        $result = $this->db->query("SELECT * FROM webshop_basket_evaluation WHERE active = 1 AND intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND id = ".$this->db->quote($this->id, 'integer')." AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer'));
89 89
 
90 90
         if (PEAR::isError($result)) {
91
-            throw new Exception($result->getMessage() . $result->getUserInfo());
91
+            throw new Exception($result->getMessage().$result->getUserInfo());
92 92
         }
93 93
 
94 94
         if ($result->numRows() == 0) {
@@ -146,35 +146,35 @@  discard block
 block discarded – undo
146 146
             return false;
147 147
         }
148 148
 
149
-        $sql = "running_index = ".$this->db->quote($input['running_index'], 'integer').", " .
150
-                 "evaluate_target_key = ".$this->db->quote($input['evaluate_target_key'], 'integer').", " .
151
-                 "evaluate_method_key = ".$this->db->quote($input['evaluate_method_key'], 'integer').", " .
152
-                 "evaluate_value = ".$this->db->quote($input['evaluate_value'], 'text').", " .
153
-                 "evaluate_value_case_sensitive = ".$this->db->quote($input['evaluate_value_case_sensitive'], 'integer').", " .
154
-                 "go_to_index_after = ".$this->db->quote($input['go_to_index_after'], 'integer').", " .
155
-                 "action_action_key = ".$this->db->quote($input['action_action_key'], 'integer').", " .
156
-                 "action_value = ".$this->db->quote($input['action_value'], 'text').", " .
157
-                 "action_quantity = ".$this->db->quote($input['action_quantity'], 'integer').", " .
149
+        $sql = "running_index = ".$this->db->quote($input['running_index'], 'integer').", ".
150
+                 "evaluate_target_key = ".$this->db->quote($input['evaluate_target_key'], 'integer').", ".
151
+                 "evaluate_method_key = ".$this->db->quote($input['evaluate_method_key'], 'integer').", ".
152
+                 "evaluate_value = ".$this->db->quote($input['evaluate_value'], 'text').", ".
153
+                 "evaluate_value_case_sensitive = ".$this->db->quote($input['evaluate_value_case_sensitive'], 'integer').", ".
154
+                 "go_to_index_after = ".$this->db->quote($input['go_to_index_after'], 'integer').", ".
155
+                 "action_action_key = ".$this->db->quote($input['action_action_key'], 'integer').", ".
156
+                 "action_value = ".$this->db->quote($input['action_value'], 'text').", ".
157
+                 "action_quantity = ".$this->db->quote($input['action_quantity'], 'integer').", ".
158 158
                  "action_unit_key = ".$this->db->quote($input['action_unit_key'], 'integer');
159 159
 
160 160
         if ($this->id != 0) {
161
-            $result = $this->db->exec("UPDATE webshop_basket_evaluation SET ".$sql." WHERE intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND id = ".$this->db->quote($this->id, 'integer')  . " AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer'));
161
+            $result = $this->db->exec("UPDATE webshop_basket_evaluation SET ".$sql." WHERE intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND id = ".$this->db->quote($this->id, 'integer')." AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer'));
162 162
 
163 163
             if (PEAR::isError($result)) {
164
-                throw new Exception($result->getMessage() . $result->getUserInfo());
164
+                throw new Exception($result->getMessage().$result->getUserInfo());
165 165
                 return false;
166 166
             }
167 167
         } else {
168 168
             $result = $this->db->query("INSERT INTO webshop_basket_evaluation SET ".$sql.", intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer').", id = ".$this->db->quote($this->id, 'integer').", shop_id = ".$this->db->quote($this->shop->getId(), 'integer'));
169 169
 
170 170
             if (PEAR::isError($result)) {
171
-                throw new Exception($result->getMessage() . $result->getUserInfo());
171
+                throw new Exception($result->getMessage().$result->getUserInfo());
172 172
                 return false;
173 173
             }
174 174
 
175 175
             $this->id = $this->db->lastInsertID();
176 176
             if (PEAR::isError($this->id)) {
177
-                throw new Exception($result->getMessage() . $result->getUserInfo());
177
+                throw new Exception($result->getMessage().$result->getUserInfo());
178 178
             }
179 179
         }
180 180
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $result = $this->db->exec("UPDATE webshop_basket_evaluation SET active = 0 WHERE intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND id = ".$this->db->quote($this->id, 'integer'));
192 192
         if (PEAR::isError($result)) {
193
-            throw new Exception($result->getMessage() . $result->getUserInfo());
193
+            throw new Exception($result->getMessage().$result->getUserInfo());
194 194
             return false;
195 195
         }
196 196
         return true;
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function getList()
205 205
     {
206
-        $result = $this->db->query("SELECT * FROM webshop_basket_evaluation WHERE active = 1 AND intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer'). " AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer')." ORDER BY running_index");
206
+        $result = $this->db->query("SELECT * FROM webshop_basket_evaluation WHERE active = 1 AND intranet_id = ".$this->db->quote($this->intranet->getId(), 'integer')." AND shop_id = ".$this->db->quote($this->shop->getId(), 'integer')." ORDER BY running_index");
207 207
 
208 208
         if (PEAR::isError($this->id)) {
209
-            throw new Exception($result->getMessage() . $result->getUserInfo());
209
+            throw new Exception($result->getMessage().$result->getUserInfo());
210 210
         }
211 211
 
212 212
         $i = 0;
Please login to merge, or discard this patch.
src/Intraface/modules/shop/DiscountCampaignGateway.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -65,6 +65,7 @@
 block discarded – undo
65 65
     /**
66 66
      * Find a variation from id
67 67
      * 
68
+     * @param integer $id
68 69
      * @return object Intraface_modules_product_Variation_OneAttributeGroup or Intraface_modules_product_Variation_TwoAttributeGroups
69 70
      */
70 71
     public function findById($id)
Please login to merge, or discard this patch.