Bugzilla – Attachment 8243 Details for
Bug 7720
Ambiguity in OPAC Details location.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7720 - Ambiguity in OPAC Details location - Followup - Add System Preference
Bug-7720---Ambiguity-in-OPAC-Details-location---Fo.patch (text/plain), 7.58 KB, created by
Kyle M Hall
on 2012-03-16 20:01:48 UTC
(
hide
)
Description:
Bug 7720 - Ambiguity in OPAC Details location - Followup - Add System Preference
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-03-16 20:01:48 UTC
Size:
7.58 KB
patch
obsolete
>From 595b3b21b5ff002623392930d4b0bb4ae74b66a5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 16 Mar 2012 12:56:58 -0400 >Subject: [PATCH] Bug 7720 - Ambiguity in OPAC Details location - Followup - Add System Preference > >This commit adds the system preference OpacLocationBranchToDisplay which >allows a library to control whether to display the holding library, >the home library, or both for the opac details page. > >http://bugs.koha-community.org/show_bug.cgi?id=7220 >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 6 ++ > .../prog/en/modules/admin/preferences/opac.pref | 8 +++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 52 ++++++++++++------- > opac/opac-detail.pl | 2 + > 5 files changed, 50 insertions(+), 19 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 5a6c713..39a724a 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -351,3 +351,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CalendarFirstDayOfWeek','Sunday','Select the first day of week to use in the calendar.','Sunday|Monday','Choice'); > INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.', 'free') > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RoutingListNote','To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutlingListNote</a> system preference.','Define a note to be shown on all routing lists','70|10','Textarea'); >+INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplay', 'holding', 'holding|home|both', 'In the OPAC, under location show which branch for Location in the record details.', 'Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 082d5ca..7658964 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4923,6 +4923,12 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.07.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplay', 'holding', 'holding|home|both', 'In the OPAC, under location show which branch for Location in the record details.', 'Choice')"); >+ print "Upgrade to $DBversion done (Added system preference OpacLocationBranchToDisplay)\n"; >+ SetVersion($DBversion); >+} > > =head1 FUNCTIONS > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 1acc414..a7c2d72 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -86,6 +86,14 @@ OPAC: > no: "Don't show" > - the name of the patron that has an item checked out on item detail pages on the OPAC. > - >+ - Display the >+ - pref: OpacLocationBranchToDisplay >+ choices: >+ home: "home library" >+ holding: "holding library" >+ both: "home and holding libraries" >+ - for items on the OPAC record details page. >+ - > - pref: OpacKohaUrl > default: 0 > choices: >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 44bdff5..4ad144b 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -580,8 +580,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <table id="holdingst"> > <thead><tr> > [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %] >- <th>Current Location</th> >- [% UNLESS ( singleBranchMode ) %]<th>Home Library</th>[% END %] >+ [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' || singleBranchMode ) %] >+ <th>Current Location</th> >+ [% END %] >+ [% UNLESS ( singleBranchMode ) %] >+ [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] >+ <th>Home Library</th> >+ [% END %] >+ [% END %] > [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %] > <th>Call Number</th> > [% IF ( itemdata_enumchron ) %]<th>Vol Info</th>[% END %] >@@ -593,29 +599,37 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </tr></thead> > <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %] > <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %] >- <td> >- [% UNLESS ( singleBranchMode ) %] >+ [% UNLESS ( singleBranchMode ) %] >+ [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] >+ <td> >+ [% IF ( ITEM_RESULT.branchurl ) %] >+ <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a> >+ [% ELSE %] >+ [% ITEM_RESULT.branchname %] >+ [% END %] >+ >+ </td> >+ [% END %] >+ >+ [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] >+ <td> >+ [% IF ( ITEM_RESULT.homebranchurl ) %] >+ <a href="[% ITEM_RESULT.homebranchurl %]">[% ITEM_RESULT.homebranchname %]</a> >+ [% ELSE %] >+ [% ITEM_RESULT.homebranchname %] >+ [% END %] >+ >+ <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> >+ </td> >+ [% END %] >+ [% ELSE %] >+ <td> > [% IF ( ITEM_RESULT.branchurl ) %] > <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a> > [% ELSE %] > [% ITEM_RESULT.branchname %] > [% END %] > >- [% END %] >- >- [% IF ( singleBranchMode ) %] >- <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> >- [% END %] >- </td> >- >- [% UNLESS ( singleBranchMode ) %] >- <td> >- [% IF ( ITEM_RESULT.homebranchurl ) %] >- <a href="[% ITEM_RESULT.homebranchurl %]">[% ITEM_RESULT.homebranchname %]</a> >- [% ELSE %] >- [% ITEM_RESULT.homebranchname %] >- [% END %] >- > <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> > </td> > [% END %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 27684d4..24372a7 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -944,4 +944,6 @@ if (C4::Context->preference('OPACLocalCoverImages') == 1) { > $template->{VARS}->{localimages} = \@images; > } > >+$template->param('OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay') ); >+ > output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7720
:
8213
|
8215
|
8216
|
8223
|
8224
|
8226
|
8229
|
8230
|
8237
|
8238
|
8243
|
8245
|
8825
|
8868
|
8878
|
9570
|
9762
|
10149
|
11091
|
11092
|
12389
|
13466
|
15237
|
15238
|
15241
|
15247
|
18622
|
19658
|
20217
|
21374
|
21375
|
22155
|
22156
|
28172
|
28173
|
28175