From 4391b0c6ea153aea085cec894c0821ff9302a04e Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Fri, 7 Jun 2013 14:55:18 +0200 Subject: [PATCH] [PASSED QA] Bug 10429 - branch filter not working in serial claims In serial claims page, the branch code is displayed in table instead of branch name and branch filter does not work. This patch adds the display of branch name by using branches template plugin. It changes javascript branch filter to make it work. Also sets "all" filter in template (like status filter) to allow translation and sets "all" as selected by default. Librairian branch was selected by default, but the table was not filtered with it. Test plan : - Go to serials claim of a vendor with serials of multiple branches => You see branch filter with "(All)" and table shows libraries names - Check that branch filter does its work Signed-off-by: David Cook Works as described. Signed-off-by: Katrin Fischer Table now shows the branch name instead of the branchcode. First option was named (All), matching the status pull down. When opening the claims page, (All) is preselected and the result list matches with the selection. Before the patch the library was preselected, but the result list did show late issues from all branches. This patch is an improvement, but there is still more work to do. - Filters are not cumulative, but when another filter is selected the first filter is not reset. - It's not possible to combine 2 or more filters. --- .../prog/en/modules/serials/claims.tt | 34 ++++++++++++---------- serials/claims.pl | 1 - 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt index 6b0b89d..4959982 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -1,3 +1,5 @@ +[% USE Branches %] + [% INCLUDE 'doc-head-open.inc' %] Koha › Serials › Claims [% INCLUDE 'doc-head-close.inc' %] @@ -83,16 +85,21 @@ } } - // Filter by branch - function filterByBranch() { - selectedBranch = $("#branchfilter").val(); - if (selectedBranch == "all") { - clearFilters(); - } else { - $("table#claimst tbody tr").hide(); - $("table#claimst tbody tr:contains(" + selectedBranch + ")").show(); - } - } + // Filter by branch + function filterByBranch() { + selectedBranch = $("#branchfilter").val(); + if (selectedBranch == "all") { + clearFilters(); + } else { + $("table#claimst tbody tr").hide(); + $("table#claimst tbody tr").each( function() { + if ( $(this).find("span.branch-" + selectedBranch).size() > 0 ) { + $(this).show(); + } + }); + } + } + // Filter by date function filterByDate() { var beginDate = Date_from_syspref($("#from").val()).getTime(); @@ -220,12 +227,9 @@
  • @@ -273,7 +277,7 @@ [% missingissue.name %] - [% missingissue.branchcode %] + [% Branches.GetName( missingissue.branchcode ) %] [% missingissue.title |html %] diff --git a/serials/claims.pl b/serials/claims.pl index 5377478..c826804 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -73,7 +73,6 @@ if ($supplierid) { } my $branchloop = GetBranchesLoop(); -unshift @$branchloop, {value=> 'all',name=>''}; my $preview=0; if($op && $op eq 'preview'){ -- 1.8.3.2