[Koha-devel] CVS: koha detail.pl,1.4,1.5 modbib.pl,1.1.1.1,1.2 updatebiblio.pl,1.1.1.1,1.2

Gynn Lomax truth_nz at users.sourceforge.net
Wed May 8 20:02:03 CEST 2002


Update of /cvsroot/koha/koha
In directory usw-pr-cvs1:/tmp/cvs-serv16527

Modified Files:
	detail.pl modbib.pl updatebiblio.pl 
Log Message:
Update to catalogue to allow change of biblio abstracts.
Related modifications to acqui system to match changes in Acquisition.pm
detail.pm changed to show abstract - still working on how to show url's


Index: detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/detail.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** detail.pl	3 May 2002 02:47:33 -0000	1.4
--- detail.pl	9 May 2002 03:01:40 -0000	1.5
***************
*** 14,31 ****
  my $title = $input->param('title');
  my @items = &ItemInfo(undef, $bib, $type);
  my $dat   = &bibdata($bib);
  my $count = @items;
! my ($count3, $addauthor) = &addauthor($bib);
  my $additional = $addauthor->[0]->{'author'};
- my @temp       = split('\t', $items[0]);
  my $main;
  my $secondary;
  
! if ($type eq ''){
      $type = 'opac';
  } # if
  
  # setup colours
! if ($type eq 'opac'){
      $main      = '#99cccc';
      $secondary = '#efe5ef';
--- 14,33 ----
  my $title = $input->param('title');
  my @items = &ItemInfo(undef, $bib, $type);
+ my @temp  = split('\t', $items[0]);
  my $dat   = &bibdata($bib);
  my $count = @items;
! my ($authorcount, $addauthor) = &addauthor($bib);
  my $additional = $addauthor->[0]->{'author'};
  my $main;
  my $secondary;
+ my $colour;
  
! 
! if ($type eq '') {
      $type = 'opac';
  } # if
  
  # setup colours
! if ($type eq 'opac') {
      $main      = '#99cccc';
      $secondary = '#efe5ef';
***************
*** 34,37 ****
--- 36,44 ----
      $secondary = '#ffffcc';
  } # else
+ $colour = $secondary;
+ 
+ for (my $i = 1; $i < $authorcount; $i++) {
+     $additional .= "|" . $addauthor->[$i]->{'author'};
+ } # for
  
  print $input->header;
***************
*** 41,52 ****
  if ($type ne 'opac'){
      print << "EOF";
! <a href=request.pl?bib=$bib><img height=42  WIDTH=120 BORDER=0 src=\"/images/requests.gif\" align=right border=0></a>
  EOF
  } # if
  
- for (my $i = 1; $i < $count3; $i++) {
-     $additional .= "|" . $addauthor->[$i]->{'author'};
- } # for
- 
  if ($type eq 'catmain'){
    print mkheadr(3,"Catalogue Maintenance");
--- 48,55 ----
  if ($type ne 'opac'){
      print << "EOF";
! <a href=request.pl?bib=$bib><img height=42  WIDTH=120 BORDER="0" src=\"/images/requests.gif\" align="right" border="0"></a>
  EOF
  } # if
  
  if ($type eq 'catmain'){
    print mkheadr(3,"Catalogue Maintenance");
***************
*** 57,97 ****
  } else {
    print mkheadr(3,"$dat->{'title'} $temp[4]");
! }
! print << "EOF";
! 
! <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width="220">
  
  <!-----------------BIBLIO RECORD TABLE--------->
  
! 
! <form action=/cgi-bin/koha/modbib.pl method=post>
! <input type=hidden name=bibnum value=$bib>
! <TR VALIGN=TOP>
! 
! <td  bgcolor="$main" 
  EOF
  
- if ($type ne 'opac'){
-  print "background=\"/images/background-mem.gif\"";
- }
  print << "EOF";
! ><B>BIBLIO RECORD 
  EOF
  
! if ($type ne 'opac'){
    print "$bib";
  }
- print << "EOF";
- </TD></TR>
  
  
! <tr VALIGN=TOP  >
! <TD>
  EOF
  
- if ($type ne 'opac'){
-   print "<INPUT TYPE=\"image\" name=\"submit\"  VALUE=\"modify\" height=42  WIDTH=93 BORDER=0 src=\"/images/modify-mem.gif\"> 
-   <INPUT TYPE=\"image\" name=\"delete\"  VALUE=\"delete\" height=42  WIDTH=93 BORDER=0 src=\"/images/delete-mem.gif\">";
- }
  print << "EOF";
  <br>
--- 60,106 ----
  } else {
    print mkheadr(3,"$dat->{'title'} $temp[4]");
! } # if
  
+ print << "EOF";
+ <table cellspacing="0" callpadding="5" border="1" align="left" width="220">
  <!-----------------BIBLIO RECORD TABLE--------->
+ <tr valign="top">
+ EOF
  
! if ($type ne 'opac') {
!     print << "EOF";
! <td bgcolor="$main" background="/images/background-mem.gif">
  EOF
+ } else {
+     print << "EOF";
+ <td bgcolor="$main">
+ EOF
+ } # else
  
  print << "EOF";
! <b>BIBLIO RECORD</b>
  EOF
  
! if ($type ne 'opac') {
    print "$bib";
  }
  
+ print << "EOF";
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>
+ EOF
  
! if ($type ne 'opac') {
!   print << "EOF";
! <form action="/cgi-bin/koha/modbib.pl" method="post">
! <input type="hidden" name="bibnum" value="$bib">
! <input type="image" name="submit" value="modify" height="42" width="93" border="0" src="/images/modify-mem.gif"> 
! <input type="image" name="delete" value="delete" height="42" width="93" border="0" src="/images/delete-mem.gif">
! </form>
  EOF
+ } # if
  
  print << "EOF";
  <br>
***************
*** 100,105 ****
  
  
! if ($type ne 'opac'){
! print << "EOF";
  <b>Subtitle:</b> $dat->{'subtitle'}<br>
  <b>Author:</b> $dat->{'author'}<br>
--- 109,114 ----
  
  
! if ($type ne 'opac') {
!     print << "EOF";
  <b>Subtitle:</b> $dat->{'subtitle'}<br>
  <b>Author:</b> $dat->{'author'}<br>
***************
*** 117,247 ****
  EOF
  
! }
! else {
! if ($dat->{'subtitle'} ne ''){
!   print "<b>Subtitle:</b> $dat->{'subtitle'}<br>";
! }
! if ($dat->{'author'} ne ''){
!   print "<b>Author:</b> $dat->{'author'}<br>";
! }
! #Additional Author: <br>
! if ($dat->{'seriestitle'} ne ''){
!   print "<b>Seriestitle:</b> $dat->{'seriestitle'}<br>";
! }
! if ($dat->{'subject'} ne ''){
!   print "<b>Subject:</b> $dat->{'subject'}<br>";
! }
! if ($dat->{'copyrightdate'} ne ''){
!   print "<b>Copyright:</b> $dat->{'copyrightdate'}<br>";
! }
! if ($dat->{'notes'} ne ''){
!   print "<b>Notes:</b> $dat->{'notes'}<br>";
! }
! if ($dat->{'unititle'} ne ''){
!   print "<b>Unititle:</b> $dat->{'unititle'}<br>";
! }
! #Analytical Author: <br>
! #Analytical Title: <br>
! if ($dat->{'serial'} ne '0'){
!  print "<b>Serial:</b> Yes<br>";
! }
! print "<b>Total Number of Items:</b> $count
  <p>
! ";
  
- }
  print << "EOF";
! </form>
! </font></TD>
! </TR>
  
! </TABLE>
! <img src="/images/holder.gif" width=16 height=300 align=left>
  EOF
  
- my $i=0;
  print center();
  print mktablehdr;
- if ($type eq 'opac'){
  
!   print mktablerow(6,$main,'Item Type','Class','Branch','Date Due','Last Seen'); 
  } else {
!   print mktablerow(6,$main,'Itemtype','Class','Location','Date Due','Last Seen','Barcode',"/images/background-mem.gif"); 
! }
! my $colour=1;
! while ($i < $count){
  
-   my @results = split('\t', $items[$i]);
-   if ($type ne 'opac'){
-     $results[1]=mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]&bib=$bib&bi=$results[8]&type=$type",$results[1]);
-   }
-   if ($results[2] eq ''){
-     $results[2]='Available';
-   }
-   if ($type eq 'catmain'){
-     $results[10]=mklink("/cgi-bin/koha/maint/catmaintain.pl?type=fixitemtype&bi=$results[8]&item=$results[6]","Fix Itemtype");
-   }
-   if ($colour == 1){
      if ($type ne 'opac'){
!       if ($type eq 'catmain'){
!         print mktablerow(8,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9],$results[10]);
!       } else {
!         print mktablerow(7,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]);
!       }
      } else {
!       $results[6]=ItemType($results[6]);
!       print mktablerow(6,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]);
!     } 
!     $colour=0;                                                                                
!   } else{                                                                                     
!     if ($type ne 'opac'){
!       if ($type eq 'catmain'){
!         print mktablerow(8,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9],$results[10]);
!       } else {
!         print mktablerow(7,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]);
!       }
      } else {
!       $results[6]=ItemType($results[6]);
!       print mktablerow(6,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]);
!     }
!     $colour=1;                                                                                
!   }
!    $i++;
! }
  
  print mktableft();
  print "<p>";
  print mktablehdr();
! if ($type ne 'opac'){
! print << "EOF";
! <TR VALIGN=TOP>
! <TD  bgcolor="99cc33" background="/images/background-mem.gif" colspan=2><p><b>HELP</b><br>
  <b>Update Biblio for all Items:</b> Click on the <b>Modify</b> button [left] to amend the biblio.  Any changes you make will update the record for <b>all</b> the items listed above. <p>
  <b>Updating the Biblio for only ONE or SOME Items:</b> 
  EOF
  
! if ($type eq 'catmain'){
! print << "EOF";
  If some of the items listed above need a different biblio, 
  you need to click on the wrong item, then shift the group it belongs to, to the correct biblio.
  You will need to know the correct biblio number
! <p>
! 
!    </TR>
  EOF
  
! } else {
! print << "EOF";
  If some of the items listed above need a different biblio, or are on the wrong biblio, you must use the <a href="acquisitions/">acquisitions</a> process to fix this. You will need to "re-order" the items, and delete them from this biblio.
! <p>
! 
!    </TR>
  EOF
  
! }
! }
  print mktableft();
  print endcenter();
! print "<br clear=all>";
  print endmenu($type);
  print endpage();
--- 126,292 ----
  EOF
  
! } else {
!     if ($dat->{'subtitle'} ne ''){
! 	print "<b>Subtitle:</b> $dat->{'subtitle'}<br>";
!     } # if
!     if ($dat->{'author'} ne ''){
! 	print "<b>Author:</b> $dat->{'author'}<br>";
!     } # if
! 
! # Additional Author: <br>
!     if ($dat->{'seriestitle'} ne '') {
! 	print "<b>Seriestitle:</b> $dat->{'seriestitle'}<br>";
!     } # if
!     if ($dat->{'subject'} ne '') {
! 	print "<b>Subject:</b> $dat->{'subject'}<br>";
!     } # if
!     if ($dat->{'copyrightdate'} ne '') {
! 	print "<b>Copyright:</b> $dat->{'copyrightdate'}<br>";
!     } # if
!     if ($dat->{'notes'} ne '') {
! 	print "<b>Notes:</b> $dat->{'notes'}<br>";
!     } # if
!     if ($dat->{'unititle'} ne '') {
! 	print "<b>Unititle:</b> $dat->{'unititle'}<br>";
!     } # if
! 
! # Analytical Author: <br>
! # Analytical Title: <br>
!     if ($dat->{'serial'} ne '0') {
! 	print "<b>Serial:</b> Yes<br>";
!     } # if
! 
!     print << "EOF";
! <b>Total Number of Items:</b> $count
  <p>
! EOF
! 
! } # if
  
  print << "EOF";
! </font></td>
! </tr>
! </table>
  
! <img src="/images/holder.gif" width="16" height="300" align="left">
  EOF
  
  print center();
  print mktablehdr;
  
! if ($type eq 'opac') {
!     print mktablerow(6,$main,'Item Type','Class','Branch','Date Due','Last Seen');
!     if ($dat->{'url'} ne '') {
! 	$dat->{'url'} =~ s/^http:\/\///;
! 	print mktablerow(6, $colour, 'Website', 'WEB', 'Online', 'Available', "<a href=\"http://$dat->{'url'}\">$dat->{'url'}</a>");
!     } # if
  } else {
!     print mktablerow(7,$main,'Itemtype','Class','Location','Date Due','Last Seen','Barcode',"","/images/background-mem.gif");
!     if ($dat->{'url'} ne '') {
! 	$dat->{'url'} =~ s/^http:\/\///;
! 	print mktablerow(7, $colour, 'WEB', '', 'Online', 'Available', "<a href=\"http://$dat->{'url'}\">$dat->{'url'}</a>");
!     } # if
! } # else
! 
! $colour = 'white';
! for (my $i = 0; $i < $count; $i ++) {
!     
!     my @results = split('\t', $items[$i]);
! 
!     if ($type ne 'opac') {
! 	$results[1] = mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]&bib=$bib&bi=$results[8]&type=$type",$results[1]);
!     } # if
! 
!     if ($results[2] eq '') {
! 	$results[2] = 'Available';
!     } # if
! 
!     if ($type eq 'catmain'){
! 	$results[10] = mklink("/cgi-bin/koha/maint/catmaintain.pl?type=fixitemtype&bi=$results[8]&item=$results[6]","Fix Itemtype");
!     } # if
  
      if ($type ne 'opac'){
! 	if ($type eq 'catmain'){
! 	    print mktablerow(8,$colour,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9],$results[10]);
! 	} else {
! 	    print mktablerow(7,$colour,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]);
! 	} # else
      } else {
! 	$results[6] = ItemType($results[6]);
! 	print mktablerow(6,$colour,$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]);
!     } # else
!     
!     if ($colour eq $secondary) {
! 	$colour = 'white';
      } else {
! 	$colour = $secondary;
!     } # else
! 
! } # for
  
  print mktableft();
  print "<p>";
  print mktablehdr();
! 
! if ($type ne 'opac') {
!     print << "EOF";
! <tr valign="top">
! <td bgcolor="99cc33" background="/images/background-mem.gif" colspan="2"><p><b>HELP</b><br>
  <b>Update Biblio for all Items:</b> Click on the <b>Modify</b> button [left] to amend the biblio.  Any changes you make will update the record for <b>all</b> the items listed above. <p>
  <b>Updating the Biblio for only ONE or SOME Items:</b> 
  EOF
  
!     if ($type eq 'catmain') {
! 	print << "EOF";
  If some of the items listed above need a different biblio, 
  you need to click on the wrong item, then shift the group it belongs to, to the correct biblio.
  You will need to know the correct biblio number
! <p />
! </tr>
  EOF
  
!     } else {
! 	print << "EOF";
  If some of the items listed above need a different biblio, or are on the wrong biblio, you must use the <a href="acquisitions/">acquisitions</a> process to fix this. You will need to "re-order" the items, and delete them from this biblio.
! <p />
! </tr>
  EOF
  
!     } # else
! } # if
! 
  print mktableft();
  print endcenter();
! print << "EOF";
! <br clear=all>
! <p />
! EOF
! 
! if ($type ne 'opac') {
!     print << "EOF";
! <table border="1" cellspacing="0" cellpadding="5" width="90%">
! <tr valign="top">
! <td bgcolor="$main" background="/images/background-mem.gif"><b>Abstract</b></td>
! </tr>
! <tr valign="top">
! <td>$dat->{'abstract'}</td>
! </tr>
! </table>
! EOF
! } else {
!     if ($dat->{'abstract'} ne '') {
! 	print << "EOF";
! <table border="1" cellspacing="0" cellpadding="5" width="90%">
! <tr valign="top">
! <td bgcolor="$main"><b>Abstract</b></td>
! </tr>
! <tr valign="top">
! <td>$dat->{'abstract'}</td>
! </tr>
! </table>
! EOF
!     } # if
! } # else
! 
  print endmenu($type);
  print endpage();

Index: modbib.pl
===================================================================
RCS file: /cvsroot/koha/koha/modbib.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** modbib.pl	19 Dec 2000 23:45:52 -0000	1.1.1.1
--- modbib.pl	9 May 2002 03:01:40 -0000	1.2
***************
*** 13,84 ****
  my $input = new CGI;
  
! my $bibnum=$input->param('bibnum');
! my $data=bibdata($bibnum);
! my ($count,$subject)=subject($data->{'biblionumber'});
! my ($count2,$subtitle)=subtitle($data->{'biblionumber'});
! my ($count3,$addauthor)=addauthor($data->{'biblionumber'});
! my $submit=$input->param('submit.x');                                                                                              
! if ($submit eq ''){                                                                                                                
!   print $input->redirect("/cgi-bin/koha/delbiblio.pl?biblio=$bibnum");                                     
! }  
  
  print $input->header;
! #my ($analytictitle)=analytic($biblionumber,'t');
! #my ($analyticauthor)=analytic($biblionumber,'a');
  print startpage();
  print startmenu();
- my %inputs;
  
! #have to get all subtitles, subjects and additional authors
! my $sub=$subject->[0]->{'subject'};
! for (my $i=1;$i<$count;$i++){
!   $sub=$sub."|".$subject->[$i]->{'subject'};
! }
! my $additional=$addauthor->[0]->{'author'};
! for (my $i=1;$i<$count3;$i++){
!   $additional=$additional."|".$addauthor->[$i]->{'author'};
! }
! 
! 
! #hash is set up with input name being the key then
! #the value is a tab separated list, the first item being the input type
! $inputs{'Author'}="text\t$data->{'author'}\t0";
! $data->{'title'}=tidyhtml($data->{'title'});
! $inputs{'Title'}="text\t$data->{'title'}\t1";
! my $dewey = $data->{'dewey'};                                                      
! $dewey =~ s/0+$//;                                                                 
! if ($dewey eq "000.") { $dewey = "";};                                             
! if ($dewey < 10){$dewey='00'.$dewey;}                                              
! if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}                               
! if ($dewey <= 0){                                                                  
!   $dewey='';                                                                       
! } 
! $dewey=~ s/\.$//;
! #$inputs{'Class'}="text\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
! #$inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
! $inputs{'Subject'}="textarea\t$sub\t4";
! #$inputs{'Publisher'}="text\t$data->{'publishercode'}\t5";
! $inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
! #$inputs{'ISBN'}="text\t$data->{'isbn'}\t7";
! #$inputs{'Publication Year'}="text\t$data->{'publicationyear'}\t8";
! #$inputs{'Pages'}="text\t$data->{'pages'}\t9";
! #$inputs{'Illustrations'}="text\t$data->{'illustration'}\t10";
! $inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
! $inputs{'Additional Author'}="text\t$additional\t12";
! $inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
! $inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
! $inputs{'Notes'}="textarea\t$data->{'notes'}\t15";
! $inputs{'Serial'}="text\t$data->{'serial'}\t16";
! #$inputs{'Volume'}="text\t$data->{'volumeddesc'}\t17";
! $inputs{'Analytic author'}="text\t\t18";
! $inputs{'Analytic title'}="text\t\t19";
! 
! $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
! $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
! 
! 
! print mkform3('updatebiblio.pl',%inputs);
! #print mktablehdr();
! #print mktableft();
  print endmenu();
  print endpage();
--- 13,128 ----
  my $input = new CGI;
  
! my $submit = $input->param('submit.x');
! my $bibnum = $input->param('bibnum');
! my $data   = &bibdata($bibnum);
! my ($subjectcount, $subject)     = &subject($data->{'biblionumber'});
! my ($subtitlecount, $subtitle)   = &subtitle($data->{'biblionumber'});
! my ($addauthorcount, $addauthor) = &addauthor($data->{'biblionumber'});
! my $sub        = $subject->[0]->{'subject'};
! my $additional = $addauthor->[0]->{'author'};
! my %inputs;
! my $dewey;
! 
! if ($submit eq '') {
!   print $input->redirect("/cgi-bin/koha/delbiblio.pl?biblio=$bibnum");
! } # if
  
  print $input->header;
! # my ($analytictitle)  = &analytic($biblionumber,'t');
! # my ($analyticauthor) = &analytic($biblionumber,'a');
  print startpage();
  print startmenu();
  
! # have to get all subtitles, subjects and additional authors
! for (my $i = 1; $i < $subjectcount; $i++) {
!   $sub = $sub . "|" . $subject->[$i]->{'subject'};
! } # for
! 
! for (my $i = 1; $i < $addauthorcount; $i++) {
!   $additional = $additional . "|" . $addauthor->[$i]->{'author'};
! } # for
! 
! 
! $dewey = $data->{'dewey'};
! $dewey =~ s/0+$//;
! if ($dewey eq "000.") {
!     $dewey = "";
! } # if
! if ($dewey < 10) {
!     $dewey = '00' . $dewey;
! } # if
! if ($dewey < 100 && $dewey > 10) {
!     $dewey = '0' . $dewey;
! } # if
! if ($dewey <= 0){
!   $dewey='';
! } # if
! $dewey = ~ s/\.$//;
! 
! $data->{'title'} = &tidyhtml($data->{'title'});
! 
! print << "EOF";
! <form action="updatebiblio.pl" method="post">
! <input type="hidden" name="biblionumber" value="$data->{'biblionumber'}">
! <input type="hidden" name="biblioitemnumber" value="$data=>{'biblioitemnumber'}">
! <table border="0" cellspacing="0" cellpadding="5">
! <tr valign="top">
! <td>Author</td>
! <td><input type="text" name="author" value="$data->{'author'}"></td>
! </tr>
! <tr valign="top">
! <td>Title</td>
! <td><input type="text" name="title" value="$data->{'title'}"></td>
! </tr>
! <tr valign="top">
! <td>Abstract</td>
! <td><textarea name="abstract" cols="40" rows="4">$data->{'abstract'}</textarea></td>
! </tr>
! <tr valign="top">
! <td>Subject</td>
! <td><textarea name="subject" cols="40" rows="4">$sub</textarea></td>
! </tr>
! <tr valign="top">
! <td>Copyright Date</td>
! <td><input type="text" name="copyrightdate" value="$data->{'copyrightdate'}"></td>
! </tr>
! <tr valign="top">
! <td>Series Title</td>
! <td><input type="text" name="seriestitle" value="$data->{'seriestitle'}"></td>
! </tr>
! <tr valign="top">
! <td>Additional Author</td>
! <td><input type="text" name="additionalauthor" value="$additional"></td>
! </tr>
! <tr valign="top">
! <td>Subtitle</td>
! <td><input type="text" name="subtitle" value="$data->{'subtitle'}"></td>
! </tr>
! <tr valign="top">
! <td>Unititle</td>
! <td><input type="text" name="unititle" value="$data->{'untitle'}"></td>
! </tr>
! <tr valign="top">
! <td>Notes</td>
! <td><textarea name="notes" cols="40" rows="4">$data->{'notes'}</textarea></td>
! </tr>
! <tr valign="top">
! <td>Serial</td>
! <td><input type="text" name="serial" value="$data->{'serial'}"></td>
! </tr>
! <tr valign="top">
! <td>Analytic Author</td>
! <td><input type="text" name="analyticauthor"></td>
! </tr>
! <tr valign="top">
! <td>Analytic Title</td>
! <td><input type="text" name="analytictitle"></td>
! </tr>
! </table>
! <br>
! <input type="submit" name="submit" value="Save Changes">
! </form>
! EOF
! 
  print endmenu();
  print endpage();

Index: updatebiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/updatebiblio.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** updatebiblio.pl	19 Dec 2000 23:45:53 -0000	1.1.1.1
--- updatebiblio.pl	9 May 2002 03:01:40 -0000	1.2
***************
*** 7,75 ****
  use C4::Output;
  
! my $input= new CGI;
! #print $input->header;
! #print $input->dump;
! 
! 
! my $title=checkinp($input->param('Title'));
! my $author=checkinp($input->param('Author'));
! my $bibnum=checkinp($input->param('bibnum'));
! my $copyright=checkinp($input->param('Copyright'));
! my $seriestitle=checkinp($input->param('Series'));
! my $serial=checkinp($input->param('Serial'));
! my $unititle=checkinp($input->param('Unititle'));
! my $notes=checkinp($input->param('Notes'));
! 
! modbiblio($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes);
! 
! my $subtitle=checkinp($input->param('Subtitle'));
! modsubtitle($bibnum,$subtitle);
! 
! my $subject=checkinp($input->param('Subject'));
! $subject=uc $subject;
! my @sub=split(/\|/,$subject);
! #print @sub;
! #
! 
! my $addauthor=checkinp($input->param('Additional'));
! modaddauthor($bibnum,$addauthor);
! my $count1=@sub;
! 
! for (my $i=0; $i<$count1; $i++){
!   $sub[$i]=~ s/ +$//;
! }
! 
! #print $input->header;
! my $force=$input->param('Force');
! my $error=modsubject($bibnum,$force, at sub);
  
  if ($error ne ''){
!   print $input->header;
!   print startpage();
!   print startmenu();
!   print $error;
!   my @subs=split('\n',$error);
!   print "<p> Click submit to force the subject";
!   my @names=$input->param;
!   my %data;
!   my $count=@names;
!   for (my $i=0;$i<$count;$i++){
!     if ($names[$i] ne 'Force'){
!       my $value=$input->param("$names[$i]");
!       $data{$names[$i]}="hidden\t$value\t$i";
!     }
!   }
!   $data{"Force"}="hidden\t$subs[0]\t$count";
!   print mkform3('updatebiblio.pl',%data);
!   print endmenu();
!   print endpage();
  } else {
!   print $input->redirect("detail.pl?type=intra&bib=$bibnum");
! }
  
  sub checkinp{
    my ($inp)=@_;
!   $inp=~ s/\'/\\\'/g;
!   $inp=~ s/\"/\\\"/g;
    return($inp);
  }
--- 7,75 ----
  use C4::Output;
  
! my $input       = new CGI;
! my $bibnum      = checkinp($input->param('biblionumber'));
! my $biblio = {
!     biblionumber => $bibnum,
!     title        => $input->param('title')?$input->param('title'):"",
!     author       => $input->param('author')?$input->param('author'):"",
!     abstract     => $input->param('abstract')?$input->param('abstract'):"",
!     copyright    => $input->param('copyrightdate')?$input->param('copyrightdate'):"",
!     seriestitle  => $input->param('seriestitle')?$input->param('seriestitle'):"",
!     serial       => $input->param('serial')?$input->param('serial'):"",
!     unititle     => $input->param('unititle')?$input->param('unititle'):"",
!     notes        => $input->param('notes')?$input->param('notes'):"",
! }; # my $biblio
! my $subtitle    = checkinp($input->param('subtitle'));
! my $subject     = checkinp($input->param('subject'));
! my $addauthor   = checkinp($input->param('additionalauthor'));
! my $force       = $input->param('Force');
! my %data;
! my @sub;
! my @subs;
! my @names;
! my $count;
! my $error;
! 
! &modbiblio($biblio);
! &modsubtitle($bibnum, $subtitle);
! &modaddauthor($bibnum, $addauthor);
! 
! $subject = uc($subject);
! @sub     = split(/\|/, $subject);
! $count   = @sub;
! 
! for (my $i = 0; $i < $count; $i++) {
!     $sub[$i] =~ s/ +$//;
! } # for
! 
! $error = &modsubject($bibnum,$force, at sub);
  
  if ($error ne ''){
!     print $input->header;
!     print startpage();
!     print startmenu();
!     print $error;
!     @subs = split('\n',$error);
!     print "<p> Click submit to force the subject";
!     @names = $input->param;
!     $count = @names;
!     for (my $i = 0; $i < $count; $i++) {
! 	if ($names[$i] ne 'Force') {
! 	    my $value = $input->param("$names[$i]");
! 	    $data{$names[$i]} = "hidden\t$value\t$i";
! 	} # if
!     } # for
!     $data{"Force"} = "hidden\t$subs[0]\t$count";
!     print mkform3('updatebiblio.pl', %data);
!     print endmenu();
!     print endpage();
  } else {
!     print $input->redirect("detail.pl?type=intra&bib=$bibnum");
! } # else
  
  sub checkinp{
    my ($inp)=@_;
!   $inp =~ s/\'/\\\'/g;
!   $inp =~ s/\"/\\\"/g;
    return($inp);
  }





More information about the Koha-devel mailing list