]> git.koha-community.org Git - koha.git/commit
Bug 27945: Add limit article request feature
authorAgustin Moyano <agustinmoyano@theke.io>
Tue, 27 Jul 2021 15:20:46 +0000 (12:20 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 5 Oct 2021 09:45:20 +0000 (11:45 +0200)
commit1ccfaa0d0335382f8ba66f1d2dea5972e2116ccd
treef2e8dd92bfbd699fb2cc0e198962bf81bfacc79a
parent712bdd2c7d0b5fdc5d5dca7b25d732ae39f936ac
Bug 27945: Add limit article request feature

This patch makes it possible to limit article requests per patron per day.

To test:
1. Apply patches
2. updatedatabase
3. Enable ArticleRequests preference
4. Edit a patron category and set an article request limit to 1
CHECK => if you set the limit to anything else but a positive number or empty string, a warning appears
5. In staff search biblios and request an article for a patron of the modified category
6. Repeat step 5
SUCCESS => if limit is reached, when you select the user to request an article a warning appears saying that the limit was reached
7. Repeat steps 5 and 6 but this time in opac
SUCCESS => Patron is not allowed to request another article if limit is reached
8. prove t/db_dependent/ArticleRequests.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Edit: This patchset originally changed the 'categories' table structure
and relied on that for limit calculation. I removed all that code and
squashed into this one, as we moved everything to the circulation_rules
table.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/ArticleRequest.pm
Koha/Exceptions/ArticleRequest.pm [new file with mode: 0644]
Koha/Patron.pm
circ/request-article.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt
opac/opac-request-article.pl
t/db_dependent/ArticleRequests.t
t/db_dependent/Koha/Patron.t