Bug 10429: improve display of library and library filter on serials claim page
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 7 Jun 2013 12:55:18 +0000 (14:55 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 6 Jan 2014 15:33:28 +0000 (15:33 +0000)
In serial claims page, the library code is displayed in table instead
of library name and library filter does not work.

This patch adds the display of library name by using libraries template
plugin.  It changes the Javascript library filter to make it work.

Also sets "all" filter in template (like status filter) to allow
translation and sets "all" as selected by default. The staff user's
library 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 libraries
=> You see branch filter with "(All)" and table shows library's names
- Check that library  filter does its work

Signed-off-by: David Cook <dcook@prosentient.com.au>
Works as described.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
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.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
serials/claims.pl

index 6b0b89d..4959982 100644 (file)
@@ -1,3 +1,5 @@
+[% USE Branches %]
+
 [% INCLUDE 'doc-head-open.inc' %]
     <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
     [% INCLUDE 'doc-head-close.inc' %]
         }
     }
 
-       // 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();
     <li>
            <label for="branchfilter">Library: </label>
            <select id="branchfilter" onchange="filterByBranch();">
+            <option value="all" selected="selected">(All)</option>
             [% FOREACH branchloo IN branchloop %]
-                [% IF ( branchloo.selected ) %]
-                <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
-                [% ELSE %]
                 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
-                [% END %]
             [% END %]
         </select>
        </li>
                         [% missingissue.name %]
                         </td>
                         <td>
-                        [% missingissue.branchcode %]
+                            <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
                         </td>
                         <td>
                         <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
index 5377478..c826804 100755 (executable)
@@ -73,7 +73,6 @@ if ($supplierid) {
 }
 
 my $branchloop = GetBranchesLoop();
-unshift @$branchloop, {value=> 'all',name=>''};
 
 my $preview=0;
 if($op && $op eq 'preview'){