diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php
index bbe67d68df5..46111e14716 100644
--- a/dev/skeletons/skeleton_list.php
+++ b/dev/skeletons/skeleton_list.php
@@ -124,6 +124,9 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Put here all code to do according to value of "action" parameter
********************************************************************/
+if (GETPOST('cancel')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction')) { $massaction=''; }
+
$parameters=array();
$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');
@@ -142,6 +145,19 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPO
if (empty($reshook))
{
+ // Mass actions. Controls on number of lines checked
+ $maxformassaction=1000;
+ if (! empty($massaction) && count($toselect) < 1)
+ {
+ $error++;
+ setEventMessages($langs->trans("NoLineChecked"), null, "warnings");
+ }
+ if (! $error && count($toselect) > $maxformassaction)
+ {
+ setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
+ $error++;
+ }
+
// Action to delete
if ($action == 'confirm_delete')
{
@@ -266,6 +282,7 @@ if ($resql)
if ($optioncss != '') print '';
print '';
print '';
+ print '';
print '';
print '';
@@ -297,8 +314,8 @@ if ($resql)
// Fields title
print '
';
- if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
- if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
+ if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@@ -315,8 +332,8 @@ if ($resql)
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
- if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+ if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
//if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
print '
'."\n";
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index ea0e1ce2de2..4aff2989462 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -59,7 +59,7 @@ $search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_montant_vat=GETPOST('search_montant_vat','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
-$search_author=GETPOST('search_author','alpha');
+$search_login=GETPOST('search_login','alpha');
$search_product_category=GETPOST('search_product_category','int');
$search_town=GETPOST('search_town','alpha');
$search_zip=GETPOST('search_zip','alpha');
@@ -90,9 +90,6 @@ if (! $sortorder) $sortorder='DESC';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$contextpage='proposallist';
-// Nombre de ligne pour choix de produit/service predefinis
-$NBLINES=4;
-
// Security check
$module='propal';
$dbtable='';
@@ -129,11 +126,11 @@ if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate";
$checkedtypetiers=0;
$arrayfields=array(
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
- 'p.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
+ 'p.ref_client'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
- 'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
+ 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
'p.date'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
@@ -160,6 +157,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
* Actions
*/
+if (GETPOST('cancel')) { $action='list'; $massaction=''; }
+if (! GETPOST('confirmmassaction')) { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -179,7 +178,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_montant_ht='';
$search_montant_vat='';
$search_montant_ttc='';
- $search_author='';
+ $search_login='';
$search_product_category='';
$search_town='';
$search_zip="";
@@ -196,6 +195,25 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
}
if ($object_statut != '') $viewstatut=$object_statut;
+if (empty($reshook))
+{
+ // Mass actions. Controls on number of lines checked
+ $maxformassaction=1000;
+ if (! empty($massaction) && count($toselect) < 1)
+ {
+ $error++;
+ setEventMessages($langs->trans("NoLineChecked"), null, "warnings");
+ }
+ if (! $error && count($toselect) > $maxformassaction)
+ {
+ setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors');
+ $error++;
+ }
+
+
+
+
+}
@@ -259,7 +277,7 @@ if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdp
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
-if ($search_author) $sql.= " AND u.login LIKE '%".$db->escape(trim($search_author))."%'";
+if ($search_login) $sql.= " AND u.login LIKE '%".$db->escape(trim($search_login))."%'";
if ($search_montant_ht != '') $sql.= natural_search("p.total_ht", $search_montant_ht, 1);
if ($search_montant_vat != '') $sql.= natural_search("p.tva", $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql.= natural_search("p.total", $search_montant_ttc, 1);
@@ -344,7 +362,7 @@ if ($result)
if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
- if ($search_author) $param.='&search_author='.$search_author;
+ if ($search_login) $param.='&search_login='.$search_login;
if ($search_town) $param.='&search_town='.$search_town;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
@@ -355,6 +373,8 @@ if ($result)
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
+ //$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
+
// Lignes des champs de filtre
print '