@@ -52,7 +52,9 @@ |
||
52 | 52 | // @todo this should be avoided |
53 | 53 | $filehandler->createInstance(); |
54 | 54 | // HACK lille hack - til at undg� at vi f�r filer med som ikke har beskrivelser (formentlig slettede filer) |
55 | - if (!$filehandler->get('description')) continue; |
|
55 | + if (!$filehandler->get('description')) { |
|
56 | + continue; |
|
57 | + } |
|
56 | 58 | $this->value['files'][$i] = $filehandler->get(); |
57 | 59 | $this->value['files'][$i]['append_file_id'] = $append_file_id; |
58 | 60 | // $this->value['pictures'][$i]['show_uri'] = $file_uri; |
@@ -121,13 +121,27 @@ |
||
121 | 121 | |
122 | 122 | function save_element($var) |
123 | 123 | { |
124 | - if (!empty($var['service'])) $this->parameter->save('service', $var['service']); |
|
125 | - if (!empty($var['text'])) $this->parameter->save('text', $var['text']); |
|
126 | - if (!empty($var['latitude'])) $this->parameter->save('latitude', $var['latitude']); |
|
127 | - if (!empty($var['longitude'])) $this->parameter->save('longitude', $var['longitude']); |
|
128 | - if (!empty($var['height'])) $this->parameter->save('height', $var['height']); |
|
129 | - if (!empty($var['width'])) $this->parameter->save('width', $var['width']); |
|
130 | - if (!empty($var['api_key'])) $this->parameter->save('api_key', $var['api_key']); |
|
124 | + if (!empty($var['service'])) { |
|
125 | + $this->parameter->save('service', $var['service']); |
|
126 | + } |
|
127 | + if (!empty($var['text'])) { |
|
128 | + $this->parameter->save('text', $var['text']); |
|
129 | + } |
|
130 | + if (!empty($var['latitude'])) { |
|
131 | + $this->parameter->save('latitude', $var['latitude']); |
|
132 | + } |
|
133 | + if (!empty($var['longitude'])) { |
|
134 | + $this->parameter->save('longitude', $var['longitude']); |
|
135 | + } |
|
136 | + if (!empty($var['height'])) { |
|
137 | + $this->parameter->save('height', $var['height']); |
|
138 | + } |
|
139 | + if (!empty($var['width'])) { |
|
140 | + $this->parameter->save('width', $var['width']); |
|
141 | + } |
|
142 | + if (!empty($var['api_key'])) { |
|
143 | + $this->parameter->save('api_key', $var['api_key']); |
|
144 | + } |
|
131 | 145 | return true; |
132 | 146 | } |
133 | 147 | } |
134 | 148 | \ No newline at end of file |
@@ -142,10 +142,11 @@ discard block |
||
142 | 142 | $_config = $this->configSettings($config, $events); |
143 | 143 | |
144 | 144 | $js = $this->returnGlobalEvents(); |
145 | - if (!empty($_config)) |
|
146 | - $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; |
|
147 | - else |
|
148 | - $js .= "CKEDITOR.replace('".$name."');"; |
|
145 | + if (!empty($_config)) { |
|
146 | + $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; |
|
147 | + } else { |
|
148 | + $js .= "CKEDITOR.replace('".$name."');"; |
|
149 | + } |
|
149 | 150 | |
150 | 151 | $out .= $this->script($js); |
151 | 152 | |
@@ -182,8 +183,7 @@ discard block |
||
182 | 183 | $js = $this->returnGlobalEvents(); |
183 | 184 | if (!empty($_config)) { |
184 | 185 | $js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");"; |
185 | - } |
|
186 | - else { |
|
186 | + } else { |
|
187 | 187 | $js .= "CKEDITOR.replace('".$id."');"; |
188 | 188 | } |
189 | 189 | $out .= $this->script($js); |
@@ -226,12 +226,10 @@ discard block |
||
226 | 226 | if (empty($_config)) { |
227 | 227 | if (empty($className)) { |
228 | 228 | $js .= "CKEDITOR.replaceAll();"; |
229 | - } |
|
230 | - else { |
|
229 | + } else { |
|
231 | 230 | $js .= "CKEDITOR.replaceAll('".$className."');"; |
232 | 231 | } |
233 | - } |
|
234 | - else { |
|
232 | + } else { |
|
235 | 233 | $classDetection = ""; |
236 | 234 | $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n"; |
237 | 235 | if (!empty($className)) { |
@@ -289,8 +287,7 @@ discard block |
||
289 | 287 | { |
290 | 288 | if (!empty($event)) { |
291 | 289 | $this->events[$event] = array(); |
292 | - } |
|
293 | - else { |
|
290 | + } else { |
|
294 | 291 | $this->events = array(); |
295 | 292 | } |
296 | 293 | } |
@@ -329,8 +326,7 @@ discard block |
||
329 | 326 | { |
330 | 327 | if (!empty($event)) { |
331 | 328 | $this->globalEvents[$event] = array(); |
332 | - } |
|
333 | - else { |
|
329 | + } else { |
|
334 | 330 | $this->globalEvents = array(); |
335 | 331 | } |
336 | 332 | } |
@@ -381,11 +377,9 @@ discard block |
||
381 | 377 | foreach ($_events as $eventName => $handlers) { |
382 | 378 | if (empty($handlers)) { |
383 | 379 | continue; |
384 | - } |
|
385 | - else if (count($handlers) == 1) { |
|
380 | + } else if (count($handlers) == 1) { |
|
386 | 381 | $_config['on'][$eventName] = '@@'.$handlers[0]; |
387 | - } |
|
388 | - else { |
|
382 | + } else { |
|
389 | 383 | $_config['on'][$eventName] = '@@function (ev){'; |
390 | 384 | foreach ($handlers as $handler => $code) { |
391 | 385 | $_config['on'][$eventName] .= '('.$code.')(ev);'; |
@@ -488,8 +482,7 @@ discard block |
||
488 | 482 | */ |
489 | 483 | if (isset($_SERVER['SCRIPT_FILENAME'])) { |
490 | 484 | $realPath = dirname($_SERVER['SCRIPT_FILENAME']); |
491 | - } |
|
492 | - else { |
|
485 | + } else { |
|
493 | 486 | /** |
494 | 487 | * realpath — Returns canonicalized absolute pathname |
495 | 488 | */ |
@@ -544,8 +537,7 @@ discard block |
||
544 | 537 | // Use @@ to not use quotes when outputting string value |
545 | 538 | if (strpos($val, '@@') === 0) { |
546 | 539 | return substr($val, 2); |
547 | - } |
|
548 | - else { |
|
540 | + } else { |
|
549 | 541 | // All scalars are converted to strings to avoid indeterminism. |
550 | 542 | // PHP's "1" and 1 are equal for all PHP operators, but |
551 | 543 | // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend, |
@@ -571,12 +563,15 @@ discard block |
||
571 | 563 | $result = array(); |
572 | 564 | if ($isList) |
573 | 565 | { |
574 | - foreach ($val as $v) $result[] = $this->jsEncode($v); |
|
566 | + foreach ($val as $v) { |
|
567 | + $result[] = $this->jsEncode($v); |
|
568 | + } |
|
575 | 569 | return '[ ' . join(', ', $result) . ' ]'; |
576 | - } |
|
577 | - else |
|
570 | + } else |
|
578 | 571 | { |
579 | - foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
|
572 | + foreach ($val as $k => $v) { |
|
573 | + $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
|
574 | + } |
|
580 | 575 | return '{ ' . join(', ', $result) . ' }'; |
581 | 576 | } |
582 | 577 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | if (is_numeric($name)) { |
18 | 18 | return 'Intraface_modules_cms_Controller_Site'; |
19 | - } elseif ($name == 'create') { |
|
19 | + } elseif ($name == 'create') { |
|
20 | 20 | return 'Intraface_modules_cms_Controller_SiteEdit'; |
21 | 21 | } |
22 | 22 | } |
@@ -491,7 +491,9 @@ |
||
491 | 491 | |
492 | 492 | foreach ($posts as $p) { |
493 | 493 | $post = new Post($this, $p['id']); |
494 | - if ($post->get('stated') == 1) continue; |
|
494 | + if ($post->get('stated') == 1) { |
|
495 | + continue; |
|
496 | + } |
|
495 | 497 | |
496 | 498 | if (!$post->setStated()) { |
497 | 499 | $this->error->set('id#' .$p['id'] . ': Det lykkedes ikke at bogføre denne post.'); |
@@ -622,58 +622,92 @@ |
||
622 | 622 | function setSettings($input) |
623 | 623 | { |
624 | 624 | if ($this->get('vat') > 0) { |
625 | - if (empty($input['vat_in_account_id'])) $input['vat_in_account_id'] = 0; |
|
625 | + if (empty($input['vat_in_account_id'])) { |
|
626 | + $input['vat_in_account_id'] = 0; |
|
627 | + } |
|
626 | 628 | $this->setSetting('vat_in_account_id', (int)$input['vat_in_account_id']); |
627 | 629 | |
628 | - if (empty($input['vat_out_account_id'])) $input['vat_out_account_id'] = 0; |
|
630 | + if (empty($input['vat_out_account_id'])) { |
|
631 | + $input['vat_out_account_id'] = 0; |
|
632 | + } |
|
629 | 633 | $this->setSetting('vat_out_account_id', (int)$input['vat_out_account_id']); |
630 | 634 | |
631 | - if (empty($input['vat_abroad_account_id'])) $input['vat_abroad_account_id'] = 0; |
|
635 | + if (empty($input['vat_abroad_account_id'])) { |
|
636 | + $input['vat_abroad_account_id'] = 0; |
|
637 | + } |
|
632 | 638 | $this->setSetting('vat_abroad_account_id', (int)$input['vat_abroad_account_id']); |
633 | 639 | |
634 | - if (empty($input['vat_balance_account_id'])) $input['vat_balance_account_id'] = 0; |
|
640 | + if (empty($input['vat_balance_account_id'])) { |
|
641 | + $input['vat_balance_account_id'] = 0; |
|
642 | + } |
|
635 | 643 | $this->setSetting('vat_balance_account_id', (int)$input['vat_balance_account_id']); |
636 | 644 | |
637 | - if (empty($input['vat_free_account_id'])) $input['vat_free_account_id'] = 0; |
|
645 | + if (empty($input['vat_free_account_id'])) { |
|
646 | + $input['vat_free_account_id'] = 0; |
|
647 | + } |
|
638 | 648 | $this->setSetting('vat_free_account_id', (int)$input['vat_free_account_id']); |
639 | 649 | |
640 | - if (empty($input['eu_sale_account_id'])) $input['eu_sale_account_id'] = 0; |
|
650 | + if (empty($input['eu_sale_account_id'])) { |
|
651 | + $input['eu_sale_account_id'] = 0; |
|
652 | + } |
|
641 | 653 | $this->setSetting('eu_sale_account_id', (int)$input['eu_sale_account_id']); |
642 | 654 | //$this->setSetting('eu_buy_account_id', (int)$input['eu_buy_account_id']); |
643 | 655 | //$this->setSetting('abroad_buy_account_id', (int)$input['abroad_buy_account_id']); |
644 | 656 | } |
645 | - if (empty($input['result_account_id'])) $input['result_account_id'] = 0; |
|
657 | + if (empty($input['result_account_id'])) { |
|
658 | + $input['result_account_id'] = 0; |
|
659 | + } |
|
646 | 660 | $this->setSetting('result_account_id', (int)$input['result_account_id']); |
647 | 661 | |
648 | - if (empty($input['debtor_account_id'])) $input['debtor_account_id'] = 0; |
|
662 | + if (empty($input['debtor_account_id'])) { |
|
663 | + $input['debtor_account_id'] = 0; |
|
664 | + } |
|
649 | 665 | $this->setSetting('debtor_account_id', (int)$input['debtor_account_id']); |
650 | 666 | |
651 | - if (empty($input['credit_account_id'])) $input['credit_account_id'] = 0; |
|
667 | + if (empty($input['credit_account_id'])) { |
|
668 | + $input['credit_account_id'] = 0; |
|
669 | + } |
|
652 | 670 | $this->setSetting('credit_account_id', (int)$input['credit_account_id']); |
653 | 671 | |
654 | - if (empty($input['balance_accounts'])) $input['balance_accounts'] = array(); |
|
672 | + if (empty($input['balance_accounts'])) { |
|
673 | + $input['balance_accounts'] = array(); |
|
674 | + } |
|
655 | 675 | $this->setSetting('balance_accounts', serialize($input['balance_accounts'])); |
656 | 676 | |
657 | - if (empty($input['buy_abroad_accounts'])) $input['buy_abroad_accounts'] = array(); |
|
677 | + if (empty($input['buy_abroad_accounts'])) { |
|
678 | + $input['buy_abroad_accounts'] = array(); |
|
679 | + } |
|
658 | 680 | $this->setSetting('buy_abroad_accounts', serialize($input['buy_abroad_accounts'])); |
659 | 681 | |
660 | - if (empty($input['buy_eu_accounts'])) $input['buy_eu_accounts'] = array(); |
|
682 | + if (empty($input['buy_eu_accounts'])) { |
|
683 | + $input['buy_eu_accounts'] = array(); |
|
684 | + } |
|
661 | 685 | $this->setSetting('buy_eu_accounts', serialize($input['buy_eu_accounts'])); |
662 | 686 | |
663 | 687 | |
664 | - if (empty($input['result_account_id_start'])) $input['result_account_id_start'] = 0; |
|
688 | + if (empty($input['result_account_id_start'])) { |
|
689 | + $input['result_account_id_start'] = 0; |
|
690 | + } |
|
665 | 691 | $this->setSetting('result_account_id_start', $input['result_account_id_start']); |
666 | 692 | |
667 | - if (empty($input['result_account_id_end'])) $input['result_account_id_end'] = 0; |
|
693 | + if (empty($input['result_account_id_end'])) { |
|
694 | + $input['result_account_id_end'] = 0; |
|
695 | + } |
|
668 | 696 | $this->setSetting('result_account_id_end', $input['result_account_id_end']); |
669 | 697 | |
670 | - if (empty($input['balance_account_id_start'])) $input['balance_account_id_start'] = 0; |
|
698 | + if (empty($input['balance_account_id_start'])) { |
|
699 | + $input['balance_account_id_start'] = 0; |
|
700 | + } |
|
671 | 701 | $this->setSetting('balance_account_id_start', $input['balance_account_id_start']); |
672 | 702 | |
673 | - if (empty($input['balance_account_id_end'])) $input['balance_account_id_end'] = 0; |
|
703 | + if (empty($input['balance_account_id_end'])) { |
|
704 | + $input['balance_account_id_end'] = 0; |
|
705 | + } |
|
674 | 706 | $this->setSetting('balance_account_id_end', $input['balance_account_id_end']); |
675 | 707 | |
676 | - if (empty($input['capital_account_id'])) $input['capital_account_id'] = 0; |
|
708 | + if (empty($input['capital_account_id'])) { |
|
709 | + $input['capital_account_id'] = 0; |
|
710 | + } |
|
677 | 711 | $this->setSetting('capital_account_id', $input['capital_account_id']); |
678 | 712 | |
679 | 713 | return true; |
@@ -69,7 +69,9 @@ |
||
69 | 69 | $sql_end = " , date_created = NOW()"; |
70 | 70 | } |
71 | 71 | |
72 | - if (empty($var['description'])) $var['description'] = ''; |
|
72 | + if (empty($var['description'])) { |
|
73 | + $var['description'] = ''; |
|
74 | + } |
|
73 | 75 | |
74 | 76 | $sql = $sql_type . " accounting_voucher_file SET |
75 | 77 | date_updated = NOW(), |
@@ -59,11 +59,9 @@ discard block |
||
59 | 59 | $style = ''; |
60 | 60 | if ($account['type'] == 'headline') { |
61 | 61 | $style = $format_bold; |
62 | - } |
|
63 | - elseif ($account['type'] == 'sum') { |
|
62 | + } elseif ($account['type'] == 'sum') { |
|
64 | 63 | $style = $format_italic; |
65 | - } |
|
66 | - else { |
|
64 | + } else { |
|
67 | 65 | $style = $format; |
68 | 66 | } |
69 | 67 | |
@@ -86,11 +84,9 @@ discard block |
||
86 | 84 | $style = ''; |
87 | 85 | if ($account['type'] == 'headline') { |
88 | 86 | $style = $format_bold; |
89 | - } |
|
90 | - elseif ($account['type'] == 'sum') { |
|
87 | + } elseif ($account['type'] == 'sum') { |
|
91 | 88 | $style = $format_italic; |
92 | - } |
|
93 | - else { |
|
89 | + } else { |
|
94 | 90 | $style = $format; |
95 | 91 | } |
96 | 92 | |
@@ -122,8 +118,7 @@ discard block |
||
122 | 118 | $year_end = new YearEnd($year); |
123 | 119 | $year_end->setStep($_POST['step'] - 2); |
124 | 120 | |
125 | - } |
|
126 | - elseif (!empty($_POST['next'])) { |
|
121 | + } elseif (!empty($_POST['next'])) { |
|
127 | 122 | $year_end = new YearEnd($year); |
128 | 123 | $year_end->setStep($_POST['step']); |
129 | 124 | } |
@@ -138,9 +133,7 @@ discard block |
||
138 | 133 | // @todo save "resultatopgørelsen" |
139 | 134 | |
140 | 135 | $year_end->setStep($_POST['step']); |
141 | - } |
|
142 | - |
|
143 | - elseif (!empty($_POST['step_save_balance'])) { |
|
136 | + } elseif (!empty($_POST['step_save_balance'])) { |
|
144 | 137 | $year_end = new YearEnd($year); |
145 | 138 | |
146 | 139 | if (!$year_end->saveStatement('balance')) { |
@@ -148,8 +141,7 @@ discard block |
||
148 | 141 | } |
149 | 142 | |
150 | 143 | $year_end->setStep($_POST['step']); |
151 | - } |
|
152 | - elseif (!empty($_POST['step_transfer_result'])) { |
|
144 | + } elseif (!empty($_POST['step_transfer_result'])) { |
|
153 | 145 | $year_end = new YearEnd($year); |
154 | 146 | |
155 | 147 | if (!$year_end->resetYearResult()) { |
@@ -157,8 +149,7 @@ discard block |
||
157 | 149 | } |
158 | 150 | |
159 | 151 | $year_end->setStep($_POST['step']); |
160 | - } |
|
161 | - elseif (!empty($_POST['step_reverse_result_account_reset'])) { |
|
152 | + } elseif (!empty($_POST['step_reverse_result_account_reset'])) { |
|
162 | 153 | $year_end = new YearEnd($year); |
163 | 154 | if (!$year_end->resetYearResult('reverse')) { |
164 | 155 | echo $year_end->error->view(); |
@@ -183,12 +183,16 @@ |
||
183 | 183 | $value['message'] = $input['message']; |
184 | 184 | |
185 | 185 | if (isset($input['customer_coupon']) && $input['customer_coupon'] != '') { |
186 | - if ($value['message'] != '') $value['message'] .= "\n\n"; |
|
186 | + if ($value['message'] != '') { |
|
187 | + $value['message'] .= "\n\n"; |
|
188 | + } |
|
187 | 189 | $value['message'] .= "Kundekupon:". $input['customer_coupon']; |
188 | 190 | } |
189 | 191 | |
190 | 192 | if (isset($input['customer_comment']) && $input['customer_comment'] != '') { |
191 | - if ($value['message'] != '') $value['message'] .= "\n\n"; |
|
193 | + if ($value['message'] != '') { |
|
194 | + $value['message'] .= "\n\n"; |
|
195 | + } |
|
192 | 196 | $value['message'] .= "Kommentar:\n". $input['customer_comment']; |
193 | 197 | } |
194 | 198 |