From 7821d507a30975b69825617b5b6e96aa4843dbd1 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Fri, 10 May 2002 17:41:05 +0000 Subject: [PATCH] Added ability to switch between two templates. One template shows biblionumber, the other template shows notes, in the third column. My thinking is that for every template, the scripts can search for a local version of the template before using the default template. --- html-template/cmsdsearchresults.tmpl | 18 ++++++++++++++++++ html-template/search.pl | 8 +++++++- html-template/searchheader.tmpl | 2 ++ html-template/searchresults.tmpl | 3 ++- 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 html-template/cmsdsearchresults.tmpl create mode 100644 html-template/searchheader.tmpl diff --git a/html-template/cmsdsearchresults.tmpl b/html-template/cmsdsearchresults.tmpl new file mode 100644 index 0000000000..f7dd9e89b0 --- /dev/null +++ b/html-template/cmsdsearchresults.tmpl @@ -0,0 +1,18 @@ + +Search Results + + + + + + + + + + + + +
TitleAuthorNotes
+
+ + diff --git a/html-template/search.pl b/html-template/search.pl index d728de4eb9..7e811c0c2b 100755 --- a/html-template/search.pl +++ b/html-template/search.pl @@ -3,12 +3,18 @@ use HTML::Template; use strict; require Exporter; use C4::Database; +use CGI; + +my $query=new CGI; + +my $template=$query->param('template'); +($template) || ($template='searchresults.tmpl'); my $dbh=&C4Connect; -my $template = HTML::Template->new(filename => 'searchresults.tmpl', die_on_bad_params => 0); +my $template = HTML::Template->new(filename => $template, die_on_bad_params => 0); my @results; my $sth=$dbh->prepare("select * from biblio where author like 's%' limit 20"); diff --git a/html-template/searchheader.tmpl b/html-template/searchheader.tmpl new file mode 100644 index 0000000000..c2dc399767 --- /dev/null +++ b/html-template/searchheader.tmpl @@ -0,0 +1,2 @@ +Template #1 | Template #2 +
diff --git a/html-template/searchresults.tmpl b/html-template/searchresults.tmpl index acd8a5ff05..4a97e4ae4e 100644 --- a/html-template/searchresults.tmpl +++ b/html-template/searchresults.tmpl @@ -1,7 +1,8 @@ -Test Template +Search Results + -- 2.39.5
TitleAuthorBiblionumber