Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules
Olli-Antti Kivilahti 51f0a0b722 Bug 13116 - Make it possible to propagate errors from C4::Reserves::CanItemBeReserved() to the web-templates.
This patch changes the way CanBookBeReserved() and CanItemBeReserved() return error
messages and how they are dealt with in the templates. This change makes it possible
to distinguish between different types of reservation failure.

Currently only two types of errors are handled, all the way to the user, from the CanItemBeReserved():
-ageRestricted
-tooManyReserves which translates to maxreserves

 #############
 - TEST PLAN -
 #############
((-- AGE RESTRICTION --))
STAFF CLIENT
1. Find a Record with Items, update the MARC Subfield 521a to "PEGI 16".
2. Get a Borrower who is younger than 16 years.
3. Place a hold for the underage Borrower for the ageRestricted Record.
4. You get a notification, that placing a hold on ageRestricted material is
   forbidden. (previously you just got a notification about maximum amount of reserves reached)

((-- MAXIMUM RESERVES REACHED --))
0. Set the  maxreserves -syspref to 3 (or any low value)
STAFF CLIENT AND OPAC
1. Make a ton of reserves for one borrower.
2. Observe the notification about maximum reserves reached blocking your reservations.

((-- MULTIPLE HOLDS STAFF CLIENT --))
3. Observe the error notification "Cannot place hold on some items"

((-- MULTIPLE HOLDS OPAC --))
1. Make a search with many results, of which atleast one is age restricted to the current borrower.
2. Select few results and "Place hold" from to result summary header element.
       (Not individual results "Place hold")
3. Observe individual Biblios getting the "age restricted"-notification, where others can be
   reserved just fine.

Updated the unit tests to match the new method return values.
t/db_dependent/Holds.t & Reserves.t

Followed test plan. Works as expected and displays meaningful messages for the reason why placing a hold is not possible.

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-12 11:23:41 -03:00
..
errors Bug 12763 [QA Followup] - Remove tabs and trailing space 2014-09-18 09:41:31 -03:00
sco Bug 12862: OPAC bootstrap - clean up language="javascript" 2014-10-18 11:13:07 -03:00
svc Bug 11951: fix OPAC search suggestions template error 2014-04-09 22:50:53 +00:00
text Bug 10309 - New OPAC theme based on Bootstrap 2013-10-14 23:13:05 +00:00
ilsdi.tt Bug 8868: Follow-up: Update boostrap documentation page 2014-09-18 09:49:25 -03:00
maintenance.tt Bug 10309 - New OPAC theme based on Bootstrap 2013-10-14 23:13:05 +00:00
opac-account.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-addbybiblionumber.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-advsearch.tt Bug 9043 [QA Followup] - Don't show "More options" are there aren't any 2014-11-10 12:25:55 -03:00
opac-alert-subscribe.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-auth-detail.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-auth-MARCdetail.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-auth.tt BUG8446, Follow up: Improve local login fallback 2014-10-16 12:27:51 -03:00
opac-authorities-home.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-authoritiessearchresultlist.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-basket.tt Bug 9214 - Show damaged status in the OPAC for items which are not for loan 2014-11-11 15:13:03 -03:00
opac-blocked.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-browser.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-course-details.tt Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC 2014-11-11 16:07:33 -03:00
opac-course-reserves.tt Bug 10632 [Follow-up] Enable datatables for courses and course details in the OPAC 2014-11-11 16:07:33 -03:00
opac-detail.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-downloadcart.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-downloadshelf.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-full-serial-issues.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-imageviewer.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-ISBDdetail.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-main.tt BUG8446, Follow up: Remove unnecessary sysprefs, move to config 2014-10-16 12:27:49 -03:00
opac-MARCdetail.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-memberentry-update-submitted.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-memberentry.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-messaging.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-mymessages.tt Bug 10309 - New OPAC theme based on Bootstrap 2013-10-14 23:13:05 +00:00
opac-opensearch.tt Bug 11308: fix RSS page in bootstrap theme 2013-11-27 15:50:19 +00:00
opac-overdrive-search.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-passwd.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-privacy.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-readingrecord.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-registration-confirmation.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-registration-email-sent.tt Bug 13095: An email will be sent shortly 2014-10-28 10:46:18 -03:00
opac-registration-invalid.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-reserve.tt Bug 13116 - Make it possible to propagate errors from C4::Reserves::CanItemBeReserved() to the web-templates. 2014-11-12 11:23:41 -03:00
opac-results-grouped.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-results.tt Bug 12974 - Argument "" isn't numeric in numeric gt (>) in opac-results.tt 2014-10-14 11:05:06 -03:00
opac-review.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-search-history.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-sendbasket.tt Bug 11357 - biblioitems.size value not correctly displayed in list emails sent from OPAC and intranet 2014-07-01 15:29:29 +12:00
opac-sendbasketform.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-sendshelf.tt Bug 11357 - biblioitems.size value not correctly displayed in list emails sent from OPAC and intranet 2014-07-01 15:29:29 +12:00
opac-sendshelfform.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-serial-issues.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-shareshelf.tt Bug 13095: An email will be sent shortly 2014-10-28 10:46:18 -03:00
opac-shelves.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-showmarc.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-showreviews-rss.tt Bug 10309 - New OPAC theme based on Bootstrap 2013-10-14 23:13:05 +00:00
opac-showreviews.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-suggestions.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-tags.tt Bug 13083 - Hard-coded " by " in opac-tags.pl 2014-10-28 09:41:17 -03:00
opac-tags_subject.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-topissues.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00
opac-user.tt Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch 2014-09-23 15:39:31 -03:00