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.

191 lines
7.5 KiB

  1. #!/usr/bin/perl
  2. #script to modify/delete groups
  3. #written 8/11/99
  4. # modified 11/11/99 by chris@katipo.co.nz
  5. # modified 18/4/00 by chris@katipo.co.nz
  6. use strict;
  7. use C4::Search;
  8. use CGI;
  9. use C4::Output;
  10. my $input = new CGI;
  11. #
  12. my $bibitemnum=$input->param('bibitem');
  13. my $data=bibitemdata($bibitemnum);
  14. my $biblio=$input->param('biblio');
  15. my $submit=$input->param('submit.x');
  16. if ($submit eq ''){
  17. print $input->redirect("/cgi-bin/koha/delbibitem.pl?bibitemnum=$bibitemnum&biblio=$biblio");
  18. }
  19. print $input->header;
  20. #my ($count,$subject)=subject($data->{'biblionumber'});
  21. #my ($count2,$subtitle)=subtitle($data->{'biblionumber'});
  22. #my ($count3,$addauthor)=addauthor($data->{'biblionumber'});
  23. #my ($analytictitle)=analytic($biblionumber,'t');
  24. #my ($analyticauthor)=analytic($biblionumber,'a');
  25. print startpage();
  26. print startmenu();
  27. my %inputs;
  28. #hash is set up with input name being the key then
  29. #the value is a tab separated list, the first item being the input type
  30. #$inputs{'Author'}="text\t$data->{'author'}\t0";
  31. #$inputs{'Title'}="text\t$data->{'title'}\t1";
  32. my $dewey = $data->{'dewey'};
  33. $dewey =~ s/0+$//;
  34. if ($dewey eq "000.") { $dewey = "";};
  35. if ($dewey < 10){$dewey='00'.$dewey;}
  36. if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
  37. if ($dewey <= 0){
  38. $dewey='';
  39. }
  40. $dewey=~ s/\.$//;
  41. $inputs{'Class'}="text\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
  42. $inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
  43. #$inputs{'Subject'}="textarea\t$sub\t4";
  44. $inputs{'Publisher'}="text\t$data->{'publishercode'}\t5";
  45. #$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
  46. $inputs{'ISBN'}="text\t$data->{'isbn'}\t7";
  47. $inputs{'Publication Year'}="text\t$data->{'publicationyear'}\t8";
  48. $inputs{'Pages'}="text\t$data->{'pages'}\t9";
  49. $inputs{'Illustrations'}="text\t$data->{'illustration'}\t10";
  50. #$inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
  51. #$inputs{'Additional Author'}="text\t$additional\t12";
  52. #$inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
  53. #$inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
  54. #$inputs{'Notes'}="textarea\t$data->{'notes'}\t15";
  55. #$inputs{'Serial'}="text\t$data->{'serial'}\t16";
  56. $inputs{'Volume'}="text\t$data->{'volumeddesc'}\t17";
  57. #$inputs{'Analytic author'}="text\t\t18";
  58. #$inputs{'Analytic title'}="text\t\t19";
  59. $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
  60. $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
  61. print <<printend
  62. <BLOCKQUOTE><FONT SIZE=6>
  63. <em><a href=/cgi-bin/koha/detail.pl?bib=$data->{'biblionumber'}&type=intra>$data->{'title'} ($data->{'author'})</a><br>
  64. Modify Group - $data->{'description'}</em></FONT><br>
  65. <form action=updatebibitem.pl method=post>
  66. <table border=0 cellspacing=0 cellpadding=5 align=left>
  67. <TR VALIGN=TOP bgcolor="99cc33">
  68. <TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=2 ><b><input type=radio name=existing value=YES > RE-ASSIGN TO EXISTING GROUP</b></td></tr>
  69. printend
  70. ;
  71. my ($count,@bibitems)=bibitems($data->{'biblionumber'});
  72. print "<tr valign=top><td colspan=3><select name=existinggroup>\n";
  73. for (my $i=0;$i<$count;$i++){
  74. print "<option value=$bibitems[$i]->{'biblioitemnumber'}>$bibitems[$i]->{'description'} - $bibitems[$i]->{'isbn'}\n";
  75. }
  76. print "</select></td></tr>";
  77. print <<printend
  78. <TR VALIGN=TOP bgcolor="99cc33">
  79. <TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=2 ><b><input type=radio name=existing value=NO checked >OR MODIFY DETAILS</b></td></tr>
  80. <tr valign=top bgcolor=white><td>Item Type</td><td><input type=text name=Item Type value="$data->{'itemtype'}" size=20></td></tr>
  81. <tr valign=top bgcolor=white><td>Class</td><td><input type=text name=Class value="$data->{'classification'}$dewey$data->{'subclass'}" size=20></td></tr>
  82. <tr valign=top bgcolor=white><td>Publisher</td><td><input type=text name=Publisher value="$data->{'publishercode'}" size=20></td></tr>
  83. <tr valign=top bgcolor=white><td>Place</td><td><input type=text name=Place value="$data->{'place'}" size=20></td></tr>
  84. <tr valign=top bgcolor=white><td>ISBN</td><td><input type=text name=ISBN value="$data->{'isbn'}" size=20></td></tr>
  85. <tr valign=top bgcolor=white><td>Publication Year</td><td><input type=text name=Publication Year value="$data->{'publicationyear'}" size=20></td></tr>
  86. <tr valign=top bgcolor=white><td>Pages</td><td><input type=text name=Pages value="$data->{'pages'}" size=20></td></tr>
  87. <tr valign=top bgcolor=white><td>Illustrations</td><td><input type=text name=Illustrations value="$data->{'illustration'}" size=20></td></tr>
  88. <tr valign=top bgcolor=white><td>Volume</td>
  89. <td><input type=text name=Volume value="$data->{'volumeddesc'}" size=20></td></tr>
  90. <tr valign=top bgcolor=white><td>Notes</td>
  91. <td><input type=text name=Notes value="$data->{'notes'}" size=20></td></tr>
  92. <tr valign=top bgcolor=white><td>Size</td>
  93. <td><input type=text name=Size value="$data->{'size'}" size=20></td></tr>
  94. <input type=hidden name=bibnum value="$data->{'biblionumber'}">
  95. <input type=hidden name=bibitemnum value="$data->{'biblioitemnumber'}">
  96. </table>
  97. <img src="/images/holder.gif" width=16 height=500 align=left>
  98. <TABLE cellspacing=0 cellpadding=5 border=0 >
  99. printend
  100. ;
  101. print <<printend;
  102. <TR VALIGN=TOP bgcolor="99cc33">
  103. <TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=5 ><b>CHANGES TO AFFECT THESE BARCODES<br>
  104. Tick ALL barcodes that changes are to apply too. Those left un-ticked will keep the original group record.</td></tr>
  105. <tr valign=top bgcolor=99cc33>
  106. <td background="/images/background-mem.gif">&nbsp;</td>
  107. <td background="/images/background-mem.gif">Barcode</td>
  108. <td background="/images/background-mem.gif">Location</td>
  109. <td background="/images/background-mem.gif">Date Due</td>
  110. <td background="/images/background-mem.gif">Last Seen</td></tr>
  111. printend
  112. ;
  113. my (@items)=itemissues($data->{'biblioitemnumber'});
  114. #print @items;
  115. my $count=@items;
  116. for (my $i=0;$i<$count;$i++){
  117. my @temp=split('-',$items[$i]->{'datelastseen'});
  118. $items[$i]->{'datelastseen'}="$temp[2]/$temp[1]/$temp[0]";
  119. print <<printend
  120. <tr valign=top gcolor=#ffffcc>
  121. <td><input type=checkbox name="check_group_$items[$i]->{'barcode'}"></td>
  122. <td><a href="/cgi-bin/koha/moredetail.pl?item=$items[$i]->{'itemnumber'}&bib=$data->{'biblionumber'}&bi=$data->{'biblioitemnumber'}">$items[$i]->{'barcode'}</a></td>
  123. <td>$items[$i]->{'holdingbranch'}</td>
  124. <td></td>
  125. <td>$items[$i]->{'datelastseen'}</td>
  126. </tr>
  127. printend
  128. ;
  129. }
  130. print <<printend
  131. </table>
  132. <p>
  133. <input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42>
  134. </form>
  135. <p>
  136. <B>HELP:</B> You <b>must</b> click on the appropriate radio button (in the green boxes), and choose to either re-assign the item/s to a record already in the system, or modify this record. IF your changes only apply to some
  137. items, tick the appropriate ones and a new group record will be created automatically for them.
  138. <br clear=all>
  139. <p> &nbsp; </p>
  140. printend
  141. ;
  142. print endmenu();
  143. print endpage();