Browse Source

tons of changesd to cataloging

master
chris 22 years ago
parent
commit
efd4d635dc
  1. 62
      C4/Acquisitions.pm
  2. 2
      C4/Circulation/Borrower.pm
  3. 25
      C4/Search.pm
  4. 28
      detail.pl
  5. 20
      modbib.pl
  6. 179
      modbibitem.pl
  7. 76
      moditem.pl
  8. 6
      moredetail.pl
  9. 70
      updatebibitem.pl
  10. 33
      updatebiblio.pl
  11. 83
      updateitem.pl

62
C4/Acquisitions.pm

@ -14,7 +14,8 @@ $VERSION = 0.01;
&ordersearch &newbiblio &newbiblioitem &newsubject &newsubtitle &neworder
&newordernum &modbiblio &modorder &getsingleorder &invoice &receiveorder
&bookfundbreakdown &curconvert &updatesup &insertsup &makeitems &modbibitem
&getcurrencies &modsubtitle &modsubject &modaddauthor &moditem);
&getcurrencies &modsubtitle &modsubject &modaddauthor &moditem &countitems
&findall &needsmod);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@ -611,14 +612,67 @@ sub makeitems {
}
sub moditem {
my ($itemnum,$bibitemnum)=@_;
my ($itemnum,$bibitemnum,$barcode,$notes)=@_;
my $dbh=C4Connect;
my $query="update items set biblioitemnumber=$bibitemnum where
itemnumber=$itemnum";
my $query="update items set biblioitemnumber=$bibitemnum,
barcode='$barcode',itemnotes='$notes'
where itemnumber=$itemnum";
if ($barcode eq ''){
$query="update items set biblioitemnumber=$bibitemnum where itemnumber=$itemnum";
}
my $sth=$dbh->prepare($query);
$sth->execute;
$sth->finish;
$dbh->disconnect;
}
sub countitems{
my ($bibitemnum)=@_;
my $dbh=C4Connect;
my $query="Select count(*) from items where biblioitemnumber='$bibitemnum'";
my $sth=$dbh->prepare($query);
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
$dbh->disconnect;
return($data->{'count(*)'});
}
sub findall {
my ($biblionumber)=@_;
my $dbh=C4Connect;
my $query="Select * from biblioitems,items,itemtypes where
biblioitems.biblionumber=$biblionumber
and biblioitems.biblioitemnumber=items.biblioitemnumber and
itemtypes.itemtype=biblioitems.itemtype
order by items.biblioitemnumber";
my $sth=$dbh->prepare($query);
$sth->execute;
my @results;
my $i;
while (my $data=$sth->fetchrow_hashref){
$results[$i]=$data;
$i++;
}
$sth->finish;
$dbh->disconnect;
return(@results);
}
sub needsmod{
my ($bibitemnum,$itemtype)=@_;
my $dbh=C4Connect;
my $query="Select * from biblioitems where biblioitemnumber=$bibitemnum
and itemtype='$itemtype'";
my $sth=$dbh->prepare($query);
$sth->execute;
my $result=0;
if (my $data=$sth->fetchrow_hashref){
$result=1;
}
$sth->finish;
$dbh->disconnect;
return($result);
}
END { } # module clean-up code here (global destructor)

2
C4/Circulation/Borrower.pm

@ -1,4 +1,4 @@
package C4::Ciecrculation::Borrower; #assumes C4/Circulation/Borrower
package C4::Circulation::Borrower; #assumes C4/Circulation/Borrower
#package to deal with Issues
#written 3/11/99 by chris@katipo.co.nz

25
C4/Search.pm

@ -18,7 +18,7 @@ $VERSION = 0.01;
&itemdata &bibdata &GetItems &borrdata &getacctlist &itemnodata &itemcount
&OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues
&getboracctrecord &ItemType &itemissues &FrontSearch &subject &subtitle
&addauthor);
&addauthor &bibitems);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@ -703,6 +703,7 @@ sub itemissues {
sub itemnodata {
my ($env,$dbh,$itemnumber) = @_;
$dbh=C4Connect;
my $query="Select * from biblio,items,biblioitems
where items.itemnumber = '$itemnumber'
and biblio.biblionumber = items.biblionumber
@ -711,7 +712,8 @@ sub itemnodata {
# print $query;
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
$sth->finish;
$dbh->disconnect;
return($data);
}
@ -950,6 +952,25 @@ sub ItemType {
$dbh->disconnect;
return ($dat->{'description'});
}
sub bibitems {
my ($bibnum)=@_;
my $dbh=C4Connect;
my $query="Select * from biblioitems,itemtypes where
biblionumber='$bibnum' and biblioitems.itemtype=itemtypes.itemtype";
my $sth=$dbh->prepare($query);
$sth->execute;
my $i=0;
my @results;
while (my $data=$sth->fetchrow_hashref){
$results[$i]=$data;
$i++;
}
$sth->finish;
$dbh->disconnect;
return($i,@results);
}
END { } # module clean-up code here (global destructor)

28
detail.pl

@ -54,7 +54,8 @@ print <<printend
<!-----------------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"
@ -131,15 +132,16 @@ print "<b>Total Number of Items:</b> $count
";
}
#if ($type ne 'opac'){
# print "<INPUT TYPE=\"image\" name=\"submit\" VALUE=\"modify\" height=42 WIDTH=93 BORDER=0 src=\"/images/modify-mem.gif\">";
#}
if ($type ne 'opac'){
print "<INPUT TYPE=\"image\" name=\"submit\" VALUE=\"modify\" height=42 WIDTH=93 BORDER=0 src=\"/images/modify-mem.gif\">";
}
print <<printend
</form>
</font></TD>
</TR>
</TABLE>
<img src="/images/holder.gif" width=16 height=250 align=left>
<img src="/images/holder.gif" width=16 height=300 align=left>
printend
;
@ -201,8 +203,22 @@ while ($i < $count){
}
$i++;
}
print endcenter();
print mktableft();
print "<p>";
print mktablehdr();
print <<printend
<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 ammend 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> 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>
printend
;
print mktableft();
print endcenter();
print "<br clear=all>";
print endmenu($type);
print endpage();

20
modbib.pl

@ -12,8 +12,8 @@ use C4::Output;
my $input = new CGI;
print $input->header;
my $bibitemnum=$input->param('bibitem');
my $data=bibitemdata($bibitemnum);
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'});
@ -48,22 +48,22 @@ 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{'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{'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{'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{'Volume'}="text\t$data->{'volumeddesc'}\t17";
$inputs{'Analytic author'}="text\t\t18";
$inputs{'Analytic title'}="text\t\t19";

179
modbibitem.pl

@ -0,0 +1,179 @@
#!/usr/bin/perl
#script to modify/delete groups
#written 8/11/99
# modified 11/11/99 by chris@katipo.co.nz
# modified 18/4/00 by chris@katipo.co.nz
use strict;
use C4::Search;
use CGI;
use C4::Output;
my $input = new CGI;
print $input->header;
my $bibitemnum=$input->param('bibitem');
my $data=bibitemdata($bibitemnum);
#my ($count,$subject)=subject($data->{'biblionumber'});
#my ($count2,$subtitle)=subtitle($data->{'biblionumber'});
#my ($count3,$addauthor)=addauthor($data->{'biblionumber'});
#my ($analytictitle)=analytic($biblionumber,'t');
#my ($analyticauthor)=analytic($biblionumber,'a');
print startpage();
print startmenu();
my %inputs;
#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";
#$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 <<printend
<BLOCKQUOTE><FONT SIZE=6><em>$data->{'title'} ($data->{'author'})<br>
Modify Group - $data->{'description'}</em></FONT><br>
<form action=updatebibitem.pl method=post>
<table border=0 cellspacing=0 cellpadding=5 align=left>
<TR VALIGN=TOP bgcolor="99cc33">
<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>
printend
;
my ($count,@bibitems)=bibitems($data->{'biblionumber'});
print "<tr valign=top><td colspan=3><select name=existinggroup>\n";
for (my $i=0;$i<$count;$i++){
print "<option value=$bibitems[$i]->{'biblioitemnumber'}>$bibitems[$i]->{'description'} - $bibitems[$i]->{'isbn'}\n";
}
print "</select></td></tr>";
print <<printend
<TR VALIGN=TOP bgcolor="99cc33">
<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>
<tr valign=top bgcolor=white><td>Item Type</td><td><input type=text name=Item Type value="$data->{'itemtype'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>Class</td><td><input type=text name=Class value="$data->{'classification'}$dewey$data->{'subclass'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>Publisher</td><td><input type=text name=Publisher value="$data->{'publishercode'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>ISBN</td><td><input type=text name=ISBN value="$data->{'isbn'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>Publication Year</td><td><input type=text name=Publication Year value="$data->{'publicationyear'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>Pages</td><td><input type=text name=Pages value="$data->{'pages'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>Illustrations</td><td><input type=text name=Illustrations value="$data->{'illustration'}" size=20></td></tr>
<tr valign=top bgcolor=white><td>Volume</td>
<td><input type=text name=Volume value="$data->{'volumeddesc'}" size=20></td></tr>
<input type=hidden name=bibnum value="$data->{'biblionumber'}">
<input type=hidden name=bibitemnum value="$data->{'biblioitemnumber'}">
</table>
<img src="/images/holder.gif" width=16 height=300 align=left>
<TABLE cellspacing=0 cellpadding=5 border=0 >
printend
;
print <<printend;
<TR VALIGN=TOP bgcolor="99cc33">
<TD bgcolor="99cc33" background="/images/background-mem.gif" colspan=5 ><b>CHANGES TO AFFECT THESE BARCODES<br>
Tick ALL barcodes that changes are to apply too. Those left un-ticked will keep the original group record.</td></tr>
<tr valign=top bgcolor=99cc33>
<td background="/images/background-mem.gif">&nbsp;</td>
<td background="/images/background-mem.gif">Barcode</td>
<td background="/images/background-mem.gif">Location</td>
<td background="/images/background-mem.gif">Date Due</td>
<td background="/images/background-mem.gif">Last Seen</td></tr>
printend
;
my (@items)=itemissues($data->{'biblioitemnumber'});
#print @items;
my $count=@items;
for (my $i=0;$i<$count;$i++){
my @temp=split('-',$items[$i]->{'datelastseen'});
$items[$i]->{'datelastseen'}="$temp[2]/$temp[1]/$temp[0]";
print <<printend
<tr valign=top gcolor=#ffffcc>
<td><input type=checkbox name="check_group_$items[$i]->{'barcode'}"></td>
<td><a href="/cgi-bin/koha/moredetail.pl?item=$items[$i]->{'itemnumber'}&bib=$data->{'biblionumber'}&bi=$data->{'biblioitemnumber'}">$items[$i]->{'barcode'}</a></td>
<td>$items[$i]->{'holdingbranch'}</td>
<td></td>
<td>$items[$i]->{'datelastseen'}</td>
</tr>
printend
;
}
print <<printend
</table>
<p>
<input type=image name=submit src=/images/save-changes.gif border=0 width=187 height=42>
</form>
<p>
<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
items, tick the appropriate ones and a new group record will be created automatically for them.
<br clear=all>
<p> &nbsp; </p>
printend
;
print endmenu();
print endpage();

76
moditem.pl

@ -9,13 +9,14 @@ use strict;
use C4::Search;
use CGI;
use C4::Output;
use C4::Acquisitions;
my $input = new CGI;
print $input->header;
my $bibitemnum=$input->param('bibitem');
my $data=bibitemdata($bibitemnum);
my $itemnum=$input->param('item');
my $item=itemnodata('blah','',$itemnum);
#my ($analytictitle)=analytic($biblionumber,'t');
#my ($analyticauthor)=analytic($biblionumber,'a');
print startpage();
@ -37,23 +38,23 @@ if ($dewey <= 0){
$dewey='';
}
$dewey=~ s/\.$//;
#$inputs{'Barcode'}="text\t\$item->{'barcode'}\t0";
$inputs{'Class'}="text\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
$inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
$inputs{'Barcode'}="text\t$item->{'barcode'}\t0";
$inputs{'Class'}="hidden\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{'Publisher'}="hidden\t$data->{'publishercode'}\t5";
#$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
$inputs{'ISBN'}="hidden\t$data->{'isbn'}\t7";
$inputs{'Publication Year'}="hidden\t$data->{'publicationyear'}\t8";
$inputs{'Pages'}="hidden\t$data->{'pages'}\t9";
$inputs{'Illustrations'}="hidden\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{'ItemNotes'}="textarea\t$item->{'itemnotes'}\t15";
#$inputs{'Serial'}="text\t$data->{'serial'}\t16";
$inputs{'Volume'}="hidden\t$data->{'volumeddesc'}\t17";
#$inputs{'Analytic author'}="text\t\t18";
#$inputs{'Analytic title'}="text\t\t19";
@ -61,8 +62,51 @@ $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
$inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
$inputs{'itemnumber'}="hidden\t$itemnum\t22";
print mkform3('updatebibitem.pl',%inputs);
#print mktablehdr();
#print mktableft();
print <<printend
<FONT SIZE=6><em>$data->{'title'} ($data->{'author'})</em></FONT><br>
printend
;
my @formats=findall($data->{'biblionumber'});
my $count=@formats;
my $format="<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width=\"220\">
";
my $i=0;
while ($i<$count){
$format.="<TR VALIGN=TOP>
<td bgcolor=\"#cccc99\" background=\"/images/background-mem.gif\">
<B>FORMAT - $formats[$i]->{'description'}</TD></TR>
<tr VALIGN=TOP >
<TD>
<FONT SIZE=2 face=\"arial, helvetica\">
<b>ISBN:</b> $formats[$i]->{'isbn'}<br>
<b>Item type:</b> $formats[$i]->{'itemtype'}<br>
<b>Class:</b> $formats[$i]->{'classification'}
";
my $bibitemnumber=$formats[$i]->{'biblioitemnumber'};
while ($bibitemnumber == $formats[$i]->{'biblioitemnumber'}){
$format.="<hr>
<b>Item:</b> <a href=\"/cgi-bin/koha/moredetail.pl?item=36358&bib=12073&bi=61386\">$formats[$i]->{'barcode'}</a><br>
<b>Location:</b> $formats[$i]->{'holdingbranch'}<br>
<b>Last Seen:</b> $formats[$i]->{'datelastseen'}
</font>";
$bibitemnumber=$formats[$i]->{'biblioitemnumber'};
$i++;
}
# $i++;
$format.="</td></TR>";
}
$format.="</table>";
my $rightside=mkform3('updateitem.pl',%inputs);
print mktablehdr();
print mktablerow(2,'white',$format,$rightside);
print mktableft();
print endmenu();
print endpage();

6
moredetail.pl

@ -53,7 +53,7 @@ print <<printend
<a href=/cgi-bin/koha/request.pl?bib=$bib><img src=/images/requests.gif width=120 height=42 border=0 align=right border=0></a>
<FONT SIZE=6><em>$data->{'title'} ($data->{'author'})</em></FONT><P>
<p>
<form action=/cgi-bin/koha/modbib.pl>
<form action=/cgi-bin/koha/modbibitem.pl>
<input type=hidden name=bibitem value=$bi>
<!-------------------BIBLIO ITEM------------>
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left>
@ -89,7 +89,7 @@ printend
for (my $i=0;$i<$count;$i++){
print <<printend
<img src="/images/holder.gif" width=16 height=250 align=left>
<img src="/images/holder.gif" width=16 height=300 align=left>
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width=220 >
<TR VALIGN=TOP>
<td bgcolor="99cc33" background="/images/background-mem.gif"><B>BARCODE $items[$i]->{'barcode'}</b></TD>
@ -131,8 +131,6 @@ print <<printend
<b>paid by:</b><br>
<b>Notes:</b> $items[$i]->{'itemnotes'}<br>
<b>Renewals:</b> $items[$i]->{'renewals'}<br>
<b>Requests:</b> put in current reserves<br>
waiting: <br>
<b>Accession Date: $items[$i]->{'dateaccessioned'}<br>
<b>Cancelled: $items[$i]->{'withdrawn'}<br>
<b>Total Issues:</b> $items[$i]->{'issues'}<br>

70
updatebibitem.pl

@ -5,26 +5,15 @@ use CGI;
use strict;
use C4::Acquisitions;
use C4::Output;
use C4::Search;
my $input= new CGI;
#print $input->header;
#print $input->dump;
print $input->header;
print $input->dump;
my $title=checkinp($input->param('Title'));
my $author=checkinp($input->param('Author'));
my $bibitemnum=checkinp($input->param('bibitemnum'));
my $bibnum=checkinp($input->param('bibnum'));
my $itemnum=checkinp($input->param('itemnumber'));
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 $bibitemnum=checkinp($input->param('bibitemnum'));
#my $olditemtype
my $itemtype=checkinp($input->param('Item'));
my $isbn=checkinp($input->param('ISBN'));
my $publishercode=checkinp($input->param('Publisher'));
@ -56,12 +45,53 @@ my $illus=checkinp($input->param('Illustrations'));
my $pages=checkinp($input->param('Pages'));
my $volumeddesc=checkinp($input->param('Volume'));
my $bibitemnum=newbiblioitem($bibnum,$itemtype,$volumeddesc,$classification);
modbibitem($bibitemnum,$itemtype,$isbn,$publishercode,$publicationdate,$classification,$dewey,$subclass,$illus,$pages,$volumeddesc);
moditem($itemnum,$bibitemnum);
print $input->redirect("detail.pl?type=intra&bib=$bibnum");
#print $bibitemnum;
my (@items)=itemissues($bibitemnum);
#print @items;
my $count=@items;
print $count;
my @barcodes;
my $existing=$input->param('existing');
if ($existing eq 'yes'){
# print "yes";
my $group=$input->param('existinggroup');
#go thru items assing selected ones to group
for (my $i=0;$i<$count;$i++){
my $temp="check_group_".$items[$i]->{'barcode'};
my $barcode=$input->param($temp);
if ($barcode ne ''){
moditem($items[$i]->{'itemnumber'},$group);
}
}
} else {
my $flag;
my $flag2;
for (my $i=0;$i<$count;$i++){
my $temp="check_group_".$items[$i]->{'barcode'};
$barcodes[$i]=$input->param($temp);
if ($barcodes[$i] eq ''){
$flag="notall";
} else {
$flag2="leastone";
}
}
if ($flag eq 'notall'){
$bibitemnum=newbiblioitem($bibnum,$itemtype,$volumeddesc,$classification);
modbibitem($bibitemnum,$itemtype,$isbn,$publishercode,$publicationdate,$classification,$dewey,$subclass,$illus,$pages,$volumeddesc);
for (my $i=0;$i<$count;$i++){
if ($barcodes[$i] ne ''){
moditem($items[$i]->{'itemnumber'},$bibitemnum);
}
}
} elsif ($flag2 eq 'leastone') {
modbibitem($bibitemnum,$itemtype,$isbn,$publishercode,$publicationdate,$classification,$dewey,$subclass,$illus,$pages,$volumeddesc);
}
}
print $input->redirect("moredetail.pl?type=intra&bib=$bibnum&bi=$bibitemnum");
sub checkinp{
my ($inp)=@_;

33
updatebiblio.pl

@ -21,39 +21,6 @@ my $unititle=checkinp($input->param('Unititle'));
my $notes=checkinp($input->param('Notes'));
modbiblio($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes);
#print $title;
my $bibitemnum=checkinp($input->param('bibitemnum'));
my $itemtype=checkinp($input->param('Item'));
my $isbn=checkinp($input->param('ISBN'));
my $publishercode=checkinp($input->param('Publisher'));
my $publicationdate=checkinp($input->param('Publication'));
my $class=checkinp($input->param('Class'));
my $classification;
my $dewey;
my $subclass;
if ($itemtype ne 'NF'){
$classification=$class;
}
if ($class =~/[0-9]+/){
# print $class;
$dewey= $class;
$dewey=~ s/[a-z]+//gi;
my @temp;
if ($class =~ /\./){
@temp=split(/[0-9]+\.[0-9]+/,$class);
} else {
@temp=split(/[0-9]+/,$class);
}
$classification=$temp[0];
$subclass=$temp[1];
# print $classification,$dewey,$subclass;
}else{
$dewey='';
}
my $illus=checkinp($input->param('Illustrations'));
my $pages=checkinp($input->param('Pages'));
my $volumeddesc=checkinp($input->param('Volume'));
modbibitem($bibitemnum,$itemtype,$isbn,$publishercode,$publicationdate,$classification,$dewey,$subclass,$illus,$pages,$volumeddesc);
my $subtitle=checkinp($input->param('Subtitle'));
modsubtitle($bibnum,$subtitle);

83
updateitem.pl

@ -0,0 +1,83 @@
#!/usr/bin/perl
use C4::Database;
use CGI;
use strict;
use C4::Acquisitions;
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 $itemnum=checkinp($input->param('itemnumber'));
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('ItemNotes'));
#need to do barcode check
my $barcode=$input->param('Barcode');
#modbiblio($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes);
my $bibitemnum=checkinp($input->param('bibitemnum'));
#my $olditemtype
my $itemtype=checkinp($input->param('Item'));
my $isbn=checkinp($input->param('ISBN'));
my $publishercode=checkinp($input->param('Publisher'));
my $publicationdate=checkinp($input->param('Publication'));
my $class=checkinp($input->param('Class'));
my $classification;
my $dewey;
my $subclass;
if ($itemtype ne 'NF'){
$classification=$class;
}
if ($class =~/[0-9]+/){
# print $class;
$dewey= $class;
$dewey=~ s/[a-z]+//gi;
my @temp;
if ($class =~ /\./){
@temp=split(/[0-9]+\.[0-9]+/,$class);
} else {
@temp=split(/[0-9]+/,$class);
}
$classification=$temp[0];
$subclass=$temp[1];
# print $classification,$dewey,$subclass;
}else{
$dewey='';
}
my $illus=checkinp($input->param('Illustrations'));
my $pages=checkinp($input->param('Pages'));
my $volumeddesc=checkinp($input->param('Volume'));
#have to check how many items are attached to this bibitem, if one, just change it,
#if more than one, we must create a new one.
my $number=countitems($bibitemnum);
if ($number > 1){
# print $number;
#check if bibitemneeds modifying
my $needsmod=needsmod($bibitemnum,$itemtype);
if ($needsmod != 1){
$bibitemnum=newbiblioitem($bibnum,$itemtype,$volumeddesc,$classification);
}
}
modbibitem($bibitemnum,$itemtype,$isbn,$publishercode,$publicationdate,$classification,$dewey,$subclass,$illus,$pages,$volumeddesc);
moditem($itemnum,$bibitemnum,$barcode,$notes);
print $input->redirect("moredetail.pl?type=intra&bib=$bibnum&bi=$bibitemnum");
#print $bibitemnum;
sub checkinp{
my ($inp)=@_;
$inp=~ s/\'/\\\'/g;
$inp=~ s/\"/\\\"/g;
return($inp);
}
Loading…
Cancel
Save