From 12a8d67c2115bc713d66cb0a2e286459a75b186f Mon Sep 17 00:00:00 2001 From: hdl Date: Mon, 16 Dec 2002 00:26:18 +0000 Subject: [PATCH] Templating moditem, modbib, modwebsites, newimember --- .../intranet-tmpl/default/en/modbib.tmpl | 72 ++++++++++++ .../intranet-tmpl/default/en/moditem.tmpl | 47 ++++++++ .../intranet-tmpl/default/en/modwebsites.tmpl | 51 ++++++++ .../intranet-tmpl/default/en/newimember.tmpl | 42 +++---- modbib.pl | 97 ++++----------- moditem.pl | 111 ++++++------------ modwebsites.pl | 72 +++--------- newimember.pl | 42 +++---- 8 files changed, 283 insertions(+), 251 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/default/en/modbib.tmpl create mode 100644 koha-tmpl/intranet-tmpl/default/en/moditem.tmpl create mode 100644 koha-tmpl/intranet-tmpl/default/en/modwebsites.tmpl diff --git a/koha-tmpl/intranet-tmpl/default/en/modbib.tmpl b/koha-tmpl/intranet-tmpl/default/en/modbib.tmpl new file mode 100644 index 0000000000..17d9f61fec --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/modbib.tmpl @@ -0,0 +1,72 @@ + + +">Modify Website Links +
+"> +"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Author">
Title">
Abstract
Subject +... +
Copyright Date">
Series Title">
Additional Author">
Subtitle">
Unititle">
Notes
Serial">
Analytic Author
Analytic Title
+
+ +
+ + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/default/en/moditem.tmpl b/koha-tmpl/intranet-tmpl/default/en/moditem.tmpl new file mode 100644 index 0000000000..0d507126b0 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/moditem.tmpl @@ -0,0 +1,47 @@ + + + ()
+ + +
+ + +"> +"> +"> +"> +"> +"> + +"> + + + + + + + + + + +"> +"> +"> + +
Barcode" size=40>
ItemNotes
Home Branch" size=40>
Lost + checked > +Yes + checked > +No +
Cancelled checked > +Yes + checked > +No +
+ +
+
+ + + diff --git a/koha-tmpl/intranet-tmpl/default/en/modwebsites.tmpl b/koha-tmpl/intranet-tmpl/default/en/modwebsites.tmpl new file mode 100644 index 0000000000..c506bb0b9b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/modwebsites.tmpl @@ -0,0 +1,51 @@ + +

+">Return to Details Page +EOF + + +

+

+"> +"> + + + + + + + + + + + + + +
Title">
Description
URL">
+ +
+ + +

+

Add another Website Link

+
+"> + + + + + + + + + + + + + +
Title
Description
URL
+ +
+EOF + + diff --git a/koha-tmpl/intranet-tmpl/default/en/newimember.tmpl b/koha-tmpl/intranet-tmpl/default/en/newimember.tmpl index 7062bd2275..b84732a3d4 100644 --- a/koha-tmpl/intranet-tmpl/default/en/newimember.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/newimember.tmpl @@ -1,30 +1,18 @@ - + - - - - The following compulsary fields have been left blank. Please push the back button and try again.

-

    - -
  • - -

- - - -Invalid cardnumber.

+ + + + + Invalid cardnumber.

+ +

+ + " value=""> + + +
+
- -
- - - - -
-
- - - - - + \ No newline at end of file diff --git a/modbib.pl b/modbib.pl index 7a63e28145..4a7af07e2b 100755 --- a/modbib.pl +++ b/modbib.pl @@ -5,6 +5,7 @@ #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 @@ -29,6 +30,7 @@ use strict; use C4::Search; use CGI; use C4::Output; +use HTML::Template; my $input = new CGI; @@ -45,11 +47,12 @@ if ($submit eq '') { print $input->redirect("/cgi-bin/koha/delbiblio.pl?biblio=$bibnum"); } # if -print $input->header; +#print $input->header; # my ($analytictitle) = &analytic($biblionumber,'t'); # my ($analyticauthor) = &analytic($biblionumber,'a'); -print startpage(); -print startmenu('catalogue'); +#print startpage(); +#print startmenu('catalogue'); +my $template = gettemplate("modbib.tmpl"); # have to get all subtitles, subjects and additional authors $sub = join("|", map { $_->{'subject'} } @{$subject}); @@ -74,79 +77,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 => $data->{'biblionumber'}); +$template->param ( biblioitemnumber => $data->{'biblioitemnumber'}); +$template->param ( author => $data->{'author'}); +$template->param ( title => $data->{'title'}); +$template->param ( abstract => $data->{'abstract'}); +$template->param ( subject => $sub); +$template->param ( copyrightdate => $data->{'copyrightdate'}); +$template->param ( seriestitle => $data->{'seriestitle'}); +$template->param ( additionalauthor => $additional); +$template->param ( subtitle => $data->{'subtitle'}); +$template->param ( untitle => $data->{'untitle'}); +$template->param ( notes => $data->{'notes'}); +$template->param ( serial => $data->{'serial'}); + +print "Content-Type: text/html\n\n", $template->output; sub tidyhtml { my ($inp)=@_; diff --git a/moditem.pl b/moditem.pl index 5933f857fb..c2d1564f42 100755 --- a/moditem.pl +++ b/moditem.pl @@ -2,10 +2,11 @@ # $Id$ + #script to modify/delete biblios #written 8/11/99 # modified 11/11/99 by chris@katipo.co.nz - +# modified 12/16/02 by hdl@ifrance.com : Templating # Copyright 2000-2002 Katipo Communications # @@ -31,6 +32,7 @@ use CGI; use C4::Output; use C4::Acquisitions; use C4::Biblio; +use HTML::Template; my $input = new CGI; my $submit=$input->param('delete.x'); @@ -40,7 +42,7 @@ if ($submit ne ''){ print $input->redirect("/cgi-bin/koha/delitem.pl?itemnum=$itemnum&bibitemnum=$bibitemnum"); } -print $input->header; +#print $input->header; #print $input->dump; my $data=bibitemdata($bibitemnum); @@ -48,8 +50,12 @@ my $data=bibitemdata($bibitemnum); my $item=itemnodata('blah','',$itemnum); #my ($analytictitle)=analytic($biblionumber,'t'); #my ($analyticauthor)=analytic($biblionumber,'a'); -print startpage(); -print startmenu('catalogue'); + + +#print startpage(); +#print startmenu('catalogue'); +my $template=gettemplate("moditem.tmpl"); + my %inputs; @@ -69,6 +75,9 @@ if ($dewey <= 0){ $dewey=''; } $dewey=~ s/\.$//; + +# 12/16/2002 hdl@ifrance.com : all these inputs seem unused !!! + $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"; @@ -90,77 +99,31 @@ $inputs{'Home Branch'}="text\t$item->{'homebranch'}\t18"; $inputs{'Lost'}="radio\t$item->{'itemlost'}\t19"; #$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"; $inputs{'itemnumber'}="hidden\t$itemnum\t22"; - - -print <$data->{'title'} ($data->{'author'})
- - -
- - - - - - - - - - - - - - - - - -
Barcode
ItemNotes
Home Branch
Lost{'itemlost'} ==1){ - print " checked "; -} -print <Yes -{'itemlost'} ==0){ - print " checked "; -} -print <No
Cancelled{'wthdrawn'} ==1){ - print " checked "; -} -print <Yes -{'wthdrawn'} ==0){ - print " checked "; -} -print <No
- -
-
- -printend -; - - - - - -print endmenu(); -print endpage(); +#12/16/2002 hdl@ifrance.com : end of comment + + + +#12/16/2002 hdl@ifrance.com : templating +$template->param( title => $data->{'title'}, + author => $data->{'author'}, + barcode => $item->{'barcode'}, + classification => "$data->{'classification'}$dewey$data->{'subclass'}", + publisher => $data->{'publisher'}, + publicationyear => $data->{'publicationyear'}, + pages => $data->{'pages'}, + illustration => $data->{'illustration'}, + itemnotes => $item->{'itemnotes'}, + volumedesc => $data->{'volumedesc'}, + homebranch => $data->{'homebranch'}, + itemlost => ($item->{'itemlost'} ==1), + itemwithdrawn => ($item->{'wthdrawn'} ==1), + biblionumber => $data->{'biblionumber'}, + biblioitemnumber => $data->{'biblioitemnumber'}, + itemnumber => $itemnum); + +print "Content-Type: text/html\n\n", $template->output; +#12/16/2002 hdl@ifrance.com : templating diff --git a/modwebsites.pl b/modwebsites.pl index 04e0567948..0a0ccfdd76 100755 --- a/modwebsites.pl +++ b/modwebsites.pl @@ -18,11 +18,14 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA +# modified by hdl@ifrance.com 12/16/2002, templating + use strict; use C4::Search; use CGI; use C4::Output; +use HTML::Template; my $input = new CGI; my $biblionumber = $input->param('biblionumber'); @@ -32,62 +35,23 @@ if ($biblionumber eq '') { print $input->redirect("/catalogue/"); } # if -print $input->header; -print startpage(); -print startmenu(); - -print << "EOF"; -

-Return to Details Page -EOF +#print $input->header; +#print startpage(); +#print startmenu(); +my $template = gettemplate("modwebsites.tmpl"); +my @websitesloop; for (my $i = 0; $i < $count; $i++) { - print << "EOF" -

-

- - - - - - - - - - - - - - - -
Title
Description
URL
- -
-EOF + my %website; + $website{'biblionumber'}=$biblionumber; + $website{'websitenumber'}=$websites[$i]->{'websitenumber'}; + $website{'title'}=$websites[$i]->{'title'}; + $website{'description'}=$websites[$i]->{'description'}; + $website{'url'}=$websites[$i]->{'url'}; + push (@websitesloop, \%website); } # for -print << "EOF"; -

-

Add another Website Link

-
- - - - - - - - - - - - - - -
Title
Description
URL
- -
-EOF +$template->param( biblionumber => $biblionumber, + websitesloop => \@websitesloop); -print endmenu(); -print endpage(); +print "Content-Type: text/html\n\n", $template->output; diff --git a/newimember.pl b/newimember.pl index 271b25053c..b7060de975 100755 --- a/newimember.pl +++ b/newimember.pl @@ -3,6 +3,7 @@ # $Id$ #script to print confirmation screen, then if accepted calls itself to insert data +#modified 2002/12/16 by hdl@ifrance.com : Templating # Copyright 2000-2002 Katipo Communications @@ -27,13 +28,15 @@ use C4::Output; use C4::Input; use CGI; use Date::Manip; +use HTML::Template; my %env; my $input = new CGI; #get varibale that tells us whether to show confirmation page #or insert data my $insert=$input->param('insert'); -print $input->header; + +my $template=gettemplate("newimember.tmpl"); #get rest of data my %data; my @names=$input->param; @@ -66,25 +69,24 @@ if ($data{'contactname'} eq ''){ } #print $input->Dump; #print $string; -print startmenu('member'); -if ($ok ==1){ - print $string; -} else { - my $valid=checkdigit(\%env,$data{"cardnumber_institution"}); - if ($valid != 1){ - print "Invalid cardnumber"; - } else { +#print startmenu('member'); - my @inputs; - my $i=0; - while (my ($key, $value) = each %data) { - $value=~ s/\"/%22/g; - $inputs[$i]=["hidden","$key","$value"]; - $i++; - } - $inputs[$i]=["submit","submit","submit"]; - print mkformnotable("/cgi-bin/koha/insertidata.pl",@inputs); +$template->param( missingloop => ($ok==1)); +$template->param( string => $string); +if ($ok !=1) { + my $valid=checkdigit(\%env,$data{"cardnumber_institution"}); + $template->param( invalid => ($valid !=1)); + if (valid==1){ + my @inputs; + while (my ($key, $value) = each %data) { + $value=~ s/\"/%22/g; + my %line; + $line{'key'}=$key; + $line{'value'}=$value; + push(@inputs, \%line); + } + $template->param(inputsloop => \@inputs); } } -print endmenu('member'); -print endpage(); +print "Content-Type: text/html\n\n", $template->output; + -- 2.39.5