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.

144 lines
4.9 KiB

  1. #!/usr/bin/perl
  2. #script to modify/delete biblios
  3. #written 8/11/99
  4. # modified 11/11/99 by chris@katipo.co.nz
  5. use strict;
  6. use C4::Search;
  7. use CGI;
  8. use C4::Output;
  9. use C4::Acquisitions;
  10. my $input = new CGI;
  11. my $submit=$input->param('delete.x');
  12. my $itemnum=$input->param('item');
  13. my $bibitemnum=$input->param('bibitem');
  14. if ($submit ne ''){
  15. print $input->redirect("/cgi-bin/koha/delitem.pl?itemnum=$itemnum&bibitemnum=$bibitemnum");
  16. }
  17. print $input->header;
  18. #print $input->dump;
  19. my $data=bibitemdata($bibitemnum);
  20. my $item=itemnodata('blah','',$itemnum);
  21. #my ($analytictitle)=analytic($biblionumber,'t');
  22. #my ($analyticauthor)=analytic($biblionumber,'a');
  23. print startpage();
  24. print startmenu();
  25. my %inputs;
  26. #hash is set up with input name being the key then
  27. #the value is a tab separated list, the first item being the input type
  28. #$inputs{'Author'}="text\t$data->{'author'}\t0";
  29. #$inputs{'Title'}="text\t$data->{'title'}\t1";
  30. my $dewey = $data->{'dewey'};
  31. $dewey =~ s/0+$//;
  32. if ($dewey eq "000.") { $dewey = "";};
  33. if ($dewey < 10){$dewey='00'.$dewey;}
  34. if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
  35. if ($dewey <= 0){
  36. $dewey='';
  37. }
  38. $dewey=~ s/\.$//;
  39. $inputs{'Barcode'}="text\t$item->{'barcode'}\t0";
  40. $inputs{'Class'}="hidden\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
  41. #$inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
  42. #$inputs{'Subject'}="textarea\t$sub\t4";
  43. $inputs{'Publisher'}="hidden\t$data->{'publishercode'}\t5";
  44. #$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
  45. $inputs{'ISBN'}="hidden\t$data->{'isbn'}\t7";
  46. $inputs{'Publication Year'}="hidden\t$data->{'publicationyear'}\t8";
  47. $inputs{'Pages'}="hidden\t$data->{'pages'}\t9";
  48. $inputs{'Illustrations'}="hidden\t$data->{'illustration'}\t10";
  49. #$inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
  50. #$inputs{'Additional Author'}="text\t$additional\t12";
  51. #$inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
  52. #$inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
  53. $inputs{'ItemNotes'}="textarea\t$item->{'itemnotes'}\t15";
  54. #$inputs{'Serial'}="text\t$data->{'serial'}\t16";
  55. $inputs{'Volume'}="hidden\t$data->{'volumeddesc'}\t17";
  56. $inputs{'Home Branch'}="text\t$item->{'homebranch'}\t18";
  57. $inputs{'Lost'}="radio\t$item->{'itemlost'}\t19";
  58. #$inputs{'Analytic author'}="text\t\t18";
  59. #$inputs{'Analytic title'}="text\t\t19";
  60. $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
  61. $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
  62. $inputs{'itemnumber'}="hidden\t$itemnum\t22";
  63. print <<printend
  64. <FONT SIZE=6><em>$data->{'title'} ($data->{'author'})</em></FONT><br>
  65. <table border=0 cellspacing=0 cellpadding=5>
  66. <tr valign=top bgcolor=white><td><form action=updateitem.pl method=post>
  67. <table border=0 cellspacing=0 cellpadding=5>
  68. <tr valign=top bgcolor=white><td>Barcode</td><td><input type=text name=Barcode value="$item->{'barcode'}" size=40></td></tr>
  69. <input type=hidden name=Class value="$data->{'classification'}$dewey$data->{'subclass'}">
  70. <input type=hidden name=Publisher value="$data->{'publisher'}">
  71. <input type=hidden name=ISBN value="$data->{'isbn'}">
  72. <input type=hidden name=Publication Year value="$data->{'publicationyear'}">
  73. <input type=hidden name=Pages value="$data->{'pages'}">
  74. <input type=hidden name=Illustrations value="$data->{'illustration'}">
  75. <tr valign=top bgcolor=white><td>ItemNotes</td><td><textarea name=ItemNotes cols=40 rows=4>$item->{'itemnotes'}</textarea></td></tr>
  76. <input type=hidden name=Volume value="$data->{'volumeddesc'}">
  77. <tr valign=top bgcolor=white><td>Home Branch</td><td><input type=text name=Home Branch value="$item->{'homebranch'}" size=40></td></tr>
  78. <tr valign=top bgcolor=white><td>Lost</td><td><input type=radio name=Lost value=1
  79. printend
  80. ;
  81. if ($item->{'itemlost'} ==1){
  82. print " checked ";
  83. }
  84. print <<printend
  85. >Yes
  86. <input type=radio name=Lost value=0
  87. printend
  88. ;
  89. if ($item->{'itemlost'} ==0){
  90. print " checked ";
  91. }
  92. print <<printend
  93. >No</td></tr>
  94. <tr valign=top bgcolor=white><td>Cancelled</td><td><input type=radio name=withdrawn value=1
  95. printend
  96. ;
  97. if ($item->{'wthdrawn'} ==1){
  98. print " checked ";
  99. }
  100. print <<printend
  101. >Yes
  102. <input type=radio name=withdrawn value=0
  103. printend
  104. ;
  105. if ($item->{'wthdrawn'} ==0){
  106. print " checked ";
  107. }
  108. print <<printend
  109. >No</td></tr>
  110. <input type=hidden name=bibnum value="$data->{'biblionumber'}">
  111. <input type=hidden name=bibitemnum value="$data->{'biblioitemnumber'}">
  112. <input type=hidden name=itemnumber value="$itemnum">
  113. <tr valign=top bgcolor=white><td></td><td>
  114. <input type=image name=submit src=/images/save-changes.gif border=0 width=187
  115. height=42></td></tr>
  116. </table>
  117. </form></td></tr>
  118. </table>
  119. printend
  120. ;
  121. print endmenu();
  122. print endpage();