diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index bc9e855046d..ff99ce5e4bf 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -34,6 +34,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->load("errors");
$langs->load("admin");
@@ -833,7 +834,6 @@ if ($action == 'delete')
*/
if ($id)
{
-
// Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$id];
@@ -944,7 +944,7 @@ if ($id)
if ($id == 4) print '
';
print '
';
print '';
- print '
';
+ print '';
print '';
// Line to enter new values
@@ -966,25 +966,37 @@ if ($id)
$reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;
- if ($id == 3)
+ if ($id == 3) unset($fieldlist[2]);
+
+ if (empty($reshook))
{
- unset($fieldlist[2]);
+ if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit')
+ {
+ fieldList($fieldlist,$obj,$tabname[$id],'hide');
+ }
+ else
+ {
+ fieldList($fieldlist,$obj,$tabname[$id],'add');
+ }
}
- if (empty($reshook)) fieldList($fieldlist,$obj);
-
if ($id == 4) print '
';
print "";
$colspan=count($fieldlist)+2;
if ($id == 4) $colspan++;
- if (! empty($alabelisused)) // Si un des champs est un libelle
+ if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
{
print '
* '.$langs->trans("LabelUsedByDefault").'.
';
}
- print '
';
+ print '
'; // Keep to have a line with enough height
}
print '';
@@ -1099,7 +1111,7 @@ if ($id)
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;
- if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id]);
+ if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
print '
';
print '
';
@@ -1419,14 +1431,16 @@ $db->close();
* @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
+ * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
* @return void
*/
-function fieldList($fieldlist,$obj='',$tabname='')
+function fieldList($fieldlist, $obj='', $tabname='', $context='')
{
global $conf,$langs,$db;
global $form;
global $region_id;
global $elementList,$sourceList,$localtax_typeList;
+ global $bc;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
@@ -1515,9 +1529,25 @@ function fieldList($fieldlist,$obj='',$tabname='')
print '';
print '';
}
- elseif (in_array($fieldlist[$field], array('libelle_facture','content'))) {
+ elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
print '
';
}
// If the user can view prospects other than his'
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 0ba8600e778..d11a37564b9 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -269,7 +269,7 @@ if ($resql)
$langs->load("commercial");
$moreforfilter.='
';
}
// If the user can view prospects other than his'
@@ -303,7 +303,7 @@ if ($resql)
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
$moreforfilter.='';
}
-
+
if ($moreforfilter)
{
print '
';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d5f0c367c22..bad965192e5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1254,10 +1254,11 @@ class Form
* @param string $morefilter Add more filters into sql request
* @param string $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
* @param string $enableonlytext If option $enableonly is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
+ * @param string $morecss More css
* @return string HTML select string
* @see select_dolgroups
*/
- function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='')
+ function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='')
{
global $conf,$user,$langs;
@@ -1339,7 +1340,7 @@ class Form
$nodatarole=($comboenhancement?' data-role="none"':'');
}
- $out.= '