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
This commit is contained in:
parent
3e3b57dedf
commit
cec2db30ea
5 changed files with 367 additions and 279 deletions
|
@ -7,13 +7,8 @@ use strict;
|
|||
use CGI;
|
||||
use C4::Output;
|
||||
use C4::Acquisitions;
|
||||
#use Date::Manip;
|
||||
|
||||
my $input = new CGI;
|
||||
#print $input->header;
|
||||
#print startpage();
|
||||
#print startmenu('acquisitions');
|
||||
#print $input->dump;
|
||||
my $existing=$input->param('existing');
|
||||
my $title=$input->param('title');
|
||||
$title=~ s/\'/\\\'/g;
|
||||
|
@ -39,7 +34,6 @@ my $bibitemnum;
|
|||
my $rrp=$input->param('rrp');
|
||||
my $ecost=$input->param('ecost');
|
||||
my $gst=$input->param('GST');
|
||||
#check to see if orderexists
|
||||
my $orderexists=$input->param('orderexists');
|
||||
|
||||
#check to see if biblio exists
|
||||
|
@ -47,14 +41,18 @@ if ($quantity ne '0'){
|
|||
|
||||
if ($existing eq 'no'){
|
||||
#if it doesnt create it
|
||||
$bibnum = &newbiblio({ title => $title,
|
||||
author =>$author,
|
||||
copyright => $copyright });
|
||||
$bibnum = &newbiblio({ title => $title?$title:"",
|
||||
author => $author?$author:"",
|
||||
copyright => $copyright?$copyright:"" });
|
||||
$bibitemnum = &newbiblioitem({ biblionumber => $bibnum,
|
||||
itemtype => $itemtype,
|
||||
isben => $isbn });
|
||||
itemtype => $itemtype?$itemtype:"",
|
||||
isben => $isbn?$isbn:"" });
|
||||
newsubtitle($bibnum);
|
||||
modbiblio($bibnum,$title,$author,$copyright,$series);
|
||||
modbiblio({ biblionumber => $bibnum,
|
||||
title => $title?$title:"",
|
||||
author => $author?$author:"",
|
||||
copyrightdate => $copyright?$copyright:"",
|
||||
series => $series?$series:"" });
|
||||
} else {
|
||||
$bibnum=$input->param('biblio');
|
||||
$bibitemnum=$input->param('bibitemnum');
|
||||
|
@ -62,21 +60,20 @@ if ($quantity ne '0'){
|
|||
if ($bibitemnum eq '' || $itemtype ne $oldtype){
|
||||
$bibitemnum=newbiblioitem($bibnum,$itemtype,$isbn);
|
||||
}
|
||||
modbiblio($bibnum,$title,$author,$copyright,$series);
|
||||
modbiblio({ biblionumber => $bibnum,
|
||||
title => $title?$title:"",
|
||||
author => $author?$author:"",
|
||||
copyrightdate => $copyright?$copyright:"",
|
||||
series => $series?$series:"" });
|
||||
}
|
||||
if ($orderexists ne ''){
|
||||
if ($orderexists ne '') {
|
||||
modorder($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst);
|
||||
}else {
|
||||
neworder($bibnum,$title,$ordnum,$basketno,$quantity,$listprice,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst);
|
||||
}
|
||||
} else {
|
||||
#print $input->header;
|
||||
#print "del";
|
||||
$bibnum=$input->param('biblio');
|
||||
delorder($bibnum,$ordnum);
|
||||
}
|
||||
|
||||
print $input->redirect("newbasket.pl?id=$supplier&basket=$basketno");
|
||||
#print $input->dump;
|
||||
#print endmenu('acquisitions');
|
||||
#print endpage();
|
||||
|
|
|
@ -13,14 +13,13 @@ my $input=new CGI;
|
|||
|
||||
my $user=$input->remote_user;
|
||||
#print $input->dump;
|
||||
my $biblio=$input->param('biblio');
|
||||
my $biblionumber = $input->param('biblio');
|
||||
my $ordnum=$input->param('ordnum');
|
||||
my $quantrec=$input->param('quantityrec');
|
||||
my $quantity=$input->param('quantity');
|
||||
my $notes=$input->param('notes');
|
||||
my $cost=$input->param('cost');
|
||||
my $invoiceno=$input->param('invoice');
|
||||
my $id=$input->param('id');
|
||||
my $bibitemno=$input->param('biblioitemnum');
|
||||
my $data=bibitemdata($bibitemno);
|
||||
my $publisher=$data->{'publishercode'};
|
||||
|
@ -37,12 +36,15 @@ my $branch=$input->param('branch');
|
|||
my $bookfund=$input->param('bookfund');
|
||||
my $itemtype=$input->param('format');
|
||||
my $isbn=$input->param('ISBN');
|
||||
my $series=$input->param('Series');
|
||||
my $bookseller=$input->param('bookseller');
|
||||
$id=$bookseller;
|
||||
my $title=$input->param('title');
|
||||
my $author=$input->param('author');
|
||||
my $copyright=$input->param('copyright');
|
||||
my $bookseller = $input->param('bookseller');
|
||||
my $id = $bookseller;
|
||||
my $biblio = {
|
||||
biblionumber => $biblionumber,
|
||||
title => $input->param('title')?$input->param('title'):"",
|
||||
author => $input->param('author')?$input->param('author'):"",
|
||||
copyrightdate => $input->param('copyright')?$input->param('copyright'):"",
|
||||
series => $input->param('Series')?$input->param('Series'):""
|
||||
}; # my $biblio
|
||||
|
||||
if ($quantrec != 0){
|
||||
$cost=$cost / $quantrec;
|
||||
|
@ -59,12 +61,12 @@ if ($itemtype =~ /REF/){
|
|||
if ($itemtype =~ /PER/){
|
||||
# print "$bibitemno";
|
||||
$class="Periodical";
|
||||
$bibitemno=newbiblioitem($biblio,$itemtype,$isbn,$volinf,$class);
|
||||
$bibitemno=newbiblioitem($biblionumber,$itemtype,$isbn,$volinf,$class);
|
||||
# print "here $bibitemno";
|
||||
}
|
||||
if ($quantity != 0){
|
||||
receiveorder($biblio,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund);
|
||||
modbiblio($biblio,$title,$author,$copyright,$series);
|
||||
receiveorder($biblionumber,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund);
|
||||
modbiblio($biblio);
|
||||
modbibitem($bibitemno,$itemtype,$isbn,$publisher,$pubdate,$class,$dewey,$subclass,$illus,$pages,$volinf,$notes,$size);
|
||||
#print $notes;
|
||||
my $barcode=$input->param('barcode');
|
||||
|
@ -80,7 +82,7 @@ if ($quantity != 0){
|
|||
# print $barcode;
|
||||
}
|
||||
my ($error) = newitems({ biblioitemnumber => $bibitemno,
|
||||
biblionumber => $biblio,
|
||||
biblionumber => $biblionumber,
|
||||
replacementprice => $replacement,
|
||||
price => $cost,
|
||||
booksellerid => $bookseller,
|
||||
|
@ -99,6 +101,6 @@ if ($quantity != 0){
|
|||
}
|
||||
} else {
|
||||
print $input->header;
|
||||
delorder($biblio,$ordnum);
|
||||
delorder($biblionumber,$ordnum);
|
||||
print $input->redirect("/acquisitions/");
|
||||
}
|
||||
|
|
287
detail.pl
287
detail.pl
|
@ -13,26 +13,33 @@ my $type = $input->param('type');
|
|||
my $bib = $input->param('bib');
|
||||
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 ($count3, $addauthor) = &addauthor($bib);
|
||||
my ($authorcount, $addauthor) = &addauthor($bib);
|
||||
my $additional = $addauthor->[0]->{'author'};
|
||||
my @temp = split('\t', $items[0]);
|
||||
my $main;
|
||||
my $secondary;
|
||||
my $colour;
|
||||
|
||||
if ($type eq ''){
|
||||
|
||||
if ($type eq '') {
|
||||
$type = 'opac';
|
||||
} # if
|
||||
|
||||
# setup colours
|
||||
if ($type eq 'opac'){
|
||||
if ($type eq 'opac') {
|
||||
$main = '#99cccc';
|
||||
$secondary = '#efe5ef';
|
||||
} else {
|
||||
$main = '#cccc99';
|
||||
$secondary = '#ffffcc';
|
||||
} # else
|
||||
$colour = $secondary;
|
||||
|
||||
for (my $i = 1; $i < $authorcount; $i++) {
|
||||
$additional .= "|" . $addauthor->[$i]->{'author'};
|
||||
} # for
|
||||
|
||||
print $input->header;
|
||||
print startpage();
|
||||
|
@ -40,14 +47,10 @@ print startmenu($type);
|
|||
|
||||
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>
|
||||
<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");
|
||||
} # if
|
||||
|
@ -56,51 +59,57 @@ if ($dat->{'author'} ne ''){
|
|||
print mkheadr(3,"$dat->{'title'} ($dat->{'author'}) $temp[4]");
|
||||
} else {
|
||||
print mkheadr(3,"$dat->{'title'} $temp[4]");
|
||||
}
|
||||
} # if
|
||||
|
||||
print << "EOF";
|
||||
|
||||
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width="220">
|
||||
|
||||
<table cellspacing="0" callpadding="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"
|
||||
<tr valign="top">
|
||||
EOF
|
||||
|
||||
if ($type ne 'opac'){
|
||||
print "background=\"/images/background-mem.gif\"";
|
||||
}
|
||||
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>BIBLIO RECORD</b>
|
||||
EOF
|
||||
|
||||
if ($type ne 'opac'){
|
||||
if ($type ne 'opac') {
|
||||
print "$bib";
|
||||
}
|
||||
|
||||
print << "EOF";
|
||||
</TD></TR>
|
||||
|
||||
|
||||
<tr VALIGN=TOP >
|
||||
<TD>
|
||||
</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\">";
|
||||
}
|
||||
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>
|
||||
<FONT SIZE=2 face="arial, helvetica">
|
||||
EOF
|
||||
|
||||
|
||||
if ($type ne 'opac'){
|
||||
print << "EOF";
|
||||
if ($type ne 'opac') {
|
||||
print << "EOF";
|
||||
<b>Subtitle:</b> $dat->{'subtitle'}<br>
|
||||
<b>Author:</b> $dat->{'author'}<br>
|
||||
<b>Additional Author:</b> $additional<br>
|
||||
|
@ -116,132 +125,168 @@ print << "EOF";
|
|||
<p>
|
||||
EOF
|
||||
|
||||
}
|
||||
else {
|
||||
if ($dat->{'subtitle'} ne ''){
|
||||
} else {
|
||||
if ($dat->{'subtitle'} ne ''){
|
||||
print "<b>Subtitle:</b> $dat->{'subtitle'}<br>";
|
||||
}
|
||||
if ($dat->{'author'} ne ''){
|
||||
} # if
|
||||
if ($dat->{'author'} ne ''){
|
||||
print "<b>Author:</b> $dat->{'author'}<br>";
|
||||
}
|
||||
#Additional Author: <br>
|
||||
if ($dat->{'seriestitle'} ne ''){
|
||||
} # if
|
||||
|
||||
# Additional Author: <br>
|
||||
if ($dat->{'seriestitle'} ne '') {
|
||||
print "<b>Seriestitle:</b> $dat->{'seriestitle'}<br>";
|
||||
}
|
||||
if ($dat->{'subject'} ne ''){
|
||||
} # if
|
||||
if ($dat->{'subject'} ne '') {
|
||||
print "<b>Subject:</b> $dat->{'subject'}<br>";
|
||||
}
|
||||
if ($dat->{'copyrightdate'} ne ''){
|
||||
} # if
|
||||
if ($dat->{'copyrightdate'} ne '') {
|
||||
print "<b>Copyright:</b> $dat->{'copyrightdate'}<br>";
|
||||
}
|
||||
if ($dat->{'notes'} ne ''){
|
||||
} # if
|
||||
if ($dat->{'notes'} ne '') {
|
||||
print "<b>Notes:</b> $dat->{'notes'}<br>";
|
||||
}
|
||||
if ($dat->{'unititle'} ne ''){
|
||||
} # if
|
||||
if ($dat->{'unititle'} ne '') {
|
||||
print "<b>Unititle:</b> $dat->{'unititle'}<br>";
|
||||
}
|
||||
#Analytical Author: <br>
|
||||
#Analytical Title: <br>
|
||||
if ($dat->{'serial'} ne '0'){
|
||||
} # if
|
||||
|
||||
# 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
|
||||
} # if
|
||||
|
||||
print << "EOF";
|
||||
<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;
|
||||
} # 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'){
|
||||
|
||||
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(6,$main,'Itemtype','Class','Location','Date Due','Last Seen','Barcode',"/images/background-mem.gif");
|
||||
}
|
||||
my $colour=1;
|
||||
while ($i < $count){
|
||||
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 ($results[2] eq ''){
|
||||
$results[2]='Available';
|
||||
}
|
||||
|
||||
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 ($colour == 1){
|
||||
$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,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9],$results[10]);
|
||||
print mktablerow(8,$colour,$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]);
|
||||
}
|
||||
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,$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]);
|
||||
$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 {
|
||||
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++;
|
||||
}
|
||||
$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>
|
||||
|
||||
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 ($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>
|
||||
<p />
|
||||
</tr>
|
||||
EOF
|
||||
|
||||
} else {
|
||||
print << "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>
|
||||
<p />
|
||||
</tr>
|
||||
EOF
|
||||
|
||||
}
|
||||
}
|
||||
} # else
|
||||
} # if
|
||||
|
||||
print mktableft();
|
||||
print endcenter();
|
||||
print "<br clear=all>";
|
||||
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();
|
||||
|
|
152
modbib.pl
152
modbib.pl
|
@ -12,74 +12,118 @@ use C4::Output;
|
|||
|
||||
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 ''){
|
||||
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');
|
||||
# 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'};
|
||||
}
|
||||
# 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
|
||||
|
||||
|
||||
#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 = $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 eq "000.") {
|
||||
$dewey = "";
|
||||
} # if
|
||||
if ($dewey < 10) {
|
||||
$dewey = '00' . $dewey;
|
||||
} # if
|
||||
if ($dewey < 100 && $dewey > 10) {
|
||||
$dewey = '0' . $dewey;
|
||||
} # if
|
||||
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";
|
||||
} # if
|
||||
$dewey = ~ s/\.$//;
|
||||
|
||||
$inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
|
||||
$inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
|
||||
$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 mkform3('updatebiblio.pl',%inputs);
|
||||
#print mktablehdr();
|
||||
#print mktableft();
|
||||
print endmenu();
|
||||
print endpage();
|
||||
|
||||
|
|
|
@ -6,70 +6,70 @@ use strict;
|
|||
use C4::Acquisitions;
|
||||
use C4::Output;
|
||||
|
||||
my $input= new CGI;
|
||||
#print $input->header;
|
||||
#print $input->dump;
|
||||
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);
|
||||
|
||||
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'));
|
||||
$subject = uc($subject);
|
||||
@sub = split(/\|/, $subject);
|
||||
$count = @sub;
|
||||
|
||||
modbiblio($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes);
|
||||
for (my $i = 0; $i < $count; $i++) {
|
||||
$sub[$i] =~ s/ +$//;
|
||||
} # for
|
||||
|
||||
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,@sub);
|
||||
$error = &modsubject($bibnum,$force,@sub);
|
||||
|
||||
if ($error ne ''){
|
||||
print $input->header;
|
||||
print startpage();
|
||||
print startmenu();
|
||||
print $error;
|
||||
my @subs=split('\n',$error);
|
||||
@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);
|
||||
@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;
|
||||
$inp =~ s/\'/\\\'/g;
|
||||
$inp =~ s/\"/\\\"/g;
|
||||
return($inp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue