@@ -5,6 +5,9 @@ |
||
| 5 | 5 | class Intraface_modules_cms_element_Pagelist extends CMS_Element |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | + /** |
|
| 9 | + * @param FakeCMSSection $section |
|
| 10 | + */ |
|
| 8 | 11 | function __construct($section, $id = 0) |
| 9 | 12 | { |
| 10 | 13 | $this->value['type'] = 'pagelist'; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * Returns position object |
| 128 | 128 | * |
| 129 | 129 | * @param object $db database object |
| 130 | - * @return object Position |
|
| 130 | + * @return Ilib_Position Position |
|
| 131 | 131 | */ |
| 132 | 132 | public function getPosition($db) |
| 133 | 133 | { |
@@ -137,13 +137,16 @@ discard block |
||
| 137 | 137 | /** |
| 138 | 138 | * returns Template object |
| 139 | 139 | * |
| 140 | - * @return object Template |
|
| 140 | + * @return CMS_Template Template |
|
| 141 | 141 | */ |
| 142 | 142 | public function getTemplate() |
| 143 | 143 | { |
| 144 | 144 | return $this->template; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | + /** |
|
| 148 | + * @param string $type |
|
| 149 | + */ |
|
| 147 | 150 | function factory($kernel, $type, $value) |
| 148 | 151 | { |
| 149 | 152 | $gateway = new Intraface_modules_cms_PageGateway($kernel, new DB_Sql); |
@@ -745,6 +748,7 @@ discard block |
||
| 745 | 748 | |
| 746 | 749 | /** |
| 747 | 750 | * @todo is this still used after the introduction of publish and unpublish |
| 751 | + * @param string $status |
|
| 748 | 752 | */ |
| 749 | 753 | function setStatus($status) |
| 750 | 754 | { |
@@ -815,7 +819,7 @@ discard block |
||
| 815 | 819 | /** |
| 816 | 820 | * Returns the possible page types |
| 817 | 821 | * |
| 818 | - * @return array possible page types |
|
| 822 | + * @return string[] possible page types |
|
| 819 | 823 | */ |
| 820 | 824 | public function getTypes() |
| 821 | 825 | { |
@@ -825,7 +829,7 @@ discard block |
||
| 825 | 829 | /** |
| 826 | 830 | * Returns the possible page types but with a binary index |
| 827 | 831 | * |
| 828 | - * @return array possible page types with binary index |
|
| 832 | + * @return string[] possible page types with binary index |
|
| 829 | 833 | */ |
| 830 | 834 | public static function getTypesWithBinaryIndex() |
| 831 | 835 | { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function __construct($cmssite, $id = 0) |
| 77 | 77 | { |
| 78 | 78 | if (!is_object($cmssite)) { |
| 79 | - throw new Exception('CMS_Page::__construct needs CMS_Site'); |
|
| 79 | + throw new Exception('CMS_Page::__construct needs CMS_Site'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->id = (int)$id; |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | return $display; |
| 527 | 527 | } |
| 528 | - */ |
|
| 528 | + */ |
|
| 529 | 529 | function getComments() |
| 530 | 530 | { |
| 531 | 531 | if (!$this->kernel->intranet->hasModuleAccess('contact')) { |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | { |
| 785 | 785 | $db = new DB_Sql(); |
| 786 | 786 | $db2 = new DB_Sql; |
| 787 | - // egentlig skuille denne m�ske v�re rekursiv? |
|
| 787 | + // egentlig skuille denne m�ske v�re rekursiv? |
|
| 788 | 788 | |
| 789 | 789 | /* |
| 790 | 790 | // I am not quite sure what this one is suppossed to do - see the next one instead. |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->id = (int)$id; |
| 83 | - $this->cmssite = $cmssite; |
|
| 83 | + $this->cmssite = $cmssite; |
|
| 84 | 84 | $this->navigation = new CMS_Navigation($this); |
| 85 | 85 | $this->template = new CMS_Template($this->cmssite); |
| 86 | 86 | $this->kernel = $this->cmssite->kernel; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if ($this->dbquery) { |
| 121 | 121 | return $this->dbquery; |
| 122 | 122 | } |
| 123 | - return ($this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id'))); |
|
| 123 | + return ($this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = '.$this->cmssite->get('id'))); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $validator->isNumeric($var['allow_comments'], 'error in comments - allowed values are 0 and 1'); |
| 213 | 213 | $validator->isNumeric($var['hidden'], 'error in hidden - allowed values are 0 and 1'); |
| 214 | 214 | |
| 215 | - if (!Validate::string($var['identifier'], array('format' => VALIDATE_ALPHA . VALIDATE_NUM . '-_'))) { |
|
| 215 | + if (!Validate::string($var['identifier'], array('format' => VALIDATE_ALPHA.VALIDATE_NUM.'-_'))) { |
|
| 216 | 216 | $this->error->set('error in unique page address. allowed values are a-z 1-9 _ -'); |
| 217 | 217 | } |
| 218 | 218 | if (!$this->isIdentifierAvailable($var['identifier'])) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | function isIdentifierAvailable($identifier) |
| 229 | 229 | { |
| 230 | 230 | $db = new DB_Sql; |
| 231 | - $db->query("SELECT * FROM cms_page WHERE site_id = " . $this->cmssite->get('id') . " AND identifier = '".$identifier."' AND active = 1 AND id != " . (int)$this->get('id')); |
|
| 231 | + $db->query("SELECT * FROM cms_page WHERE site_id = ".$this->cmssite->get('id')." AND identifier = '".$identifier."' AND active = 1 AND id != ".(int)$this->get('id')); |
|
| 232 | 232 | return ($db->numRows() == 0); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | if (empty($var['identifier'])) { |
| 271 | - $var['identifier'] = md5(date('d-m-Y H:i:s') . $type_key . serialize($var)); |
|
| 271 | + $var['identifier'] = md5(date('d-m-Y H:i:s').$type_key.serialize($var)); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | settype($var['date_expire'], 'string'); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $sql_end = ", date_created = NOW()"; |
| 283 | 283 | } else { |
| 284 | 284 | $sql_type = "UPDATE "; |
| 285 | - $sql_end = ", date_updated = NOW() WHERE id = " . $this->id; |
|
| 285 | + $sql_end = ", date_updated = NOW() WHERE id = ".$this->id; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | $sql_extra = ''; |
@@ -295,11 +295,11 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | // if the page is to updated |
| 298 | - $sql = $sql_type . " cms_page SET |
|
| 298 | + $sql = $sql_type." cms_page SET |
|
| 299 | 299 | intranet_id = '".$this->kernel->intranet->get('id')."', |
| 300 | 300 | user_id = '".$this->kernel->user->get('id')."', |
| 301 | - title = '" .$var['title']. "', |
|
| 302 | - keywords = '" .$var['keywords']. "', |
|
| 301 | + title = '" .$var['title']."', |
|
| 302 | + keywords = '" .$var['keywords']."', |
|
| 303 | 303 | description = '".$var['description']."', |
| 304 | 304 | date_publish = ".$sql_publish.", |
| 305 | 305 | allow_comments = ".$var['allow_comments'].", |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | site_id = '".(int)$this->cmssite->get('id')."', |
| 312 | 312 | template_id = ".$var['template_id'].", |
| 313 | 313 | pic_id = ".intval($var['pic_id']).", |
| 314 | - identifier = '".$var['identifier']."'" . $sql_end; |
|
| 314 | + identifier = '".$var['identifier']."'".$sql_end; |
|
| 315 | 315 | // password = '".$var['password']."', |
| 316 | 316 | $db = new DB_Sql; |
| 317 | 317 | $db->query($sql); |
@@ -326,11 +326,11 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | //position |
| 329 | - $db->query("SELECT position FROM cms_page WHERE id = " . $this->id); |
|
| 329 | + $db->query("SELECT position FROM cms_page WHERE id = ".$this->id); |
|
| 330 | 330 | if ($db->nextRecord()) { |
| 331 | 331 | if ($db->f('position') == 0 and count($this->getList($this->value['type']) > 0)) { |
| 332 | 332 | $next_pos = $this->getPosition(MDB2::singleton(DB_DSN))->getMaxPosition() + 1; |
| 333 | - $db->query("UPDATE cms_page SET position = " . $next_pos . " WHERE id = " . $this->id); |
|
| 333 | + $db->query("UPDATE cms_page SET position = ".$next_pos." WHERE id = ".$this->id); |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | $sql_publish = " AND date_publish < NOW() AND status_key > 0"; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $sql = "SELECT *, DATE_FORMAT(date_publish, '%d-%m-%Y') AS date_publish_dk FROM cms_page WHERE intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND id = " .$this->id . $sql_expire . $sql_publish; |
|
| 370 | + $sql = "SELECT *, DATE_FORMAT(date_publish, '%d-%m-%Y') AS date_publish_dk FROM cms_page WHERE intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND id = ".$this->id.$sql_expire.$sql_publish; |
|
| 371 | 371 | |
| 372 | 372 | $db = new DB_Sql(); |
| 373 | 373 | $db->query($sql); |
@@ -386,8 +386,8 @@ discard block |
||
| 386 | 386 | if (empty($this->value['identifier'])) { |
| 387 | 387 | $this->value['identifier'] = $db->f('id'); |
| 388 | 388 | } |
| 389 | - $this->value['url'] = $this->cmssite->get('url') . $this->value['identifier'] . '/'; |
|
| 390 | - $this->value['url_self'] = $this->value['identifier'] . '/'; |
|
| 389 | + $this->value['url'] = $this->cmssite->get('url').$this->value['identifier'].'/'; |
|
| 390 | + $this->value['url_self'] = $this->value['identifier'].'/'; |
|
| 391 | 391 | |
| 392 | 392 | $this->value['child_of_id'] = $db->f('child_of_id'); |
| 393 | 393 | $this->value['name'] = $db->f('title'); // bruges til keywords - m�ske skulle vi have et felt ogs�, s� title var webrelateret? |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | foreach ($template_sections as $template_section) { |
| 466 | 466 | $db = new DB_Sql; |
| 467 | - $db->query("SELECT id FROM cms_section WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND page_id = ".$this->get('id')." AND site_id = ".$this->cmssite->get('id')." AND template_section_id = " . $template_section['id']); |
|
| 467 | + $db->query("SELECT id FROM cms_section WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND page_id = ".$this->get('id')." AND site_id = ".$this->cmssite->get('id')." AND template_section_id = ".$template_section['id']); |
|
| 468 | 468 | |
| 469 | 469 | // opretter de sektioner der ikke er oprettet p� siden |
| 470 | 470 | if (!$db->nextRecord()) { |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | $db = new DB_Sql; |
| 481 | 481 | $db->query("SELECT cms_section.id FROM cms_section INNER JOIN cms_template_section ON cms_section.template_section_id = cms_template_section.id |
| 482 | 482 | WHERE cms_section.intranet_id = ".$this->kernel->intranet->get('id')." |
| 483 | - AND cms_section.page_id = " . $this->id . " ORDER BY cms_template_section.position ASC"); |
|
| 483 | + AND cms_section.page_id = " . $this->id." ORDER BY cms_template_section.position ASC"); |
|
| 484 | 484 | $i = 0; |
| 485 | 485 | $section = array(); |
| 486 | 486 | while ($db->nextRecord()) { |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | return false; |
| 756 | 756 | } |
| 757 | 757 | $db = new DB_Sql; |
| 758 | - $db->query("UPDATE cms_page SET status_key = " . array_search($status, $this->status) . " WHERE id = " . $this->id . " AND intranet_id = " . $this->cmssite->kernel->intranet->get('id')); |
|
| 758 | + $db->query("UPDATE cms_page SET status_key = ".array_search($status, $this->status)." WHERE id = ".$this->id." AND intranet_id = ".$this->cmssite->kernel->intranet->get('id')); |
|
| 759 | 759 | $this->value['status_key'] = array_search($status, $this->status); |
| 760 | 760 | return true; |
| 761 | 761 | } |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | // @todo: BUT it can be a mess and the position of the pages is not corrected |
| 800 | 800 | $db->query('UPDATE cms_page SET child_of_id = '.intval($this->get('child_of_id')).' WHERE child_of_id = '.intval($this->id)); |
| 801 | 801 | |
| 802 | - $sql = "UPDATE cms_page SET active = 0 WHERE id=" . $this->id . " AND site_id = ".$this->cmssite->get('id'); |
|
| 802 | + $sql = "UPDATE cms_page SET active = 0 WHERE id=".$this->id." AND site_id = ".$this->cmssite->get('id'); |
|
| 803 | 803 | $db->query($sql); |
| 804 | 804 | $this->value['active'] = 0; |
| 805 | 805 | $this->load(); |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | function publish() |
| 859 | 859 | { |
| 860 | 860 | $db = new DB_Sql; |
| 861 | - $db->query("UPDATE cms_page SET status_key = " . array_search('published', $this->status) . " WHERE id = " . $this->id . " AND intranet_id = " . $this->cmssite->kernel->intranet->get('id')); |
|
| 861 | + $db->query("UPDATE cms_page SET status_key = ".array_search('published', $this->status)." WHERE id = ".$this->id." AND intranet_id = ".$this->cmssite->kernel->intranet->get('id')); |
|
| 862 | 862 | $this->value['status_key'] = 1; |
| 863 | 863 | $this->load(); |
| 864 | 864 | return true; |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | function unpublish() |
| 868 | 868 | { |
| 869 | 869 | $db = new DB_Sql; |
| 870 | - $db->query("UPDATE cms_page SET status_key = " . array_search('draft', $this->status) . " WHERE id = " . $this->id . " AND intranet_id = " . $this->cmssite->kernel->intranet->get('id')); |
|
| 870 | + $db->query("UPDATE cms_page SET status_key = ".array_search('draft', $this->status)." WHERE id = ".$this->id." AND intranet_id = ".$this->cmssite->kernel->intranet->get('id')); |
|
| 871 | 871 | $this->value['status_key'] = 0; |
| 872 | 872 | $this->load(); |
| 873 | 873 | return true; |
@@ -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 | } |