From f9915f42c2789c6c3e76fb7fea4ffaa6bca22dc9 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 15 Mar 2012 10:27:12 -0400 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. --- C4/Items.pm | 11 ++++++- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 31 ++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index b257e52..7f5c04c 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1185,7 +1185,8 @@ sub GetItemsInfo { items.notforloan as itemnotforloan, itemtypes.description, itemtypes.notforloan as notforloan_per_itemtype, - holding.branchurl + holding.branchurl, + 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 @@ -1237,6 +1238,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/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 7af60a0..44bdff5 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -580,7 +580,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( item_level_itypes ) %][% END %] - + + [% UNLESS ( singleBranchMode ) %][% END %] [% IF ( itemdata_ccode ) %][% END %] [% IF ( itemdata_enumchron ) %][% END %] @@ -592,7 +593,33 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% FOREACH ITEM_RESULT IN ITEM_RESULTS %] [% IF ( item_level_itypes ) %][% END %] - + + + [% UNLESS ( singleBranchMode ) %] + + [% END %] + [% IF ( itemdata_ccode ) %][% END %] [% IF ( itemdata_enumchron ) %][% END %] -- 1.7.2.5
Item typeLocationCurrent LocationHome LibraryCollectionCall NumberVol Info
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% ITEM_RESULT.description %][% END %][% END %] [% ITEM_RESULT.description %][% UNLESS ( singleBranchMode ) %][% IF ( ITEM_RESULT.branchurl ) %][% ITEM_RESULT.branchname %][% ELSE %][% ITEM_RESULT.branchname %][% END %][% END %] [% ITEM_RESULT.location_description %] + [% UNLESS ( singleBranchMode ) %] + [% IF ( ITEM_RESULT.branchurl ) %] + [% ITEM_RESULT.branchname %] + [% ELSE %] + [% ITEM_RESULT.branchname %] + [% END %] + + [% END %] + + [% IF ( singleBranchMode ) %] + [% ITEM_RESULT.location_description %] + [% END %] + + [% IF ( ITEM_RESULT.homebranchurl ) %] + [% ITEM_RESULT.homebranchname %] + [% ELSE %] + [% ITEM_RESULT.homebranchname %] + [% END %] + + [% ITEM_RESULT.location_description %] + [% ITEM_RESULT.ccode %][% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (Browse Shelf)[% END %][% END %][% ITEM_RESULT.enumchron %]