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 its 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 equivalent 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.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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
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
('opaclanguagesdisplay','0','','If ON, enables display of Change Language feature on OPAC','YesNo'),
('opaclayoutstylesheet','opac.css','','Enter the name of the layout CSS stylesheet to use in the OPAC','free'),
('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'),
+('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'),
+('OpacLocationBranchToDisplayShelving','holding','holding|home|both','In the OPAC, display the shelving location under which which column.', 'Choice'),
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','70|10','A user-defined block of HTML in the main content area of the opac main page','Textarea'),
('OpacMainUserBlockMobile','',NULL,'Show the following HTML in its own column on the main page of the OPAC (mobile version):','free'),
SetVersion($DBversion);
}
+$DBversion = "3.13.00.XXX";
+if ( CheckVersion($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 (Bug 7720 - Ambiguity in OPAC Details location.)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
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:
<table class="holdingst">
<thead><tr>
[% IF ( item_level_itypes ) %]<th id="item_itemtype" class="itype">Item type</th>[% END %]
- <th id="item_location" class="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" class="collection">Collection</th>[% END %]
<th id="item_callnumber" class="call_no">Call number</th>
[% IF ( itemdata_enumchron ) %]<th id="item_enumchron" class="vol_info">Vol info</th>[% END %]
<tr vocab="http://schema.org/" typeof="Offer">
[% 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" property="seller">
- <link property="itemOffered" href="#record" />
- <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
- [% 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" property="seller">
+ <link property="itemOffered" href="#record" />
+ <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
+ <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" property="seller">
+ <link property="itemOffered" href="#record" />
+ <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
+
+ <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" property="sku">
[% IF ( ITEM_RESULT.itemcallnumber ) %]
}
}
+$template->param(
+ 'OpacLocationBranchToDisplay' => C4::Context->preference('OpacLocationBranchToDisplay') ,
+ 'OpacLocationBranchToDisplayShelving' => C4::Context->preference('OpacLocationBranchToDisplayShelving'),
+);
+
output_html_with_http_headers $query, $cookie, $template->output;