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.

91 lines
3.4 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. my $input = new CGI;
  10. my $bibnum=$input->param('bibnum');
  11. my $data=bibdata($bibnum);
  12. my ($count,$subject)=subject($data->{'biblionumber'});
  13. my ($count2,$subtitle)=subtitle($data->{'biblionumber'});
  14. my ($count3,$addauthor)=addauthor($data->{'biblionumber'});
  15. my $submit=$input->param('submit.x');
  16. if ($submit eq ''){
  17. print $input->redirect("/cgi-bin/koha/delbiblio.pl?biblio=$bibnum");
  18. }
  19. print $input->header;
  20. #my ($analytictitle)=analytic($biblionumber,'t');
  21. #my ($analyticauthor)=analytic($biblionumber,'a');
  22. print startpage();
  23. print startmenu();
  24. my %inputs;
  25. #have to get all subtitles, subjects and additional authors
  26. my $sub=$subject->[0]->{'subject'};
  27. for (my $i=1;$i<$count;$i++){
  28. $sub=$sub."|".$subject->[$i]->{'subject'};
  29. }
  30. my $additional=$addauthor->[0]->{'author'};
  31. for (my $i=1;$i<$count3;$i++){
  32. $additional=$additional."|".$addauthor->[$i]->{'author'};
  33. }
  34. #hash is set up with input name being the key then
  35. #the value is a tab separated list, the first item being the input type
  36. $inputs{'Author'}="text\t$data->{'author'}\t0";
  37. $data->{'title'}=tidyhtml($data->{'title'});
  38. $inputs{'Title'}="text\t$data->{'title'}\t1";
  39. my $dewey = $data->{'dewey'};
  40. $dewey =~ s/0+$//;
  41. if ($dewey eq "000.") { $dewey = "";};
  42. if ($dewey < 10){$dewey='00'.$dewey;}
  43. if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
  44. if ($dewey <= 0){
  45. $dewey='';
  46. }
  47. $dewey=~ s/\.$//;
  48. #$inputs{'Class'}="text\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
  49. #$inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
  50. $inputs{'Subject'}="textarea\t$sub\t4";
  51. #$inputs{'Publisher'}="text\t$data->{'publishercode'}\t5";
  52. $inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
  53. #$inputs{'ISBN'}="text\t$data->{'isbn'}\t7";
  54. #$inputs{'Publication Year'}="text\t$data->{'publicationyear'}\t8";
  55. #$inputs{'Pages'}="text\t$data->{'pages'}\t9";
  56. #$inputs{'Illustrations'}="text\t$data->{'illustration'}\t10";
  57. $inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
  58. $inputs{'Additional Author'}="text\t$additional\t12";
  59. $inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
  60. $inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
  61. $inputs{'Notes'}="textarea\t$data->{'notes'}\t15";
  62. $inputs{'Serial'}="text\t$data->{'serial'}\t16";
  63. #$inputs{'Volume'}="text\t$data->{'volumeddesc'}\t17";
  64. $inputs{'Analytic author'}="text\t\t18";
  65. $inputs{'Analytic title'}="text\t\t19";
  66. $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
  67. $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
  68. print mkform3('updatebiblio.pl',%inputs);
  69. #print mktablehdr();
  70. #print mktableft();
  71. print endmenu();
  72. print endpage();
  73. sub tidyhtml {
  74. my ($inp)=@_;
  75. $inp=~ s/\"/\&quot\;/g;
  76. return($inp);
  77. }