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.

87 lines
2.5 KiB

  1. #!/usr/bin/perl
  2. use C4::Database;
  3. use CGI;
  4. use strict;
  5. use C4::Acquisitions;
  6. use C4::Output;
  7. my $input= new CGI;
  8. #print $input->header;
  9. #print $input->dump;
  10. #my $title=checkinp($input->param('Title'));
  11. #my $author=checkinp($input->param('Author'));
  12. my $bibnum=checkinp($input->param('bibnum'));
  13. my $itemnum=checkinp($input->param('itemnumber'));
  14. my $copyright=checkinp($input->param('Copyright'));
  15. my $seriestitle=checkinp($input->param('Series'));
  16. my $serial=checkinp($input->param('Serial'));
  17. my $unititle=checkinp($input->param('Unititle'));
  18. my $notes=checkinp($input->param('ItemNotes'));
  19. #need to do barcode check
  20. my $barcode=$input->param('Barcode');
  21. #modbiblio($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes);
  22. my $bibitemnum=checkinp($input->param('bibitemnum'));
  23. #my $olditemtype
  24. my $itemtype=checkinp($input->param('Item'));
  25. my $isbn=checkinp($input->param('ISBN'));
  26. my $publishercode=checkinp($input->param('Publisher'));
  27. my $publicationdate=checkinp($input->param('Publication'));
  28. my $class=checkinp($input->param('Class'));
  29. my $homebranch=checkinp($input->param('Home'));
  30. my $lost=$input->param('Lost');
  31. my $wthdrawn=$input->param('withdrawn');
  32. my $classification;
  33. my $dewey;
  34. my $subclass;
  35. if ($itemtype ne 'NF'){
  36. $classification=$class;
  37. }
  38. if ($class =~/[0-9]+/){
  39. # print $class;
  40. $dewey= $class;
  41. $dewey=~ s/[a-z]+//gi;
  42. my @temp;
  43. if ($class =~ /\./){
  44. @temp=split(/[0-9]+\.[0-9]+/,$class);
  45. } else {
  46. @temp=split(/[0-9]+/,$class);
  47. }
  48. $classification=$temp[0];
  49. $subclass=$temp[1];
  50. # print $classification,$dewey,$subclass;
  51. }else{
  52. $dewey='';
  53. }
  54. my $illus=checkinp($input->param('Illustrations'));
  55. my $pages=checkinp($input->param('Pages'));
  56. my $volumeddesc=checkinp($input->param('Volume'));
  57. #have to check how many items are attached to this bibitem, if one, just change it,
  58. #if more than one, we must create a new one.
  59. #my $number=countitems($bibitemnum);
  60. #if ($number > 1){
  61. # print $number;
  62. #check if bibitemneeds modifying
  63. # my $needsmod=needsmod($bibitemnum,$itemtype);
  64. # if ($needsmod != 1){
  65. # $bibitemnum=newbiblioitem($bibnum,$itemtype,$volumeddesc,$classification);
  66. # }
  67. #}
  68. #modbibitem($bibitemnum,$itemtype,$isbn,$publishercode,$publicationdate,$classification,$dewey,$subclass,$illus,$pages,$volumeddesc);
  69. moditem('loan',$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn);
  70. print $input->redirect("moredetail.pl?type=intra&bib=$bibnum&bi=$bibitemnum");
  71. #print $bibitemnum;
  72. sub checkinp{
  73. my ($inp)=@_;
  74. $inp=~ s/\'/\\\'/g;
  75. $inp=~ s/\"/\\\"/g;
  76. return($inp);
  77. }