Completed
Branch master (6ed6e7)
by Lars
07:57
created
src/Intraface/modules/debtor/Controller/Item.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         if (isset($_GET['change_product'])) {
33 33
         	$redirect = Intraface_Redirect::factory($this->getKernel(), 'go');
34
-        	$url = $redirect->setDestination(NET_SCHEME . NET_HOST . $this->url('selectproduct'), NET_SCHEME . NET_HOST . $this->url());
34
+        	$url = $redirect->setDestination(NET_SCHEME.NET_HOST.$this->url('selectproduct'), NET_SCHEME.NET_HOST.$this->url());
35 35
         	$redirect->askParameter('product_id');
36 36
         	return new k_SeeOther($url);
37 37
         }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         }
45 45
         */
46 46
 
47
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/item-edit');
47
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/item-edit');
48 48
         return $smarty->render($this);
49 49
     }
50 50
 
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Controller/Reminder.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             }
52 52
         }
53 53
 
54
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/reminder');
54
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/reminder');
55 55
         return $smarty->render($this);
56 56
     }
57 57
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             $checked_reminder[] = $reminders[$i]["reminder_id"];
83 83
         }
84 84
 
85
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/reminder-edit');
85
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/reminder-edit');
86 86
         return $smarty->render($this, array('value' => $value, 'checked_invoice' => $checked_invoice, 'checked_reminder' => $checked_reminder));
87 87
     }
88 88
 
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
             throw new Exception('Kontaktpersonen har ikke nogen email');
181 181
         }
182 182
 
183
-        $subject  =	"Påmindelse om betaling";
183
+        $subject = "Påmindelse om betaling";
184 184
 
185 185
         $reminder_text = new Reminder_Text();
186 186
         $reminder_text->visit($reminder);
187 187
 
188 188
         $body = $reminder_text->getText();
189 189
 
190
-        switch($this->getKernel()->setting->get('intranet', 'debtor.sender')) {
190
+        switch ($this->getKernel()->setting->get('intranet', 'debtor.sender')) {
191 191
             case 'intranet':
192 192
                 $from_email = '';
193 193
                 $from_name = '';
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         if ($id = $email->save($var)) {
219 219
             $redirect = new Intraface_Redirect($this->getKernel());
220 220
             $shared_email = $this->getKernel()->useModule('email');
221
-            $url = $redirect->setDestination($shared_email->getPath() . $id . '?edit', NET_SCHEME . NET_HOST . $this->url());
221
+            $url = $redirect->setDestination($shared_email->getPath().$id.'?edit', NET_SCHEME.NET_HOST.$this->url());
222 222
             $redirect->setIdentifier('send_email');
223 223
             $redirect->askParameter('send_email_status');
224 224
             return new k_SeeOther($url);
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
 
264 264
     function visit(Reminder $reminder)
265 265
     {
266
-        $this->output .= "Dato: " . $reminder->get("dk_this_date") ."\n\n";
267
-        $this->output .= $reminder->contact->address->get("name") . "\n";
266
+        $this->output .= "Dato: ".$reminder->get("dk_this_date")."\n\n";
267
+        $this->output .= $reminder->contact->address->get("name")."\n";
268 268
         if ($reminder->get("attention_to") != "") {
269 269
             $this->output .= "Att.: ".$reminder->get("attention_to")."\n";
270 270
         }
271
-        $this->output .= $reminder->contact->address->get("address") . "\n";
272
-        $this->output .= $reminder->contact->address->get("postcode") . "  " .  $reminder->contact->address->get("city") ."\n\n";
273
-        $this->output .= $reminder->get("text") . "\n\n";
271
+        $this->output .= $reminder->contact->address->get("address")."\n";
272
+        $this->output .= $reminder->contact->address->get("postcode")."  ".$reminder->contact->address->get("city")."\n\n";
273
+        $this->output .= $reminder->get("text")."\n\n";
274 274
 
275 275
         // Overskrifter - Vareudskrivning
276 276
         $this->output .= "Beskrivelse          Dato        Forfaldsdato    Bel�b\n";
@@ -280,25 +280,25 @@  discard block
 block discarded – undo
280 280
         for ($i = 0, $max = count($items); $i < $max; $i++) {
281 281
             $this->output .= "\nFak# ".$items[$i]["number"];
282 282
             $spaces = -strlen($items[$i]["number"]) - 5 + 20;
283
-            for ($j = 0; $j < $spaces; $j++) { $this->output .= ' ';  }
284
-                $this->output .= ' ' . $items[$i]["dk_this_date"];
285
-                $this->output .= '  ' . $items[$i]["dk_due_date"];
286
-                $this->output .= '      ' . number_format($items[$i]["arrears"], 2, ",", ".");
283
+            for ($j = 0; $j < $spaces; $j++) { $this->output .= ' '; }
284
+                $this->output .= ' '.$items[$i]["dk_this_date"];
285
+                $this->output .= '  '.$items[$i]["dk_due_date"];
286
+                $this->output .= '      '.number_format($items[$i]["arrears"], 2, ",", ".");
287 287
                 $total += $items[$i]["arrears"];
288 288
             }
289 289
             $items = $reminder->item->getList("reminder");
290 290
             for ($i = 0, $max = count($items); $i < $max; $i++) {
291 291
                 $this->output .= "\nTidl. rykkkergebyr  ";
292
-                $this->output .= ' ' . $items[$i]["dk_this_date"];
293
-                $this->output .= '  ' .$items[$i]["dk_due_date"];
294
-                $this->output .= '      ' . number_format($items[$i]["reminder_fee"], 2, ",", ".");
292
+                $this->output .= ' '.$items[$i]["dk_this_date"];
293
+                $this->output .= '  '.$items[$i]["dk_due_date"];
294
+                $this->output .= '      '.number_format($items[$i]["reminder_fee"], 2, ",", ".");
295 295
                 $total += $items[$i]["reminder_fee"];
296 296
             }
297 297
             if ($reminder->get("reminder_fee") != 0) {
298 298
                 $this->output .= "\nRykkergebyr                                      ".number_format($reminder->get("reminder_fee"), 2, ",", ".");
299 299
                 $total += $reminder->get("reminder_fee");
300 300
             }
301
-            $this->output .= "\n\nTotal:                                           " . number_format($total, 2, ",", ".");
301
+            $this->output .= "\n\nTotal:                                           ".number_format($total, 2, ",", ".");
302 302
 
303 303
             $parameter = array(
304 304
                 "contact" => $reminder->contact,
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 "amount" => $total,
307 307
                 "due_date" => $reminder->get("dk_due_date"),
308 308
                 "girocode" => $reminder->get("girocode"));
309
-            $this->output .= "\n\nDet skyldige beløb betales senest: " . $parameter['due_date'];
309
+            $this->output .= "\n\nDet skyldige beløb betales senest: ".$parameter['due_date'];
310 310
 
311 311
             // TODO: change to payment_method
312 312
             switch ($reminder->get('payment_method_key')) {
@@ -316,16 +316,16 @@  discard block
 block discarded – undo
316 316
                     $this->output .= "\nBank:                ".$reminder->kernel->setting->get('intranet', 'bank_name');
317 317
                     $this->output .= "\nRegnr.:              ".$reminder->kernel->setting->get('intranet', 'bank_reg_number');
318 318
                     $this->output .= "\nKontonr.:            ".$reminder->kernel->setting->get('intranet', 'bank_account_number');
319
-                    $this->output .= "\nBesked til modtager: " . "Kunde #" . $reminder->contact->get("number");
319
+                    $this->output .= "\nBesked til modtager: "."Kunde #".$reminder->contact->get("number");
320 320
                 break;
321 321
                 case 3:
322 322
                     $this->output .= "\n\nBetaling via homebanking\n+71< ".str_repeat("0", 15 - strlen($parameter["girocode"])).$parameter["girocode"]." +".$kernel->setting->get('intranet', 'giro_account_number')."<";
323 323
                 break;
324 324
             }
325 325
 
326
-            $this->output .= "\n\nMed venlig hilsen\n\n" . $reminder->kernel->user->getAddress()->get("name") . "\n" .$reminder->kernel->intranet->get("name");
327
-            $this->output .= "\n" . $reminder->kernel->intranet->address->get("address");
328
-            $this->output .= "\n" . $reminder->kernel->intranet->address->get("postcode") . "  " . $reminder->kernel->intranet->address->get("city");
326
+            $this->output .= "\n\nMed venlig hilsen\n\n".$reminder->kernel->user->getAddress()->get("name")."\n".$reminder->kernel->intranet->get("name");
327
+            $this->output .= "\n".$reminder->kernel->intranet->address->get("address");
328
+            $this->output .= "\n".$reminder->kernel->intranet->address->get("postcode")."  ".$reminder->kernel->intranet->address->get("city");
329 329
     }
330 330
 
331 331
     public function getText()
Please login to merge, or discard this patch.
src/Intraface/modules/shop/BasketEvaluation.php 1 patch
Spacing   +23 added lines, -23 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,22 +146,22 @@  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
 
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
             $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'));
170 170
 
171 171
             if (PEAR::isError($result)) {
172
-                throw new Exception($result->getMessage() . $result->getUserInfo());
172
+                throw new Exception($result->getMessage().$result->getUserInfo());
173 173
                 return false;
174 174
             }
175 175
 
176 176
             $this->id = $this->db->lastInsertID();
177 177
             if (PEAR::isError($this->id)) {
178
-                throw new Exception($result->getMessage() . $result->getUserInfo());
178
+                throw new Exception($result->getMessage().$result->getUserInfo());
179 179
             }
180 180
         }
181 181
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     {
192 192
         $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'));
193 193
         if (PEAR::isError($result)) {
194
-            throw new Exception($result->getMessage() . $result->getUserInfo());
194
+            throw new Exception($result->getMessage().$result->getUserInfo());
195 195
             return false;
196 196
         }
197 197
         return true;
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
      */
205 205
     public function getList()
206 206
     {
207
-        $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
+        $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");
208 208
 
209 209
         if (PEAR::isError($this->id)) {
210
-            throw new Exception($result->getMessage() . $result->getUserInfo());
210
+            throw new Exception($result->getMessage().$result->getUserInfo());
211 211
         }
212 212
 
213 213
         $i = 0;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
             $evaluation_result = false;
251 251
 
252
-            switch($evaluation['evaluate_target']) {
252
+            switch ($evaluation['evaluate_target']) {
253 253
                 case 'price':
254 254
                     $evaluate = (double)$basket->getTotalPrice();
255 255
                     settype($evaluation['evaluate_value'], 'double');
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                     return false;
320 320
             }
321 321
 
322
-            switch($evaluation['evaluate_method']) {
322
+            switch ($evaluation['evaluate_method']) {
323 323
                 case 'equals':
324 324
                     if ($evaluate == $evaluation['evaluate_value']) {
325 325
                         $evaluation_result = true;
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             if ($evaluation_result) {
349 349
                 $go_to_index = $evaluation['go_to_index_after'];
350 350
 
351
-                switch($evaluation['action_unit']) {
351
+                switch ($evaluation['action_unit']) {
352 352
                     case 'pieces':
353 353
                         $quantity = $evaluation['action_quantity'];
354 354
                         break;
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
                         return false;
364 364
                 }
365 365
 
366
-                switch($evaluation['action_action']) {
366
+                switch ($evaluation['action_action']) {
367 367
                     case 'no_action':
368 368
                         // fine nothing is done
369 369
                         break;
Please login to merge, or discard this patch.
src/Intraface/modules/shop/Shop.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,21 +4,21 @@
 block discarded – undo
4 4
     public function setTableDefinition()
5 5
     {
6 6
         $this->setTableName('shop');
7
-        $this->hasColumn('name',                         'string',  255);
8
-        $this->hasColumn('description',                  'string',  65555);
9
-        $this->hasColumn('identifier',                   'string',  255);
10
-        $this->hasColumn('show_online',                  'integer', 1);
11
-        $this->hasColumn('send_confirmation',            'integer', 1);
12
-        $this->hasColumn('confirmation_subject',         'string',  255);
13
-        $this->hasColumn('confirmation_greeting',        'string',  255);
14
-        $this->hasColumn('confirmation',                 'string',  65555);
7
+        $this->hasColumn('name', 'string', 255);
8
+        $this->hasColumn('description', 'string', 65555);
9
+        $this->hasColumn('identifier', 'string', 255);
10
+        $this->hasColumn('show_online', 'integer', 1);
11
+        $this->hasColumn('send_confirmation', 'integer', 1);
12
+        $this->hasColumn('confirmation_subject', 'string', 255);
13
+        $this->hasColumn('confirmation_greeting', 'string', 255);
14
+        $this->hasColumn('confirmation', 'string', 65555);
15 15
         $this->hasColumn('confirmation_add_contact_url', 'integer', 1);
16
-        $this->hasColumn('receipt',                      'string',  65555);
17
-        $this->hasColumn('payment_link',                 'string',  255);
18
-        $this->hasColumn('payment_link_add',             'integer', 1);
19
-        $this->hasColumn('terms_of_trade_url',           'string',  255);
20
-        $this->hasColumn('default_currency_id',          'integer');
21
-        $this->hasColumn('language_key',                 'integer');
16
+        $this->hasColumn('receipt', 'string', 65555);
17
+        $this->hasColumn('payment_link', 'string', 255);
18
+        $this->hasColumn('payment_link_add', 'integer', 1);
19
+        $this->hasColumn('terms_of_trade_url', 'string', 255);
20
+        $this->hasColumn('default_currency_id', 'integer');
21
+        $this->hasColumn('language_key', 'integer');
22 22
 
23 23
     }
24 24
 
Please login to merge, or discard this patch.
src/Intraface/modules/shop/Coordinator.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 
195 195
         if (isset($input['customer_coupon']) && $input['customer_coupon'] != '') {
196 196
             if ($value['message'] != '') $value['message'] .= "\n\n";
197
-            $value['message'] .= "Kundekupon:". $input['customer_coupon'];
197
+            $value['message'] .= "Kundekupon:".$input['customer_coupon'];
198 198
         }
199 199
 
200 200
         if (isset($input['customer_comment']) && $input['customer_comment'] != '') {
201 201
             if ($value['message'] != '') $value['message'] .= "\n\n";
202
-            $value['message'] .= "Kommentar:\n". $input['customer_comment'];
202
+            $value['message'] .= "Kommentar:\n".$input['customer_comment'];
203 203
         }
204 204
 
205 205
         if (isset($input['payment_method']) && is_array($input['payment_method']) && !empty($input['payment_method'])) {
@@ -324,15 +324,15 @@  discard block
 block discarded – undo
324 324
         $email = new Email($this->kernel);
325 325
 
326 326
         if ($this->shop->getConfirmationSubject()) {
327
-            $subject = $this->shop->getConfirmationSubject() . ' (#' . $this->order->get('number') . ')';
327
+            $subject = $this->shop->getConfirmationSubject().' (#'.$this->order->get('number').')';
328 328
         } else {
329
-            $subject = 'Bekræftelse på bestilling (#' . $this->order->get('number') . ')';
329
+            $subject = 'Bekræftelse på bestilling (#'.$this->order->get('number').')';
330 330
         }
331 331
 
332 332
         $body = $this->shop->getConfirmationText();
333 333
 
334 334
         if ($this->shop->showPaymentUrl()) {
335
-            $body .=  "\n\n" . $this->shop->getPaymentUrl() . $this->order->getIdentifier();
335
+            $body .= "\n\n".$this->shop->getPaymentUrl().$this->order->getIdentifier();
336 336
         }
337 337
 
338 338
         // @todo improve this table
@@ -348,19 +348,19 @@  discard block
 block discarded – undo
348 348
                 $currency_iso_code = 'DKK';
349 349
             }
350 350
 
351
-            $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' ' . $amount));
351
+            $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' '.$amount));
352 352
         }
353 353
 
354
-        $body .= "\n\n" . $table->getTable();
354
+        $body .= "\n\n".$table->getTable();
355 355
 
356 356
         if ($this->shop->getConfirmationGreeting()) {
357
-            $body .=  "\n\n" . $this->shop->getConfirmationGreeting();
357
+            $body .= "\n\n".$this->shop->getConfirmationGreeting();
358 358
         } else {
359
-            $body .= "Venlig hilsen\n".  $this->kernel->intranet->address->get('name');
359
+            $body .= "Venlig hilsen\n".$this->kernel->intranet->address->get('name');
360 360
         }
361 361
 
362 362
         if ($this->shop->showLoginUrl()) {
363
-            $body .=  "\n\n" . $this->contact->getLoginUrl();
363
+            $body .= "\n\n".$this->contact->getLoginUrl();
364 364
         }
365 365
 
366 366
         if (!$email->save(array('contact_id' => $this->contact->get('id'),
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
         $this->kernel->useShared('email');
436 436
         $email = new Email($this->kernel);
437 437
 
438
-        $subject = 'Bekræftelse på betaling (#' . $payment_id . ')';
438
+        $subject = 'Bekræftelse på betaling (#'.$payment_id.')';
439 439
         $body = 'Vi har modtaget din betaling. Hvis din ordre var afsendt inden kl. 12.00, sender vi den allerede i dag.';
440
-        $body .= "\n\nVenlig hilsen\n".  $this->kernel->intranet->address->get('name');
440
+        $body .= "\n\nVenlig hilsen\n".$this->kernel->intranet->address->get('name');
441 441
 
442 442
         if (!$email->save(array('contact_id' => $this->contact->get('id'),
443 443
                                 'subject' => $subject,
Please login to merge, or discard this patch.
src/Intraface/modules/shop/PaymentMethods.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
     public function setTableDefinition()
5 5
     {
6 6
         $this->setTableName('shop_paymentmethods');
7
-        $this->hasColumn('paymentmethod_key', 'integer',  11);
8
-        $this->hasColumn('text',  'string',  65555);
9
-        $this->hasColumn('shop_id',   'integer',  11);
7
+        $this->hasColumn('paymentmethod_key', 'integer', 11);
8
+        $this->hasColumn('text', 'string', 65555);
9
+        $this->hasColumn('shop_id', 'integer', 11);
10 10
     }
11 11
 
12 12
     public function setUp()
Please login to merge, or discard this patch.
src/Intraface/modules/shop/FeaturedProducts.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $result = $this->db->query('SELECT id 
44 44
                                     FROM shop_featuredproducts 
45
-                                    WHERE intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer') . ' 
46
-                                        AND shop_id = ' . $this->db->quote($this->shop->getId(), 'integer') . ' 
45
+                                    WHERE intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer').' 
46
+                                        AND shop_id = ' . $this->db->quote($this->shop->getId(), 'integer').' 
47 47
                                         AND keyword_id  = ' . $this->db->quote($keyword->getId(), 'integer'));
48 48
         if (PEAR::isError($result)) {
49 49
             throw new Exception($result->getUserInfo());
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     function delete($id)
73 73
     {
74
-        $result = $this->db->query('DELETE FROM shop_featuredproducts WHERE intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer') . ' AND shop_id = ' . $this->db->quote($this->shop->getId(), 'integer') . ' AND id  = ' . $this->db->quote($id, 'integer'));
74
+        $result = $this->db->query('DELETE FROM shop_featuredproducts WHERE intranet_id = '.$this->db->quote($this->intranet->getId(), 'integer').' AND shop_id = '.$this->db->quote($this->shop->getId(), 'integer').' AND id  = '.$this->db->quote($id, 'integer'));
75 75
         if (PEAR::isError($result)) {
76 76
             throw new Exception($result->getUserInfo());
77 77
         }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     function getAll()
82 82
     {
83 83
         $result = $this->db->query('SELECT * FROM shop_featuredproducts 
84
-                                    WHERE intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer') . ' 
84
+                                    WHERE intranet_id = ' . $this->db->quote($this->intranet->getId(), 'integer').' 
85 85
                                         AND shop_id = ' . $this->db->quote($this->shop->getId(), 'integer'));
86 86
         if (PEAR::isError($result)) {
87 87
             throw new Exception($result->getUserInfo());
Please login to merge, or discard this patch.
src/Intraface/modules/shop/DiscountCampaign/Voucher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
     {
11 11
         $this->setTableName('shop_dicount_campaign_voucher');
12 12
         $this->hasColumn('shop_discount_campaign_id', 'integer', 4, array('type' => 'integer', 'length' => 4, 'default' => '0', 'notnull' => true));
13
-        $this->hasColumn('code', 'string',  255, array('type' => 'string', 'length' => 255, 'notnull' => true));
13
+        $this->hasColumn('code', 'string', 255, array('type' => 'string', 'length' => 255, 'notnull' => true));
14 14
         $this->hasColumn('quantity', 'integer', 11, array('type' => 'integer', 'length' => 11, 'default' => '0', 'notnull' => true));
15
-        $this->hasColumn('date_created', 'timestamp',  NULL, array('type' => 'timestamp', 'default' => new Doctrine_Expression('NOW()'), 'notnull' => true));
16
-        $this->hasColumn('date_expiry', 'timestamp',  NULL, array('type' => 'timestamp', 'notnull' => true));
15
+        $this->hasColumn('date_created', 'timestamp', NULL, array('type' => 'timestamp', 'default' => new Doctrine_Expression('NOW()'), 'notnull' => true));
16
+        $this->hasColumn('date_expiry', 'timestamp', NULL, array('type' => 'timestamp', 'notnull' => true));
17 17
         $this->hasColumn('used_on_debtor_id', 'integer', 11, array('type' => 'integer', 'length' => 11, 'default' => '0', 'notnull' => true));
18 18
         $this->hasColumn('created_from_debtor_id', 'integer', 11, array('type' => 'integer', 'length' => 11, 'default' => '0', 'notnull' => true));
19 19
 
Please login to merge, or discard this patch.
src/Intraface/modules/shop/Basket.php 1 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()) {
@@ -576,9 +576,9 @@  discard block
 block discarded – undo
576 576
                 ON product.id = basket.product_id
577 577
             INNER JOIN product_detail
578 578
                 ON product.id = product_detail.product_id
579
-            WHERE " . $sql_extra . "
579
+            WHERE " . $sql_extra."
580 580
                 AND product_detail.active = 1
581
-                AND basket.intranet_id = " . $this->intranet->getId() . "
581
+                AND basket.intranet_id = " . $this->intranet->getId()."
582 582
             ORDER BY product_detail.vat DESC, basket.basketevaluation_product");
583 583
 
584 584
         $i = 0;
@@ -630,16 +630,16 @@  discard block
 block discarded – undo
630 630
 
631 631
             // basket specific
632 632
             $items[$i]['quantity'] = $db->f('quantity');
633
-            $items[$i]['totalweight'] = $items[$i]['weight'] * $db->f('quantity');
634
-            $items[$i]['totalprice'] = $db->f('quantity') * $items[$i]['price'];
635
-            $items[$i]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['price_incl_vat'];
633
+            $items[$i]['totalweight'] = $items[$i]['weight']*$db->f('quantity');
634
+            $items[$i]['totalprice'] = $db->f('quantity')*$items[$i]['price'];
635
+            $items[$i]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['price_incl_vat'];
636 636
 
637
-            $items[$i]['currency']['DKK']['totalprice'] = $db->f('quantity') * $items[$i]['currency']['DKK']['price'];
638
-            $items[$i]['currency']['DKK']['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['currency']['DKK']['price_incl_vat'];
637
+            $items[$i]['currency']['DKK']['totalprice'] = $db->f('quantity')*$items[$i]['currency']['DKK']['price'];
638
+            $items[$i]['currency']['DKK']['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['currency']['DKK']['price_incl_vat'];
639 639
             if (is_object($currencies) && $currencies->count() > 0) {
640 640
                 foreach ($currencies AS $currency) {
641
-                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice'] = $db->f('quantity') * $items[$i]['currency'][$currency->getType()->getIsoCode()]['price'];
642
-                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice_incl_vat'] = $db->f('quantity') * $items[$i]['currency'][$currency->getType()->getIsoCode()]['price_incl_vat'];
641
+                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice'] = $db->f('quantity')*$items[$i]['currency'][$currency->getType()->getIsoCode()]['price'];
642
+                    $items[$i]['currency'][$currency->getType()->getIsoCode()]['totalprice_incl_vat'] = $db->f('quantity')*$items[$i]['currency'][$currency->getType()->getIsoCode()]['price_incl_vat'];
643 643
                 }
644 644
             }
645 645
 
@@ -668,10 +668,10 @@  discard block
 block discarded – undo
668 668
     {
669 669
         $sql_extra = implode(" AND ", $this->conditions);
670 670
         $db = new DB_Sql;
671
-        $db->query("DELETE FROM basket " .
672
-                "WHERE basketevaluation_product = 1 " .
673
-                    "AND " . $sql_extra . " " .
674
-                    "AND intranet_id = " . $this->intranet->getId());
671
+        $db->query("DELETE FROM basket ".
672
+                "WHERE basketevaluation_product = 1 ".
673
+                    "AND ".$sql_extra." ".
674
+                    "AND intranet_id = ".$this->intranet->getId());
675 675
 
676 676
         $this->resetItemCache();
677 677
 
@@ -690,8 +690,8 @@  discard block
 block discarded – undo
690 690
 
691 691
         $sql_extra = implode(" AND ", $this->conditions);
692 692
         $db = new DB_Sql;
693
-        $db->query("UPDATE basket SET session_id = '' WHERE " . $sql_extra . " AND intranet_id = " . $this->intranet->getId());
694
-        $db->query("UPDATE basket_details SET session_id = '' WHERE " . $sql_extra . " AND intranet_id = " . $this->intranet->getId());
693
+        $db->query("UPDATE basket SET session_id = '' WHERE ".$sql_extra." AND intranet_id = ".$this->intranet->getId());
694
+        $db->query("UPDATE basket_details SET session_id = '' WHERE ".$sql_extra." AND intranet_id = ".$this->intranet->getId());
695 695
 
696 696
         return true;
697 697
     }
Please login to merge, or discard this patch.