@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Constructor |
| 45 | 45 | * |
| 46 | - * @param object $product Product object |
|
| 46 | + * @param Product $product Product object |
|
| 47 | 47 | * @param integer $old_detail_id Only used with old product details |
| 48 | 48 | * |
| 49 | 49 | * @return void |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @param array $array_var An array with data to save, @see $this->fields |
| 157 | 157 | * |
| 158 | - * @return integer |
|
| 158 | + * @return boolean |
|
| 159 | 159 | */ |
| 160 | 160 | public function save($array_var) |
| 161 | 161 | { |
@@ -332,24 +332,24 @@ |
||
| 332 | 332 | public static function getUnits($key = null) |
| 333 | 333 | { |
| 334 | 334 | $units = array(1 => array('singular' => '', |
| 335 | - 'plural' => '', |
|
| 336 | - 'combined' => ''), |
|
| 337 | - 2 => array('singular' => 'unit', |
|
| 338 | - 'plural' => 'units', |
|
| 339 | - 'combined' => 'unit(s)'), |
|
| 340 | - 3 => array('singular' => 'day', |
|
| 341 | - 'plural' => 'days', |
|
| 342 | - 'combined' => 'day(s)'), |
|
| 343 | - 4 => array('singular' => 'month (singular)', |
|
| 344 | - 'plural' => 'month (plural)', |
|
| 345 | - 'combined' => 'month (combined)'), |
|
| 346 | - 5 => array('singular' => 'year', |
|
| 347 | - 'plural' => 'years', |
|
| 348 | - 'combined' => 'year(s)'), |
|
| 349 | - 6 => array('singular' => 'hour', |
|
| 350 | - 'plural' => 'hours', |
|
| 351 | - 'combined' => 'hour(s)') |
|
| 352 | - ); |
|
| 335 | + 'plural' => '', |
|
| 336 | + 'combined' => ''), |
|
| 337 | + 2 => array('singular' => 'unit', |
|
| 338 | + 'plural' => 'units', |
|
| 339 | + 'combined' => 'unit(s)'), |
|
| 340 | + 3 => array('singular' => 'day', |
|
| 341 | + 'plural' => 'days', |
|
| 342 | + 'combined' => 'day(s)'), |
|
| 343 | + 4 => array('singular' => 'month (singular)', |
|
| 344 | + 'plural' => 'month (plural)', |
|
| 345 | + 'combined' => 'month (combined)'), |
|
| 346 | + 5 => array('singular' => 'year', |
|
| 347 | + 'plural' => 'years', |
|
| 348 | + 'combined' => 'year(s)'), |
|
| 349 | + 6 => array('singular' => 'hour', |
|
| 350 | + 'plural' => 'hours', |
|
| 351 | + 'combined' => 'hour(s)') |
|
| 352 | + ); |
|
| 353 | 353 | |
| 354 | 354 | if ($key === null) { |
| 355 | 355 | return $units; |
@@ -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; |
@@ -259,7 +259,6 @@ |
||
| 259 | 259 | /** |
| 260 | 260 | * Set attribute for product |
| 261 | 261 | * |
| 262 | - * @param integer $id Attribute id to relate to this product |
|
| 263 | 262 | * |
| 264 | 263 | * @return boolean |
| 265 | 264 | */ |
@@ -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) { |
@@ -65,6 +65,7 @@ |
||
| 65 | 65 | /** |
| 66 | 66 | * Find a variation from id |
| 67 | 67 | * |
| 68 | + * @param integer $id |
|
| 68 | 69 | * @return object Intraface_modules_product_Variation_OneAttributeGroup or Intraface_modules_product_Variation_TwoAttributeGroups |
| 69 | 70 | */ |
| 70 | 71 | public function findById($id) |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $this->variation = new Intraface_modules_product_Variation_OneAttributeGroup; |
| 46 | 46 | |
| 47 | 47 | } elseif (count($this->groups) == 2) { |
| 48 | - $this->variation = new Intraface_modules_product_Variation_TwoAttributeGroups; |
|
| 48 | + $this->variation = new Intraface_modules_product_Variation_TwoAttributeGroups; |
|
| 49 | 49 | } else { |
| 50 | 50 | throw new Exception('At the moment the system only supports up to two attribute groups!'); |
| 51 | 51 | } |
@@ -82,6 +82,9 @@ |
||
| 82 | 82 | return $this->context->getKernel(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @return integer |
|
| 87 | + */ |
|
| 85 | 88 | function getShopId() |
| 86 | 89 | { |
| 87 | 90 | if ($this->query('shop_id')) { |
@@ -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 | ); |
@@ -9,6 +9,9 @@ |
||
| 9 | 9 | public $value; |
| 10 | 10 | private $kernel; |
| 11 | 11 | |
| 12 | + /** |
|
| 13 | + * @param Intraface_modules_product_Variation $variation |
|
| 14 | + */ |
|
| 12 | 15 | function __construct($product, $variation = NULL) |
| 13 | 16 | {
|
| 14 | 17 | $this->product = $product; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @param string $headerImg The filepath for the header image |
| 139 | 139 | * |
| 140 | - * @return void |
|
| 140 | + * @return false|null |
|
| 141 | 141 | */ |
| 142 | 142 | public function addHeader($headerImg = '') |
| 143 | 143 | { |
@@ -191,6 +191,7 @@ discard block |
||
| 191 | 191 | * write the document to a file |
| 192 | 192 | * |
| 193 | 193 | * @param string $data The data to write |
| 194 | + * @param string $filnavn |
|
| 194 | 195 | * |
| 195 | 196 | * @return void |
| 196 | 197 | */ |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | // Notice that the placement of the characters are different in the two tables. Placement is correct in the first. |
| 43 | 43 | |
| 44 | 44 | $diff = array(230 => 'ae', |
| 45 | - 198 => 'AE', |
|
| 46 | - 248 => 'oslash', |
|
| 47 | - 216 => 'Oslash', |
|
| 48 | - 229 => 'aring', |
|
| 49 | - 197 => 'Aring'); |
|
| 45 | + 198 => 'AE', |
|
| 46 | + 248 => 'oslash', |
|
| 47 | + 216 => 'Oslash', |
|
| 48 | + 229 => 'aring', |
|
| 49 | + 197 => 'Aring'); |
|
| 50 | 50 | |
| 51 | 51 | parent::selectFont('Helvetica.afm', array('differences' => $diff)); |
| 52 | 52 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->setY(0); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - /** |
|
| 165 | + /** |
|
| 166 | 166 | * create a round rectangle |
| 167 | 167 | * |
| 168 | 168 | * @param integer $x The starting x point |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | parent::partEllipse($x+$width-$round, $y+$round, 270, 360, $round); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - /** |
|
| 190 | + /** |
|
| 191 | 191 | * write the document to a file |
| 192 | 192 | * |
| 193 | 193 | * @param string $data The data to write |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | if (is_int($value)) { |
| 105 | 105 | $this->value['x'] = $this->get('margin_left') + $value; |
| 106 | 106 | } elseif (is_string($value) && substr($value, 0, 1) == "+") { |
| 107 | - $this->value['x'] += intval(substr($value, 1)); |
|
| 107 | + $this->value['x'] += intval(substr($value, 1)); |
|
| 108 | 108 | } elseif (is_string($value) && substr($value, 0, 1) == "-") { |
| 109 | 109 | $this->value['x'] -= intval(substr($value, 1)); |
| 110 | 110 | } else { |
@@ -150,11 +150,11 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | $height = $this->get('header_height'); |
| 152 | 152 | ; |
| 153 | - $width = $size[0] * ($height/$size[1]); |
|
| 153 | + $width = $size[0]*($height/$size[1]); |
|
| 154 | 154 | |
| 155 | 155 | if ($width > $this->get('content_width')) { |
| 156 | 156 | $width = $this->get('content_width'); |
| 157 | - $height = $size[1] * ($width/$size[0]); |
|
| 157 | + $height = $size[1]*($width/$size[0]); |
|
| 158 | 158 | } |
| 159 | 159 | parent::addJpegFromFile($headerImg, $this->get('right_margin_position') - $width, $this->page_height - $this->get('header_margin_top') - $height, $width, $height); // , ($this->value["page_width"] - $this->value["margin_left"])/10 |
| 160 | 160 | parent::closeObject(); |
@@ -177,15 +177,15 @@ discard block |
||
| 177 | 177 | public function roundRectangle($x, $y, $width, $height, $round) |
| 178 | 178 | { |
| 179 | 179 | parent::setLineStyle(1); |
| 180 | - parent::line($x, $y+$round, $x, $y+$height-$round); |
|
| 181 | - parent::line($x+$round, $y+$height, $x+$width-$round, $y+$height); |
|
| 182 | - parent::line($x+$width, $y+$height-$round, $x+$width, $y+$round-1); |
|
| 183 | - parent::line($x+$width-$round, $y, $x+$round, $y); |
|
| 184 | - |
|
| 185 | - parent::partEllipse($x+$round, $y+$round, 180, 270, $round); |
|
| 186 | - parent::partEllipse($x+$round, $y+$height-$round, 90, 180, $round); |
|
| 187 | - parent::partEllipse($x+$width-$round, $y+$height-$round, 0, 90, $round); |
|
| 188 | - parent::partEllipse($x+$width-$round, $y+$round, 270, 360, $round); |
|
| 180 | + parent::line($x, $y + $round, $x, $y + $height - $round); |
|
| 181 | + parent::line($x + $round, $y + $height, $x + $width - $round, $y + $height); |
|
| 182 | + parent::line($x + $width, $y + $height - $round, $x + $width, $y + $round - 1); |
|
| 183 | + parent::line($x + $width - $round, $y, $x + $round, $y); |
|
| 184 | + |
|
| 185 | + parent::partEllipse($x + $round, $y + $round, 180, 270, $round); |
|
| 186 | + parent::partEllipse($x + $round, $y + $height - $round, 90, 180, $round); |
|
| 187 | + parent::partEllipse($x + $width - $round, $y + $height - $round, 0, 90, $round); |
|
| 188 | + parent::partEllipse($x + $width - $round, $y + $round, 270, 360, $round); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -59,6 +59,9 @@ discard block |
||
| 59 | 59 | return $this->controlpanel_files; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $file |
|
| 64 | + */ |
|
| 62 | 65 | function addPreloadFile($file) |
| 63 | 66 | {
|
| 64 | 67 | $this->preload_file[] = $file; |
@@ -81,6 +84,7 @@ discard block |
||
| 81 | 84 | |
| 82 | 85 | /** |
| 83 | 86 | * @todo why is this not using getPath() |
| 87 | + * @param string $file |
|
| 84 | 88 | */ |
| 85 | 89 | function includeSettingFile($file) |
| 86 | 90 | {
|
@@ -351,7 +351,7 @@ |
||
| 351 | 351 | * @param integer $file_id Id of file in the file system |
| 352 | 352 | * @param string $filename Which filename to use |
| 353 | 353 | * |
| 354 | - * @return boolean |
|
| 354 | + * @return integer |
|
| 355 | 355 | */ |
| 356 | 356 | function attachFile($file_id, $filename) |
| 357 | 357 | { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $db = new DB_Sql; |
| 83 | 83 | $db->query('SET NAMES utf8'); /* To be removed when everything is in utf-8 */ |
| 84 | - $sql = "SELECT id, email.date_sent, DATE_FORMAT(date_sent, '%d-%m-%Y') as date_sent_dk, subject, from_name, from_email, user_id, body, status, contact_id, contact_person_id, type_id, belong_to_id, status, bcc_to_user FROM email WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = " . $this->id; |
|
| 84 | + $sql = "SELECT id, email.date_sent, DATE_FORMAT(date_sent, '%d-%m-%Y') as date_sent_dk, subject, from_name, from_email, user_id, body, status, contact_id, contact_person_id, type_id, belong_to_id, status, bcc_to_user FROM email WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id; |
|
| 85 | 85 | $db->query($sql); |
| 86 | 86 | if (!$db->nextRecord()) { |
| 87 | 87 | return false; |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | if ($this->id == 0) { |
| 175 | 175 | $sql_type = "INSERT INTO "; |
| 176 | 176 | $sql_end = ", date_created = NOW(), |
| 177 | - belong_to_id = ".(int)$var['belong_to'] . ", |
|
| 178 | - type_id = ".(int)$var['type_id'] . ", |
|
| 177 | + belong_to_id = ".(int)$var['belong_to'].", |
|
| 178 | + type_id = ".(int)$var['type_id'].", |
|
| 179 | 179 | contact_id=".$var['contact_id']; |
| 180 | 180 | } else { |
| 181 | 181 | $sql_type = "UPDATE "; |
| 182 | - $sql_end = " WHERE id = " . $this->id; |
|
| 182 | + $sql_end = " WHERE id = ".$this->id; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if (!empty($var['date_deadline'])) { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | // gemme userid hvis vi er inde i systemet |
| 192 | 192 | if (is_object($this->kernel->user) AND $this->kernel->user->get('id') > 0) { |
| 193 | 193 | //$db->query("UPDATE email SET user_id = ".$this->kernel->user->get('id')." WHERE id = " . $this->id); |
| 194 | - $sql_extra = ', user_id = ' . $db->quote($this->kernel->user->get('id'), 'integer'); |
|
| 194 | + $sql_extra = ', user_id = '.$db->quote($this->kernel->user->get('id'), 'integer'); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | if (!isset($var['contact_person_id'])) { |
@@ -203,11 +203,11 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // status 1 = draft |
| 206 | - $sql = $sql_type . " email SET |
|
| 206 | + $sql = $sql_type." email SET |
|
| 207 | 207 | contact_person_id = ".(int)$var['contact_person_id'].", |
| 208 | 208 | bcc_to_user = ".(int)$var['bcc_to_user'].", |
| 209 | 209 | date_updated = NOW(), |
| 210 | - intranet_id = " . $this->kernel->intranet->get('id') . ", |
|
| 210 | + intranet_id = " . $this->kernel->intranet->get('id').", |
|
| 211 | 211 | subject = '".$var['subject']."', |
| 212 | 212 | body = '".$var['body']."', |
| 213 | 213 | date_deadline = ".$date_deadline.", |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | function saveErrorMsg($error) |
| 246 | 246 | { |
| 247 | 247 | $db = new DB_Sql; |
| 248 | - $db->query("UPDATE email SET error_msg = '".$error."' WHERE id = " . $this->id); |
|
| 248 | + $db->query("UPDATE email SET error_msg = '".$error."' WHERE id = ".$this->id); |
|
| 249 | 249 | return true; |
| 250 | 250 | } |
| 251 | 251 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | return false; |
| 261 | 261 | } |
| 262 | 262 | $db = new DB_Sql; |
| 263 | - $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = " . $this->id); |
|
| 263 | + $db->query("UPDATE email SET status = 3, date_sent = NOW() WHERE id = ".$this->id); |
|
| 264 | 264 | return true; |
| 265 | 265 | } |
| 266 | 266 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | $db = new DB_Sql; |
| 293 | 293 | // Putter e-mailen i outboxen (status = 2) |
| 294 | - $db->query("UPDATE email SET status = 2 WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = " . $this->id); |
|
| 294 | + $db->query("UPDATE email SET status = 2 WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND id = ".$this->id); |
|
| 295 | 295 | return true; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | $contact = $this->getContact(); |
| 301 | 301 | if ($this->get('contact_id') == 0 OR !is_object($contact)) { |
| 302 | - $this->error->set('Der kunne ikke sendes e-mail til email #' . $this->get('id') . ' fordi der ikke var nogen kunde sat'); |
|
| 302 | + $this->error->set('Der kunne ikke sendes e-mail til email #'.$this->get('id').' fordi der ikke var nogen kunde sat'); |
|
| 303 | 303 | return false; |
| 304 | 304 | } |
| 305 | 305 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | { |
| 384 | 384 | $db = new DB_Sql; |
| 385 | 385 | $db->query("SELECT file_id, filename FROM email_attachment |
| 386 | - WHERE intranet_id = " .$this->kernel->intranet->get('id') . " AND email_id = " . $this->id); |
|
| 386 | + WHERE intranet_id = " .$this->kernel->intranet->get('id')." AND email_id = ".$this->id); |
|
| 387 | 387 | $file = array(); |
| 388 | 388 | $i = 0; |
| 389 | 389 | while ($db->nextRecord()) { |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | return false; |
| 416 | 416 | } |
| 417 | 417 | $db = new DB_Sql; |
| 418 | - $db->query("DELETE FROM email WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
| 418 | + $db->query("DELETE FROM email WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
| 419 | 419 | return true; |
| 420 | 420 | } |
| 421 | 421 | |
@@ -9,6 +9,9 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class Intraface_XMLRPC_CMS_Server0300 extends Intraface_XMLRPC_Server0100 |
| 11 | 11 | {
|
| 12 | + /** |
|
| 13 | + * @param integer $site_id |
|
| 14 | + */ |
|
| 12 | 15 | private function factory($site_id) |
| 13 | 16 | {
|
| 14 | 17 | if (!$this->kernel->weblogin->hasModuleAccess('cms')) { // -2
|
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // level 9999 cannot be recognized, so we take top level |
| 64 | 64 | // 0 which should be top level does not work - the variable is not set |
| 65 | 65 | |
| 66 | - $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
| 66 | + $cmspage->value['navigation_toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
| 67 | 67 | $cmspage->value['navigation_sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel' |
| 68 | 68 | $cmspage->value['sections'] = $cmspage->collect(); |
| 69 | 69 | $cmspage->value['comments'] = $cmspage->getComments(); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $this->factory($site_id); |
| 146 | 146 | |
| 147 | 147 | $cmspage = new CMS_Page($this->site); |
| 148 | - $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
| 148 | + $value['toplevel'] = $cmspage->navigation->build(9999, 'array'); // 'toplevel' |
|
| 149 | 149 | $value['sublevel'] = $cmspage->navigation->build(1, 'array'); // 'sublevel' |
| 150 | 150 | |
| 151 | 151 | return $this->prepareResponseData($value); |