@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * Gets the tax percent on the individual product |
242 | 242 | * |
243 | - * @return float |
|
243 | + * @return integer |
|
244 | 244 | */ |
245 | 245 | public function getTaxPercent() |
246 | 246 | { |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | /** |
571 | 571 | * Returns position object |
572 | 572 | * |
573 | - * @return object Ilib_Position |
|
573 | + * @return Ilib_Position Ilib_Position |
|
574 | 574 | */ |
575 | 575 | function getPosition($db) |
576 | 576 | { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $product = new Product($this->debtor->kernel, $input["product_id"], $input['product_detail_id']); |
283 | 283 | |
284 | 284 | if (!is_object($product) || $product->get('id') == 0) { |
285 | - $this->error->set("Ugyldigt produkt"); |
|
285 | + $this->error->set("Ugyldigt produkt"); |
|
286 | 286 | } else { |
287 | 287 | $product_detail_id = $product->get("detail_id"); |
288 | 288 | } |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $product = new Product($this->debtor->kernel, $product_id); |
375 | 375 | |
376 | 376 | if (!is_object($product) || $product->get('id') == 0) { |
377 | - throw new Excetion('Invalid product id'); |
|
377 | + throw new Excetion('Invalid product id'); |
|
378 | 378 | } else { |
379 | 379 | $product_detail_id = $product->get("detail_id"); |
380 | 380 | } |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $i++; |
502 | 502 | } |
503 | 503 | } else { |
504 | - throw new Exception("Ugyldig produktdetalje i DebtorItem->getList() on ".$db->f('product_id').'/'.$db->f('product_detail_id')); |
|
504 | + throw new Exception("Ugyldig produktdetalje i DebtorItem->getList() on ".$db->f('product_id').'/'.$db->f('product_detail_id')); |
|
505 | 505 | } |
506 | 506 | } |
507 | 507 | unset($db); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | // TODO how do we handle vat? this should return raw prices |
225 | 225 | // and then the tax percent should return the tax to apply |
226 | 226 | // the calculator should handle the final price |
227 | - return $this->getProductPrice() * $this->get('quantity'); |
|
227 | + return $this->getProductPrice()*$this->get('quantity'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function getWeight() |
236 | 236 | { |
237 | - return $this->getProductWeight() * $this->get('quantity'); |
|
237 | + return $this->getProductWeight()*$this->get('quantity'); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -471,14 +471,14 @@ discard block |
||
471 | 471 | $variation = $product->getVariation($db->f('product_variation_id')); |
472 | 472 | $detail = $variation->getDetail($db->f('product_variation_detail_id')); |
473 | 473 | $item["name"] = $product->get("name").' - '.$variation->getName(); |
474 | - $item["number"]= $product->get("number").'.'.$variation->getNumber(); |
|
474 | + $item["number"] = $product->get("number").'.'.$variation->getNumber(); |
|
475 | 475 | $item["price"] = $detail->getPrice($product); |
476 | 476 | if ($currency) { |
477 | 477 | $item['price_currency'] = $detail->getPriceInCurrency($currency, $this->debtor->get('currency_product_price_exchange_rate_id'), $product); |
478 | 478 | } |
479 | 479 | } else { |
480 | 480 | $item["name"] = $product->get("name"); |
481 | - $item["number"]= $product->get("number"); |
|
481 | + $item["number"] = $product->get("number"); |
|
482 | 482 | $item["price"] = $product->getDetails()->getPrice(); |
483 | 483 | if ($currency) { |
484 | 484 | $item['price_currency'] = $product->getDetails()->getPriceInCurrency($currency, $this->debtor->get('currency_product_price_exchange_rate_id')); |
@@ -487,16 +487,16 @@ discard block |
||
487 | 487 | |
488 | 488 | if ($product->get("vat") == 0) { |
489 | 489 | $item_no_vat[$j] = $item; |
490 | - $item_no_vat[$j]["amount"] = new Ilib_Variable_Float($item["quantity"] * $item["price"]->getAsIso(2)); |
|
490 | + $item_no_vat[$j]["amount"] = new Ilib_Variable_Float($item["quantity"]*$item["price"]->getAsIso(2)); |
|
491 | 491 | if ($currency) { |
492 | - $item_no_vat[$j]["amount_currency"] = new Ilib_Variable_Float($item["quantity"] * $item["price_currency"]->getAsIso(2), 'iso'); |
|
492 | + $item_no_vat[$j]["amount_currency"] = new Ilib_Variable_Float($item["quantity"]*$item["price_currency"]->getAsIso(2), 'iso'); |
|
493 | 493 | } |
494 | 494 | $j++; |
495 | 495 | } else { |
496 | 496 | $item_with_vat[$i] = $item; |
497 | - $item_with_vat[$i]["amount"] = new Ilib_Variable_Float($item["quantity"] * $item["price"]->getAsIso(2) * 1.25); |
|
497 | + $item_with_vat[$i]["amount"] = new Ilib_Variable_Float($item["quantity"]*$item["price"]->getAsIso(2)*1.25); |
|
498 | 498 | if ($currency) { |
499 | - $item_with_vat[$i]["amount_currency"] = new Ilib_Variable_Float($item["quantity"] * $item["price_currency"]->getAsIso(2) * 1.25, 'iso'); |
|
499 | + $item_with_vat[$i]["amount_currency"] = new Ilib_Variable_Float($item["quantity"]*$item["price_currency"]->getAsIso(2)*1.25, 'iso'); |
|
500 | 500 | } |
501 | 501 | $i++; |
502 | 502 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @param string $belong_to Which type the file belongs to |
27 | 27 | * @param integer $belong_to_id The id this appended file belongs to |
28 | 28 | * |
29 | - * @return void |
|
29 | + * @return integer |
|
30 | 30 | */ |
31 | 31 | public function __construct($kernel, $belong_to, $belong_to_id) |
32 | 32 | { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * Adds an array with files |
159 | 159 | * |
160 | - * @param array $files An array with files |
|
160 | + * @param FakeAppendFileFile[] $files An array with files |
|
161 | 161 | * |
162 | 162 | * @return boolean |
163 | 163 | */ |
@@ -188,6 +188,7 @@ discard block |
||
188 | 188 | /** |
189 | 189 | * Undelete |
190 | 190 | * |
191 | + * @param integer $id |
|
191 | 192 | * @return boolean |
192 | 193 | */ |
193 | 194 | public function undelete($id) |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | if ($this->dbquery) { |
100 | 100 | return $this->dbquery; |
101 | 101 | } |
102 | - $this->dbquery = new Ilib_DBQuery('filehandler_append_file', 'filehandler_append_file.active = 1 AND filehandler_append_file.intranet_id='.$this->kernel->intranet->get('id').' AND filehandler_append_file.belong_to_key = '.$this->belong_to_key.' AND filehandler_append_file.belong_to_id = ' . $this->belong_to_id); |
|
102 | + $this->dbquery = new Ilib_DBQuery('filehandler_append_file', 'filehandler_append_file.active = 1 AND filehandler_append_file.intranet_id='.$this->kernel->intranet->get('id').' AND filehandler_append_file.belong_to_key = '.$this->belong_to_key.' AND filehandler_append_file.belong_to_id = '.$this->belong_to_id); |
|
103 | 103 | $this->dbquery->createStore($this->kernel->getSessionId(), 'intranet_id = '.intval($this->kernel->intranet->get('id'))); |
104 | 104 | return $this->dbquery; |
105 | 105 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | $db = new DB_Sql(); |
117 | 117 | $db->query("SELECT id FROM filehandler_append_file |
118 | - WHERE intranet_id = " . $this->kernel->intranet->get('id') . " |
|
118 | + WHERE intranet_id = " . $this->kernel->intranet->get('id')." |
|
119 | 119 | AND belong_to_key = ".$this->belong_to_key." |
120 | 120 | AND belong_to_id = ".$this->belong_to_id." |
121 | 121 | AND file_handler_id = ".$file_id." |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /** |
199 | 199 | * Creates a filehandler |
200 | 200 | * |
201 | - * @param object $kernel Kernel object |
|
201 | + * @param Stub_Kernel $kernel Kernel object |
|
202 | 202 | * @param string $access_key The accesskey |
203 | 203 | * |
204 | 204 | * @return object |
@@ -359,7 +359,8 @@ discard block |
||
359 | 359 | * creates and temporary file handler |
360 | 360 | * |
361 | 361 | * @param string optional file name |
362 | - * @return object temporary file |
|
362 | + * @param string $file_name |
|
363 | + * @return TemporaryFile temporary file |
|
363 | 364 | */ |
364 | 365 | public function createTemporaryFile($file_name = null) |
365 | 366 | { |
@@ -689,8 +690,7 @@ discard block |
||
689 | 690 | /** |
690 | 691 | * Returns RandomKeyGenerator |
691 | 692 | * |
692 | - * @param integer $length the length of the random key |
|
693 | - * @return object RandomKeyGenerator |
|
693 | + * @return Ilib_RandomKeyGenerator RandomKeyGenerator |
|
694 | 694 | */ |
695 | 695 | private function getRandomKeyGenerator() |
696 | 696 | { |
@@ -50,7 +50,7 @@ |
||
50 | 50 | /** |
51 | 51 | * Creates the keywords object |
52 | 52 | * |
53 | - * @return object |
|
53 | + * @return Keyword |
|
54 | 54 | */ |
55 | 55 | public function getKeywords() |
56 | 56 | { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * Constructor |
30 | 30 | * |
31 | - * @param object $file_handler |
|
31 | + * @param FileHandler $file_handler |
|
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | * |
142 | 142 | * @param float $width Width |
143 | 143 | * @param float $height Height |
144 | - * @param float $offset_x offset x |
|
145 | - * @param float $offset_y offset y |
|
144 | + * @param integer $offset_x offset x |
|
145 | + * @param integer $offset_y offset y |
|
146 | 146 | * |
147 | 147 | * @return string new file name |
148 | 148 | */ |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | - /** |
|
3 | - * Image handler. Klarer h�ndtering af billeder. |
|
4 | - * |
|
5 | - * @package Intraface |
|
6 | - * @author: Sune |
|
7 | - * @version: 1.0 |
|
8 | - * |
|
9 | - */ |
|
2 | + /** |
|
3 | + * Image handler. Klarer h�ndtering af billeder. |
|
4 | + * |
|
5 | + * @package Intraface |
|
6 | + * @author: Sune |
|
7 | + * @version: 1.0 |
|
8 | + * |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | class ImageHandler extends Intraface_Standard |
12 | 12 | { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->image_library = IMAGE_LIBRARY; |
55 | 55 | |
56 | 56 | if ($this->file_handler->get('is_image') != 1) { |
57 | - throw new Exception("Filtypen " . $file_handler->get('mime_type') . " er ikke et billede, og kan derfor ikke manipuleres i ImageHandler"); |
|
57 | + throw new Exception("Filtypen ".$file_handler->get('mime_type')." er ikke et billede, og kan derfor ikke manipuleres i ImageHandler"); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $this->tempdir_path = $this->file_handler->getTemporaryDirectory(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $image = Image_Transform::factory($this->image_library); |
82 | 82 | if (PEAR::isError($image)) { |
83 | - throw new Exception($image->getMessage() . $image->getUserInfo()); |
|
83 | + throw new Exception($image->getMessage().$image->getUserInfo()); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ($this->tmp_file_name != null && file_exists($this->tmp_file_name)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $image = Image_Transform::factory($this->image_library); |
152 | 152 | if (PEAR::isError($image)) { |
153 | - throw new Exception($image->getMessage() . $image->getUserInfo()); |
|
153 | + throw new Exception($image->getMessage().$image->getUserInfo()); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | if ($this->tmp_file_name != null && file_exists($this->tmp_file_name)) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $result = $image->crop($width, $height, $offset_x, $offset_y); |
169 | 169 | |
170 | 170 | if (PEAR::isError($result)) { |
171 | - throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: " . $result->getMessage()); |
|
171 | + throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: ".$result->getMessage()); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $file_type = $this->file_handler->get('file_type'); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param object $file_handler File handler object |
35 | 35 | * @param integer $id Optional id |
36 | 36 | * |
37 | - * @return void |
|
37 | + * @return string |
|
38 | 38 | */ |
39 | 39 | function __construct($file_handler, $id = 0) |
40 | 40 | { |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * Factory |
67 | 67 | * |
68 | - * @param object $file_handler File handler |
|
69 | - * @param string $type the instance type |
|
68 | + * @param FileHandler $file_handler File handler |
|
70 | 69 | * @param array $param one or more of crop_width, crop_height, crop_offset_x, crop_offset_y |
70 | + * @param string $type_name |
|
71 | 71 | * |
72 | - * @return object |
|
72 | + * @return InstanceHandler |
|
73 | 73 | */ |
74 | 74 | function factory($file_handler, $type_name, $param = array()) |
75 | 75 | { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | type_key = ".$type['type_key'].", |
124 | 124 | file_size = ".(int)$file_size.", |
125 | 125 | width = ".(int)$width.", |
126 | - height = ".(int)$height.", " . |
|
126 | + height = ".(int)$height.", ". |
|
127 | 127 | "crop_parameter = \"".safeToDb($crop_param_string)."\""); |
128 | 128 | |
129 | 129 | $id = $db->insertedId(); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | //$this->value['predefined_size'] = $db->f('predefined_size'); |
188 | 188 | $this->value['server_file_name'] = $db->f('server_file_name'); |
189 | 189 | $this->value['file_size'] = $db->f('file_size'); |
190 | - $this->value['file_path'] = $this->instance_path . $db->f('server_file_name'); |
|
190 | + $this->value['file_path'] = $this->instance_path.$db->f('server_file_name'); |
|
191 | 191 | |
192 | 192 | $this->value['last_modified'] = filemtime($this->get('file_path')); |
193 | 193 | // $this->value['file_uri'] = FILE_VIEWER.'?id='.$this->get('id').'&type='.$this->get('type').'&name=/'.urlencode($this->file_handler->get('file_name')); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | * then the filehandler->save method should rather accept some kind of file object which this |
71 | 71 | * object could generate? |
72 | 72 | * |
73 | - * @param object $file_handler A filehandler |
|
73 | + * @param FileHandler $file_handler A filehandler |
|
74 | 74 | * |
75 | 75 | * @return void |
76 | 76 | */ |
@@ -288,7 +288,7 @@ |
||
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | |
291 | - $ext = substr($file, strrpos($file, ".")+1); |
|
291 | + $ext = substr($file, strrpos($file, ".") + 1); |
|
292 | 292 | |
293 | 293 | if (strlen($ext) < 3 || strlen($ext) > 4) { |
294 | 294 | $this->file_handler->error->set("Filen \"".$file."\" har ikke en gyldig endelse, f.eks. .pdf"); |
@@ -85,6 +85,9 @@ |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param string $module_name |
|
90 | + */ |
|
88 | 91 | public function registerModule($module_name) |
89 | 92 | { |
90 | 93 | $gateway = new Intraface_ModuleGateway(MDB2::singleton(DB_DSN)); |
@@ -95,7 +95,7 @@ |
||
95 | 95 | * |
96 | 96 | * @param string $action Which action to perform? |
97 | 97 | * |
98 | - * @return void |
|
98 | + * @return boolean |
|
99 | 99 | */ |
100 | 100 | function transactionAction($action) |
101 | 101 | { |