diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php
index 3018a23fdea..686549f19a8 100644
--- a/dev/skeletons/skeleton_list.php
+++ b/dev/skeletons/skeleton_list.php
@@ -96,6 +96,23 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
if ($result < 0) dol_print_error($db);
}
+// Definition of fields for list
+$arrayfields=array(
+ 't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
+ 't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
+ //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
+ 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+ 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
+ //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
+);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
+ }
+}
@@ -267,22 +284,6 @@ if ($resql)
print '';
}
- $arrayfields=array(
- 't.field1'=>array('label'=>$langs->trans("Field1"), 'checked'=>1),
- 't.field2'=>array('label'=>$langs->trans("Field2"), 'checked'=>1),
- //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
- 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
- );
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
- }
- }
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index ee5c24f3017..d10e34227d6 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -122,6 +122,34 @@ $fieldstosearchall = array(
's.nom'=>"ThirdParty",
);
+// Definition of fields for list
+$arrayfields=array(
+ 'p.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
+ 'p.firstname'=>array('label'=>$langs->trans("Firsname"), 'checked'=>1),
+ 'p.poste'=>array('label'=>$langs->trans("Post"), 'checked'=>1),
+ 'p.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
+ 'p.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
+ 'p.phone'=>array('label'=>$langs->trans("PhonePro"), 'checked'=>1),
+ 'p.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0),
+ 'p.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>1),
+ 'p.fax'=>array('label'=>$langs->trans("Fax"), 'checked'=>1),
+ 'p.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1),
+ 'p.skype'=>array('label'=>$langs->trans("Skype"), 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
+ 'p.thirdparty'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
+ 'p.priv'=>array('label'=>$langs->trans("ContactVisibility"), 'checked'=>1, 'position'=>200),
+ 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+ 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
+ 'p.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
+);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
+ }
+}
+
/*
* Actions
@@ -386,35 +414,10 @@ if ($result)
print '';
}
- $arrayfields=array(
- 'p.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
- 'p.firstname'=>array('label'=>$langs->trans("Firsname"), 'checked'=>1),
- 'p.poste'=>array('label'=>$langs->trans("Post"), 'checked'=>1),
- 'p.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
- 'p.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
- 'p.phone'=>array('label'=>$langs->trans("PhonePro"), 'checked'=>1),
- 'p.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0),
- 'p.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>1),
- 'p.fax'=>array('label'=>$langs->trans("Fax"), 'checked'=>1),
- 'p.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1),
- 'p.skype'=>array('label'=>$langs->trans("Skype"), 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
- 'p.thirdparty'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
- 'p.priv'=>array('label'=>$langs->trans("ContactVisibility"), 'checked'=>1, 'position'=>200),
- 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- 'p.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
- );
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
- }
- }
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
- print '
';
+
+ print '';
// Ligne des titres
print '';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 781db3fda3f..b656b88efc6 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -112,7 +112,31 @@ if (! empty($conf->barcode->enabled)) {
$fieldstosearchall['p.barcode']='Gencod';
}
+// Definition of fields for lists
+$arrayfields=array(
+ 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
+ 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
+ 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))),
+ 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))),
+ 'p.sellprice'=>array('label'=>$titlesellprice, 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
+ 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
+ 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
+ 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
+ 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+ 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
+ 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000),
+ 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Purchases").')', 'checked'=>1, 'position'=>1000)
+);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
+ }
+}
+
/*
* Actions
*/
@@ -364,31 +388,10 @@ else
}
}
- $arrayfields=array(
- 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
- 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
- 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))),
- 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))),
- 'p.sellprice'=>array('label'=>$titlesellprice, 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
- 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
- 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
- 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
- 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000),
- 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Purchases").')', 'checked'=>1, 'position'=>1000)
- );
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
- }
- }
- $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
- $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
- print '';
+ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
+ $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+
+ print '';
print '';
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder);
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 3d234728a70..1ebdde8b717 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -121,6 +121,55 @@ if (($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp !=
if (($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof6']='ProfId6';
if (!empty($conf->barcode->enabled)) $fieldstosearchall['s.barcode']='Gencod';
+// Define list of fields to show into list
+$checkedcustomercode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0);
+$checkedsuppliercode=(in_array($contextpage, array('supplierlist')) ? 1 : 0);
+$checkedcustomeraccountcode=(in_array($contextpage, array('customerlist')) ? 1 : 0);
+$checkedsupplieraccountcode=(in_array($contextpage, array('supplierlist')) ? 1 : 0);
+$checkedtypetiers=1;
+$checkedprofid1=0;
+$checkedprofid2=0;
+$checkedprofid3=0;
+$checkedprofid4=0;
+$checkedprofid5=0;
+$checkedprofid6=0;
+//$checkedprofid4=((($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') ? 1 : 0);
+//$checkedprofid5=((($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') ? 1 : 0);
+//$checkedprofid6=((($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') ? 1 : 0);
+$checkprospectlevel=(in_array($contextpage, array('prospectlist')) ? 1 : 0);
+$checkstcomm=(in_array($contextpage, array('prospectlist')) ? 1 : 0);
+$arrayfields=array(
+ 's.nom'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
+ 's.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))),
+ 's.code_client'=>array('label'=>$langs->trans("CustomerCodeShort"), 'checked'=>$checkedcustomercode),
+ 's.code_fournisseur'=>array('label'=>$langs->trans("SupplierCodeShort"), 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
+ 's.code_compta'=>array('label'=>$langs->trans("CustomerAccountancyCodeShort"), 'checked'=>$checkedcustomeraccountcode),
+ 's.code_compta_fournisseur'=>array('label'=>$langs->trans("SupplierAccountancyCodeShort"), 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
+ 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
+ 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
+ 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
+ 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
+ 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>$checkedprofid1),
+ 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>$checkedprofid2),
+ 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>$checkedprofid3),
+ 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4),
+ 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5),
+ 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6),
+ 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel),
+ 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm),
+ 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+ 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
+ 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
+);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
+ }
+}
+
/*
@@ -489,56 +538,9 @@ if ($resql)
print '';
}
- // Define list of fields to show into list
- $checkedcustomercode=(in_array($contextpage, array('thirdpartylist', 'customerlist', 'prospectlist')) ? 1 : 0);
- $checkedsuppliercode=(in_array($contextpage, array('supplierlist')) ? 1 : 0);
- $checkedcustomeraccountcode=(in_array($contextpage, array('customerlist')) ? 1 : 0);
- $checkedsupplieraccountcode=(in_array($contextpage, array('supplierlist')) ? 1 : 0);
- $checkedtypetiers=1;
- $checkedprofid1=0;
- $checkedprofid2=0;
- $checkedprofid3=0;
- $checkedprofid4=0;
- $checkedprofid5=0;
- $checkedprofid6=0;
- //$checkedprofid4=((($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') ? 1 : 0);
- //$checkedprofid5=((($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') ? 1 : 0);
- //$checkedprofid6=((($tmp = $langs->transnoentities("ProfId6".$mysoc->country_code)) && $tmp != "ProfId6".$mysoc->country_code && $tmp != '-') ? 1 : 0);
- $checkprospectlevel=(in_array($contextpage, array('prospectlist')) ? 1 : 0);
- $checkstcomm=(in_array($contextpage, array('prospectlist')) ? 1 : 0);
- $arrayfields=array(
- 's.nom'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
- 's.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))),
- 's.code_client'=>array('label'=>$langs->trans("CustomerCodeShort"), 'checked'=>$checkedcustomercode),
- 's.code_fournisseur'=>array('label'=>$langs->trans("SupplierCodeShort"), 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
- 's.code_compta'=>array('label'=>$langs->trans("CustomerAccountancyCodeShort"), 'checked'=>$checkedcustomeraccountcode),
- 's.code_compta_fournisseur'=>array('label'=>$langs->trans("SupplierAccountancyCodeShort"), 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))),
- 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
- 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
- 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
- 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
- 's.siren'=>array('label'=>$langs->trans("ProfId1Short"), 'checked'=>$checkedprofid1),
- 's.siret'=>array('label'=>$langs->trans("ProfId2Short"), 'checked'=>$checkedprofid2),
- 's.ape'=>array('label'=>$langs->trans("ProfId3Short"), 'checked'=>$checkedprofid3),
- 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4),
- 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5),
- 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6),
- 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel),
- 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm),
- 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- 's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
- );
- // Extra fields
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
- }
- }
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+
print '';
print '';
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index e1329a591be..ffd2f878adf 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -194,7 +194,8 @@ if (empty($reshook)) {
$object->note = GETPOST("note");
$object->ldap_sid = GETPOST("ldap_sid");
$object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user") : 0;
-
+ $object->employee = GETPOST('employee');
+
$object->thm = GETPOST("thm") != '' ? GETPOST("thm") : '';
$object->tjm = GETPOST("tjm") != '' ? GETPOST("tjm") : '';
$object->salary = GETPOST("salary") != '' ? GETPOST("salary") : '';
@@ -324,7 +325,8 @@ if (empty($reshook)) {
$object->accountancy_code = GETPOST("accountancy_code");
$object->openid = GETPOST("openid");
$object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user") : 0;
-
+ $object->employee = GETPOST('employee');
+
$object->thm = GETPOST("thm") != '' ? GETPOST("thm") : '';
$object->tjm = GETPOST("tjm") != '' ? GETPOST("tjm") : '';
$object->salary = GETPOST("salary") != '' ? GETPOST("salary") : '';
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index 9c1828653ac..e19b7c8ab6a 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -40,21 +40,6 @@ $socid=0;
if ($user->societe_id > 0)
$socid = $user->societe_id;
-$sall=GETPOST('sall','alpha');
-$search_user=GETPOST('search_user','alpha');
-$search_login=GETPOST('search_login','alpha');
-$search_lastname=GETPOST('search_lastname','alpha');
-$search_firstname=GETPOST('search_firstname','alpha');
-$search_accountancy_code=GETPOST('search_accountancy_code','alpha');
-$search_email=GETPOST('search_email','alpha');
-$search_statut=GETPOST('search_statut','alpha');
-$search_thirdparty=GETPOST('search_thirdparty','alpha');
-$search_supervisor=GETPOST('search_supervisor','alpha');
-$search_previousconn=GETPOST('search_previousconn','alpha');
-$optioncss = GETPOST('optioncss','alpha');
-
-if ($search_statut == '') $search_statut='1';
-
// Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
@@ -89,6 +74,53 @@ $fieldstosearchall = array(
'u.note'=>"Note"
);
+// Definition of fields for list
+$arrayfields=array(
+ 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
+ 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
+ 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
+ 'u.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0),
+ 'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>0),
+ 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0),
+ 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1),
+ 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
+ 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))),
+ 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1),
+ 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100),
+ 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110),
+ 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
+ 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
+ 'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
+);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+ foreach($extrafields->attribute_label as $key => $val)
+ {
+ $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
+ }
+}
+
+// Init search fields
+$sall=GETPOST('sall','alpha');
+$search_user=GETPOST('search_user','alpha');
+$search_login=GETPOST('search_login','alpha');
+$search_lastname=GETPOST('search_lastname','alpha');
+$search_firstname=GETPOST('search_firstname','alpha');
+$search_gender=GETPOST('search_gender','alpha');
+$search_employee=GETPOST('search_employee','alpha');
+$search_accountancy_code=GETPOST('search_accountancy_code','alpha');
+$search_email=GETPOST('search_email','alpha');
+$search_statut=GETPOST('search_statut','alpha');
+$search_thirdparty=GETPOST('search_thirdparty','alpha');
+$search_supervisor=GETPOST('search_supervisor','alpha');
+$search_previousconn=GETPOST('search_previousconn','alpha');
+$optioncss = GETPOST('optioncss','alpha');
+
+// Default search
+if ($search_statut == '') $search_statut='1';
+
+
/*
* Actions
@@ -106,6 +138,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPO
$search_login="";
$search_lastname="";
$search_firstname="";
+ $search_gender="";
+ $search_employee="";
$search_accountancy_code="";
$search_email="";
$search_statut="";
@@ -130,7 +164,7 @@ $buttonviewhierarchy='