Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.5 KiB

  1. #!/usr/bin/perl
  2. #script to place reserves/requests
  3. #writen 2/1/00 by chris@katipo.oc.nz
  4. use strict;
  5. #use DBI;
  6. use C4::Search;
  7. use CGI;
  8. use C4::Output;
  9. use C4::Reserves2;
  10. my $input = new CGI;
  11. #print $input->header;
  12. my @bibitems=$input->param('biblioitem');
  13. my @reqbib=$input->param('reqbib');
  14. my $biblio=$input->param('biblio');
  15. my $borrower=$input->param('member');
  16. my $notes=$input->param('notes');
  17. my $branch=$input->param('pickup');
  18. my @rank=$input->param('rank-request');
  19. my $type=$input->param('type');
  20. my $title=$input->param('title');
  21. my $bornum=borrdata($borrower,'');
  22. if ($type eq 'str8' && $bornum ne ''){
  23. my $count=@bibitems;
  24. @bibitems=sort @bibitems;
  25. my $i2=1;
  26. my @realbi;
  27. $realbi[0]=$bibitems[0];
  28. for (my $i=1;$i<$count;$i++){
  29. my $i3=$i2-1;
  30. if ($realbi[$i3] ne $bibitems[$i]){
  31. $realbi[$i2]=$bibitems[$i];
  32. $i2++;
  33. }
  34. }
  35. #print $input->dump;
  36. my $env;
  37. my $const;
  38. if ($input->param('request') eq 'any'){
  39. $const='a';
  40. CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@realbi,$rank[0],$notes,$title);
  41. } elsif ($reqbib[0] ne ''){
  42. $const='o';
  43. CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@reqbib,$rank[0],$notes,$title);
  44. } else {
  45. CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,'a',\@realbi,$rank[0],$notes,$title);
  46. }
  47. #print @realbi;
  48. print $input->redirect("request.pl?bib=$biblio");
  49. } elsif ($bornum eq ''){
  50. print $input->header();
  51. print "Invalid card number please try again";
  52. print $input->dump;
  53. }