@@ -62,11 +62,17 @@ |
||
62 | 62 | return new CMS_Parameter($this); |
63 | 63 | } |
64 | 64 | |
65 | + /** |
|
66 | + * @param string $key |
|
67 | + */ |
|
65 | 68 | function addParameter($key, $value) |
66 | 69 | { |
67 | 70 | return $this->parameter->save($key, $value); |
68 | 71 | } |
69 | 72 | |
73 | + /** |
|
74 | + * @param string $type |
|
75 | + */ |
|
70 | 76 | function factory($object, $type, $value) |
71 | 77 | { |
72 | 78 | $class_prefix = 'Intraface_modules_cms_templatesection_'; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->db = MDB2::singleton(DB_DSN); |
31 | 31 | $this->cmspage = $cmspage; |
32 | 32 | $this->kernel = $cmspage->kernel; |
33 | - $this->id = (int) $id; |
|
33 | + $this->id = (int)$id; |
|
34 | 34 | //$template_class = 'CMS_Template_' . $this->value['type']; |
35 | 35 | |
36 | 36 | $this->error = new Intraface_Error(); |
@@ -184,16 +184,16 @@ discard block |
||
184 | 184 | if ($this->id == 0) { |
185 | 185 | $sql_type = "INSERT INTO "; |
186 | 186 | $sql_end = ", date_created = NOW(), |
187 | - type_key = ".$var['type_key'] . ", |
|
187 | + type_key = ".$var['type_key'].", |
|
188 | 188 | template_section_id = ".$var['template_section_id']; |
189 | 189 | } else { |
190 | 190 | $sql_type = "UPDATE "; |
191 | - $sql_end = " WHERE id = " . $this->id; |
|
191 | + $sql_end = " WHERE id = ".$this->id; |
|
192 | 192 | } |
193 | - $sql = $sql_type . " cms_section SET |
|
193 | + $sql = $sql_type." cms_section SET |
|
194 | 194 | intranet_id = ".$this->cmspage->kernel->intranet->get('id').", |
195 | - page_id=". (int)$this->cmspage->get('id') . ", |
|
196 | - site_id=". (int)$this->cmspage->cmssite->get('id') . ", |
|
195 | + page_id=". (int)$this->cmspage->get('id').", |
|
196 | + site_id=". (int)$this->cmspage->cmssite->get('id').", |
|
197 | 197 | date_updated = NOW() |
198 | 198 | " . $sql_end; |
199 | 199 |
@@ -12,6 +12,9 @@ discard block |
||
12 | 12 | { |
13 | 13 | private $allowed_tags = ''; |
14 | 14 | |
15 | + /** |
|
16 | + * @param FakeCMSPage $cmspage |
|
17 | + */ |
|
15 | 18 | function __construct($cmspage, $id = 0) |
16 | 19 | { |
17 | 20 | $this->value['type'] = 'longtext'; |
@@ -52,6 +55,9 @@ discard block |
||
52 | 55 | return true; |
53 | 56 | } |
54 | 57 | |
58 | + /** |
|
59 | + * @param string[] $array |
|
60 | + */ |
|
55 | 61 | public static function convertArrayToTags($array) |
56 | 62 | { |
57 | 63 | $tags = ''; |
@@ -65,6 +65,9 @@ discard block |
||
65 | 65 | return 'cms_template'; |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param DB_Sql $db |
|
70 | + */ |
|
68 | 71 | function getPosition($db) |
69 | 72 | { |
70 | 73 | return new Ilib_Position($db, 'cms_template', $this->id, 'site_id = ' . $this->cmssite->get('id'), 'id', 'position'); |
@@ -131,6 +134,9 @@ discard block |
||
131 | 134 | } |
132 | 135 | |
133 | 136 | |
137 | + /** |
|
138 | + * @return string |
|
139 | + */ |
|
134 | 140 | function save($var) |
135 | 141 | { |
136 | 142 | if (!empty($var['for_page_type']) && is_array($var['for_page_type'])) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | function getPosition($db) |
69 | 69 | { |
70 | - return new Ilib_Position($db, 'cms_template', $this->id, 'site_id = ' . $this->cmssite->get('id'), 'id', 'position'); |
|
70 | + return new Ilib_Position($db, 'cms_template', $this->id, 'site_id = '.$this->cmssite->get('id'), 'id', 'position'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | switch ($type) { |
79 | 79 | case 'id': |
80 | 80 | $db = new DB_Sql; |
81 | - $db->query("SELECT site_id, id FROM cms_template WHERE id = " . $id . " AND intranet_id = " . $kernel->intranet->get('id')); |
|
81 | + $db->query("SELECT site_id, id FROM cms_template WHERE id = ".$id." AND intranet_id = ".$kernel->intranet->get('id')); |
|
82 | 82 | if (!$db->nextRecord()) { |
83 | 83 | return false; |
84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | function load() |
98 | 98 | { |
99 | 99 | $db = new DB_Sql; |
100 | - $db->query("SELECT id, name, site_id, identifier, for_page_type FROM cms_template WHERE intranet_id = " . $this->cmssite->kernel->intranet->get('id') . " AND id = " . $this->id); |
|
100 | + $db->query("SELECT id, name, site_id, identifier, for_page_type FROM cms_template WHERE intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND id = ".$this->id); |
|
101 | 101 | |
102 | 102 | if (!$db->nextRecord()) { |
103 | 103 | return 0; |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | $db = new DB_Sql; |
147 | 147 | if ($this->id > 0) { |
148 | 148 | $sql_type = "UPDATE "; |
149 | - $sql_end = " WHERE id = " . $this->id; |
|
149 | + $sql_end = " WHERE id = ".$this->id; |
|
150 | 150 | } else { |
151 | 151 | $sql_type = "INSERT INTO "; |
152 | 152 | $sql_end = ", date_created = NOW()"; |
153 | 153 | } |
154 | - $db->query($sql_type . " cms_template SET |
|
154 | + $db->query($sql_type." cms_template SET |
|
155 | 155 | name = '".safeToDb($var['name'])."', |
156 | 156 | date_updated = NOW(), |
157 | 157 | intranet_id = ".safeToDb($this->cmssite->kernel->intranet->get('id')).", |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $sql_extra = ''; |
180 | 180 | } |
181 | 181 | |
182 | - $db->query("SELECT id, name, identifier, for_page_type FROM cms_template WHERE ".$sql_extra." intranet_id = " . $this->cmssite->kernel->intranet->get('id') . " AND site_id = " . $this->cmssite->get('id') . " AND active = 1 ORDER BY name"); |
|
182 | + $db->query("SELECT id, name, identifier, for_page_type FROM cms_template WHERE ".$sql_extra." intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND site_id = ".$this->cmssite->get('id')." AND active = 1 ORDER BY name"); |
|
183 | 183 | $i = 0; |
184 | 184 | $templates = array(); |
185 | 185 | while ($db->nextRecord()) { |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | function delete() |
213 | 213 | { |
214 | 214 | $db = new DB_Sql; |
215 | - $db->query("UPDATE cms_template SET active = 0 WHERE id = " . $this->id); |
|
215 | + $db->query("UPDATE cms_template SET active = 0 WHERE id = ".$this->id); |
|
216 | 216 | return true; |
217 | 217 | } |
218 | 218 | |
219 | 219 | function isIdentifierUnique($identifier) |
220 | 220 | { |
221 | 221 | $db = new DB_Sql; |
222 | - $db->query("SELECT id FROM cms_template WHERE site_id = " . $this->cmssite->get('id') . " AND identifier = '".$identifier."' AND active = 1 AND id != " . $this->id); |
|
222 | + $db->query("SELECT id FROM cms_template WHERE site_id = ".$this->cmssite->get('id')." AND identifier = '".$identifier."' AND active = 1 AND id != ".$this->id); |
|
223 | 223 | if ($db->numRows() == 0) { |
224 | 224 | return true; |
225 | 225 | } else { |
@@ -257,7 +257,6 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @param object $kernel |
259 | 259 | * @param string $type What should the contact object be created from |
260 | - * @param string $id The value which corresponds to the type |
|
261 | 260 | * |
262 | 261 | * @return object |
263 | 262 | */ |
@@ -318,7 +317,7 @@ discard block |
||
318 | 317 | /** |
319 | 318 | * Loads values for the contact into an array |
320 | 319 | * |
321 | - * @return true on success |
|
320 | + * @return boolean on success |
|
322 | 321 | */ |
323 | 322 | private function load() |
324 | 323 | { |
@@ -394,7 +393,7 @@ discard block |
||
394 | 393 | * |
395 | 394 | * @param array $var Values to validate |
396 | 395 | * |
397 | - * @return true on success |
|
396 | + * @return boolean on success |
|
398 | 397 | */ |
399 | 398 | public function validate($var) |
400 | 399 | { |
@@ -502,20 +501,6 @@ discard block |
||
502 | 501 | /** |
503 | 502 | * Saves the contact |
504 | 503 | * |
505 | - * @param int $var['id'] Kundeid |
|
506 | - * @param string $var['company'] |
|
507 | - * @param string $var['address'] |
|
508 | - * @param string $var['postalcode'] |
|
509 | - * @param string $var['town'] |
|
510 | - * @param string $var['country'] |
|
511 | - * @param string $var['email'] |
|
512 | - * @param string $var['website'] |
|
513 | - * @param string $var['phone'] |
|
514 | - * @param string $var['deliveryaddress'] |
|
515 | - * @param string $var['deliverypostalcode'] |
|
516 | - * @param string $var['deliverytown'] |
|
517 | - * @param string $var['deliverycountry'] |
|
518 | - * @param string $var['paymentcondition'] |
|
519 | 504 | * |
520 | 505 | * @return void |
521 | 506 | */ |
@@ -616,7 +601,7 @@ discard block |
||
616 | 601 | * |
617 | 602 | * Never delete a contact entirely. Should only be deactivated. |
618 | 603 | * |
619 | - * @return integer 0 = false eller 1 = true |
|
604 | + * @return boolean 0 = false eller 1 = true |
|
620 | 605 | */ |
621 | 606 | public function delete() |
622 | 607 | { |
@@ -659,7 +644,7 @@ discard block |
||
659 | 644 | * |
660 | 645 | * @param string $number |
661 | 646 | * |
662 | - * @return true hvis det er frit |
|
647 | + * @return boolean hvis det er frit |
|
663 | 648 | */ |
664 | 649 | public function isNumberFree($number) |
665 | 650 | { |
@@ -822,7 +807,7 @@ discard block |
||
822 | 807 | * |
823 | 808 | * TODO M�ske burde denne metode hedde loadKeywords()? |
824 | 809 | * |
825 | - * @return object |
|
810 | + * @return Keyword |
|
826 | 811 | */ |
827 | 812 | function getKeywords() |
828 | 813 | { |
@@ -858,7 +843,7 @@ discard block |
||
858 | 843 | * |
859 | 844 | * @param integer $id Optional id of the contact person |
860 | 845 | * |
861 | - * @return object |
|
846 | + * @return ContactPerson |
|
862 | 847 | */ |
863 | 848 | function loadContactPerson($id = 0) |
864 | 849 | { |
@@ -105,9 +105,6 @@ |
||
105 | 105 | |
106 | 106 | function getContacts() |
107 | 107 | } |
108 | - |
|
109 | - |
|
110 | - |
|
111 | 108 | * |
112 | 109 | * @package Intraface_Contact |
113 | 110 | * @author Lars Olesen <[email protected]> |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @license |
120 | 120 | * |
121 | 121 | */ |
122 | -require_once dirname(__FILE__) . '/ContactPerson.php'; |
|
122 | +require_once dirname(__FILE__).'/ContactPerson.php'; |
|
123 | 123 | require_once 'Intraface/functions.php'; |
124 | 124 | |
125 | 125 | class Contact extends Intraface_Standard |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | { |
387 | 387 | // HACK NECCESSARY FOR THE NEWSLETTERSUBSCRIBER |
388 | 388 | $this->kernel->useModule('contact'); |
389 | - return ($this->value['login_url'] = 'http://' . $this->kernel->getSetting()->get('intranet', 'contact.login_url') . '/' .$this->kernel->intranet->get('identifier') . '/login?code='. $this->get('code')); |
|
389 | + return ($this->value['login_url'] = 'http://'.$this->kernel->getSetting()->get('intranet', 'contact.login_url').'/'.$this->kernel->intranet->get('identifier').'/login?code='.$this->get('code')); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | /** |
@@ -556,16 +556,16 @@ discard block |
||
556 | 556 | |
557 | 557 | // prepare sql to update or insert |
558 | 558 | if ($this->id > 0) { |
559 | - $sql="UPDATE contact "; |
|
560 | - $sql_after=" WHERE id='".$this->id."'"; |
|
559 | + $sql = "UPDATE contact "; |
|
560 | + $sql_after = " WHERE id='".$this->id."'"; |
|
561 | 561 | $sql_create = ""; |
562 | 562 | } else { |
563 | - $sql="INSERT INTO contact "; |
|
564 | - $sql_after = ", code='".safeToDb(md5(date('Y-m-d H:i:s') . $sql_items))."'"; |
|
563 | + $sql = "INSERT INTO contact "; |
|
564 | + $sql_after = ", code='".safeToDb(md5(date('Y-m-d H:i:s').$sql_items))."'"; |
|
565 | 565 | $sql_create = "date_created = NOW(),"; |
566 | 566 | } |
567 | 567 | |
568 | - $sql .= " SET ".$sql_create. " |
|
568 | + $sql .= " SET ".$sql_create." |
|
569 | 569 | intranet_id = '". $this->kernel->intranet->get('id')."'," |
570 | 570 | .$sql_items. |
571 | 571 | "date_changed = NOW() |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | // Delivery Address |
596 | 596 | foreach ($address_fields as $key => $value) { |
597 | 597 | if (array_key_exists('delivery_'.$value, $var)) { |
598 | - $delivery_address_to_save[$value] = $var['delivery_' . $value]; |
|
598 | + $delivery_address_to_save[$value] = $var['delivery_'.$value]; |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | return false; |
630 | 630 | } |
631 | 631 | $db = new DB_Sql; |
632 | - $db->query("UPDATE contact SET active = 0, date_changed = NOW() WHERE intranet_id = " . $this->kernel->intranet->get("id") . " AND id = " . $this->id); |
|
632 | + $db->query("UPDATE contact SET active = 0, date_changed = NOW() WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND id = ".$this->id); |
|
633 | 633 | return true; |
634 | 634 | } |
635 | 635 | |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | return false; |
650 | 650 | } |
651 | 651 | $db = new DB_Sql; |
652 | - $db->query("UPDATE contact SET active = 1, date_changed = NOW() WHERE intranet_id = " . $this->kernel->intranet->get("id") . " AND id = " . $this->id); |
|
652 | + $db->query("UPDATE contact SET active = 1, date_changed = NOW() WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND id = ".$this->id); |
|
653 | 653 | |
654 | 654 | return true; |
655 | 655 | } |
@@ -667,9 +667,9 @@ discard block |
||
667 | 667 | $db = new DB_Sql(); |
668 | 668 | $sql = "SELECT id |
669 | 669 | FROM contact |
670 | - WHERE intranet_id = " . $this->kernel->intranet->get("id") . " |
|
671 | - AND number = " . (int)$number . " |
|
672 | - AND id <> " . $this->id . " |
|
670 | + WHERE intranet_id = " . $this->kernel->intranet->get("id")." |
|
671 | + AND number = " . (int)$number." |
|
672 | + AND id <> " . $this->id." |
|
673 | 673 | AND active = 1 |
674 | 674 | LIMIT 1"; |
675 | 675 | $db->query($sql); |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | public function getMaxNumber() |
690 | 690 | { |
691 | 691 | $db = new DB_Sql(); |
692 | - $db->query("SELECT number FROM contact WHERE intranet_id = " . $this->kernel->intranet->get("id") . " ORDER BY number DESC"); |
|
692 | + $db->query("SELECT number FROM contact WHERE intranet_id = ".$this->kernel->intranet->get("id")." ORDER BY number DESC"); |
|
693 | 693 | if (!$db->nextRecord()) { |
694 | 694 | return 0; |
695 | 695 | } |
@@ -781,11 +781,11 @@ discard block |
||
781 | 781 | WHERE address.type=3 |
782 | 782 | AND contact.active = 1 |
783 | 783 | AND address.active = 1 |
784 | - AND contact.intranet_id = " . $db->quote($this->kernel->intranet->get('id'), 'integer') . " |
|
785 | - AND contact.id != " . $db->quote($this->id, 'integer') . " |
|
784 | + AND contact.intranet_id = " . $db->quote($this->kernel->intranet->get('id'), 'integer')." |
|
785 | + AND contact.id != " . $db->quote($this->id, 'integer')." |
|
786 | 786 | AND ( |
787 | - (address.email = " . $db->quote($this->address->get('email'), 'text') . " AND address.email != '') |
|
788 | - OR (address.phone = " . $db->quote($this->address->get('phone'), 'text') . " AND address.phone != '')) |
|
787 | + (address.email = " . $db->quote($this->address->get('email'), 'text')." AND address.email != '') |
|
788 | + OR (address.phone = " . $db->quote($this->address->get('phone'), 'text')." AND address.phone != '')) |
|
789 | 789 | |
790 | 790 | "; |
791 | 791 | |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | function isFilledIn() |
875 | 875 | { |
876 | 876 | $db = new DB_Sql; |
877 | - $db->query("SELECT count(*) AS antal FROM contact WHERE intranet_id = " . $this->kernel->intranet->get('id')); |
|
877 | + $db->query("SELECT count(*) AS antal FROM contact WHERE intranet_id = ".$this->kernel->intranet->get('id')); |
|
878 | 878 | if ($db->nextRecord()) { |
879 | 879 | return $db->f('antal'); |
880 | 880 | } |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | return false; |
893 | 893 | } |
894 | 894 | $db = new DB_Sql; |
895 | - $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); |
|
895 | + $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); |
|
896 | 896 | $this->load(); |
897 | 897 | return true; |
898 | 898 | } |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | return false; |
910 | 910 | } |
911 | 911 | $db = new DB_Sql; |
912 | - $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); |
|
912 | + $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); |
|
913 | 913 | $this->load(); |
914 | 914 | return true; |
915 | 915 | } |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | function getNewsletterSubscriptions() |
923 | 923 | { |
924 | 924 | $db = new DB_Sql; |
925 | - $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')); |
|
925 | + $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')); |
|
926 | 926 | $lists = array(); |
927 | 927 | while ($db->nextRecord()) { |
928 | 928 | $lists[] = $db->f('list_id'); |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | function needNewsletterOptin() |
939 | 939 | { |
940 | 940 | $db = new DB_Sql; |
941 | - $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')); |
|
941 | + $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')); |
|
942 | 942 | $lists = array(); |
943 | 943 | $i = 0; |
944 | 944 | while ($db->nextRecord()) { |
@@ -959,7 +959,7 @@ discard block |
||
959 | 959 | function canBeDeleted() |
960 | 960 | { |
961 | 961 | $db = new DB_Sql; |
962 | - $db->query("SELECT * FROM debtor WHERE contact_id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
962 | + $db->query("SELECT * FROM debtor WHERE contact_id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
963 | 963 | if (!$db->nextRecord()) { |
964 | 964 | return true; |
965 | 965 | } |
@@ -8,6 +8,9 @@ |
||
8 | 8 | |
9 | 9 | class OnlinePaymentDefault extends OnlinePayment |
10 | 10 | { |
11 | + /** |
|
12 | + * @param integer $id |
|
13 | + */ |
|
11 | 14 | function __construct($kernel, $id) { |
12 | 15 | |
13 | 16 | parent::__construct($kernel, $id); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | throw new Exception('Could not save information in ContactReminder->update' . $result->getUserInfo()); |
226 | 226 | return false; |
227 | 227 | } |
228 | - return $this->id; |
|
228 | + return $this->id; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | throw new Exception('Could not postphone reminder' . $result->getUserInfo()); |
246 | 246 | return false; |
247 | 247 | } |
248 | - $this->load(); |
|
249 | - return true; |
|
248 | + $this->load(); |
|
249 | + return true; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | if ($result->numRows() == 0) { |
279 | 279 | return array(); |
280 | 280 | } |
281 | - return $result->fetchAll(MDB2_FETCHMODE_ASSOC); |
|
281 | + return $result->fetchAll(MDB2_FETCHMODE_ASSOC); |
|
282 | 282 | |
283 | 283 | } |
284 | 284 | |
@@ -297,8 +297,8 @@ discard block |
||
297 | 297 | throw new Exception('Could not postphone reminder' . $result->getUserInfo()); |
298 | 298 | return false; |
299 | 299 | } |
300 | - $this->load(); |
|
301 | - return true; |
|
300 | + $this->load(); |
|
301 | + return true; |
|
302 | 302 | |
303 | 303 | } |
304 | 304 |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | throw new Exception("Was not able to convert date in ContactReminder->update"); |
200 | 200 | } |
201 | 201 | |
202 | - $sql = "reminder_date = ".$this->db->quote($date->get(), 'date')."," . |
|
203 | - "date_changed = NOW()," . |
|
204 | - "subject = ".$this->db->quote($input['subject'], 'text')."," . |
|
202 | + $sql = "reminder_date = ".$this->db->quote($date->get(), 'date').",". |
|
203 | + "date_changed = NOW(),". |
|
204 | + "subject = ".$this->db->quote($input['subject'], 'text').",". |
|
205 | 205 | "description = ".$this->db->quote($input['description'], 'text').""; |
206 | 206 | |
207 | 207 | if ($this->error->isError()) { |
@@ -212,17 +212,17 @@ discard block |
||
212 | 212 | $result = $this->db->exec("UPDATE contact_reminder_single SET ".$sql." WHERE intranet_id = ".$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer')." AND id = ".$this->db->quote($this->id, 'integer')); |
213 | 213 | } else { |
214 | 214 | $result = $this->db->exec("INSERT INTO contact_reminder_single SET ".$sql.", ". |
215 | - "intranet_id = ".$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer')."," . |
|
216 | - "contact_id = ".$this->db->quote($this->contact->get('id'), 'integer')."," . |
|
217 | - "created_by_user_id = ".$this->db->quote($this->contact->kernel->user->get('id'), 'integer')."," . |
|
218 | - "status_key = 1," . |
|
219 | - "date_created = NOW()," . |
|
215 | + "intranet_id = ".$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer').",". |
|
216 | + "contact_id = ".$this->db->quote($this->contact->get('id'), 'integer').",". |
|
217 | + "created_by_user_id = ".$this->db->quote($this->contact->kernel->user->get('id'), 'integer').",". |
|
218 | + "status_key = 1,". |
|
219 | + "date_created = NOW(),". |
|
220 | 220 | "active = 1"); |
221 | 221 | $this->id = $this->db->lastInsertID(); |
222 | 222 | } |
223 | 223 | |
224 | 224 | if (PEAR::isError($result)) { |
225 | - throw new Exception('Could not save information in ContactReminder->update' . $result->getUserInfo()); |
|
225 | + throw new Exception('Could not save information in ContactReminder->update'.$result->getUserInfo()); |
|
226 | 226 | return false; |
227 | 227 | } |
228 | 228 | return $this->id; |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * @todo: validation needed - not crucial as we are setting the postpone date |
242 | 242 | */ |
243 | - $result = $this->db->exec('UPDATE contact_reminder_single SET date_changed = NOW(), reminder_date = ' .$this->db->quote($date, 'date').' WHERE intranet_id = '.$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer').' AND id = '.$this->db->quote($this->id, 'integer')); |
|
243 | + $result = $this->db->exec('UPDATE contact_reminder_single SET date_changed = NOW(), reminder_date = '.$this->db->quote($date, 'date').' WHERE intranet_id = '.$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer').' AND id = '.$this->db->quote($this->id, 'integer')); |
|
244 | 244 | if (PEAR::isError($result)) { |
245 | - throw new Exception('Could not postphone reminder' . $result->getUserInfo()); |
|
245 | + throw new Exception('Could not postphone reminder'.$result->getUserInfo()); |
|
246 | 246 | return false; |
247 | 247 | } |
248 | 248 | $this->load(); |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | |
266 | 266 | $db = MDB2::singleton(DB_DSN); |
267 | 267 | // |
268 | - $result = $db->query('SELECT contact_reminder_single.*, DATE_FORMAT(contact_reminder_single.reminder_date, "%d-%m-%Y") AS dk_reminder_date, address.name AS contact_name ' . |
|
269 | - 'FROM contact_reminder_single ' . |
|
270 | - 'INNER JOIN contact ON (contact_reminder_single.contact_id = contact.id AND contact.intranet_id = '.$db->quote($kernel->intranet->get('id'), 'integer') . ' AND contact.active = 1) '. |
|
271 | - 'LEFT JOIN address ON (address.belong_to_id = contact.id AND address.type = 3 AND address.active = 1) ' . |
|
272 | - 'WHERE contact_reminder_single.reminder_date < DATE_ADD(NOW(), INTERVAL 30 DAY) AND contact_reminder_single.intranet_id = ' .$db->quote($kernel->intranet->get('id'), 'integer').' AND contact_reminder_single.active = 1 AND contact_reminder_single.status_key = 1 ' . |
|
268 | + $result = $db->query('SELECT contact_reminder_single.*, DATE_FORMAT(contact_reminder_single.reminder_date, "%d-%m-%Y") AS dk_reminder_date, address.name AS contact_name '. |
|
269 | + 'FROM contact_reminder_single '. |
|
270 | + 'INNER JOIN contact ON (contact_reminder_single.contact_id = contact.id AND contact.intranet_id = '.$db->quote($kernel->intranet->get('id'), 'integer').' AND contact.active = 1) '. |
|
271 | + 'LEFT JOIN address ON (address.belong_to_id = contact.id AND address.type = 3 AND address.active = 1) '. |
|
272 | + 'WHERE contact_reminder_single.reminder_date < DATE_ADD(NOW(), INTERVAL 30 DAY) AND contact_reminder_single.intranet_id = '.$db->quote($kernel->intranet->get('id'), 'integer').' AND contact_reminder_single.active = 1 AND contact_reminder_single.status_key = 1 '. |
|
273 | 273 | 'ORDER BY contact_reminder_single.reminder_date ASC'); |
274 | 274 | if (PEAR::isError($result)) { |
275 | 275 | die($result->getUserInfo()); |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | { |
293 | 293 | $status_key = array_search($status, $this->status_types); |
294 | 294 | |
295 | - $result = $this->db->exec('UPDATE contact_reminder_single SET date_changed = NOW(), status_key = ' .$this->db->quote($status_key, 'integer').' WHERE intranet_id = '.$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer').' AND id = '.$this->db->quote($this->id, 'integer')); |
|
295 | + $result = $this->db->exec('UPDATE contact_reminder_single SET date_changed = NOW(), status_key = '.$this->db->quote($status_key, 'integer').' WHERE intranet_id = '.$this->db->quote($this->contact->kernel->intranet->get('id'), 'integer').' AND id = '.$this->db->quote($this->id, 'integer')); |
|
296 | 296 | if (PEAR::isError($result)) { |
297 | - throw new Exception('Could not postphone reminder' . $result->getUserInfo()); |
|
297 | + throw new Exception('Could not postphone reminder'.$result->getUserInfo()); |
|
298 | 298 | return false; |
299 | 299 | } |
300 | 300 | $this->load(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @param object $kernel Kernel |
145 | 145 | * @param integer $id Debtor id or debtor identifier_key |
146 | - * @param type $tpye String TODO What is this used for as a last parameter? |
|
146 | + * @param type $type String TODO What is this used for as a last parameter? |
|
147 | 147 | */ |
148 | 148 | public static function factory($kernel, $id = 0, $type = "") |
149 | 149 | { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | /** |
619 | 619 | * S�tter status for debtoren |
620 | 620 | * |
621 | - * @return true / false |
|
621 | + * @return boolean / false |
|
622 | 622 | */ |
623 | 623 | public function setStatus($status) |
624 | 624 | { |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | * @param string $from Where from |
677 | 677 | * @param integer $from_id From id |
678 | 678 | * |
679 | - * @return true / false |
|
679 | + * @return boolean / false |
|
680 | 680 | */ |
681 | 681 | private function setFrom($from = 'manuel', $from_id = 0) |
682 | 682 | { |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | /** |
1136 | 1136 | * Gets the intranet address |
1137 | 1137 | * |
1138 | - * @return object |
|
1138 | + * @return Intraface_Address |
|
1139 | 1139 | */ |
1140 | 1140 | public function getIntranetAddress() |
1141 | 1141 | { |
@@ -1173,7 +1173,7 @@ discard block |
||
1173 | 1173 | /** |
1174 | 1174 | * Returns the total amount on Debtor |
1175 | 1175 | * |
1176 | - * @return object Ilib_Variable_Float with total |
|
1176 | + * @return Ilib_Variable_Float Ilib_Variable_Float with total |
|
1177 | 1177 | */ |
1178 | 1178 | public function getTotal() |
1179 | 1179 | { |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | /** |
1199 | 1199 | * Returns arrears on a debtor |
1200 | 1200 | * |
1201 | - * @return object Ilib_Variable_Float with arrears |
|
1201 | + * @return Ilib_Variable_Float Ilib_Variable_Float with arrears |
|
1202 | 1202 | */ |
1203 | 1203 | public function getArrears() |
1204 | 1204 | { |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | /** |
1222 | 1222 | * returns the possible debtor types! |
1223 | 1223 | * |
1224 | - * @return array types |
|
1224 | + * @return string[] types |
|
1225 | 1225 | */ |
1226 | 1226 | static function getDebtorTypes() |
1227 | 1227 | { |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | /** |
1236 | 1236 | * returns the possible places where the debtor comes from |
1237 | 1237 | * |
1238 | - * @return array with the allowed froms |
|
1238 | + * @return string[] with the allowed froms |
|
1239 | 1239 | */ |
1240 | 1240 | private function getFromTypes() |
1241 | 1241 | { |
@@ -1251,7 +1251,7 @@ discard block |
||
1251 | 1251 | /** |
1252 | 1252 | * returns possible status types |
1253 | 1253 | * |
1254 | - * @return array possible status types |
|
1254 | + * @return string[] possible status types |
|
1255 | 1255 | */ |
1256 | 1256 | private function getStatusTypes() |
1257 | 1257 | { |
@@ -1266,7 +1266,7 @@ discard block |
||
1266 | 1266 | /** |
1267 | 1267 | * returns possible payment methods |
1268 | 1268 | * |
1269 | - * @return array possible payment methods |
|
1269 | + * @return string[] possible payment methods |
|
1270 | 1270 | */ |
1271 | 1271 | private function getPaymentMethods() |
1272 | 1272 | { |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | } |
392 | 392 | |
393 | 393 | if ($this->type == "invoice") { |
394 | - // Hvis det er en faktura skal der indtastes en due_date, ellers er det ligegyldigt! |
|
394 | + // Hvis det er en faktura skal der indtastes en due_date, ellers er det ligegyldigt! |
|
395 | 395 | if ($validator->isDate($input["due_date"], "Ugyldig leveringsdato", "allow_no_year")) { |
396 | 396 | $due_date = new Intraface_Date($input["due_date"]); |
397 | 397 | $due_date->convert2db(); |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | $input["round_off"] = 0; |
448 | 448 | } |
449 | 449 | |
450 | - // user_id = ".$this->kernel->user->get('id').", // skal puttes p�, men kun hvis det ikke er fra webshop. |
|
450 | + // user_id = ".$this->kernel->user->get('id').", // skal puttes p�, men kun hvis det ikke er fra webshop. |
|
451 | 451 | $db = new DB_Sql; |
452 | 452 | if ($this->id == 0) { |
453 | 453 | $infinite_check = 0; |
@@ -1124,9 +1124,9 @@ discard block |
||
1124 | 1124 | function getPaymentInformation() |
1125 | 1125 | { |
1126 | 1126 | $info = array('bank_name' => $this->kernel->setting->get("intranet", "bank_name"), |
1127 | - 'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"), |
|
1128 | - 'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"), |
|
1129 | - 'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number") |
|
1127 | + 'bank_reg_number' => $this->kernel->setting->get("intranet", "bank_reg_number"), |
|
1128 | + 'bank_account_number' => $this->kernel->setting->get("intranet", "bank_account_number"), |
|
1129 | + 'giro_account_number' => $this->kernel->setting->get("intranet", "giro_account_number") |
|
1130 | 1130 | ); |
1131 | 1131 | |
1132 | 1132 | return $info; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | // Bruges til at afg�re, hvor debtor er sendt hent til |
273 | 273 | $db = new DB_Sql; |
274 | - $db->query("SELECT id, type FROM debtor WHERE where_from > 2 AND where_from_id = " . $this->id . " AND active = 1"); |
|
274 | + $db->query("SELECT id, type FROM debtor WHERE where_from > 2 AND where_from_id = ".$this->id." AND active = 1"); |
|
275 | 275 | if ($db->nextRecord()) { |
276 | 276 | if ($db->f('type') > 0) { |
277 | 277 | $types = self::getDebtorTypes(); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | // @todo Currency is always loaded, should be done with left join. Oh give me more doctrine! |
306 | 306 | $currency = $this->getCurrency(); |
307 | 307 | |
308 | - for ($i = 0, $max = count($item), $total = 0, $total_currency = 0; $i<$max; $i++) { |
|
308 | + for ($i = 0, $max = count($item), $total = 0, $total_currency = 0; $i < $max; $i++) { |
|
309 | 309 | $total += $item[$i]["amount"]->getAsIso(); |
310 | 310 | if ($currency) { |
311 | 311 | $total_currency += $item[$i]['amount_currency']->getAsIso(); |
@@ -462,12 +462,12 @@ discard block |
||
462 | 462 | } while ($db->nextRecord()); |
463 | 463 | |
464 | 464 | $sql_type = "INSERT INTO "; |
465 | - $sql_after = ", date_created = NOW(), identifier_key = \"".$identifier."\", intranet_id = " . $this->kernel->intranet->get('id'); |
|
465 | + $sql_after = ", date_created = NOW(), identifier_key = \"".$identifier."\", intranet_id = ".$this->kernel->intranet->get('id'); |
|
466 | 466 | } else { |
467 | 467 | $sql_type = "UPDATE "; |
468 | - $sql_after = " WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'); |
|
468 | + $sql_after = " WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'); |
|
469 | 469 | } |
470 | - $sql = $sql_type . "debtor SET contact_id = " . $contact->get('id') . ", |
|
470 | + $sql = $sql_type."debtor SET contact_id = ".$contact->get('id').", |
|
471 | 471 | contact_address_id = ".$contact_address_id.", |
472 | 472 | contact_person_id = ".$input['contact_person_id'].", |
473 | 473 | intranet_address_id = ".$this->kernel->intranet->address->get("address_id").", |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | currency_id = ".$currency_id.", |
483 | 483 | currency_product_price_exchange_rate_id = ".$currency_exchange_rate_id.", |
484 | 484 | payment_method=".$input['payment_method'].", |
485 | - girocode='".$input['girocode']."' " . $internal_note_sql . $sql_after; |
|
485 | + girocode='".$input['girocode']."' ".$internal_note_sql.$sql_after; |
|
486 | 486 | |
487 | 487 | // attention_to = '". $input['attention_to'] ."', |
488 | 488 | |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | } |
495 | 495 | |
496 | 496 | if (is_object($this->kernel->user) and strtolower(get_class($this->kernel->user)) == 'user') { |
497 | - $db->query("UPDATE debtor SET user_id = ".$this->kernel->user->get('id')." WHERE id = " . $this->id); |
|
497 | + $db->query("UPDATE debtor SET user_id = ".$this->kernel->user->get('id')." WHERE id = ".$this->id); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | $this->load(); |
@@ -514,9 +514,9 @@ discard block |
||
514 | 514 | return false; |
515 | 515 | } |
516 | 516 | $db = new DB_Sql; |
517 | - $db->query("SELECT id FROM debtor WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'). " AND type = '".$this->type_key."' LIMIT 1"); |
|
517 | + $db->query("SELECT id FROM debtor WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')." AND type = '".$this->type_key."' LIMIT 1"); |
|
518 | 518 | if ($db->nextRecord()) { |
519 | - $db->query("UPDATE debtor SET active = 0 WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id') . " AND type = '".$this->type_key."'"); |
|
519 | + $db->query("UPDATE debtor SET active = 0 WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')." AND type = '".$this->type_key."'"); |
|
520 | 520 | return true; |
521 | 521 | } |
522 | 522 | return false; |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | |
567 | 567 | switch ($this->type) { |
568 | 568 | case "invoice": |
569 | - $values['due_date'] = date("d-m-Y", time() + 24 * 60 * 60 * $debtor_object->contact->get("paymentcondition")); |
|
569 | + $values['due_date'] = date("d-m-Y", time() + 24*60*60*$debtor_object->contact->get("paymentcondition")); |
|
570 | 570 | if (empty($values['payment_method']) and $this->kernel->setting->get('intranet', 'bank_account_number')) { |
571 | 571 | $values['payment_method'] = 1; |
572 | 572 | } |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | } |
664 | 664 | |
665 | 665 | $db = new Db_Sql; |
666 | - $db->query("UPDATE debtor SET status = ".$status_id.", ".$sql." WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
666 | + $db->query("UPDATE debtor SET status = ".$status_id.", ".$sql." WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
667 | 667 | $this->load(); |
668 | 668 | |
669 | 669 | return true; |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | return false; |
691 | 691 | } |
692 | 692 | $db = new Db_Sql; |
693 | - $db->query("UPDATE debtor SET where_from = ".(int)$from.", where_from_id = " . $from_id . " WHERE id = " . $this->id); |
|
693 | + $db->query("UPDATE debtor SET where_from = ".(int)$from.", where_from_id = ".$from_id." WHERE id = ".$this->id); |
|
694 | 694 | return true; |
695 | 695 | } |
696 | 696 | |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | } |
712 | 712 | $contact_id = (int)$contact_id; |
713 | 713 | $db = new DB_Sql; |
714 | - $db->query("UPDATE debtor SET contact_id = " . $contact_id . " WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get("id") . " AND type='".$this->type_key."'"); |
|
714 | + $db->query("UPDATE debtor SET contact_id = ".$contact_id." WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get("id")." AND type='".$this->type_key."'"); |
|
715 | 715 | |
716 | 716 | return true; |
717 | 717 | } |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | case 'contact': |
741 | 741 | $sql = "SELECT id |
742 | 742 | FROM debtor |
743 | - WHERE intranet_id = " . $this->kernel->intranet->get("id") . " |
|
743 | + WHERE intranet_id = " . $this->kernel->intranet->get("id")." |
|
744 | 744 | AND contact_id = ".(int)$type_id." |
745 | 745 | AND type='".$this->type_key."' |
746 | 746 | AND active = 1"; |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | public function isFilledIn() |
775 | 775 | { |
776 | 776 | $db = new DB_Sql; |
777 | - $db->query("SELECT id FROM debtor WHERE type = " . $this->type_key . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
777 | + $db->query("SELECT id FROM debtor WHERE type = ".$this->type_key." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
778 | 778 | return $db->numRows(); |
779 | 779 | } |
780 | 780 | |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | { |
973 | 973 | $number = safeToDb($number); |
974 | 974 | $db = new DB_Sql; |
975 | - $sql = "SELECT id FROM debtor WHERE intranet_id = " . $this->kernel->intranet->get('id') . " AND number = '".$number."' AND type = '".$this->type_key."' AND id != " . $this->id." AND active = 1"; |
|
975 | + $sql = "SELECT id FROM debtor WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND number = '".$number."' AND type = '".$this->type_key."' AND id != ".$this->id." AND active = 1"; |
|
976 | 976 | $db->query($sql); |
977 | 977 | if ($db->numRows() == 0) { |
978 | 978 | return true; |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | { |
1058 | 1058 | // FIXME - check on date |
1059 | 1059 | $db = new DB_Sql; |
1060 | - $db->query("UPDATE debtor SET date_stated = '" . $voucher_date . "', voucher_id = '".$voucher_id."' WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
1060 | + $db->query("UPDATE debtor SET date_stated = '".$voucher_date."', voucher_id = '".$voucher_id."' WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
1061 | 1061 | return true; |
1062 | 1062 | } |
1063 | 1063 | |
@@ -1301,6 +1301,6 @@ discard block |
||
1301 | 1301 | |
1302 | 1302 | function getPaymentLink($url) |
1303 | 1303 | { |
1304 | - return $url . $this->getIdentifier(); |
|
1304 | + return $url.$this->getIdentifier(); |
|
1305 | 1305 | } |
1306 | 1306 | } |
@@ -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 | { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $this->id = (int)$file_id; |
115 | 115 | $this->error = new Ilib_Error; |
116 | 116 | |
117 | - $this->upload_path = PATH_UPLOAD . $this->kernel->intranet->get('id') . '/'; |
|
117 | + $this->upload_path = PATH_UPLOAD.$this->kernel->intranet->get('id').'/'; |
|
118 | 118 | $this->tempdir_path = $this->upload_path.PATH_UPLOAD_TEMPORARY; |
119 | 119 | $this->file_viewer = FILE_VIEWER; |
120 | 120 | $this->www_path = PATH_WWW; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $this->loadMimeTypes(); |
261 | 261 | $this->value['file_type'] = $this->_getMimeType((int)$db->f('file_type_key')); |
262 | 262 | $this->value['is_image'] = $this->file_types[$this->get('file_type_key')]['image']; |
263 | - $this->value['file_path'] = $this->upload_path . $db->f('server_file_name'); |
|
263 | + $this->value['file_path'] = $this->upload_path.$db->f('server_file_name'); |
|
264 | 264 | |
265 | 265 | if (file_exists($this->get('file_path'))) { |
266 | 266 | $this->value['last_modified'] = filemtime($this->get('file_path')); |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | $db = new DB_Sql; |
410 | - $deleted_file_name = $this->upload_path . '_deleted_' . $this->get('server_file_name'); |
|
410 | + $deleted_file_name = $this->upload_path.'_deleted_'.$this->get('server_file_name'); |
|
411 | 411 | if (file_exists($deleted_file_name)) { |
412 | 412 | if (!rename($deleted_file_name, $this->upload_path.$this->get('server_file_name'))) { |
413 | 413 | throw new Exception("Kunne ikke omdøbe filen i FileHandler->undelete()"); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | public function moveFromTemporary() |
683 | 683 | { |
684 | 684 | $db = new DB_Sql; |
685 | - $db->query("UPDATE file_handler SET temporary = 0 WHERE user_id = ".$this->kernel->user->get('id')." AND id = " . $this->id); |
|
685 | + $db->query("UPDATE file_handler SET temporary = 0 WHERE user_id = ".$this->kernel->user->get('id')." AND id = ".$this->id); |
|
686 | 686 | return true; |
687 | 687 | } |
688 | 688 |