';
print '';
// User
print '
'.$langs->trans("CreatedBy").' ';
- print $form->select_users($userid,'userid',1);
+ print $form->select_dolusers($userid,'userid',1);
print ' ';
// Year
print '
'.$langs->trans("Year").' ';
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 89b2fe5181e..8f710dadca4 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -274,124 +274,137 @@ else if ($action == 'add' && $user->rights->commande->creer)
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
+ if($ret < 0)
+ $error++;
- $object_id = $object->create($user);
+ if(!$error) {
+ $object_id = $object->create($user);
- if ($object_id > 0)
- {
- dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
-
- $classname = ucfirst($subelement);
- $srcobject = new $classname($db);
-
- dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
- $result=$srcobject->fetch($object->origin_id);
- if ($result > 0)
+ if ($object_id > 0)
{
- $lines = $srcobject->lines;
- if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
+ dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
- $fk_parent_line=0;
- $num=count($lines);
+ $classname = ucfirst($subelement);
+ $srcobject = new $classname($db);
- for ($i=0;$i<$num;$i++)
+ dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
+ $result=$srcobject->fetch($object->origin_id);
+ if ($result > 0)
{
- $label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
- $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
- $product_type=(! empty($lines[$i]->product_type)?$lines[$i]->product_type:0);
+ $lines = $srcobject->lines;
+ if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
- // Dates
- // TODO mutualiser
- $date_start=$lines[$i]->date_debut_prevue;
- if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
- if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
- $date_end=$lines[$i]->date_fin_prevue;
- if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
- if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
+ $fk_parent_line=0;
+ $num=count($lines);
- // Reset fk_parent_line for no child products and special product
- if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
- $fk_parent_line = 0;
- }
-
- //Extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals') ) // For avoid conflicts if trigger used
+ for ($i=0;$i<$num;$i++)
{
- $lines[$i]->fetch_optionals($lines[$i]->rowid);
- $array_option=$lines[$i]->array_options;
+ $label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
+ $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
+ $product_type=(! empty($lines[$i]->product_type)?$lines[$i]->product_type:0);
+
+ // Dates
+ // TODO mutualiser
+ $date_start=$lines[$i]->date_debut_prevue;
+ if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
+ if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
+ $date_end=$lines[$i]->date_fin_prevue;
+ if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
+ if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
+
+ // Reset fk_parent_line for no child products and special product
+ if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
+ $fk_parent_line = 0;
+ }
+
+ //Extrafields
+ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals') ) // For avoid conflicts if trigger used
+ {
+ $lines[$i]->fetch_optionals($lines[$i]->rowid);
+ $array_option=$lines[$i]->array_options;
+ }
+
+ $result = $object->addline(
+ $desc,
+ $lines[$i]->subprice,
+ $lines[$i]->qty,
+ $lines[$i]->tva_tx,
+ $lines[$i]->localtax1_tx,
+ $lines[$i]->localtax2_tx,
+ $lines[$i]->fk_product,
+ $lines[$i]->remise_percent,
+ $lines[$i]->info_bits,
+ $lines[$i]->fk_remise_except,
+ 'HT',
+ 0,
+ $date_start,
+ $date_end,
+ $product_type,
+ $lines[$i]->rang,
+ $lines[$i]->special_code,
+ $fk_parent_line,
+ $lines[$i]->fk_fournprice,
+ $lines[$i]->pa_ht,
+ $label,
+ $array_option
+ );
+
+ if ($result < 0)
+ {
+ $error++;
+ break;
+ }
+
+ // Defined the new fk_parent_line
+ if ($result > 0 && $lines[$i]->product_type == 9) {
+ $fk_parent_line = $result;
+ }
}
- $result = $object->addline(
- $desc,
- $lines[$i]->subprice,
- $lines[$i]->qty,
- $lines[$i]->tva_tx,
- $lines[$i]->localtax1_tx,
- $lines[$i]->localtax2_tx,
- $lines[$i]->fk_product,
- $lines[$i]->remise_percent,
- $lines[$i]->info_bits,
- $lines[$i]->fk_remise_except,
- 'HT',
- 0,
- $date_start,
- $date_end,
- $product_type,
- $lines[$i]->rang,
- $lines[$i]->special_code,
- $fk_parent_line,
- $lines[$i]->fk_fournprice,
- $lines[$i]->pa_ht,
- $label,
- $array_option
- );
-
- if ($result < 0)
- {
- $error++;
- break;
- }
-
- // Defined the new fk_parent_line
- if ($result > 0 && $lines[$i]->product_type == 9) {
- $fk_parent_line = $result;
- }
+ // Hooks
+ $parameters=array('objFrom'=>$srcobject);
+ $reshook=$hookmanager->executeHooks('createFrom',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ if ($reshook < 0) $error++;
+ }
+ else
+ {
+ $mesg=$srcobject->error;
+ $error++;
}
-
- // Hooks
- $parameters=array('objFrom'=>$srcobject);
- $reshook=$hookmanager->executeHooks('createFrom',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
- if ($reshook < 0) $error++;
}
else
{
- $mesg=$srcobject->error;
+ $mesg=$object->error;
$error++;
}
}
else
{
- $mesg=$object->error;
- $error++;
+ // Required extrafield left blank, error message already defined by setOptionalsFromPost()
+ $action='create';
}
}
else
{
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
+ if($ret < 0)
+ $error++;
- $object_id = $object->create($user);
+ if(!$error) {
+ $object_id = $object->create($user);
- // If some invoice's lines already known
- $NBLINES=8;
- for ($i = 1 ; $i <= $NBLINES ; $i++)
- {
- if ($_POST['idprod'.$i])
+ // If some invoice's lines already known
+ $NBLINES=8;
+ for ($i = 1 ; $i <= $NBLINES ; $i++)
{
- $xid = 'idprod'.$i;
- $xqty = 'qty'.$i;
- $xremise = 'remise_percent'.$i;
- $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]);
+ if ($_POST['idprod'.$i])
+ {
+ $xid = 'idprod'.$i;
+ $xqty = 'qty'.$i;
+ $xremise = 'remise_percent'.$i;
+ $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]);
+ }
}
}
}
@@ -1167,23 +1180,32 @@ else if ($action == 'update_extras')
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
- // Actions on extra fields (by external module or standard code)
- // FIXME le hook fait double emploi avec le trigger !!
- $hookmanager->initHooks(array('orderdao'));
- $parameters=array('id'=>$object->id);
- $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
- if (empty($reshook))
- {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if($ret < 0)
+ $error++;
+
+ if(!$error) {
+ // Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
+ $hookmanager->initHooks(array('orderdao'));
+ $parameters=array('id'=>$object->id);
+ $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+ if (empty($reshook))
{
- $result=$object->insertExtraFields();
- if ($result < 0)
+ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
- $error++;
+ $result=$object->insertExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ }
}
}
+ else if ($reshook < 0) $error++;
+ }
+ else
+ {
+ $action = 'edit_extras';
}
- else if ($reshook < 0) $error++;
}
@@ -1372,7 +1394,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}
}
-if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer)
+if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer)
{
if ($action == 'addcontact')
{
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index 57354926865..31cb0566934 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -257,7 +257,7 @@ print ' ';
// User
print '
'.$langs->trans("CreatedBy").' ';
- print $form->select_users($userid,'userid',1);
+ print $form->select_dolusers($userid,'userid',1);
print ' ';
// Year
print '
'.$langs->trans("Year").' ';
diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php
index bc2795e554f..e82d962053d 100644
--- a/htdocs/compta/deplacement/fiche.php
+++ b/htdocs/compta/deplacement/fiche.php
@@ -280,7 +280,7 @@ if ($action == 'create')
print " ";
print ''.$langs->trans("Person").' ';
- print $form->select_users(GETPOST('fk_user','int'),'fk_user',1);
+ print $form->select_dolusers(GETPOST('fk_user','int'),'fk_user',1);
print ' ';
print "
";
@@ -375,7 +375,7 @@ else if ($id)
// Who
print " ";
print ''.$langs->trans("Person").' ';
- print $form->select_users(GETPOST('fk_user','int')?GETPOST('fk_user','int'):$object->fk_user,'fk_user',0);
+ print $form->select_dolusers(GETPOST('fk_user','int')?GETPOST('fk_user','int'):$object->fk_user,'fk_user',0);
print ' ';
// Date
diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php
index 3112c5aebed..cd52ada8220 100755
--- a/htdocs/compta/deplacement/stats/index.php
+++ b/htdocs/compta/deplacement/stats/index.php
@@ -220,7 +220,7 @@ print $form->select_company($socid,'socid',$filter,1,1);
print '';
// User
print '
'.$langs->trans("User").'/'.$langs->trans("SalesRepresentative").' ';
-print $form->select_users($userid,'userid',1);
+print $form->select_dolusers($userid,'userid',1);
print ' ';
// Year
print '
'.$langs->trans("Year").' ';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 33e27fdb1e9..c3590cb94a5 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -661,7 +661,8 @@ else if ($action == 'add' && $user->rights->facture->creer)
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
-
+ if($ret < 0)
+ $error++;
// Replacement invoice
if ($_POST['type'] == 1)
@@ -1906,24 +1907,32 @@ if ($action == 'update_extras')
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
+ if($ret < 0)
+ $error++;
- // Actions on extra fields (by external module or standard code)
- // FIXME le hook fait double emploi avec le trigger !!
- $hookmanager->initHooks(array('invoicedao'));
- $parameters=array('id'=>$object->id);
- $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
- if (empty($reshook))
- {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if(!$error) {
+ // Actions on extra fields (by external module or standard code)
+ // FIXME le hook fait double emploi avec le trigger !!
+ $hookmanager->initHooks(array('invoicedao'));
+ $parameters=array('id'=>$object->id);
+ $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+ if (empty($reshook))
{
- $result=$object->insertExtraFields();
- if ($result < 0)
+ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
- $error++;
+ $result=$object->insertExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ }
}
}
+ else if ($reshook < 0) $error++;
+ }
+ else
+ {
+ $action = 'edit_extras';
}
- else if ($reshook < 0) $error++;
}
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index af4ff83cd54..211bc355cc6 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -235,7 +235,7 @@ print ' ';
// User
print '
'.$langs->trans("CreatedBy").' ';
- print $form->select_users($userid,'userid',1);
+ print $form->select_dolusers($userid,'userid',1);
print ' ';
// Year
print '
'.$langs->trans("Year").' ';
diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php
index c8d710e2831..0ad3eaf8622 100644
--- a/htdocs/compta/payment_sc/fiche.php
+++ b/htdocs/compta/payment_sc/fiche.php
@@ -262,7 +262,7 @@ if ($resql)
// Expected to pay
print ' '.price($objp->sc_amount).' ';
// Status
- print ''.$socialcontrib->LibStatut($objp->fk_statut,2).' ';
+ print ''.$socialcontrib->getLibStatut(4).' ';
// Amount payed
print ''.price($objp->amount).' ';
print "\n";
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index 4989fc98440..3cc5824ddc5 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -850,12 +850,12 @@ if ($action == 'create')
// Commercial suivi
print '
'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").' ';
- print $form->select_users(GETPOST("commercial_suivi_id")?GETPOST("commercial_suivi_id"):$user->id,'commercial_suivi_id',1,'');
+ print $form->select_dolusers(GETPOST("commercial_suivi_id")?GETPOST("commercial_suivi_id"):$user->id,'commercial_suivi_id',1,'');
print ' ';
// Commercial signature
print '
'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").' ';
- print $form->select_users(GETPOST("commercial_signature_id")?GETPOST("commercial_signature_id"):$user->id,'commercial_signature_id',1,'');
+ print $form->select_dolusers(GETPOST("commercial_signature_id")?GETPOST("commercial_signature_id"):$user->id,'commercial_signature_id',1,'');
print ' ';
print '
'.$langs->trans("Date").' ';
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 4cb0f68959e..f4645721185 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2254,6 +2254,10 @@ abstract class CommonObject
{
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]);
}
+
+ if($extrafields->attribute_required[$key])
+ $label = ''.$label.' ';
+
$out .= ' '.$label.' ';
$out .='';
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index da4ba612f01..051c9950fd2 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -23,13 +23,13 @@
/**
* \file htdocs/core/class/extrafields.class.php
-* \ingroup core
-* \brief File of class to manage extra fields
-*/
+ * \ingroup core
+ * \brief File of class to manage extra fields
+ */
/**
* Class to manage standard extra fields
-*/
+ */
class ExtraFields
{
var $db;
@@ -683,16 +683,18 @@ class ExtraFields
}
elseif ($type == 'sellist')
{
+
$out='';
- $param_list=array_keys($param['options']);
- $InfoFieldList = explode(":", $param_list[0]);
+ if (is_array($param['options'])) {
+ $param_list=array_keys($param['options']);
+ $InfoFieldList = explode(":", $param_list[0]);
- // 0 1 : tableName
- // 1 2 : label field name Nom du champ contenant le libelle
- // 2 3 : key fields name (if differ of rowid)
- // 3 4 : key field parent (for dependent lists)
+ // 0 1 : tableName
+ // 1 2 : label field name Nom du champ contenant le libelle
+ // 2 3 : key fields name (if differ of rowid)
+ // 3 4 : key field parent (for dependent lists)
- $keyList='rowid';
+ $keyList='rowid';
if (count($InfoFieldList)>=3)
$keyList=$InfoFieldList[2].' as rowid';
@@ -717,17 +719,15 @@ class ExtraFields
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0];
//$sql.= ' WHERE entity = '.$conf->entity;
- dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql);
- $resql = $this->db->query($sql);
+ dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql);
+ $resql = $this->db->query($sql);
- if ($resql)
- {
- $out.=' ';
- $num = $this->db->num_rows($resql);
- $i = 0;
- if ($num)
+ if ($resql)
{
- while ($i < $num)
+ $out.=' ';
+ $num = $this->db->num_rows($resql);
+ $i = 0;
+ if ($num)
{
$labeltoshow='';
$obj = $this->db->fetch_object($resql);
@@ -785,8 +785,8 @@ class ExtraFields
$i++;
}
}
+ $this->db->free();
}
- $this->db->free();
}
$out.=' ';
}
@@ -993,7 +993,9 @@ class ExtraFields
*/
function setOptionalsFromPost($extralabels,&$object)
{
- global $_POST;
+ global $_POST, $langs;
+ $nofillrequired='';// For error when required field left blank
+ $error_field_required = array();
if (is_array($extralabels))
{
@@ -1001,6 +1003,11 @@ class ExtraFields
foreach ($extralabels as $key => $value)
{
$key_type = $this->attribute_type[$key];
+ if($this->attribute_required[$key] && !GETPOST("options_$key",2))
+ {
+ $nofillrequired++;
+ $error_field_required[] = $value;
+ }
if (in_array($key_type,array('date','datetime')))
{
@@ -1028,7 +1035,14 @@ class ExtraFields
$object->array_options["options_".$key]=$value_key;
}
- return 1;
+ if($nofillrequired) {
+ $langs->load('errors');
+ setEventMessage($langs->trans('ErrorFieldsRequired').' : '.implode(', ',$error_field_required),'errors');
+ return -1;
+ }
+ else {
+ return 1;
+ }
}
else {
return 0;
@@ -1080,4 +1094,4 @@ class ExtraFields
return 0;
}
}
-}
\ No newline at end of file
+}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 625e068ec2a..60ac2cf0571 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1061,6 +1061,7 @@ class Form
* @param int $enableonly Array list of users id to be enabled. All other must be disabled
* @param int $force_entity 0 or Id of environment to force
* @return void
+ * @deprecated
*/
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
{
@@ -1079,9 +1080,10 @@ class Form
* @param array $enableonly Array list of users id to be enabled. All other must be disabled
* @param int $force_entity 0 or Id of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
+ * @param int $showstatus Show user status into label
* @return string HTML select string
*/
- function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0)
+ function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0)
{
global $conf,$user,$langs;
@@ -1142,7 +1144,7 @@ class Form
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
-
+
$userstatic->id=$obj->rowid;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
@@ -1164,13 +1166,10 @@ class Form
}
$out.= $userstatic->getFullName($langs, 0, 0, $maxlength);
- if ($obj->statut == 1)
+ if ($showstatus)
{
- $out.=" (".$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4').")";
- }
- else
- {
- $out.=" (".$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5').")";
+ if ($obj->statut == 1) $out.=" (".$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4').")";
+ else $out.=" (".$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5').")";
}
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
@@ -1182,7 +1181,7 @@ class Form
//if ($obj->admin) $out.= ' *';
if (! empty($conf->global->MAIN_SHOW_LOGIN)) $out.= ' ('.$obj->login.')';
$out.= '';
-
+
$i++;
}
}
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 6ab8a204437..bc1eefcce3b 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -347,9 +347,10 @@ class FormOther
* @param string $selected Preselected value
* @param string $htmlname Name of combo list (example: 'search_sale')
* @param User $user Object user
+ * @param int $showstatus Show user status into label
* @return string Html combo list code
*/
- function select_salesrepresentatives($selected,$htmlname,$user)
+ function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0)
{
global $conf,$langs;
$langs->load('users');
@@ -385,13 +386,11 @@ class FormOther
if ($obj_usr->rowid == $selected) $moreforfilter.=' selected="selected"';
$moreforfilter.='>';
- if ($obj_usr->statut == 1)
- {
- $moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')'." ". img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
- }
- else
- {
- $moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')'." ". img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
+ $moreforfilter.=dolGetFirstLastname($obj_usr->firstname,$obj_usr->name)." (".$obj_usr->login.')';
+ if ($showstatus)
+ {
+ if ($obj_usr->statut == 1) $moreforfilter.=" ". img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
+ else $moreforfilter.=" ". img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
$moreforfilter.='';
}
diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
index 995815a0724..8f37976f3b1 100644
--- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
+++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
@@ -787,6 +787,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
}
+ $pdf->SetTextColor(0,0,60);
}
/**
diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php
index a65e19137ee..478bf76f86f 100644
--- a/htdocs/fourn/commande/liste.php
+++ b/htdocs/fourn/commande/liste.php
@@ -132,12 +132,12 @@ if ($resql)
print '