Koha/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
Owen Leonard 480a445991 Bug 16490 - Add an "add to cart" link for each search results in the staff client
This patch adds an "add to cart" link to each line of search results in
the staff client.

To test, apply the patch and clear your browser cache if necessary.

- Enable the intranetbookbag system preference.
- Perform a search which will return multiple search results.
- Each result should have an "Add to cart" link.
  - Clicking the "Add to cart" link should add the title to the cart,
    triggering the correct pop-up message and changing the link to read
    "In your cart (remove)."
  - Clicking the "remove" link should remove the title from your cart
    and trigger the correct messages.
- Add multiple titles to your cart and perform the same search again.
  Each result should correctly indicate which titles are already in your
  cart.
- Open the cart popup window.
  - Check the checkbox for one or more titles in your cart and choose
    "Remove." The titles should be removed, and the "In your cart" label
    in the search results page should reflect that the titles are no
    longer in the cart.
  - Choose "Empty and close." All titles in the parent page should now
    indicate that they are not in the cart.
- Disable the intranetbookbag preference and confirm that the "Add to
  cart" links are no longer there.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 13:45:41 +00:00

105 lines
4.7 KiB
HTML

[% USE Koha %]
[% USE AudioAlerts %]
[% USE String %]
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[%# Prevent XFS attacks -%]
[% UNLESS popup %]
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
[% END %]
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.css" />
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" />
[% INCLUDE intranetstylesheet.inc %]
[% IF ( bidi ) %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />[% END %]
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script>
<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script>
<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script>
[% IF ( login ) %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/login.css" />
[% END %]
[% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %]
<!-- koha core js -->
<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script>
[% INCLUDE 'validator-strings.inc' %]
[% IF ( IntranetUserJS ) %]
<script type="text/javascript">
//<![CDATA[
[% IntranetUserJS %]
//]]>
</script>
[% END %]
[% IF ( virtualshelves || intranetbookbag ) %]
<script type="text/javascript">
//<![CDATA[
var MSG_BASKET_EMPTY = _("Your cart is currently empty");
var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
var MSG_RECORD_ADDED = _("This item has been added to your cart");
var MSG_NRECORDS_ADDED = _("%s item(s) added to your cart");
var MSG_NRECORDS_IN_BASKET = _("%s already in your cart");
var MSG_NO_RECORD_SELECTED = _("No item was selected");
var MSG_NO_RECORD_ADDED = _("No item was added to your cart (already in your cart)!");
var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
var MSG_IN_YOUR_CART = _("Items in your cart: %s");
var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved.");
var MSG_ITEM_NOT_IN_CART = _("Add to cart");
var MSG_ITEM_IN_CART = _("In your cart");
var MSG_RECORD_REMOVED = _("The item has been removed from your cart");
//]]>
</script>
<script type="text/javascript" src="[% interface %]/[% theme %]/js/basket.js"></script>
[% END %]
[% IF LocalCoverImages %]
<script type="text/javascript" src="[% interface %]/[% theme %]/js/localcovers.js"></script>
<script type="text/javascript">
//<![CDATA[
var NO_LOCAL_JACKET = _("No cover image available");
//]]>
</script>
[% END %]
[% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %]
<script type="text/javascript">
//<![CDATA[
var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/';
var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) %]' );
//]]>
$( document ).ready(function() {
if ( AUDIO_ALERTS ) {
for ( var k in AUDIO_ALERTS ) {
var alert = AUDIO_ALERTS[k];
if ( $( alert.selector ).length ) {
playSound( alert.sound );
break;
}
}
}
});
</script>
[% END %]