Bug 3215 [REBASED] It would be nice if "Add to Cart" changed to "Remove from Cart"
authorOwen Leonard <oleonard@myacpl.org>
Fri, 20 Jan 2012 20:28:09 +0000 (15:28 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 27 Feb 2012 11:12:07 +0000 (12:12 +0100)
commit95ead9a42be498da827812e64795f403f4f9e6c7
tree31a38a20d2db7c6154e0ac0d159745716757dd53
parentf7a525fa09008d98340739bd930fc48debcd306f
Bug 3215 [REBASED] It would be nice if "Add to Cart" changed to "Remove from Cart"

"Add to Cart" links in the OPAC should reflect whether a title
is already in the Cart. On the results, list, and detail pages
the "Add to Cart" link will say "In your cart (remove)" if the
title is in your cart. The "(remove)" link will remove the title.

This patch adds a check of the biblionumbers in the cart to the
relevant scripts and sets a variable for the template governing
whether to show "Add to cart" or "In your cart."

Pages to test:

  - the search results page
  - any detail page (normal, MARC, ISBD)
  - any list contents page (/cgi-bin/koha/opac-shelves.pl?viewshelf=XX)

Situations to test:

- Add a single item to the Cart from the above pages

The link should change from "Add to cart" to "In your cart (remove)"
The count of items in your cart should reflect the addition, and the
notification box should appear.

- Remove a single item from the Cart from the above pages

The link should change from "In your cart (remove)" to "Add to cart."
The count of items in your cart should reflect the removal, and the
notification box should appear.

- View an item which is already in the cart from the above pages

The cart links should reflect whether the title is already in the cart.

- Remove one or more items from the Cart via the cart pop-up window

View the above pages as you do so to verify that the operation is
reflected immediately by the state of the "in your cart" links.

- Empty the Cart from the cart pop-up window

View the above pages as you do so to verify that the operation is
reflected immediately by the state of the "in your cart" links.

Tested in Firefox 9, Chrome 16, IE 7, and Opera 11.6 on Win 7

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/VirtualShelves/Page.pm
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc
koha-tmpl/opac-tmpl/prog/en/js/basket.js
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
opac/opac-ISBDdetail.pl
opac/opac-MARCdetail.pl
opac/opac-detail.pl
opac/opac-search.pl