From f5270c34a6ff126ee43dd0e12d3d05f5aafb2809 Mon Sep 17 00:00:00 2001 From: oleonard Date: Thu, 20 Apr 2006 21:26:53 +0000 Subject: [PATCH] Adding new system preference, IntranetBiblioDefaultView, and necessary changes to relevant scripts and templates. Just like the OPAC's BiblioDefaultView preference, this determines which screen the user will see when they click a listing in search results: normal, MARC, or ISBD. --- admin/systempreferences.pl | 105 ++++++++++-------- .../npl/en/search.marc/result.tmpl | 3 +- search.marc/search.pl | 10 +- 3 files changed, 67 insertions(+), 51 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index b3fcdc0d03..895a6d6f78 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -49,55 +49,62 @@ use HTML::Template; use C4::Context; my %tabsysprefs; -$tabsysprefs{acquisitions}="Acquisitions"; -$tabsysprefs{advancedMARCEditor}="Catalogue"; -$tabsysprefs{AmazonAssocTag}="OPAC"; -$tabsysprefs{AmazonContent}="OPAC"; -$tabsysprefs{AmazonDevKey}="OPAC"; -$tabsysprefs{AnonSuggestions}="OPAC"; -$tabsysprefs{autoBarcode}="Catalogue"; -$tabsysprefs{automembernum}="Members"; -$tabsysprefs{authoritysep}="Authorities"; -$tabsysprefs{BiblioDefaultView}="OPAC"; -$tabsysprefs{checkdigit}="Members"; -$tabsysprefs{dateformat}="Admin"; -$tabsysprefs{Disable_Dictionary}="OPAC"; -$tabsysprefs{gist}="Acquisitions"; -$tabsysprefs{hidelostitems}="OPAC"; -$tabsysprefs{hide_marc}="Catalogue"; -$tabsysprefs{insecure}="Admin"; -$tabsysprefs{itemcallnumber}="Catalogue"; -$tabsysprefs{ISBD}="Catalogue"; -$tabsysprefs{KohaAdmin}="Admin"; -$tabsysprefs{LabelMARCView}="Catalogue"; -$tabsysprefs{LibraryName}="OPAC"; -$tabsysprefs{marc}="Catalogue"; -$tabsysprefs{marcflavour}="Catalogue"; -$tabsysprefs{maxreserves}="Circulation"; -$tabsysprefs{maxoutstanding}="Circulation"; -$tabsysprefs{NotifyBorrowerDeparture}="Members"; -$tabsysprefs{opaccolorstylesheet}="OPAC"; -$tabsysprefs{opaccredits}="OPAC"; -$tabsysprefs{opacheader}="OPAC"; -$tabsysprefs{opaclanguagesdisplay}="OPAC"; -$tabsysprefs{opaclanguages}="OPAC"; -$tabsysprefs{opaclargeimage}="OPAC"; -$tabsysprefs{opaclayoutstylesheet}="OPAC"; -$tabsysprefs{OpacNav}="OPAC"; -$tabsysprefs{OpacPasswordChange}="OPAC"; -$tabsysprefs{opacreadinghistory}="OPAC"; -$tabsysprefs{opacsmallimage}="OPAC"; -$tabsysprefs{opacstylesheet}="OPAC"; -$tabsysprefs{opacthemes}="OPAC"; -$tabsysprefs{noissuescharge}="Circulation"; -$tabsysprefs{patronimages}="Circulation"; -$tabsysprefs{printcirculationslips}="Circulation"; -$tabsysprefs{ReturnBeforeExpiry}="Circulation"; -$tabsysprefs{serialsadditems}="Catalogue"; -$tabsysprefs{sortbynonfiling}="Catalogue"; -$tabsysprefs{SubscriptionHistory}="OPAC"; -$tabsysprefs{suggestion}="OPAC"; -$tabsysprefs{virtualshelves}="OPAC"; +# Acquisitions + $tabsysprefs{acquisitions}="Acquisitions"; + $tabsysprefs{gist}="Acquisitions"; +# Admin + $tabsysprefs{dateformat}="Admin"; + $tabsysprefs{insecure}="Admin"; + $tabsysprefs{KohaAdmin}="Admin"; +# Authorities + $tabsysprefs{authoritysep}="Authorities"; +# Catalogue + $tabsysprefs{advancedMARCEditor}="Catalogue"; + $tabsysprefs{autoBarcode}="Catalogue"; + $tabsysprefs{hide_marc}="Catalogue"; + $tabsysprefs{IntranetBiblioDefaultView} = "Catalogue"; + $tabsysprefs{ISBD}="Catalogue"; + $tabsysprefs{itemcallnumber}="Catalogue"; + $tabsysprefs{LabelMARCView}="Catalogue"; + $tabsysprefs{marc}="Catalogue"; + $tabsysprefs{marcflavour}="Catalogue"; + $tabsysprefs{serialsadditems}="Catalogue"; + $tabsysprefs{sortbynonfiling}="Catalogue"; +# Circulation + $tabsysprefs{maxoutstanding}="Circulation"; + $tabsysprefs{maxreserves}="Circulation"; + $tabsysprefs{noissuescharge}="Circulation"; + $tabsysprefs{patronimages}="Circulation"; + $tabsysprefs{printcirculationslips}="Circulation"; + $tabsysprefs{ReturnBeforeExpiry}="Circulation"; +# Members + $tabsysprefs{automembernum}="Members"; + $tabsysprefs{checkdigit}="Members"; + $tabsysprefs{NotifyBorrowerDeparture}="Members"; +# OPAC + $tabsysprefs{AmazonAssocTag}="OPAC"; + $tabsysprefs{AmazonContent}="OPAC"; + $tabsysprefs{AmazonDevKey}="OPAC"; + $tabsysprefs{AnonSuggestions}="OPAC"; + $tabsysprefs{BiblioDefaultView}="OPAC"; + $tabsysprefs{Disable_Dictionary}="OPAC"; + $tabsysprefs{hidelostitems}="OPAC"; + $tabsysprefs{LibraryName}="OPAC"; + $tabsysprefs{opaccolorstylesheet}="OPAC"; + $tabsysprefs{opaccredits}="OPAC"; + $tabsysprefs{opaclanguages}="OPAC"; + $tabsysprefs{opaclanguagesdisplay}="OPAC"; + $tabsysprefs{opaclargeimage}="OPAC"; + $tabsysprefs{opaclayoutstylesheet}="OPAC"; + $tabsysprefs{OpacNav}="OPAC"; + $tabsysprefs{OpacPasswordChange}="OPAC"; + $tabsysprefs{opacreadinghistory}="OPAC"; + $tabsysprefs{opacsmallimage}="OPAC"; + $tabsysprefs{opacstylesheet}="OPAC"; + $tabsysprefs{opacthemes}="OPAC"; + $tabsysprefs{SubscriptionHistory}="OPAC"; + $tabsysprefs{suggestion}="OPAC"; + $tabsysprefs{virtualshelves}="OPAC"; sub StringSearch { my ($env,$searchstring,$type)=@_; diff --git a/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl b/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl index 91b554b777..3dd528d153 100644 --- a/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl +++ b/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl @@ -39,7 +39,8 @@ class="highlight"> -

">

+

+ "> "> ">

- ; diff --git a/search.marc/search.pl b/search.marc/search.pl index d2c85f6775..43368f5431 100755 --- a/search.marc/search.pl +++ b/search.marc/search.pl @@ -141,8 +141,14 @@ if ($op eq "do_search") { $startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc); if ($total == 1) { # if only 1 answer, jump directly to the biblio + if (C4::Context->preference("IntranetBiblioDefaultView") eq "normal") { + print $query->redirect("/cgi-bin/koha/detail.pl?bib=".@$results[0]->{biblionumber}); + } elsif (C4::Context->preference("IntranetBiblioDefaultView") eq "marc") { print $query->redirect("/cgi-bin/koha/MARCdetail.pl?bib=".@$results[0]->{biblionumber}); - exit + } else { + print $query->redirect("/cgi-bin/koha/ISBDdetail.pl?bib=".@$results[0]->{biblionumber}); + } + exit } ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "search.marc/result.tmpl", @@ -195,6 +201,7 @@ if ($op eq "do_search") { } else { $to = (($startfrom+1)*$resultsperpage); } + my $defaultview = 'BiblioDefaultView'.C4::Context->preference('IntranetBiblioDefaultView'); $template->param(result => $results, startfrom=> $startfrom, displaynext=> $displaynext, @@ -210,6 +217,7 @@ if ($op eq "do_search") { desc_asc=>$desc_or_asc, orderby=>$orderby, MARC_ON => C4::Context->preference("marc"), + $defaultview => 1, ); } elsif ($op eq "AddStatement") { -- 2.39.5