From eb41a72e2721e9ee5c22e43d4a9ec8087241de6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Oct 2020 17:41:36 +0200 Subject: [PATCH] Properties ->titre have been renamed into ->title --- ChangeLog | 3 ++- htdocs/comm/mailing/advtargetemailing.php | 2 +- htdocs/comm/mailing/card.php | 16 ++++++++-------- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/class/mailing.class.php | 16 ++++++++-------- htdocs/comm/mailing/index.php | 2 +- htdocs/comm/mailing/list.php | 2 +- htdocs/compta/facture/card-rec.php | 4 ++-- .../compta/facture/class/facture-rec.class.php | 5 +++++ htdocs/core/class/html.formprojet.class.php | 2 +- htdocs/fichinter/class/fichinterrec.class.php | 8 ++++---- htdocs/projet/ajax/projects.php | 4 ++-- 12 files changed, 36 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53282d1c1d3..60aa376f96d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,8 @@ NEW: Module Reception (for a more accurate management of your receptions) moved WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* Properties ->contactid has been renamed into ->contact_id +* Properties ->contactid have been renamed into ->contact_id +* Properties ->titre have been renamed into ->title * Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english) * The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in your email templates. diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 29b06819e9e..64e7df053ea 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -426,7 +426,7 @@ if ($object->fetch($id) >= 0) { print $form->showrefnav($object, 'id', $linkback); print ''; - print ''.$langs->trans("MailTitle").''.$object->titre.''; + print ''.$langs->trans("MailTitle").''.$object->title.''; print ''.$langs->trans("MailFrom").''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 78b9dea4bc6..02d779e5525 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -465,13 +465,13 @@ if (empty($reshook)) $object->email_from = GETPOST("from"); $object->email_replyto = GETPOST("replyto"); $object->email_errorsto = GETPOST("errorsto"); - $object->titre = GETPOST("titre"); + $object->title = GETPOST("title"); $object->sujet = GETPOST("sujet"); $object->body = GETPOST("bodyemail", 'restricthtml'); $object->bgcolor = GETPOST("bgcolor"); $object->bgimage = GETPOST("bgimage"); - if (!$object->titre) { + if (!$object->title) { $mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle")); } if (!$object->sujet) { @@ -496,16 +496,16 @@ if (empty($reshook)) } // Action update description of emailing - if ($action == 'settitre' || $action == 'setemail_from' || $action == 'setreplyto' || $action == 'setemail_errorsto') + if ($action == 'settitle' || $action == 'setemail_from' || $action == 'setreplyto' || $action == 'setemail_errorsto') { $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); - if ($action == 'settitre') $object->titre = trim(GETPOST('titre', 'alpha')); + if ($action == 'settitle') $object->title = trim(GETPOST('title', 'alpha')); elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha')); elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha')); elseif ($action == 'setemail_errorsto') { $object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha')); - } elseif ($action == 'settitre' && empty($object->titre)) { + } elseif ($action == 'settitle' && empty($object->title)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle")); } elseif ($action == 'setfrom' && empty($object->email_from)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")); @@ -854,9 +854,9 @@ if ($action == 'create') // Description print ''; - print $form->editfieldkey("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); print ''; - print $form->editfieldval("MailTitle", 'titre', $object->titre, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); print ''; // From @@ -1144,7 +1144,7 @@ if ($action == 'create') */ // Topic - print ''.$langs->trans("MailTitle").''.$object->titre.''; + print ''.$langs->trans("MailTitle").''.$object->title.''; // From print ''.$langs->trans("MailFrom").''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; // To diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ef2f3cc772e..ff9bb98f639 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -237,7 +237,7 @@ if ($object->fetch($id) >= 0) print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index d22dd130507..525064942a6 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -238,7 +238,7 @@ if ($resql) print $email->getNomUrl(1); print ''; - print ''; + print ''; // Date creation print '
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailTitle").''.$object->title.'
'.$langs->trans("MailFrom").''; $emailarray = CMailFile::getArrayAddress($object->email_from); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 1bb4864876c..704d0892ab5 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -46,7 +46,7 @@ class Mailing extends CommonObject */ public $picto = 'email'; - public $titre; + public $title; public $sujet; public $body; public $nbemail; @@ -115,7 +115,7 @@ class Mailing extends CommonObject $this->db->begin(); - $this->titre = trim($this->titre); + $this->title = trim($this->title); $this->email_from = trim($this->email_from); if (!$this->email_from) @@ -130,9 +130,9 @@ class Mailing extends CommonObject $sql .= " (date_creat, fk_user_creat, entity)"; $sql .= " VALUES ('".$this->db->idate($now)."', ".$user->id.", ".$conf->entity.")"; - if (!$this->titre) + if (!$this->title) { - $this->titre = $langs->trans("NoTitle"); + $this->title = $langs->trans("NoTitle"); } dol_syslog("Mailing::Create", LOG_DEBUG); @@ -167,7 +167,7 @@ class Mailing extends CommonObject public function update($user) { $sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; - $sql .= " SET titre = '".$this->db->escape($this->titre)."'"; + $sql .= " SET titre = '".$this->db->escape($this->title)."'"; $sql .= ", sujet = '".$this->db->escape($this->sujet)."'"; $sql .= ", body = '".$this->db->escape($this->body)."'"; $sql .= ", email_from = '".$this->db->escape($this->email_from)."'"; @@ -198,7 +198,7 @@ class Mailing extends CommonObject { global $conf; - $sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage"; + $sql = "SELECT m.rowid, m.titre as title, m.sujet, m.body, m.bgcolor, m.bgimage"; $sql .= ", m.email_from, m.email_replyto, m.email_errorsto"; $sql .= ", m.statut, m.nbemail"; $sql .= ", m.fk_user_creat, m.fk_user_valid"; @@ -221,7 +221,7 @@ class Mailing extends CommonObject $this->ref = $obj->rowid; $this->statut = $obj->statut; $this->nbemail = $obj->nbemail; - $this->titre = $obj->titre; + $this->title = $obj->title; $this->sujet = $obj->sujet; if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401))) { @@ -283,7 +283,7 @@ class Mailing extends CommonObject $object->statut = 0; // Clear fields - $object->titre = $langs->trans("CopyOf").' '.$object->titre.' '.dol_print_date(dol_now()); + $object->title = $langs->trans("CopyOf").' '.$object->title.' '.dol_print_date(dol_now()); // If no option copy content if (empty($option1)) diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index cf439e4314b..ddcdaabf14e 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -182,7 +182,7 @@ if ($result) { print '
'.$mailstatic->getNomUrl(1).''.dol_trunc($obj->titre, 38).''.dol_trunc($obj->title, 38).''.dol_print_date($db->jdate($obj->date_creat), 'day').''.($obj->nbemail ? $obj->nbemail : "0").''.$mailstatic->LibStatut($obj->statut, 5).''.$obj->titre.''.$obj->title.''; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 113068c447c..3ab212a62bd 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -188,8 +188,8 @@ if (empty($reshook)) if (!$error) { - $object->titre = GETPOST('titre', 'nohtml'); // deprecated - $object->title = GETPOST('titre', 'nohtml'); + $object->titre = GETPOST('title', 'nohtml'); // deprecated + $object->title = GETPOST('title', 'nohtml'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); $object->model_pdf = GETPOST('modelpdf', 'alpha'); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index c288251f56a..d1a6abcdec3 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -74,6 +74,11 @@ class FactureRec extends CommonInvoice */ protected $table_ref_field = 'titre'; + /** + * @var string The label of recurring invoice + */ + public $title; + public $number; public $date; public $remise; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 6fad72862c7..058706edce7 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -170,7 +170,7 @@ class FormProjets if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql .= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; elseif ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. { - $sql .= " AND (p.fk_soc IN (".$socid.", ".$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") OR p.fk_soc IS NULL)"; + $sql .= " AND (p.fk_soc IN (".$socid.", ".((int) $conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY).") OR p.fk_soc IS NULL)"; } } if (!empty($filterkey)) $sql .= natural_search(array('p.title', 'p.ref'), $filterkey); diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 818c1763786..c9e689ffd4c 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -250,12 +250,11 @@ class FichinterRec extends Fichinter */ public function fetch($rowid = 0, $ref = '', $ref_ext = '') { - $sql = 'SELECT f.titre, f.fk_soc'; + $sql = 'SELECT f.titre as title, f.fk_soc'; $sql .= ', f.datec, f.duree, f.fk_projet, f.fk_contrat, f.description'; $sql .= ', f.note_private, f.note_public, f.fk_user_author'; $sql .= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.auto_validate'; $sql .= ', f.note_private, f.note_public, f.fk_user_author'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'fichinter_rec as f'; if ($rowid > 0) $sql .= ' WHERE f.rowid='.$rowid; elseif ($ref) $sql .= " WHERE f.titre='".$this->db->escape($ref)."'"; @@ -268,8 +267,9 @@ class FichinterRec extends Fichinter $obj = $this->db->fetch_object($result); $this->id = $rowid; - $this->titre = $obj->titre; - $this->ref = $obj->titre; + $this->titre = $obj->title; + $this->title = $obj->title; + $this->ref = $obj->title; $this->description = $obj->description; $this->datec = $obj->datec; $this->duration = $obj->duree; diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index cbc223f8525..3491ae1e166 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -1,8 +1,8 @@ * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2007-2011 Laurent Destailleur - * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2007-2020 Laurent Destailleur + * Copyright (C) 2014-2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by