koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha opac/opac-reserve.pl koha-tmpl/opac-tmpl/n... [rel_2_2]


From: Chris Cormack
Subject: [Koha-cvs] koha opac/opac-reserve.pl koha-tmpl/opac-tmpl/n... [rel_2_2]
Date: Fri, 20 Apr 2007 00:58:53 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Chris Cormack <rangi>   07/04/20 00:58:53

Modified files:
        opac           : opac-reserve.pl 
        koha-tmpl/opac-tmpl/npl/en: opac-reserve.tmpl 

Log message:
        Allowing reserving of items in Opac, if itemlevelreserves sys pref is 
set.
        Default behaviour if not. Its working but needs more testing. 
        Expect more commits in the near future

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-reserve.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.22.2.10&r2=1.22.2.11
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/npl/en/opac-reserve.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.5&r2=1.1.2.6

Patches:
Index: opac/opac-reserve.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-reserve.pl,v
retrieving revision 1.22.2.10
retrieving revision 1.22.2.11
diff -u -b -r1.22.2.10 -r1.22.2.11
--- opac/opac-reserve.pl        17 Apr 2007 19:35:14 -0000      1.22.2.10
+++ opac/opac-reserve.pl        20 Apr 2007 00:58:53 -0000      1.22.2.11
@@ -156,7 +156,12 @@
 foreach my $pt (@publictypes) {
     $typecount += $pt->{'count'};
 }
-$template->param(onlyone => 1) if $typecount == 1;
+if (C4::Context->preference('itemlevelreserves')){
+    $template->param(itemlevel => 1);
+}
+else {
+    $template->param(onlyone => 1) if $typecount == 1;
+}
 
 my @typerows;
 for (my $rownum=0;$rownum<$publictypes[0]->{'count'} ;$rownum++) {
@@ -171,7 +176,12 @@
     $fill-- if $fill;
     push @typerows, {ROW => address@hidden, fill => $fill};
 }
-$template->param(TYPE_ROWS => address@hidden);
+if (C4::Context->preference('itemlevelreserves')){
+    $template->param(TYPE_ROWS => address@hidden);
+}
+else {
+    $template->param(TYPE_ROWS => address@hidden);
+}
 $width = 2*$width -1;
 $template->param(totalwidth => 2*$width-1,
 );
@@ -198,6 +208,22 @@
                $fee += 
CalcReserveFee(undef,$borrowernumber,$biblionumber,'o',address@hidden);
                }
                $proceed = 1;
+        }
+        elsif (C4::Context->preference('itemlevelreserves')){
+           my @itemnumbers = $query->param('itemnumber');
+           my @reqbibs;
+           if (@itemnumbers){
+               @address@hidden;
+           }
+           my @items;
+           foreach my $item (@itemnumbers){
+               my %newitem;
+               $newitem{'itemnumber'} = $item;
+               push @items,\%newitem;
+           }
+           $template->param(ITEMS => address@hidden);
+           $fee += 
CalcReserveFee(undef,$borrowernumber,$biblionumber,'o',address@hidden);
+           $proceed = 1;
        } elsif ($query->param('all')) {
                $template->param(all => 1);
                $fee = 0;
@@ -218,6 +244,12 @@
 } elsif ($query->param('place_reserve')) {
        # here we actually do the reserveration. Stage 3.
        my $title = $bibdata->{'title'};
+    if (C4::Context->preference('itemlevelreserves')){
+       if (my @reqbibs=$query->param('itemnumber')){
+           
CreateReserve(undef,$branch,$borrowernumber,$biblionumber,'o',address@hidden,$rank,'',$title);
+       }
+    }
+    else {                                             
        my @itemtypes = $query->param('itemtype');
        foreach my $type (@itemtypes) {
                my @reqbibs;
@@ -228,6 +260,7 @@
                }
                
CreateReserve(undef,$branch,$borrowernumber,$biblionumber,'o',address@hidden,$rank,'',$title);
        }
+    }
        if ($query->param('all')) {
                CreateReserve(undef,$branch,$borrowernumber,$biblionumber,'a', 
undef, $rank,'',$title);
        }

Index: koha-tmpl/opac-tmpl/npl/en/opac-reserve.tmpl
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/opac-tmpl/npl/en/Attic/opac-reserve.tmpl,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -b -r1.1.2.5 -r1.1.2.6
--- koha-tmpl/opac-tmpl/npl/en/opac-reserve.tmpl        17 Apr 2007 19:35:14 
-0000      1.1.2.5
+++ koha-tmpl/opac-tmpl/npl/en/opac-reserve.tmpl        20 Apr 2007 00:58:53 
-0000      1.1.2.6
@@ -51,14 +51,25 @@
       <p><input class="checkbox" type="checkbox" name="all" 
value="next-available">
         Next Available Copy (any format)</p>
     <h4>
+    <!-- TMPL_IF NAME="itemlevel" -->
+     ...Or Choose item
+    <!-- TMPL_ELSE -->
      ...Or Choose Acceptable Formats
+    <!-- /TMPL_IF -->
     </h4>
-
+<!-- TMPL_IF NAME="itemlevel" -->
+<ul>
+<!-- TMPL_LOOP NAME="TYPE_ROWS" -->
+<li><input type="checkbox" name="itemnumber" value="<!-- TMPL_VAR 
NAME="itemnumber"-->"><!-- TMPL_VAR NAME="itemtype" --> <!--TMPL_VAR 
NAME="holdingbranch" --> <!-- TMPL_VAR NAME="barcode" --></li>
+<!-- /TMPL_LOOP -->
+</ul>
+<!-- TMPL_ELSE -->
 <!-- TMPL_LOOP NAME="TYPE_ROWS" -->
 <ul><!-- TMPL_LOOP NAME="ROW" -->
 <li><input type="checkbox" name="itemtype" value="<!-- TMPL_VAR 
NAME="itemtype" -->" class="checkbox"><!-- TMPL_VAR NAME="description" --></li>
 <!-- /TMPL_LOOP -->
 </ul><!-- /TMPL_LOOP -->
+<!-- /TMPL_IF -->
 <!-- <table>
        <tr>
     <th>Number of Copies</th><th>Requests already received for this title</th> 
<th>Items curently on issue, due back</th></tr>
@@ -89,10 +100,16 @@
 <!-- TMPL_IF NAME="all" -->
                <tr><th>Item Type: </th><td>Any<input type="hidden" name="all" 
value="1"></td></tr>
 <!-- TMPL_ELSE -->
+<!-- TMPL_IF NAME="itemlevel" -->
+  <tr><th>Items</th><td><!--TMPL_LOOP NAME="ITEMS"-->
+  <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR 
NAME="itemnumber" -->"> <!-- TMPL_VAR NAME="itemnumber" -->
+  <!-- /TMPL_LOOP -->
+  </td></tr>
+<!-- TMPL_ELSE -->
                <tr><th>Item Types: </th><td><!-- TMPL_LOOP NAME="TYPES" -->
 <input type="hidden" name="itemtype" value="<!-- TMPL_VAR NAME="itemtype" 
-->"><!-- TMPL_VAR NAME="description" -->;
 <!-- /TMPL_LOOP --></td></tr>
-
+<!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
                <tr><th>Pick up From: </th><td><!-- TMPL_VAR NAME="branchname" 
--><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" 
-->"></td></tr>
 </table>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]