Fixing style errors.
This commit is contained in:
parent
fb7ed3afc1
commit
0e7d429991
@ -459,147 +459,147 @@ $sql .= $db->plimit($listlimit + 1, $offset);
|
|||||||
$fieldlist = explode(',', $tabfield[$id]);
|
$fieldlist = explode(',', $tabfield[$id]);
|
||||||
|
|
||||||
if ($action == 'view') {
|
if ($action == 'view') {
|
||||||
// Form to add a new line
|
// Form to add a new line
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
|
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
// Line to enter new values (title)
|
// Line to enter new values (title)
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
|
||||||
// dans les dictionnaires de donnees
|
|
||||||
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
|
|
||||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
|
||||||
$align = "left";
|
|
||||||
if ($fieldlist[$field] == 'fk_user') { $valuetoshow = $langs->trans("Owner"); }
|
|
||||||
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("Code"); }
|
|
||||||
if ($fieldlist[$field] == 'type_template') { $valuetoshow = $langs->trans("TypeOfTemplate"); }
|
|
||||||
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.'">';
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
// dans les dictionnaires de donnees
|
||||||
elseif (!empty($tabhelp[$id][$value]))
|
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
|
||||||
|
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||||
|
$align = "left";
|
||||||
|
if ($fieldlist[$field] == 'fk_user') { $valuetoshow = $langs->trans("Owner"); }
|
||||||
|
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("Code"); }
|
||||||
|
if ($fieldlist[$field] == 'type_template') { $valuetoshow = $langs->trans("TypeOfTemplate"); }
|
||||||
|
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 != '')
|
||||||
{
|
{
|
||||||
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
print '<td align="'.$align.'">';
|
||||||
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||||
} else print $valuetoshow;
|
elseif (!empty($tabhelp[$id][$value]))
|
||||||
print '</td>';
|
{
|
||||||
|
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
||||||
|
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
||||||
|
} else print $valuetoshow;
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
print '<td>';
|
||||||
print '<td>';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '</td>';
|
||||||
print '</td>';
|
print '</tr>';
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd'))
|
if (GETPOST('actionadd'))
|
||||||
{
|
{
|
||||||
foreach ($fieldlist as $key => $val) {
|
foreach ($fieldlist as $key => $val) {
|
||||||
if (GETPOST($val) != '')
|
if (GETPOST($val) != '')
|
||||||
$obj->$val = GETPOST($val);
|
$obj->$val = GETPOST($val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$tmpaction = 'create';
|
$tmpaction = 'create';
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'fieldlist' => $fieldlist,
|
'fieldlist' => $fieldlist,
|
||||||
'tabname' => $tabname[$id]
|
'tabname' => $tabname[$id]
|
||||||
);
|
);
|
||||||
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error = $hookmanager->error;
|
$error = $hookmanager->error;
|
||||||
$errors = $hookmanager->errors;
|
$errors = $hookmanager->errors;
|
||||||
|
|
||||||
|
|
||||||
// Line to enter new values (input fields)
|
// Line to enter new values (input fields)
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
|
||||||
if ($action == 'edit') {
|
|
||||||
fieldList($fieldlist, $obj, $tabname[$id], 'hide');
|
|
||||||
} else {
|
|
||||||
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<td class="right">';
|
|
||||||
print '</td>';
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
// Show fields for topic, join files and body
|
|
||||||
$fieldsforcontent = array('topic', 'joinfiles', 'content');
|
|
||||||
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); }
|
|
||||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
|
||||||
{
|
|
||||||
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 ($action == 'edit') {
|
||||||
|
fieldList($fieldlist, $obj, $tabname[$id], 'hide');
|
||||||
|
} else {
|
||||||
|
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($tmpfieldlist == 'joinfiles')
|
|
||||||
|
print '<td class="right">';
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>";
|
||||||
|
|
||||||
|
// Show fields for topic, join files and body
|
||||||
|
$fieldsforcontent = array('topic', 'joinfiles', 'content');
|
||||||
|
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); }
|
||||||
|
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||||
{
|
{
|
||||||
print '<strong>'.$form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong> ';
|
print '<tr class="impair nodrag nodrop nohover"><td colspan="6" class="nobottom">';
|
||||||
}
|
|
||||||
if ($tmpfieldlist == 'content')
|
// 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 $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
|
print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
|
||||||
if ($tmpfieldlist == 'content_lines')
|
if ($tmpfieldlist == 'content_lines')
|
||||||
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
|
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
|
||||||
|
|
||||||
// Input field
|
// Input field
|
||||||
if ($tmpfieldlist == 'topic') {
|
if ($tmpfieldlist == 'topic') {
|
||||||
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="'.(!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '').'">';
|
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="'.(!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '').'">';
|
||||||
} elseif ($tmpfieldlist == 'joinfiles') {
|
} elseif ($tmpfieldlist == 'joinfiles') {
|
||||||
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="'.(isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1').'">';
|
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="'.(isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1').'">';
|
||||||
} else {
|
} else {
|
||||||
if ($context != 'hide') {
|
if ($context != 'hide') {
|
||||||
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||||
$okforextended = true;
|
$okforextended = true;
|
||||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
|
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
|
||||||
$okforextended = false;
|
$okforextended = false;
|
||||||
$doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 500, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
|
$doleditor = new DolEditor($tmpfieldlist, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 500, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
} else print ' ';
|
} else print ' ';
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if ($tmpfieldlist == 'topic') {
|
|
||||||
print '<td class="center" rowspan="'.(count($fieldsforcontent)).'">';
|
|
||||||
if ($action != 'edit') {
|
|
||||||
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if ($tmpfieldlist == 'topic') {
|
||||||
|
print '<td class="center" rowspan="'.(count($fieldsforcontent)).'">';
|
||||||
|
if ($action != 'edit') {
|
||||||
|
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// else print '<td></td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
// else print '<td></td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$colspan = count($fieldlist) + 1;
|
$colspan = count($fieldlist) + 1;
|
||||||
//print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
//print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} // END IF not edit
|
} // END IF not edit
|
||||||
|
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user