diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index d4d74ec3fe6..ba8ed5624d1 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2970,7 +2970,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
* @param string $morecss More css to the table
- * @param int|string $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit).
+ * @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit).
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
@@ -2983,7 +2983,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
if ($picto == 'setup') $picto='title_setup.png';
if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif';
if ($limit < 0) $limit = $conf->liste_limit;
- if ($savlimit >= 0 && (($num > $limit) || ($num == -1) || ($limit == 0)))
+ if ($savlimit != 0 && (($num > $limit) || ($num == -1) || ($limit == 0)))
{
$nextpage = 1;
}
@@ -2991,7 +2991,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
{
$nextpage = 0;
}
-
+ //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage;
+
print "\n";
print "\n";
print '
';
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 75dca94540b..627bb67ff53 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -50,12 +50,12 @@ if ($socid > 0)
if (!$user->rights->projet->lire) accessforbidden();
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST("sortfield","alpha");
$sortorder = GETPOST("sortorder");
$page = GETPOST("page");
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
-
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$offset = $conf->liste_limit * $page ;
@@ -71,6 +71,7 @@ $search_all=GETPOST("search_all");
$search_status=GETPOST("search_status",'int');
$search_opp_status=GETPOST("search_opp_status",'alpha');
$search_opp_percent=GETPOST("search_opp_percent",'alpha');
+$search_opp_amount=GETPOST("search_opp_amount",'alpha');
$search_public=GETPOST("search_public",'int');
$search_user=GETPOST('search_user','int');
$search_sale=GETPOST('search_sale','int');
@@ -88,16 +89,6 @@ $year = GETPOST('year','int');
if ($search_status == '') $search_status=-1; // -1 or 1
-$sortfield = GETPOST("sortfield",'alpha');
-$sortorder = GETPOST("sortorder",'alpha');
-$page = GETPOST("page",'int');
-$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
-if ($page == -1) { $page = 0; }
-$offset = $limit * $page;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
-if (! $sortfield) $sortfield='p.ref';
-if (! $sortorder) $sortorder='DESC';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$contextpage='projectlist';
@@ -160,6 +151,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_year="";
$search_status=-1;
$search_opp_status=-1;
+ $search_opp_amount='';
+ $search_opp_percent='';
$search_public="";
$search_sale="";
$search_user='';
@@ -237,6 +230,8 @@ if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$soc
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_label) $sql .= natural_search('p.title', $search_label);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
+if ($search_opp_amount) $sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
+if ($search_opp_percent) $sql .= natural_search('p.opp_percent', $search_opp_percent, 1);
if ($smonth > 0)
{
if ($syear > 0 && empty($sday))
@@ -301,6 +296,7 @@ if ($resql)
$num = $db->num_rows($resql);
$param='';
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sday) $param.='&sday='.$day;
if ($smonth) $param.='&smonth='.$smonth;
if ($syear) $param.='&syear=' .$syear;
@@ -329,7 +325,6 @@ if ($resql)
$text=$langs->trans("Projects");
if ($search_user == $user->id) $text=$langs->trans('MyProjects');
- print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num,'','title_project');
print '