LP1431055 Content Cafe optionally opens in new tab user/ldw/LP1431055
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 30 May 2014 23:24:32 +0000 (16:24 -0700)
committerLiam Whalen <liam.whalen@bc.libraries.coop>
Thu, 9 Apr 2015 17:48:00 +0000 (10:48 -0700)
commitda48848fddb4815db94ec88f9ea1db30ccbd98c6
tree061272bbeeae095d5beb9d5cfaec63d7f3518625
parent962902632bcd6bbbca30813d289e439a15f068eb
LP1431055  Content Cafe optionally opens in new tab

Currently, when a user clicks on the Reviews & More links in the search
results, a new window is opened that displays the Content Cafe data.
This is a problem for two reasons.  1. The Content Cafe username and
password are contained in the URL of the window that is opened.  2. Some
libraries hvae touch screen systems, and when a new window is opened it
interferes with the touch screen interface.

This modification allows Reviews & More links from the search results
to be opened in a new tab.  To do this, a new boolean org unit
setting has been created.

The new setting is opac.reviews_and_more_new_tab.

The ctx.get_org_setting(org_id, setting) function returns the current
value of opac.reviews_and_more_new_tab.  If that setting is set to
true, then the TPAC inserts target='_blank' into the URL.  Or in the
case of the staff client, it opens in a new Staff Client window.
In the case of touchscreen kiosks, libraries would have this setting
at false, so their touch screen system keeps operating in the current
window when users touch the Reviews & More links.

In order to get the correct org_id for ctx.get_org_setting() call when
using the Staff Client, I had to add a ctx.ws_ou variable to
EGCatLoader.pm.  This uses the value taken from the staff client login.
The Staff Client cannot use the physical_loc variable because it is based
on an Apache ENV variable set in the /etc/apache2/includes/ TPAC skin
files, and unless the host used in the staff client has the relevant short
name appended to it, the physical_loc value will be set to 1 for the
consortia.

Additionally, when there is no isbn or upc for Content Cafe to identify
the item, the Summaries & More drop down is not displayed.  This is
confusing for users who click the Reviews & More link in the search
results because it takes them to a page without any information
pertaining to the link they clicked.

If Apache has the OILS_CONTENT_CAFE_USER environment variable set in
eg_vhost.conf, then this commit displays the Summaries and More tab
with the following localized comment: 'There are currently no reviews
available for this title'.  Otherwise, the Summaries and More tab is
ommited from the record details.

Furthermore, the summaries for an item are stored in attrs.summaries.
The code in summaryplus.tt2 was checking for the existence of
attrs.summary, which does not exist, so it was always excluding
summaries from the record details under the Summaries & More tab.

This commit fixes that typo, which allows summaries to be
displayed.

However, only the first value in a 520 field is being passed as a
summary for records to display in the Abstract field and the Summaries
& More tab.  But, the Summaries & More tab is expecting to display
all the 520 values.

So, this commit also modifies misc_util.tt2 to return all 520 values
when any are present.  Currently, it only returns the first 520 value
when any are present.

Next, the Abstract field in summary.tt2 is modified to only display the
first 520 to keep that information brief.

This allows summaryplus.tt2 to display all the 520 values in the
Summaries & More tab.

Additionally, the Summaries & More tab has been renamed Reviews & More,
so that it is consistent with the link in the results page.  Reviews &
More was chosen because it is shorter than Summaries & More.

Finally, by default no 520 values are displayed in Summaries & More.
However, the code to do so is included in comments in case a library
wishes to display all 520 values.

Signed-off-by: Liam Whalen <liam.whalen@bc.libraries.coop>
Conflicts:

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

The occurance of Reviews & More was displaying as Reviews &amp; More.
This has been corrected.  The TT2 localization seems to properly display
& now without needing to use the HTML code for it.  In fact, it appears
that the TT2 localization no longer translates the HTML code for &.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Conflicts:
Open-ILS/src/templates/opac/parts/record/extras.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting.reviews_and_more_new_tab.sql [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/src/templates/opac/parts/record/extras.tt2
Open-ILS/src/templates/opac/parts/record/summaryplus.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2