@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $this->document->setTitle('Memos'); |
21 | 21 | |
22 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/memos'); |
|
22 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/memos'); |
|
23 | 23 | |
24 | 24 | if (is_numeric($this->context->name())) { |
25 | 25 | return $tpl->render($this, array('memos' => $gateway->findByContactId($this->context->name()))); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $reminder = new ContactReminder($this->context->getKernel()); |
35 | 35 | $contact = $reminder->contact; |
36 | 36 | |
37 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/memo-edit'); |
|
37 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/memo-edit'); |
|
38 | 38 | return $smarty->render($this, array('reminder' => $reminder, 'contact' => $contact)); |
39 | 39 | } |
40 | 40 |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @author Sune Jensen <[email protected]> |
115 | 115 | * @copyright Lars Olesen |
116 | 116 | */ |
117 | -require_once dirname(__FILE__) . '/ContactPerson.php'; |
|
117 | +require_once dirname(__FILE__).'/ContactPerson.php'; |
|
118 | 118 | require_once 'Intraface/functions.php'; |
119 | 119 | |
120 | 120 | class Contact extends Intraface_Standard |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | { |
382 | 382 | // HACK NECCESSARY FOR THE NEWSLETTERSUBSCRIBER |
383 | 383 | $this->kernel->useModule('contact'); |
384 | - return ($this->value['login_url'] = 'http://' . $this->kernel->getSetting()->get('intranet', 'contact.login_url') . '/' .$this->kernel->intranet->get('identifier') . '/login?code='. $this->get('code')); |
|
384 | + return ($this->value['login_url'] = 'http://'.$this->kernel->getSetting()->get('intranet', 'contact.login_url').'/'.$this->kernel->intranet->get('identifier').'/login?code='.$this->get('code')); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -551,16 +551,16 @@ discard block |
||
551 | 551 | |
552 | 552 | // prepare sql to update or insert |
553 | 553 | if ($this->id > 0) { |
554 | - $sql="UPDATE contact "; |
|
555 | - $sql_after=" WHERE id='".$this->id."'"; |
|
554 | + $sql = "UPDATE contact "; |
|
555 | + $sql_after = " WHERE id='".$this->id."'"; |
|
556 | 556 | $sql_create = ""; |
557 | 557 | } else { |
558 | - $sql="INSERT INTO contact "; |
|
559 | - $sql_after = ", code='".safeToDb(md5(date('Y-m-d H:i:s') . $sql_items))."'"; |
|
558 | + $sql = "INSERT INTO contact "; |
|
559 | + $sql_after = ", code='".safeToDb(md5(date('Y-m-d H:i:s').$sql_items))."'"; |
|
560 | 560 | $sql_create = "date_created = NOW(),"; |
561 | 561 | } |
562 | 562 | |
563 | - $sql .= " SET ".$sql_create. " |
|
563 | + $sql .= " SET ".$sql_create." |
|
564 | 564 | intranet_id = '". $this->kernel->intranet->get('id')."'," |
565 | 565 | .$sql_items. |
566 | 566 | "date_changed = NOW() |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | // Delivery Address |
591 | 591 | foreach ($address_fields as $key => $value) { |
592 | 592 | if (array_key_exists('delivery_'.$value, $var)) { |
593 | - $delivery_address_to_save[$value] = $var['delivery_' . $value]; |
|
593 | + $delivery_address_to_save[$value] = $var['delivery_'.$value]; |
|
594 | 594 | } |
595 | 595 | } |
596 | 596 | |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | return false; |
625 | 625 | } |
626 | 626 | $db = new DB_Sql; |
627 | - $db->query("UPDATE contact SET active = 0, date_changed = NOW() WHERE intranet_id = " . $this->kernel->intranet->get("id") . " AND id = " . $this->id); |
|
627 | + $db->query("UPDATE contact SET active = 0, date_changed = NOW() WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND id = ".$this->id); |
|
628 | 628 | return true; |
629 | 629 | } |
630 | 630 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | return false; |
645 | 645 | } |
646 | 646 | $db = new DB_Sql; |
647 | - $db->query("UPDATE contact SET active = 1, date_changed = NOW() WHERE intranet_id = " . $this->kernel->intranet->get("id") . " AND id = " . $this->id); |
|
647 | + $db->query("UPDATE contact SET active = 1, date_changed = NOW() WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND id = ".$this->id); |
|
648 | 648 | |
649 | 649 | return true; |
650 | 650 | } |
@@ -662,9 +662,9 @@ discard block |
||
662 | 662 | $db = new DB_Sql(); |
663 | 663 | $sql = "SELECT id |
664 | 664 | FROM contact |
665 | - WHERE intranet_id = " . $this->kernel->intranet->get("id") . " |
|
666 | - AND number = " . (int)$number . " |
|
667 | - AND id <> " . $this->id . " |
|
665 | + WHERE intranet_id = " . $this->kernel->intranet->get("id")." |
|
666 | + AND number = " . (int)$number." |
|
667 | + AND id <> " . $this->id." |
|
668 | 668 | AND active = 1 |
669 | 669 | LIMIT 1"; |
670 | 670 | $db->query($sql); |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | public function getMaxNumber() |
685 | 685 | { |
686 | 686 | $db = new DB_Sql(); |
687 | - $db->query("SELECT number FROM contact WHERE intranet_id = " . $this->kernel->intranet->get("id") . " ORDER BY number DESC"); |
|
687 | + $db->query("SELECT number FROM contact WHERE intranet_id = ".$this->kernel->intranet->get("id")." ORDER BY number DESC"); |
|
688 | 688 | if (!$db->nextRecord()) { |
689 | 689 | return 0; |
690 | 690 | } |
@@ -776,11 +776,11 @@ discard block |
||
776 | 776 | WHERE address.type=3 |
777 | 777 | AND contact.active = 1 |
778 | 778 | AND address.active = 1 |
779 | - AND contact.intranet_id = " . $db->quote($this->kernel->intranet->get('id'), 'integer') . " |
|
780 | - AND contact.id != " . $db->quote($this->id, 'integer') . " |
|
779 | + AND contact.intranet_id = " . $db->quote($this->kernel->intranet->get('id'), 'integer')." |
|
780 | + AND contact.id != " . $db->quote($this->id, 'integer')." |
|
781 | 781 | AND ( |
782 | - (address.email = " . $db->quote($this->address->get('email'), 'text') . " AND address.email != '') |
|
783 | - OR (address.phone = " . $db->quote($this->address->get('phone'), 'text') . " AND address.phone != '')) |
|
782 | + (address.email = " . $db->quote($this->address->get('email'), 'text')." AND address.email != '') |
|
783 | + OR (address.phone = " . $db->quote($this->address->get('phone'), 'text')." AND address.phone != '')) |
|
784 | 784 | |
785 | 785 | "; |
786 | 786 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | function isFilledIn() |
870 | 870 | { |
871 | 871 | $db = new DB_Sql; |
872 | - $db->query("SELECT count(*) AS antal FROM contact WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
872 | + $db->query("SELECT count(*) AS antal FROM contact WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
873 | 873 | if ($db->nextRecord()) { |
874 | 874 | return $db->f('antal'); |
875 | 875 | } |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | return false; |
888 | 888 | } |
889 | 889 | $db = new DB_Sql; |
890 | - $db->query("UPDATE contact SET code = '".md5($this->id . date('Y-m-d H:i:s') . $this->kernel->intranet->get('id'))."' WHERE id = " . $this->id); |
|
890 | + $db->query("UPDATE contact SET code = '".md5($this->id.date('Y-m-d H:i:s').$this->kernel->intranet->get('id'))."' WHERE id = ".$this->id); |
|
891 | 891 | $this->load(); |
892 | 892 | return true; |
893 | 893 | } |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | return false; |
905 | 905 | } |
906 | 906 | $db = new DB_Sql; |
907 | - $db->query("UPDATE contact SET password = '".md5($this->id . date('Y-m-d H:i:s') . $this->kernel->intranet->get('id'))."' WHERE id = " . $this->id); |
|
907 | + $db->query("UPDATE contact SET password = '".md5($this->id.date('Y-m-d H:i:s').$this->kernel->intranet->get('id'))."' WHERE id = ".$this->id); |
|
908 | 908 | $this->load(); |
909 | 909 | return true; |
910 | 910 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | function getNewsletterSubscriptions() |
918 | 918 | { |
919 | 919 | $db = new DB_Sql; |
920 | - $db->query("SELECT * FROM newsletter_subscriber WHERE optin = 1 AND active = 1 AND contact_id = " . $this->id . " AND intranet_id =" . $this->kernel->intranet->get('id')); |
|
920 | + $db->query("SELECT * FROM newsletter_subscriber WHERE optin = 1 AND active = 1 AND contact_id = ".$this->id." AND intranet_id =".$this->kernel->intranet->get('id')); |
|
921 | 921 | $lists = array(); |
922 | 922 | while ($db->nextRecord()) { |
923 | 923 | $lists[] = $db->f('list_id'); |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | function needNewsletterOptin() |
934 | 934 | { |
935 | 935 | $db = new DB_Sql; |
936 | - $db->query("SELECT list_id, code FROM newsletter_subscriber WHERE optin = 0 AND contact_id = " . $this->id . " AND intranet_id =" . $this->kernel->intranet->get('id')); |
|
936 | + $db->query("SELECT list_id, code FROM newsletter_subscriber WHERE optin = 0 AND contact_id = ".$this->id." AND intranet_id =".$this->kernel->intranet->get('id')); |
|
937 | 937 | $lists = array(); |
938 | 938 | $i = 0; |
939 | 939 | while ($db->nextRecord()) { |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | function canBeDeleted() |
955 | 955 | { |
956 | 956 | $db = new DB_Sql; |
957 | - $db->query("SELECT * FROM debtor WHERE contact_id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
957 | + $db->query("SELECT * FROM debtor WHERE contact_id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
958 | 958 | if (!$db->nextRecord()) { |
959 | 959 | return true; |
960 | 960 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function convertAmountToCurrency($amount) |
79 | 79 | { |
80 | - return new Ilib_Variable_Float($amount->getAsIso() / ($this->getRate()->getAsIso() / 100)); |
|
80 | + return new Ilib_Variable_Float($amount->getAsIso()/($this->getRate()->getAsIso()/100)); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function convertAmountFromCurrency($amount) |
91 | 91 | { |
92 | - return new Ilib_Variable_Float($amount->getAsIso() * ($this->getRate()->getAsIso() / 100)); |
|
92 | + return new Ilib_Variable_Float($amount->getAsIso()*($this->getRate()->getAsIso()/100)); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function getUsedForTypes() |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
76 | 76 | |
77 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
77 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
78 | 78 | $this->doc->nextPage(true); |
79 | 79 | } |
80 | 80 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | foreach ($text as $line) { |
84 | 84 | if ($line == "") { |
85 | 85 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
86 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
86 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
87 | 87 | $this->doc->nextPage(true); |
88 | 88 | } |
89 | 89 | } else { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $this->doc->setY('-'.($this->doc->get("font_padding_top") + $this->doc->get("font_size"))); |
92 | 92 | $line = $this->doc->addTextWrap($this->doc->get('margin_left'), $this->doc->get('y'), $this->doc->get('content_width'), $this->doc->get("font_size"), $line); |
93 | 93 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
94 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
94 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
95 | 95 | $this->doc->nextPage(true); |
96 | 96 | } |
97 | 97 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->doc->addText($apointX["tekst"], $this->doc->get('y'), $this->doc->get("font_size"), "Tekst"); |
117 | 117 | $this->doc->addText($apointX["antal"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Antal"), $this->doc->get('y'), $this->doc->get("font_size"), "Antal"); |
118 | 118 | $this->doc->addText($apointX["pris"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Pris"), $this->doc->get('y'), $this->doc->get("font_size"), "Pris"); |
119 | - $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") -3, $this->doc->get('y'), $this->doc->get("font_size"), "Beløb"); |
|
119 | + $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") - 3, $this->doc->get('y'), $this->doc->get("font_size"), "Beløb"); |
|
120 | 120 | |
121 | 121 | $this->doc->setY('-'.($this->doc->get("font_spacing") - $this->doc->get("font_size"))); |
122 | 122 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $bg_color = 0; |
140 | 140 | |
141 | - for ($i = 0, $max = count($items); $i < $max; $i++) { |
|
141 | + for ($i = 0, $max = count($items); $i < $max; $i++) { |
|
142 | 142 | $vat = $items[$i]["vat"]; |
143 | 143 | |
144 | 144 | if ($bg_color == 1) { |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | if ($debtor->getCurrency()) { |
164 | - $amount = $items[$i]["quantity"] * $items[$i]["price_currency"]->getAsIso(2); |
|
164 | + $amount = $items[$i]["quantity"]*$items[$i]["price_currency"]->getAsIso(2); |
|
165 | 165 | } else { |
166 | - $amount = $items[$i]["quantity"] * $items[$i]["price"]->getAsIso(2); |
|
166 | + $amount = $items[$i]["quantity"]*$items[$i]["price"]->getAsIso(2); |
|
167 | 167 | } |
168 | 168 | $total += $amount; |
169 | 169 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $tekst = $this->doc->addTextWrap($apointX["tekst"], $this->doc->get('y'), $apointX["tekst_width_small"], $this->doc->get("font_size"), $tekst); |
189 | 189 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
190 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
190 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
191 | 191 | $this->doc->nextPage(true); |
192 | 192 | } |
193 | 193 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $this->doc->setColor(0, 0, 0); |
211 | 211 | } |
212 | 212 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
213 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
213 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
214 | 214 | $this->doc->nextPage(true); |
215 | 215 | } |
216 | 216 | } else { |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $line = $this->doc->addTextWrap($apointX["tekst"], $this->doc->get('y') + 1, $apointX["tekst_width"], $this->doc->get("font_size"), $line); // Ups Ups, hvor kommer '+ 1' fra - jo ser du, ellers kappes det nederste af teksten! |
226 | 226 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
227 | 227 | |
228 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
228 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
229 | 229 | $this->doc->nextPage(true); |
230 | 230 | } |
231 | 231 | } |
@@ -233,12 +233,12 @@ discard block |
||
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
236 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
237 | 237 | $this->doc->nextPage(true); |
238 | 238 | } |
239 | 239 | |
240 | 240 | // If products with VAT and next post is without we add VAT. |
241 | - if (($vat == 1 && isset($items[$i+1]["vat"]) && $items[$i+1]["vat"] == 0) || ($vat == 1 && $i+1 >= $max)) { |
|
241 | + if (($vat == 1 && isset($items[$i + 1]["vat"]) && $items[$i + 1]["vat"] == 0) || ($vat == 1 && $i + 1 >= $max)) { |
|
242 | 242 | // If VAT on current product, but next has no VAT OR if VAT and last product |
243 | 243 | |
244 | 244 | ($bg_color == 1) ? $bg_color = 0 : $bg_color = 1; |
@@ -253,8 +253,8 @@ discard block |
||
253 | 253 | $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y'), $this->doc->get('right_margin_position'), $this->doc->get('y')); |
254 | 254 | $this->doc->setY('-'.($this->doc->get("font_size") + $this->doc->get("font_padding_top"))); |
255 | 255 | $this->doc->addText($apointX["tekst"], $this->doc->get('y'), $this->doc->get("font_size"), "<b>25% moms af ".number_format($total, 2, ",", ".")."</b>"); |
256 | - $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "<b>".number_format($total * 0.25, 2, ",", ".")."</b>"), $this->doc->get('y'), $this->doc->get("font_size"), "<b>".number_format($total * 0.25, 2, ",", ".")."</b>"); |
|
257 | - $total = $total * 1.25; |
|
256 | + $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "<b>".number_format($total*0.25, 2, ",", ".")."</b>"), $this->doc->get('y'), $this->doc->get("font_size"), "<b>".number_format($total*0.25, 2, ",", ".")."</b>"); |
|
257 | + $total = $total*1.25; |
|
258 | 258 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
259 | 259 | $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y'), $this->doc->get('right_margin_position'), $this->doc->get('y')); |
260 | 260 | $this->doc->setLineStyle(1); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | |
268 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
268 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
269 | 269 | $this->doc->nextPage(); |
270 | 270 | } |
271 | 271 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $total_text = "Total ".$currency_iso_code.":"; |
291 | 291 | } |
292 | 292 | |
293 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
293 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
294 | 294 | $this->doc->nextPage(true); |
295 | 295 | } |
296 | 296 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
328 | 328 | |
329 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
329 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
330 | 330 | $this->doc->nextPage(true); |
331 | 331 | } |
332 | 332 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | foreach ($text as $line) { |
335 | 335 | if ($line == "") { |
336 | 336 | $this->doc->setY('-'.$this->doc->get("font_spacing")); |
337 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
337 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
338 | 338 | $this->doc->nextPage(true); |
339 | 339 | } |
340 | 340 | } else { |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $line = $this->doc->addTextWrap($this->doc->get('margin_left'), $this->doc->get('y'), $this->doc->get('content_width'), $this->doc->get("font_size"), $line); |
344 | 344 | $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); |
345 | 345 | |
346 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { |
|
346 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) { |
|
347 | 347 | $this->doc->nextPage(true); |
348 | 348 | } |
349 | 349 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $box_padding_top = 8; // space from top box to first line |
88 | 88 | $box_padding_bottom = 9; |
89 | 89 | $box_width = 275; // ($page_width - $margin_left - 10)/2; |
90 | - $box_small_height = $this->doc->get("font_spacing") * 3 + $box_padding_top + $box_padding_bottom + 2; |
|
90 | + $box_small_height = $this->doc->get("font_spacing")*3 + $box_padding_top + $box_padding_bottom + 2; |
|
91 | 91 | |
92 | 92 | // Write the receiver |
93 | 93 | $this->doc->setY('-'.$this->doc->get("font_spacing")); // $pointY -= $box_padding_top; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | } |
157 | 157 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["postcode"]." ".$intranet["city"]); |
158 | - $this->doc->setY('-'.($this->doc->get("font_spacing") * 2)); // $pointY -= $this->doc->get("font_spacing") * 2; |
|
158 | + $this->doc->setY('-'.($this->doc->get("font_spacing")*2)); // $pointY -= $this->doc->get("font_spacing") * 2; |
|
159 | 159 | |
160 | 160 | $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), "CVR.:"); |
161 | 161 | $this->doc->addText($this->doc->get('x') + 10 + 60, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["cvr"]); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if (is_array($docinfo) && count($docinfo) > 0) { |
193 | 193 | $this->doc->setY('-10'); // $pointY -= 10; |
194 | 194 | $box_small_top = $this->doc->get('y'); |
195 | - $box_small_height = count($docinfo) * $this->doc->get("font_spacing") + $box_padding_top + $box_padding_bottom; |
|
195 | + $box_small_height = count($docinfo)*$this->doc->get("font_spacing") + $box_padding_top + $box_padding_bottom; |
|
196 | 196 | $this->doc->setY('-'.$box_padding_top); // $pointY -= $box_padding_top; |
197 | 197 | |
198 | 198 | for ($i = 0; $i < count($docinfo); $i++) { |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $payment_left = 230; |
284 | 284 | $payment_right = $this->doc->get("right_margin_position") - $this->doc->get("margin_left") - $payment_left; |
285 | 285 | |
286 | - if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") + 4 + $payment_line * 3) { |
|
286 | + if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") + 4 + $payment_line*3) { |
|
287 | 287 | $this->doc->nextPage(true); |
288 | 288 | } |
289 | 289 | |
@@ -300,10 +300,10 @@ discard block |
||
300 | 300 | $payment_start = $this->doc->get('y'); |
301 | 301 | |
302 | 302 | if ($payment_method == 1) { |
303 | - $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 2); |
|
304 | - $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left, $this->doc->get('y')); |
|
303 | + $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*2); |
|
304 | + $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left, $this->doc->get('y')); |
|
305 | 305 | $this->doc->line($this->doc->get('x'), $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line); |
306 | - $this->doc->line($this->doc->get('x') + $payment_left / 2, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left / 2, $this->doc->get('y') - $payment_line); |
|
306 | + $this->doc->line($this->doc->get('x') + $payment_left/2, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left/2, $this->doc->get('y') - $payment_line); |
|
307 | 307 | |
308 | 308 | $this->doc->setY('-7'); // $pointY -= 7; |
309 | 309 | $this->doc->addText($this->doc->get('x') + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Bank:"); |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position |
328 | 328 | $this->doc->setY('-7'); // $pointY -= 7; |
329 | 329 | |
330 | - $this->doc->addText($this->doc->get('x') + $payment_left / 2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:"); |
|
330 | + $this->doc->addText($this->doc->get('x') + $payment_left/2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:"); |
|
331 | 331 | $this->doc->setY('-'.($payment_line - 12)); |
332 | - $this->doc->addText($this->doc->get('x') + $payment_left / 2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]); |
|
332 | + $this->doc->addText($this->doc->get('x') + $payment_left/2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]); |
|
333 | 333 | |
334 | 334 | $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position |
335 | 335 | $this->doc->setY('-7'); |
@@ -339,11 +339,11 @@ discard block |
||
339 | 339 | $this->doc->setY('-'.($payment_line - 12)); |
340 | 340 | $this->doc->addText($this->doc->get('x') + $payment_left + 10, $this->doc->get('y'), $this->doc->get("font_size"), $payment_info["bank_reg_number"]." ".$payment_info["bank_account_number"]); |
341 | 341 | } elseif ($payment_method == 2) { |
342 | - $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 3, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 3); |
|
343 | - $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 3, $this->doc->get('x') + $payment_left, $this->doc->get('y')); |
|
342 | + $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*3, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*3); |
|
343 | + $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*3, $this->doc->get('x') + $payment_left, $this->doc->get('y')); |
|
344 | 344 | $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line); |
345 | - $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line * 2); |
|
346 | - $this->doc->line($this->doc->get('x') + $payment_left + $payment_right / 2, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left + $payment_right / 2, $this->doc->get('y') - $payment_line); |
|
345 | + $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line*2); |
|
346 | + $this->doc->line($this->doc->get('x') + $payment_left + $payment_right/2, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left + $payment_right/2, $this->doc->get('y') - $payment_line); |
|
347 | 347 | |
348 | 348 | $this->doc->setY('-7'); |
349 | 349 | $this->doc->addText($this->doc->get('x') + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Indbetaler:"); |
@@ -378,11 +378,11 @@ discard block |
||
378 | 378 | $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position |
379 | 379 | $this->doc->setY('-7'); |
380 | 380 | |
381 | - $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right / 2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:"); |
|
381 | + $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right/2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:"); |
|
382 | 382 | $this->doc->setY('-'.($payment_line - 12)); |
383 | - $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right / 2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]); |
|
383 | + $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right/2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]); |
|
384 | 384 | |
385 | - $this->doc->setValue('y', $payment_start - $payment_line * 2); // Sets exact position |
|
385 | + $this->doc->setValue('y', $payment_start - $payment_line*2); // Sets exact position |
|
386 | 386 | $this->doc->setY('-7'); |
387 | 387 | |
388 | 388 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $this_text = '+01-'.str_repeat(' ', 20).'+'.$payment_info['giro_account_number'].'-'; |
394 | 394 | $this->doc->addText($this->doc->get('x') + $payment_left + 10, $this->doc->get('y'), $this->doc->get('font_size'), $this_text); |
395 | 395 | } elseif ($payment_method == 3) { |
396 | - $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 2); |
|
396 | + $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*2); |
|
397 | 397 | $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line); |
398 | 398 | $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y'), $this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line); |
399 | 399 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | function renderHtml() |
17 | 17 | { |
18 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/payment'); |
|
18 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/payment'); |
|
19 | 19 | return $smarty->render($this); |
20 | 20 | } |
21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $payment = $this->getPayment(); |
26 | 26 | if ($id = $payment->update($_POST)) { |
27 | 27 | if ($this->getKernel()->user->hasModuleAccess('accounting')) { |
28 | - return new k_SeeOther($this->url($id . '/state')); |
|
28 | + return new k_SeeOther($this->url($id.'/state')); |
|
29 | 29 | } else { |
30 | 30 | return new k_SeeOther($this->url('../')); |
31 | 31 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | return new k_SeeOther($this->url('quotation/list', array('type' => 'quotation'))); |
29 | 29 | } |
30 | 30 | |
31 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
31 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
32 | 32 | return $smarty->render($this); |
33 | 33 | } |
34 | 34 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | 'email_shared' => $email_shared |
63 | 63 | ); |
64 | 64 | |
65 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
65 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
66 | 66 | return $tpl->render($this, $data); |
67 | 67 | } |
68 | 68 |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | |
156 | - $sql = 'name = '.$this->db->quote($input['name'], 'text').', ' . |
|
157 | - 'max_width = '.$this->db->quote($input['max_width'], 'integer').', ' . |
|
158 | - 'max_height = '.$this->db->quote($input['max_height'], 'integer').', ' . |
|
156 | + $sql = 'name = '.$this->db->quote($input['name'], 'text').', '. |
|
157 | + 'max_width = '.$this->db->quote($input['max_width'], 'integer').', '. |
|
158 | + 'max_height = '.$this->db->quote($input['max_height'], 'integer').', '. |
|
159 | 159 | 'resize_type_key = '.$this->db->quote($resize_type_key); |
160 | 160 | |
161 | 161 | if ($this->type_key == 0 || $this->get('origin') == 'standard') { |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | $type_key = $this->type_key; |
166 | 166 | } |
167 | 167 | |
168 | - $result = $this->db->exec('INSERT INTO file_handler_instance_type SET ' . |
|
169 | - 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').', ' . |
|
170 | - 'type_key = '.$this->db->quote($type_key, 'integer').', ' . |
|
168 | + $result = $this->db->exec('INSERT INTO file_handler_instance_type SET '. |
|
169 | + 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').', '. |
|
170 | + 'type_key = '.$this->db->quote($type_key, 'integer').', '. |
|
171 | 171 | 'active = 1, '.$sql); |
172 | 172 | if (PEAR::isError($result)) { |
173 | 173 | throw new Exception('Error in exec: '.$result->getUserInfo()); |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | $this->type_key = $type_key; |
181 | 181 | return $this->type_key; |
182 | 182 | } else { |
183 | - $result = $this->db->exec('UPDATE file_handler_instance_type SET '.$sql.' ' . |
|
184 | - 'WHERE intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' ' . |
|
183 | + $result = $this->db->exec('UPDATE file_handler_instance_type SET '.$sql.' '. |
|
184 | + 'WHERE intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' '. |
|
185 | 185 | 'AND type_key = '.$this->db->quote($this->type_key, 'integer')); |
186 | 186 | if (PEAR::isError($result)) { |
187 | 187 | throw new Exception('Error in exec: '.$result->getUserInfo()); |
@@ -231,10 +231,10 @@ discard block |
||
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
234 | - $result = $this->db->query('SELECT type_key FROM file_handler_instance_type WHERE ' . |
|
235 | - 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND ' . |
|
236 | - 'name = '.$this->db->quote($name, 'text').' AND ' . |
|
237 | - 'type_key != '.$this->db->quote((int)$type_key, 'integer').' AND ' . |
|
234 | + $result = $this->db->query('SELECT type_key FROM file_handler_instance_type WHERE '. |
|
235 | + 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer').' AND '. |
|
236 | + 'name = '.$this->db->quote($name, 'text').' AND '. |
|
237 | + 'type_key != '.$this->db->quote((int)$type_key, 'integer').' AND '. |
|
238 | 238 | 'active = 1'); |
239 | 239 | if (PEAR::isError($result)) { |
240 | 240 | throw new Exception('Error in query: '.$result->getUserInfo()); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | private function getNextFreeTypeKey() |
258 | 258 | { |
259 | 259 | // We do not active = 1, then it is possible to recreate deleted items without messing everything up. |
260 | - $result = $this->db->query('SELECT MAX(type_key) AS max_key FROM file_handler_instance_type WHERE ' . |
|
260 | + $result = $this->db->query('SELECT MAX(type_key) AS max_key FROM file_handler_instance_type WHERE '. |
|
261 | 261 | 'intranet_id = '.$this->db->quote($this->intranet_id, 'integer')); |
262 | 262 | if (PEAR::isError($result)) { |
263 | 263 | throw new Exception('Error in query: '.$result->getUserInfo()); |