@@ -51,7 +51,7 @@ |
||
51 | 51 | 'payments' => $payments, |
52 | 52 | 'onlinepayment' => $onlinepayment); |
53 | 53 | |
54 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
54 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
55 | 55 | return $smarty->render($this, $data); |
56 | 56 | } |
57 | 57 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return $this->dbquery; |
53 | 53 | } |
54 | 54 | // optin = 1 should not be set here |
55 | - $this->dbquery = new Intraface_DBQuery($this->list->kernel, "newsletter_subscriber", "newsletter_subscriber.list_id=". $this->list->get("id") . " AND newsletter_subscriber.intranet_id = " . $this->list->kernel->intranet->get('id')); |
|
55 | + $this->dbquery = new Intraface_DBQuery($this->list->kernel, "newsletter_subscriber", "newsletter_subscriber.list_id=".$this->list->get("id")." AND newsletter_subscriber.intranet_id = ".$this->list->kernel->intranet->get('id')); |
|
56 | 56 | $this->dbquery->setJoin("LEFT", "contact", "newsletter_subscriber.contact_id = contact.id AND contact.intranet_id = ".$this->list->kernel->intranet->get("id"), ''); |
57 | 57 | $this->dbquery->setJoin("LEFT", "address", "address.belong_to_id = contact.id AND address.active = 1 AND address.type = 3", ''); |
58 | 58 | $this->dbquery->useErrorObject($this->error); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | private function load() |
136 | 136 | { |
137 | 137 | $db = new DB_Sql; |
138 | - $db->query("SELECT * FROM newsletter_subscriber WHERE id = " . $this->id." and active = 1"); |
|
138 | + $db->query("SELECT * FROM newsletter_subscriber WHERE id = ".$this->id." and active = 1"); |
|
139 | 139 | if (!$db->nextRecord()) { |
140 | 140 | $this->id = 0; |
141 | 141 | $this->value['id'] = 0; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function delete() |
159 | 159 | { |
160 | 160 | $db = new DB_Sql; |
161 | - $db->query('UPDATE newsletter_subscriber SET active = 0 WHERE id = ' . $this->id); |
|
161 | + $db->query('UPDATE newsletter_subscriber SET active = 0 WHERE id = '.$this->id); |
|
162 | 162 | return true; |
163 | 163 | } |
164 | 164 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | { |
185 | 185 | $db = new DB_sql; |
186 | 186 | |
187 | - $db->query("SELECT id FROM newsletter_subscriber WHERE contact_id = '".$contact->getId()."' AND list_id = " . $this->list->get("id") . " AND intranet_id = ".$this->list->kernel->intranet->get('id')." AND active = 1"); |
|
187 | + $db->query("SELECT id FROM newsletter_subscriber WHERE contact_id = '".$contact->getId()."' AND list_id = ".$this->list->get("id")." AND intranet_id = ".$this->list->kernel->intranet->get('id')." AND active = 1"); |
|
188 | 188 | if ($db->nextRecord()) { |
189 | 189 | return $db->f('id'); |
190 | 190 | } |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | // Spørgsmålet er om vedkommende bør få en e-mail, hvor man kan acceptere? |
193 | 193 | $db->query("INSERT INTO newsletter_subscriber SET |
194 | 194 | contact_id = '".$contact->getId()."', |
195 | - list_id = " . $this->list->get("id") . ", |
|
195 | + list_id = " . $this->list->get("id").", |
|
196 | 196 | date_submitted=NOW(), |
197 | 197 | optin = 1, |
198 | - code = '".md5($this->list->get("id") . $this->list->kernel->intranet->get('id') . date('Y-m-d H:i:s') . $contact->getId())."', |
|
198 | + code = '".md5($this->list->get("id").$this->list->kernel->intranet->get('id').date('Y-m-d H:i:s').$contact->getId())."', |
|
199 | 199 | intranet_id = ".$this->list->kernel->intranet->get('id')); |
200 | 200 | |
201 | 201 | return $db->insertedId(); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $input = array_map('strip_tags', $input); |
215 | 215 | |
216 | 216 | $validator = new Intraface_Validator($this->error); |
217 | - $validator->isEmail($input['email'], $input['email'] . ' er ikke en gyldig e-mail'); |
|
217 | + $validator->isEmail($input['email'], $input['email'].' er ikke en gyldig e-mail'); |
|
218 | 218 | |
219 | 219 | if (empty($input['name'])) { |
220 | 220 | $input['name'] = $input['email']; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | date_submitted = NOW(), |
283 | 283 | ip_submitted = '".$input['ip']."' |
284 | 284 | WHERE id = ".$this->id." |
285 | - AND list_id = " . $this->list->get("id") . " |
|
285 | + AND list_id = " . $this->list->get("id")." |
|
286 | 286 | AND intranet_id = " . $this->list->kernel->intranet->get('id')); |
287 | 287 | //code = '" . md5($input['email'] . date('Y-m-d H:i:s') . $input['ip'])."' |
288 | 288 | } else { |
@@ -305,10 +305,10 @@ discard block |
||
305 | 305 | contact_id = '".$contact->get('id')."', |
306 | 306 | email = '".$input['email']."', |
307 | 307 | name='".$input['name']."', |
308 | - list_id = " . $this->list->get("id") . ", |
|
308 | + list_id = " . $this->list->get("id").", |
|
309 | 309 | ip_submitted='".$input['ip']."', |
310 | 310 | date_submitted=NOW(), |
311 | - code= '" . md5($input['email'] . date('Y-m-d H:i:s') . $input['ip'])."', |
|
311 | + code= '" . md5($input['email'].date('Y-m-d H:i:s').$input['ip'])."', |
|
312 | 312 | intranet_id = ".$this->list->kernel->intranet->get('id')); |
313 | 313 | } |
314 | 314 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | return false; |
343 | 343 | } |
344 | 344 | $db = new DB_Sql; |
345 | - $db->query("SELECT * FROM newsletter_subscriber WHERE id = " . $this->id." and active = 1"); |
|
345 | + $db->query("SELECT * FROM newsletter_subscriber WHERE id = ".$this->id." and active = 1"); |
|
346 | 346 | if (!$db->nextRecord()) { |
347 | 347 | return false; |
348 | 348 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $this->load(); |
381 | 381 | |
382 | 382 | $db = new DB_Sql; |
383 | - $db->query("UPDATE newsletter_subscriber SET active = 0, date_unsubscribe = '".date('Y-m-d H:i:s')."' WHERE id=".$this->id." AND list_id = " . $this->list->get("id") . " AND intranet_id = " . $this->list->kernel->intranet->get('id')); |
|
383 | + $db->query("UPDATE newsletter_subscriber SET active = 0, date_unsubscribe = '".date('Y-m-d H:i:s')."' WHERE id=".$this->id." AND list_id = ".$this->list->get("id")." AND intranet_id = ".$this->list->kernel->intranet->get('id')); |
|
384 | 384 | return true; |
385 | 385 | } |
386 | 386 | |
@@ -398,16 +398,16 @@ discard block |
||
398 | 398 | // optin really wants to optin, so we will not make that a part of the select query |
399 | 399 | // and we will set it in the update query |
400 | 400 | $db = new DB_Sql; |
401 | - $db->query("SELECT id, ip_submitted FROM newsletter_subscriber WHERE code = '".$code."' AND list_id = " . $this->list->get('id')); |
|
401 | + $db->query("SELECT id, ip_submitted FROM newsletter_subscriber WHERE code = '".$code."' AND list_id = ".$this->list->get('id')); |
|
402 | 402 | if (!$db->nextRecord()) { |
403 | 403 | return false; |
404 | 404 | } |
405 | 405 | |
406 | - $db->query("UPDATE newsletter_subscriber SET optin = 1, ip_optin = '".$ip."', date_optin = NOW(), active = 1 WHERE code = '" . $code . "' AND list_id = " . $this->list->get('id')); |
|
406 | + $db->query("UPDATE newsletter_subscriber SET optin = 1, ip_optin = '".$ip."', date_optin = NOW(), active = 1 WHERE code = '".$code."' AND list_id = ".$this->list->get('id')); |
|
407 | 407 | |
408 | 408 | // makes sure that the submitted ip is also set - not really a part of this method. |
409 | 409 | if ($db->f('ip_submitted')) { |
410 | - $db->query("UPDATE newsletter_subscriber SET ip_submitted = '".$ip."' WHERE id = " . $db->f("id")); |
|
410 | + $db->query("UPDATE newsletter_subscriber SET ip_submitted = '".$ip."' WHERE id = ".$db->f("id")); |
|
411 | 411 | } |
412 | 412 | return true; |
413 | 413 | } |
@@ -452,8 +452,8 @@ discard block |
||
452 | 452 | $data = array( |
453 | 453 | 'subject' => $subscribe_subject, |
454 | 454 | 'body' => |
455 | - $this->list->get('subscribe_message') . "\n\n" . |
|
456 | - $this->getLoginUrl($contact) . |
|
455 | + $this->list->get('subscribe_message')."\n\n". |
|
456 | + $this->getLoginUrl($contact). |
|
457 | 457 | "\n\n".$this->list->get('sender_name'), |
458 | 458 | 'contact_id' => $this->get('contact_id'), |
459 | 459 | 'from_email' => $this->list->get('reply_email'), |
@@ -463,16 +463,16 @@ discard block |
||
463 | 463 | ); |
464 | 464 | |
465 | 465 | if (!$email->save($data)) { |
466 | - $this->error->set('could not send the e-mail' . implode(',', $email->error->messages)); |
|
466 | + $this->error->set('could not send the e-mail'.implode(',', $email->error->messages)); |
|
467 | 467 | return false; |
468 | 468 | } |
469 | 469 | |
470 | 470 | if ($email->queue()) { |
471 | 471 | $db = new DB_Sql; |
472 | - $db->query("UPDATE newsletter_subscriber SET date_optin_email_sent = NOW() WHERE id = " . $this->id); |
|
472 | + $db->query("UPDATE newsletter_subscriber SET date_optin_email_sent = NOW() WHERE id = ".$this->id); |
|
473 | 473 | return true; |
474 | 474 | } |
475 | - $this->error->set('could not send the e-mail' . implode(',', $email->error->message)); |
|
475 | + $this->error->set('could not send the e-mail'.implode(',', $email->error->message)); |
|
476 | 476 | return false; |
477 | 477 | } |
478 | 478 | |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | { |
485 | 485 | if ($this->sendOptInEmail()) { |
486 | 486 | $db = new DB_Sql; |
487 | - $db->query("UPDATE newsletter_subscriber SET resend_optin_email_count = resend_optin_email_count + 1 WHERE id = " . $this->id); |
|
487 | + $db->query("UPDATE newsletter_subscriber SET resend_optin_email_count = resend_optin_email_count + 1 WHERE id = ".$this->id); |
|
488 | 488 | return true; |
489 | 489 | } |
490 | 490 | } |
@@ -492,9 +492,9 @@ discard block |
||
492 | 492 | private function getLoginUrl($contact) |
493 | 493 | { |
494 | 494 | if (!$link = $this->list->get('optin_link')) { |
495 | - return $contact->getLoginUrl() . '&optin=' . $this->get('code'); |
|
495 | + return $contact->getLoginUrl().'&optin='.$this->get('code'); |
|
496 | 496 | } |
497 | - return $link . '?optin=' . $this->get('code'); |
|
497 | + return $link.'?optin='.$this->get('code'); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | /** |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | |
78 | 78 | $sql = "SELECT product_detail.id, product_detail.unit AS unit_key,".implode(',', $this->fields).", product_detail_translation.name, product_detail_translation.description FROM product_detail |
79 | 79 | LEFT JOIN product_detail_translation ON product_detail.id = product_detail_translation.id AND product_detail_translation.lang = 'da' |
80 | - WHERE ".$sql . " |
|
81 | - AND product_id = " . $this->product->get('id') . ' AND intranet_id = ' . $this->product->intranet->getId(); |
|
80 | + WHERE ".$sql." |
|
81 | + AND product_id = " . $this->product->get('id').' AND intranet_id = '.$this->product->intranet->getId(); |
|
82 | 82 | $this->db->query($sql); |
83 | 83 | if ($this->db->numRows() > 1) { |
84 | 84 | throw new Exception('Der er mere end en aktiv produktdetalje'); |
85 | 85 | } elseif ($this->db->nextRecord()) { |
86 | 86 | // hardcoded udtr�k af nogle vigtige oplysnigner, som vi ikke kan have i feltlisten |
87 | - for ($i = 0, $max = count($this->fields); $i<$max; $i++) { |
|
87 | + for ($i = 0, $max = count($this->fields); $i < $max; $i++) { |
|
88 | 88 | $this->value[$this->fields[$i]] = $this->db->f($this->fields[$i]); |
89 | 89 | } |
90 | 90 | $this->value['name'] = $this->db->f('name'); |
@@ -100,13 +100,13 @@ discard block |
||
100 | 100 | exit; |
101 | 101 | } |
102 | 102 | |
103 | - $this->value['unit_id'] = $this->db->f('unit_key'); |
|
104 | - $this->value['unit'] = $unit; |
|
103 | + $this->value['unit_id'] = $this->db->f('unit_key'); |
|
104 | + $this->value['unit'] = $unit; |
|
105 | 105 | |
106 | 106 | // udregne moms priser ud fra prisen, men kun hvis der er moms p� den |
107 | 107 | if ($this->db->f('vat') == 1) { |
108 | 108 | $this->value['vat_percent'] = 25; |
109 | - $this->value['price_incl_vat'] = round((float)$this->db->f('price') + ((float)$this->db->f('price') * 0.25), 2); |
|
109 | + $this->value['price_incl_vat'] = round((float)$this->db->f('price') + ((float)$this->db->f('price')*0.25), 2); |
|
110 | 110 | } else { |
111 | 111 | $this->value['vat_percent'] = 0; |
112 | 112 | $this->value['price_incl_vat'] = round((float)$this->db->f('price'), 2); |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | return true; |
270 | 270 | } else { |
271 | 271 | // vi opdaterer produktet |
272 | - $this->db->query("UPDATE product_detail SET active = 0 WHERE product_id = " . $this->product->get('id')); |
|
273 | - $this->db->query("INSERT INTO product_detail SET ".$sql." active = 1, changed_date = NOW(), product_id = " . $this->product->get('id') . ", intranet_id = " . $this->product->intranet->getId()); |
|
272 | + $this->db->query("UPDATE product_detail SET active = 0 WHERE product_id = ".$this->product->get('id')); |
|
273 | + $this->db->query("INSERT INTO product_detail SET ".$sql." active = 1, changed_date = NOW(), product_id = ".$this->product->get('id').", intranet_id = ".$this->product->intranet->getId()); |
|
274 | 274 | $this->detail_id = $this->db->insertedId(); |
275 | 275 | $this->db->query("INSERT INTO product_detail_translation SET name = \"".$array_var['name']."\", description = \"".$array_var['description']."\", lang = 'da', id = ".$this->detail_id); |
276 | 276 | |
@@ -291,17 +291,17 @@ discard block |
||
291 | 291 | |
292 | 292 | public function getPriceInCurrency($currency, $exchange_rate_id = 0) |
293 | 293 | { |
294 | - return new Ilib_Variable_Float(round($this->get('price') / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2), 'iso'); |
|
294 | + return new Ilib_Variable_Float(round($this->get('price')/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2), 'iso'); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | public function getPriceIncludingVat() |
298 | 298 | { |
299 | - return new Ilib_Variable_Float(round($this->get('price') * (1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
299 | + return new Ilib_Variable_Float(round($this->get('price')*(1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id = 0) |
303 | 303 | { |
304 | - return new Ilib_Variable_Float(round($this->get('price') / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100) * (1 + $this->getVatPercent()->getAsIso()/100), 2), 'iso'); |
|
304 | + return new Ilib_Variable_Float(round($this->get('price')/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100)*(1 + $this->getVatPercent()->getAsIso()/100), 2), 'iso'); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | public function getBeforePrice() |
@@ -311,17 +311,17 @@ discard block |
||
311 | 311 | |
312 | 312 | public function getBeforePriceInCurrency($currency, $exchange_rate_id = 0) |
313 | 313 | { |
314 | - return new Ilib_Variable_Float(round($this->get('price') / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2), 'iso'); |
|
314 | + return new Ilib_Variable_Float(round($this->get('price')/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2), 'iso'); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | public function getBeforePriceIncludingVat() |
318 | 318 | { |
319 | - return new Ilib_Variable_Float(round($this->get('before_price') * (1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
319 | + return new Ilib_Variable_Float(round($this->get('before_price')*(1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | public function getBeforePriceIncludingVatInCurrency($currency, $exchange_rate_id = 0) |
323 | 323 | { |
324 | - return new Ilib_Variable_Float(round($this->get('before_price') / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100) * (1 + $this->getVatPercent()->getAsIso()/100), 2), 'iso'); |
|
324 | + return new Ilib_Variable_Float(round($this->get('before_price')/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100)*(1 + $this->getVatPercent()->getAsIso()/100), 2), 'iso'); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | public function getVatPercent() |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | function setStateAccountId($id) |
373 | 373 | { |
374 | 374 | $db = new DB_Sql; |
375 | - $db->query('UPDATE product_detail SET state_account_id = ' . $id . ' WHERE id = ' . $this->detail_id); |
|
375 | + $db->query('UPDATE product_detail SET state_account_id = '.$id.' WHERE id = '.$this->detail_id); |
|
376 | 376 | $this->load(); |
377 | 377 | $this->product->load(); |
378 | 378 | return true; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | $this->hasOne( |
34 | 34 | 'Intraface_modules_product_Variation_X_Attribute as variation_x_attribute', |
35 | - array( 'local' => 'id','foreign' => 'product_attribute_id') |
|
35 | + array('local' => 'id', 'foreign' => 'product_attribute_id') |
|
36 | 36 | ); |
37 | 37 | } |
38 | 38 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | $data = array('products' => $products, 'product' => $product); |
20 | 20 | |
21 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/batchpricechanger'); |
|
21 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/batchpricechanger'); |
|
22 | 22 | return $tpl->render($this, $data); |
23 | 23 | } |
24 | 24 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | foreach ($this->body('product_id') as $key => $product_id) { |
30 | 30 | $product = new Product($this->context->getKernel(), $product_id); |
31 | 31 | if ($this->body('change_type') == 'percent') { |
32 | - $new_price = $product->get('price') + intval($product->get('price') * ($_POST['price_change'] / 100)); |
|
32 | + $new_price = $product->get('price') + intval($product->get('price')*($_POST['price_change']/100)); |
|
33 | 33 | if ($this->body('round_off') == 'yes') { |
34 | 34 | $new_price = round($new_price, 0); |
35 | 35 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | |
84 | 84 | public function getCollectedErrorStack() |
85 | 85 | { |
86 | - $stack =& $this->getErrorStack(); |
|
86 | + $stack = & $this->getErrorStack(); |
|
87 | 87 | if (is_object($this->active_details)) { |
88 | 88 | foreach ($this->active_details->getErrorStack() as $field => $errors) { |
89 | 89 | foreach ($errors as $error) { |
@@ -19,10 +19,10 @@ |
||
19 | 19 | //$this->loadTemplate('Intraface_Doctrine_Template_Intranet'); |
20 | 20 | $this->actAs('Intraface_Doctrine_Template_Intranet'); |
21 | 21 | |
22 | - $this->hasOne('Intraface_modules_product_Attribute as attribute', array('local' => 'product_attribute_id','foreign' => 'id')); |
|
22 | + $this->hasOne('Intraface_modules_product_Attribute as attribute', array('local' => 'product_attribute_id', 'foreign' => 'id')); |
|
23 | 23 | // Notice that Variation/OneAttributeGroup and TwoAttributeGroup extends Variation, which means we do not get |
24 | 24 | // all functionality in the relation specified below here. |
25 | - $this->hasOne('Intraface_modules_product_Variation as variation', array('local' => 'product_variation_id','foreign' => 'id')); |
|
25 | + $this->hasOne('Intraface_modules_product_Variation as variation', array('local' => 'product_variation_id', 'foreign' => 'id')); |
|
26 | 26 | |
27 | 27 | } |
28 | 28 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | } elseif (count($this->groups) == 1) { |
45 | 45 | $this->variation = new Intraface_modules_product_Variation_OneAttributeGroup; |
46 | 46 | } elseif (count($this->groups) == 2) { |
47 | - $this->variation = new Intraface_modules_product_Variation_TwoAttributeGroups; |
|
47 | + $this->variation = new Intraface_modules_product_Variation_TwoAttributeGroups; |
|
48 | 48 | } else { |
49 | 49 | throw new Exception('At the moment the system only supports up to two attribute groups!'); |
50 | 50 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $contact = $this->context->getContact(); |
24 | 24 | $person = $contact->loadContactPerson(0); |
25 | 25 | |
26 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/contactperson-edit'); |
|
26 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/contactperson-edit'); |
|
27 | 27 | return $smarty->render($this, array('person' => $person, 'contact' => $contact)); |
28 | 28 | } |
29 | 29 |