@@ -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); |
@@ -438,9 +438,9 @@ |
||
| 438 | 438 | array("sql" => "insert into " . $this->db->prefix() . "c_type_contact(rowid, element, source, code, libelle, active ) values (110122, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1);", "ignoreerror" => 1), |
| 439 | 439 | array("sql" => "insert into " . $this->db->prefix() . "c_type_contact(rowid, element, source, code, libelle, active ) values (110123, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1);", "ignoreerror" => 1), |
| 440 | 440 | // remove old settings |
| 441 | - "DELETE FROM " . $this->db->prefix() . "document_model WHERE nom = 'TICKET_ADDON_PDF_ODT_PATH' AND type = 'ticket' AND entity = " . ((int)$conf->entity), |
|
| 441 | + "DELETE FROM " . $this->db->prefix() . "document_model WHERE nom = 'TICKET_ADDON_PDF_ODT_PATH' AND type = 'ticket' AND entity = " . ((int) $conf->entity), |
|
| 442 | 442 | // activate default odt templates |
| 443 | - array("sql" => "INSERT INTO " . $this->db->prefix() . "document_model (nom, type, libelle, entity, description) VALUES('generic_ticket_odt','ticket','ODT templates'," . ((int)$conf->entity) . ",'TICKET_ADDON_PDF_ODT_PATH');", "ignoreerror" => 1), |
|
| 443 | + array("sql" => "INSERT INTO " . $this->db->prefix() . "document_model (nom, type, libelle, entity, description) VALUES('generic_ticket_odt','ticket','ODT templates'," . ((int) $conf->entity) . ",'TICKET_ADDON_PDF_ODT_PATH');", "ignoreerror" => 1), |
|
| 444 | 444 | ); |
| 445 | 445 | |
| 446 | 446 | return $this->_init($sql, $options); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | 'e.phone' => 'Text', 'e.fax' => 'Text', 'e.statut' => 'Text', 'pe.rowid' => 'List:entrepot:ref:rowid:stock', 'pe.ref' => 'Text' |
| 227 | 227 | ); |
| 228 | 228 | $this->export_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into export_icon |
| 229 | - $this->export_aggregate_array[$r] = array(); // TODO Not used yet |
|
| 229 | + $this->export_aggregate_array[$r] = array(); // TODO Not used yet |
|
| 230 | 230 | $keyforselect = 'warehouse'; |
| 231 | 231 | $keyforelement = 'warehouse'; |
| 232 | 232 | $keyforaliasextra = 'extra'; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | 'p.datec' => 'product', 'p.tms' => 'product', 'p.pmp' => 'product', 'p.cost_price' => 'product', |
| 274 | 274 | 'ps.reel' => 'stock', |
| 275 | 275 | 'p.seuil_stock_alerte' => 'product', 'p.barcode' => 'product', 'bt.libelle' => 'product', |
| 276 | - ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 276 | + ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 277 | 277 | if (isModEnabled('barcode')) { |
| 278 | 278 | $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode' => 'product')); |
| 279 | 279 | } |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | 'p.datec' => 'product', 'p.tms' => 'product', 'p.pmp' => 'product', 'p.cost_price' => 'product', |
| 333 | 333 | 'pb.rowid' => 'batch', 'pb.batch' => 'batch', 'pb.qty' => 'batch', |
| 334 | 334 | 'pl.eatby' => 'batch', 'pl.sellby' => 'batch' |
| 335 | - ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 335 | + ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 336 | 336 | if (isModEnabled('barcode')) { |
| 337 | 337 | $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode' => 'product')); |
| 338 | 338 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | 'e.rowid' => 'warehouse', 'e.ref' => 'warehouse', 'e.description' => 'warehouse', 'e.lieu' => 'warehouse', 'e.address' => 'warehouse', 'e.zip' => 'warehouse', 'e.town' => 'warehouse', |
| 383 | 383 | 'p.rowid' => "product", 'p.ref' => "product", 'p.fk_product_type' => "product", 'p.label' => "product", 'p.description' => "product", 'p.note' => "product", |
| 384 | 384 | 'p.price' => "product", 'p.tva_tx' => 'product', 'p.tosell' => "product", 'p.tobuy' => "product", 'p.duration' => "product", 'p.datec' => 'product', 'p.tms' => 'product' |
| 385 | - ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 385 | + ); // We define here only fields that use another icon that the one defined into export_icon |
|
| 386 | 386 | if (isModEnabled('productbatch')) { |
| 387 | 387 | $this->export_fields_array[$r]['sm.batch'] = 'Batch'; |
| 388 | 388 | $this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; |
@@ -557,10 +557,10 @@ discard block |
||
| 557 | 557 | $sql = array(); |
| 558 | 558 | |
| 559 | 559 | $sql = array( |
| 560 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'stock' AND entity = " . ((int)$conf->entity), |
|
| 561 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "','stock'," . ((int)$conf->entity) . ")", |
|
| 562 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[2][2]) . "' AND type = 'mouvement' AND entity = " . ((int)$conf->entity), |
|
| 563 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[2][2]) . "','mouvement'," . ((int)$conf->entity) . ")", |
|
| 560 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[1][2]) . "' AND type = 'stock' AND entity = " . ((int) $conf->entity), |
|
| 561 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[1][2]) . "','stock'," . ((int) $conf->entity) . ")", |
|
| 562 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[2][2]) . "' AND type = 'mouvement' AND entity = " . ((int) $conf->entity), |
|
| 563 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[2][2]) . "','mouvement'," . ((int) $conf->entity) . ")", |
|
| 564 | 564 | ); |
| 565 | 565 | |
| 566 | 566 | return $this->_init($sql, $options); |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; |
| 455 | 455 | $this->export_sql_end[$r] .= ' AND f.entity IN (' . getEntity('supplier_invoice') . ')'; |
| 456 | 456 | if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) { |
| 457 | - $this->export_sql_end[$r] .= ' AND sc.fk_user = ' . ((int)$user->id); |
|
| 457 | + $this->export_sql_end[$r] .= ' AND sc.fk_user = ' . ((int) $user->id); |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | // Invoices and payments |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid'; |
| 538 | 538 | $this->export_sql_end[$r] .= ' AND f.entity IN (' . getEntity('supplier_invoice') . ')'; |
| 539 | 539 | if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) { |
| 540 | - $this->export_sql_end[$r] .= ' AND sc.fk_user = ' . ((int)$user->id); |
|
| 540 | + $this->export_sql_end[$r] .= ' AND sc.fk_user = ' . ((int) $user->id); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | // Order |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; |
| 618 | 618 | $this->export_sql_end[$r] .= ' AND f.entity IN (' . getEntity('supplier_order') . ')'; |
| 619 | 619 | if (is_object($user) && !$user->hasRight('societe', 'client', 'voir')) { |
| 620 | - $this->export_sql_end[$r] .= ' AND sc.fk_user = ' . ((int)$user->id); |
|
| 620 | + $this->export_sql_end[$r] .= ' AND sc.fk_user = ' . ((int) $user->id); |
|
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | //Import Supplier Invoice |
@@ -992,8 +992,8 @@ discard block |
||
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | $sql_order = array( |
| 995 | - "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'order_supplier' AND entity = " . ((int)$conf->entity), |
|
| 996 | - "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'order_supplier', " . ((int)$conf->entity) . ")", |
|
| 995 | + "DELETE FROM " . MAIN_DB_PREFIX . "document_model WHERE nom = '" . $this->db->escape($this->const[0][2]) . "' AND type = 'order_supplier' AND entity = " . ((int) $conf->entity), |
|
| 996 | + "INSERT INTO " . MAIN_DB_PREFIX . "document_model (nom, type, entity) VALUES('" . $this->db->escape($this->const[0][2]) . "', 'order_supplier', " . ((int) $conf->entity) . ")", |
|
| 997 | 997 | ); |
| 998 | 998 | |
| 999 | 999 | //ODT template for Supplier Invoice |
@@ -163,8 +163,8 @@ |
||
| 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); |