X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=modbib.pl;h=06212e9455a237bfed7d1a603c36a8833219fd56;hb=81e5ddd39c9a35dd84cffe0804baa7c5cdd8bb41;hp=859dbe311773df32009fb46e613807b2859cb088;hpb=5c91d43a43b801bbc1952613ac2061fa7c517d60;p=koha.git diff --git a/modbib.pl b/modbib.pl index 859dbe3117..06212e9455 100755 --- a/modbib.pl +++ b/modbib.pl @@ -1,8 +1,11 @@ #!/usr/bin/perl +# $Id$ + #script to modify/delete biblios #written 8/11/99 # modified 11/11/99 by chris@katipo.co.nz +# modified 12/16/2002 by hdl@ifrance.com : templating # Copyright 2000-2002 Katipo Communications @@ -27,40 +30,39 @@ use strict; use C4::Search; use CGI; use C4::Output; +use HTML::Template; +use C4::Auth; +use C4::Context; +use C4::Interface::CGI::Output; my $input = new CGI; 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 ($subjectcount, $subject) = &subject($bibnum); +my ($subtitlecount, $subtitle) = &subtitle($bibnum); +my ($addauthorcount, $addauthor) = &addauthor($bibnum); my $sub = $subject->[0]->{'subject'}; my $additional = $addauthor->[0]->{'author'}; -my %inputs; my $dewey; -my $submit=$input->param('submit.x'); +my $submit=$input->param('submit.x'); 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('catalogue'); -my %inputs; +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "modbib.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {acquisition => 1}, + debug => 1, + }); # have to get all subtitles, subjects and additional authors -for (my $i = 1; $i < $subjectcount; $i++) { - $sub = $sub . "|" . $subject->[$i]->{'subject'}; # FIXME - .= -} # for - -for (my $i = 1; $i < $addauthorcount; $i++) { - $additional = $additional . "|" . $addauthor->[$i]->{'author'}; - # FIXME - .= -} # for +$sub = join("|", map { $_->{'subject'} } @{$subject}); +$additional = join("|", map { $_->{'author'} } @{$addauthor}); $dewey = $data->{'dewey'}; $dewey =~ s/0+$//; @@ -80,79 +82,21 @@ $dewey = ~ s/\.$//; $data->{'title'} = &tidyhtml($data->{'title'}); -print << "EOF"; -Modify Website Links -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Author
Title
Abstract
Subject -... -
Copyright Date
Series Title
Additional Author
Subtitle
Unititle
Notes
Serial
Analytic Author
Analytic Title
-
- -
- -EOF - -print endmenu(); -print endpage(); +$template->param ( biblionumber => $bibnum, + biblioitemnumber => $data->{'biblioitemnumber'}, + author => $data->{'author'}, + title => $data->{'title'}, + abstract => $data->{'abstract'}, + subject => $sub, + copyrightdate => $data->{'copyrightdate'}, + seriestitle => $data->{'seriestitle'}, + additionalauthor => $additional, + subtitle => $data->{'subtitle'}, + untitle => $data->{'untitle'}, + notes => $data->{'notes'}, + serial => $data->{'serial'}); + +output_html_with_http_headers $input, $cookie, $template->output; sub tidyhtml { my ($inp)=@_;