Qual: Renamed table llx_c_civilite into llx_c_civility
field civilite into label in the same table and field civilite into civility in other table
This commit is contained in:
parent
526066803c
commit
1a87d98357
@ -73,6 +73,9 @@ For developers:
|
||||
- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE.
|
||||
- New: Added hook "formConfirm" and "doActions" for supplier invoice card.
|
||||
- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card.
|
||||
- Qual: Renamed table llx_c_civilite into llx_c_civility
|
||||
field civilite into label in the same table
|
||||
and field civilite into civility in other table
|
||||
|
||||
WARNING: Following change may create regression for some external modules, but was necessary to make
|
||||
Dolibarr better:
|
||||
|
||||
@ -425,7 +425,7 @@ class Adherent extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql.= " civilite = ".(!is_null($this->civility_id)?"'".$this->civility_id."'":"null");
|
||||
$sql.= " civility = ".(!is_null($this->civility_id)?"'".$this->civility_id."'":"null");
|
||||
$sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
||||
$sql.= ", lastname=" .($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
||||
$sql.= ", login=" .($this->login?"'".$this->db->escape($this->login)."'":"null");
|
||||
@ -1048,7 +1048,7 @@ class Adherent extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT d.rowid, d.ref_ext, d.civilite as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
|
||||
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
|
||||
$sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
|
||||
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
|
||||
$sql.= " d.datec as datec,";
|
||||
@ -1539,7 +1539,7 @@ class Adherent extends CommonObject
|
||||
|
||||
$code=(empty($this->civility_id)?'':$this->civility_id);
|
||||
if (empty($code)) return '';
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code);
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -78,7 +78,7 @@ $tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
||||
$tabname[2] = MAIN_DB_PREFIX."c_departements";
|
||||
$tabname[3] = MAIN_DB_PREFIX."c_regions";
|
||||
$tabname[4] = MAIN_DB_PREFIX."c_pays";
|
||||
$tabname[5] = MAIN_DB_PREFIX."c_civilite";
|
||||
$tabname[5] = MAIN_DB_PREFIX."c_civility";
|
||||
$tabname[6] = MAIN_DB_PREFIX."c_actioncomm";
|
||||
$tabname[7] = MAIN_DB_PREFIX."c_chargesociales";
|
||||
$tabname[8] = MAIN_DB_PREFIX."c_typent";
|
||||
@ -136,7 +136,7 @@ $tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code
|
||||
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
|
||||
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays";
|
||||
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c";
|
||||
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
|
||||
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
|
||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, p.code as country_code, p.libelle as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON t.fk_country=p.rowid";
|
||||
@ -165,7 +165,7 @@ $tabsqlsort[1] ="country ASC, code ASC";
|
||||
$tabsqlsort[2] ="country ASC, code ASC";
|
||||
$tabsqlsort[3] ="country ASC, code ASC";
|
||||
$tabsqlsort[4] ="code ASC";
|
||||
$tabsqlsort[5] ="libelle ASC";
|
||||
$tabsqlsort[5] ="label ASC";
|
||||
$tabsqlsort[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC";
|
||||
$tabsqlsort[7] ="country ASC, code ASC, a.libelle ASC";
|
||||
$tabsqlsort[8] ="country DESC, libelle ASC";
|
||||
@ -194,7 +194,7 @@ $tabfield[1] = "code,libelle,country";
|
||||
$tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country"
|
||||
$tabfield[3] = "code,libelle,country_id,country";
|
||||
$tabfield[4] = "code,libelle";
|
||||
$tabfield[5] = "code,libelle";
|
||||
$tabfield[5] = "code,label";
|
||||
$tabfield[6] = "code,libelle,type,position";
|
||||
$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible";
|
||||
$tabfield[8] = "code,libelle,country_id,country";
|
||||
@ -223,7 +223,7 @@ $tabfieldvalue[1] = "code,libelle,country";
|
||||
$tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
|
||||
$tabfieldvalue[3] = "code,libelle,country";
|
||||
$tabfieldvalue[4] = "code,libelle";
|
||||
$tabfieldvalue[5] = "code,libelle";
|
||||
$tabfieldvalue[5] = "code,label";
|
||||
$tabfieldvalue[6] = "code,libelle,type,position";
|
||||
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
|
||||
$tabfieldvalue[8] = "code,libelle,country";
|
||||
@ -252,7 +252,7 @@ $tabfieldinsert[1] = "code,libelle,fk_pays";
|
||||
$tabfieldinsert[2] = "code_departement,nom,fk_region";
|
||||
$tabfieldinsert[3] = "code_region,nom,fk_pays";
|
||||
$tabfieldinsert[4] = "code,libelle";
|
||||
$tabfieldinsert[5] = "code,civilite";
|
||||
$tabfieldinsert[5] = "code,label";
|
||||
$tabfieldinsert[6] = "code,libelle,type,position";
|
||||
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
|
||||
$tabfieldinsert[8] = "code,libelle,fk_country";
|
||||
@ -1044,7 +1044,7 @@ if ($id)
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_civilite') {
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
|
||||
$key=$langs->trans("Civility".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ class Contact extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
|
||||
if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',";
|
||||
else if ($this->socid == -1) $sql .= " fk_soc=null,";
|
||||
$sql .= " civilite='".$this->db->escape($this->civility_id)."'";
|
||||
$sql .= " civility='".$this->db->escape($this->civility_id)."'";
|
||||
$sql .= ", lastname='".$this->db->escape($this->lastname)."'";
|
||||
$sql .= ", firstname='".$this->db->escape($this->firstname)."'";
|
||||
$sql .= ", address='".$this->db->escape($this->address)."'";
|
||||
@ -498,7 +498,7 @@ class Contact extends CommonObject
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civilite as civility_id, c.lastname, c.firstname,";
|
||||
$sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civility as civility_id, c.lastname, c.firstname,";
|
||||
$sql.= " c.address, c.statut, c.zip, c.town,";
|
||||
$sql.= " c.fk_pays as country_id,";
|
||||
$sql.= " c.fk_departement,";
|
||||
@ -911,7 +911,7 @@ class Contact extends CommonObject
|
||||
|
||||
$code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civility_id)?$this->civility_id:''));
|
||||
if (empty($code)) return '';
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code);
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -61,7 +61,7 @@ class box_contacts extends ModeleBoxes
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civilite as civility_id, sp.datec, sp.tms, sp.fk_soc,";
|
||||
$sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc,";
|
||||
$sql.= " s.nom as socname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
|
||||
|
||||
@ -381,7 +381,7 @@ abstract class CommonObject
|
||||
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
|
||||
if ($source == 'internal') $sql.=", '-1' as socid";
|
||||
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid";
|
||||
$sql.= ", t.civilite as civility, t.lastname as lastname, t.firstname, t.email";
|
||||
$sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email";
|
||||
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact ec";
|
||||
|
||||
@ -367,7 +367,7 @@ class FormCompany
|
||||
|
||||
$out='';
|
||||
|
||||
$sql = "SELECT rowid, code, civilite as civility_label, active FROM ".MAIN_DB_PREFIX."c_civilite";
|
||||
$sql = "SELECT rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_civility";
|
||||
$sql.= " WHERE active = 1";
|
||||
|
||||
dol_syslog("Form::select_civility", LOG_DEBUG);
|
||||
@ -392,7 +392,7 @@ class FormCompany
|
||||
$out.= '<option value="'.$obj->code.'">';
|
||||
}
|
||||
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
||||
$out.= ($langs->trans("Civility".$obj->code)!="Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->civility_label!='-'?$obj->civility_label:''));
|
||||
$out.= ($langs->trans("Civility".$obj->code)!="Civility".$obj->code ? $langs->trans("Civility".$obj->code) : ($obj->label!='-'?$obj->label:''));
|
||||
$out.= '</option>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -363,7 +363,7 @@ class Translate
|
||||
}
|
||||
else if (preg_match('/^Civility([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_civilite','code','civilite');
|
||||
$newstr=$this->getLabelFromKey($db,$reg[1],'c_civility','code','label');
|
||||
}
|
||||
else if (preg_match('/^OrderSource([0-9A-Z]+)$/i',$key,$reg))
|
||||
{
|
||||
|
||||
@ -648,7 +648,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
|
||||
|
||||
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.skype, p.statut ";
|
||||
$sql .= ", p.civilite as civility_id, p.address, p.zip, p.town";
|
||||
$sql .= ", p.civility as civility_id, p.address, p.zip, p.town";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||
if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status);
|
||||
|
||||
@ -197,7 +197,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname, other
|
||||
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
|
||||
$sql.= " c.lastname, c.firstname, c.civilite as civility_id,";
|
||||
$sql.= " c.lastname, c.firstname, c.civility as civility_id,";
|
||||
$sql.= " s.nom as companyname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
|
||||
@ -239,7 +239,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
'firstname' => $obj->firstname,
|
||||
'other' =>
|
||||
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.
|
||||
($langs->transnoentities("UserTitle").'='.($obj->civilite_id?$langs->transnoentities("Civility".$obj->civilite_id):'')),
|
||||
($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')),
|
||||
'source_url' => $this->url($obj->id),
|
||||
'source_id' => $obj->id,
|
||||
'source_type' => 'contact'
|
||||
|
||||
@ -79,7 +79,7 @@ class mailing_contacts2 extends MailingTargets
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname, other
|
||||
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
|
||||
$sql.= " sp.lastname, sp.firstname as firstname, sp.civilite as civility_id,";
|
||||
$sql.= " sp.lastname, sp.firstname as firstname, sp.civility as civility_id,";
|
||||
$sql.= " s.nom as companyname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
|
||||
|
||||
@ -77,7 +77,7 @@ class mailing_contacts3 extends MailingTargets
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname, other
|
||||
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
|
||||
$sql.= " sp.lastname, sp.firstname, sp.civilite as civility_id,";
|
||||
$sql.= " sp.lastname, sp.firstname, sp.civility as civility_id,";
|
||||
$sql.= " s.nom as companyname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
|
||||
|
||||
@ -77,7 +77,7 @@ class mailing_contacts4 extends MailingTargets
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname, other
|
||||
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
|
||||
$sql.= " sp.lastname, sp.firstname, sp.civilite as civility_id,";
|
||||
$sql.= " sp.lastname, sp.firstname, sp.civility as civility_id,";
|
||||
$sql.= " s.nom as companyname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
if ($filtersarray[0] <> 'all')$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie_contact as cs ON cs.fk_socpeople=sp.rowid";
|
||||
|
||||
@ -166,7 +166,7 @@ class mailing_fraise extends MailingTargets
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname
|
||||
$sql = "SELECT a.rowid as id, a.email as email, null as fk_contact, ";
|
||||
$sql.= " a.lastname, a.firstname,";
|
||||
$sql.= " a.datefin, a.civilite as civility_id, a.login, a.societe"; // Other fields
|
||||
$sql.= " a.datefin, a.civility as civility_id, a.login, a.societe"; // Other fields
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.email <> ''"; // Note that null != '' is false
|
||||
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
|
||||
|
||||
@ -64,7 +64,7 @@ class mailing_framboise extends MailingTargets
|
||||
|
||||
// Select the members from category
|
||||
$sql = "SELECT a.rowid as id, a.email as email, a.lastname, null as fk_contact, a.firstname,";
|
||||
$sql.= " a.datefin, a.civilite as civility_id, a.login, a.societe,"; // Other fields
|
||||
$sql.= " a.datefin, a.civility as civility_id, a.login, a.societe,"; // Other fields
|
||||
if ($_POST['filter']) $sql.= " c.label";
|
||||
else $sql.=" null as label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
|
||||
@ -149,7 +149,7 @@ class mailing_pomme extends MailingTargets
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, lastname, firstname
|
||||
$sql = "SELECT u.rowid as id, u.email as email, null as fk_contact,";
|
||||
$sql.= " u.lastname, u.firstname as firstname, u.civilite as civility_id, u.login, u.office_phone";
|
||||
$sql.= " u.lastname, u.firstname as firstname, u.civility as civility_id, u.login, u.office_phone";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test
|
||||
$sql.= " AND u.entity IN (0,".$conf->entity.")";
|
||||
|
||||
@ -173,9 +173,9 @@ class modAdherent extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='MembersAndSubscriptions';
|
||||
$this->export_permission[$r]=array(array("adherent","export"));
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'p.code'=>"CountryCode",'p.libelle'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'p.code'=>'Text','p.libelle'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'p.code'=>"member",'p.libelle'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'p.code'=>"CountryCode",'p.libelle'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'p.code'=>'Text','p.libelle'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'p.code'=>"member",'p.libelle'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity = ".$conf->entity;
|
||||
$resql=$this->db->query($sql);
|
||||
@ -210,7 +210,7 @@ class modAdherent extends DolibarrModules
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('a'=>MAIN_DB_PREFIX.'adherent','extra'=>MAIN_DB_PREFIX.'adherent_extrafields');
|
||||
$this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id
|
||||
$this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.state_id'=>'StateId','a.country'=>"CountryId",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
|
||||
$this->import_fields_array[$r]=array('a.civility'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.state_id'=>'StateId','a.country'=>"CountryId",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity = ".$conf->entity;
|
||||
$resql=$this->db->query($sql);
|
||||
@ -225,8 +225,8 @@ class modAdherent extends DolibarrModules
|
||||
}
|
||||
// End add extra fields
|
||||
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||
$this->import_regex_array[$r]=array('a.civilite'=>'code@'.MAIN_DB_PREFIX.'c_civilite','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
$this->import_examplevalues_array[$r]=array('a.civilite'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
|
||||
$this->import_regex_array[$r]=array('a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
$this->import_examplevalues_array[$r]=array('a.civility'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ class modCategorie extends DolibarrModules
|
||||
'u.label' => "Label",
|
||||
'u.description' => "Description",
|
||||
'p.rowid' => 'ContactId',
|
||||
'p.civilite' => 'Civility',
|
||||
'p.civility' => 'Civility',
|
||||
'p.lastname' => 'LastName',
|
||||
'p.firstname' => 'Firstname',
|
||||
'p.address' => 'Address',
|
||||
@ -211,7 +211,7 @@ class modCategorie extends DolibarrModules
|
||||
'u.label' => "category",
|
||||
'u.description' => "category",
|
||||
'p.rowid' => 'contact',
|
||||
'p.civilite' => 'contact',
|
||||
'p.civility' => 'contact',
|
||||
'p.lastname' => 'contact',
|
||||
'p.firstname' => 'contact',
|
||||
'p.address' => 'contact',
|
||||
|
||||
@ -320,8 +320,8 @@ class modSociete extends DolibarrModules
|
||||
$this->export_label[$r]='ExportDataset_company_2';
|
||||
$this->export_icon[$r]='contact';
|
||||
$this->export_permission[$r]=array(array("societe","contact","export"));
|
||||
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1');
|
||||
$this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text");
|
||||
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civility'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1');
|
||||
$this->export_TypeFields_array[$r]=array('c.civility'=>"List:c_civility:label:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text");
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto
|
||||
if (empty($conf->fournisseur->enabled))
|
||||
{
|
||||
@ -417,7 +417,7 @@ class modSociete extends DolibarrModules
|
||||
$this->import_icon[$r]='contact';
|
||||
$this->import_entities_array[$r]=array('s.fk_soc'=>'company'); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'socpeople','extra'=>MAIN_DB_PREFIX.'socpeople_extrafields'); // List of tables to insert into (insert done in same order)
|
||||
$this->import_fields_array[$r]=array('s.fk_soc'=>'ThirdPartyName','s.civilite'=>'UserTitle','s.lastname'=>"Lastname*",'s.firstname'=>"Firstname",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.birthday'=>"BirthdayDate",'s.poste'=>"Role",'s.phone'=>"Phone",'s.phone_perso'=>"PhonePerso",'s.phone_mobile'=>"PhoneMobile",'s.fax'=>"Fax",'s.email'=>"Email",'s.note_private'=>"Note",'s.note_public'=>"Note",'s.datec'=>"DateCreation");
|
||||
$this->import_fields_array[$r]=array('s.fk_soc'=>'ThirdPartyName','s.civility'=>'UserTitle','s.lastname'=>"Lastname*",'s.firstname'=>"Firstname",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.birthday'=>"BirthdayDate",'s.poste'=>"Role",'s.phone'=>"Phone",'s.phone_perso'=>"PhonePerso",'s.phone_mobile'=>"PhoneMobile",'s.fax'=>"Fax",'s.email'=>"Email",'s.note_private'=>"Note",'s.note_public'=>"Note",'s.datec'=>"DateCreation");
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity = ".$conf->entity;
|
||||
$resql=$this->db->query($sql);
|
||||
@ -438,7 +438,7 @@ class modSociete extends DolibarrModules
|
||||
);
|
||||
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
|
||||
$this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
$this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civilite'=>"MR",'s.lastname'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.zip'=>'75000','s.town'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note_private'=>"My private note",'s.note_public'=>"My public note");
|
||||
$this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civility'=>"MR",'s.lastname'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.zip'=>'75000','s.town'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note_private'=>"My private note",'s.note_public'=>"My public note");
|
||||
|
||||
// Import Bank Accounts
|
||||
$r++;
|
||||
|
||||
@ -27,12 +27,12 @@
|
||||
--
|
||||
|
||||
--
|
||||
-- Civilites
|
||||
-- Civilities
|
||||
--
|
||||
|
||||
delete from llx_c_civilite;
|
||||
insert into llx_c_civilite (rowid, code, civilite, active) values (1 , 'MME', 'Madame', 1);
|
||||
insert into llx_c_civilite (rowid, code, civilite, active) values (3 , 'MR', 'Monsieur', 1);
|
||||
insert into llx_c_civilite (rowid, code, civilite, active) values (5 , 'MLE', 'Mademoiselle', 1);
|
||||
insert into llx_c_civilite (rowid, code, civilite, active) values (7 , 'MTRE', 'Maître', 1);
|
||||
insert into llx_c_civilite (rowid, code, civilite, active) values (8 , 'DR', 'Docteur', 1);
|
||||
delete from llx_c_civility;
|
||||
insert into llx_c_civility (rowid, code, label, active) values (1 , 'MME', 'Madame', 1);
|
||||
insert into llx_c_civility (rowid, code, label, active) values (3 , 'MR', 'Monsieur', 1);
|
||||
insert into llx_c_civility (rowid, code, label, active) values (5 , 'MLE', 'Mademoiselle', 1);
|
||||
insert into llx_c_civility (rowid, code, label, active) values (7 , 'MTRE', 'Maître', 1);
|
||||
insert into llx_c_civility (rowid, code, label, active) values (8 , 'DR', 'Docteur', 1);
|
||||
|
||||
@ -959,3 +959,11 @@ CREATE TABLE llx_holiday_types (
|
||||
nbCongesDeducted varchar(255) NOT NULL,
|
||||
nbCongesEveryMonth varchar(255) NOT NULL
|
||||
);
|
||||
|
||||
-- Change on table c_civilite
|
||||
ALTER TABLE llx_c_civilite RENAME TO llx_c_civility;
|
||||
ALTER TABLE llx_c_civility CHANGE civilite label VARCHAR(50);
|
||||
ALTER TABLE llx_c_civility ADD UNIQUE INDEX uk_c_civility(code);
|
||||
ALTER TABLE llx_adherent CHANGE civilite civility VARCHAR(6);
|
||||
ALTER TABLE llx_socpeople CHANGE civilite civility VARCHAR(6);
|
||||
ALTER TABLE llx_user CHANGE civilite civility VARCHAR(6);
|
||||
|
||||
@ -30,7 +30,7 @@ create table llx_adherent
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
|
||||
|
||||
civilite varchar(6),
|
||||
civility varchar(6),
|
||||
lastname varchar(50),
|
||||
firstname varchar(50),
|
||||
login varchar(50), -- login
|
||||
|
||||
@ -16,4 +16,4 @@
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
ALTER TABLE llx_c_civilite ADD UNIQUE INDEX uk_c_civilite(code);
|
||||
ALTER TABLE llx_c_civility ADD UNIQUE INDEX uk_c_civility(code);
|
||||
@ -17,11 +17,11 @@
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
create table llx_c_civilite
|
||||
create table llx_c_civility
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
code varchar(6) NOT NULL,
|
||||
civilite varchar(50),
|
||||
label varchar(50),
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
module varchar(32) NULL
|
||||
)ENGINE=innodb;
|
||||
@ -26,7 +26,7 @@ create table llx_socpeople
|
||||
fk_soc integer, -- lien vers la societe
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
|
||||
civilite varchar(6),
|
||||
civility varchar(6),
|
||||
lastname varchar(50),
|
||||
firstname varchar(50),
|
||||
address varchar(255),
|
||||
|
||||
@ -34,7 +34,7 @@ create table llx_user
|
||||
pass varchar(32),
|
||||
pass_crypted varchar(128),
|
||||
pass_temp varchar(32), -- temporary password when asked for forget password
|
||||
civilite varchar(6),
|
||||
civility varchar(6),
|
||||
lastname varchar(50),
|
||||
firstname varchar(50),
|
||||
address varchar(255), -- user personal address
|
||||
|
||||
@ -491,7 +491,7 @@ function getContactsForThirdParty($authentication,$idthirdparty)
|
||||
{
|
||||
$linesinvoice=array();
|
||||
|
||||
$sql = "SELECT c.rowid, c.fk_soc, c.civilite as civility_id, c.lastname, c.firstname, c.statut,";
|
||||
$sql = "SELECT c.rowid, c.fk_soc, c.civility as civility_id, c.lastname, c.firstname, c.statut,";
|
||||
$sql.= " c.address, c.zip, c.town,";
|
||||
$sql.= " c.fk_pays as country_id,";
|
||||
$sql.= " c.fk_departement,";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user