diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 7063f7fd53e..f75fa48f544 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -323,11 +323,11 @@ if ($result) { if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { if ($reg[1] == 'socialcontribution') $reg[1] = 'SocialContribution'; - $chargestatic->lib = $langs->trans($reg[1]); + $chargestatic->label = $langs->trans($reg[1]); } else { - $chargestatic->lib = $links[$key]['label']; + $chargestatic->label = $links[$key]['label']; } - $chargestatic->ref = $chargestatic->lib; + $chargestatic->ref = $chargestatic->label; $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 57031a9822f..a209a5f5590 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -208,7 +208,7 @@ print ''.$langs->trans("Example").''; print ''.$langs->trans("CodeBarGenerator").''; print "\n"; -$sql = "SELECT rowid, code as encoding, libelle, coder, example"; +$sql = "SELECT rowid, code as encoding, libelle as label, coder, example"; $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; $sql.= " WHERE entity = ".$conf->entity; $sql.= " ORDER BY code"; @@ -225,7 +225,7 @@ if ($resql) $obj = $db->fetch_object($resql); print ''; - print $obj->libelle; + print $obj->label; print "\n"; print $langs->trans('BarcodeDesc'.$obj->encoding); //print "L'EAN se compose de 8 caracteres, 7 chiffres plus une cle de controle.
"; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8432ba786a1..b1b4fc83be8 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1344,7 +1344,6 @@ class ActionComm extends CommonObject $linkstart = ''; $linkend = ''; } - //print 'rrr'.$this->libelle.'rrr'.$this->label.'rrr'.$withpicto; if ($withpicto == 2) { @@ -1463,7 +1462,7 @@ class ActionComm extends CommonObject $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql.= " u.firstname, u.lastname, u.email,"; $sql.= " s.nom as socname,"; - $sql.= " c.id as type_id, c.code as type_code, c.libelle"; + $sql.= " c.id as type_id, c.code as type_code, c.libelle as type_label"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; @@ -1568,7 +1567,7 @@ class ActionComm extends CommonObject $event['location']=$obj->location; $event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy) $event['punctual']=$obj->punctual; - $event['category']=$obj->libelle; // libelle type action + $event['category']=$obj->type_label; $event['email']=$obj->email; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 569b57ca552..3b2e334e2ef 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -614,7 +614,7 @@ if ($resql) $event->type_label=$obj->type_label; $event->type_color=$obj->type_color; - $event->libelle=$obj->label; + $event->libelle=$obj->label; // deprecated $event->label=$obj->label; $event->percentage=$obj->percent; $event->authorid=$obj->fk_user_author; // user id of creator @@ -720,7 +720,7 @@ if ($showbirthday) $event->datep=dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true); // For full day events, date are also GMT but they wont but converted during output $event->datef=$event->datep; $event->type_code='BIRTHDAY'; - $event->libelle=$langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname); + $event->label=$langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname); $event->percentage=100; $event->fulldayevent=1; @@ -949,9 +949,9 @@ if (count($listofextcals)) $event->datef=$dateend+$usertime; $event->type_code="ICALEVENT"; - if($icalevent['SUMMARY']) $event->libelle=$icalevent['SUMMARY']; - elseif($icalevent['DESCRIPTION']) $event->libelle=dol_nl2br($icalevent['DESCRIPTION'], 1); - else $event->libelle = $langs->trans("ExtSiteNoLabel"); + if($icalevent['SUMMARY']) $event->label=$icalevent['SUMMARY']; + elseif($icalevent['DESCRIPTION']) $event->label=dol_nl2br($icalevent['DESCRIPTION'], 1); + else $event->label = $langs->trans("ExtSiteNoLabel"); $event->date_start_in_calendar=$event->datep; @@ -1554,7 +1554,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show title $titletoshow = $daterange; - $titletoshow.=($titletoshow?' ':'').$event->libelle; + $titletoshow.=($titletoshow?' ':'').($event->label?$event->label:$event->libelle); if ($event->type_code == 'ICALEVENT') print $titletoshow; else diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 286863c7dc6..15d98465e3c 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -616,12 +616,12 @@ $typeofevents=array(); // Load array of colors by type $colorsbytype=array(); $labelbytype=array(); -$sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm"; +$sql="SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position"; $resql=$db->query($sql); while ($obj = $db->fetch_object($resql)) { $colorsbytype[$obj->code]=$obj->color; - $labelbytype[$obj->code]=$obj->libelle; + $labelbytype[$obj->code]=$obj->label; } // Loop on each user to show calendar diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index ce577de78bd..fe125820daf 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -752,12 +752,12 @@ while($currentdaytoshow<$lastdaytoshow) { // Load array of colors by type $colorsbytype=array(); $labelbytype=array(); - $sql="SELECT code, color, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position"; + $sql="SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX."c_actioncomm ORDER BY position"; $resql=$db->query($sql); while ($obj = $db->fetch_object($resql)) { $colorsbytype[$obj->code]=$obj->color; - $labelbytype[$obj->code]=$obj->libelle; + $labelbytype[$obj->code]=$obj->label; } // Loop on each user to show calendar diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 7b9b29ce100..cac784ba8f9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1695,13 +1695,13 @@ class Propal extends CommonObject $line->fk_product = $objp->fk_product; - $line->ref = $objp->product_ref; // TODO deprecated + $line->ref = $objp->product_ref; // deprecated $line->product_ref = $objp->product_ref; - $line->libelle = $objp->product_label; // TODO deprecated + $line->libelle = $objp->product_label; // deprecated $line->product_label = $objp->product_label; $line->product_desc = $objp->product_desc; // Description produit $line->product_tobatch = $objp->product_tobatch; - $line->fk_product_type = $objp->fk_product_type; // TODO deprecated + $line->fk_product_type = $objp->fk_product_type; // deprecated $line->fk_unit = $objp->fk_unit; $line->weight = $objp->weight; $line->weight_units = $objp->weight_units; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index cec68cf2c3a..a9294474115 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -258,7 +258,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) { $socialcontribstatic->ref=$obj->ref; $socialcontribstatic->id=$obj->objid; - $socialcontribstatic->lib=$obj->type; + $socialcontribstatic->label=$obj->type; $ref = $socialcontribstatic->getNomUrl(1, 24); $totalpayment = -1*$socialcontribstatic->getSommePaiement(); // Payment already done diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8859578e94b..20459641d66 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1127,7 +1127,7 @@ class Facture extends CommonInvoice { $line = new FactureLigne($this->db); - $line->libelle = $object->lines[$i]->libelle; + $line->libelle = $object->lines[$i]->libelle; // deprecated $line->label = $object->lines[$i]->label; $line->desc = $object->lines[$i]->desc; $line->subprice = $object->lines[$i]->subprice; @@ -1551,7 +1551,7 @@ class Facture extends CommonInvoice $line->product_type = $objp->product_type; // Type of line $line->ref = $objp->product_ref; // Ref product $line->product_ref = $objp->product_ref; // Ref product - $line->libelle = $objp->product_label; // TODO deprecated + $line->libelle = $objp->product_label; // deprecated $line->product_label = $objp->product_label; // Label product $line->product_desc = $objp->product_desc; // Description product $line->fk_product_type = $objp->fk_product_type; // Type of product diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index a7df3685175..dc8a610f908 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -958,7 +958,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { $facstatic=new FactureFournisseur($db); - $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye"; + $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye"; $sql.= ", ff.date_lim_reglement"; $sql.= ", s.nom as name"; $sql.= ", s.rowid as socid, s.email"; @@ -1075,9 +1075,8 @@ if ($resql) { $obj = $db->fetch_object($resql); - print ''.dol_print_date($db->jdate($obj->da), "day").''; - print ''.$obj->libelle.' '.$obj->label.''; + print ''.$obj->label.''; $i++; } $db->free($resql); diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 55f5c82a72a..1d7a1c1d406 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -100,7 +100,7 @@ $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; -$sql = "SELECT f.rowid, f.ref_supplier, f.type, f.datef, f.libelle,"; +$sql = "SELECT f.rowid, f.ref_supplier, f.type, f.datef, f.libelle as label,"; $sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,"; $sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,"; $sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,"; @@ -158,7 +158,7 @@ if ($result) $tabfac[$obj->rowid]["date"] = $obj->datef; $tabfac[$obj->rowid]["ref"] = $obj->ref_supplier; $tabfac[$obj->rowid]["type"] = $obj->type; - $tabfac[$obj->rowid]["lib"] = $obj->libelle; + $tabfac[$obj->rowid]["lib"] = $obj->label; $tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc; $tabht[$obj->rowid][$compta_prod] += $obj->total_ht; if ($obj->recuperableonly != 1) $tabtva[$obj->rowid][$compta_tva] += $obj->total_tva; diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 37614f7e36e..4363f39216f 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -41,7 +41,14 @@ class Cpaiement public $table_element = 'c_paiement'; public $code; + + /** + * @deprecated + * @see $label + */ public $libelle; + public $label; + public $type; public $active; public $accountancy_code; @@ -80,6 +87,9 @@ class Cpaiement if (isset($this->libelle)) { $this->libelle = trim($this->libelle); } + if (isset($this->label)) { + $this->label = trim($this->label); + } if (isset($this->type)) { $this->type = trim($this->type); } @@ -100,7 +110,6 @@ class Cpaiement // Insert request $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '('; - $sql.= 'entity,'; $sql.= 'code,'; $sql.= 'libelle,'; @@ -108,10 +117,7 @@ class Cpaiement $sql.= 'active,'; $sql.= 'accountancy_code,'; $sql.= 'module'; - - $sql .= ') VALUES ('; - $sql .= ' '.(! isset($this->entity)?getEntity('c_paiement'):$this->entity).','; $sql .= ' '.(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").','; $sql .= ' '.(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").','; @@ -119,8 +125,6 @@ class Cpaiement $sql .= ' '.(! isset($this->active)?'NULL':$this->active).','; $sql .= ' '.(! isset($this->accountancy_code)?'NULL':"'".$this->db->escape($this->accountancy_code)."'").','; $sql .= ' '.(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'"); - - $sql .= ')'; $this->db->begin(); @@ -173,7 +177,7 @@ class Cpaiement $sql = 'SELECT'; $sql .= ' t.id,'; $sql .= " t.code,"; - $sql .= " t.libelle,"; + $sql .= " t.libelle as label,"; $sql .= " t.type,"; $sql .= " t.active,"; $sql .= " t.accountancy_code,"; @@ -195,7 +199,8 @@ class Cpaiement $this->id = $obj->id; $this->code = $obj->code; - $this->libelle = $obj->libelle; + $this->libelle = $obj->label; + $this->label = $obj->label; $this->type = $obj->type; $this->active = $obj->active; $this->accountancy_code = $obj->accountancy_code; @@ -238,6 +243,9 @@ class Cpaiement if (isset($this->libelle)) { $this->libelle = trim($this->libelle); } + if (isset($this->label)) { + $this->label = trim($this->label); + } if (isset($this->type)) { $this->type = trim($this->type); } @@ -361,6 +369,7 @@ class Cpaiement $this->code = ''; $this->libelle = ''; + $this->label = ''; $this->type = ''; $this->active = ''; $this->accountancy_code = ''; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index aaff1a99c9f..ebfad45bb67 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -221,7 +221,7 @@ dol_fiche_end(); */ $disable_delete = 0; -$sql = 'SELECT f.rowid as scid, f.libelle, f.paye, f.amount as sc_amount, pf.amount, pc.libelle as sc_type'; +$sql = 'SELECT f.rowid as scid, f.libelle as label, f.paye, f.amount as sc_amount, pf.amount, pc.libelle as sc_type'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementcharge as pf,'.MAIN_DB_PREFIX.'chargesociales as f, '.MAIN_DB_PREFIX.'c_chargesociales as pc'; $sql.= ' WHERE pf.fk_charge = f.rowid AND f.fk_type = pc.id'; $sql.= ' AND f.entity = '.$conf->entity; @@ -263,7 +263,7 @@ if ($resql) /*print $socialcontrib->type;*/ print "\n"; // Label - print ''.$objp->libelle.''; + print ''.$objp->label.''; // Expected to pay print ''.price($objp->sc_amount).''; // Status diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 3054e64320e..79b0e97b8b1 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -167,7 +167,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer) else { $object->type = $actioncode; - $object->lib = GETPOST('label'); + $object->label = GETPOST('label', 'alpha'); $object->date_ech = $dateech; $object->periode = $dateperiod; $object->amount = $amount; @@ -464,8 +464,8 @@ if ($id > 0) $morehtmlref='
'; // Ref customer - $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project if (! empty($conf->projet->enabled)) { diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index b3fb1cf697b..dfdca9cdf6a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -108,8 +108,8 @@ if ($object->id) $morehtmlref='
'; // Label of social contribution - $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project if (! empty($conf->projet->enabled)) { diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 461cf6d8330..96a64a76bd5 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -126,8 +126,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); print "\n"; - $sql = "SELECT c.id, c.libelle as lib,"; - $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; + $sql = "SELECT c.id, c.libelle as type_label,"; + $sql.= " cs.rowid, cs.libelle as label, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment,"; $sql.= " pct.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; @@ -162,10 +162,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); - print ''; - // Ref payment + $payment_sc_static->id=$obj->pid; $payment_sc_static->ref=$obj->pid; + + print ''; + // Ref payment print ''.$payment_sc_static->getNomUrl(1)."\n"; // Date payment print ''.dol_print_date($db->jdate($obj->datep), 'day').''; @@ -177,11 +179,11 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; $socialcontrib->id=$obj->rowid; $socialcontrib->ref=$obj->rowid; - $socialcontrib->label=$obj->libelle; + $socialcontrib->label=$obj->label; print $socialcontrib->getNomUrl(1, '20'); print ''; // Type - print ''.$obj->lib.''; + print ''.$obj->type_label.''; // Date $date=$obj->periode; if (empty($date)) $date=$obj->date_ech; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 00817ee5799..56427347dd4 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -170,7 +170,7 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $documentstatic=new Fichinter($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'fichinterdet d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'fichinter as f ON d.fk_fichinter=f.rowid'; $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid AND ec.fk_socpeople='.$object->id; @@ -183,7 +183,7 @@ elseif ($type_element == 'invoice') { // Customer : show products from invoices require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $documentstatic=new Facture($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'facturedet d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture as f ON d.fk_facture=f.rowid'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; @@ -198,7 +198,7 @@ elseif ($type_element == 'propal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $documentstatic=new Propal($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, tc.libelle, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'propaldet d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propal as c ON d.fk_propal=c.rowid'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; @@ -213,7 +213,7 @@ elseif ($type_element == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $documentstatic=new Commande($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, tc.libelle, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'commandedet d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande as c ON d.fk_commande=c.rowid'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; @@ -228,7 +228,7 @@ elseif ($type_element == 'supplier_invoice') { // Supplier : Show products from invoices. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $documentstatic=new FactureFournisseur($db); - $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle, '; + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'facture_fourn_det d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn as f ON d.fk_facture_fourn=f.rowid'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; @@ -256,7 +256,7 @@ elseif ($type_element == 'supplier_order') { // Supplier : Show products from orders. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $documentstatic=new CommandeFournisseur($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, tc.libelle, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'commande_fournisseurdet d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur as c ON d.fk_commande=c.rowid'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; @@ -272,7 +272,7 @@ elseif ($type_element == 'contract') require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $documentstatic=new Contrat($db); $documentstaticline=new ContratLigne($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, tc.libelle, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, tc.libelle as type_contact_label, '; $tables_from = MAIN_DB_PREFIX.'contratdet d'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'contrat as c ON d.fk_contrat=c.rowid'; $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; @@ -344,14 +344,14 @@ if ($sql_select) $num = $db->num_rows($resql); - $param="&socid=".$socid."&type_element=".$type_element; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + $param="&socid=".urlencode($socid)."&type_element=".urlencode($type_element); + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr); if ($sref) $param.= "&sref=".urlencode($sref); - if ($month) $param.= "&month=".$month; - if ($year) $param.= "&year=".$year; - if ($optioncss != '') $param.='&optioncss='.$optioncss; + if ($month) $param.= "&month=".urlencode($month); + if ($year) $param.= "&year=".urlencode($year); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, '', 0, '', '', $limit); @@ -408,6 +408,7 @@ if ($sql_select) $documentstatic->statut=$objp->status; $documentstatic->status=$objp->status; $documentstatic->paye=$objp->paid; + $documentstatic->paid=$objp->paid; if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status; @@ -573,8 +574,7 @@ if ($sql_select) */ print ''; - //print ''.$prodreftxt.''; - print ''.$objp->libelle.''; + print ''.$objp->type_contact_label.''; // Type of contact label print ''.$objp->prod_qty.''; $total_qty+=$objp->prod_qty; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 30eba9867b8..07f058f2fe2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1617,7 +1617,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) $found=0; $dirtoscan=''; - $sql = "SELECT nom as id, nom as lib, libelle as label, description as description"; + $sql = "SELECT nom as id, nom as doc_template_name, libelle as label, description as description"; $sql.= " FROM ".MAIN_DB_PREFIX."document_model"; $sql.= " WHERE type = '".$type."'"; $sql.= " AND entity IN (0,".$conf->entity.")"; @@ -1677,18 +1677,18 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) } else { - if ($type == 'member' && $obj->lib == 'standard') // Special case, if member template, we add variant per format + if ($type == 'member' && $obj->doc_template_name == 'standard') // Special case, if member template, we add variant per format { global $_Avery_Labels; include_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'; foreach($_Avery_Labels as $key => $val) { - $liste[$obj->id.':'.$key]=($obj->label?$obj->label:$obj->lib).' '.$val['name']; + $liste[$obj->id.':'.$key]=($obj->label?$obj->label:$obj->doc_template_name).' '.$val['name']; } } else // Common usage { - $liste[$obj->id]=$obj->label?$obj->label:$obj->lib; + $liste[$obj->id]=$obj->label?$obj->label:$obj->doc_template_name; } } $i++; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 25ffcb717fd..43d6ae08213 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -129,7 +129,7 @@ class mailing_fraise extends MailingTargets $s.=' '; $s.=$langs->trans("Type").': '; $s.=''; } // Moral/Physic attribute diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index db18a1bf6af..7f531498e2f 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -301,6 +301,8 @@ if ($id > 0 || ! empty($ref)) // Type $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; + $membertypestatic->label=$objp->type; + print ''; print $membertypestatic->getNomUrl(1, 32); print ''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 6af681750cc..27269dbaac2 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1364,9 +1364,9 @@ class SupplierProposal extends CommonObject $line->fk_product = $objp->fk_product; - $line->ref = $objp->product_ref; // TODO deprecated + $line->ref = $objp->product_ref; // deprecated $line->product_ref = $objp->product_ref; - $line->libelle = $objp->product_label; // TODO deprecated + $line->libelle = $objp->product_label; // deprecated $line->product_label = $objp->product_label; $line->product_desc = $objp->product_desc; // Description produit $line->fk_product_type = $objp->fk_product_type; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index b009d01659b..167735e901d 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -45,14 +45,14 @@ $langs->loadLangs(array("admin", "cashdesk")); global $db; -$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement"; +$sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " WHERE entity IN (".getEntity('c_paiement').")"; $sql.= " AND active = 1"; $sql.= " ORDER BY libelle"; $resql = $db->query($sql); $paiements = array(); -if($resql){ - while ($obj = $db->fetch_object($resql)){ +if ($resql) { + while ($obj = $db->fetch_object($resql)) { array_push($paiements, $obj); } } @@ -152,7 +152,7 @@ if (! empty($conf->banque->enabled)) foreach($paiements as $modep) { if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; // Already managed before $name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse; - print ''.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).''; + print ''.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->label).''; print ''; if (! empty($conf->global->$name)) $atleastonefound++; $cour=preg_match('/^LIQ.*/', $modep->code)?2:1; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 9a3bce8c458..494d6b351b8 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2258,7 +2258,7 @@ class Ticket extends CommonObject $sql .= ", t.phone as phone, t.phone_mobile as phone_mobile, t.phone_perso as phone_perso"; } - $sql .= ", tc.source, tc.element, tc.code, tc.libelle"; + $sql .= ", tc.source, tc.element, tc.code, tc.libelle as type_contact_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_type_contact tc"; $sql .= ", " . MAIN_DB_PREFIX . "element_contact ec"; if ($source == 'internal') { @@ -2296,7 +2296,7 @@ class Ticket extends CommonObject if (!$list) { $transkey = "TypeContact_" . $obj->element . "_" . $obj->source . "_" . $obj->code; - $libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle); + $libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->type_contact_label); $tab[$i] = array( 'source' => $obj->source, 'socid' => $obj->socid, diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index c34a9f1c7d0..5610ef88857 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -258,7 +258,7 @@ class User extends CommonObject $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.personal_email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,"; $sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile, u.personal_mobile,"; $sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,"; - $sql.= " u.admin, u.login, u.note,"; + $sql.= " u.admin, u.login, u.note as note_private, u.note_public,"; $sql.= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,"; $sql.= " u.fk_soc, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid, u.fk_user_expense_validator, u.fk_user_holiday_validator,"; $sql.= " u.statut, u.lang, u.entity,"; @@ -374,7 +374,9 @@ class User extends CommonObject $this->job = $obj->job; $this->signature = $obj->signature; $this->admin = $obj->admin; - $this->note = $obj->note; + $this->note_public = $obj->note_public; + $this->note_private = $obj->note_private; + $this->note = $obj->note_private; $this->statut = $obj->statut; $this->photo = $obj->photo; $this->openid = $obj->openid; @@ -1222,7 +1224,8 @@ class User extends CommonObject require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; $langs->load("stocks"); $entrepot = new Entrepot($this->db); - $entrepot->libelle = $langs->trans("PersonalStock", $this->getFullName($langs)); + $entrepot->label = $langs->trans("PersonalStock", $this->getFullName($langs)); + $entrepot->libelle = $entrepot->label; // For backward compatibility $entrepot->description = $langs->trans("ThisWarehouseIsPersonalStock", $this->getFullName($langs)); $entrepot->statut = 1; $entrepot->country_id = $mysoc->country_id; @@ -1515,7 +1518,8 @@ class User extends CommonObject $this->job = trim($this->job); $this->signature = trim($this->signature); - $this->note = trim($this->note); + $this->note_public = trim($this->note_public); + $this->note_private = trim($this->note_private); $this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning $this->admin = $this->admin?$this->admin:0; $this->address = empty($this->address)?'':$this->address; @@ -1574,7 +1578,8 @@ class User extends CommonObject $sql.= ", color = '".$this->db->escape($this->color)."'"; $sql.= ", dateemployment=".(strval($this->dateemployment)!='' ? "'".$this->db->idate($this->dateemployment)."'" : 'null'); $sql.= ", dateemploymentend=".(strval($this->dateemploymentend)!='' ? "'".$this->db->idate($this->dateemploymentend)."'" : 'null'); - $sql.= ", note = '".$this->db->escape($this->note)."'"; + $sql.= ", note = '".$this->db->escape($this->note_private)."'"; + $sql.= ", note_public = '".$this->db->escape($this->note_public)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); $sql.= ", fk_user = ".($this->fk_user > 0?"'".$this->db->escape($this->fk_user)."'":"null"); @@ -2692,7 +2697,8 @@ class User extends CommonObject $this->lastname='DOLIBARR'; $this->firstname='SPECIMEN'; $this->gender='man'; - $this->note='This is a note'; + $this->note_public='This is a note public'; + $this->note_private='This is a note private'; $this->email='email@specimen.com'; $this->personal_email='personalemail@specimen.com'; $this->skype='skypepseudo'; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 258cb42388d..32118e05b7b 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -243,7 +243,7 @@ if ($object->id > 0) print ''.$langs->trans("Permissions").''; print ''; - $sql = "SELECT r.id, r.libelle, r.module"; + $sql = "SELECT r.id, r.libelle as label, r.module"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" $sql.= " AND r.entity = " . $entity; @@ -330,7 +330,7 @@ if ($object->id > 0) print ' '; } - $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); + $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->label))); print ''.$perm_libelle. ''; print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index a49c3e930b0..d85adf12a3e 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -283,7 +283,7 @@ print ''.$langs->trans("Permissions").''; print ''."\n"; //print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS; -$sql = "SELECT r.id, r.libelle, r.module, r.module_position"; +$sql = "SELECT r.id, r.libelle as label, r.module, r.module_position"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" $sql.= " AND r.entity = " . $entity; @@ -421,7 +421,7 @@ if ($result) } // Label - $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->libelle))); + $permlabel=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$langs->trans($obj->label))); print ''.$permlabel.''; print ''."\n"; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index f2fed8f1bca..b66b0db4bcd 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -518,10 +518,10 @@ function createProductOrService($authentication, $product) $newobject->ref=$product['ref']; $newobject->ref_ext=$product['ref_ext']; $newobject->type=$product['type']; - $newobject->libelle=$product['label']; // @deprecated $newobject->label=$product['label']; $newobject->description=$product['description']; - $newobject->note=$product['note']; + $newobject->note_public=$product['note_public']; + $newobject->note_private=$product['note_private']; $newobject->status=$product['status_tosell']; $newobject->status_buy=$product['status_tobuy']; $newobject->price=$product['price_net']; @@ -692,7 +692,6 @@ function updateProductOrService($authentication, $product) if (isset($product['ref'])) $newobject->ref=$product['ref']; if (isset($product['ref_ext'])) $newobject->ref_ext=$product['ref_ext']; $newobject->type=$product['type']; - $newobject->libelle=$product['label']; // @deprecated $newobject->label=$product['label']; $newobject->description=$product['description']; $newobject->note=$product['note']; diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 1873a8a9f5c..d738bca19f3 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -290,8 +290,8 @@ function getSupplierInvoice($authentication, $id = '', $ref = '', $ref_ext = '') 'date_modification'=>dol_print_date($invoice->tms, 'dayhourrfc'), 'date_invoice'=>dol_print_date($invoice->date, 'dayhourrfc'), 'date_term'=>dol_print_date($invoice->date_echeance, 'dayhourrfc'), - 'label'=>$invoice->libelle, - 'paid'=>$invoice->paye, + 'label'=>$invoice->label, + 'paid'=>$invoice->paid, 'note_private'=>$invoice->note_private, 'note_public'=>$invoice->note_public, 'close_code'=>$invoice->close_code, @@ -422,8 +422,8 @@ function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) 'date_modification'=>dol_print_date($invoice->tms, 'dayhourrfc'), 'date_invoice'=>dol_print_date($invoice->date, 'dayhourrfc'), 'date_term'=>dol_print_date($invoice->date_echeance, 'dayhourrfc'), - 'label'=>$invoice->libelle, - 'paid'=>$invoice->paye, + 'label'=>$invoice->label, + 'paid'=>$invoice->paid, 'note_private'=>$invoice->note_private, 'note_public'=>$invoice->note_public, 'close_code'=>$invoice->close_code,