FIX #6973
This commit is contained in:
parent
08a86fa03d
commit
4dda771079
@ -50,6 +50,7 @@ $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
|||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
$rowid=GETPOST('rowid','alpha');
|
$rowid=GETPOST('rowid','alpha');
|
||||||
|
$search_label=GETPOST('search_label','alpha');
|
||||||
|
|
||||||
$allowed=$user->admin;
|
$allowed=$user->admin;
|
||||||
if (! $allowed) accessforbidden();
|
if (! $allowed) accessforbidden();
|
||||||
@ -78,10 +79,6 @@ $hookmanager->initHooks(array('emailtemplates'));
|
|||||||
$tabname=array();
|
$tabname=array();
|
||||||
$tabname[25]= MAIN_DB_PREFIX."c_email_templates";
|
$tabname[25]= MAIN_DB_PREFIX."c_email_templates";
|
||||||
|
|
||||||
// Requests to extract data
|
|
||||||
$tabsql=array();
|
|
||||||
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content_lines, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template').")";
|
|
||||||
|
|
||||||
// Criteria to sort dictionaries
|
// Criteria to sort dictionaries
|
||||||
$tabsqlsort=array();
|
$tabsqlsort=array();
|
||||||
$tabsqlsort[25]="label ASC";
|
$tabsqlsort[25]="label ASC";
|
||||||
@ -173,211 +170,223 @@ $id = 25;
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
|
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||||
{
|
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||||
//$search_country_id = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Actions add or modify an entry into a dictionary
|
$parameters=array();
|
||||||
if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
{
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
|
||||||
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
|
||||||
$listfieldmodify=explode(',',$tabfieldinsert[$id]);
|
|
||||||
$listfieldvalue=explode(',',$tabfieldvalue[$id]);
|
|
||||||
|
|
||||||
// Check that all fields are filled
|
if (empty($reshook))
|
||||||
$ok=1;
|
{
|
||||||
foreach ($listfield as $f => $value)
|
// Purge search criteria
|
||||||
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
if ($value == 'content') continue;
|
$search_label='';
|
||||||
if ($value == 'content_lines') continue;
|
$toselect='';
|
||||||
if ($value == 'content') $value='content-'.$rowid;
|
$search_array_options=array();
|
||||||
if ($value == 'content_lines') $value='content_lines-'.$rowid;
|
|
||||||
|
|
||||||
if (! isset($_POST[$value]) || $_POST[$value]=='')
|
|
||||||
{
|
|
||||||
$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 == 'code') $fieldnamekey = 'Code';
|
|
||||||
if ($fieldnamekey == 'note') $fieldnamekey = 'Note';
|
|
||||||
if ($fieldnamekey == 'type') $fieldnamekey = 'Type';
|
|
||||||
|
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action add, on ajoute la ligne
|
// Actions add or modify an entry into a dictionary
|
||||||
if ($ok && GETPOST('actionadd'))
|
if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id])
|
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
||||||
|
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
||||||
|
$listfieldmodify=explode(',',$tabfieldinsert[$id]);
|
||||||
|
$listfieldvalue=explode(',',$tabfieldvalue[$id]);
|
||||||
|
|
||||||
|
// Check that all fields are filled
|
||||||
|
$ok=1;
|
||||||
|
foreach ($listfield as $f => $value)
|
||||||
{
|
{
|
||||||
// Recupere id libre pour insertion
|
if ($value == 'content') continue;
|
||||||
$newid=0;
|
if ($value == 'content_lines') continue;
|
||||||
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
if ($value == 'content') $value='content-'.$rowid;
|
||||||
$result = $db->query($sql);
|
if ($value == 'content_lines') $value='content_lines-'.$rowid;
|
||||||
if ($result)
|
|
||||||
|
if (! isset($_POST[$value]) || $_POST[$value]=='')
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$ok=0;
|
||||||
$newid=($obj->newid + 1);
|
$fieldnamekey=$listfield[$f];
|
||||||
|
// We take translate key of field
|
||||||
|
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
|
||||||
|
if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments';
|
||||||
|
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
||||||
|
if ($fieldnamekey == 'note') $fieldnamekey = 'Note';
|
||||||
|
if ($fieldnamekey == 'type') $fieldnamekey = 'Type';
|
||||||
|
|
||||||
} else {
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
dol_print_error($db);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new entry
|
// Si verif ok et action add, on ajoute la ligne
|
||||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
if ($ok && GETPOST('actionadd'))
|
||||||
// List of fields
|
{
|
||||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
if ($tabrowid[$id])
|
||||||
$sql.= $tabrowid[$id].",";
|
{
|
||||||
$sql.= $tabfieldinsert[$id];
|
// Recupere id libre pour insertion
|
||||||
$sql.=",active)";
|
$newid=0;
|
||||||
$sql.= " VALUES(";
|
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
|
$newid=($obj->newid + 1);
|
||||||
|
|
||||||
// List of values
|
} else {
|
||||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
dol_print_error($db);
|
||||||
$sql.= $newid.",";
|
}
|
||||||
$i=0;
|
|
||||||
foreach ($listfieldinsert as $f => $value)
|
|
||||||
{
|
|
||||||
//var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value);
|
|
||||||
if ($value == 'entity') {
|
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
|
||||||
if ($value == 'private' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='0';
|
|
||||||
if ($value == 'position' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='1';
|
|
||||||
if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = ''
|
|
||||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
$sql.=",1)";
|
|
||||||
|
|
||||||
dol_syslog("actionadd", LOG_DEBUG);
|
// Add new entry
|
||||||
$result = $db->query($sql);
|
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||||
if ($result) // Add is ok
|
// List of fields
|
||||||
{
|
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
$sql.= $tabrowid[$id].",";
|
||||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
$sql.= $tabfieldinsert[$id];
|
||||||
}
|
$sql.=",active)";
|
||||||
else
|
$sql.= " VALUES(";
|
||||||
{
|
|
||||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
// List of values
|
||||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||||
|
$sql.= $newid.",";
|
||||||
|
$i=0;
|
||||||
|
foreach ($listfieldinsert as $f => $value)
|
||||||
|
{
|
||||||
|
//var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value);
|
||||||
|
if ($value == 'entity') {
|
||||||
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
|
}
|
||||||
|
if ($i) $sql.=",";
|
||||||
|
if ($value == 'private' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='0';
|
||||||
|
if ($value == 'position' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='1';
|
||||||
|
if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = ''
|
||||||
|
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
else {
|
$sql.=",1)";
|
||||||
dol_print_error($db);
|
|
||||||
|
dol_syslog("actionadd", LOG_DEBUG);
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result) // Add is ok
|
||||||
|
{
|
||||||
|
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||||
|
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si verif ok et action modify, on modifie la ligne
|
||||||
|
if ($ok && GETPOST('actionmodify'))
|
||||||
|
{
|
||||||
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
|
else { $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)
|
||||||
|
{
|
||||||
|
if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid];
|
||||||
|
if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid];
|
||||||
|
if ($field == 'entity') {
|
||||||
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
|
}
|
||||||
|
if ($i) $sql.=",";
|
||||||
|
$sql.= $field."=";
|
||||||
|
if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = ''
|
||||||
|
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
|
||||||
|
|
||||||
|
dol_syslog("actionmodify", LOG_DEBUG);
|
||||||
|
//print $sql;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
setEventMessages($db->error(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||||
if ($ok && GETPOST('actionmodify'))
|
|
||||||
{
|
{
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
else { $rowidcol="rowid"; }
|
else { $rowidcol="rowid"; }
|
||||||
|
|
||||||
// Modify entry
|
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'";
|
||||||
$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)
|
|
||||||
{
|
|
||||||
if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid];
|
|
||||||
if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid];
|
|
||||||
if ($field == 'entity') {
|
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
|
||||||
}
|
|
||||||
if ($i) $sql.=",";
|
|
||||||
$sql.= $field."=";
|
|
||||||
if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = ''
|
|
||||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
|
|
||||||
|
|
||||||
dol_syslog("actionmodify", LOG_DEBUG);
|
dol_syslog("delete", LOG_DEBUG);
|
||||||
//print $sql;
|
$result = $db->query($sql);
|
||||||
$resql = $db->query($sql);
|
if (! $result)
|
||||||
if (! $resql)
|
|
||||||
{
|
{
|
||||||
setEventMessages($db->error(), null, 'errors');
|
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
||||||
|
{
|
||||||
|
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
// activate
|
||||||
{
|
if ($action == $acts[0])
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
|
||||||
else { $rowidcol="rowid"; }
|
|
||||||
|
|
||||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'";
|
|
||||||
|
|
||||||
dol_syslog("delete", LOG_DEBUG);
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if (! $result)
|
|
||||||
{
|
{
|
||||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
{
|
else { $rowidcol="rowid"; }
|
||||||
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
|
||||||
|
if ($rowid) {
|
||||||
|
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'";
|
||||||
}
|
}
|
||||||
else
|
elseif ($code) {
|
||||||
|
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$code."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if (!$result)
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// disable
|
||||||
|
if ($action == $acts[1])
|
||||||
|
{
|
||||||
|
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||||
|
else { $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."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if (!$result)
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// activate
|
|
||||||
if ($action == $acts[0])
|
|
||||||
{
|
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
|
||||||
else { $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."'";
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if (!$result)
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// disable
|
|
||||||
if ($action == $acts[1])
|
|
||||||
{
|
|
||||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
|
||||||
else { $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."'";
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if (!$result)
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -416,8 +425,11 @@ if ($action == 'delete')
|
|||||||
}
|
}
|
||||||
//var_dump($elementList);
|
//var_dump($elementList);
|
||||||
|
|
||||||
// Complete requete recherche valeurs avec critere de tri
|
|
||||||
$sql=$tabsql[$id];
|
$sql="SELECT rowid as rowid, label, type_template, private, position, topic, content_lines, content, active";
|
||||||
|
$sql.=" FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||||
|
$sql.=" WHERE entity IN (".getEntity('email_template').")";
|
||||||
|
if ($search_label) $sql.=natural_search('label', $search_label);
|
||||||
|
|
||||||
if ($search_country_id > 0)
|
if ($search_country_id > 0)
|
||||||
{
|
{
|
||||||
@ -572,9 +584,19 @@ if ($action != 'edit')
|
|||||||
|
|
||||||
|
|
||||||
$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 '</form>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
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')).'">';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
// List of available record in database
|
// List of available record in database
|
||||||
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
||||||
@ -599,8 +621,26 @@ if ($resql)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Title line with search boxes
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
$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>';
|
||||||
|
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">';
|
||||||
|
$searchpicto=$form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Title of lines
|
// Title of lines
|
||||||
print '<tr class="liste_titre'.($action != 'edit' ? ' liste_titre_add' : '').'">';
|
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
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
@ -642,18 +682,6 @@ if ($resql)
|
|||||||
print getTitleFieldOfList('');
|
print getTitleFieldOfList('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Title line with search boxes
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
$filterfound=0;
|
|
||||||
foreach ($fieldlist as $field => $value)
|
|
||||||
{
|
|
||||||
if (! in_array($field, 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>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
// Lines with values
|
// Lines with values
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user