Passed
Pull Request — dev (#14)
by Rafael
51:23
created
Dolibarr/Modules/Don.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -163,8 +163,8 @@
 block discarded – undo
163 163
         }
164 164
 
165 165
         $sql = array(
166
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'donation' AND entity = " . ((int)$conf->entity),
167
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','donation'," . ((int)$conf->entity) . ")",
166
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'donation' AND entity = " . ((int) $conf->entity),
167
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','donation'," . ((int) $conf->entity) . ")",
168 168
         );
169 169
 
170 170
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.
Dolibarr/Modules/Projet.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 
133 133
         // Boxes
134 134
         $this->boxes = array(
135
-            0 => array('file' => 'box_project.php', 'enabledbydefaulton' => 'Home'),  // open projects
136
-            1 => array('file' => 'box_project_opportunities.php', 'enabledbydefaulton' => 'Home'),    // open opportunities
135
+            0 => array('file' => 'box_project.php', 'enabledbydefaulton' => 'Home'), // open projects
136
+            1 => array('file' => 'box_project_opportunities.php', 'enabledbydefaulton' => 'Home'), // open opportunities
137 137
             2 => array('file' => 'box_task.php', 'enabledbydefaulton' => 'Home'),
138
-            3 => array('file' => 'box_validated_projects.php', 'enabledbydefaulton' => 'Home'),   // task without timespent
138
+            3 => array('file' => 'box_validated_projects.php', 'enabledbydefaulton' => 'Home'), // task without timespent
139 139
             4 => array('file' => 'box_funnel_of_prospection.php', 'enabledbydefaulton' => 'Home'),
140 140
         );
141 141
         // Cronjobs
@@ -413,12 +413,12 @@  discard block
 block discarded – undo
413 413
         }
414 414
 
415 415
         $sql = array();
416
-        $sql[] = "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[3][2]) . "' AND type = 'task' AND entity = " . ((int)$conf->entity);
417
-        $sql[] = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[3][2]) . "','task'," . ((int)$conf->entity) . ")";
418
-        $sql[] = "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'beluga' AND type = 'project' AND entity = " . ((int)$conf->entity);
419
-        $sql[] = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('beluga','project'," . ((int)$conf->entity) . ")";
420
-        $sql[] = "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'baleine' AND type = 'project' AND entity = " . ((int)$conf->entity);
421
-        $sql[] = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('baleine','project'," . ((int)$conf->entity) . ")";
416
+        $sql[] = "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[3][2]) . "' AND type = 'task' AND entity = " . ((int) $conf->entity);
417
+        $sql[] = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[3][2]) . "','task'," . ((int) $conf->entity) . ")";
418
+        $sql[] = "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'beluga' AND type = 'project' AND entity = " . ((int) $conf->entity);
419
+        $sql[] = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('beluga','project'," . ((int) $conf->entity) . ")";
420
+        $sql[] = "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'baleine' AND type = 'project' AND entity = " . ((int) $conf->entity);
421
+        $sql[] = "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('baleine','project'," . ((int) $conf->entity) . ")";
422 422
 
423 423
 
424 424
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.
Dolibarr/Modules/KnowledgeManagement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -472,10 +472,10 @@
 block discarded – undo
472 472
                 }
473 473
 
474 474
                 $sql = array_merge($sql, array(
475
-                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int)$conf->entity),
476
-                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . strtolower($myTmpObjectKey) . "'," . ((int)$conf->entity) . ")",
477
-                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int)$conf->entity),
478
-                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . strtolower($myTmpObjectKey) . "', " . ((int)$conf->entity) . ")"
475
+                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int) $conf->entity),
476
+                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . strtolower($myTmpObjectKey) . "'," . ((int) $conf->entity) . ")",
477
+                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int) $conf->entity),
478
+                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . strtolower($myTmpObjectKey) . "', " . ((int) $conf->entity) . ")"
479 479
                 ));
480 480
             }
481 481
         }
Please login to merge, or discard this patch.
Dolibarr/Modules/Partnership.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             // Label of tables
225 225
             'tablib' => array("PartnershipType"),
226 226
             // Request to select fields
227
-            'tabsql' => array('SELECT f.rowid as rowid, f.code, f.label, f.keyword, f.active FROM ' . MAIN_DB_PREFIX . 'c_partnership_type as f WHERE f.entity = ' . ((int)$conf->entity)),
227
+            'tabsql' => array('SELECT f.rowid as rowid, f.code, f.label, f.keyword, f.active FROM ' . MAIN_DB_PREFIX . 'c_partnership_type as f WHERE f.entity = ' . ((int) $conf->entity)),
228 228
             // Sort order
229 229
             'tabsqlsort' => array("label ASC"),
230 230
             // List of fields (result of select to show dictionary)
@@ -488,10 +488,10 @@  discard block
 block discarded – undo
488 488
                 }
489 489
 
490 490
                 $sql = array_merge($sql, array(
491
-                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int)$conf->entity),
492
-                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . strtolower($myTmpObjectKey) . "'," . ((int)$conf->entity) . ")",
493
-                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int)$conf->entity),
494
-                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . strtolower($myTmpObjectKey) . "', " . ((int)$conf->entity) . ")"
491
+                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int) $conf->entity),
492
+                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . strtolower($myTmpObjectKey) . "'," . ((int) $conf->entity) . ")",
493
+                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . strtolower($myTmpObjectKey) . "' AND entity = " . ((int) $conf->entity),
494
+                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . strtolower($myTmpObjectKey) . "', " . ((int) $conf->entity) . ")"
495 495
                 ));
496 496
             }
497 497
         }
Please login to merge, or discard this patch.
Dolibarr/Modules/Societe.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         $this->rights[$r][0] = 130;
208 208
         $this->rights[$r][1] = 'Modify thirdparty information payment';
209 209
         $this->rights[$r][3] = 0;
210
-        $this->rights[$r][4] = 'thirdparty_paymentinformation_advance';      // Visible if option MAIN_USE_ADVANCED_PERMS is on
210
+        $this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
211 211
         $this->rights[$r][5] = 'write';
212 212
 
213 213
         // 262 : Restrict access to sales representative
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_incoterms as incoterm ON s.fk_incoterms = incoterm.rowid';
357 357
         $this->export_sql_end[$r] .= ' WHERE s.entity IN (' . getEntity('societe') . ')';
358 358
         if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) {
359
-            $this->export_sql_end[$r] .= ' AND (sc.fk_user = ' . ((int)$user->id) . ' ';
359
+            $this->export_sql_end[$r] .= ' AND (sc.fk_user = ' . ((int) $user->id) . ' ';
360 360
             if (getDolGlobalString('SOCIETE_EXPORT_SUBORDINATES_CHILDS')) {
361 361
                 $subordinatesids = $user->getAllChildIds();
362 362
                 $this->export_sql_end[$r] .= count($subordinatesids) > 0 ? ' OR (sc.fk_user IN (' . $this->db->sanitize(implode(',', $subordinatesids)) . ')' : '';
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_typent as t ON s.fk_typent = t.id';
446 446
         $this->export_sql_end[$r] .= ' WHERE c.entity IN (' . getEntity('contact') . ')';
447 447
         if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) {
448
-            $this->export_sql_end[$r] .= ' AND (sc.fk_user = ' . ((int)$user->id) . ' ';
448
+            $this->export_sql_end[$r] .= ' AND (sc.fk_user = ' . ((int) $user->id) . ' ';
449 449
             if (getDolGlobalString('SOCIETE_EXPORT_SUBORDINATES_CHILDS')) {
450 450
                 $subordinatesids = $user->getAllChildIds();
451 451
                 $this->export_sql_end[$r] .= count($subordinatesids) > 0 ? ' OR (sc.fk_user IN (' . $this->db->sanitize(implode(',', $subordinatesids)) . ')' : '';
Please login to merge, or discard this patch.
Dolibarr/Modules/Mrp.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         $r = 1;
253 253
 
254 254
         $this->export_code[$r] = $this->rights_class . '_' . $r;
255
-        $this->export_label[$r] = 'MOs';  // Translation key (used only if key ExportDataset_xxx_z not found)
255
+        $this->export_label[$r] = 'MOs'; // Translation key (used only if key ExportDataset_xxx_z not found)
256 256
         $this->export_icon[$r] = 'mrp';
257 257
         $this->export_fields_array[$r] = array(
258 258
             'm.rowid' => "Id",
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
         /* END MODULEBUILDER IMPORT MO */
335 335
         $r++;
336 336
         $this->import_code[$r] = $this->rights_class . '_' . $r;
337
-        $this->import_label[$r] = 'MOs';  // Translation key (used only if key ExportDataset_xxx_z not found)
337
+        $this->import_label[$r] = 'MOs'; // Translation key (used only if key ExportDataset_xxx_z not found)
338 338
         $this->import_icon[$r] = 'mrp';
339 339
         $this->import_entities_array[$r] = array(); // We define here only fields that use a different icon from the one defined in import_icon
340 340
         $this->import_tables_array[$r] = array('m' => MAIN_DB_PREFIX . 'mrp_mo', 'extra' => MAIN_DB_PREFIX . 'mrp_mo_extrafields');
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
         }
463 463
 
464 464
         $sql = array(
465
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape('vinci') . "' AND type = 'mrp' AND entity = " . ((int)$conf->entity),
466
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape('vinci') . "','mrp'," . ((int)$conf->entity) . ")"
465
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape('vinci') . "' AND type = 'mrp' AND entity = " . ((int) $conf->entity),
466
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape('vinci') . "','mrp'," . ((int) $conf->entity) . ")"
467 467
         );
468 468
 
469 469
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.
Dolibarr/Modules/EmailCollector.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -208,17 +208,17 @@  discard block
 block discarded – undo
208 208
                 $descriptionA1 = $langs->trans('EmailCollectorExampleToCollectTicketRequestsDesc');
209 209
                 $label = $langs->trans('EmailCollectorExampleToCollectTicketRequests');
210 210
                 $sqlforexampleA1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
211
-                $sqlforexampleA1 .= " VALUES (" . $conf->entity . ", 'Collect_Ticket_Requests', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionA1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 0)";
211
+                $sqlforexampleA1 .= " VALUES (" . $conf->entity . ", 'Collect_Ticket_Requests', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionA1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 0)";
212 212
 
213 213
                 $sqlforexampleFilterA1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
214
-                $sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = " . $conf->entity . "), 'isnotanswer', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
214
+                $sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = " . $conf->entity . "), 'isnotanswer', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
215 215
                 //$sqlforexampleFilterA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
216 216
                 //$sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
217 217
                 $sqlforexampleFilterA3 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
218
-                $sqlforexampleFilterA3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = " . $conf->entity . "), 'to', '[email protected]', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
218
+                $sqlforexampleFilterA3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = " . $conf->entity . "), 'to', '[email protected]', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
219 219
 
220 220
                 $sqlforexampleActionA1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
221
-                $sqlforexampleActionA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = " . $conf->entity . "), 'ticket', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
221
+                $sqlforexampleActionA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = " . $conf->entity . "), 'ticket', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
222 222
 
223 223
                 $sql[] = $sqlforexampleA1;
224 224
 
@@ -239,15 +239,15 @@  discard block
 block discarded – undo
239 239
                 $descriptionA1 = $langs->trans('EmailCollectorExampleToCollectAnswersFromExternalEmailSoftware');
240 240
                 $label = $langs->trans('EmailCollectorExampleToCollectAnswersFromExternalEmailSoftware');
241 241
                 $sqlforexampleA1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
242
-                $sqlforexampleA1 .= " VALUES (" . $conf->entity . ", 'Collect_Responses_Out', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionA1) . "', 'Sent', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 0)";
242
+                $sqlforexampleA1 .= " VALUES (" . $conf->entity . ", 'Collect_Responses_Out', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionA1) . "', 'Sent', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 0)";
243 243
 
244 244
                 $sqlforexampleFilterA1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
245
-                $sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = " . ((int)$conf->entity) . "), 'isanswer', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
245
+                $sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = " . ((int) $conf->entity) . "), 'isanswer', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
246 246
                 $sqlforexampleFilterA2 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
247
-                $sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = " . ((int)$conf->entity) . "), 'withouttrackingidinmsgid', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
247
+                $sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = " . ((int) $conf->entity) . "), 'withouttrackingidinmsgid', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
248 248
 
249 249
                 $sqlforexampleActionA1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
250
-                $sqlforexampleActionA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = " . ((int)$conf->entity) . "), 'recordevent', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
250
+                $sqlforexampleActionA1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = " . ((int) $conf->entity) . "), 'recordevent', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
251 251
 
252 252
                 $sql[] = $sqlforexampleA1;
253 253
 
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
             }
259 259
         }
260 260
 
261
-        $tmpsql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = " . ((int)$conf->entity);
261
+        $tmpsql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = " . ((int) $conf->entity);
262 262
         $tmpresql = $this->db->query($tmpsql);
263 263
         if ($tmpresql) {
264 264
             if ($this->db->num_rows($tmpresql) == 0) {
265 265
                 $descriptionB1 = $langs->trans('EmailCollectorExampleToCollectDolibarrAnswersDesc');
266 266
                 $label = $langs->trans('EmailCollectorExampleToCollectDolibarrAnswers');
267 267
                 $sqlforexampleB1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
268
-                $sqlforexampleB1 .= " VALUES (" . $conf->entity . ", 'Collect_Responses_In', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionB1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 0)";
268
+                $sqlforexampleB1 .= " VALUES (" . $conf->entity . ", 'Collect_Responses_In', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionB1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 0)";
269 269
 
270 270
                 $sqlforexampleFilterB2 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
271
-                $sqlforexampleFilterB2 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = " . ((int)$conf->entity) . "), 'isanswer', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
271
+                $sqlforexampleFilterB2 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = " . ((int) $conf->entity) . "), 'isanswer', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
272 272
 
273 273
                 $sqlforexampleActionB3 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
274
-                $sqlforexampleActionB3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = " . ((int)$conf->entity) . "), 'recordevent', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
274
+                $sqlforexampleActionB3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = " . ((int) $conf->entity) . "), 'recordevent', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
275 275
 
276 276
                 $sql[] = $sqlforexampleB1;
277 277
 
@@ -283,25 +283,25 @@  discard block
 block discarded – undo
283 283
             dol_print_error($this->db);
284 284
         }
285 285
 
286
-        $tmpsql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int)$conf->entity);
286
+        $tmpsql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int) $conf->entity);
287 287
         $tmpresql = $this->db->query($tmpsql);
288 288
         if ($tmpresql) {
289 289
             if ($this->db->num_rows($tmpresql) == 0) {
290 290
                 $descriptionC1 = $langs->trans("EmailCollectorExampleToCollectLeadsDesc");
291 291
                 $label = $langs->trans('EmailCollectorExampleToCollectLeads');
292 292
                 $sqlforexampleC1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
293
-                $sqlforexampleC1 .= " VALUES (" . $conf->entity . ", 'Collect_Leads', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionC1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 0)";
293
+                $sqlforexampleC1 .= " VALUES (" . $conf->entity . ", 'Collect_Leads', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionC1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 0)";
294 294
 
295 295
                 $sqlforexampleFilterC1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
296
-                $sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int)$conf->entity) . "), 'isnotanswer', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
296
+                $sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int) $conf->entity) . "), 'isnotanswer', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
297 297
                 //$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
298 298
                 //$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
299 299
                 $sqlforexampleFilterC3 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
300
-                $sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int)$conf->entity) . "), 'to', '[email protected]', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
300
+                $sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int) $conf->entity) . "), 'to', '[email protected]', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
301 301
 
302 302
                 $paramstring = 'tmp_from=EXTRACT:HEADER:^From:(.*)' . "\n" . 'socid=SETIFEMPTY:1' . "\n" . 'usage_opportunity=SET:1' . "\n" . 'description=EXTRACT:BODY:(.*)' . "\n" . 'title=SET:Lead or message from __tmp_from__ received by email';
303 303
                 $sqlforexampleActionC4 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
304
-                $sqlforexampleActionC4 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int)$conf->entity) . "), 'project', '" . $this->db->escape($paramstring) . "', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
304
+                $sqlforexampleActionC4 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = " . ((int) $conf->entity) . "), 'project', '" . $this->db->escape($paramstring) . "', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
305 305
 
306 306
                 $sql[] = $sqlforexampleC1;
307 307
 
@@ -315,25 +315,25 @@  discard block
 block discarded – undo
315 315
             dol_print_error($this->db);
316 316
         }
317 317
 
318
-        $tmpsql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int)$conf->entity);
318
+        $tmpsql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int) $conf->entity);
319 319
         $tmpresql = $this->db->query($tmpsql);
320 320
         if ($tmpresql) {
321 321
             if ($this->db->num_rows($tmpresql) == 0) {
322 322
                 $descriptionC1 = $langs->trans("EmailCollectorExampleToCollectJobCandidaturesDesc");
323 323
                 $label = $langs->trans('EmailCollectorExampleToCollectJobCandidatures');
324 324
                 $sqlforexampleC1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
325
-                $sqlforexampleC1 .= " VALUES (" . $conf->entity . ", 'Collect_Candidatures', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionC1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 0)";
325
+                $sqlforexampleC1 .= " VALUES (" . $conf->entity . ", 'Collect_Candidatures', '" . $this->db->escape($label) . "', '" . $this->db->escape($descriptionC1) . "', 'INBOX', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 0)";
326 326
 
327 327
                 $sqlforexampleFilterC1 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
328
-                $sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int)$conf->entity) . "), 'isnotanswer', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
328
+                $sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int) $conf->entity) . "), 'isnotanswer', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
329 329
                 //$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
330 330
                 //$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
331 331
                 $sqlforexampleFilterC3 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
332
-                $sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int)$conf->entity) . "), 'to', '[email protected]', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
332
+                $sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int) $conf->entity) . "), 'to', '[email protected]', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
333 333
 
334 334
                 $paramstring = 'tmp_from=EXTRACT:HEADER:^From:(.*)(<.*>)?' . "\n" . 'fk_recruitmentjobposition=EXTRACT:HEADER:^To:[^\n]*\+([^\n]*)' . "\n" . 'description=EXTRACT:BODY:(.*)' . "\n" . 'lastname=SET:__tmp_from__';
335 335
                 $sqlforexampleActionC4 = "INSERT INTO " . MAIN_DB_PREFIX . "emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
336
-                $sqlforexampleActionC4 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int)$conf->entity) . "), 'candidature', '" . $this->db->escape($paramstring) . "', '" . $this->db->idate(dol_now()) . "', " . ((int)$user->id) . ", 1)";
336
+                $sqlforexampleActionC4 .= " VALUES ((SELECT rowid FROM " . MAIN_DB_PREFIX . "emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = " . ((int) $conf->entity) . "), 'candidature', '" . $this->db->escape($paramstring) . "', '" . $this->db->idate(dol_now()) . "', " . ((int) $user->id) . ", 1)";
337 337
 
338 338
                 $sql[] = $sqlforexampleC1;
339 339
 
Please login to merge, or discard this patch.
Dolibarr/Modules/Adherent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -456,8 +456,8 @@
 block discarded – undo
456 456
         }*/
457 457
 
458 458
         $sql = array(
459
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type='member' AND entity = " . ((int)$conf->entity),
460
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','member'," . ((int)$conf->entity) . ")"
459
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type='member' AND entity = " . ((int) $conf->entity),
460
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','member'," . ((int) $conf->entity) . ")"
461 461
         );
462 462
 
463 463
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.
Dolibarr/Modules/Propale.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -509,8 +509,8 @@
 block discarded – undo
509 509
         }
510 510
 
511 511
         $sql = array(
512
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'propal' AND entity = " . ((int)$conf->entity),
513
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','propal'," . ((int)$conf->entity) . ")",
512
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'propal' AND entity = " . ((int) $conf->entity),
513
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','propal'," . ((int) $conf->entity) . ")",
514 514
         );
515 515
 
516 516
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.