Completed
Push — master ( 6ed6e7...ca5679 )
by Lars
26:16 queued 07:58
created
src/Intraface/modules/cms/Element.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
     /**
70 70
      * Creates a parameter
71 71
      *
72
-     * @return object
72
+     * @return CMS_Parameter
73 73
      */
74 74
     function createParameter()
75 75
     {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      */
42 42
     function __construct($section, $id = 0)
43 43
     {
44
-        $this->value['identify_as'] = 'cms_element';  // bruges af parameter
44
+        $this->value['identify_as'] = 'cms_element'; // bruges af parameter
45 45
 
46
-        $this->id        = (int) $id;
46
+        $this->id        = (int)$id;
47 47
         $this->kernel    = $section->kernel;
48 48
         $this->section   = $section;
49 49
         $this->error     = new Intraface_Error;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
     function getPosition(DB_Sql $db)
65 65
     {
66
-        return new Ilib_Position($db, "cms_element", $this->id, "section_id=".$this->section->get('id')." AND active = 1 AND intranet_id = " . $this->kernel->intranet->get('id'), "position", "id");
66
+        return new Ilib_Position($db, "cms_element", $this->id, "section_id=".$this->section->get('id')." AND active = 1 AND intranet_id = ".$this->kernel->intranet->get('id'), "position", "id");
67 67
     }
68 68
 
69 69
     /**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
 
127 127
         $db = new DB_Sql;
128
-        $db->query("SELECT id, section_id, date_expire, date_publish, type_key, position FROM cms_element WHERE intranet_id = ".$this->section->kernel->intranet->get('id')." AND id = " . $this->id);
128
+        $db->query("SELECT id, section_id, date_expire, date_publish, type_key, position FROM cms_element WHERE intranet_id = ".$this->section->kernel->intranet->get('id')." AND id = ".$this->id);
129 129
         if (!$db->nextRecord()) {
130 130
             return 0;
131 131
         }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $this->value['extra_class'] = '';
148 148
 
149 149
         if ($this->get('elm_width')) {
150
-            $this->value['extra_style'] .= 'width: ' . $this->get('elm_width') . ';';
150
+            $this->value['extra_style'] .= 'width: '.$this->get('elm_width').';';
151 151
         }
152 152
 
153 153
         if ($this->get('elm_properties') == 'float') {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             $this->value['extra_style'] .= ' clear: both;';
162 162
         }
163 163
         if ($this->get('elm_adjust')) {
164
-            $this->value['extra_class'] .= ' cms-align-' . $this->get('elm_adjust');
164
+            $this->value['extra_class'] .= ' cms-align-'.$this->get('elm_adjust');
165 165
         }
166 166
 
167 167
         if ($this->get('elm_box') == 'box') {
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
             $sql_end = ", date_created = NOW()";
238 238
         } else {
239 239
             $sql_type = "UPDATE ";
240
-            $sql_end = " WHERE id = " . $this->id;
240
+            $sql_end = " WHERE id = ".$this->id;
241 241
         }
242
-        $sql = $sql_type . " cms_element SET
242
+        $sql = $sql_type." cms_element SET
243 243
                 intranet_id = ".$this->section->kernel->intranet->get('id').",
244
-                section_id=". (int)$this->section->get('id') . ",
244
+                section_id=". (int)$this->section->get('id').",
245 245
                 type_key = ".safeToDb($this->value['type_key']).",
246 246
                 date_changed = NOW(),
247 247
                 date_publish = ".$date_publish.",
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $this->id = $db->insertedId();
255 255
 
256 256
             $next_pos = $this->getPosition($db)->getMaxPosition() + 1;
257
-            $db->query("UPDATE cms_element SET position = " . $next_pos . " WHERE id = " . $this->id);
257
+            $db->query("UPDATE cms_element SET position = ".$next_pos." WHERE id = ".$this->id);
258 258
         }
259 259
 
260 260
         $this->load();
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     public function delete()
291 291
     {
292 292
         $db = new DB_Sql;
293
-        $db->query("UPDATE cms_element SET active = 0 WHERE id = " . $this->id);
293
+        $db->query("UPDATE cms_element SET active = 0 WHERE id = ".$this->id);
294 294
         return true;
295 295
     }
296 296
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     public function undelete()
303 303
     {
304 304
         $db = new DB_Sql;
305
-        $db->query("UPDATE cms_element SET active = 1 WHERE id = " . $this->id);
305
+        $db->query("UPDATE cms_element SET active = 1 WHERE id = ".$this->id);
306 306
         return true;
307 307
     }
308 308
 
Please login to merge, or discard this patch.
src/Intraface/modules/cms/element/Gallery.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -6,6 +6,9 @@
 block discarded – undo
6 6
 {
7 7
     public $methods = array('single_image');
8 8
 
9
+    /**
10
+     * @param FakeCMSSection $section
11
+     */
9 12
     function __construct($section, $id = 0)
10 13
     {
11 14
         $this->value['type'] = 'gallery';
Please login to merge, or discard this patch.
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.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -62,11 +62,17 @@
 block discarded – undo
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_';
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
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
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Intraface/modules/contact/ContactReminder.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.