Passed
Push — GENERAL_BUG_REVIEW_240911 ( 6dbc7d...fb375d )
by Rafael
53:50
created
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.
Dolibarr/Modules/Recruitment.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -441,11 +441,11 @@
 block discarded – undo
441 441
                 }
442 442
 
443 443
                 $sql = array_merge($sql, array(
444
-                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity),
445
-                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int)$conf->entity) . ")",
444
+                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity),
445
+                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int) $conf->entity) . ")",
446 446
 
447
-                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity),
448
-                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int)$conf->entity) . ")"
447
+                    "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'generic_" . strtolower($myTmpObjectKey) . "_odt' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity),
448
+                    "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int) $conf->entity) . ")"
449 449
                 ));
450 450
             }
451 451
         }
Please login to merge, or discard this patch.
Dolibarr/Modules/Service.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         $this->export_sql_start[$r] = 'SELECT DISTINCT ';
273 273
         $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'product as p';
274 274
         if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
275
-            $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int)$conf->entity);
275
+            $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
276 276
         }
277 277
         if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) {
278 278
             $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN ' . MAIN_DB_PREFIX . 'categorie as cat ON cp.fk_categorie = cat.rowid';
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
                 $this->export_sql_start[$r] = 'SELECT DISTINCT ';
422 422
                 $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'product as p';
423 423
                 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
424
-                    $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as pac ON pac.fk_product = p.rowid AND pac.entity = " . ((int)$conf->entity);
424
+                    $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as pac ON pac.fk_product = p.rowid AND pac.entity = " . ((int) $conf->entity);
425 425
                 }
426 426
                 $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_extrafields as extra ON p.rowid = extra.fk_object,';
427 427
                 $this->export_sql_end[$r] .= ' ' . MAIN_DB_PREFIX . 'product_association as pa, ' . MAIN_DB_PREFIX . 'product as p2';
Please login to merge, or discard this patch.
Dolibarr/Modules/Contrat.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,8 +248,8 @@
 block discarded – undo
248 248
         }
249 249
 
250 250
         $sql = array(
251
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'contract' AND entity = " . ((int)$conf->entity),
252
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "', 'contract', " . ((int)$conf->entity) . ")"
251
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'contract' AND entity = " . ((int) $conf->entity),
252
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "', 'contract', " . ((int) $conf->entity) . ")"
253 253
         );
254 254
 
255 255
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.
Dolibarr/Modules/MultiCurrency.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
                 'priority' => 61,
164 164
                 'label' => 'MutltiCurrencyAutoUpdateCurrencies',
165 165
                 'jobtype' => 'method',
166
-                'class' => 'multicurrency/class/multicurrency.class.php',   // TODO: Review. Is correct? The file no longer exists!
166
+                'class' => 'multicurrency/class/multicurrency.class.php', // TODO: Review. Is correct? The file no longer exists!
167 167
                 'objectname' => 'MultiCurrency',
168 168
                 'method' => 'syncRates',
169 169
                 'parameters' => '0,0,cron',
Please login to merge, or discard this patch.
Dolibarr/Modules/Facture.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
         $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'facturedet_extrafields as extra2 on fd.rowid = extra2.fk_object';
657 657
         $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product as p on (fd.fk_product = p.rowid)';
658 658
         if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
659
-            $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int)$conf->entity);
659
+            $this->export_sql_end[$r] .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
660 660
         }
661 661
         $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_extrafields as extra3 on p.rowid = extra3.fk_object';
662 662
         $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa on fd.fk_code_ventilation = aa.rowid';
@@ -793,8 +793,8 @@  discard block
 block discarded – undo
793 793
         }
794 794
 
795 795
         $sql = array(
796
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'invoice' AND entity = " . ((int)$conf->entity),
797
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "','invoice'," . ((int)$conf->entity) . ")"
796
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'invoice' AND entity = " . ((int) $conf->entity),
797
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "','invoice'," . ((int) $conf->entity) . ")"
798 798
         );
799 799
 
800 800
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.
Dolibarr/Modules/ExpenseReport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -266,8 +266,8 @@
 block discarded – undo
266 266
         $this->remove($options);
267 267
 
268 268
         $sql = array(
269
-            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard' AND type='expensereport' AND entity = " . ((int)$conf->entity),
270
-            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard','expensereport'," . ((int)$conf->entity) . ")"
269
+            "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard' AND type='expensereport' AND entity = " . ((int) $conf->entity),
270
+            "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard','expensereport'," . ((int) $conf->entity) . ")"
271 271
         );
272 272
 
273 273
         return $this->_init($sql, $options);
Please login to merge, or discard this patch.