Merge pull request #5727 from fmarcet/3.9

Fix: Search all  is lost on lists when pagination or when the columns…
This commit is contained in:
Laurent Destailleur 2016-09-10 14:25:16 +02:00 committed by GitHub
commit 87fb00c293
15 changed files with 70 additions and 34 deletions

View File

@ -10,6 +10,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -255,6 +256,7 @@ if ($result)
}
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($sall) $param.='&sall='.$sall;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref;

View File

@ -259,6 +259,7 @@ if ($resql)
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
$param='';
if ($sall) $param.='&sall='.$sall;
if ($socid > 0) $param.='&socid='.$socid;
if ($viewstatut != '') $param.='&viewstatut='.$viewstatut;
if ($orderday) $param.='&orderday='.$orderday;

View File

@ -66,7 +66,6 @@ if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
if (! empty($conf->margin->enabled))
$langs->load('margins');
$sall = trim(GETPOST('sall'));
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility

View File

@ -568,6 +568,7 @@ if ($resql)
}
$param='&socid='.$socid;
if ($sall) $param.='&sall='.$sall;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year=' .$year;

View File

@ -364,6 +364,7 @@ if ($result)
$param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email);
if (!empty($search_categ)) $param.='&search_categ='.urlencode($search_categ);
if ($sall != '') $param.='&amp;sall='.urlencode($sall);
if ($search_lastname != '') $param.='&amp;search_lastname='.urlencode($search_lastname);
if ($search_firstname != '') $param.='&amp;search_firstname='.urlencode($search_firstname);
if ($search_zip != '') $param.='&amp;search_zip='.urlencode($search_zip);

View File

@ -6,6 +6,7 @@
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -222,6 +223,7 @@ if ($resql)
$param.='&search_name='.$search_name;
$param.='&search_ref_supplier='.$search_ref_supplier;
$param.='&search_sale=' .$search_sale;
if ($sall != '') $param.='&sall='.$sall;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -124,6 +125,7 @@ if ($resql)
$expedition = new Expedition($db);
$param="";
if ($sall) $param.= "&amp;sall=".$sall;
if ($search_ref_exp) $param.= "&amp;search_ref_exp=".$search_ref_exp;
if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_company) $param.= "&amp;search_company=".$search_company;

View File

@ -193,6 +193,7 @@ if ($resql)
$i = 0;
$param="";
if ($sall) $param.="&sall=".$sall;
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_user) $param.="&search_user=".$search_user;
if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht;

View File

@ -139,6 +139,7 @@ if ($result)
$num = $db->num_rows($result);
$urlparam='';
if ($sall) $urlparam.="&sall=".$sall;
if ($socid) $urlparam.="&socid=".$socid;
if ($search_ref) $urlparam.="&search_ref=".urlencode($search_ref);
if ($search_company) $urlparam.="&search_company=".urlencode($search_company);

View File

@ -5,6 +5,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -208,6 +209,7 @@ if ($resql)
$i = 0;
$param="";
if ($sall) $param.="&search_all=".$sall;
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_company) $param.="&search_company=".$search_company;
if ($search_user) $param.="&search_user=".$search_user;

View File

@ -239,24 +239,29 @@ if ($resql)
print '</div>';
}
$param="&tosell=$tosell&tobuy=$tobuy".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref";
$param='';
if ($tosell) $param.="&tosell=".$tosell;
if ($tobuy) $param.="&tobuy=".$tobuy;
if ($type) $param.="&type=".$type;
if ($fourn_id) $param.="&fourn_id=".$fourn_id;
if ($snom) $param.="&snom=".$snom;
if ($sref) $param.="&sref=".$sref;
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
// Lignes des titres
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("StockLimit"), $_SERVER["PHP_SELF"], "p.seuil_stock_alerte",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DesiredStock"), $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label","",$param,"",$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("StockLimit"), $_SERVER["PHP_SELF"], "p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DesiredStock"), $_SERVER["PHP_SELF"], "p.desiredstock","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique","",$param,'align="right"',$sortfield,$sortorder);
// TODO Add info of running suppliers/customers orders
//print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -247,28 +248,37 @@ if ($resql)
print $hookmanager->resPrint;
print '</div>';
}
$param="&tosell=$tosell&tobuy=$tobuy".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref&batch=$batch&eatby=$eatby&sellby=$sellby";
$param='';
if ($tosell) $param.="&tosell=".$tosell;
if ($tobuy) $param.="&tobuy=".$tobuy;
if ($type) $param.="&type=".$type;
if ($fourn_id) $param.="&fourn_id=".$fourn_id;
if ($snom) $param.="&snom=".$snom;
if ($sref) $param.="&sref=".$sref;
if ($search_batch) $param.="&search_batch=".$search_batch;
/*if ($eatby) $param.="&eatby=".$eatby;
if ($sellby) $param.="&sellby=".$sellby;*/
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
// Lignes des titres
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Warehouse"), $_SERVER["PHP_SELF"], "",$param,"",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label","",$param,"",$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Warehouse"), $_SERVER["PHP_SELF"], "","",$param,'',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("DesiredStock"), $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Batch"), $_SERVER["PHP_SELF"], "pb.batch",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("l_eatby"), $_SERVER["PHP_SELF"], "pb.eatby",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("l_sellby"), $_SERVER["PHP_SELF"], "pb.sellby",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Batch"), $_SERVER["PHP_SELF"], "pb.batch","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("l_eatby"), $_SERVER["PHP_SELF"], "pb.eatby","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("l_sellby"), $_SERVER["PHP_SELF"], "pb.sellby","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique","",$param,'align="right"',$sortfield,$sortorder);
// TODO Add info of running suppliers/customers orders
//print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre

View File

@ -107,7 +107,13 @@ if ($result)
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
llxHeader("",$langs->trans("ListOfWarehouses"),$help_url);
print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $totalnboflines);
$param = '';
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_label) $param.="&search_label=".$search_label;
if ($search_status) $param.="&search_status=".$search_status;
if ($sall) $param.="&sall=".$sall;
print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -122,17 +128,17 @@ if ($result)
}
$moreforfilter='';
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "e.label","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LocationSummary"),$_SERVER["PHP_SELF"], "e.lieu","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stockqty",'','','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EstimatedStockValue"), $_SERVER["PHP_SELF"], "e.valo_pmp",'','','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EstimatedStockValueSell"), $_SERVER["PHP_SELF"], "",'','','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "e.statut",'','','align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LocationSummary"),$_SERVER["PHP_SELF"], "e.lieu","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stockqty",'',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EstimatedStockValue"), $_SERVER["PHP_SELF"], "e.valo_pmp",'',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EstimatedStockValueSell"), $_SERVER["PHP_SELF"], "",'',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "e.statut",'',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
// Lignes des champs de filtre

View File

@ -5,6 +5,7 @@
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -429,7 +430,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
if ($sall != '') $param = "&amp;sall=".urlencode($sall);
if ($search_all != '') $param = "&amp;sall=".urlencode($search_all);
if ($search_categ != '') $param.='&amp;search_categ='.urlencode($search_categ);
if ($search_sale > 0) $param.='&amp;search_sale='.urlencode($search_sale);
if ($search_nom != '') $param.= "&amp;search_nom=".urlencode($search_nom);

View File

@ -9,7 +9,8 @@
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@ -238,6 +239,7 @@ if ($result)
}
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($sall) $param.='&sall='.$sall;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref;