|
@@ -448,8 +448,6 @@ $sql.=$db->plimit($listlimit+1,$offset);
|
|
|
$fieldlist=explode(',',$tabfield[$id]);
|
|
|
|
|
|
// Form to add a new line
|
|
|
-$alabelisused=0;
|
|
|
-
|
|
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
|
@@ -461,38 +459,37 @@ print '<table class="noborder" width="100%">';
|
|
|
print '<tr class="liste_titre">';
|
|
|
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.'">';
|
|
|
- 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 if (! empty($tabhelp[$id][$value]))
|
|
|
- {
|
|
|
- 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>';
|
|
|
- }
|
|
|
- if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
|
|
+ // 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.'">';
|
|
|
+ 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 if (! empty($tabhelp[$id][$value]))
|
|
|
+ {
|
|
|
+ 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 '<input type="hidden" name="id" value="' . $id . '">';
|
|
@@ -535,6 +532,7 @@ print '<td align="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('content','content_lines'); }
|
|
|
foreach ($fieldsforcontent as $tmpfieldlist)
|
|
@@ -631,11 +629,11 @@ if ($resql)
|
|
|
$filterfound=0;
|
|
|
foreach ($fieldlist as $field => $value)
|
|
|
{
|
|
|
- if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
|
|
+ if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" class="maxwidth100" value="'.dol_escape_htmltag($search_label).'"></td>';
|
|
|
elseif ($value == 'lang')
|
|
|
{
|
|
|
print '<td class="liste_titre">';
|
|
|
- print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth150');
|
|
|
+ print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth100');
|
|
|
print '</td>';
|
|
|
}
|
|
|
elseif ($value == 'fk_user')
|
|
@@ -644,13 +642,13 @@ if ($resql)
|
|
|
$restrictid=array();
|
|
|
if (! $user->admin) $restrictid=array($user->id);
|
|
|
//var_dump($restrictid);
|
|
|
- print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
|
|
+ print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth100');
|
|
|
print '</td>';
|
|
|
}
|
|
|
elseif ($value == 'topic') print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
|
|
elseif ($value == 'type_template')
|
|
|
{
|
|
|
- print '<td class="liste_titre">'.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200 maxwidth100onsmartphone').'</td>';
|
|
|
+ print '<td class="liste_titre">'.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100 maxwidth100onsmartphone').'</td>';
|
|
|
}
|
|
|
elseif (! in_array($value, array('content', 'content_lines'))) print '<td class="liste_titre"></td>';
|
|
|
}
|
|
@@ -672,6 +670,7 @@ if ($resql)
|
|
|
$align="left";
|
|
|
$sortable=1;
|
|
|
$valuetoshow='';
|
|
|
+ $forcenowrap=1;
|
|
|
/*
|
|
|
$tmparray=getLabelOfField($fieldlist[$field]);
|
|
|
$showfield=$tmp['showfield'];
|
|
@@ -689,7 +688,7 @@ if ($resql)
|
|
|
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]=='joinfiles') { $valuetoshow=$langs->trans("FilesAttachedToEmail"); $align='center'; $forcenowrap=0; }
|
|
|
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
|
|
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
|
|
|
|
@@ -698,8 +697,8 @@ if ($resql)
|
|
|
{
|
|
|
if (! empty($tabhelp[$id][$value]))
|
|
|
{
|
|
|
- if (in_array($value, array('topic'))) $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltip'.$value); // Tooltip on click
|
|
|
- else $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, '', 1); // Tooltip on hover
|
|
|
+ if (in_array($value, array('topic'))) $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltip'.$value, $forcenowrap); // Tooltip on click
|
|
|
+ else $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, '', $forcenowrap); // Tooltip on hover
|
|
|
}
|
|
|
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
|
|
}
|
|
@@ -1024,17 +1023,18 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200');
|
|
|
+ print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150 maxwidth100onsmartphone');
|
|
|
}
|
|
|
print '</td>';
|
|
|
}
|
|
|
- elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', '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='';
|
|
|
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
|
|
+ if ($fieldlist[$field]=='label') $class='maxwidth100';
|
|
|
if ($fieldlist[$field]=='private') { $class='maxwidth50'; $classtd='center'; }
|
|
|
if ($fieldlist[$field]=='position') { $class='maxwidth50'; $classtd='center'; }
|
|
|
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
|