From 7363ae17ee82fb9765850eda81acb846b1b5266e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:09:46 +0100 Subject: [PATCH] Move setup of email for module module into email templates --- htdocs/adherents/admin/adherent_emails.php | 62 ++++--------- htdocs/adherents/card.php | 4 +- htdocs/adherents/class/adherent.class.php | 9 +- htdocs/admin/mails_templates.php | 15 ++-- htdocs/core/class/html.form.class.php | 34 +++---- htdocs/core/class/html.formmail.class.php | 3 +- htdocs/core/lib/admin.lib.php | 86 ++++++++++++------ htdocs/core/modules/modAdherent.class.php | 90 +++++++++---------- .../mysql/data/llx_c_email_templates.sql | 10 ++- .../install/mysql/migration/6.0.0-7.0.0.sql | 2 +- .../install/mysql/migration/7.0.0-8.0.0.sql | 21 +++-- htdocs/install/mysql/tables/llx_const.sql | 4 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/members.lang | 38 +++++--- 14 files changed, 206 insertions(+), 173 deletions(-) diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 292b9c77339..88514d83da3 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -39,7 +39,7 @@ $langs->load("members"); if (! $user->admin) accessforbidden(); -$type=array('yesno','texte','chaine'); +$oldtypetonewone=array('texte'=>'text','chaine'=>'string'); // old type to new ones $action = GETPOST('action','alpha'); @@ -53,20 +53,7 @@ if ($action == 'updateall') { $db->begin(); $res1=$res2=$res3=$res4=$res5=$res6=0; - $res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - $res2=dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - $res3=dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); - $res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); - // Use vat for invoice creation - if ($conf->facture->enabled) - { - $res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - $res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - } - } + $res1=dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); @@ -82,19 +69,16 @@ if ($action == 'updateall') // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { + $constlineid = GETPOST('rowid','int'); $constname=GETPOST('constname','alpha'); - $constvalue=(GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue')); - if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE' || $constname=='ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue=''; - if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice - { - if ($constvalue) $constvalue=0; - else $constvalue=1; - } + $constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); + $consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); + $constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote')); - $consttype=GETPOST('consttype','alpha'); - $constnote=GETPOST('constnote'); - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; + + $res=dolibarr_set_const($db,$constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); if (! $res > 0) $error++; @@ -111,7 +95,7 @@ if ($action == 'update' || $action == 'add') // Action activation d'un sous module du module adherent if ($action == 'set') { - $result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value'),'',0,'',$conf->entity); + $result=dolibarr_set_const($db, GETPOST('name','alpha'), GETPOST('value'), '', 0, '', $conf->entity); if ($result < 0) { print $db->error(); @@ -157,23 +141,15 @@ print ''; * Editing global variables not related to a specific theme */ $constantes=array( - 'ADHERENT_MAIL_FROM', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL', - 'ADHERENT_AUTOREGISTER_MAIL_SUBJECT', - 'ADHERENT_AUTOREGISTER_MAIL', - 'ADHERENT_MAIL_VALID_SUBJECT', - 'ADHERENT_MAIL_VALID', - 'ADHERENT_MAIL_COTIS_SUBJECT', - 'ADHERENT_MAIL_COTIS', - 'ADHERENT_MAIL_RESIL_SUBJECT', - 'ADHERENT_MAIL_RESIL', - ); - -$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; -$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; -$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; -$helptext.='__YEAR__, __MONTH__, __DAY__'; + 'ADHERENT_MAIL_FROM'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ + 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ +); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 81757aab9e0..41a49bd386d 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1353,7 +1353,7 @@ else $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_VALID_SUBJECT); $texttosend=$object->makeSubstitution($adht->getMailOnValid()); - $tmp=$langs->trans("SendAnEMailToMember"); + $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
'.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; $tmp.='
'.$langs->trans("MailRecipient").': '.$object->email.''; $helpcontent=''; @@ -1395,7 +1395,7 @@ else $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_RESIL_SUBJECT); $texttosend=$object->makeSubstitution($adht->getMailOnResiliate()); - $tmp=$langs->trans("SendAnEMailToMember"); + $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; $tmp.=$langs->trans("MailRecipient").': '.$object->email.')'; $helpcontent=''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a22a2d57c0d..3ef7af75ceb 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2562,9 +2562,12 @@ class Adherent extends CommonObject $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); - $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, '(SendReminderForExpiredSubscriptionTitle)'); + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; - if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent); //if (is_array($adherent->thirdparty)) $substitutionarraycomp = ... @@ -2591,7 +2594,7 @@ class Adherent extends CommonObject } else { - $blockingerrormsg="Can't find email template '(SendReminderForExpiredSubscriptionTitle)'"; + $blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding"; $nbko++; break; } diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 21d3cb2eae5..79c4d4765be 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -91,17 +91,17 @@ $tabsqlsort[25]="label ASC, lang ASC, position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,joinfiles,content"; +$tabfield[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines'; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content"; +$tabfieldvalue[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines'; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content"; +$tabfieldinsert[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines'; $tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays @@ -233,8 +233,7 @@ if (empty($reshook)) $ok=0; $fieldnamekey=$listfield[$f]; // We take translate key of field - if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; - if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments'; + if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Code'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; if ($fieldnamekey == 'note') $fieldnamekey = 'Note'; if ($fieldnamekey == 'type_template') $fieldnamekey = 'TypeOfTemplate'; @@ -478,7 +477,7 @@ foreach ($fieldlist as $field => $value) if ($fieldlist[$field]=='lang') { $valuetoshow=(empty($conf->global->MAIN_MULTILANGS) ? ' ' : $langs->trans("Language")); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='private') { $align='center'; } if ($fieldlist[$field]=='position') { $align='center'; } @@ -695,7 +694,7 @@ if ($resql) if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='private') { $align='center'; } if ($fieldlist[$field]=='position') { $align='center'; } @@ -990,7 +989,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') { $selectedlang = $langs->defaultlang; if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; - print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1); + print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 32172ea60f0..8c575b6478e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5421,23 +5421,23 @@ class Form * Return a HTML select string, built from an array of key+value. * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. * - * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect - * @param array $array Array (key => value) - * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value. - * @param int $key_in_label 1 to show key into label with format "[key] value" - * @param int $value_as_key 1 to use value as key - * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container - * @param int $translate 1=Translate and encode value - * @param int $maxlen Length maximum for labels - * @param int $disabled Html select box is disabled - * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order - * @param string $morecss Add more class to css styles - * @param int $addjscombo Add js combo - * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set - * @param int $disablebademail Check if an email is found into value and if not disable and colorize entry - * @param int $nohtmlescape No html escaping. - * @return string HTML select string. + * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect + * @param array $array Array (key => value) + * @param string|string[] $id Preselected key or preselected keys for multiselect + * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value. + * @param int $key_in_label 1 to show key into label with format "[key] value" + * @param int $value_as_key 1 to use value as key + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param int $translate 1=Translate and encode value + * @param int $maxlen Length maximum for labels + * @param int $disabled Html select box is disabled + * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order + * @param string $morecss Add more class to css styles + * @param int $addjscombo Add js combo + * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set + * @param int $disablebademail Check if an email is found into value and if not disable and colorize entry + * @param int $nohtmlescape No html escaping. + * @return string HTML select string. * @see multiselectarray */ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 33aab58eb2e..2a93a3dc2b6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -998,7 +998,7 @@ class FormMail extends Form * @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $active 1=Only active template, 0=Only disabled, -1=All * @param string $label Label of template - * @return ModelMail + * @return ModelMail One instance of ModelMail */ public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1, $label='') { @@ -1153,6 +1153,7 @@ class FormMail extends Form $line->topic=$obj->topic; $line->content=$obj->content; $line->content_lines=$obj->content_lines; + $this->lines_model[]=$line; } $this->db->free($resql); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 4bd9b097b3d..85a9be1f0fd 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1321,14 +1321,15 @@ function complete_elementList_with_modules(&$elementList) /** * Show array with constants to edit * - * @param array $tableau Array of constants + * @param array $tableau Array of constants array('key'=>type, ) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all * @param string $helptext Help * @return void */ function form_constantes($tableau, $strictw3c=0, $helptext='') { - global $db,$bc,$langs,$conf,$_Avery_Labels; + global $db,$bc,$langs,$conf,$user; + global $_Avery_Labels; $form = new Form($db); @@ -1343,11 +1344,20 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') print ''; if (empty($strictw3c)) print ''.$langs->trans("Action").''; print "\n"; - $var=true; $listofparam=array(); - foreach($tableau as $const) // Loop on each param + foreach($tableau as $key => $const) // Loop on each param { + // $const is a const key like 'MYMODULE_ABC' + if (is_numeric($key)) { + $type = 'string'; + } + else + { + $type = $const; + $const = $key; + } + $sql = "SELECT "; $sql.= "rowid"; $sql.= ", ".$db->decrypt('name')." as name"; @@ -1355,7 +1365,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') $sql.= ", type"; $sql.= ", note"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$db->decrypt('name')." = '".$const."'"; + $sql.= " WHERE ".$db->decrypt('name')." = '".$db->escape($const)."'"; $sql.= " AND entity IN (0, ".$conf->entity.")"; $sql.= " ORDER BY name ASC, entity DESC"; $result = $db->query($sql); @@ -1365,23 +1375,26 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') { $obj = $db->fetch_object($result); // Take first result of select - - // For avoid warning in strict mode - if (empty($obj)) { - $obj = (object) array('rowid'=>'','name'=>'','value'=>'','type'=>'','note'=>''); + if (empty($obj)) // If not yet into table + { + $obj = (object) array('rowid'=>'','name'=>$const,'value'=>'','type'=>$type,'note'=>''); } - if (empty($strictw3c)) print "\n".'
'; + if (empty($strictw3c)) + { + print "\n".''; + print ''; + } print ''; // Show constant print ''; - print ''; - print ''; + if (empty($strictw3c)) print ''; print ''; print ''; - print ''; + print ''; + print ''; print $langs->trans('Desc'.$const); @@ -1428,34 +1441,57 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') } print $form->selectarray('constvalue'.(empty($strictw3c)?'':'[]'),$arrayoflabels,($obj->value?$obj->value:'CARD'),1,0,0); print ''; + print ''; print ''; } else { print ''; - if (in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT','ADHERENT_ETIQUETTE_TEXT'))) + print ''; + print ''; + if ($obj->type == 'textarea' || in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT','ADHERENT_ETIQUETTE_TEXT'))) { print '\n"; - print ''; } - else if (in_array($const,array('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) + elseif ($obj->type == 'html') { - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%'); - $doleditor->Create(); - print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%'); + $doleditor->Create(); } - else if ($obj->type == 'yesno') + elseif ($obj->type == 'yesno') { - print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1); - print ''; + print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1); } - else + elseif (preg_match('/emailtemplate/', $obj->type)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $tmp=explode(':', $obj->type); + + $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, -1); // We set lang=null to get in priority record with no lang + //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); + $arrayofmessagename=array(); + if (is_array($formmail->lines_model)) + { + foreach($formmail->lines_model as $modelmail) + { + //var_dump($modelmail); + $moreonlabel=''; + if (! empty($arrayofmessagename[$modelmail->label])) $moreonlabel=' ('.$langs->trans("SeveralLangugeVariatFound").')'; + $arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/','',$modelmail->label)).$moreonlabel; + } + } + //var_dump($arraydefaultmessage); + //var_dump($arrayofmessagename); + print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value, 'None', 1, 0, '', 0, 0, 0, '', '', 1); + } + else // type = 'string' ou 'chaine' { print ''; - print ''; } print ''; } diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index f3369d58582..0ffe195fb6d 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -83,34 +83,7 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_MAIL_RESIL"; - $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt"; - $this->const[$r][3] = "Mail de résiliation"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_MAIL_VALID"; - $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n__INFOS__\r\n\r\n"; - $this->const[$r][3] = "Mail de validation"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_MAIL_VALID_SUBJECT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Votre adhésion a été validée"; - $this->const[$r][3] = "Sujet du mail de validation"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_MAIL_RESIL_SUBJECT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Résiliation de votre adhésion"; - $this->const[$r][3] = "Sujet du mail de résiliation"; - $this->const[$r][4] = 0; - $r++; - + // For emails $this->const[$r][0] = "ADHERENT_MAIL_FROM"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; @@ -118,20 +91,35 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_MAIL_COTIS"; - $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Bonjour __FIRSTNAME__,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée"; - $this->const[$r][3] = "Mail de validation de cotisation"; + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingEmailOnAutoSubscription)"; + $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_MAIL_COTIS_SUBJECT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Reçu de votre cotisation"; - $this->const[$r][3] = "Sujet du mail de validation de cotisation"; + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingEmailOnNewSubscription)"; + $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingReminderForExpiredSubscription)"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_CANCELATION"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingEmailOnCancelation)"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + + // For cards $this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "__YEAR__"; @@ -160,20 +148,6 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_BANK_ACCOUNT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = ""; - $this->const[$r][3] = "ID du Compte banquaire utilise"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_BANK_CATEGORIE"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = ""; - $this->const[$r][3] = "ID de la catégorie bancaire des cotisations"; - $this->const[$r][4] = 0; - $r++; - $this->const[$r][0] = "ADHERENT_ETIQUETTE_TYPE"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "L7163"; @@ -188,6 +162,22 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; + // For subscriptions + $this->const[$r][0] = "ADHERENT_BANK_ACCOUNT"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = ""; + $this->const[$r][3] = "ID of bank account to use"; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "ADHERENT_BANK_CATEGORIE"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = ""; + $this->const[$r][3] = "ID of bank transaction category to use"; + $this->const[$r][4] = 0; + $r++; + + // Boxes //------- $this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home')); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index ad8d8ffd199..0f6c76cb1b1 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -20,9 +20,13 @@ -- 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,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,

\n\n__(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__

\n__(Sincerely)__
__USER_SIGNATURE__',null); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendReminderForExpiredSubscriptionTitle)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null); - INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__INFOS__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(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__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); + 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 e6296bb8eae..c19530acd01 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 @@ -197,7 +197,7 @@ ALTER TABLE llx_c_email_templates ADD COLUMN enabled varchar(255) DEFAULT '1'; ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles varchar(255) DEFAULT '1'; ALTER TABLE llx_c_email_templates MODIFY COLUMN content mediumtext; -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,

\n\n__(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__

\n__(Sincerely)__
__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,

\n\n__(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__

\n__(Sincerely)__
__USER_SIGNATURE__',null); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',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); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index c1d7e59cbed..89a704679a3 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -286,6 +286,16 @@ CREATE TABLE llx_societe_account( -- VMYSQL4.3 ALTER TABLE llx_societe_account MODIFY COLUMN pass_encoding varchar(24) NULL; +ALTER TABLE llx_const MODIFY type varchar(64) DEFAULT 'string'; + +UPDATE llx_const set type = 'text' where type = 'texte'; +UPDATE llx_const set type = 'html' where name in ('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'); + +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_AUTOREGISTER_MAIL' AND type != 'emailtemplate:member'; +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_VALID' AND type != 'emailtemplate:member'; +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_COTIS' AND type != 'emailtemplate:member'; +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_RESIL' AND type != 'emailtemplate:member'; + ALTER TABLE llx_societe_account ADD COLUMN key_account varchar(128); ALTER TABLE llx_societe_account ADD INDEX idx_societe_account_rowid (rowid); @@ -303,10 +313,11 @@ ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_societe FO ALTER TABLE llx_societe_rib MODIFY COLUMN max_total_amount_of_all_payments double(24,8); ALTER TABLE llx_societe_rib MODIFY COLUMN total_amount_of_all_payments double(24,8); - - - -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,

\n\n__(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__

\n__(Sincerely)__
__USER_SIGNATURE__',null); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendReminderForExpiredSubscriptionTitle)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(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__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); diff --git a/htdocs/install/mysql/tables/llx_const.sql b/htdocs/install/mysql/tables/llx_const.sql index 22e552213aa..806a3337291 100644 --- a/htdocs/install/mysql/tables/llx_const.sql +++ b/htdocs/install/mysql/tables/llx_const.sql @@ -28,8 +28,8 @@ create table llx_const rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id - value text NOT NULL, -- max 65535 caracteres - type varchar(6), + value text NOT NULL, -- max 65535 caracteres + type varchar(64) DEFAULT 'string', visible tinyint DEFAULT 1 NOT NULL, note text, tms timestamp diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3a7e8a7d14a..ac3e27a7166 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1775,6 +1775,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2') +SeveralLangugeVariatFound=Several language variants found ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index befb763d60c..8a8346aac4a 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -13,8 +13,6 @@ ListOfValidatedPublicMembers=List of validated public members ErrorThisMemberIsNotPublic=This member is not public ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, login: %s) is already linked to a third party %s. Remove this link first because a third party can't be linked to only a member (and vice versa). ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours. -ThisIsContentOfYourCard=Hi.

This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

-CardContent=Content of your member card SetLinkToUser=Link to a Dolibarr user SetLinkToThirdParty=Link to a Dolibarr third party MembersCards=Members business cards @@ -108,17 +106,33 @@ PublicMemberCard=Member public card SubscriptionNotRecorded=Subscription not recorded AddSubscription=Create subscription ShowSubscription=Show subscription -SendAnEMailToMember=Send information email to member +# Label of email templates +SendingAnEMailToMember=Sending information email to member +SendingEmailOnAutoSubscription=Sending email on auto registration +SendingEmailOnMemberValidation=Sending email on new member validation +SendingEmailOnNewSubscription=Sending email on new subscription +SendingReminderForExpiredSubscription=Sending reminder for expired subscription +SendingEmailOnCancelation=Sending email on cancelation +# Topic of email templates +YourMembershipRequestWasReceived=Your membership was received. +YourMembershipWasValidated=Your membership was validated +YourSubscriptionWasRecorded=Your new subscription was recorded +SubscriptionReminderEmail=Subscription reminder +YourMembershipWasCanceled=You membership was canceled +CardContent=Content of your member card +# Text of email templates +ThisIsContentOfYourMembershipRequestWasReceived=We want to let you know that your membership request was received.

+ThisIsContentOfYourMembershipWasValidated=We want to let you know that your membership was validated with the following information:

+ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.

+ThisIsContentOfSubscriptionReminderEmail=We want to let you know thet your subscription is about to expire. We hope you can make a renewal of it.

+ThisIsContentOfYourCard=This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the e-mail received in case of auto-inscription of a guest DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail received in case of auto-inscription of a guest -DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=EMail subject for member autosubscription -DescADHERENT_AUTOREGISTER_MAIL=EMail for member autosubscription -DescADHERENT_MAIL_VALID_SUBJECT=EMail subject for member validation -DescADHERENT_MAIL_VALID=EMail for member validation -DescADHERENT_MAIL_COTIS_SUBJECT=EMail subject for subscription -DescADHERENT_MAIL_COTIS=EMail for subscription -DescADHERENT_MAIL_RESIL_SUBJECT=EMail subject for member resiliation -DescADHERENT_MAIL_RESIL=EMail for member resiliation +DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Template Email to use to send email to a member on member autosubscription +DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Template EMail to use to send email to a member on member validation +DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Template Email to use to send email to a member on new subscription recording +DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Template Email to use to send email remind when subscription is about to expire +DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Template Email to use to send email to a member on member cancelation DescADHERENT_MAIL_FROM=Sender EMail for automatic emails DescADHERENT_ETIQUETTE_TYPE=Format of labels page DescADHERENT_ETIQUETTE_TEXT=Text printed on member address sheets @@ -182,5 +196,3 @@ NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind) -YourSubscriptionHasExpired=Your subscription has expired -ThisIsContentOfSubscriptionReminderEmail=This is an email to remind you that your subscription is about to expire.