From f745d01bf34f9e9d04abf9ded88f3ce3ed71d0c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Jul 2019 13:22:54 +0200 Subject: [PATCH] Prepare change of properties "titre" into "title" --- htdocs/admin/menus/edit.php | 8 +++++--- htdocs/admin/menus/index.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/class/facture-rec.class.php | 12 +++++++----- htdocs/compta/facture/fiche-rec.php | 8 +++++--- htdocs/compta/facture/invoicetemplate_list.php | 4 ++-- htdocs/core/class/menubase.class.php | 3 ++- htdocs/core/modules/DolibarrModules.class.php | 3 ++- htdocs/fichinter/card-rec.php | 6 +++--- htdocs/projet/class/api_projects.class.php | 1 - htdocs/projet/class/project.class.php | 6 +----- 11 files changed, 31 insertions(+), 28 deletions(-) diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index cf42f294d03..6bacc97e92f 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -87,7 +87,8 @@ if ($action == 'update') $result=$menu->fetch(GETPOST('menuId', 'int')); if ($result > 0) { - $menu->titre=GETPOST('titre', 'alpha'); + $menu->titre=GETPOST('titre', 'alpha'); // deprecated + $menu->title=GETPOST('titre', 'alpha'); $menu->leftmenu=GETPOST('leftmenu', 'aZ09'); $menu->url=GETPOST('url', 'alpha'); $menu->langs=GETPOST('langs', 'alpha'); @@ -205,7 +206,8 @@ if ($action == 'add') $menu = new Menubase($db); $menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); $menu->type=GETPOST('type', 'alpha'); - $menu->titre=GETPOST('titre', 'alpha'); + $menu->titre=GETPOST('titre', 'alpha'); // deprecated + $menu->title=GETPOST('titre', 'alpha'); $menu->url=GETPOST('url', 'alpha'); $menu->langs=GETPOST('langs', 'alpha'); $menu->position=GETPOST('position', 'int'); @@ -494,7 +496,7 @@ elseif ($action == 'edit') //print ''.$langs->trans('Level').''.$menu->level.''.$langs->trans('DetailLevel').''; // Title - print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; + print ''.$langs->trans('Title').''.$langs->trans('DetailTitre').''; // Url print ''.$langs->trans('URL').''.$langs->trans('DetailUrl').''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index d1b56d51cee..1790eaf5aee 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -244,13 +244,13 @@ print "
\n"; // Confirmation for remove menu entry if ($action == 'delete') { - $sql = "SELECT m.titre"; + $sql = "SELECT m.titre as title"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int'); $result = $db->query($sql); $obj = $db->fetch_object($result); - print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->titre), "confirm_delete"); + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete"); } $newcardbutton=''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 968469ff1e0..2f017b485d6 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2773,7 +2773,7 @@ if ($action == 'create') $note_public = $invoice_predefined->note_public; $note_private = $invoice_predefined->note_private; - $sql = 'SELECT r.rowid, r.titre, r.total_ttc'; + $sql = 'SELECT r.rowid, r.titre as title, r.total_ttc'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r'; $sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid; @@ -2797,7 +2797,7 @@ if ($action == 'create') print ' selected'; $exampletemplateinvoice->fetch(GETPOST('fac_rec')); } - print '>' . $objp->titre . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')'; + print '>' . $objp->title . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')'; $i ++; } print ''; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f6b148d308c..37a031198bc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -123,7 +123,8 @@ class FactureRec extends CommonInvoice $now=dol_now(); // Clean parameters - $this->titre=trim($this->titre); + $this->titre=trim($this->titre); // deprecated + $this->title=trim($this->title); $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; if (empty($this->suspended)) $this->suspended=0; @@ -180,7 +181,7 @@ class FactureRec extends CommonInvoice $sql.= ", multicurrency_tx"; $sql.= ", suspended"; $sql.= ") VALUES ("; - $sql.= "'".$this->db->escape($this->titre)."'"; + $sql.= "'".$this->db->escape($this->titre ? $this->titre : $this->title)."'"; $sql.= ", ".$facsrc->socid; $sql.= ", ".$conf->entity; $sql.= ", '".$this->db->idate($now)."'"; @@ -376,7 +377,7 @@ class FactureRec extends CommonInvoice */ public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '') { - $sql = 'SELECT f.rowid, f.entity, f.titre, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; + $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; $sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.note_private, f.note_public, f.fk_user_author'; @@ -410,8 +411,9 @@ class FactureRec extends CommonInvoice $this->id = $obj->rowid; $this->entity = $obj->entity; - $this->titre = $obj->titre; - $this->ref = $obj->titre; + $this->titre = $obj->title; // deprecated + $this->title = $obj->title; + $this->ref = $obj->title; $this->ref_client = $obj->ref_client; $this->suspended = $obj->suspended; $this->type = $obj->type; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index dd4a2af11ee..39f913fbf76 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -187,7 +187,8 @@ if (empty($reshook)) if (! $error) { - $object->titre = GETPOST('titre', 'alpha'); + $object->titre = GETPOST('titre', 'alpha'); // deprecated + $object->title = GETPOST('titre', 'alpha'); $object->note_private = GETPOST('note_private', 'none'); $object->note_public = GETPOST('note_public', 'none'); $object->modelpdf = GETPOST('modelpdf', 'alpha'); @@ -295,8 +296,9 @@ if (empty($reshook)) $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); if ($result > 0) { - $object->titre = GETPOST('ref', 'alpha'); - $object->ref = $object->titre; + $object->titre = GETPOST('ref', 'alpha'); // deprecated + $object->title = GETPOST('ref', 'alpha'); + $object->ref = $object->title; } else dol_print_error($db, $object->error, $object->errors); } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 5da37d46fd5..1226f7c8a79 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -213,7 +213,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray[' /* * List mode */ -$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,"; +$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,"; $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,"; $sql.= " f.datec, f.tms,"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; @@ -514,7 +514,7 @@ if ($resql) $invoicerectmp->unit_frequency=$objp->unit_frequency; $invoicerectmp->nb_gen_max=$objp->nb_gen_max; $invoicerectmp->nb_gen_done=$objp->nb_gen_done; - $invoicerectmp->ref=$objp->titre; + $invoicerectmp->ref=$objp->title; print ''; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index d1d7534af23..26f96b93ec5 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -422,7 +422,8 @@ class Menubase $this->position=''; $this->url='http://dummy'; $this->target=''; - $this->titre='Specimen menu'; + $this->titre='Specimen menu'; // deprecated + $this->title='Specimen menu'; $this->langs=''; $this->level=''; $this->leftmenu=''; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 4a8135800ae..16d3969652d 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1938,7 +1938,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $menu->type=$this->menu[$key]['type']; $menu->mainmenu=isset($this->menu[$key]['mainmenu'])?$this->menu[$key]['mainmenu']:(isset($menu->fk_mainmenu)?$menu->fk_mainmenu:''); $menu->leftmenu=isset($this->menu[$key]['leftmenu'])?$this->menu[$key]['leftmenu']:''; - $menu->titre=$this->menu[$key]['titre']; + $menu->titre=$this->menu[$key]['titre']; // deprecated + $menu->title=$this->menu[$key]['titre']; $menu->url=$this->menu[$key]['url']; $menu->langs=$this->menu[$key]['langs']; $menu->position=$this->menu[$key]['position']; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 6ee445d68a1..63183c73d1d 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -129,7 +129,7 @@ if ($action == 'add') { if (! $error) { $object->id_origin = $id; - $object->titre = GETPOST('titre', 'alpha'); + $object->title = GETPOST('titre', 'alpha'); $object->description = GETPOST('description', 'alpha'); $object->socid = GETPOST('socid', 'alpha'); $object->fk_project = GETPOST('projectid', 'int'); @@ -773,7 +773,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( /* * List mode */ - $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre,"; + $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title,"; $sql.= " f.duree, f.fk_contrat, f.fk_projet as fk_project, f.frequency, f.nb_gen_done, f.nb_gen_max,"; $sql.= " f.date_last_gen, f.date_when, f.datec"; @@ -844,7 +844,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( print ''; print ''; - print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre; + print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->title; print "\n"; if ($objp->socid) { $companystatic->id=$objp->socid; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 48ae3cbf337..b6f9acbf4b5 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -546,7 +546,6 @@ class Projects extends DolibarrApi // phpcs:enable $object = parent::_cleanObjectDatas($object); - unset($object->titre); unset($object->datec); unset($object->datem); unset($object->barcode_type); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 9a651ec4a0a..0c7495efa7e 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -74,12 +74,9 @@ class Project extends CommonObject /** * @var string - * @deprecated - * @see $title */ - public $titre; - public $title; + public $date_start; public $date_end; public $date_close; @@ -465,7 +462,6 @@ class Project extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->ref; $this->title = $obj->title; - $this->titre = $obj->title; // TODO deprecated $this->description = $obj->description; $this->date_c = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec); // TODO deprecated