diff --git a/ChangeLog b/ChangeLog index 9509d17c800..811660a00b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,7 +31,8 @@ For developers: - Function plimit of databases drivers accept -1 as value (it means default value set into conf->liste_limit). - New: Add option dol_hide_topmenu and dol_hide_leftmenu onto login page. - +- New: dol_syslog method accept a suffix to use different log files for log. + For translators: - Update language files. diff --git a/build/debian/changelog b/build/debian/changelog index 1b4daf52782..4380b0a6b50 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -4,6 +4,6 @@ dolibarr (3.4.0+nmu1) unstable; urgency=low * New upstream release. closes: bug#634783 - -- Dolibarr team Mon, 14 Jan 2013 12:00:00 +0100 + -- Dolibarr team Thu, 28 Feb 2013 12:00:00 +0100 # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/launchpad/README b/build/launchpad/README index 489712e91f8..2334b01f1d7 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -96,11 +96,11 @@ https://launchpad.net/dolibarr/stable lp:dolibarr merge packaging lp:~yourlogin/+junk/debian-dev For beta: - # bzr-builder format 0.3 deb-version {debupstream}-0~{revno} + # bzr-builder format 0.3 deb-version {debupstream}-1~{revno} lp:dolibarr/beta merge packaging lp:~yourlogin/+junk/debian-beta For stable: - # bzr-builder format 0.3 deb-version {debupstream}-0~{revno} + # bzr-builder format 0.3 deb-version {debupstream}-2~{revno} lp:dolibarr/stable merge packaging lp:~yourlogin/+junk/debian-stable - Run command diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 50a24ea907a..d57b7ea093e 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -286,10 +286,10 @@ abstract class ActionsAdherentCardCommon } // Zip - $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6); + $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); // Town - $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id')); + $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','state_id')); if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id; @@ -300,7 +300,7 @@ abstract class ActionsAdherentCardCommon if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); // State - if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement,$this->object->country_code); + if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id,$this->object->country_code); else $this->tpl['select_state'] = $countrynotdefined; // Physical or Moral @@ -400,10 +400,8 @@ abstract class ActionsAdherentCardCommon $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; - $this->object->fk_pays = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; - $this->object->fk_departement = $_POST["departement_id"]; $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; - $this->object->state_id = $_POST["departement_id"]; + $this->object->state_id = $_POST["state_id"]; $this->object->phone_perso = $_POST["phone_perso"]; $this->object->phone_mobile = $_POST["phone_mobile"]; $this->object->email = $_POST["email"]; @@ -423,7 +421,6 @@ abstract class ActionsAdherentCardCommon { dol_print_error($this->db); } - $this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country_code = $obj->code; $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index 84cb06e2093..58ac61c13f2 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -76,7 +76,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors'] trans('State'); ?> - control->tpl['departement']; ?> + control->tpl['state']; ?> diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 13fc7f2488e..c45f1aed993 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -62,11 +62,11 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // requete en prenant que les adherents a jour de cotisation $sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,"; - $sql.= " d.address, d.zip, d.town, d.naiss, d.email, d.photo,"; + $sql.= " d.address, d.zip, d.town, d.country, d.naiss, d.email, d.photo,"; $sql.= " t.libelle as type,"; $sql.= " p.code as country_code, p.libelle as country"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; $sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1"; if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid; if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'"; @@ -111,7 +111,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // For backward compatibility '%SOCIETE%'=>$objp->company, '%ZIP%'=>$objp->zip, - '%PAYS%'=>$objp->country, + '%COUNTRY%'=>$objp->country, '%ANNEE%'=>$year, '%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/" // deprecated ); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c3be6de5ed8..8cced5bd052 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -56,14 +56,10 @@ class Adherent extends CommonObject var $state_id; // Id of department var $state_code; // Code of department var $state; // Label of department - var $fk_departement; // deprecated - var $departement_code; // deprecated - var $departement; // deprecated var $country_id; var $country_code; var $country; - var $pays; // deprecated var $email; var $phone; @@ -225,7 +221,7 @@ class Adherent extends CommonObject '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, - '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, + '%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, ); complete_substitutions_array($substitutionarray, $langs); @@ -396,8 +392,8 @@ class Adherent extends CommonObject $this->address=($this->address?$this->address:$this->address); $this->zip=($this->zip?$this->zip:$this->zip); $this->town=($this->town?$this->town:$this->town); - $this->country_id=($this->country_id > 0?$this->country_id:$this->fk_pays); - $this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement); + $this->country_id=($this->country_id > 0?$this->country_id:$this->country_id); + $this->state_id=($this->state_id > 0?$this->state_id:$this->state_id); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname=ucwords(trim($this->lastname)); if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname=ucwords(trim($this->firstname)); @@ -421,8 +417,8 @@ class Adherent extends CommonObject $sql.= ", address=" .($this->address?"'".$this->db->escape($this->address)."'":"null"); $sql.= ", zip=" .($this->zip?"'".$this->db->escape($this->zip)."'":"null"); $sql.= ", town=" .($this->town?"'".$this->db->escape($this->town)."'":"null"); - $sql.= ", pays=" .($this->country_id>0?"'".$this->country_id."'":"null"); - $sql.= ", fk_departement=".($this->state_id>0?"'".$this->state_id."'":"null"); + $sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null"); + $sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null"); $sql.= ", email='".$this->email."'"; $sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null"); $sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); @@ -1014,15 +1010,15 @@ class Adherent extends CommonObject $sql.= " d.datefin as datefin,"; $sql.= " d.naiss as datenaiss,"; $sql.= " d.datevalid as datev,"; - $sql.= " d.pays,"; - $sql.= " d.fk_departement,"; + $sql.= " d.country,"; + $sql.= " d.state_id,"; $sql.= " p.rowid as country_id, p.code as country_code, p.libelle as country,"; $sql.= " dep.nom as state, dep.code_departement as state_code,"; $sql.= " t.libelle as type, t.cotisation as cotisation,"; $sql.= " u.rowid as user_id, u.login as user_login"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.fk_departement = dep.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member"; $sql.= " WHERE d.fk_adherent_type = t.rowid"; if ($rowid) $sql.= " AND d.rowid=".$rowid; @@ -1054,12 +1050,9 @@ class Adherent extends CommonObject $this->zip = $obj->zip; $this->town = $obj->town; - $this->state_id = $obj->fk_departement; - $this->state_code = $obj->fk_departement?$obj->state_code:''; - $this->state = $obj->fk_departement?$obj->state:''; - $this->fk_departement = $obj->fk_departement; // deprecated - $this->departement_code = $obj->fk_departement?$obj->state_code:''; // deprecated - $this->departement = $obj->fk_departement?$obj->state:''; // deprecated + $this->state_id = $obj->state_id; + $this->state_code = $obj->state_id?$obj->state_code:''; + $this->state = $obj->state_id?$obj->state:''; $this->country_id = $obj->country_id; $this->country_code = $obj->country_code; @@ -1067,7 +1060,6 @@ class Adherent extends CommonObject $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code); else $this->country=$obj->country; - $this->pays = $this->country; // deprecated $this->phone = $obj->phone; $this->phone_perso = $obj->phone_perso; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 59b2a6e2402..0159f5d93d5 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -260,9 +260,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->address = trim($_POST["address"]); $object->zip = trim($_POST["zipcode"]); $object->town = trim($_POST["town"]); - $object->state_id = $_POST["departement_id"]; + $object->state_id = $_POST["state_id"]; $object->country_id = $_POST["country_id"]; - $object->fk_departement = $_POST["departement_id"]; // deprecated $object->phone = trim($_POST["phone"]); $object->phone_perso = trim($_POST["phone_perso"]); @@ -410,7 +409,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $address=$_POST["address"]; $zip=$_POST["zipcode"]; $town=$_POST["town"]; - $state_id=$_POST["departement_id"]; + $state_id=$_POST["state_id"]; $country_id=$_POST["country_id"]; $phone=$_POST["phone"]; @@ -435,7 +434,6 @@ if ($action == 'add' && $user->rights->adherent->creer) $object->address = $address; $object->zip = $zip; $object->town = $town; - $object->fk_departement = $state_id; $object->state_id = $state_id; $object->country_id = $country_id; $object->phone = $phone; @@ -721,14 +719,13 @@ else /* */ /* ************************************************************************** */ $object->canvas=$canvas; - $object->fk_departement = GETPOST('departement_id', 'int'); + $object->state_id = GETPOST('departement_id', 'int'); // We set country_id, country_code and country for the selected country $object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id; if ($object->country_id) { $tmparray=getCountry($object->country_id,'all'); - $object->pays=$tmparray['code']; $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; } @@ -834,9 +831,9 @@ else // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); print ' '; - print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','state_id')); print ''; // Country @@ -852,7 +849,7 @@ else print ''.$langs->trans('State').''; if ($object->country_id) { - print $formcompany->select_state(GETPOST('departement_id','int')?GETPOST('departement_id','int'):$object->fk_departement,$object->country_code); + print $formcompany->select_state(GETPOST('state_id','int')?GETPOST('state_id','int'):$object->state_id,$object->country_code); } else { @@ -944,9 +941,9 @@ else $adht->fetch($object->typeid); // We set country_id, and country_code, country of the chosen country - if (isset($_POST["pays"]) || $object->country_id) + if (isset($_POST["country"]) || $object->country_id) { - $sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["pays"])?$_POST["pays"]:$object->country_id); + $sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["country"])?$_POST["country"]:$object->country_id); $resql=$db->query($sql); if ($resql) { @@ -956,7 +953,6 @@ else { dol_print_error($db); } - $object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; $object->country_id=$obj->rowid; $object->country_code=$obj->code; $object->country=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; @@ -1085,9 +1081,9 @@ else // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print ''; // Country @@ -1101,7 +1097,7 @@ else if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''.$langs->trans('State').''; - print $formcompany->select_state($object->fk_departement,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id); + print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id); print ''; } @@ -1434,7 +1430,7 @@ else print ''; // State - print ''.$langs->trans('State').''.$object->departement.''; + print ''.$langs->trans('State').''.$object->state.''; // Tel pro. print ''.$langs->trans("PhonePro").''.dol_print_phone($object->phone,$object->country_code,0,$object->fk_soc,1).''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index fcb421e14fe..2595136a33e 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -71,7 +71,7 @@ if ($mode) $data = array(); $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.libelle as label"; - $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.pays = c.rowid"; + $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.country = c.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; $sql.=" GROUP BY c.libelle, c.code"; @@ -85,9 +85,9 @@ if ($mode) $data = array(); $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, c.nom as label2"; - $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.fk_departement = c.rowid"; + $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; $sql.=" GROUP BY p.libelle, p.code, c.nom"; @@ -102,7 +102,7 @@ if ($mode) $data = array(); $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; $sql.=" GROUP BY p.libelle, p.code, d.town"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 271318258ee..55ad5902e13 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -61,14 +61,14 @@ if ( ($action == 'update' && empty($_POST["cancel"])) $mysoc->country_label=$tmparray['label']; $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS", $s,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); } dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_DEPARTEMENT",$_POST["departement_id"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE",$_POST["state_id"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity); @@ -289,14 +289,14 @@ if ($action == 'edit' || $action == 'updateedit') // Country $var=!$var; print ''.$langs->trans("Country").''; - //if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation + //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''."\n"; $var=!$var; print ''.$langs->trans("State").''; - $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT,$mysoc->country_code,'departement_id'); + $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); print ''."\n"; $var=!$var; @@ -366,7 +366,7 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; - // Identifiants de la societe (propre au pays) + // Identifiants de la societe (country-specific) print ''; print ''; $var=true; @@ -667,7 +667,7 @@ else $var=!$var; print ''; @@ -731,7 +731,7 @@ else print '
'; - // Identifiants de la societe (propre au pays) + // Identifiants de la societe (country-specific) print ''; print ''; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT); + if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE); else print ' '; print '
'; @@ -860,7 +860,7 @@ else } else { - $s.='id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; } } print $s; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 77534fd0d76..a2b07ca2d11 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -157,7 +157,7 @@ jQuery(document).ready(function() { jQuery("#delconst").show(); jQuery("#action").val('delete'); }); - jQuery(".inputforupdate").keypress(function() { + jQuery(".inputforupdate").keyup(function() { // keypress does not support back var field_id = jQuery(this).attr("id"); var row_num = field_id.split("_"); jQuery("#updateconst").show(); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 4bd5a1029c8..3a8605f232b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -128,20 +128,20 @@ $tablib[24]= "DictionnaryAccountancysystem"; // Requete pour extraction des donnees des dictionnaires $tabsql=array(); -$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; -$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 pays, 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, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as pays, 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[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; +$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, code_region as code, 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[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 pays, 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[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 id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent"; $tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; -$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; +$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c'; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c"; -$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; +$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; @@ -155,20 +155,20 @@ $tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.c // Critere de tri du dictionnaire $tabsqlsort=array(); -$tabsqlsort[1] ="pays ASC, code ASC"; -$tabsqlsort[2] ="pays ASC, code ASC"; -$tabsqlsort[3] ="pays ASC, code ASC"; +$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[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC"; -$tabsqlsort[7] ="pays ASC, code ASC, a.libelle ASC"; +$tabsqlsort[7] ="country ASC, code ASC, a.libelle ASC"; $tabsqlsort[8] ="libelle ASC"; $tabsqlsort[9] ="label ASC"; -$tabsqlsort[10]="pays ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC"; +$tabsqlsort[10]="country ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC"; $tabsqlsort[11]="element ASC, source ASC, code ASC"; $tabsqlsort[12]="sortorder ASC, code ASC"; $tabsqlsort[13]="code ASC"; -$tabsqlsort[14]="pays ASC, e.organization ASC, code ASC"; +$tabsqlsort[14]="country ASC, e.organization ASC, code ASC"; $tabsqlsort[15]="rowid ASC"; $tabsqlsort[16]="sortorder ASC"; $tabsqlsort[17]="code ASC"; @@ -182,20 +182,20 @@ $tabsqlsort[24]="pcg_version ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[1] = "code,libelle,pays"; -$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,country_code-pays" -$tabfield[3] = "code,libelle,country_id,pays"; +$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[6] = "code,libelle,type,position"; -$tabfield[7] = "code,libelle,country_id,pays,accountancy_code,deductible"; +$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible"; $tabfield[8] = "code,libelle"; $tabfield[9] = "code,label,unicode"; -$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; +$tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfield[13]= "code,libelle,type"; -$tabfield[14]= "code,libelle,price,organization,country_id,pays"; +$tabfield[14]= "code,libelle,price,organization,country_id,country"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle"; $tabfield[17]= "code,libelle"; @@ -205,24 +205,24 @@ $tabfield[20]= "code,libelle"; $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; -$tabfield[24]= "pcg_version,country_id,pays,label"; +$tabfield[24]= "pcg_version,country_id,country,label"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[1] = "code,libelle,pays"; +$tabfieldvalue[1] = "code,libelle,country"; $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region" -$tabfieldvalue[3] = "code,libelle,pays"; +$tabfieldvalue[3] = "code,libelle,country"; $tabfieldvalue[4] = "code,libelle"; $tabfieldvalue[5] = "code,libelle"; $tabfieldvalue[6] = "code,libelle,type,position"; -$tabfieldvalue[7] = "code,libelle,pays,accountancy_code,deductible"; +$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible"; $tabfieldvalue[8] = "code,libelle"; $tabfieldvalue[9] = "code,label,unicode"; -$tabfieldvalue[10]= "pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; +$tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[11]= "element,source,code,libelle"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; $tabfieldvalue[13]= "code,libelle,type"; -$tabfieldvalue[14]= "code,libelle,price,organization,pays"; +$tabfieldvalue[14]= "code,libelle,price,organization,country"; $tabfieldvalue[15]= "code,libelle,width,height,unit"; $tabfieldvalue[16]= "code,libelle"; $tabfieldvalue[17]= "code,libelle"; @@ -232,7 +232,7 @@ $tabfieldvalue[20]= "code,libelle"; $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; $tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; -$tabfieldvalue[24]= "pcg_version,pays,label"; +$tabfieldvalue[24]= "pcg_version,country,label"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); @@ -390,9 +390,9 @@ if (GETPOST("id") == 10) "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"), "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"), "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"), - "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)", //$langs->trans("%ageOnServiceBeforeVAT"), - "7" => $langs->trans("Yes").' ('.$langs->trans("Type")." 7)" //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype + "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"), ); + if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype } $msg=''; @@ -409,7 +409,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'pays' && in_array('region_id',$listfield)) continue; // For region page, we do not require the country input + if ($value == 'country' && in_array('region_id',$listfield)) continue; // For region page, we do not require the country input if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ((! isset($_POST[$value]) || $_POST[$value]=='') @@ -443,7 +443,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; $msg.="Code can't contains value 0
"; } - if (isset($_POST["pays"]) && $_POST["pays"]=='0') { + if (isset($_POST["country"]) && $_POST["country"]=='0') { $ok=0; $msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'
'; } @@ -673,8 +673,8 @@ if ($id) if ($sortfield) { - // If sort order is "pays", we use country_code instead - if ($sortfield == 'pays') $sortfield='country_code'; + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; $sql.= " ORDER BY ".$sortfield; if ($sortorder) { @@ -728,7 +728,7 @@ if ($id) if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; } if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } - if ($fieldlist[$field]=='pays') { + if ($fieldlist[$field]=='country') { if (in_array('region_id',$fieldlist)) { print '
'; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } @@ -845,7 +845,7 @@ if ($id) if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; } if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } - if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); } + if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); } @@ -922,7 +922,7 @@ if ($id) else if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); } - else if ($fieldlist[$field]=='pays') { + else if ($fieldlist[$field]=='country') { if (empty($obj->country_code)) { $valuetoshow='-'; @@ -930,7 +930,7 @@ if ($id) else { $key=$langs->trans("Country".strtoupper($obj->country_code)); - $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->pays); + $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country); } } else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') { @@ -1193,10 +1193,10 @@ function fieldList($fieldlist,$obj='',$tabname='') foreach ($fieldlist as $field => $value) { - if ($fieldlist[$field] == 'pays') { + if ($fieldlist[$field] == 'country') { if (in_array('region_id',$fieldlist)) { print ''; continue; } // For region page, we do not show the country input print ''; } elseif ($fieldlist[$field] == 'country_id') { diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index a559b4f580e..457a32ec4ce 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -55,7 +55,7 @@ print $langs->trans("SetupDescription2")."

"; print '
'; //print '
'; -if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) $setupcompanynotcomplete=1; +if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit')); if (! empty($setupcompanynotcomplete)) { diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 464cf608e8c..fa4aa52bfc8 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -140,6 +140,9 @@ if (($action == 'send' || $action == 'sendhtml') && GETPOST('cancel')) if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GETPOST('addfilehtml') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { $error=0; + + + $email_from=''; if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' '; @@ -152,7 +155,12 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE $subject = $_POST['subject']; $body = $_POST['message']; $deliveryreceipt= $_POST["deliveryreceipt"]; - + + //Check if we have to decode HTML + if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) { + $body=dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401); + } + // Create form object include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 9da1d910c0f..b1532f5d7d7 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -247,12 +247,12 @@ if ($socid) print '"; // Country - if ($soc->pays) + if ($soc->country) { print ''; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index cf3be8898d7..802ebc59514 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -457,7 +457,8 @@ class ActionComm extends CommonObject //print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep); $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; - $sql.= " SET percent='".$this->percentage."'"; + $sql.= " SET percent = '".$this->percentage."'"; + if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->fk_action."'"; $sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null"); $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index f5fdb2cfabb..c7ac95111b1 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -309,6 +309,7 @@ if ($action == 'update') $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); + $actioncomm->fk_action = dol_getIdFromCode($db, $_POST["actioncode"], 'c_actioncomm'); $actioncomm->label = $_POST["label"]; $actioncomm->datep = $datep; $actioncomm->datef = $datef; @@ -467,16 +468,7 @@ if ($action == 'create') if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''; } else print ''; @@ -739,7 +731,9 @@ if ($id > 0) // Type if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''; + print ''; } // Title diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 0c09c953d9d..f996bb1cd93 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -205,7 +205,7 @@ if ($action == 'create') $object->note = $_POST["note"]; } - // On positionne country_id, country_code et libelle du pays choisi + // On positionne country_id, country_code and label of the chosen country $object->country_id = (GETPOST('country_id','int') ? GETPOST('country_id','int') : $mysoc->country_id); if ($object->country_id) { @@ -333,7 +333,7 @@ elseif ($action == 'edit') $object->fax = $_POST["fax"]; $object->note = $_POST["note"]; - // On positionne country_id, country_code et libelle du pays choisi + // On positionne country_id, country_code and label of the chosen country if ($object->country_id) { $tmparray=getCountry($object->country_id,'all'); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index ecae8acadac..896d29f05dd 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -179,6 +179,8 @@ class Mailing extends CommonObject */ function fetch($rowid) { + global $conf; + $sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage"; $sql.= ", m.email_from, m.email_replyto, m.email_errorsto"; $sql.= ", m.statut, m.nbemail"; @@ -203,8 +205,14 @@ class Mailing extends CommonObject $this->statut = $obj->statut; $this->nbemail = $obj->nbemail; $this->titre = $obj->titre; - $this->sujet = $obj->sujet; - $this->body = $obj->body; + + $this->sujet = $obj->sujet; + if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401))) { + $this->body = dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401); + }else { + $this->body = $obj->body; + } + $this->bgcolor = $obj->bgcolor; $this->bgimage = $obj->bgimage; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 727932c0f40..6684b2d0f0d 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -41,8 +41,8 @@ $socname = GETPOST("socname",'alpha'); $stcomm = GETPOST("stcomm",'int'); $search_nom = GETPOST("search_nom"); $search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_departement = GETPOST("search_departement"); +$search_town = GETPOST("search_town"); +$search_state = GETPOST("search_state"); $search_datec = GETPOST("search_datec"); $search_categ = GETPOST("search_categ",'int'); $catid = GETPOST("catid",'int'); @@ -195,7 +195,7 @@ if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'"; if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape(strtolower($search_town))."%'"; -if ($search_departement) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_departement))."%'"; +if ($search_state) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_state))."%'"; if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; // Insert levels filters if ($search_levels) @@ -318,7 +318,7 @@ if ($resql) print ''; print ''; print ''; print ''; - print "".''; + print "".''; print "".''; print "'; - print "".''; + print "".''; print "".''; print "".''; // Country - print "".''; + print "".''; // EMail print "".''; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 1521802a580..f1977f9f01a 100755 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -90,7 +90,7 @@ else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); -$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS); +$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.libelle,"; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index cbdb8b4da29..c3cb58526ad 100755 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -92,7 +92,7 @@ else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); -$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS); +$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,"; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index bc918816dc6..a0fb97d7158 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -432,7 +432,6 @@ abstract class ActionsContactCardCommon $this->object->address = $_POST["address"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; - $this->object->fk_pays = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $this->object->fk_departement = $_POST["departement_id"]; $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $this->object->state_id = $_POST["departement_id"]; @@ -459,7 +458,7 @@ abstract class ActionsContactCardCommon { dol_print_error($this->db); } - $this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; + $this->object->country_id = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country_code = $obj->code; $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 7b605130995..58183a3df25 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -53,8 +53,6 @@ class Contact extends CommonObject var $state_code; // Code of department var $state; // Label of department - var $fk_pays; // deprecated - var $pays; // deprecated var $country_id; // Id of country var $country_code; // Code of country var $country; // Label of country @@ -222,7 +220,7 @@ class Contact extends CommonObject $this->fax=trim($this->fax); $this->zip=($this->zip?$this->zip:$this->zip); $this->town=($this->town?$this->town:$this->town); - $this->country_id=($this->country_id > 0?$this->country_id:$this->fk_pays); + $this->country_id=($this->country_id > 0?$this->country_id:$this->country_id); $this->state_id=($this->state_id > 0?$this->state_id:$this->fk_departement); $this->db->begin(); @@ -490,7 +488,7 @@ class Contact extends CommonObject $sql.= " p.libelle as country, p.code as country_code,"; $sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " u.rowid as user_id, u.login as user_login,"; - $sql.= " s.nom as socname, s.address as socaddress, s.cp as soccp, s.town as soccity, s.default_lang as socdefault_lang"; + $sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid"; @@ -522,10 +520,8 @@ class Contact extends CommonObject $this->departement = $obj->state; // deprecated $this->state = $obj->state; - $this->fk_pays = $obj->country_id; $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; - $this->pays = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; $this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; $this->socid = $obj->fk_soc; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 1bd291b5f25..80277c904ad 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -585,7 +585,6 @@ else if (isset($_POST["country_id"]) || $object->country_id) { $tmparray=getCountry($object->country_id,'all'); - $object->pays = $tmparray['label']; $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; } @@ -890,7 +889,7 @@ else print ''; // State diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index be1b820cb60..683be86bb08 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -54,8 +54,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE"); $v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE"); $v->setPhoneNumber($contact->fax, "WORK;FAX"); -$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK;POSTAL"); -$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK"); +$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL"); +$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK"); $v->setEmail($contact->email,'internet,pref'); $v->setNote($contact->note); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 99f7560a15e..08202a597ec 100755 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -99,7 +99,7 @@ class box_contacts extends ModeleBoxes 'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid); $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' => $contactstatic->getFullName($langs,1), + 'text' => $contactstatic->getFullName($langs,0), 'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid); $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 84b59c1667f..9256e08318c 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -169,6 +169,9 @@ class DolEditor //$skin='office2003'; //$skin='v2'; $skin='kama'; + + if ($this->toolbarname=='dolibarr_mailings') {$htmlencode_force='true';} + else {$htmlencode_force='false';} $out.= '
  '; - print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->pays)?$obj->pays:'')), 'pays', '', 28); + print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28); print ''.$langs->trans('Town').''.$soc->town."
'.$langs->trans('Country').''; $img=picto_from_langcode($soc->country_code); print ($img?$img.' ':''); - print $soc->pays; + print $soc->country; print '
'.$langs->trans("Type").''; - if (GETPOST("actioncode")) - { - print ''."\n"; - $cactioncomm->fetch(GETPOST("actioncode")); - print $cactioncomm->getNomUrl(); - } - else - { - $htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto"); - } + $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$actioncomm->type_code, "actioncode","systemauto"); print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Type").''; + $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$act->type_code, "actioncode","systemauto"); + print '
'; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 6e4dbbeba0c..31d929dfed5 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -65,8 +65,8 @@ if ($action == 'update' && ! $_POST["cancel"]) $account->domiciliation = trim($_POST["domiciliation"]); $account->proprio = trim($_POST["proprio"]); $account->owner_address = trim($_POST["owner_address"]); - $account->fk_departement = trim($_POST["fk_departement"]); - //$account->fk_pays = trim($_POST["fk_pays"]); // We do not change this. + $account->state_id = trim($_POST["state_id"]); + //$account->country_id = trim($_POST["country_id"]); // We do not change this. if ($account->id) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index fa6b412c457..21a669d618a 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -62,16 +62,10 @@ class Account extends CommonObject var $proprio; var $owner_address; - - var $fk_departement; // deprecated - var $departement_code; // deprecated - var $departement; // deprecated var $state_id; var $state_code; var $state; - var $fk_pays; // deprecated - var $pays; // deprecated var $country_id; var $country_code; var $country; @@ -353,8 +347,8 @@ class Account extends CommonObject // Clean parameters if (! $this->min_allowed) $this->min_allowed=0; if (! $this->min_desired) $this->min_desired=0; - $this->state_id = ($this->state_id?$this->state_id:$this->fk_departement); - $this->country_id = ($this->country_id?$this->country_id:$this->fk_pays); + $this->state_id = ($this->state_id?$this->state_id:$this->state_id); + $this->country_id = ($this->country_id?$this->country_id:$this->country_id); // Check parameters if (empty($this->country_id)) @@ -392,7 +386,7 @@ class Account extends CommonObject $sql.= ", min_allowed"; $sql.= ", min_desired"; $sql.= ", comment"; - $sql.= ", fk_departement"; + $sql.= ", state_id"; $sql.= ", fk_pays"; $sql.= ") VALUES ("; $sql.= "'".$this->db->idate($now)."'"; @@ -477,8 +471,8 @@ class Account extends CommonObject // Clean parameters if (! $this->min_allowed) $this->min_allowed=0; if (! $this->min_desired) $this->min_desired=0; - $this->state_id = ($this->state_id?$this->state_id:$this->fk_departement); - $this->country_id = ($this->country_id?$this->country_id:$this->fk_pays); + $this->state_id = ($this->state_id?$this->state_id:$this->state_id); + $this->country_id = ($this->country_id?$this->country_id:$this->country_id); // Check parameters if (empty($this->country_id)) @@ -512,7 +506,7 @@ class Account extends CommonObject $sql.= ",min_desired = '".price2num($this->min_desired)."'"; $sql.= ",comment = '".$this->db->escape($this->comment)."'"; - $sql.= ",fk_departement = ".($this->state_id>0?"'".$this->state_id."'":"null"); + $sql.= ",state_id = ".($this->state_id>0?"'".$this->state_id."'":"null"); $sql.= ",fk_pays = ".$this->country_id; $sql.= " WHERE rowid = ".$this->id; @@ -544,8 +538,8 @@ class Account extends CommonObject global $conf,$langs; // Clean parameters - $this->state_id = ($this->state_id?$this->state_id:$this->fk_departement); - $this->country_id = ($this->country_id?$this->country_id:$this->fk_pays); + $this->state_id = ($this->state_id?$this->state_id:$this->state_id); + $this->country_id = ($this->country_id?$this->country_id:$this->country_id); // Chargement librairie pour acces fonction controle RIB require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; @@ -570,7 +564,7 @@ class Account extends CommonObject $sql.= ",domiciliation='".$this->db->escape($this->domiciliation)."'"; $sql.= ",proprio = '".$this->db->escape($this->proprio)."'"; $sql.= ",owner_address = '".$this->db->escape($this->owner_address)."'"; - $sql.= ",fk_departement = ".($this->state_id>0?"'".$this->state_id."'":"null"); + $sql.= ",state_id = ".($this->state_id>0?"'".$this->state_id."'":"null"); $sql.= ",fk_pays = ".$this->country_id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; @@ -610,14 +604,14 @@ class Account extends CommonObject $sql = "SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url,"; $sql.= " ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban,"; - $sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.fk_departement, ba.fk_pays as country_id,"; + $sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.state_id, ba.fk_pays as country_id,"; $sql.= " ba.account_number, ba.currency_code,"; $sql.= " ba.min_allowed, ba.min_desired, ba.comment,"; $sql.= ' p.code as country_code, p.libelle as country,'; $sql.= ' d.code_departement as state_code, d.nom as state'; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.fk_departement = d.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid'; $sql.= " WHERE entity = ".$conf->entity; if ($id) $sql.= " AND ba.rowid = ".$id; if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'"; @@ -652,15 +646,10 @@ class Account extends CommonObject $this->proprio = $obj->proprio; $this->owner_address = $obj->owner_address; - $this->fk_departement = $obj->fk_departement; // deprecated - $this->departement_code= $obj->state_code; // deprecated - $this->departement = $obj->state; // deprecated - $this->state_id = $obj->fk_departement; + $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; $this->state = $obj->state; - $this->fk_pays = $obj->country_id; // deprecated - $this->pays = $obj->country; // deprecated $this->country_id = $obj->country_id; $this->country_code = $obj->country_code; $this->country = $obj->country; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index fe251cae5cb..b811e35f7d7 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -69,8 +69,8 @@ if ($_POST["action"] == 'add') $account->currency_code = trim($_POST["account_currency_code"]); - $account->fk_departement = $_POST["account_departement_id"]; - $account->fk_pays = $_POST["account_country_id"]; + $account->state_id = $_POST["account_departement_id"]; + $account->country_id = $_POST["account_country_id"]; $account->min_allowed = $_POST["account_min_allowed"]; $account->min_desired = $_POST["account_min_desired"]; @@ -140,7 +140,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) $account->currency_code = trim($_POST["account_currency_code"]); - $account->state_id = $_POST["account_departement_id"]; + $account->state_id = $_POST["account_state_id"]; $account->country_id = $_POST["account_country_id"]; $account->min_allowed = $_POST["account_min_allowed"]; @@ -282,7 +282,7 @@ if ($action == 'create') print '
'.$langs->trans('State').''; if ($selectedcode) { - $formcompany->select_departement(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:'',$selectedcode,'account_departement_id'); + $formcompany->select_departement(isset($_POST["account_state_id"])?$_POST["account_state_id"]:'',$selectedcode,'account_state_id'); } else { @@ -407,7 +407,7 @@ else // Country print '
'.$langs->trans("BankAccountCountry").''; - if ($account->fk_pays > 0) + if ($account->country_id > 0) { $img=picto_from_langcode($account->country_code); print $img?$img.' ':''; @@ -555,7 +555,7 @@ else print '
'.$langs->trans('State').''; if ($selectedcode) { - print $formcompany->select_state(isset($_POST["account_departement_id"])?$_POST["account_departement_id"]:$account->fk_departement,$selectedcode,'account_departement_id'); + print $formcompany->select_state(isset($_POST["account_state_id"])?$_POST["account_state_id"]:$account->state_id,$selectedcode,'account_state_id'); } else { diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index a03f2cd8f5e..9ca97617db6 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -45,7 +45,7 @@ class Don extends CommonObject var $address; var $zip; var $town; - var $pays; + var $country; var $email; var $public; var $fk_project; @@ -300,8 +300,8 @@ class Don extends CommonObject $this->address=($this->address>0?$this->address:$this->address); $this->zip=($this->zip>0?$this->zip:$this->zip); $this->town=($this->town>0?$this->town:$this->town); - $this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays); - $this->country=($this->country?$this->country:$this->pays); + $this->country_id=($this->country_id>0?$this->country_id:$this->country_id); + $this->country=($this->country?$this->country:$this->country); $now=dol_now(); @@ -316,7 +316,7 @@ class Don extends CommonObject $sql.= ", address"; $sql.= ", zip"; $sql.= ", town"; - $sql.= ", pays"; + $sql.= ", country"; $sql.= ", public"; $sql.= ", fk_don_projet"; $sql.= ", note"; @@ -385,8 +385,8 @@ class Don extends CommonObject $this->address=($this->address>0?$this->address:$this->address); $this->zip=($this->zip>0?$this->zip:$this->zip); $this->town=($this->town>0?$this->town:$this->town); - $this->country_id=($this->country_id>0?$this->country_id:$this->fk_pays); - $this->country=($this->country?$this->country:$this->pays); + $this->country_id=($this->country_id>0?$this->country_id:$this->country_id); + $this->country=($this->country?$this->country:$this->country); $sql = "UPDATE ".MAIN_DB_PREFIX."don SET "; $sql .= "amount = " . price2num($this->amount); @@ -397,7 +397,7 @@ class Don extends CommonObject $sql .= ",address='".$this->db->escape($this->address)."'"; $sql .= ",zip='".$this->db->escape($this->zip)."'"; $sql .= ",town='".$this->db->escape($this->town)."'"; - $sql .= ",pays='".$this->db->escape($this->country)."'"; // TODO use country_id + $sql .= ",country='".$this->db->escape($this->country)."'"; // TODO use country_id $sql .= ",public=".$this->public; $sql .= ",fk_don_projet=".($this->fk_project>0?$this->fk_project:'null'); $sql .= ",note='".$this->db->escape($this->note)."'"; @@ -463,7 +463,7 @@ class Don extends CommonObject global $conf; $sql = "SELECT d.rowid, d.datec, d.tms as datem, d.datedon,"; - $sql.= " d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.phone, d.phone_mobile, d.fk_don_projet,"; + $sql.= " d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, d.country, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.phone, d.phone_mobile, d.fk_don_projet,"; $sql.= " p.title as project_label"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_don_projet"; @@ -491,10 +491,10 @@ class Don extends CommonObject $this->town = $obj->town; $this->zip = $obj->zip; $this->town = $obj->town; + $this->country = $obj->country; $this->email = $obj->email; $this->phone = $obj->phone; $this->phone_mobile = $obj->phone_mobile; - $this->pays = $obj->pays; $this->projet = $obj->project_label; $this->fk_project = $obj->fk_don_projet; $this->public = $obj->public; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 9c4715cc406..7057b97f21e 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -92,11 +92,10 @@ if ($action == 'update') $don->amount = price2num($_POST["amount"]); $don->town = $_POST["town"]; $don->zip = $_POST["zipcode"]; - $don->town = $_POST["town"]; + $don->country = $_POST["country"]; $don->email = $_POST["email"]; $don->date = $donation_date; $don->note = $_POST["note"]; - $don->pays = $_POST["pays"]; $don->public = $_POST["public"]; $don->fk_project = $_POST["projectid"]; $don->note = $_POST["comment"]; @@ -144,10 +143,10 @@ if ($action == 'add') $don->town = $_POST["town"]; $don->zip = $_POST["zipcode"]; $don->town = $_POST["town"]; + $don->country = $_POST["country"]; $don->email = $_POST["email"]; $don->date = $donation_date; $don->note = $_POST["note"]; - $don->pays = $_POST["pays"]; $don->public = $_POST["public"]; $don->fk_project = $_POST["projectid"]; $don->note = $_POST["comment"]; @@ -302,12 +301,12 @@ if ($action == 'create') // Zip / Town print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6); print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans("Country").'
'.$langs->trans("Country").'
'.$langs->trans("EMail").'
".$langs->trans("PaymentMode")."\n"; @@ -392,12 +391,12 @@ if (! empty($id) && $action == 'edit') // Zip / Town print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','departement_id'),6); + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6); print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','departement_id')); + print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans("Country").'
'.$langs->trans("Country").'
'.$langs->trans("EMail").'
".$langs->trans("PaymentMode")."\n"; @@ -489,7 +488,7 @@ if (! empty($id) && $action != 'edit') print "
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$don->zip.($don->zip && $don->town?' / ':'').$don->town.'
'.$langs->trans("Country").''.$don->pays.'
'.$langs->trans("Country").''.$don->country.'
'.$langs->trans("EMail").''.dol_print_email($don->email).'
'.$langs->trans("Country").''; $img=picto_from_langcode($object->country_code); if ($img) print $img.' '; - print $object->pays; + print $object->country_id; print '