From 1583d0e49f25411c6562724446597ff5143bce82 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Dec 2016 14:14:03 +0100 Subject: [PATCH] Fix linkof mass action for pdf merge --- htdocs/comm/propal/list.php | 2 +- htdocs/core/class/html.form.class.php | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index cdcedf9bbcc..02afc350e97 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -289,7 +289,7 @@ if ($sall) { } if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; -if ($viewstatut <> '') +if ($viewstatut != '' && $viewstatut != '-1') { $sql.= ' AND p.fk_statut IN ('.$viewstatut.')'; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ee5bb19bc9a..f5ed62e0b0c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -562,10 +562,17 @@ class Form jQuery(".checkforselect").click(function() { initCheckForSelect(); }); - /* Warning: if you set submit button to disabled, post using Enter will no more work jQuery(".massactionselect").change(function() { - console.log( $( this ).val() ); - if ($(this).val() != \'0\') + var massaction = $( this ).val(); + var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); + if (massaction == "builddoc") + { + urlform = urlform + "#show_files"; + } + $( this ).closest("form").attr("action", urlform); + console.log("we select a mass action "+massaction+" - "+urlform); + /* Warning: if you set submit button to disabled, post using Enter will no more work + if ($(this).val() != \'0\') { jQuery(".massactionconfirmed").prop(\'disabled\', false); } @@ -573,8 +580,8 @@ class Form { jQuery(".massactionconfirmed").prop(\'disabled\', true); } - }); - */ + */ + }); }); ';