Completed
Pull Request — master (#27)
by Lars
11:31 queued 01:30
created
src/Intraface/Filehandler/Controller/Batchedit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
             'kernel' => $kernel,
31 31
             'gateway' => $gateway);
32 32
 
33
-        $tpl = $this->template->create(dirname(__FILE__) . '/../templates/batchedit');
33
+        $tpl = $this->template->create(dirname(__FILE__).'/../templates/batchedit');
34 34
         return $tpl->render($this, $data);
35 35
     }
36 36
 
Please login to merge, or discard this patch.
src/Intraface/Filehandler/Controller/Sizes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             'instance_manager' => $instance_manager,
30 30
             'instances' => $instances);
31 31
 
32
-        $tpl = $this->template->create(dirname(__FILE__) . '/../templates/sizes');
32
+        $tpl = $this->template->create(dirname(__FILE__).'/../templates/sizes');
33 33
         return $tpl->render($this, $data);
34 34
     }
35 35
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             'instance_manager' => $instance_manager,
48 48
             'value' => $value);
49 49
 
50
-        $tpl = $this->template->create(dirname(__FILE__) . '/../templates/sizes-edit');
50
+        $tpl = $this->template->create(dirname(__FILE__).'/../templates/sizes-edit');
51 51
         return $tpl->render($this, $data);
52 52
     }
53 53
 
Please login to merge, or discard this patch.
src/Intraface/Filehandler/Controller/Size.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             'instance_manager' => $instance_manager,
22 22
             'value' => $value);
23 23
 
24
-        $tpl = $this->template->create(dirname(__FILE__) . '/../templates/sizes-edit');
24
+        $tpl = $this->template->create(dirname(__FILE__).'/../templates/sizes-edit');
25 25
         return $tpl->render($this, $data);
26 26
     }
27 27
 
Please login to merge, or discard this patch.
src/Intraface/shared/email/Email.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         $db = new DB_Sql;
83 83
         $db->query('SET NAMES utf8'); /* To be removed when everything is in utf-8 */
84
-        $sql = "SELECT id, email.date_sent, DATE_FORMAT(date_sent, '%d-%m-%Y') as date_sent_dk, subject, from_name, from_email, user_id, body, status, contact_id, contact_person_id, type_id, belong_to_id, status, bcc_to_user FROM email WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = " . $this->id;
84
+        $sql = "SELECT id, email.date_sent, DATE_FORMAT(date_sent, '%d-%m-%Y') as date_sent_dk, subject, from_name, from_email, user_id, body, status, contact_id, contact_person_id, type_id, belong_to_id, status, bcc_to_user FROM email WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id;
85 85
         $db->query($sql);
86 86
         if (!$db->nextRecord()) {
87 87
             return false;
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
         if ($this->id == 0) {
175 175
             $sql_type = "INSERT INTO ";
176 176
             $sql_end = ", date_created = NOW(),
177
-                belong_to_id = ".(int)$var['belong_to'] . ",
178
-                type_id = ".(int)$var['type_id'] . ",
177
+                belong_to_id = ".(int)$var['belong_to'].",
178
+                type_id = ".(int)$var['type_id'].",
179 179
                 contact_id=".$var['contact_id'];
180 180
         } else {
181 181
             $sql_type = "UPDATE ";
182
-            $sql_end = " WHERE id = " . $this->id;
182
+            $sql_end = " WHERE id = ".$this->id;
183 183
         }
184 184
 
185 185
         if (!empty($var['date_deadline'])) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         // gemme userid hvis vi er inde i systemet
192 192
         if (is_object($this->kernel->user) and $this->kernel->user->get('id') > 0) {
193 193
             //$db->query("UPDATE email SET user_id = ".$this->kernel->user->get('id')." WHERE id = " . $this->id);
194
-            $sql_extra = ', user_id = ' . $db->quote($this->kernel->user->get('id'), 'integer');
194
+            $sql_extra = ', user_id = '.$db->quote($this->kernel->user->get('id'), 'integer');
195 195
         }
196 196
 
197 197
         if (!isset($var['contact_person_id'])) {
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
         }
204 204
 
205 205
         // status 1 = draft
206
-        $sql = $sql_type . " email SET
206
+        $sql = $sql_type." email SET
207 207
             contact_person_id = ".(int)$var['contact_person_id'].",
208 208
             bcc_to_user = ".(int)$var['bcc_to_user'].",
209 209
             date_updated = NOW(),
210
-            intranet_id = " . $this->kernel->intranet->get('id') . ",
210
+            intranet_id = " . $this->kernel->intranet->get('id').",
211 211
             subject = '".$var['subject']."',
212 212
             body = '".$var['body']."',
213 213
             date_deadline = ".$date_deadline.",
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     function saveErrorMsg($error)
246 246
     {
247 247
         $db = new DB_Sql;
248
-        $db->query("UPDATE email SET error_msg = '".$error."' WHERE id = " . $this->id);
248
+        $db->query("UPDATE email SET error_msg = '".$error."' WHERE id = ".$this->id);
249 249
         return true;
250 250
     }
251 251
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             return false;
261 261
         }
262 262
         $db = new DB_Sql;
263
-        $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = " . $this->id);
263
+        $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = ".$this->id);
264 264
         return true;
265 265
     }
266 266
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
         $db = new DB_Sql;
293 293
         // Putter e-mailen i outboxen (status = 2)
294
-        $db->query("UPDATE email SET status = 2 WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = " . $this->id);
294
+        $db->query("UPDATE email SET status = 2 WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id);
295 295
         return true;
296 296
     }
297 297
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
     {
300 300
         $contact = $this->getContact();
301 301
         if ($this->get('contact_id') == 0 or !is_object($contact)) {
302
-            $this->error->set('Der kunne ikke sendes e-mail til email #' . $this->get('id') . ' fordi der ikke var nogen kunde sat');
302
+            $this->error->set('Der kunne ikke sendes e-mail til email #'.$this->get('id').' fordi der ikke var nogen kunde sat');
303 303
             return false;
304 304
         }
305 305
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
     {
384 384
         $db = new DB_Sql;
385 385
         $db->query("SELECT file_id, filename FROM email_attachment
386
-            WHERE intranet_id = " .$this->kernel->intranet->get('id') . " AND email_id = " . $this->id);
386
+            WHERE intranet_id = " .$this->kernel->intranet->get('id')." AND email_id = ".$this->id);
387 387
         $file = array();
388 388
         $i = 0;
389 389
         while ($db->nextRecord()) {
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
             return false;
415 415
         }
416 416
         $db = new DB_Sql;
417
-        $db->query("DELETE FROM email WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
417
+        $db->query("DELETE FROM email WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
418 418
         return true;
419 419
     }
420 420
 
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Shop/Server0100.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -72,40 +72,40 @@  discard block
 block discarded – undo
72 72
         }
73 73
 
74 74
         // sublevel has to be used so other searches are not overwritten
75
-        $product->getDBQuery()->storeResult('use_stored', 'webshop_' . $area . '_' .  md5($this->credentials['session_id']), 'sublevel');
75
+        $product->getDBQuery()->storeResult('use_stored', 'webshop_'.$area.'_'.md5($this->credentials['session_id']), 'sublevel');
76 76
         $debug2 = serialize($mixed);
77 77
         if (isset($mixed['offset']) and is_numeric($mixed['offset']) and $mixed['offset'] > 0) {
78 78
             $product->getDBQuery()->useStored(true);
79 79
             $product->getDBQuery()->setPagingOffset((int)$mixed['offset']);
80
-            $debug2 .= 'offset ' . $mixed['offset'];
80
+            $debug2 .= 'offset '.$mixed['offset'];
81 81
         } elseif (isset($mixed['use_stored']) and array_key_exists('use_stored', $mixed) and $mixed['use_stored'] == 'true') {
82 82
             $product->getDBQuery()->useStored(true);
83 83
             $debug2 .= 'use_stored true';
84 84
         } else {
85 85
             if (array_key_exists('search', $mixed) and !empty($mixed['search'])) {
86 86
                 $product->getDBQuery()->setFilter('search', $mixed['search']);
87
-                $debug2 .= 'search ' . $mixed['search'];
87
+                $debug2 .= 'search '.$mixed['search'];
88 88
             }
89 89
 
90 90
             if (array_key_exists('keywords', $mixed) and !empty($mixed['keywords'])) {
91 91
                 $product->getDBQuery()->setFilter('keywords', $mixed['keywords']);
92
-                $debug2 .= 'keyword ' . $mixed['keywords'];
92
+                $debug2 .= 'keyword '.$mixed['keywords'];
93 93
             }
94 94
 
95 95
             if (array_key_exists('category', $mixed) and !empty($mixed['category'])) {
96 96
                 $product->getDBQuery()->setFilter('shop_id', $shop_id);
97 97
                 $product->getDBQuery()->setFilter('category', $mixed['category']);
98
-                $debug2 .= 'category ' . $mixed['category'];
98
+                $debug2 .= 'category '.$mixed['category'];
99 99
             }
100 100
 
101 101
             if (isset($mixed['ids']) and array_key_exists('ids', $mixed) and is_array($mixed['ids'])) {
102 102
                 $product->getDBQuery()->setFilter('ids', $mixed['ids']);
103
-                $debug2 .= 'ids ' . implode(', ', $mixed['ids']);
103
+                $debug2 .= 'ids '.implode(', ', $mixed['ids']);
104 104
             }
105 105
 
106 106
             if (array_key_exists('sorting', $mixed) and !empty($mixed['sorting'])) {
107 107
                 $product->getDBQuery()->setFilter('sorting', $mixed['sorting']);
108
-                $debug2 .= 'sorting ' . $mixed['sorting'];
108
+                $debug2 .= 'sorting '.$mixed['sorting'];
109 109
             }
110 110
         }
111 111
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 
450 450
         if (PEAR::isError($db)) {
451 451
             require_once 'XML/RPC2/Exception.php';
452
-            throw new XML_RPC2_FaultException($db->getMessage() . $db->getUserInfo(), -1);
452
+            throw new XML_RPC2_FaultException($db->getMessage().$db->getUserInfo(), -1);
453 453
         }
454 454
 
455 455
         $featured = new Intraface_modules_shop_FeaturedProducts($this->kernel->intranet, $this->webshop->getShop(), $db);
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 
717 717
         if (!$order_id = $this->webshop->placeOrder($values)) {
718 718
             require_once 'XML/RPC2/Exception.php';
719
-            throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
719
+            throw new XML_RPC2_FaultException('order could not be placed. It returned the following error: '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
720 720
         }
721 721
 
722 722
         return $this->prepareResponseData($this->webshop->getOrderIdentifierKey());
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 
747 747
         if (!$this->webshop->getBasket()->saveAddress($values)) {
748 748
             require_once 'XML/RPC2/Exception.php';
749
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
749
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
750 750
         }
751 751
 
752 752
         return $this->prepareResponseData(true);
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
         $customer_coupon = $this->processRequestData($customer_coupon);
788 788
         if (!$this->webshop->getBasket()->saveCustomerCoupon($customer_coupon)) {
789 789
             require_once 'XML/RPC2/Exception.php';
790
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
790
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
791 791
         }
792 792
 
793 793
         return $this->prepareResponseData(true);
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
         $customer_ean = $this->processRequestData($customer_ean);
829 829
         if (!$this->webshop->getBasket()->saveCustomerEan($customer_ean)) {
830 830
             require_once 'XML/RPC2/Exception.php';
831
-            throw new XML_RPC2_FaultException('ean could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
831
+            throw new XML_RPC2_FaultException('ean could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
832 832
         }
833 833
 
834 834
         return $this->prepareResponseData(true);
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
         $customer_comment = $this->processRequestData($customer_comment);
871 871
         if (!$this->webshop->getBasket()->saveCustomerComment($customer_comment)) {
872 872
             require_once 'XML/RPC2/Exception.php';
873
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
873
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
874 874
         }
875 875
 
876 876
         return $this->prepareResponseData(true);
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
         $payment_method = $this->processRequestData($payment_method);
930 930
         if (!$this->webshop->getBasket()->savePaymentMethod($payment_method)) {
931 931
             require_once 'XML/RPC2/Exception.php';
932
-            throw new XML_RPC2_FaultException('datails could not be saved ' . strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
932
+            throw new XML_RPC2_FaultException('datails could not be saved '.strtolower(implode(', ', $this->webshop->error->getMessage())), -4);
933 933
         }
934 934
 
935 935
         return $this->prepareResponseData(true);
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Server0100.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
         if (count($credentials) != 2) { // -4
72 72
             require_once 'XML/RPC2/Exception.php';
73
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
73
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
74 74
         }
75 75
         if (empty($credentials['private_key'])) { // -5
76 76
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Contact/Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@
 block discarded – undo
269 269
     {
270 270
         if (count($credentials) != 2) { // -4
271 271
             require_once 'XML/RPC2/Exception.php';
272
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
272
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
273 273
         }
274 274
         if (empty($credentials['private_key'])) { // -5
275 275
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/XMLRPC/Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
         if (count($credentials) != 2) { // -4
72 72
             require_once 'XML/RPC2/Exception.php';
73
-            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got ' . count($credentials) . ' arguments - need 2', -4);
73
+            throw new XML_RPC2_FaultException('wrong argument count in $credentials - got '.count($credentials).' arguments - need 2', -4);
74 74
         }
75 75
         if (empty($credentials['private_key'])) { // -5
76 76
             require_once 'XML/RPC2/Exception.php';
Please login to merge, or discard this patch.
src/Intraface/User.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $this->error       = $this->getError();
86 86
 
87 87
         if (PEAR::isError($this->db)) {
88
-            throw new Exception($this->db->getMessage() . $this->db->getUserInfo());
88
+            throw new Exception($this->db->getMessage().$this->db->getUserInfo());
89 89
         }
90 90
 
91 91
         if ($this->id > 0) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     protected function load()
110 110
     {
111
-        $result = $this->db->query("SELECT id, email, disabled FROM user WHERE id = " . $this->db->quote($this->id, 'integer'));
111
+        $result = $this->db->query("SELECT id, email, disabled FROM user WHERE id = ".$this->db->quote($this->id, 'integer'));
112 112
 
113 113
         if (PEAR::isError($result)) {
114 114
             throw new Exception($result->getUserInfo());
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         if (!empty($this->modules[$module])) {
201 201
             return $module_id = $this->modules[$module];
202 202
         } else {
203
-            throw new Exception('user says unknown module ' . $module);
203
+            throw new Exception('user says unknown module '.$module);
204 204
         }
205 205
     }
206 206
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      */
261 261
     public function hasModuleAccess($module, $intranet_id = 0)
262 262
     {
263
-        $filename = PATH_INCLUDE_MODULE . $module . '/Main' . ucfirst($module) . '.php';
263
+        $filename = PATH_INCLUDE_MODULE.$module.'/Main'.ucfirst($module).'.php';
264 264
         if (file_exists($filename)) {
265 265
             require_once $filename;
266 266
             $module_class = 'Main'.ucfirst($module);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
     {
466 466
         $id = intval($id);
467 467
         if ($this->hasIntranetAccess($id)) {
468
-            $this->db->exec("UPDATE user SET active_intranet_id = ". $this->db->quote($id, 'integer')." WHERE id = ". $this->db->quote($this->get('id'), 'integer'));
468
+            $this->db->exec("UPDATE user SET active_intranet_id = ".$this->db->quote($id, 'integer')." WHERE id = ".$this->db->quote($this->get('id'), 'integer'));
469 469
             return $id;
470 470
         }
471 471
         return false;
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
         $row = $result->fetchRow(MDB2_FETCHMODE_ASSOC);
569 569
         $new_password = Intraface_Kernel::randomKey(8);
570 570
 
571
-        $db->exec("UPDATE user SET password = '".md5($new_password)."' WHERE id =" . $row['id']);
571
+        $db->exec("UPDATE user SET password = '".md5($new_password)."' WHERE id =".$row['id']);
572 572
 
573 573
         return $new_password;
574 574
     }
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
             return false;
580 580
         }
581 581
 
582
-        $result = $this->db->query("SELECT * FROM user WHERE password = '".safeToDb(md5($old_password))."' AND id = " . $this->get('id'));
582
+        $result = $this->db->query("SELECT * FROM user WHERE password = '".safeToDb(md5($old_password))."' AND id = ".$this->get('id'));
583 583
         if ($result->numRows() < 1) {
584 584
             $this->error->set('error in old password');
585 585
         }
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
             return false;
596 596
         }
597 597
 
598
-        $this->db->query("UPDATE user SET password = '".safeToDb(md5($new_password))."' WHERE id = " . $this->get('id'));
598
+        $this->db->query("UPDATE user SET password = '".safeToDb(md5($new_password))."' WHERE id = ".$this->get('id'));
599 599
 
600 600
         return true;
601 601
     }
Please login to merge, or discard this patch.