Prepare change of properties "titre" into "title"

This commit is contained in:
Laurent Destailleur 2019-07-19 13:22:54 +02:00
parent cd1a2d24ee
commit f745d01bf3
11 changed files with 31 additions and 28 deletions

View File

@ -87,7 +87,8 @@ if ($action == 'update')
$result=$menu->fetch(GETPOST('menuId', 'int')); $result=$menu->fetch(GETPOST('menuId', 'int'));
if ($result > 0) 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->leftmenu=GETPOST('leftmenu', 'aZ09');
$menu->url=GETPOST('url', 'alpha'); $menu->url=GETPOST('url', 'alpha');
$menu->langs=GETPOST('langs', 'alpha'); $menu->langs=GETPOST('langs', 'alpha');
@ -205,7 +206,8 @@ if ($action == 'add')
$menu = new Menubase($db); $menu = new Menubase($db);
$menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); $menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09'));
$menu->type=GETPOST('type', 'alpha'); $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->url=GETPOST('url', 'alpha');
$menu->langs=GETPOST('langs', 'alpha'); $menu->langs=GETPOST('langs', 'alpha');
$menu->position=GETPOST('position', 'int'); $menu->position=GETPOST('position', 'int');
@ -494,7 +496,7 @@ elseif ($action == 'edit')
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>'; //print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
// Title // Title
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->titre).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->titre ? $menu->titre : $menu->title).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
// Url // Url
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';

View File

@ -244,13 +244,13 @@ print "<br>\n";
// Confirmation for remove menu entry // Confirmation for remove menu entry
if ($action == 'delete') if ($action == 'delete')
{ {
$sql = "SELECT m.titre"; $sql = "SELECT m.titre as title";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
$sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int'); $sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int');
$result = $db->query($sql); $result = $db->query($sql);
$obj = $db->fetch_object($result); $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=''; $newcardbutton='';

View File

@ -2773,7 +2773,7 @@ if ($action == 'create')
$note_public = $invoice_predefined->note_public; $note_public = $invoice_predefined->note_public;
$note_private = $invoice_predefined->note_private; $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 .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
$sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid; $sql .= ' WHERE r.fk_soc = ' . $invoice_predefined->socid;
@ -2797,7 +2797,7 @@ if ($action == 'create')
print ' selected'; print ' selected';
$exampletemplateinvoice->fetch(GETPOST('fac_rec')); $exampletemplateinvoice->fetch(GETPOST('fac_rec'));
} }
print '>' . $objp->titre . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; print '>' . $objp->title . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>';
$i ++; $i ++;
} }
print '</select>'; print '</select>';

View File

@ -123,7 +123,8 @@ class FactureRec extends CommonInvoice
$now=dol_now(); $now=dol_now();
// Clean parameters // 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; $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice;
if (empty($this->suspended)) $this->suspended=0; if (empty($this->suspended)) $this->suspended=0;
@ -180,7 +181,7 @@ class FactureRec extends CommonInvoice
$sql.= ", multicurrency_tx"; $sql.= ", multicurrency_tx";
$sql.= ", suspended"; $sql.= ", suspended";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= "'".$this->db->escape($this->titre)."'"; $sql.= "'".$this->db->escape($this->titre ? $this->titre : $this->title)."'";
$sql.= ", ".$facsrc->socid; $sql.= ", ".$facsrc->socid;
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($now)."'";
@ -376,7 +377,7 @@ class FactureRec extends CommonInvoice
*/ */
public function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '') 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.remise_percent, f.remise_absolue, f.remise';
$sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.date_lim_reglement as dlr';
$sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.note_private, f.note_public, f.fk_user_author';
@ -410,8 +411,9 @@ class FactureRec extends CommonInvoice
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->titre = $obj->titre; $this->titre = $obj->title; // deprecated
$this->ref = $obj->titre; $this->title = $obj->title;
$this->ref = $obj->title;
$this->ref_client = $obj->ref_client; $this->ref_client = $obj->ref_client;
$this->suspended = $obj->suspended; $this->suspended = $obj->suspended;
$this->type = $obj->type; $this->type = $obj->type;

View File

@ -187,7 +187,8 @@ if (empty($reshook))
if (! $error) 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_private = GETPOST('note_private', 'none');
$object->note_public = GETPOST('note_public', 'none'); $object->note_public = GETPOST('note_public', 'none');
$object->modelpdf = GETPOST('modelpdf', 'alpha'); $object->modelpdf = GETPOST('modelpdf', 'alpha');
@ -295,8 +296,9 @@ if (empty($reshook))
$result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0) if ($result > 0)
{ {
$object->titre = GETPOST('ref', 'alpha'); $object->titre = GETPOST('ref', 'alpha'); // deprecated
$object->ref = $object->titre; $object->title = GETPOST('ref', 'alpha');
$object->ref = $object->title;
} }
else dol_print_error($db, $object->error, $object->errors); else dol_print_error($db, $object->error, $object->errors);
} }

View File

@ -213,7 +213,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['
/* /*
* List mode * 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.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
$sql.= " f.datec, f.tms,"; $sql.= " f.datec, f.tms,";
$sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement";
@ -514,7 +514,7 @@ if ($resql)
$invoicerectmp->unit_frequency=$objp->unit_frequency; $invoicerectmp->unit_frequency=$objp->unit_frequency;
$invoicerectmp->nb_gen_max=$objp->nb_gen_max; $invoicerectmp->nb_gen_max=$objp->nb_gen_max;
$invoicerectmp->nb_gen_done=$objp->nb_gen_done; $invoicerectmp->nb_gen_done=$objp->nb_gen_done;
$invoicerectmp->ref=$objp->titre; $invoicerectmp->ref=$objp->title;
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -422,7 +422,8 @@ class Menubase
$this->position=''; $this->position='';
$this->url='http://dummy'; $this->url='http://dummy';
$this->target=''; $this->target='';
$this->titre='Specimen menu'; $this->titre='Specimen menu'; // deprecated
$this->title='Specimen menu';
$this->langs=''; $this->langs='';
$this->level=''; $this->level='';
$this->leftmenu=''; $this->leftmenu='';

View File

@ -1938,7 +1938,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$menu->type=$this->menu[$key]['type']; $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->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->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->url=$this->menu[$key]['url'];
$menu->langs=$this->menu[$key]['langs']; $menu->langs=$this->menu[$key]['langs'];
$menu->position=$this->menu[$key]['position']; $menu->position=$this->menu[$key]['position'];

View File

@ -129,7 +129,7 @@ if ($action == 'add') {
if (! $error) { if (! $error) {
$object->id_origin = $id; $object->id_origin = $id;
$object->titre = GETPOST('titre', 'alpha'); $object->title = GETPOST('titre', 'alpha');
$object->description = GETPOST('description', 'alpha'); $object->description = GETPOST('description', 'alpha');
$object->socid = GETPOST('socid', 'alpha'); $object->socid = GETPOST('socid', 'alpha');
$object->fk_project = GETPOST('projectid', 'int'); $object->fk_project = GETPOST('projectid', 'int');
@ -773,7 +773,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
/* /*
* List mode * 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.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"; $sql.= " f.date_last_gen, f.date_when, f.datec";
@ -844,7 +844,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime(
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td><a href="'.$_SERVER['PHP_SELF'].'?id='.$objp->fich_rec.'">'; print '<td><a href="'.$_SERVER['PHP_SELF'].'?id='.$objp->fich_rec.'">';
print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre; print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->title;
print "</a></td>\n"; print "</a></td>\n";
if ($objp->socid) { if ($objp->socid) {
$companystatic->id=$objp->socid; $companystatic->id=$objp->socid;

View File

@ -546,7 +546,6 @@ class Projects extends DolibarrApi
// phpcs:enable // phpcs:enable
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
unset($object->titre);
unset($object->datec); unset($object->datec);
unset($object->datem); unset($object->datem);
unset($object->barcode_type); unset($object->barcode_type);

View File

@ -74,12 +74,9 @@ class Project extends CommonObject
/** /**
* @var string * @var string
* @deprecated
* @see $title
*/ */
public $titre;
public $title; public $title;
public $date_start; public $date_start;
public $date_end; public $date_end;
public $date_close; public $date_close;
@ -465,7 +462,6 @@ class Project extends CommonObject
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->title = $obj->title; $this->title = $obj->title;
$this->titre = $obj->title; // TODO deprecated
$this->description = $obj->description; $this->description = $obj->description;
$this->date_c = $this->db->jdate($obj->datec); $this->date_c = $this->db->jdate($obj->datec);
$this->datec = $this->db->jdate($obj->datec); // TODO deprecated $this->datec = $this->db->jdate($obj->datec); // TODO deprecated