Bug 9604: filter overdues with homebranch and holdingbranch
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Wed, 13 Feb 2013 08:41:29 +0000 (09:41 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 23 Mar 2013 02:05:38 +0000 (22:05 -0400)
This patch adds in overdues.pl filters on item home branch and holding branch.

Test plan :
Play with item home branch and holding branch filters and check
it filters well results.

Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Filters are added to the list of overdues in the circulation module.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
circ/overdue.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt

index 8fed8c8..1e1bd6f 100755 (executable)
@@ -40,6 +40,8 @@ my $borcatfilter    = $input->param('borcat') || '';
 my $itemtypefilter  = $input->param('itemtype') || '';
 my $borflagsfilter  = $input->param('borflag') || '';
 my $branchfilter    = $input->param('branch') || '';
+my $homebranchfilter    = $input->param('homebranch') || '';
+my $holdingbranchfilter = $input->param('holdingbranch') || '';
 my $op              = $input->param('op') || '';
 my $dateduefrom = format_date_in_iso($input->param( 'dateduefrom' )) || '';
 my $datedueto   = format_date_in_iso($input->param( 'datedueto' )) || '';
@@ -214,7 +216,11 @@ if (@patron_attr_filter_loop) {
 $template->param(
     patron_attr_header_loop => [ map { { header => $_->{description} } } grep { ! $_->{isclone} } @patron_attr_filter_loop ],
     branchloop   => GetBranchesLoop($branchfilter, $onlymine),
+    homebranchloop => GetBranchesLoop( $homebranchfilter, $onlymine ),
+    holdingbranchloop => GetBranchesLoop( $holdingbranchfilter, $onlymine ),
     branchfilter => $branchfilter,
+    homebranchfilter => $homebranchfilter,
+    holdingbranchfilter => $homebranchfilter,
     borcatloop=> \@borcatloop,
     itemtypeloop => \@itemtypeloop,
     patron_attr_filter_loop => \@patron_attr_filter_loop,
@@ -260,6 +266,8 @@ if ($noreport) {
         issues.itemnumber,
         issues.issuedate,
         items.barcode,
+        items.homebranch,
+        items.holdingbranch,
         biblio.title,
         biblio.author,
         borrowers.borrowernumber,
@@ -295,6 +303,8 @@ if ($noreport) {
         $strsth .= " AND borrowers.lost <> 0";
     }
     $strsth.=" AND borrowers.branchcode   = '" . $branchfilter   . "' " if $branchfilter;
+    $strsth.=" AND items.homebranch       = '" . $homebranchfilter . "' " if $homebranchfilter;
+    $strsth.=" AND items.holdingbranch    = '" . $holdingbranchfilter . "' " if $holdingbranchfilter;
     $strsth.=" AND date_due < '" . $datedueto . "' "  if $datedueto;
     $strsth.=" AND date_due > '" . $dateduefrom . "' " if $dateduefrom;
     # restrict patrons (borrowers) to those matching the patron attribute filter(s), if any
@@ -352,6 +362,8 @@ if ($noreport) {
             title                  => $data->{title},
             author                 => $data->{author},
             branchcode             => $data->{branchcode},
+            homebranchcode         => $data->{homebranchcode},
+            holdingbranchcode      => $data->{holdingbranchcode},
             itemcallnumber         => $data->{itemcallnumber},
             replacementprice       => $data->{replacementprice},
             enumchron              => $data->{enumchron},
index f45dbea..5e5dd59 100644 (file)
@@ -194,6 +194,28 @@ overdue as of [% todaysdate %][% IF ( isfiltered ) %] <span style="font-size:70%
     </li>
 
     <li>
+        <label>Item home branch:</label>
+        <select name="homebranch" id="homebranch">
+            <option value="">Any</option>
+            [% FOREACH homebranchloo IN homebranchloop %][% IF ( homebranchloo.selected ) %]
+            <option value="[% homebranchloo.value |html %]" selected="selected">[% homebranchloo.branchname %]</option>[% ELSE %]
+            <option value="[% homebranchloo.value |html %]">[% homebranchloo.branchname %]</option>[% END %]
+            [% END %]
+        </select>
+    </li>
+
+    <li>
+        <label>Item holding branch:</label>
+            <select name="holdingbranch" id="holdingbranch">
+            <option value="">Any</option>
+            [% FOREACH holdingbranchloo IN holdingbranchloop %][% IF ( holdingbranchloo.selected ) %]
+            <option value="[% holdingbranchloo.value |html %]" selected="selected">[% holdingbranchloo.branchname %]</option>[% ELSE %]
+            <option value="[% holdingbranchloo.value |html %]">[% holdingbranchloo.branchname %]</option>[% END %]
+            [% END %]
+        </select>
+    </li>
+
+    <li>
     <label>Library of the patron:</label><select name="branch" id="branch">
         <option value="">Any</option>
       [% FOREACH branchloo IN branchloop %]