Completed
Pull Request — master (#26)
by Lars
10:03
created
src/Intraface/modules/cms/element/Pagelist.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -5,6 +5,9 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Page.php 3 patches
Doc Comments   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Intraface/modules/cms/section/Longtext.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 = '';
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Template.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -65,6 +65,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'])) {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/Intraface/modules/contact/Contact.php 3 patches
Doc Comments   +6 added lines, -21 removed lines patch added patch discarded remove patch
@@ -257,7 +257,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Indentation   -3 removed lines patch added patch discarded remove patch
@@ -105,9 +105,6 @@
 block discarded – undo
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]>
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
  * @author  Sune Jensen <[email protected]>
115 115
  * @copyright   Lars Olesen
116 116
  */
117
-require_once dirname(__FILE__) . '/ContactPerson.php';
117
+require_once dirname(__FILE__).'/ContactPerson.php';
118 118
 require_once 'Intraface/functions.php';
119 119
 
120 120
 class Contact extends Intraface_Standard
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
     {
382 382
         // HACK NECCESSARY FOR THE NEWSLETTERSUBSCRIBER
383 383
         $this->kernel->useModule('contact');
384
-        return ($this->value['login_url'] = 'http://' . $this->kernel->getSetting()->get('intranet', 'contact.login_url') . '/' .$this->kernel->intranet->get('identifier') . '/login?code='. $this->get('code'));
384
+        return ($this->value['login_url'] = 'http://'.$this->kernel->getSetting()->get('intranet', 'contact.login_url').'/'.$this->kernel->intranet->get('identifier').'/login?code='.$this->get('code'));
385 385
     }
386 386
 
387 387
     /**
@@ -551,16 +551,16 @@  discard block
 block discarded – undo
551 551
 
552 552
         // prepare sql to update or insert
553 553
         if ($this->id > 0) {
554
-            $sql="UPDATE contact ";
555
-            $sql_after=" WHERE id='".$this->id."'";
554
+            $sql = "UPDATE contact ";
555
+            $sql_after = " WHERE id='".$this->id."'";
556 556
             $sql_create = "";
557 557
         } else {
558
-            $sql="INSERT INTO contact ";
559
-            $sql_after = ", code='".safeToDb(md5(date('Y-m-d H:i:s') . $sql_items))."'";
558
+            $sql = "INSERT INTO contact ";
559
+            $sql_after = ", code='".safeToDb(md5(date('Y-m-d H:i:s').$sql_items))."'";
560 560
             $sql_create = "date_created = NOW(),";
561 561
         }
562 562
 
563
-        $sql .= " SET	".$sql_create. "
563
+        $sql .= " SET	".$sql_create."
564 564
             intranet_id = '". $this->kernel->intranet->get('id')."',"
565 565
             .$sql_items.
566 566
             "date_changed = NOW()
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
             // Delivery Address
591 591
         foreach ($address_fields as $key => $value) {
592 592
             if (array_key_exists('delivery_'.$value, $var)) {
593
-                $delivery_address_to_save[$value] = $var['delivery_' . $value];
593
+                $delivery_address_to_save[$value] = $var['delivery_'.$value];
594 594
             }
595 595
         }
596 596
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
             return false;
625 625
         }
626 626
         $db = new DB_Sql;
627
-        $db->query("UPDATE contact SET active = 0, date_changed = NOW() WHERE intranet_id = " . $this->kernel->intranet->get("id") . " AND id = " . $this->id);
627
+        $db->query("UPDATE contact SET active = 0, date_changed = NOW() WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND id = ".$this->id);
628 628
         return true;
629 629
     }
630 630
 
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
             return false;
645 645
         }
646 646
         $db = new DB_Sql;
647
-        $db->query("UPDATE contact SET active = 1, date_changed = NOW() WHERE intranet_id = " . $this->kernel->intranet->get("id") . " AND id = " . $this->id);
647
+        $db->query("UPDATE contact SET active = 1, date_changed = NOW() WHERE intranet_id = ".$this->kernel->intranet->get("id")." AND id = ".$this->id);
648 648
 
649 649
         return true;
650 650
     }
@@ -662,9 +662,9 @@  discard block
 block discarded – undo
662 662
         $db = new DB_Sql();
663 663
         $sql = "SELECT id
664 664
             FROM contact
665
-            WHERE intranet_id = " . $this->kernel->intranet->get("id") . "
666
-                AND number = " . (int)$number . "
667
-                AND id <> " . $this->id . "
665
+            WHERE intranet_id = " . $this->kernel->intranet->get("id")."
666
+                AND number = " . (int)$number."
667
+                AND id <> " . $this->id."
668 668
                 AND active = 1
669 669
             LIMIT 1";
670 670
         $db->query($sql);
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
     public function getMaxNumber()
685 685
     {
686 686
         $db = new DB_Sql();
687
-        $db->query("SELECT number FROM contact WHERE intranet_id = " . $this->kernel->intranet->get("id") . " ORDER BY number DESC");
687
+        $db->query("SELECT number FROM contact WHERE intranet_id = ".$this->kernel->intranet->get("id")." ORDER BY number DESC");
688 688
         if (!$db->nextRecord()) {
689 689
             return 0;
690 690
         }
@@ -776,11 +776,11 @@  discard block
 block discarded – undo
776 776
                 WHERE address.type=3
777 777
                     AND contact.active = 1
778 778
                     AND address.active = 1
779
-                    AND contact.intranet_id = " . $db->quote($this->kernel->intranet->get('id'), 'integer') . "
780
-                    AND contact.id != " . $db->quote($this->id, 'integer') . "
779
+                    AND contact.intranet_id = " . $db->quote($this->kernel->intranet->get('id'), 'integer')."
780
+                    AND contact.id != " . $db->quote($this->id, 'integer')."
781 781
                     AND (
782
-                        (address.email = " . $db->quote($this->address->get('email'), 'text') . " AND address.email != '')
783
-                        OR (address.phone = " . $db->quote($this->address->get('phone'), 'text') . " AND address.phone != ''))
782
+                        (address.email = " . $db->quote($this->address->get('email'), 'text')." AND address.email != '')
783
+                        OR (address.phone = " . $db->quote($this->address->get('phone'), 'text')." AND address.phone != ''))
784 784
 
785 785
                     ";
786 786
 
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
     function isFilledIn()
870 870
     {
871 871
         $db = new DB_Sql;
872
-        $db->query("SELECT count(*) AS antal FROM contact WHERE intranet_id = " . $this->kernel->intranet->get('id'));
872
+        $db->query("SELECT count(*) AS antal FROM contact WHERE intranet_id = ".$this->kernel->intranet->get('id'));
873 873
         if ($db->nextRecord()) {
874 874
             return $db->f('antal');
875 875
         }
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
             return false;
888 888
         }
889 889
         $db = new DB_Sql;
890
-        $db->query("UPDATE contact SET code = '".md5($this->id . date('Y-m-d H:i:s') . $this->kernel->intranet->get('id'))."' WHERE id = " . $this->id);
890
+        $db->query("UPDATE contact SET code = '".md5($this->id.date('Y-m-d H:i:s').$this->kernel->intranet->get('id'))."' WHERE id = ".$this->id);
891 891
         $this->load();
892 892
         return true;
893 893
     }
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
             return false;
905 905
         }
906 906
         $db = new DB_Sql;
907
-        $db->query("UPDATE contact SET password = '".md5($this->id . date('Y-m-d H:i:s') . $this->kernel->intranet->get('id'))."' WHERE id = " . $this->id);
907
+        $db->query("UPDATE contact SET password = '".md5($this->id.date('Y-m-d H:i:s').$this->kernel->intranet->get('id'))."' WHERE id = ".$this->id);
908 908
         $this->load();
909 909
         return true;
910 910
     }
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
     function getNewsletterSubscriptions()
918 918
     {
919 919
         $db = new DB_Sql;
920
-        $db->query("SELECT * FROM newsletter_subscriber WHERE optin = 1 AND active = 1 AND contact_id = " . $this->id . " AND intranet_id =" . $this->kernel->intranet->get('id'));
920
+        $db->query("SELECT * FROM newsletter_subscriber WHERE optin = 1 AND active = 1 AND contact_id = ".$this->id." AND intranet_id =".$this->kernel->intranet->get('id'));
921 921
         $lists = array();
922 922
         while ($db->nextRecord()) {
923 923
             $lists[] = $db->f('list_id');
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
     function needNewsletterOptin()
934 934
     {
935 935
         $db = new DB_Sql;
936
-        $db->query("SELECT list_id, code FROM newsletter_subscriber WHERE optin = 0 AND contact_id = " . $this->id . " AND intranet_id =" . $this->kernel->intranet->get('id'));
936
+        $db->query("SELECT list_id, code FROM newsletter_subscriber WHERE optin = 0 AND contact_id = ".$this->id." AND intranet_id =".$this->kernel->intranet->get('id'));
937 937
         $lists = array();
938 938
         $i = 0;
939 939
         while ($db->nextRecord()) {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
     function canBeDeleted()
955 955
     {
956 956
         $db = new DB_Sql;
957
-        $db->query("SELECT * FROM debtor WHERE contact_id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
957
+        $db->query("SELECT * FROM debtor WHERE contact_id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
958 958
         if (!$db->nextRecord()) {
959 959
             return true;
960 960
         }
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Debtor.php 3 patches
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
1301 1301
 
1302 1302
     function getPaymentLink($url)
1303 1303
     {
1304
-        return $url . $this->getIdentifier();
1304
+        return $url.$this->getIdentifier();
1305 1305
     }
1306 1306
 }
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/DebtorItem.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Pdf.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /**
35 35
      * Creates the document to write
36 36
      *
37
-     * @return PdfMaker object
37
+     * @return Intraface_Pdf object
38 38
      */
39 39
     protected function getDocument()
40 40
     {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param string $type     Output to type (string or file)
49 49
      * @param string $filename Filename
50 50
      *
51
-     * @return void
51
+     * @return string|null
52 52
      */
53 53
     function output($type = 'string', $filename = 'debtor.pdf')
54 54
     {
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $box_padding_top = 8; // space from top box to first line
88 88
         $box_padding_bottom = 9;
89 89
         $box_width = 275; // ($page_width - $margin_left - 10)/2;
90
-        $box_small_height = $this->doc->get("font_spacing") * 3 + $box_padding_top + $box_padding_bottom + 2;
90
+        $box_small_height = $this->doc->get("font_spacing")*3 + $box_padding_top + $box_padding_bottom + 2;
91 91
 
92 92
         // Write the receiver
93 93
         $this->doc->setY('-'.$this->doc->get("font_spacing")); // $pointY -= $box_padding_top;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 }
156 156
             }
157 157
             $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["postcode"]." ".$intranet["city"]);
158
-            $this->doc->setY('-'.($this->doc->get("font_spacing") * 2)); // $pointY -= $this->doc->get("font_spacing") * 2;
158
+            $this->doc->setY('-'.($this->doc->get("font_spacing")*2)); // $pointY -= $this->doc->get("font_spacing") * 2;
159 159
 
160 160
             $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), "CVR.:");
161 161
             $this->doc->addText($this->doc->get('x') + 10 + 60, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["cvr"]);
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         if (is_array($docinfo) && count($docinfo) > 0) {
193 193
             $this->doc->setY('-10'); // $pointY -= 10;
194 194
             $box_small_top = $this->doc->get('y');
195
-            $box_small_height = count($docinfo) * $this->doc->get("font_spacing") + $box_padding_top + $box_padding_bottom;
195
+            $box_small_height = count($docinfo)*$this->doc->get("font_spacing") + $box_padding_top + $box_padding_bottom;
196 196
             $this->doc->setY('-'.$box_padding_top); // $pointY -= $box_padding_top;
197 197
 
198 198
             for ($i = 0; $i < count($docinfo); $i++) {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
             $payment_left = 230;
284 284
             $payment_right = $this->doc->get("right_margin_position") - $this->doc->get("margin_left") - $payment_left;
285 285
 
286
-            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") + 4 + $payment_line * 3) {
286
+            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") + 4 + $payment_line*3) {
287 287
                 $this->doc->nextPage(true);
288 288
             }
289 289
 
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
             $payment_start = $this->doc->get('y');
301 301
 
302 302
             if ($payment_method == 1) {
303
-                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 2);
304
-                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
303
+                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*2);
304
+                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
305 305
                 $this->doc->line($this->doc->get('x'), $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line);
306
-                $this->doc->line($this->doc->get('x') + $payment_left / 2, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left / 2, $this->doc->get('y') - $payment_line);
306
+                $this->doc->line($this->doc->get('x') + $payment_left/2, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left/2, $this->doc->get('y') - $payment_line);
307 307
 
308 308
                 $this->doc->setY('-7'); // $pointY -= 7;
309 309
                 $this->doc->addText($this->doc->get('x') + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Bank:");
@@ -327,9 +327,9 @@  discard block
 block discarded – undo
327 327
                 $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position
328 328
                 $this->doc->setY('-7'); // $pointY -= 7;
329 329
 
330
-                $this->doc->addText($this->doc->get('x') + $payment_left / 2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
330
+                $this->doc->addText($this->doc->get('x') + $payment_left/2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
331 331
                 $this->doc->setY('-'.($payment_line - 12));
332
-                $this->doc->addText($this->doc->get('x') + $payment_left / 2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
332
+                $this->doc->addText($this->doc->get('x') + $payment_left/2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
333 333
 
334 334
                 $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position
335 335
                 $this->doc->setY('-7');
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
                 $this->doc->setY('-'.($payment_line - 12));
340 340
                 $this->doc->addText($this->doc->get('x') + $payment_left + 10, $this->doc->get('y'), $this->doc->get("font_size"), $payment_info["bank_reg_number"]."       ".$payment_info["bank_account_number"]);
341 341
             } elseif ($payment_method == 2) {
342
-                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 3, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 3);
343
-                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 3, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
342
+                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*3, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*3);
343
+                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*3, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
344 344
                 $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line);
345
-                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line * 2);
346
-                $this->doc->line($this->doc->get('x') + $payment_left + $payment_right / 2, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left + $payment_right / 2, $this->doc->get('y') - $payment_line);
345
+                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line*2);
346
+                $this->doc->line($this->doc->get('x') + $payment_left + $payment_right/2, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left + $payment_right/2, $this->doc->get('y') - $payment_line);
347 347
 
348 348
                 $this->doc->setY('-7');
349 349
                 $this->doc->addText($this->doc->get('x') + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Indbetaler:");
@@ -378,11 +378,11 @@  discard block
 block discarded – undo
378 378
                 $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position
379 379
                 $this->doc->setY('-7');
380 380
 
381
-                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right / 2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
381
+                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right/2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
382 382
                 $this->doc->setY('-'.($payment_line - 12));
383
-                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right / 2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
383
+                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right/2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
384 384
 
385
-                $this->doc->setValue('y', $payment_start - $payment_line * 2); // Sets exact position
385
+                $this->doc->setValue('y', $payment_start - $payment_line*2); // Sets exact position
386 386
                 $this->doc->setY('-7');
387 387
 
388 388
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 $this_text = '+01-'.str_repeat(' ', 20).'+'.$payment_info['giro_account_number'].'-';
394 394
                 $this->doc->addText($this->doc->get('x') + $payment_left + 10, $this->doc->get('y'), $this->doc->get('font_size'), $this_text);
395 395
             } elseif ($payment_method == 3) {
396
-                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 2);
396
+                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*2);
397 397
                 $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line);
398 398
                 $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y'), $this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line);
399 399
 
Please login to merge, or discard this patch.
src/Intraface/modules/filemanager/AppendFile.php 2 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
188 188
     /**
189 189
      * Undelete
190 190
      *
191
+     * @param integer $id
191 192
      * @return boolean
192 193
      */
193 194
     public function undelete($id)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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."
Please login to merge, or discard this patch.