[Koha-patches] [PATCH 15/17] MT #4931 add the ability to choose home or holding branch in stocktaking

paul.poulain at biblibre.com paul.poulain at biblibre.com
Thu Dec 16 15:11:21 CET 2010


From: Paul Poulain <paul.poulain at biblibre.com>

This add radio box in stocktaking to base it on home or holdingbranch
---
 .../prog/en/modules/tools/inventory.tmpl           |    6 ++++++
 tools/inventory.pl                                 |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl
index 0b35000..480441d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl
@@ -76,6 +76,10 @@ $(document).ready(function(){
         <fieldset class="rows">
         <legend>Select items you want to check</legend>
         <ol><li>
+        <label for="branch">Branch</label>
+            <input type="radio" name="branch" value="homebranch">Home Branch</input>
+            <input type="radio" name="branch" value="holdingbranch">Holding Branch</input>
+        </li><li>
         <label for="branchloop">Library</label><select id="branchloop" name="branchcode" style="width:12em;">
             <option value="">All Locations</option>
         <!-- TMPL_LOOP NAME="branchloop" -->
@@ -228,6 +232,7 @@ $(document).ready(function(){
     </form>
     <!-- TMPL_IF NAME="offset" -->
     <form method="post" action="/cgi-bin/koha/tools/inventory.pl">
+        <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
         <input type="hidden" name="minlocation" value="<!-- TMPL_VAR NAME="minlocation" -->" />
         <input type="hidden" name="maxlocation" value="<!-- TMPL_VAR NAME="maxlocation" -->" />
         <input type="hidden" name="location" value="<!-- TMPL_VAR NAME="location" -->" />
@@ -241,6 +246,7 @@ $(document).ready(function(){
     <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="nextoffset" -->
     <form method="post">
+        <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
         <input type="hidden" name="location" value="<!-- TMPL_VAR NAME="location" -->" />
         <input type="hidden" name="branchcode" value="<!-- TMPL_VAR NAME="branchcode" -->" />
         <input type="hidden" name="minlocation" value="<!-- TMPL_VAR NAME="minlocation" -->" />
diff --git a/tools/inventory.pl b/tools/inventory.pl
index c87a7e9..f8903e5 100755
--- a/tools/inventory.pl
+++ b/tools/inventory.pl
@@ -49,6 +49,7 @@ $offset=0 unless $offset;
 my $pagesize = $input->param('pagesize');
 $pagesize=50 unless $pagesize;
 my $branchcode = $input->param('branchcode');
+my $branch     = $input->param('branch');
 my $op = $input->param('op');
 my $res;    #contains the results loop
 # warn "uploadbarcodes : ".$uploadbarcodes;
@@ -129,6 +130,7 @@ $template->param(branchloop => \@branch_loop,
                 location=>$location,
                 ignoreissued=>$ignoreissued,
                 branchcode=>$branchcode,      
+                branch    => $branch,
                 offset => $offset,
                 pagesize => $pagesize,
                 datelastseen => $datelastseen,
@@ -183,7 +185,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa
         }
     }
     if ($markseen or $op) {
-        $res = GetItemsForInventory($minlocation,$maxlocation,$location, $ignoreissued,$itemtype,$datelastseen,$branchcode,$offset,$pagesize,$staton);
+        $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $ignoreissued, $itemtype, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton );
         $template->param(loop =>$res,
                         nextoffset => ($offset+$pagesize),
                         prevoffset => ($offset?$offset-$pagesize:0),
-- 
1.7.1



More information about the Koha-patches mailing list