@@ -41,7 +41,7 @@ |
||
41 | 41 | 'category_object' => $this->getModel(), |
42 | 42 | 'regret_link' => $redirect->getRedirect($this->url('../')) |
43 | 43 | ); |
44 | - $tpl = $this->template->create(dirname(__FILE__) . '/../tpl/categories-edit'); |
|
44 | + $tpl = $this->template->create(dirname(__FILE__).'/../tpl/categories-edit'); |
|
45 | 45 | return $tpl->render($this, $data); |
46 | 46 | } |
47 | 47 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | $data = array('shop' => $shop, 'evaluations' => $evaluations); |
46 | 46 | |
47 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/show'); |
|
47 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/show'); |
|
48 | 48 | return $tpl->render($this, $data); |
49 | 49 | } |
50 | 50 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | 'settings' => $settings, |
86 | 86 | 'currencies' => $currencies, |
87 | 87 | 'languages' => $langs); |
88 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/edit'); |
|
89 | - return $this->getError()->view() . $tpl->render($this, $data); |
|
88 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/edit'); |
|
89 | + return $this->getError()->view().$tpl->render($this, $data); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | function postForm() |
@@ -42,7 +42,7 @@ |
||
42 | 42 | 'kernel' => $this->getKernel(), |
43 | 43 | 'keywords' => $keywords); |
44 | 44 | |
45 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/featuredproducts'); |
|
45 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/featuredproducts'); |
|
46 | 46 | return $tpl->render($this, $data); |
47 | 47 | } |
48 | 48 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | $shop = Doctrine::getTable('Intraface_modules_shop_Shop')->find($this->getShopId()); |
14 | 14 | |
15 | - $this->document->setTitle('Payment methods for') . ' ' . $shop->name; |
|
15 | + $this->document->setTitle('Payment methods for').' '.$shop->name; |
|
16 | 16 | |
17 | 17 | $this->document->options = array($this->url('../') => 'Close'); |
18 | 18 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $chosen = $this->getPaymentMethodsForShop(); |
23 | 23 | |
24 | 24 | $data = array('shop' => $shop, 'methods' => $methods, 'chosen' => $chosen); |
25 | - $tpl = $this->template->create(dirname(__FILE__) . '/../tpl/paymentmethods-index'); |
|
25 | + $tpl = $this->template->create(dirname(__FILE__).'/../tpl/paymentmethods-index'); |
|
26 | 26 | return $tpl->render($this, $data); |
27 | 27 | } |
28 | 28 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $shop_gateway = $this->getShopGateway(); |
29 | 29 | $shop = $shop_gateway->findById($this->context->name()); |
30 | 30 | |
31 | - $this->document->setTitle('Categories for shop' . $shop->getName()); |
|
31 | + $this->document->setTitle('Categories for shop'.$shop->getName()); |
|
32 | 32 | $this->document->options = array( |
33 | 33 | $redirect->getRedirect($this->url('../')) => 'Close', $this->url('create') => 'Add new category' |
34 | 34 | ); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | ); |
31 | 31 | |
32 | 32 | $this->hasOne('Intraface_modules_product_Variation_X_Attribute as variation_x_attribute', |
33 | - array( 'local' => 'id','foreign' => 'product_attribute_id') |
|
33 | + array('local' => 'id', 'foreign' => 'product_attribute_id') |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | public function getCollectedErrorStack() |
86 | 86 | { |
87 | - $stack =& $this->getErrorStack(); |
|
87 | + $stack = & $this->getErrorStack(); |
|
88 | 88 | if (is_object($this->active_details)) { |
89 | 89 | foreach ($this->active_details->getErrorStack() AS $field => $errors) { |
90 | 90 | foreach ($errors AS $error) { |
@@ -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); |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | } else { |
263 | 263 | |
264 | 264 | // vi opdaterer produktet |
265 | - $this->db->query("UPDATE product_detail SET active = 0 WHERE product_id = " . $this->product->get('id')); |
|
266 | - $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()); |
|
265 | + $this->db->query("UPDATE product_detail SET active = 0 WHERE product_id = ".$this->product->get('id')); |
|
266 | + $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()); |
|
267 | 267 | $this->detail_id = $this->db->insertedId(); |
268 | 268 | $this->db->query("INSERT INTO product_detail_translation SET name = \"".$array_var['name']."\", description = \"".$array_var['description']."\", lang = 'da', id = ".$this->detail_id); |
269 | 269 | |
@@ -284,17 +284,17 @@ discard block |
||
284 | 284 | |
285 | 285 | public function getPriceInCurrency($currency, $exchange_rate_id = 0) |
286 | 286 | { |
287 | - return new Ilib_Variable_Float(round($this->get('price') / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2), 'iso'); |
|
287 | + return new Ilib_Variable_Float(round($this->get('price')/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2), 'iso'); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | public function getPriceIncludingVat() |
291 | 291 | { |
292 | - return new Ilib_Variable_Float(round($this->get('price') * (1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
292 | + return new Ilib_Variable_Float(round($this->get('price')*(1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id = 0) |
296 | 296 | { |
297 | - 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'); |
|
297 | + 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'); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | public function getBeforePrice() |
@@ -304,17 +304,17 @@ discard block |
||
304 | 304 | |
305 | 305 | public function getBeforePriceInCurrency($currency, $exchange_rate_id = 0) |
306 | 306 | { |
307 | - return new Ilib_Variable_Float(round($this->get('price') / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2), 'iso'); |
|
307 | + return new Ilib_Variable_Float(round($this->get('price')/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2), 'iso'); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | public function getBeforePriceIncludingVat() |
311 | 311 | { |
312 | - return new Ilib_Variable_Float(round($this->get('before_price') * (1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
312 | + return new Ilib_Variable_Float(round($this->get('before_price')*(1 + $this->getVatPercent()->getAsIso()/100), 2)); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | public function getBeforePriceIncludingVatInCurrency($currency, $exchange_rate_id = 0) |
316 | 316 | { |
317 | - 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'); |
|
317 | + 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'); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | public function getVatPercent() |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | function setStateAccountId($id) |
366 | 366 | { |
367 | 367 | $db = new DB_Sql; |
368 | - $db->query('UPDATE product_detail SET state_account_id = ' . $id . ' WHERE id = ' . $this->detail_id); |
|
368 | + $db->query('UPDATE product_detail SET state_account_id = '.$id.' WHERE id = '.$this->detail_id); |
|
369 | 369 | $this->load(); |
370 | 370 | $this->product->load(); |
371 | 371 | return true; |
@@ -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 |