@@ -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 | |
@@ -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 | |
@@ -319,23 +319,23 @@ |
||
| 319 | 319 | { |
| 320 | 320 | $units = array( |
| 321 | 321 | 1 => array('singular' => '', |
| 322 | - 'plural' => '', |
|
| 323 | - 'combined' => ''), |
|
| 322 | + 'plural' => '', |
|
| 323 | + 'combined' => ''), |
|
| 324 | 324 | 2 => array('singular' => 'unit', |
| 325 | - 'plural' => 'units', |
|
| 326 | - 'combined' => 'unit(s)'), |
|
| 325 | + 'plural' => 'units', |
|
| 326 | + 'combined' => 'unit(s)'), |
|
| 327 | 327 | 3 => array('singular' => 'day', |
| 328 | - 'plural' => 'days', |
|
| 329 | - 'combined' => 'day(s)'), |
|
| 328 | + 'plural' => 'days', |
|
| 329 | + 'combined' => 'day(s)'), |
|
| 330 | 330 | 4 => array('singular' => 'month (singular)', |
| 331 | - 'plural' => 'month (plural)', |
|
| 332 | - 'combined' => 'month (combined)'), |
|
| 331 | + 'plural' => 'month (plural)', |
|
| 332 | + 'combined' => 'month (combined)'), |
|
| 333 | 333 | 5 => array('singular' => 'year', |
| 334 | - 'plural' => 'years', |
|
| 335 | - 'combined' => 'year(s)'), |
|
| 334 | + 'plural' => 'years', |
|
| 335 | + 'combined' => 'year(s)'), |
|
| 336 | 336 | 6 => array('singular' => 'hour', |
| 337 | - 'plural' => 'hours', |
|
| 338 | - 'combined' => 'hour(s)') |
|
| 337 | + 'plural' => 'hours', |
|
| 338 | + 'combined' => 'hour(s)') |
|
| 339 | 339 | ); |
| 340 | 340 | |
| 341 | 341 | if ($key === null) { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /** |
| 185 | 185 | * Returns the price of the product |
| 186 | 186 | * |
| 187 | - * @return object Ilib_Variable_Float with price |
|
| 187 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price |
|
| 188 | 188 | */ |
| 189 | 189 | public function getPrice() |
| 190 | 190 | { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | /** |
| 195 | 195 | * Used to set price |
| 196 | 196 | * |
| 197 | - * @param object $price Ilib_Variable_Float |
|
| 197 | + * @param Ilib_Variable_Float $price Ilib_Variable_Float |
|
| 198 | 198 | * @return void |
| 199 | 199 | */ |
| 200 | 200 | public function setPrice(Ilib_Variable_Float $price) |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | * Returns the price of the product in given currency |
| 207 | 207 | * |
| 208 | 208 | * @param object $currency Intraface_modules_currency_Currency |
| 209 | - * @param integer $exchange_rage_id |
|
| 209 | + * @param integer $exchange_rate_id |
|
| 210 | 210 | * |
| 211 | - * @return obejct Ilib_Variable_Float with price of the variation in given currency |
|
| 211 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price of the variation in given currency |
|
| 212 | 212 | */ |
| 213 | 213 | public function getPriceInCurrency($currency, $exchange_rate_id = 0) |
| 214 | 214 | { |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | /** |
| 219 | 219 | * Returns price include vat of the product |
| 220 | 220 | * |
| 221 | - * @return object Ilib_Variable_Float with price including vat |
|
| 221 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat |
|
| 222 | 222 | */ |
| 223 | 223 | public function getPriceIncludingVat() |
| 224 | 224 | { |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | * |
| 231 | 231 | * @param object $currency Intraface_modules_currency_Currency |
| 232 | 232 | * @param integer $exchange_rate_id |
| 233 | - * @return object Ilib_Variable_Float with price including vat in given currency |
|
| 233 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat in given currency |
|
| 234 | 234 | */ |
| 235 | 235 | public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id) |
| 236 | 236 | { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | /** |
| 246 | 246 | * Returns the before price of the product |
| 247 | 247 | * |
| 248 | - * @return object Ilib_Variable_Float with price |
|
| 248 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price |
|
| 249 | 249 | */ |
| 250 | 250 | public function getBeforePrice() |
| 251 | 251 | { |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | * Returns the before price of the product in given currency |
| 257 | 257 | * |
| 258 | 258 | * @param object $currency Intraface_modules_currency_Currency |
| 259 | - * @param integer $exchange_rage_id |
|
| 259 | + * @param integer $exchange_rate_id |
|
| 260 | 260 | * |
| 261 | - * @return obejct Ilib_Variable_Float with price of the variation in given currency |
|
| 261 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price of the variation in given currency |
|
| 262 | 262 | */ |
| 263 | 263 | public function getBeforePriceInCurrency($currency, $exchange_rate_id = 0) |
| 264 | 264 | { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | /** |
| 269 | 269 | * Returns before price include vat of the product |
| 270 | 270 | * |
| 271 | - * @return object Ilib_Variable_Float with price including vat |
|
| 271 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat |
|
| 272 | 272 | */ |
| 273 | 273 | public function getBeforePriceIncludingVat() |
| 274 | 274 | { |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | * |
| 281 | 281 | * @param object $currency Intraface_modules_currency_Currency |
| 282 | 282 | * @param integer $exchange_rate_id |
| 283 | - * @return object Ilib_Variable_Float with price including vat in given currency |
|
| 283 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price including vat in given currency |
|
| 284 | 284 | */ |
| 285 | 285 | public function getBeforePriceIncludingVatInCurrency($currency, $exchange_rate_id) |
| 286 | 286 | { |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | 291 | * Sets the weight |
| 292 | - * @param object $value Ilib_Value_Float |
|
| 292 | + * @param Ilib_Variable_Float $value Ilib_Value_Float |
|
| 293 | 293 | * @return void |
| 294 | 294 | */ |
| 295 | 295 | public function setWeight(Ilib_Variable_Float $value) |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | /** |
| 301 | 301 | * Returns the weight of the product |
| 302 | 302 | * |
| 303 | - * @return object Ilib_Variable_Float with price |
|
| 303 | + * @return Ilib_Variable_Float Ilib_Variable_Float with price |
|
| 304 | 304 | */ |
| 305 | 305 | public function getWeight() |
| 306 | 306 | { |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | /** |
| 362 | 362 | * Returns the var percenttage of the product |
| 363 | 363 | * |
| 364 | - * @return object Ilib_Variable_Float with vat percent |
|
| 364 | + * @return Ilib_Variable_Float Ilib_Variable_Float with vat percent |
|
| 365 | 365 | */ |
| 366 | 366 | public function getVatPercent() |
| 367 | 367 | { |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | //->innerJoin('Intraface_modules_product_ProductDoctrine.details AS details') |
| 74 | 74 | //->addWhere('active = 1') |
| 75 | 75 | ->addWhere('active = 1') |
| 76 | - ->addWhere('number = ' . $this->number) |
|
| 77 | - ->addWhere('intranet_id = ' . $this->intranet_id) |
|
| 78 | - ->addWhere('product_id <> ' . $product_id); |
|
| 76 | + ->addWhere('number = '.$this->number) |
|
| 77 | + ->addWhere('intranet_id = '.$this->intranet_id) |
|
| 78 | + ->addWhere('product_id <> '.$product_id); |
|
| 79 | 79 | |
| 80 | 80 | // not necessary to execute query when counting |
| 81 | 81 | //$collection = $dql->execute(); |
| 82 | 82 | |
| 83 | 83 | if ($dql->count() > 0) { |
| 84 | - $this->getErrorStack()->add('number', $this->number . ' has already been added'); |
|
| 84 | + $this->getErrorStack()->add('number', $this->number.' has already been added'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return true; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function getPriceInCurrency($currency, $exchange_rate_id = 0) |
| 214 | 214 | { |
| 215 | - return new Ilib_Variable_Float(round($this->getPrice()->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2)); |
|
| 215 | + return new Ilib_Variable_Float(round($this->getPrice()->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2)); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | public function getPriceIncludingVat() |
| 224 | 224 | { |
| 225 | - return new Ilib_Variable_Float($this->getPrice()->getAsIso(2) * (1 + $this->getVatPercent()->getAsIso()/100)); |
|
| 225 | + return new Ilib_Variable_Float($this->getPrice()->getAsIso(2)*(1 + $this->getVatPercent()->getAsIso()/100)); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public function getPriceIncludingVatInCurrency($currency, $exchange_rate_id) |
| 236 | 236 | { |
| 237 | - return new Ilib_Variable_Float($this->getPriceIncludingVat()->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100)); |
|
| 237 | + return new Ilib_Variable_Float($this->getPriceIncludingVat()->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100)); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | public function setBeforePrice(Ilib_Variable_Float $value) |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function getBeforePriceInCurrency($currency, $exchange_rate_id = 0) |
| 264 | 264 | { |
| 265 | - return new Ilib_Variable_Float(round($this->getBeforePrice($product)->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100), 2)); |
|
| 265 | + return new Ilib_Variable_Float(round($this->getBeforePrice($product)->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100), 2)); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getBeforePriceIncludingVat() |
| 274 | 274 | { |
| 275 | - return new Ilib_Variable_Float($this->getBeforePrice()->getAsIso(2) * (1 + $this->getVatPercent()->getAsIso()/100)); |
|
| 275 | + return new Ilib_Variable_Float($this->getBeforePrice()->getAsIso(2)*(1 + $this->getVatPercent()->getAsIso()/100)); |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | public function getBeforePriceIncludingVatInCurrency($currency, $exchange_rate_id) |
| 286 | 286 | { |
| 287 | - return new Ilib_Variable_Float($this->getBeforePriceIncludingVat()->getAsIso() / ($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso() / 100)); |
|
| 287 | + return new Ilib_Variable_Float($this->getBeforePriceIncludingVat()->getAsIso()/($currency->getProductPriceExchangeRate((int)$exchange_rate_id)->getRate()->getAsIso()/100)); |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | 'db' => $this->mdb2 |
| 39 | 39 | ); |
| 40 | 40 | |
| 41 | - $smarty = $this->template->create(dirname(__FILE__) . '/../tpl/show-plain-text'); |
|
| 41 | + $smarty = $this->template->create(dirname(__FILE__).'/../tpl/show-plain-text'); |
|
| 42 | 42 | return $smarty->render($this, $data); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | 'existing_groups' => $existing_groups, |
| 50 | 50 | 'groups' => $groups); |
| 51 | 51 | |
| 52 | - $tpl = $this->template->create(dirname(__FILE__) . '/../tpl/variations'); |
|
| 52 | + $tpl = $this->template->create(dirname(__FILE__).'/../tpl/variations'); |
|
| 53 | 53 | return $tpl->render($this, $data); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | 'existing_groups' => $existing_groups, |
| 70 | 70 | 'groups' => $groups); |
| 71 | 71 | |
| 72 | - $tpl = $this->template->create(dirname(__FILE__) . '/../tpl/variations-edit'); |
|
| 72 | + $tpl = $this->template->create(dirname(__FILE__).'/../tpl/variations-edit'); |
|
| 73 | 73 | return $tpl->render($this, $data); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $product->getDBQuery()->storeResult("use_stored", "products", "toplevel"); |
| 19 | 19 | $products = $product->getList(); |
| 20 | 20 | |
| 21 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/batchedit'); |
|
| 21 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/batchedit'); |
|
| 22 | 22 | return $tpl->render($this, array('products' => $products, 'product' => $product)); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -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 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | return new k_SeeOther($this->url()); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - $smarty = $this->template->create(dirname(__FILE__) . '/tpl/show'); |
|
| 84 | + $smarty = $this->template->create(dirname(__FILE__).'/tpl/show'); |
|
| 85 | 85 | return $smarty->render($this, $data); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if ($this->body('choose_file') && $this->getKernel()->user->hasModuleAccess('filemanager')) { |
| 122 | 122 | $redirect = Intraface_Redirect::factory($this->getKernel(), 'go'); |
| 123 | 123 | $module_filemanager = $this->getKernel()->useModule('filemanager'); |
| 124 | - $url = $redirect->setDestination(NET_SCHEME . NET_HOST . $this->url('filehandler/selectfile', array('images'=>1, 'multiple_choice' => 1)), NET_SCHEME . NET_HOST . $this->url()); |
|
| 124 | + $url = $redirect->setDestination(NET_SCHEME.NET_HOST.$this->url('filehandler/selectfile', array('images'=>1, 'multiple_choice' => 1)), NET_SCHEME.NET_HOST.$this->url()); |
|
| 125 | 125 | $redirect->setIdentifier('product'); |
| 126 | 126 | $redirect->askParameter('file_handler_id', 'multiple'); |
| 127 | 127 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | 'product' => $this->getProductDoctrine(), |
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | - $smarty = $this->template->create(dirname(__FILE__) . '/tpl/edit'); |
|
| 142 | + $smarty = $this->template->create(dirname(__FILE__).'/tpl/edit'); |
|
| 143 | 143 | return $smarty->render($this, $data); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | { |
| 209 | 209 | $this->getKernel()->module('product'); |
| 210 | 210 | if ($id = $this->getProduct()->copy()) { |
| 211 | - return new k_SeeOther($this->url('../' . $id)); |
|
| 211 | + return new k_SeeOther($this->url('../'.$id)); |
|
| 212 | 212 | } |
| 213 | 213 | return $this->render(); |
| 214 | 214 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $module = $this->getKernel()->module('product'); |
| 32 | 32 | |
| 33 | - $smarty = $this->template->create(dirname(__FILE__) . '/tpl/index'); |
|
| 33 | + $smarty = $this->template->create(dirname(__FILE__).'/tpl/index'); |
|
| 34 | 34 | return $smarty->render($this); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $data['product'] = $this->product_doctrine; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $smarty = $this->template->create(dirname(__FILE__) . '/tpl/edit'); |
|
| 79 | + $smarty = $this->template->create(dirname(__FILE__).'/tpl/edit'); |
|
| 80 | 80 | return $smarty->render($this, $data); |
| 81 | 81 | } |
| 82 | 82 | |