From becd77a04aca207618e71b06d12a190c3d36b6e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Apr 2011 18:23:05 +0000 Subject: [PATCH] Renamed table llx_c_commande_fournisseur_methode into an english and more generic name: llx_c_input_method --- htdocs/admin/dict.php | 7 ++++--- htdocs/core/class/html.formorder.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- ...commande_fournisseur.sql => llx_c_input_method.sql} | 10 +++++----- htdocs/install/mysql/migration/3.0.0-3.1.0.sql | 2 ++ ..._fournisseur.key.sql => llx_c_input_method.key.sql} | 2 +- ...commande_fournisseur.sql => llx_c_input_method.sql} | 2 +- htdocs/install/upgrade.php | 5 +++-- 8 files changed, 19 insertions(+), 15 deletions(-) rename htdocs/install/mysql/data/{llx_c_methode_commande_fournisseur.sql => llx_c_input_method.sql} (69%) mode change 100644 => 100755 rename htdocs/install/mysql/tables/{llx_c_methode_commande_fournisseur.key.sql => llx_c_input_method.key.sql} (90%) mode change 100644 => 100755 rename htdocs/install/mysql/tables/{llx_c_methode_commande_fournisseur.sql => llx_c_input_method.sql} (96%) mode change 100644 => 100755 diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 4a70a40de37..9ee71de5ec6 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -74,9 +74,10 @@ $tabname[16]= MAIN_DB_PREFIX."c_prospectlevel"; $tabname[17]= MAIN_DB_PREFIX."c_type_fees"; $tabname[18]= MAIN_DB_PREFIX."c_shipment_mode"; $tabname[19]= MAIN_DB_PREFIX."c_effectif"; -$tabname[20]= MAIN_DB_PREFIX."c_methode_commande_fournisseur"; +$tabname[20]= MAIN_DB_PREFIX."c_demand_method"; $tabname[21]= MAIN_DB_PREFIX."c_availability"; $tabname[22]= MAIN_DB_PREFIX."c_source"; +//$tabname[23]= MAIN_DB_PREFIX."c_demand_reason"; // Dictionary labels $tablib[1] = "DictionnaryCompanyJuridicalType"; @@ -122,7 +123,7 @@ $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_pro $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; $tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode"; $tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif"; -$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; +$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_demand_method"; $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c"; $tabsql[22]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_source AS c"; @@ -874,7 +875,7 @@ function fieldList($fieldlist,$obj='') foreach ($fieldlist as $field => $value) { - + if ($fieldlist[$field] == 'pays') { if (in_array('region_id',$fieldlist)) { print ' '; continue; } // For region page, we do not show the country input print ''; diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 9732ef89b08..62e4945e3c7 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -87,7 +87,7 @@ class FormOrder $form=new Form($this->db); $sql = "SELECT rowid, code, libelle as label"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_demand_method"; $sql.= " WHERE active = 1"; dol_syslog("Form::select_methodes_commande sql=".$sql); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ace4a2e26a6..c72854da4ab 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -107,7 +107,7 @@ class CommandeFournisseur extends Commande $sql.= " c.note, c.note_public, c.model_pdf,"; $sql.= " cm.libelle as methode_commande"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_methode_commande_fournisseur as cm ON cm.rowid = c.fk_methode_commande"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_demand_method as cm ON cm.rowid = c.fk_methode_commande"; $sql.= " WHERE c.entity = ".$conf->entity; if ($ref) $sql.= " AND c.ref='".$ref."'"; else $sql.= " AND c.rowid=".$id; @@ -1123,7 +1123,7 @@ class CommandeFournisseur extends Commande function get_methodes_commande() { $sql = "SELECT rowid, libelle"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_demand_method"; $sql.= " WHERE active = 1"; $resql=$this->db->query($sql); diff --git a/htdocs/install/mysql/data/llx_c_methode_commande_fournisseur.sql b/htdocs/install/mysql/data/llx_c_input_method.sql old mode 100644 new mode 100755 similarity index 69% rename from htdocs/install/mysql/data/llx_c_methode_commande_fournisseur.sql rename to htdocs/install/mysql/data/llx_c_input_method.sql index e1f848aa706..e29b3f306f5 --- a/htdocs/install/mysql/data/llx_c_methode_commande_fournisseur.sql +++ b/htdocs/install/mysql/data/llx_c_input_method.sql @@ -29,8 +29,8 @@ -- -INSERT INTO llx_c_methode_commande_fournisseur (rowid, code, libelle, active) VALUES (1, 'OrderByMail', 'Courrier', 1); -INSERT INTO llx_c_methode_commande_fournisseur (rowid, code, libelle, active) VALUES (2, 'OrderByFax', 'Fax', 1); -INSERT INTO llx_c_methode_commande_fournisseur (rowid, code, libelle, active) VALUES (3, 'OrderByEMail', 'EMail', 1); -INSERT INTO llx_c_methode_commande_fournisseur (rowid, code, libelle, active) VALUES (4, 'OrderByPhone', 'Téléphone', 1); -INSERT INTO llx_c_methode_commande_fournisseur (rowid, code, libelle, active) VALUES (5, 'OrderByWWW', 'En ligne', 1); +INSERT INTO llx_c_input_method (rowid, code, libelle, active) VALUES (1, 'OrderByMail', 'Courrier', 1); +INSERT INTO llx_c_input_method (rowid, code, libelle, active) VALUES (2, 'OrderByFax', 'Fax', 1); +INSERT INTO llx_c_input_method (rowid, code, libelle, active) VALUES (3, 'OrderByEMail', 'EMail', 1); +INSERT INTO llx_c_input_method (rowid, code, libelle, active) VALUES (4, 'OrderByPhone', 'Téléphone', 1); +INSERT INTO llx_c_input_method (rowid, code, libelle, active) VALUES (5, 'OrderByWWW', 'En ligne', 1); diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql index 49ae2e5f2ab..c1715fbe837 100755 --- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql +++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql @@ -10,6 +10,8 @@ -- To change type of field: ALTER TABLE llx_table MODIFY name varchar(60); -- +RENAME TABLE llx_c_methode_commande_fournisseur TO llx_c_input_method; + ALTER TABLE llx_adherent MODIFY login varchar(50); ALTER TABLE llx_c_actioncomm ADD COLUMN position integer NOT NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_c_methode_commande_fournisseur.key.sql b/htdocs/install/mysql/tables/llx_c_input_method.key.sql old mode 100644 new mode 100755 similarity index 90% rename from htdocs/install/mysql/tables/llx_c_methode_commande_fournisseur.key.sql rename to htdocs/install/mysql/tables/llx_c_input_method.key.sql index 1e98ba08990..665a210d74b --- a/htdocs/install/mysql/tables/llx_c_methode_commande_fournisseur.key.sql +++ b/htdocs/install/mysql/tables/llx_c_input_method.key.sql @@ -19,4 +19,4 @@ -- $Id$ -- ======================================================================== -ALTER TABLE llx_c_methode_commande_fournisseur ADD UNIQUE INDEX uk_c_methode_commande_fournisseur (code); +ALTER TABLE llx_c_input_method ADD UNIQUE INDEX uk_c_input_method(code); diff --git a/htdocs/install/mysql/tables/llx_c_methode_commande_fournisseur.sql b/htdocs/install/mysql/tables/llx_c_input_method.sql old mode 100644 new mode 100755 similarity index 96% rename from htdocs/install/mysql/tables/llx_c_methode_commande_fournisseur.sql rename to htdocs/install/mysql/tables/llx_c_input_method.sql index 188e7c60930..69681d61b61 --- a/htdocs/install/mysql/tables/llx_c_methode_commande_fournisseur.sql +++ b/htdocs/install/mysql/tables/llx_c_input_method.sql @@ -19,7 +19,7 @@ -- $Id$ -- ======================================================================== -create table llx_c_methode_commande_fournisseur +create table llx_c_input_method ( rowid integer AUTO_INCREMENT PRIMARY KEY, code varchar(30), diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 8bb4055c95d..2c68f71604a 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -107,7 +107,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $conf->db->name = $dolibarr_main_db_name; $conf->db->user = $dolibarr_main_db_user; $conf->db->pass = $dolibarr_main_db_pass; - + // Load type and crypt key if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0; $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption; @@ -243,7 +243,8 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $listtables=array( 'llx_adherent_options', 'llx_bank_class', 'llx_c_ecotaxe', - 'llx_c_methode_commande_fournisseur'); + 'llx_c_methode_commande_fournisseur', // table renamed + 'llx_c_input_method'); $listtables = $db->DDLListTables($conf->db->name,''); foreach ($listtables as $val)