Bugzilla – Attachment 18622 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.
Bug-7720---Ambiguity-in-OPAC-Details-location.patch (text/plain), 12.44 KB, created by
Kyle M Hall (khall)
on 2013-06-03 12:07:33 UTC
(
hide
)
Description:
Bug 7720 - Ambiguity in OPAC Details location.
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-06-03 12:07:33 UTC
Size:
12.44 KB
patch
obsolete
>From a99fcc6b3d154042f2553c6a8374ed767e3cc718 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 11 Feb 2013 09:12:07 -0500 >Subject: [PATCH] Bug 7720 - Ambiguity in OPAC Details location. > >Currently, in opac-detail.pl, there exists a column named 'Location'. >This column lists the name of the holding branch, and the item's >location description. This can cause confusion to borrowers, as >they may assume that the holding branch is the *owning* branch >(homebranch) of an item. > >This could cause a situation where a borrower waits for an >item to be returned to his or her library, only to find that >the library never owned that item, and it was transferred back >to it's homebranch. It could also lead a borrower to falsely >assume that his or her home library does not own a copy of a >particular item because the borrower does not see an his or her >home library listed for any of the items on the record. > >In addition, even when the holding branch is different >than the home branch, the item's shelving location is displayed, >even though that branch may not use that location. > >This commit makes the item details table equivilent to the intranet >details page by adding a "Home Library" column, which displays the >item's home library, as well as the shelving location. > >If singleBranchMode is enabled, this column disappears and the >"Location" column displays the shelving location only. > >This commit adds two new system preferences: > >OpacLocationBranchToDisplay, which defines whether >to display the holding library, the home library, >or both for the opac details page. > >OpacLocationBranchToDisplayShelving, which defines >where the shelving location should be displayed, >under the home library, the holding library, or both. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Comment: Work as described. Tested all variations. >No koha-qa errors. >--- > C4/Items.pm | 11 ++++- > installer/data/mysql/sysprefs.sql | 2 + > installer/data/mysql/updatedatabase.pl | 7 +++ > .../prog/en/modules/admin/preferences/opac.pref | 16 ++++++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 55 +++++++++++++++---- > opac/opac-detail.pl | 5 ++ > 6 files changed, 83 insertions(+), 13 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 212a9d3..e6ce0eb 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1222,7 +1222,8 @@ sub GetItemsInfo { > itemtypes.notforloan as notforloan_per_itemtype, > holding.branchurl, > holding.branchname, >- holding.opac_info as branch_opac_info >+ holding.opac_info as branch_opac_info, >+ home.branchurl AS homebranchurl > FROM items > LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode > LEFT JOIN branches AS home ON items.homebranch=home.branchcode >@@ -1274,6 +1275,14 @@ sub GetItemsInfo { > if ( my $bdata = $bsth->fetchrow_hashref ) { > $data->{'branchname'} = $bdata->{'branchname'}; > } >+ $bsth = $dbh->prepare( >+ "SELECT * FROM branches WHERE branchcode = ? >+ " >+ ); >+ $bsth->execute( $data->{'homebranch'} ); >+ if ( my $bdata = $bsth->fetchrow_hashref ) { >+ $data->{'homebranchname'} = $bdata->{'branchname'}; >+ } > $data->{'datedue'} = $datedue; > > # get notforloan complete status if applicable >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 31485bc..5c8b599 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -427,3 +427,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'); > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowHoldNotes',0,'Show hold notes on OPAC','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); >+INSERT IGNORE 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'); >+INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplayShelving', 'holding', 'holding|home|both', 'In the OPAC, display the shelving location under which which column.', 'Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f3a90d8..d009347 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6983,6 +6983,13 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > SetVersion($DBversion); > } > >+$DBversion = "3.13.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')"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacLocationBranchToDisplayShelving', 'holding', 'holding|home|both', 'In the OPAC, display the shelving location under which which column', '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 81824e4..3d66963 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 >@@ -110,6 +110,22 @@ 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. >+ - >+ - Display the shelving location under the >+ - pref: OpacLocationBranchToDisplayShelving >+ 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 1effd07..540cee0 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -1474,7 +1474,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <table class="holdingst"> > <thead><tr> > [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %] >- <th id="item_location">Location</th> >+ [% 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 id="item_ccode">Collection</th>[% END %] > <th id="item_callnumber">Call number</th> > [% IF ( itemdata_enumchron ) %]<th id="item_enumchron">Vol info</th>[% END %] >@@ -1494,19 +1501,43 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <tbody>[% FOREACH ITEM_RESULT IN items %] > [% IF ITEM_RESULT.this_branch %]<tr class="highlight-row-detail">[% ELSE %]<tr>[% END %] > [% IF ( item_level_itypes ) %]<td class="itype">[% 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 class="location"> >- [% UNLESS ( singleBranchMode ) %] >- <div class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]"> >- [% IF ( ITEM_RESULT.branchurl ) %] >- <a href="[% ITEM_RESULT.branchurl %]" title="">[% ITEM_RESULT.branchname %]</a> >+ [% UNLESS ( singleBranchMode ) %] >+ [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] >+ <td class="location_holding"> >+ <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]"> >+ [% IF ( ITEM_RESULT.branchurl ) %] >+ <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a> >+ [% ELSE %] >+ [% ITEM_RESULT.branchname %] >+ [% END %] >+ </span> >+ >+ [% IF ( OpacLocationBranchToDisplayShelving == 'holding' || OpacLocationBranchToDisplayShelving == 'both' ) %] >+ <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> >+ [% END %] >+ >+ <div class="branch-info-tooltip">[% ITEM_RESULT.branch_opac_info %]</div> >+ </td> >+ [% END %] >+ >+ [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] >+ <td class="location_home"> >+ <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]"> >+ [% IF ( ITEM_RESULT.homebranchurl ) %] >+ <a href="[% ITEM_RESULT.homebranchurl %]">[% ITEM_RESULT.homebranchname %]</a> >+ [% ELSE %] >+ [% ITEM_RESULT.homebranchname %] >+ [% END %] >+ </span> >+ >+ [% IF ( OpacLocationBranchToDisplayShelving == 'home' || OpacLocationBranchToDisplayShelving == 'both' ) %] >+ <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> >+ [% END %] >+ </td> >+ [% END %] > [% ELSE %] >- <span title="">[% ITEM_RESULT.branchname %]</span> >+ <td class="location"><span class="shelvingloc">[% ITEM_RESULT.location_description %]</span></td> > [% END %] >- <div class="branch-info-tooltip">[% ITEM_RESULT.branch_opac_info %]</div> >- </div> >- [% END %] >- <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> >- </td> > [% IF ( itemdata_ccode ) %]<td class="collection">[% ITEM_RESULT.ccode %]</td>[% END %] > <td class="call_no">[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)[% END %][% END %]</td> > [% IF ( itemdata_enumchron ) %]<td class="vol_info">[% ITEM_RESULT.enumchron %]</td>[% END %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 9d0851f..a2a7564 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -1062,4 +1062,9 @@ if ( C4::Context->preference('UseCourseReserves') ) { > } > } > >+$template->param( >+ 'OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay') , >+ 'OpacLocationBranchToDisplayShelving' => C4::Context->preference('OpacLocationBranchToDisplayShelving'), >+); >+ > 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