@@ -456,8 +456,8 @@ |
||
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); |
@@ -509,8 +509,8 @@ |
||
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); |
@@ -441,11 +441,11 @@ |
||
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 | } |
@@ -272,7 +272,7 @@ discard block |
||
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 |
||
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'; |
@@ -248,8 +248,8 @@ |
||
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); |
@@ -163,7 +163,7 @@ |
||
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', |
@@ -656,7 +656,7 @@ discard block |
||
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 |
||
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); |
@@ -266,8 +266,8 @@ |
||
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); |
@@ -436,7 +436,7 @@ |
||
436 | 436 | 'linkedObjectsIds', |
437 | 437 | 'linkedObjects', |
438 | 438 | 'fk_delivery_address', |
439 | - 'projet', // There is already ->fk_project |
|
439 | + 'projet', // There is already ->fk_project |
|
440 | 440 | 'restrictiononfksoc', |
441 | 441 | 'specimen', |
442 | 442 | ); |