Properties ->titre have been renamed into ->title

This commit is contained in:
Laurent Destailleur 2020-10-07 17:41:36 +02:00
parent 561ca757d7
commit eb41a72e27
12 changed files with 36 additions and 30 deletions

View File

@ -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.

View File

@ -426,7 +426,7 @@ if ($object->fetch($id) >= 0) {
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';
print '<tr><td>'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
print '<tr><td>'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->title.'</td></tr>';
print '<tr><td>'.$langs->trans("MailFrom").'</td><td colspan="3">'.dol_print_email($object->email_from, 0, 0, 0, 0, 1).'</td></tr>';

View File

@ -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 '<tr><td class="titlefield">';
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 '</td><td>';
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 '</td></tr>';
// From
@ -1144,7 +1144,7 @@ if ($action == 'create')
*/
// Topic
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->title.'</td></tr>';
// From
print '<tr><td class="titlefield">'.$langs->trans("MailFrom").'</td><td colspan="3">'.dol_print_email($object->email_from, 0, 0, 0, 0, 1).'</td></tr>';
// To

View File

@ -237,7 +237,7 @@ if ($object->fetch($id) >= 0)
print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->title.'</td></tr>';
print '<tr><td>'.$langs->trans("MailFrom").'</td><td colspan="3">';
$emailarray = CMailFile::getArrayAddress($object->email_from);

View File

@ -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))

View File

@ -182,7 +182,7 @@ if ($result) {
print '<tr class="oddeven">';
print '<td class="nowrap">'.$mailstatic->getNomUrl(1).'</td>';
print '<td>'.dol_trunc($obj->titre, 38).'</td>';
print '<td>'.dol_trunc($obj->title, 38).'</td>';
print '<td class="center">'.dol_print_date($db->jdate($obj->date_creat), 'day').'</td>';
print '<td class="center">'.($obj->nbemail ? $obj->nbemail : "0").'</td>';
print '<td class="right">'.$mailstatic->LibStatut($obj->statut, 5).'</td>';

View File

@ -238,7 +238,7 @@ if ($resql)
print $email->getNomUrl(1);
print '</td>';
print '<td>'.$obj->titre.'</td>';
print '<td>'.$obj->title.'</td>';
// Date creation
print '<td class="center">';

View File

@ -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');

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2007-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* 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