[Koha-cvs] koha admin/systempreferences.pl koha-tmpl/intra... [rel_2_2]

Owen Leonard oleonard at athenscounty.lib.oh.us
Thu Apr 20 23:26:54 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	Owen Leonard <oleonard at savannah.gnu.org>	06/04/20 21:26:53

Modified files:
	admin          : systempreferences.pl 
	koha-tmpl/intranet-tmpl/npl/en/search.marc: result.tmpl 
	search.marc    : search.pl 

Log message:
	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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/admin/systempreferences.pl.diff?only_with_tag=rel_2_2&tr1=1.22.2.16&tr2=1.22.2.17&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl.diff?only_with_tag=rel_2_2&tr1=1.5.2.2&tr2=1.5.2.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/search.marc/search.pl.diff?only_with_tag=rel_2_2&tr1=1.22.2.9&tr2=1.22.2.10&r1=text&r2=text

Patches:
Index: koha/admin/systempreferences.pl
diff -u koha/admin/systempreferences.pl:1.22.2.16 koha/admin/systempreferences.pl:1.22.2.17
--- koha/admin/systempreferences.pl:1.22.2.16	Wed Apr 19 16:22:18 2006
+++ koha/admin/systempreferences.pl	Thu Apr 20 21:26:53 2006
@@ -49,55 +49,62 @@
 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)=@_;
Index: koha/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl
diff -u koha/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl:1.5.2.2 koha/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl:1.5.2.3
--- koha/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl:1.5.2.2	Tue Mar  7 18:14:27 2006
+++ koha/koha-tmpl/intranet-tmpl/npl/en/search.marc/result.tmpl	Thu Apr 20 21:26:53 2006
@@ -39,7 +39,8 @@
 <tbody>
 	<!-- TMPL_LOOP name="result" -->
 		<tr<!-- TMPL_IF NAME="even" --> class="highlight"<!-- /TMPL_IF -->>
-			<td><p><a href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" --></a></p>
+			<td><p>
+			<!-- TMPL_IF name="BiblioDefaultViewmarc" --><a href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></a><!-- TMPL_ELSE --><!-- TMPL_IF name="BiblioDefaultViewisbd" --><a href="/cgi-bin/koha/ISBDdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></a><!-- TMPL_ELSE --><a href="/cgi-bin/koha/detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" --></a><!-- /TMPL_IF --><!-- /TMPL_IF --></p>
 						<p><!-- TMPL_VAR NAME="author" -->
 						<!-- TMPL_IF NAME="publishercode" -->- <!-- TMPL_VAR NAME="publishercode" --><!-- /TMPL_IF -->
 						<!-- TMPL_IF NAME="place" --> ; <!-- TMPL_VAR NAME="place" --><!-- /TMPL_IF -->
Index: koha/search.marc/search.pl
diff -u koha/search.marc/search.pl:1.22.2.9 koha/search.marc/search.pl:1.22.2.10
--- koha/search.marc/search.pl:1.22.2.9	Tue Apr  4 14:08:02 2006
+++ koha/search.marc/search.pl	Thu Apr 20 21:26:53 2006
@@ -141,8 +141,14 @@
 										$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 @@
 	} else {
 		$to = (($startfrom+1)*$resultsperpage);
 	}
+	my $defaultview = 'BiblioDefaultView'.C4::Context->preference('IntranetBiblioDefaultView');
 	$template->param(result => $results,
 							startfrom=> $startfrom,
 							displaynext=> $displaynext,
@@ -210,6 +217,7 @@
 							desc_asc=>$desc_or_asc,
 							orderby=>$orderby,
 							MARC_ON => C4::Context->preference("marc"),
+							$defaultview => 1,
 							);
 
 } elsif ($op eq "AddStatement") {





More information about the Koha-cvs mailing list