X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=modbibitem.pl;h=13a44ba54575c71f322814d8a87c9c4cd0a34d1a;hb=26543b430e1df3866f50e79fbfb724ec69a26791;hp=899964dd1c4c8f04bee0092fc264760946c41944;hpb=89cbfd3cd0d50b2e5387020da43f25a2199a88cc;p=koha.git diff --git a/modbibitem.pl b/modbibitem.pl index 899964dd1c..13a44ba545 100755 --- a/modbibitem.pl +++ b/modbibitem.pl @@ -1,52 +1,80 @@ #!/usr/bin/perl +# $Id$ + #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 + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; +require Exporter; use C4::Search; -use CGI; use C4::Output; +use C4::Koha; +use CGI; +use HTML::Template; +use C4::Date; +use C4::Biblio; +use C4::Catalogue; +use C4::Auth; +use C4::Interface::CGI::Output; my $input = new CGI; -# my $bibitemnum=$input->param('bibitem'); my $data=bibitemdata($bibitemnum); my $biblio=$input->param('biblio'); my $submit=$input->param('submit.x'); -if ($submit eq ''){ - print $input->redirect("/cgi-bin/koha/delbibitem.pl?bibitemnum=$bibitemnum&biblio=$biblio"); +if ($submit eq ''){ + print $input->redirect("deletebiblioitem.pl?biblioitemnumber=$bibitemnum&biblionumber=$biblio"); } -print $input->header; -#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 ($template, $loggedinuser, $cookie) = get_template_and_user({ + template_name => 'modbibitem.tmpl', + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {catalogue => 1}, + }); + + 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=''; -} +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{'URL'}="text\t$data->{'url'}\t4"; $inputs{'Publisher'}="text\t$data->{'publishercode'}\t5"; #$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6"; $inputs{'ISBN'}="text\t$data->{'isbn'}\t7"; @@ -66,125 +94,62 @@ $inputs{'Volume'}="text\t$data->{'volumeddesc'}\t17"; $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20"; $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21"; -print <param( biblionumber => $data->{'biblionumber'}, + title => $data->{'title'}, + author => $data->{'author'}, + description => $data->{'description'}, + loggedinuser => $loggedinuser, + ); -
-{'biblionumber'}&type=intra>$data->{'title'} ($data->{'author'})
-Modify Group - $data->{'description'}

-
- +my ($count,@bibitems)=bibitems($data->{'biblionumber'}); - - +my @bibitemloop; -printend -; -my ($count,@bibitems)=bibitems($data->{'biblionumber'}); -print ""; -print < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RE-ASSIGN TO EXISTING GROUP
OR MODIFY DETAILS
Item Type
Class
Publisher
Place
ISBN
Publication Year
Pages
Illustrations
Volume
Notes
Size
- - - - - - - -printend -; - - -print < - - - - - - - - - -printend -; -my (@items)=itemissues($data->{'biblioitemnumber'}); -#print @items; -my $count=@items; +$template->param(bibitemloop =>\@bibitemloop); + + +#my $notesinput=$input->textfield(-name=>'Notes', -default=>$data->{'bnotes'}, -size=>20); +$template->param(bnotes=>$data->{'bnotes'}); + +$template->param(itemtype => $data->{'itemtype'}); + +$template->param(url => $data->{'url'}); +$template->param(classification => $data->{'classification'}, + dewey => $dewey, + subclass => $data->{'subclass'}, + publishercode => $data->{'publishercode'}, + place => $data->{'place'}, + isbn => $data->{'isbn'}, + publicationyear => $data->{'publicationyear'}, + pages => $data->{'pages'}, + illustration => $data->{'illustration'}, + volumeddesc => $data->{'volumeddesc'}, + size => $data->{'size'}, + biblionumber => $data->{'biblionumber'}, + biblioitemnumber => $data->{'biblioitemnumber'}); + +my (@items)=itemissues($data->{'biblioitemnumber'}); +#print @items; +my @itemloop; +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 -; + my %line; + $items[$i]->{'datelastseen'} = format_date($items[$i]->{'datelastseen'}); + $line{barcode}=$items[$i]->{'barcode'}; + $line{itemnumber}=$items[$i]->{'itemnumber'}; + $line{biblionumber}=$data->{'biblionumber'}; + $line{biblioitemnumber}=$data->{'biblioitemnumber'}; + $line{holdingbranch}=$items[$i]->{'holdingbranch'}; + $line{datelastseen}=$items[$i]->{'datelastseen'}; + push(@itemloop,\%line); } -print < -

- - - - - -

- - -HELP: You must 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. -
- -

 

- - -printend -; - +$template->param(itemloop => \@itemloop); +print "Content-Type: text/html\n\n", $template->output; -print endmenu(); -print endpage();
CHANGES TO AFFECT THESE BARCODES
-Tick ALL barcodes that changes are to apply too. Those left un-ticked will keep the original group record.
 BarcodeLocationDate DueLast Seen
$items[$i]->{'barcode'}$items[$i]->{'holdingbranch'}$items[$i]->{'datelastseen'}