@@ -233,8 +233,8 @@ |
||
233 | 233 | $this->remove($options); |
234 | 234 | |
235 | 235 | $sql = array( |
236 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'ficheinter' AND entity = " . ((int)$conf->entity), |
|
237 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','ficheinter'," . ((int)$conf->entity) . ")", |
|
236 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'ficheinter' AND entity = " . ((int) $conf->entity), |
|
237 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','ficheinter'," . ((int) $conf->entity) . ")", |
|
238 | 238 | ); |
239 | 239 | |
240 | 240 | return $this->_init($sql, $options); |
@@ -448,21 +448,21 @@ |
||
448 | 448 | $res = $this->db->fetch_object($resql); |
449 | 449 | $nextid = $this->getNextId(); |
450 | 450 | if (empty($res)) { |
451 | - $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int)$nextid) . ", 'stocktransfer', 'internal', 'STRESP', 'Responsible for stock transfers', 1, NULL, 0)"); |
|
451 | + $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int) $nextid) . ", 'stocktransfer', 'internal', 'STRESP', 'Responsible for stock transfers', 1, NULL, 0)"); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | $resql = $this->db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "c_type_contact WHERE code = 'STFROM' AND element = 'stocktransfer' AND source = 'external'"); |
455 | 455 | $res = $this->db->fetch_object($resql); |
456 | 456 | $nextid = $this->getNextId(); |
457 | 457 | if (empty($res)) { |
458 | - $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int)$nextid) . ", 'stocktransfer', 'external', 'STFROM', 'Contact sending the stock transfer', 1, NULL, 0)"); |
|
458 | + $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int) $nextid) . ", 'stocktransfer', 'external', 'STFROM', 'Contact sending the stock transfer', 1, NULL, 0)"); |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | $resql = $this->db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "c_type_contact WHERE code = 'STDEST' AND element = 'stocktransfer' AND source = 'external'"); |
462 | 462 | $res = $this->db->fetch_object($resql); |
463 | 463 | $nextid = $this->getNextId(); |
464 | 464 | if (empty($res)) { |
465 | - $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int)$nextid) . ", 'stocktransfer', 'external', 'STDEST', 'Contact receiving the stock transfer', 1, NULL, 0)"); |
|
465 | + $this->db->query("INSERT INTO " . MAIN_DB_PREFIX . "c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(" . ((int) $nextid) . ", 'stocktransfer', 'external', 'STDEST', 'Contact receiving the stock transfer', 1, NULL, 0)"); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | return $this->_init($sql, $options); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function __construct($db) |
50 | 50 | { |
51 | - global $conf, $user; // $conf is required by /core/extrafieldsinexport.inc.php |
|
51 | + global $conf, $user; // $conf is required by /core/extrafieldsinexport.inc.php |
|
52 | 52 | |
53 | 53 | $this->db = $db; |
54 | 54 | $this->numero = 80; |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | $sql = array(); |
366 | 366 | |
367 | 367 | $sql = array( |
368 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'shipping' AND entity = " . ((int)$conf->entity), |
|
369 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'shipping', " . ((int)$conf->entity) . ")", |
|
370 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[3][2]) . "' AND type = 'delivery' AND entity = " . ((int)$conf->entity), |
|
371 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[3][2]) . "', 'delivery', " . ((int)$conf->entity) . ")", |
|
368 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'shipping' AND entity = " . ((int) $conf->entity), |
|
369 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'shipping', " . ((int) $conf->entity) . ")", |
|
370 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[3][2]) . "' AND type = 'delivery' AND entity = " . ((int) $conf->entity), |
|
371 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[3][2]) . "', 'delivery', " . ((int) $conf->entity) . ")", |
|
372 | 372 | //"DELETE FROM ".MAIN_DB_PREFIX."const WHERE name IN ('STOCK_CALCULATE_ON_BILL', 'STOCK_CALCULATE_ON_VALIDATE_ORDER', 'STOCK_CALCULATE_ON_SHIPMENT', 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE') AND entity = ".((int) $conf->entity), |
373 | 373 | //"INSERT INTO ".MAIN_DB_PREFIX."const (name, value, entity) VALUES ('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', 1, ".((int) $conf->entity).")" |
374 | 374 | ); |
@@ -419,10 +419,10 @@ |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | $sql = array_merge($sql, array( |
422 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int)$conf->entity), |
|
423 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int)$conf->entity) . ")", |
|
424 | - "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), |
|
425 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int)$conf->entity) . ")" |
|
422 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard_" . strtolower($myTmpObjectKey) . "' AND type = '" . $this->db->escape(strtolower($myTmpObjectKey)) . "' AND entity = " . ((int) $conf->entity), |
|
423 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard_" . strtolower($myTmpObjectKey) . "','" . $this->db->escape(strtolower($myTmpObjectKey)) . "'," . ((int) $conf->entity) . ")", |
|
424 | + "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), |
|
425 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('generic_" . strtolower($myTmpObjectKey) . "_odt', '" . $this->db->escape(strtolower($myTmpObjectKey)) . "', " . ((int) $conf->entity) . ")" |
|
426 | 426 | )); |
427 | 427 | } |
428 | 428 | } |
@@ -478,8 +478,8 @@ |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | $sql = array( |
481 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'order' AND entity = " . ((int)$conf->entity), |
|
482 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'order', " . ((int)$conf->entity) . ")" |
|
481 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'order' AND entity = " . ((int) $conf->entity), |
|
482 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'order', " . ((int) $conf->entity) . ")" |
|
483 | 483 | ); |
484 | 484 | |
485 | 485 | return $this->_init($sql, $options); |
@@ -183,8 +183,8 @@ |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | $sql = array( |
186 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'supplier_proposal' AND entity = " . ((int)$conf->entity), |
|
187 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','supplier_proposal'," . ((int)$conf->entity) . ")", |
|
186 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'supplier_proposal' AND entity = " . ((int) $conf->entity), |
|
187 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','supplier_proposal'," . ((int) $conf->entity) . ")", |
|
188 | 188 | ); |
189 | 189 | |
190 | 190 | return $this->_init($sql, $options); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | $this->export_sql_start[$r] = 'SELECT DISTINCT '; |
310 | 310 | $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'product as p'; |
311 | 311 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
312 | - $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); |
|
312 | + $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); |
|
313 | 313 | } |
314 | 314 | if (getDolGlobalString('EXPORTTOOL_CATEGORIES')) { |
315 | 315 | $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'; |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $this->export_sql_start[$r] = 'SELECT DISTINCT '; |
465 | 465 | $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'product as p'; |
466 | 466 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
467 | - $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); |
|
467 | + $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); |
|
468 | 468 | } |
469 | 469 | $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_extrafields as extra ON p.rowid = extra.fk_object,'; |
470 | 470 | $this->export_sql_end[$r] .= ' ' . MAIN_DB_PREFIX . 'product_association as pa, ' . MAIN_DB_PREFIX . 'product as p2'; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | // Array to add new pages in new tabs |
134 | 134 | $this->tabs = array(); |
135 | - $this->tabs[] = array('data' => 'user:+skill_tab:Skills:hrm:1:/hrm/skill_tab.php?id=__ID__&objecttype=user'); // To add a new tab identified by code tabname1 |
|
135 | + $this->tabs[] = array('data' => 'user:+skill_tab:Skills:hrm:1:/hrm/skill_tab.php?id=__ID__&objecttype=user'); // To add a new tab identified by code tabname1 |
|
136 | 136 | //$this->tabs[] = array('data'=>'job:+tabname1:Poste:mylangfile@hrm:1:/hrm/poste_list.php?fk_job=__ID__'); // To add a new tab identified by code tabname1 |
137 | 137 | // Example: |
138 | 138 | // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@hrm:$user->rights->hrm->read:/hrm/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 |
@@ -303,8 +303,8 @@ discard block |
||
303 | 303 | } |
304 | 304 | |
305 | 305 | $sql = array( |
306 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard' AND type='evaluation' AND entity = " . ((int)$conf->entity), |
|
307 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard','evaluation'," . ((int)$conf->entity) . ")" |
|
306 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = 'standard' AND type='evaluation' AND entity = " . ((int) $conf->entity), |
|
307 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('standard','evaluation'," . ((int) $conf->entity) . ")" |
|
308 | 308 | ); |
309 | 309 | |
310 | 310 | return $this->_init($sql, $options); |
@@ -149,8 +149,8 @@ |
||
149 | 149 | $this->remove($options); |
150 | 150 | |
151 | 151 | $sql = array( |
152 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'bankaccount' AND entity = " . ((int)$conf->entity), |
|
153 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','bankaccount'," . ((int)$conf->entity) . ")", |
|
152 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'bankaccount' AND entity = " . ((int) $conf->entity), |
|
153 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "','bankaccount'," . ((int) $conf->entity) . ")", |
|
154 | 154 | ); |
155 | 155 | |
156 | 156 | return $this->_init($sql, $options); |