[Koha-cvs] CVS: koha request.pl,1.14,1.15 modrequest.pl,1.2,1.3

Finlay Thompson finlayt at users.sourceforge.net
Fri Sep 27 07:21:46 CEST 2002


Update of /cvsroot/koha/koha
In directory usw-pr-cvs1:/tmp/cvs-serv27402

Modified Files:
	request.pl modrequest.pl 
Log Message:

Added the possiblity of deleting waiting reservesm or setting them back to not waiting.
uses UpdateReserve now, instead of updatereserves from Reserves2.pm



Index: request.pl
===================================================================
RCS file: /cvsroot/koha/koha/request.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** request.pl	19 Sep 2002 00:24:28 -0000	1.14
--- request.pl	27 Sep 2002 05:21:44 -0000	1.15
***************
*** 40,43 ****
--- 40,44 ----
  # get existing reserves .....
  my ($count,$reserves) = FindReserves($bib);
+ my $totalcount = $count;
  foreach my $res (@$reserves) {
      if ($res->{'found'} eq 'W') {
***************
*** 112,116 ****
  my $existingreserves = "";
  foreach my $res (sort {$a->{'found'} cmp $b->{'found'}} @$reserves){
!     my $prioropt = priorityoptions($count, $res->{'priority'});
      my $bropt = branchoptions($res->{'branchcode'});
      my $bor=$res->{'borrowernumber'};
--- 113,117 ----
  my $existingreserves = "";
  foreach my $res (sort {$a->{'found'} cmp $b->{'found'}} @$reserves){
!     my $prioropt = priorityoptions($totalcount, $res->{'priority'});
      my $bropt = branchoptions($res->{'branchcode'});
      my $bor=$res->{'borrowernumber'};
***************
*** 127,131 ****
      my $rank;
      my $pickup;
-     my $change;
      if ($res->{'found'} eq 'W') {
  	my %env;
--- 128,131 ----
***************
*** 133,150 ****
  	$item = getiteminformation(\%env,$item);
  	$item = "<a href=/cgi-bin/koha/detail.pl?bib=$item->{'biblionumber'} &type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$item->{'barcode'}</a>";
! 	my $wbra = $branches->{$res->{'branchcode'}}->{'branchname'};
! 	$rank = "Item waiting";
  	$type = $item;
! 	$pickup = "at <b>".$wbra."</b>";
! 	$change = "<input type=checkbox name=rank-request value=del>delete";
      } else {
! 	$rank = "<select name=rank-request>$prioropt<option value=del>Del</select>";
  	$pickup = "<select name=pickup>$bropt</select>";
      }
      $existingreserves .= <<"EOF";
  <input type=hidden name=borrower value=$res->{'borrowernumber'}>
  <input type=hidden name=biblio value=$res->{'biblionumber'}>
! <tr VALIGN=TOP>
! <TD>$rank</td>
  <TD>
  <a href=/cgi-bin/koha/moremember.pl?bornum=$bor>$res->{'firstname'} $res->{'surname'}</a>
--- 133,151 ----
  	$item = getiteminformation(\%env,$item);
  	$item = "<a href=/cgi-bin/koha/detail.pl?bib=$item->{'biblionumber'} &type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$item->{'barcode'}</a>";
! 	my $wbrcd = $res->{'branchcode'};
! 	my $wbra = $branches->{$wbrcd}->{'branchname'};
  	$type = $item;
! 	$rank = "<select name=rank-request><option value=W selected>Waiting</option>$prioropt<option value=del>Del</option></select>";
! 	$pickup = "Item waiting at <b>".$wbra."</b> <input type=hidden name=pickup value=$wbrcd>";
      } else {
! 	$rank = "<select name=rank-request>$prioropt<option value=del>Del</option></select>";
  	$pickup = "<select name=pickup>$bropt</select>";
      }
      $existingreserves .= <<"EOF";
+ <tr VALIGN=TOP>
+ <TD>
  <input type=hidden name=borrower value=$res->{'borrowernumber'}>
  <input type=hidden name=biblio value=$res->{'biblionumber'}>
! $rank</td>
  <TD>
  <a href=/cgi-bin/koha/moremember.pl?bornum=$bor>$res->{'firstname'} $res->{'surname'}</a>
***************
*** 168,172 ****
  	    $out .= " selected";
  	}
! 	$out .= ">$i\n";
      }
      return $out;
--- 169,173 ----
  	    $out .= " selected";
  	}
! 	$out .= ">$i</option>\n";
      }
      return $out;
***************
*** 183,187 ****
  	    $selected = "selected";
  	}
! 	$out .= "<option value=$br $selected>$branches->{$br}->{'branchname'}\n";
      }
      return $out;
--- 184,188 ----
  	    $selected = "selected";
  	}
! 	$out .= "<option value=$br $selected>$branches->{$br}->{'branchname'}</option>\n";
      }
      return $out;
***************
*** 189,201 ****
  
  
  
  # printout the page
  
  
! print $input->header;
  
  
  #setup colours
- print startpage();
  print startmenu('catalogue');
  
--- 190,206 ----
  
  
+ #get the time for the form name...
+ my $time = time();
+ 
  
  # printout the page
  
  
! 
! 
! print $input->header(-expires=>'now');
  
  
  #setup colours
  print startmenu('catalogue');
  
***************
*** 216,220 ****
  
  
! <!----------------BIBLIO RESERVE TABLE-------------->
  
  
--- 221,225 ----
  
  
! 
  
  
***************
*** 241,245 ****
  <br>(or choose from list below)</td>
  </tr></table>
! </p>
  
  
--- 246,250 ----
  <br>(or choose from list below)</td>
  </tr></table>
! 
  
  
***************
*** 256,260 ****
  $bibitemrows
  </table>
! </p>
  </form>
  <p>&nbsp;</p>
--- 261,265 ----
  $bibitemrows
  </table>
! 
  </form>
  <p>&nbsp;</p>
***************
*** 262,266 ****
  
  
! <!-----------MODIFY EXISTING REQUESTS----------------->
  
  <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 >
--- 267,273 ----
  
  
! 
! 
! <form name=T$time action=modrequest.pl method=post>
  
  <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 >
***************
*** 270,274 ****
  <td  bgcolor="99cc33" background="/images/background-mem.gif" colspan=7><B>MODIFY EXISTING REQUESTS </b></TD>
  </TR>
- <form action=modrequest.pl method=post>
  <TR VALIGN=TOP>
  
--- 277,280 ----

Index: modrequest.pl
===================================================================
RCS file: /cvsroot/koha/koha/modrequest.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** modrequest.pl	14 Aug 2002 18:12:51 -0000	1.2
--- modrequest.pl	27 Sep 2002 05:21:44 -0000	1.3
***************
*** 40,54 ****
  my @branch=$input->param('pickup');
  my $count=@rank;
! my $del=0;
  for (my $i=0;$i<$count;$i++){
!   if ($rank[$i] ne 'del' && $del == 0){
!     updatereserves($rank[$i],$biblio[$i],$borrower[$i],0,$branch[$i]); #from C4::Reserves2
!     
!   } elsif ($rank[$i] eq 'del'){
!     updatereserves($rank[$i],$biblio[$i],$borrower[$i],1); #from C4::Reserves2
!     $del=1;
!   }
!   
  }
  my $from=$input->param('from');
  if ($from eq 'borrower'){
--- 40,50 ----
  my @branch=$input->param('pickup');
  my $count=@rank;
! 
! # goes through and manually changes the reserves record....
! # no attempt is made to check consistency.
  for (my $i=0;$i<$count;$i++){
!     UpdateReserve($rank[$i],$biblio[$i],$borrower[$i],$branch[$i]); #from C4::Reserves2
  }
+ 
  my $from=$input->param('from');
  if ($from eq 'borrower'){





More information about the Koha-cvs mailing list