Enhance email template editor
This commit is contained in:
parent
4c23363400
commit
ce7ce82801
@ -53,7 +53,6 @@ $id=GETPOST('id','int');
|
||||
$rowid=GETPOST('rowid','alpha');
|
||||
$search_label=GETPOST('search_label','alpha');
|
||||
$search_type_template=GETPOST('search_type_template','alpha');
|
||||
$search_topic=GETPOST('search_topic','alpha');
|
||||
$search_lang=GETPOST('search_lang','alpha');
|
||||
$search_fk_user=GETPOST('search_fk_user','intcomma');
|
||||
$search_topic=GETPOST('search_topic','alpha');
|
||||
@ -94,26 +93,20 @@ $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,content";
|
||||
$tabfield[25]= "label,type_template,lang,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,content";
|
||||
$tabfieldvalue[25]= "label,type_template,fk_user,lang,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,content";
|
||||
$tabfieldinsert[25]= "label,type_template,fk_user,lang,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
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
||||
$tabrowid=array();
|
||||
$tabrowid[25]= "";
|
||||
|
||||
// Condition to show dictionary in setup page
|
||||
$tabcond=array();
|
||||
$tabcond[25]= true;
|
||||
@ -153,7 +146,7 @@ else
|
||||
|
||||
|
||||
$tabhelp=array();
|
||||
$tabhelp[25] = array('topic'=>$helpsubstit,'content'=>$helpsubstit,'content_lines'=>$helpsubstitforlines,'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[25] = array('topic'=>$helpsubstit,'joinfiles'=>$langs->trans('AttachMainDocByDefault'), 'content'=>$helpsubstit,'content_lines'=>$helpsubstitforlines,'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck=array();
|
||||
@ -229,10 +222,12 @@ if (empty($reshook))
|
||||
$ok=1;
|
||||
foreach ($listfield as $f => $value)
|
||||
{
|
||||
// Not mandatory fields
|
||||
if ($value == 'joinfiles') continue;
|
||||
if ($value == 'content') continue;
|
||||
if ($value == 'content_lines') continue;
|
||||
if ($value == 'content') $value='content-'.$rowid;
|
||||
if ($value == 'content_lines') $value='content_lines-'.$rowid;
|
||||
|
||||
if ($value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid];
|
||||
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position')
|
||||
{
|
||||
@ -256,34 +251,14 @@ if (empty($reshook))
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd'))
|
||||
{
|
||||
if ($tabrowid[$id])
|
||||
{
|
||||
// Recupere id libre pour insertion
|
||||
$newid=0;
|
||||
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$newid=($obj->newid + 1);
|
||||
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
// List of fields
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||
$sql.= $tabrowid[$id].",";
|
||||
$sql.= $tabfieldinsert[$id];
|
||||
$sql.=",active)";
|
||||
$sql.= " VALUES(";
|
||||
|
||||
// List of values
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||
$sql.= $newid.",";
|
||||
$i=0;
|
||||
foreach ($listfieldinsert as $f => $value)
|
||||
{
|
||||
@ -322,17 +297,11 @@ if (empty($reshook))
|
||||
// Si verif ok et action modify, on modifie la ligne
|
||||
if ($ok && GETPOST('actionmodify'))
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
$rowidcol="rowid";
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||
// Modifie valeur des champs
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify))
|
||||
{
|
||||
$sql.= $tabrowid[$id]."=";
|
||||
$sql.= "'".$db->escape($rowid)."', ";
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($listfieldmodify as $field)
|
||||
{
|
||||
@ -340,8 +309,10 @@ if (empty($reshook))
|
||||
if ($field == 'lang') $keycode='langcode';
|
||||
|
||||
if ($field == 'fk_user' && ! ($_POST['fk_user'] > 0)) $_POST['fk_user']='';
|
||||
if ($field == 'topic') $_POST['topic']=$_POST['topic-'.$rowid];
|
||||
if ($field == 'joinfiles') $_POST['joinfiles']=$_POST['joinfiles-'.$rowid];
|
||||
if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid];
|
||||
if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid];
|
||||
if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid];
|
||||
if ($field == 'entity') $_POST[$keycode] = $conf->entity;
|
||||
if ($i) $sql.=",";
|
||||
$sql.= $field."=";
|
||||
@ -354,7 +325,11 @@ if (empty($reshook))
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
if ($resql)
|
||||
{
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($db->error(), null, 'errors');
|
||||
}
|
||||
@ -363,8 +338,7 @@ if (empty($reshook))
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
$rowidcol="rowid";
|
||||
|
||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'";
|
||||
|
||||
@ -386,15 +360,9 @@ if (empty($reshook))
|
||||
// activate
|
||||
if ($action == $acts[0])
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
$rowidcol="rowid";
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'";
|
||||
}
|
||||
elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$code."'";
|
||||
}
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
@ -406,15 +374,9 @@ if (empty($reshook))
|
||||
// disable
|
||||
if ($action == $acts[1])
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
$rowidcol="rowid";
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'";
|
||||
}
|
||||
elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$code."'";
|
||||
}
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
@ -475,7 +437,7 @@ if ($action == 'delete')
|
||||
//var_dump($elementList);
|
||||
|
||||
|
||||
$sql="SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, content_lines, content, active";
|
||||
$sql="SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, joinfiles, content_lines, content, active";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||
$sql.=" WHERE entity IN (".getEntity('email_template').")";
|
||||
if (! $user->admin)
|
||||
@ -541,11 +503,14 @@ foreach ($fieldlist as $field => $value)
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
|
||||
if ($fieldlist[$field]=='topic') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='joinfiles') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; }
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
print '<td align="'.$align.'">';
|
||||
@ -560,14 +525,11 @@ foreach ($fieldlist as $field => $value)
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||
}
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="id" value="' . $id . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Line to enter new values (input fields)
|
||||
print "<tr " . $bcnd[$var] . ">";
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
if (GETPOST('actionadd'))
|
||||
@ -587,6 +549,10 @@ $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters,
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
||||
|
||||
// Line to enter new values (input fields)
|
||||
print "<tr " . $bcnd[$var] . ">";
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($action == 'edit') {
|
||||
@ -596,32 +562,51 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
print '<td align="right" colspan="3">';
|
||||
print '<td align="right">';
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
|
||||
$fieldsforcontent = array('content');
|
||||
$fieldsforcontent = array('topic', 'joinfiles', 'content');
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content','content_lines'); }
|
||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
{
|
||||
print '<tr class="impair nodrag nodrop nohover"><td colspan="6">';
|
||||
print '<tr class="impair nodrag nodrop nohover"><td colspan="6" class="nobottom">';
|
||||
// Label
|
||||
if ($tmpfieldlist == 'topic')
|
||||
{
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("Topic"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
|
||||
}
|
||||
if ($tmpfieldlist == 'joinfiles')
|
||||
{
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
|
||||
}
|
||||
if ($tmpfieldlist == 'content')
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong><br>';
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
|
||||
if ($tmpfieldlist == 'content_lines')
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong><br>';
|
||||
|
||||
if ($context != 'hide') {
|
||||
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
$okforextended = true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
|
||||
$okforextended = false;
|
||||
$doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
|
||||
print $doleditor->Create(1);
|
||||
} else
|
||||
print ' ';
|
||||
// Input field
|
||||
if ($tmpfieldlist == 'topic') {
|
||||
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
||||
}
|
||||
else if ($tmpfieldlist == 'joinfiles') {
|
||||
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($context != 'hide') {
|
||||
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
$okforextended = true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
|
||||
$okforextended = false;
|
||||
$doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
|
||||
print $doleditor->Create(1);
|
||||
}
|
||||
else
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
if ($tmpfieldlist == 'content') {
|
||||
print '<td align="center" colspan="3" rowspan="' . (count($fieldsforcontent)) . '">';
|
||||
if ($tmpfieldlist == 'topic') {
|
||||
print '<td align="center" rowspan="' . (count($fieldsforcontent)) . '">';
|
||||
if ($action != 'edit') {
|
||||
print '<input type="submit" class="button" name="actionadd" value="' . $langs->trans("Add") . '">';
|
||||
}
|
||||
@ -704,7 +689,6 @@ if ($resql)
|
||||
elseif (! in_array($value, array('content', 'content_lines'))) print '<td class="liste_titre"></td>';
|
||||
}
|
||||
if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="right" width="64">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
@ -736,11 +720,13 @@ if ($resql)
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
|
||||
if ($fieldlist[$field]=='joinfiles') { $valuetoshow=$langs->trans("FilesAttachedToEmail"); $align='center'; }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
||||
|
||||
// Affiche nom du champ
|
||||
if ($showfield)
|
||||
{
|
||||
@ -755,7 +741,6 @@ if ($resql)
|
||||
|
||||
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print '</tr>';
|
||||
|
||||
if ($num)
|
||||
@ -777,7 +762,8 @@ if ($resql)
|
||||
// Show fields
|
||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||
|
||||
print '<td colspan="3" align="center">';
|
||||
print '<td></td><td></td><td></td>';
|
||||
print '<td align="center">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
@ -785,10 +771,10 @@ if ($resql)
|
||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
|
||||
$fieldsforcontent = array('content');
|
||||
$fieldsforcontent = array('topic', 'joinfiles', 'content');
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES))
|
||||
{
|
||||
$fieldsforcontent = array('content', 'content_lines');
|
||||
$fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines');
|
||||
}
|
||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
{
|
||||
@ -799,17 +785,29 @@ if ($resql)
|
||||
$class = 'tddict';
|
||||
// Show value for field
|
||||
if ($showfield) {
|
||||
|
||||
// Show line for topic, joinfiles and content
|
||||
print '</tr><tr class="oddeven" nohover tr-'.$tmpfieldlist.'-'.$rowid.' ">';
|
||||
print '<td colspan="7">'; // To create an artificial CR for the current tr we are on
|
||||
$okforextended = true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false;
|
||||
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '<td colspan="8">';
|
||||
if ($tmpfieldlist == 'topic')
|
||||
{
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("Topic"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
|
||||
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'-'.$rowid.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
||||
}
|
||||
if ($tmpfieldlist == 'joinfiles')
|
||||
{
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
|
||||
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'-'.$rowid.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
||||
}
|
||||
if ($tmpfieldlist == 'content')
|
||||
{
|
||||
$okforextended = true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false;
|
||||
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
|
||||
print $doleditor->Create(1);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -856,6 +854,10 @@ if ($resql)
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
if ($value == 'joinfiles')
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
|
||||
$class='tddict';
|
||||
// Show value for field
|
||||
@ -880,24 +882,21 @@ if ($resql)
|
||||
if ($param) $url .= '&'.$param;
|
||||
$url.='&';
|
||||
|
||||
// Active
|
||||
// Status / Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td align="center" width="64"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td></td>';
|
||||
|
||||
// Delete link
|
||||
// Modify link / Delete link
|
||||
print '<td align="center" width="64">';
|
||||
if ($canbemodified) print '<a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a>';
|
||||
if ($iserasable)
|
||||
{
|
||||
print '<td align="center" width="64">';
|
||||
print '<a href="'.$url.'action=delete">'.img_delete().'</a>';
|
||||
print ' <a href="'.$url.'action=delete">'.img_delete().'</a>';
|
||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||
print '</td>';
|
||||
}
|
||||
else print '<td></td>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
/*
|
||||
$fieldsforcontent = array('content');
|
||||
@ -1042,7 +1041,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field], array('content','content_lines'))) continue;
|
||||
elseif ($context == 'add' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
elseif ($context == 'edit' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
elseif ($context == 'hide' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
else
|
||||
{
|
||||
$size=''; $class=''; $classtd='';
|
||||
|
||||
@ -79,6 +79,8 @@ UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
|
||||
UPDATE llx_c_email_templates SET lang = '' WHERE lang IS NULL;
|
||||
|
||||
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)__,<br><br>\n\n__(ThisIsContentOfYourCard)__<br>\n__(ID)__ : __ID__<br>\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br>\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br />\n__(Lastname)__ : __MEMBER_LASTNAME__<br />\n__(Fullname)__ : __MEMBER_FULLNAME__<br />\n__(Company)__ : __MEMBER_COMPANY__<br />\n__(Address)__ : __MEMBER_ADDRESS__<br />\n__(Zip)__ : __MEMBER_ZIP__<br />\n__(Town)__ : __MEMBER_TOWN__<br />\n__(Country)__ : __MEMBER_COUNTRY__<br />\n__(Email)__ : __MEMBER_EMAIL__<br />\n__(Birthday)__ : __MEMBER_BIRTH__<br />\n__(Photo)__ : __MEMBER_PHOTO__<br />\n__(Login)__ : __MEMBER_LOGIN__<br />\n__(Password)__ : __MEMBER_PASSWORD__<br />\n__(Phone)__ : __MEMBER_PHONE__<br />\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br />\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__<br><br>\n__(Sincerely)__<br>__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)__,<br><br>\n\n__(FindYourSEPAMandate)__ :<br>\n__MYCOMPANY_NAME__<br>\n__MYCOMPANY_FULLADDRESS__<br><br>\n__(Sincerely)__<br>\n__USER_SIGNATURE__',null);
|
||||
|
||||
@ -33,6 +33,7 @@ create table llx_c_email_templates
|
||||
enabled varchar(255) DEFAULT '1', -- Condition to have this module visible
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
topic text, -- Predefined topic
|
||||
content text, -- Predefined text
|
||||
joinfiles text, -- Files to attach
|
||||
content mediumtext, -- Predefined text
|
||||
content_lines text -- Predefined lines
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -462,6 +462,8 @@ Field=Field
|
||||
ProductDocumentTemplates=Document templates to generate product document
|
||||
FreeLegalTextOnExpenseReports=Free legal text on expense reports
|
||||
WatermarkOnDraftExpenseReports=Watermark on draft expense reports
|
||||
AttachMainDocByDefault=Set this to 1 if you want to attach main document to email by default (if applicable)
|
||||
FilesAttachedToEmail=Attach file
|
||||
# Modules
|
||||
Module0Name=Users & groups
|
||||
Module0Desc=Users / Employees and Groups management
|
||||
|
||||
@ -452,13 +452,15 @@ fieldset { border: 1px solid #AAAAAA !important; }
|
||||
hr { border: 0; border-top: 1px solid #ccc; }
|
||||
|
||||
.button, .buttonDelete, input[name="sbmtConnexion"] {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
border-color: #c5c5c5;
|
||||
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
||||
display: inline-block;
|
||||
padding: 3px 14px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
text-decoration: none !important;
|
||||
@ -481,9 +483,9 @@ hr { border: 0; border-top: 1px solid #ccc; }
|
||||
border-radius: 2px;
|
||||
}
|
||||
.button:focus, .buttonDelete:focus {
|
||||
-moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-moz-box-shadow: 0px 0px 5px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
-webkit-box-shadow: 0px 0px 5px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 5px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
.button:hover, .buttonDelete:hover {
|
||||
/* warning: having a larger shadow has side effect when button is completely on left of a table */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user