From 63ec14e47ddefcab2d62dbd1d8ff9d263072e7b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Sep 2017 20:18:11 +0200 Subject: [PATCH] Convert sode to send member info email into new generic email template system. --- htdocs/adherents/card.php | 15 ++--- htdocs/adherents/class/adherent.class.php | 62 +++++-------------- htdocs/core/actions_sendmails.inc.php | 6 ++ htdocs/core/class/html.formactions.class.php | 33 +++++----- htdocs/core/class/html.formmail.class.php | 16 ++++- htdocs/core/lib/functions.lib.php | 27 +++++++- htdocs/core/tpl/card_presend.tpl.php | 21 ------- .../mysql/data/llx_c_email_templates.sql | 23 +++++++ .../install/mysql/migration/6.0.0-7.0.0.sql | 2 + 9 files changed, 112 insertions(+), 93 deletions(-) create mode 100644 htdocs/install/mysql/data/llx_c_email_templates.sql diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 758fad1e015..b2bb56b14b5 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -238,6 +238,7 @@ if (empty($reshook)) } } + /* if ($action == 'confirm_sendinfo' && $confirm == 'yes') { if ($object->email) @@ -250,7 +251,7 @@ if (empty($reshook)) $langs->load("mails"); setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs'); } - } + }*/ if ($action == 'update' && ! $cancel && $user->rights->adherent->creer) { @@ -1363,10 +1364,10 @@ else } // Confirm send card by mail - if ($action == 'sendinfo') + /*if ($action == 'sendinfo') { print $form->formconfirm("card.php?rowid=".$id,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1); - } + }*/ // Confirm terminate if ($action == 'resign') @@ -1616,6 +1617,7 @@ else // Send card by email // TODO Remove this to replace with a template + /* if ($user->rights->adherent->creer) { if ($object->statut >= 1) @@ -1631,7 +1633,7 @@ else else { print '
'.$langs->trans("SendCardByMail")."
"; - } + }*/ // Modify if ($user->rights->adherent->creer) @@ -1790,11 +1792,10 @@ else print '
'; // List of actions on element - /* Already in tab Agenda/Events include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'member', $socid, 1); - */ + $somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', 10); + print '
'; } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 793f972139b..81fc6ea5909 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -213,51 +213,23 @@ class Adherent extends CommonObject // Substitutions $substitutionarray=array( - '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, - '__ID__'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, - '__CIVILITY__'=>$this->getCivilityLabel(), - '__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, - '__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, - '__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), - '__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, - '__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address, - '__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, - '__TOWN_'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, - '__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, - '__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, - '__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, - '__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, - '__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, - '__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass, - // For backward compatibility - '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, - '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, - '%CIVILITY%'=>$this->getCivilityLabel(), - '%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, - '%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, - '%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), - '%COMPANY%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, - '%ADDRESS%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address, - '%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, - '%TOWN%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, - '%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, - '%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, - '%BIRTH%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, - '%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, - '%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, - '%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass, - '%TYPE%'=>$msgishtml?dol_htmlentitiesbr($this->type):$this->type, - '%PHONE_PRO%'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone, - '%PHONE_PERSO%'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso, - '%PHONE_MOBILE%'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile, - // For backward compatibility - '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, - '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, - '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, - '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, - '%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, - '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, - '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, + '__CIVILITY__'=>$this->getCivilityLabel(), + '__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, + '__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, + '__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), + '__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, + '__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address, + '__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, + '__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, + '__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, + '__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, + '__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, + '__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, + '__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, + '__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass, + '__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone, + '__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso, + '__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile, ); complete_substitutions_array($substitutionarray, $langs, $this); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index e0bd7081043..4439f0034ce 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -360,6 +360,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $subject=make_substitutions($subject, $substitutionarray); $message=make_substitutions($message, $substitutionarray); + if (method_exists($object, 'makeSubstitution')) + { + $subject = $object->makeSubstitution($subject); + $message = $object->makeSubstitution($message); + } + // Send mail (substitutionarray must be done just before this) if (empty($sendcontext)) $sendcontext = 'standard'; $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index f09dab9be38..b93083d9a9f 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -150,14 +150,14 @@ class FormActions /** * Show list of actions for element * - * @param Object $object Object - * @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' - * @param int $socid socid of user - * @param int $forceshowtitle Show title even if there is no actions to show - * @param string $morecss More css on table - * @param int $max Max number of record + * @param Object $object Object + * @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' + * @param int $socid Socid of user + * @param int $forceshowtitle Show title even if there is no actions to show + * @param string $morecss More css on table + * @param int $max Max number of record * @param string $moreparambacktopage More param for the backtopage - * @return int <0 if KO, >=0 if OK + * @return int <0 if KO, >=0 if OK */ function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='') { @@ -175,17 +175,18 @@ class FormActions $num = count($listofactions); if ($num || $forceshowtitle) { - if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill'); + if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill'); elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill'); - elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal'); - elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment'); - elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal'); - elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder'); + elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal'); + elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment'); + elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal'); + elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder'); elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder'); - elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping'); - elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter'); - elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); - elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); + elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping'); + elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter'); + elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); + elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); + elseif ($typeelement == 'member') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); else $title=$langs->trans("Actions"); $urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:''); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ed99002c442..3e09c1a83e8 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -339,16 +339,25 @@ class FormMail extends Form $modelmail_array=array(); foreach($this->lines_model as $line) { - $modelmail_array[$line->id]=$line->label; + $langs->trans("members"); + if (preg_match('/\((.*)\)/', $line->label, $reg)) + { + $modelmail_array[$line->id]=$langs->trans($reg[1]); // langs->trans when label is __(xxx)__ + } + else + { + $modelmail_array[$line->id]=$line->label; + } if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')'; if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private"); //if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' '; } } - // Zone to select its email template + // Zone to select email template if (count($modelmail_array)>0) { + // If list of template is filled $out.= '
'."\n"; $out.= ''.$langs->trans('SelectMailModel').': '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100'); if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); @@ -363,6 +372,7 @@ class FormMail extends Form 'invoice_supplier_send','thirdparty','contract','all' ))) { + // If list of template is empty $out.= '
'."\n"; $out.= $langs->trans('SelectMailModel').': '; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); @@ -1020,7 +1030,7 @@ class FormMail extends Form $sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position"; $sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates'; $sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')"; - $sql.= " AND entity IN (".getEntity('c_email_templates', 0).")"; + $sql.= " AND entity IN (".getEntity('c_email_templates', 1).")"; $sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own. if ($active >= 0) $sql.=" AND active = ".$active; //if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 706e2a11a1b..704653ade84 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -129,7 +129,7 @@ function getEntity($element, $shared=1) else { $out=''; - $addzero = array('user', 'usergroup', 'email_template', 'default_values'); + $addzero = array('user', 'usergroup', 'c_email_templates', 'email_template', 'default_values'); if (in_array($element, $addzero)) $out.= '0,'; $out.= $conf->entity; return $out; @@ -5240,6 +5240,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__'; $substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__'; + $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; + $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; + $substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__'; + $substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__'; $substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__'; $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_REF__'; @@ -5263,6 +5267,27 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : '')); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : ''); + // TODO USe this ? + $msgishtml = 0; + + if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel(); + $substitutionarray['__MEMBER_FIRSTNAME__']=$msgishtml?dol_htmlentitiesbr($object->firstname):$object->firstname; + $substitutionarray['__MEMBER_LASTNAME__']=$msgishtml?dol_htmlentitiesbr($object->lastname):$object->lastname; + if (method_exists($object, 'getFullName')) $substitutionarray['__MEMBER_FULLNAME__']=$msgishtml?dol_htmlentitiesbr($object->getFullName($langs)):$object->getFullName($langs); + $substitutionarray['__MEMBER_COMPANY__']=$msgishtml?dol_htmlentitiesbr($object->societe):$object->societe; + $substitutionarray['__MEMBER_ADDRESS__']=$msgishtml?dol_htmlentitiesbr($object->address):$object->address; + $substitutionarray['__MEMBER_ZIP__']=$msgishtml?dol_htmlentitiesbr($object->zip):$object->zip; + $substitutionarray['__MEMBER_TOWN__']=$msgishtml?dol_htmlentitiesbr($object->town):$object->town; + $substitutionarray['__MEMBER_COUNTRY__']=$msgishtml?dol_htmlentitiesbr($object->country):$object->country; + $substitutionarray['__MEMBER_EMAIL__']=$msgishtml?dol_htmlentitiesbr($object->email):$object->email; + $substitutionarray['__MEMBER_BIRTH__']=$msgishtml?dol_htmlentitiesbr($birthday):$birthday; + $substitutionarray['__MEMBER_PHOTO__']=$msgishtml?dol_htmlentitiesbr($object->photo):$object->photo; + $substitutionarray['__MEMBER_LOGIN__']=$msgishtml?dol_htmlentitiesbr($object->login):$object->login; + $substitutionarray['__MEMBER_PASSWORD__']=$msgishtml?dol_htmlentitiesbr($object->pass):$object->pass; + $substitutionarray['__MEMBER_PHONE__']=$msgishtml?dol_htmlentitiesbr($object->phone):$object->phone; + $substitutionarray['__MEMBER_PHONEPRO__']=$msgishtml?dol_htmlentitiesbr($object->phone_perso):$object->phone_perso; + $substitutionarray['__MEMBER_PHONEMOBILE__']=$msgishtml?dol_htmlentitiesbr($object->phone_mobile):$object->phone_mobile; + if (is_object($object->thirdparty) && $object->thirdparty->id > 0) { $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:''); diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 9e0d6f09fcf..e24fbb44f7a 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -149,27 +149,6 @@ if ($action == 'presend') $substitutionarray['__PERSONALIZED__'] = ''; // deprecated $substitutionarray['__CONTACTCIVNAME__'] = ''; - // Choose one contact for the __CONTACTCIVNAME__ TODO Really not reliable. - /* - $custcontact = ''; - $contactarr = array(); - $contactarr = $object->liste_contact(-1, 'external'); - if (is_array($contactarr) && count($contactarr) > 0) - { - foreach ($contactarr as $contact) - { - if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label - $contactstatic = new Contact($db); - $contactstatic->fetch($contact ['id']); - $custcontact = $contactstatic->getFullName($langs, 1); - } - } - - if (! empty($custcontact)) { - $formmail->substit['__CONTACTCIVNAME__'] = $custcontact; - } - }*/ - $parameters = array( 'mode' => 'formemail' ); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql new file mode 100644 index 00000000000..b3bb3292ba6 --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -0,0 +1,23 @@ +-- Copyright (C) 2017 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,active,topic,content,content_lines) VALUES (0,null,'member',null,0,null,null,'(SendAnEMailToMember)',1,1,'__(CardContent)__','__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__',null); diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 23467355174..c8f2142684c 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -66,6 +66,8 @@ ALTER TABLE llx_contrat MODIFY COLUMN ref_ext varchar(50); UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL; +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,active,topic,content,content_lines) VALUES (0,null,'member',null,0,null,null,'(SendAnEMailToMember)',1,1,'__(CardContent)__','__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__',null); + INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1); INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Exemple: 6xxxxx', 0, 0, '', '20', 1, 1); INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'PROFIT', 'Balance', '', 0, 1, 'VENTES+DEPENSES', '30', 1, 1);