@@ -130,8 +130,9 @@ |
||
130 | 130 | { |
131 | 131 | if ( is_dir( $f ) ){ |
132 | 132 | foreach ( scandir( $f ) as $item ){ |
133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
134 | - continue; |
|
133 | + if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) { |
|
134 | + continue; |
|
135 | + } |
|
135 | 136 | $this->deleteUploadDirectory( $f . "/" . $item ); |
136 | 137 | } |
137 | 138 | rmdir( $f ); |
@@ -251,7 +251,9 @@ |
||
251 | 251 | foreach ($web_files AS $file) { |
252 | 252 | $src_file = substr($file, 4); |
253 | 253 | $formatted_file = substr($file, strlen($web_dir . '/')); |
254 | - if (in_array($src_file, $ignore)) continue; |
|
254 | + if (in_array($src_file, $ignore)) { |
|
255 | + continue; |
|
256 | + } |
|
255 | 257 | $pfm->addInstallAs($src_file, $formatted_file); |
256 | 258 | } |
257 | 259 |
@@ -307,7 +307,9 @@ |
||
307 | 307 | |
308 | 308 | for ($i = 0, $max = count($item), $total = 0, $total_currency = 0; $i<$max; $i++) { |
309 | 309 | $total += $item[$i]["amount"]->getAsIso(); |
310 | - if ($currency) $total_currency += $item[$i]['amount_currency']->getAsIso(); |
|
310 | + if ($currency) { |
|
311 | + $total_currency += $item[$i]['amount_currency']->getAsIso(); |
|
312 | + } |
|
311 | 313 | } |
312 | 314 | |
313 | 315 | // no round off of curreny yet! |
@@ -166,8 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | if ($this->getProduct()->get('has_variation')) { |
168 | 168 | return $this->getProductVariationDetail()->getPrice($this->getProduct()); |
169 | - } |
|
170 | - else { |
|
169 | + } else { |
|
171 | 170 | return $this->getProduct()->getDetails()->getPrice(); |
172 | 171 | } |
173 | 172 | } |
@@ -181,8 +180,7 @@ discard block |
||
181 | 180 | { |
182 | 181 | if ($this->getProduct()->get('has_variation')) { |
183 | 182 | return $this->getProduct()->get("weight") + $this->getProductVariationDetail()->getWeightDifference(); |
184 | - } |
|
185 | - else { |
|
183 | + } else { |
|
186 | 184 | return $this->getProduct()->get("weight"); |
187 | 185 | } |
188 | 186 | } |
@@ -196,8 +194,7 @@ discard block |
||
196 | 194 | { |
197 | 195 | if ($this->getProduct()->get('has_variation')) { |
198 | 196 | return $this->getProduct()->get("number").'.'.$this->getProductVariation()->getNumber(); |
199 | - } |
|
200 | - else { |
|
197 | + } else { |
|
201 | 198 | return $this->getProduct()->get("number"); |
202 | 199 | } |
203 | 200 | } |
@@ -211,8 +208,7 @@ discard block |
||
211 | 208 | { |
212 | 209 | if ($this->getProduct()->get('has_variation')) { |
213 | 210 | return $this->getProduct()->get("name").' - '.$this->getProductVariation()->getName(); |
214 | - } |
|
215 | - else { |
|
211 | + } else { |
|
216 | 212 | return $this->getProduct()->get("name"); |
217 | 213 | } |
218 | 214 | } |
@@ -291,14 +287,18 @@ discard block |
||
291 | 287 | $product_detail_id = $product->get("detail_id"); |
292 | 288 | } |
293 | 289 | |
294 | - if (!isset($input['product_variation_id'])) $input['product_variation_id'] = 0; |
|
290 | + if (!isset($input['product_variation_id'])) { |
|
291 | + $input['product_variation_id'] = 0; |
|
292 | + } |
|
295 | 293 | if (intval($input['product_variation_id']) != 0) { |
296 | 294 | $variation = $product->getVariation(intval($input['product_variation_id'])); |
297 | 295 | if (!$variation->getId()) { |
298 | 296 | $this->error->set("Invalid product variation"); |
299 | 297 | } |
300 | 298 | |
301 | - if (!isset($input['product_variation_detail_id'])) $input['product_variation_detail_id'] = 0; |
|
299 | + if (!isset($input['product_variation_detail_id'])) { |
|
300 | + $input['product_variation_detail_id'] = 0; |
|
301 | + } |
|
302 | 302 | $detail = $variation->getDetail(intval($input['product_variation_detail_id'])); |
303 | 303 | if (!$detail->getId()) { |
304 | 304 | $this->error->set("Invalid product variation detail"); |
@@ -306,15 +306,16 @@ discard block |
||
306 | 306 | |
307 | 307 | $variation_id = $variation->getId(); |
308 | 308 | $variation_detail_id = $detail->getId(); |
309 | - } |
|
310 | - else { |
|
309 | + } else { |
|
311 | 310 | $variation_id = 0; |
312 | 311 | $variation_detail_id = 0; |
313 | 312 | } |
314 | 313 | |
315 | 314 | } |
316 | 315 | |
317 | - if (!isset($input["quantity"])) $input["quantity"] = 0; |
|
316 | + if (!isset($input["quantity"])) { |
|
317 | + $input["quantity"] = 0; |
|
318 | + } |
|
318 | 319 | $validator->isDouble($input["quantity"], "Du skal angive et antal", ""); |
319 | 320 | $quantity = new Intraface_Amount($input["quantity"]); |
320 | 321 | if ($quantity->convert2db()) { |
@@ -322,7 +323,9 @@ discard block |
||
322 | 323 | } else { |
323 | 324 | $this->error->set("Ugyligt antal"); |
324 | 325 | } |
325 | - if (!isset($input['description'])) $input['description'] = ''; |
|
326 | + if (!isset($input['description'])) { |
|
327 | + $input['description'] = ''; |
|
328 | + } |
|
326 | 329 | $validator->isString($input["description"], "Fejl i beskrivelse", "<b><i>", "allow_empty"); |
327 | 330 | |
328 | 331 | if ($this->error->isError()) { |
@@ -107,7 +107,9 @@ discard block |
||
107 | 107 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $line[$i]); |
108 | 108 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
109 | 109 | |
110 | - if ($i == 2) $i = count($line); |
|
110 | + if ($i == 2) { |
|
111 | + $i = count($line); |
|
112 | + } |
|
111 | 113 | } |
112 | 114 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $contact["postcode"]." ".$contact["city"]); |
113 | 115 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
@@ -148,7 +150,9 @@ discard block |
||
148 | 150 | for ($i = 0; $i < count($line); $i++) { |
149 | 151 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $line[$i]); |
150 | 152 | $this->doc->setY('-'.$this->doc->get("font_spacing")); // $pointY -= $this->doc->get("font_spacing"); |
151 | - if ($i == 2) $i = count($line); |
|
153 | + if ($i == 2) { |
|
154 | + $i = count($line); |
|
155 | + } |
|
152 | 156 | } |
153 | 157 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["postcode"]." ".$intranet["city"]); |
154 | 158 | $this->doc->setY('-'.($this->doc->get("font_spacing") * 2)); // $pointY -= $this->doc->get("font_spacing") * 2; |
@@ -355,7 +359,9 @@ discard block |
||
355 | 359 | for ($i = 0; $i < count($line); $i++) { |
356 | 360 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $line[$i]); |
357 | 361 | $this->doc->setY('-'.$this->doc->get('font_spacing')); |
358 | - if ($i == 2) $i = count($line); |
|
362 | + if ($i == 2) { |
|
363 | + $i = count($line); |
|
364 | + } |
|
359 | 365 | } |
360 | 366 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["contact"]->address->get("postcode")." ".$parameter["contact"]->address->get("city")); |
361 | 367 |
@@ -442,9 +442,7 @@ |
||
442 | 442 | |
443 | 443 | $this->onlinepayment->setStatus('cancelled'); |
444 | 444 | $this->getDebtor()->load(); |
445 | - } |
|
446 | - |
|
447 | - else { |
|
445 | + } else { |
|
448 | 446 | $debtor = $this->getDebtor(); |
449 | 447 | $contact = new Contact($this->getKernel(), $_POST["contact_id"]); |
450 | 448 |
@@ -290,8 +290,7 @@ |
||
290 | 290 | $countries = new Ilib_Countries('iso-8859-1'); |
291 | 291 | if (false !== ($country = $countries->getCountryByName(trim($customer['country'])))) { |
292 | 292 | $evaluate = $country['region']; |
293 | - } |
|
294 | - else { |
|
293 | + } else { |
|
295 | 294 | $evaluate = 'unknown'; |
296 | 295 | } |
297 | 296 |
@@ -193,12 +193,16 @@ |
||
193 | 193 | $value['message'] = $input['message']; |
194 | 194 | |
195 | 195 | if (isset($input['customer_coupon']) && $input['customer_coupon'] != '') { |
196 | - if ($value['message'] != '') $value['message'] .= "\n\n"; |
|
196 | + if ($value['message'] != '') { |
|
197 | + $value['message'] .= "\n\n"; |
|
198 | + } |
|
197 | 199 | $value['message'] .= "Kundekupon:". $input['customer_coupon']; |
198 | 200 | } |
199 | 201 | |
200 | 202 | if (isset($input['customer_comment']) && $input['customer_comment'] != '') { |
201 | - if ($value['message'] != '') $value['message'] .= "\n\n"; |
|
203 | + if ($value['message'] != '') { |
|
204 | + $value['message'] .= "\n\n"; |
|
205 | + } |
|
202 | 206 | $value['message'] .= "Kommentar:\n". $input['customer_comment']; |
203 | 207 | } |
204 | 208 |
@@ -485,8 +485,7 @@ |
||
485 | 485 | foreach ($this->getItems() AS $item) { |
486 | 486 | if ($type == 'exclusive_vat') { |
487 | 487 | $price += $item['totalprice']; |
488 | - } |
|
489 | - else { |
|
488 | + } else { |
|
490 | 489 | $price += $item['totalprice_incl_vat']; |
491 | 490 | } |
492 | 491 | } |