Clean code of deprecated field

This commit is contained in:
Laurent Destailleur 2022-09-23 09:35:17 +02:00
parent 1f8327514b
commit e1b5e5033f
19 changed files with 9 additions and 66 deletions

View File

@ -127,7 +127,6 @@ class DolibarrApi
unset($object->ref_previous);
unset($object->ref_next);
unset($object->ref_int);
unset($object->imgWidth);
unset($object->imgHeight);
unset($object->barcode_type_code);

View File

@ -102,12 +102,6 @@ class Commande extends CommonOrder
*/
public $ref_client;
/**
* @var string Internal ref for order
* @deprecated
*/
public $ref_int;
/**
* @var int Contact ID
*/
@ -311,7 +305,6 @@ class Commande extends CommonOrder
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>25),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>26),
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>25),
@ -945,7 +938,7 @@ class Commande extends CommonOrder
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande (";
$sql .= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int";
$sql .= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client";
$sql .= ", model_pdf, fk_cond_reglement, deposit_percent, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
$sql .= ", fk_shipping_method";
$sql .= ", fk_warehouse";
@ -964,7 +957,6 @@ class Commande extends CommonOrder
$sql .= ", '".$this->db->escape($this->note_public)."'";
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
$sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null");
$sql .= ", '".$this->db->escape($this->model_pdf)."'";
$sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : "null");
$sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null");
@ -1827,7 +1819,7 @@ class Commande extends CommonOrder
$sql .= ', c.fk_shipping_method';
$sql .= ', c.fk_warehouse';
$sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed';
$sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams';
$sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams';
$sql .= ', c.fk_incoterms, c.location_incoterms';
$sql .= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc";
$sql .= ", c.module_source, c.pos_source";
@ -1855,9 +1847,6 @@ class Commande extends CommonOrder
if ($ref_ext) {
$sql .= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
}
if ($notused) {
$sql .= " AND c.ref_int='".$this->db->escape($notused)."'";
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
@ -1871,7 +1860,6 @@ class Commande extends CommonOrder
$this->ref_client = $obj->ref_client;
$this->ref_customer = $obj->ref_client;
$this->ref_ext = $obj->ref_ext;
$this->ref_int = $obj->ref_int;
$this->socid = $obj->fk_soc;
$this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty

View File

@ -147,12 +147,6 @@ class Facture extends CommonInvoice
public $ref_client; // deprecated; use ref_customer instead
public $ref_customer;
/**
* @var int Ref Int
* @deprecated
*/
public $ref_int; // deprecated
//Check constants for types
public $type = self::TYPE_STANDARD;
@ -305,7 +299,6 @@ class Facture extends CommonInvoice
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>10),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>12),
//'ref_int' =>array('type'=>'varchar(255)', 'label'=>'Ref int', 'enabled'=>1, 'visible'=>0, 'position'=>30), // deprecated
'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
//'increment' =>array('type'=>'varchar(10)', 'label'=>'Increment', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50),
@ -664,7 +657,7 @@ class Facture extends CommonInvoice
$sql .= ", date_pointoftax";
$sql .= ", note_private";
$sql .= ", note_public";
$sql .= ", ref_client, ref_int";
$sql .= ", ref_client";
$sql .= ", fk_account";
$sql .= ", module_source, pos_source, fk_fac_rec_source, fk_facture_source, fk_user_author, fk_projet";
$sql .= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf";
@ -691,7 +684,6 @@ class Facture extends CommonInvoice
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
$sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null");
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
$sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null");
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null");
$sql .= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null");
@ -1926,7 +1918,7 @@ class Facture extends CommonInvoice
return -1;
}
$sql = 'SELECT f.rowid,f.entity,f.ref,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc';
$sql = 'SELECT f.rowid, f.entity, f.ref, f.ref_client, f.ref_ext, f.type, f.fk_soc';
$sql .= ', f.total_tva, f.localtax1, f.localtax2, f.total_ht, f.total_ttc, f.revenuestamp';
$sql .= ', f.remise_percent, f.remise_absolue, f.remise';
$sql .= ', f.datef as df, f.date_pointoftax';
@ -1961,9 +1953,6 @@ class Facture extends CommonInvoice
if ($ref_ext) {
$sql .= " AND f.ref_ext='".$this->db->escape($ref_ext)."'";
}
if ($notused) {
$sql .= " AND f.ref_int='".$this->db->escape($notused)."'"; // deprecated
}
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);

View File

@ -1096,7 +1096,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis,
foreach ($object->fields as $key => $val) {
if (empty($val['measure'])) {
if (in_array($key, array(
'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
continue;
}
@ -1217,7 +1217,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
foreach ($object->fields as $key => $val) {
if (empty($val['isameasure'])) {
if (in_array($key, array(
'id', 'ref_int', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
'id', 'ref_ext', 'rowid', 'entity', 'last_main_doc', 'logo', 'logo_squarred', 'extraparams',
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
continue;
}

View File

@ -238,7 +238,6 @@ class modFacture extends DolibarrModules
$this->import_fields_array[$r] = array(
'f.ref' => 'InvoiceRef*',
'f.ref_ext' => 'ExternalRef',
'f.ref_int' => 'ExternalRef',
'f.ref_client' => 'CutomerRef',
'f.type' => 'Type*',
'f.fk_soc' => 'Customer*',
@ -292,7 +291,6 @@ class modFacture extends DolibarrModules
$import_sample = array(
'f.ref' => '(PROV0001)',
'f.ref_ext' => '',
'f.ref_int' => '',
'f.ref_client' => '',
'f.type' => '0',
'f.fk_soc' => '80LIMIT',

View File

@ -457,7 +457,6 @@ function cleanObjectDatas($toclean)
unset($toclean->ref_previous);
unset($toclean->ref_next);
unset($toclean->ref_int);
unset($toclean->projet); // Should be fk_project
unset($toclean->project); // Should be fk_project

View File

@ -874,7 +874,6 @@ if ($action == 'create') {
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="origin_id" value="'.$object->id.'">';
print '<input type="hidden" name="ref_int" value="'.$object->ref_int.'">';
if (GETPOST('entrepot_id', 'int')) {
print '<input type="hidden" name="entrepot_id" value="'.GETPOST('entrepot_id', 'int').'">';
}

View File

@ -98,12 +98,6 @@ class Expedition extends CommonObject
*/
public $ref_customer;
/**
* @var string internal ref
* @deprecated
*/
public $ref_int;
public $brouillon;
/**
@ -304,7 +298,6 @@ class Expedition extends CommonObject
$sql .= "ref";
$sql .= ", entity";
$sql .= ", ref_customer";
$sql .= ", ref_int";
$sql .= ", ref_ext";
$sql .= ", date_creation";
$sql .= ", fk_user_author";
@ -329,7 +322,6 @@ class Expedition extends CommonObject
$sql .= "'(PROV)'";
$sql .= ", ".((int) $conf->entity);
$sql .= ", ".($this->ref_customer ? "'".$this->db->escape($this->ref_customer)."'" : "null");
$sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null");
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", ".((int) $user->id);
@ -527,7 +519,7 @@ class Expedition extends CommonObject
return -1;
}
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
$sql .= ", e.date_valid";
$sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql .= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
@ -551,9 +543,6 @@ class Expedition extends CommonObject
if ($ref_ext) {
$sql .= " AND e.ref_ext='".$this->db->escape($ref_ext)."'";
}
if ($notused) {
$sql .= " AND e.ref_int='".$this->db->escape($notused)."'";
}
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
@ -567,7 +556,6 @@ class Expedition extends CommonObject
$this->socid = $obj->socid;
$this->ref_customer = $obj->ref_customer;
$this->ref_ext = $obj->ref_ext;
$this->ref_int = $obj->ref_int;
$this->statut = $obj->fk_statut;
$this->user_author_id = $obj->fk_user_author;
$this->date_creation = $this->db->jdate($obj->date_creation);

View File

@ -1510,7 +1510,7 @@ if ($resql) {
// Payment condition
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
print '<td class="tdoverflowmax125">';
print '<td class="tdoverflowmax100">';
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1);
print '</td>';
if (!$i) {
@ -1519,7 +1519,7 @@ if ($resql) {
}
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
print '<td class="tdoverflowmax125">';
print '<td class="tdoverflowmax100">';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
print '</td>';
if (!$i) {

View File

@ -26,7 +26,6 @@ create table llx_commande
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_int varchar(255), -- reference into an internal system (deprecated)
ref_client varchar(255), -- reference for customer
fk_soc integer NOT NULL,

View File

@ -26,7 +26,6 @@ create table llx_delivery
fk_soc integer NOT NULL,
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info)
ref_customer varchar(255), -- customer number
date_creation datetime, -- date de creation

View File

@ -29,7 +29,6 @@ create table llx_expedition
fk_projet integer DEFAULT NULL,
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info)
ref_customer varchar(255), -- customer number
date_creation datetime, -- date de creation

View File

@ -30,7 +30,6 @@ create table llx_facture
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info)
ref_client varchar(255), -- reference for customer
type smallint DEFAULT 0 NOT NULL, -- type of invoice

View File

@ -26,7 +26,6 @@ create table llx_propal
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_int varchar(255), -- reference into an internal system (used by dolibarr to store extern id like paypal info)
ref_client varchar(255), -- customer proposal number
fk_soc integer,

View File

@ -29,7 +29,6 @@ create table llx_reception
fk_projet integer DEFAULT NULL,
ref_ext varchar(30), -- reference into an external system (not used by dolibarr)
ref_int varchar(30), -- reference into an internal system (deprecated)
ref_supplier varchar(128), -- supplier number
date_creation datetime, -- date de creation

View File

@ -29,7 +29,6 @@ create table llx_societe
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_int varchar(255), -- reference into an internal system (deprecated)
statut tinyint DEFAULT 0, -- statut
parent integer,

View File

@ -20,7 +20,6 @@ CREATE TABLE llx_supplier_proposal (
ref varchar(30) NOT NULL,
entity integer NOT NULL DEFAULT 1,
ref_ext varchar(255) DEFAULT NULL,
ref_int varchar(255) DEFAULT NULL,
fk_soc integer DEFAULT NULL,
fk_projet integer DEFAULT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

View File

@ -700,12 +700,6 @@ class Societe extends CommonObject
*/
public $ref;
/**
* @var string Internal ref
* @deprecated
*/
public $ref_int;
/**
* External user reference.
* This is to allow external systems to store their id and make self-developed synchronizing functions easier to build.

View File

@ -183,7 +183,6 @@ $order_fields = array(
'ref' => array('name'=>'ref', 'type'=>'xsd:string'),
'ref_client' => array('name'=>'ref_client', 'type'=>'xsd:string'),
'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'),
'ref_int' => array('name'=>'ref_int', 'type'=>'xsd:string'),
'thirdparty_id' => array('name'=>'thirdparty_id', 'type'=>'xsd:int'),
'status' => array('name'=>'status', 'type'=>'xsd:int'),
'billed' => array('name'=>'billed', 'type'=>'xsd:string'),
@ -438,7 +437,6 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '')
'ref' => $order->ref,
'ref_client' => $order->ref_client,
'ref_ext' => $order->ref_ext,
'ref_int' => $order->ref_int,
'thirdparty_id' => $order->socid,
'status' => $order->statut,
@ -593,7 +591,6 @@ function getOrdersForThirdParty($authentication, $idthirdparty)
'ref' => $order->ref,
'ref_client' => $order->ref_client,
'ref_ext' => $order->ref_ext,
'ref_int' => $order->ref_int,
'socid' => $order->socid,
'status' => $order->statut,