diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index c9ebfbf8499..ca23640aa4a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -75,7 +75,7 @@ $tabname[17]= MAIN_DB_PREFIX."c_type_fees"; $tabname[18]= MAIN_DB_PREFIX."c_shipment_mode"; $tabname[19]= MAIN_DB_PREFIX."c_effectif"; $tabname[20]= MAIN_DB_PREFIX."c_methode_commande_fournisseur"; -$tabname[21]= MAIN_DB_PREFIX."c_delivery"; +$tabname[21]= MAIN_DB_PREFIX."c_availability"; // Dictionary labels $tablib[1] = "DictionnaryCompanyJuridicalType"; @@ -98,7 +98,7 @@ $tablib[17]= "DictionnaryFees"; $tablib[18]= "DictionnarySendingMethods"; $tablib[19]= "DictionnaryStaff"; $tablib[20]= "DictionnaryOrderMethods"; -$tablib[21]= "DictionnaryDelivery"; +$tablib[21]= "DictionnaryAvailability"; // Requete pour extraction des donnees des dictionnaires $tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_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"; @@ -121,7 +121,7 @@ $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode"; $tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif"; $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; -$tabsql[21]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_delivery"; +$tabsql[21]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability"; // Critere de tri du dictionnaire $tabsqlsort[1] ="pays ASC, code ASC"; @@ -144,7 +144,7 @@ $tabsqlsort[17]="code ASC"; $tabsqlsort[18]="code ASC, libelle ASC"; $tabsqlsort[19]="id ASC"; $tabsqlsort[20]="code ASC, libelle ASC"; -$tabsqlsort[21]="code ASC, libelle ASC"; +$tabsqlsort[21]="code ASC, label ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield[1] = "code,libelle,pays"; @@ -167,7 +167,7 @@ $tabfield[17]= "code,libelle"; $tabfield[18]= "code,libelle"; $tabfield[19]= "code,libelle"; $tabfield[20]= "code,libelle"; -$tabfield[21]= "code,libelle"; +$tabfield[21]= "code,label"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue[1] = "code,libelle,pays"; @@ -190,7 +190,7 @@ $tabfieldvalue[17]= "code,libelle"; $tabfieldvalue[18]= "code,libelle"; $tabfieldvalue[19]= "code,libelle"; $tabfieldvalue[20]= "code,libelle"; -$tabfieldvalue[21]= "code,libelle"; +$tabfieldvalue[21]= "code,label"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert[1] = "code,libelle,fk_pays"; @@ -213,7 +213,7 @@ $tabfieldinsert[17]= "code,libelle"; $tabfieldinsert[18]= "code,libelle"; $tabfieldinsert[19]= "code,libelle"; $tabfieldinsert[20]= "code,libelle"; -$tabfieldinsert[21]= "code,libelle"; +$tabfieldinsert[21]= "code,label"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index d0811d31141..0cff46ff37b 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -232,11 +232,11 @@ if ($_POST['action'] == 'setaddress' && $user->rights->propale->creer) if ($result < 0) dol_print_error($db,$object->error); } -//delai de livraison -if ($_POST['action'] == 'setdelivery' && $user->rights->propale->creer) +// Availability +if ($_POST['action'] == 'setavailability' && $user->rights->propale->creer) { $object->fetch($_GET["id"]); - $result=$object->set_delivery($user,$_POST['delivery']); + $result=$object->set_availability($user,$_POST['fk_availability']); if ($result < 0) dol_print_error($db,$object->error); } @@ -265,7 +265,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer) $object->ref = $_POST['ref']; $object->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $object->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']); - $object->delivery = $_POST['delivery']; + $object->fk_availability = $_POST['fk_availability']; $object->fk_delivery_address = $_POST['fk_address']; $object->duree_validite = $_POST['duree_validite']; $object->cond_reglement_id = $_POST['cond_reglement_id']; @@ -293,7 +293,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer) $object->ref_client = $_POST['ref_client']; $object->datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $object->date_livraison = dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']); - $object->delivery = $_POST['delivery']; + $object->fk_availability = $_POST['fk_availability']; $object->fk_delivery_address = $_POST['fk_address']; $object->duree_validite = $_POST['duree_validite']; $object->cond_reglement_id = $_POST['cond_reglement_id']; @@ -1271,21 +1271,21 @@ if ($id > 0 || ! empty($ref)) print ''; } - // Delivery + // Availability print ''; print ''; - if ($_GET['action'] != 'editdelivery' && $object->brouillon) print ''; + if ($_GET['action'] != 'editavailability' && $object->brouillon) print ''; print '
'; - print $langs->trans('DeliveryPeriod'); + print $langs->trans('AvailabilityPeriod'); print 'id.'">'.img_edit($langs->trans('SetDelivery'),1).'id.'">'.img_edit($langs->trans('SetAvailability'),1).'
'; print ''; - if ($_GET['action'] == 'editdelivery') + if ($_GET['action'] == 'editavailability') { - $html->form_delivery($_SERVER['PHP_SELF'].'?id='.$object->id,$object->delivery,'delivery'); + $html->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_availability,'availability'); } else { - $html->form_delivery($_SERVER['PHP_SELF'].'?id='.$object->id,$object->delivery,'none'); + $html->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_availability,'none'); } print ''; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b9362757d45..ca08ba00a71 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -95,7 +95,7 @@ class Propal extends CommonObject var $fk_address; var $address_type; var $adresse; - var $delivery; + var $fk_availability; var $products=array(); @@ -618,7 +618,7 @@ class Propal extends CommonObject $sql.= ", fk_mode_reglement"; $sql.= ", ref_client"; $sql.= ", date_livraison"; - $sql.= ", delivery"; + $sql.= ", fk_availability"; $sql.= ", entity"; $sql.= ") "; $sql.= " VALUES ("; @@ -641,7 +641,7 @@ class Propal extends CommonObject $sql.= ", ".$this->mode_reglement_id; $sql.= ", '".$this->db->escape($this->ref_client)."'"; $sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":'null'); - $sql.= ", ".$this->delivery; + $sql.= ", ".$this->fk_availability; $sql.= ", ".$conf->entity; $sql.= ")"; @@ -904,7 +904,7 @@ class Propal extends CommonObject $sql.= ", datep as dp"; $sql.= ", fin_validite as dfv"; $sql.= ", date_livraison as date_livraison"; - $sql.= ", delivery"; + $sql.= ", fk_availability"; $sql.= ", model_pdf, ref_client"; $sql.= ", note, note_public"; $sql.= ", fk_projet, fk_statut"; @@ -958,7 +958,7 @@ class Propal extends CommonObject $this->datep = $this->db->jdate($obj->dp); $this->fin_validite = $this->db->jdate($obj->dfv); $this->date_livraison = $this->db->jdate($obj->date_livraison); - $this->delivery = $obj->delivery; + $this->fk_availability = $obj->fk_availability; $this->fk_delivery_address = $obj->fk_adresse_livraison; // TODO obsolete $this->fk_address = $obj->fk_adresse_livraison; @@ -1237,23 +1237,23 @@ class Propal extends CommonObject * \param delivery delai de livraison * \return int <0 si ko, >0 si ok */ - function set_delivery($user, $delivery) + function set_availability($user, $id) { if ($user->rights->propale->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."propal "; - $sql.= " SET delivery = '".$delivery."'"; + $sql.= " SET fk_availability = '".$id."'"; $sql.= " WHERE rowid = ".$this->id; if ($this->db->query($sql)) { - $this->delivery = $delivery; + $this->fk_availability = $id; return 1; } else { $this->error=$this->db->error(); - dol_syslog("Propal::set_delivery Erreur SQL"); + dol_syslog("Propal::set_availability Erreur SQL"); return -1; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0faad6e7019..72207253463 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1491,17 +1491,17 @@ class Form * \brief Charge dans cache la liste des délais de livraison possibles * \return int Nb lignes chargees, 0 si deja chargees, <0 si ko */ - function load_cache_delivery() + function load_cache_availability() { global $langs; - if (sizeof($this->cache_delivery)) return 0; // Cache deja charge + if (sizeof($this->cache_availability)) return 0; // Cache deja charge - $sql = "SELECT rowid, code, libelle"; - $sql.= " FROM ".MAIN_DB_PREFIX.'c_delivery'; + $sql = "SELECT rowid, code, label"; + $sql.= " FROM ".MAIN_DB_PREFIX.'c_availability'; $sql.= " WHERE active=1"; $sql.= " ORDER BY rowid"; - dol_syslog('Form::load_cache_delivery sql='.$sql,LOG_DEBUG); + dol_syslog('Form::load_cache_availability sql='.$sql,LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1512,9 +1512,9 @@ class Form $obj = $this->db->fetch_object($resql); // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $libelle=($langs->trans("DeliveryType".$obj->code)!=("DeliveryType".$obj->code)?$langs->trans("DeliveryType".$obj->code):($obj->libelle!='-'?$obj->libelle:'')); - $this->cache_delivery[$obj->rowid]['code'] =$obj->code; - $this->cache_delivery[$obj->rowid]['label']=$libelle; + $label=($langs->trans("AvailabilityType".$obj->code)!=("AvailabilityType".$obj->code)?$langs->trans("AvailabilityType".$obj->code):($obj->label!='-'?$obj->label:'')); + $this->cache_availability[$obj->rowid]['code'] =$obj->code; + $this->cache_availability[$obj->rowid]['label']=$label; $i++; } return 1; @@ -1532,15 +1532,15 @@ class Form * \param filtertype Pour filtre * \param addempty Ajoute entree vide */ - function select_delivery($selected='',$htmlname='delivery',$filtertype='',$addempty=0) + function select_availability($selected='',$htmlname='availability',$filtertype='',$addempty=0) { global $langs,$user; - $this->load_cache_delivery(); + $this->load_cache_availability(); print ''; @@ -2136,17 +2136,17 @@ class Form * \param htmlname Name of select html field * \param addempty Ajoute entree vide */ - function form_delivery($page, $selected='', $htmlname='delivery', $addempty=0) + function form_availability($page, $selected='', $htmlname='availability', $addempty=0) { global $langs; if ($htmlname != "none") { print '
'; - print ''; + print ''; print ''; print ''; print ''; print ''; print '
'; - $this->select_delivery($selected,$htmlname,-1,$addempty); + $this->select_availability($selected,$htmlname,-1,$addempty); print '
'; @@ -2155,8 +2155,8 @@ class Form { if ($selected) { - $this->load_cache_delivery(); - print $this->cache_delivery[$selected]['label']; + $this->load_cache_availability(); + print $this->cache_availability[$selected]['label']; } else { print " "; } diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql index b1c1ce59851..b6f5a9abdba 100755 --- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql +++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql @@ -51,6 +51,7 @@ create table llx_c_availability active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; + ALTER TABLE llx_propal ADD COLUMN fk_availability integer DEFAULT 0 AFTER fk_adresse_livraison; ALTER TABLE llx_propal CHANGE COLUMN delivery fk_availability integer DEFAULT 0; -ALTER TABLE llx_availability CHANGE COLUMN libelle label integer varchar(60) NOT NULL; +ALTER TABLE llx_availability CHANGE COLUMN libelle label varchar(60) NOT NULL; diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index e6572ecd5d4..94e356b7558 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -80,8 +80,8 @@ ClonePropal=Cloner proposition commerciale ConfirmClonePropal=Êtes-vous sûr de vouloir cloner cette proposition commerciale %s ? ProposalsAndProposalsLines=Propositions commerciales clientes et lignes de propositions ProposalLine=Ligne de proposition -DeliveryPeriod=Délai de livraison (à réception de commande) -SetDelivery=Définir le délai de livraison +AvailabilityPeriod=Délai de livraison (à réception de commande) +SetAvailability=Définir le délai de livraison ##### Types de contacts ##### TypeContact_propal_internal_SALESREPFOLL=Commercial suivi propale TypeContact_propal_external_BILLING=Contact client facturation propale