Koha/opac
Fridolin Somers d421cfaed5 Bug 20953: Prevent several discharge requests on OPAC
On OPAC, a user can requested a discharge even if one is already pending.
This generates several pending discharges in staff interface that can not be deleted.

This is because request operation leads to page 'opac-discharge.pl?op=request' and user can refresh this page performing a new request.

Perl code must check that operation is allowed.

Patch reoganised the code so that the following FIXME is obsolete :
  'FIXME looks like $available is not needed'
Patch also replaces 'op' arg test to also check undef : input->param("op") // ''

Test plan :
1) Set system preference 'useDischarge' to 'Allow'
2) Choose a patron without checkouts nor fines nor restrictions
3) Log at OPAC and go to patron page /cgi-bin/koha/opac-user.pl
4) Click on 'ask for a discharge' tab
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'What is a discharge? ...'
5) Click on 'Ask for a discharge' link
   => You see /cgi-bin/koha/opac-discharge.pl?op=request
      with text 'Your discharge request has been sent ...'
6) In a new browser tab/page, go to intranet on /cgi-bin/koha/members/discharges.pl
   => You see one discharge requets for the patron
7) Come back to OPAC and refresh page
   => You see /cgi-bin/koha/opac-discharge.pl
   with text 'Your discharge will be available on this page within a few days.'
8) Come back to intranet and refresh /cgi-bin/koha/opac-discharge.pl
   => There is still one requets for the patron
9) Come back to OPAC and enter URL /cgi-bin/koha/opac-discharge.pl?op=get
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'Your discharge will be available on this page within a few days.'
10) Come back to intranet and refresh /cgi-bin/koha/opac-discharge.pl
   => There is still one requets for the patron
11) Click on 'allow' on patron discharge request
12) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
    => You see link 'Get your discharge'
13) enter URL /cgi-bin/koha/opac-discharge.pl?op=request
    => You see same page and no new discharge requets is created
14) Come back to intranet on patron details page
15) Remove the discharge restriction
16) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
    => You see text 'What is a discharge?...'
17) enter URL /cgi-bin/koha/opac-discharge.pl?op=get
    => You see same page and no new discharge requets is created

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-07-13 10:34:28 +00:00
..
clubs
errors
external/overdrive
rss
sci Bug 15492: (QA followup) Make page refresh work correctly 2018-03-26 17:31:19 -03:00
sco Bug 19935: Replace GetPendingIssues - sco-main 2018-04-03 11:43:38 -03:00
svc Bug 20495: (follow-up) Correct search for report by name 2018-07-02 12:06:54 +00:00
ilsdi.pl Bug 13990: ILS-DI LookupPatron requires ID Type 2018-01-30 14:18:21 -03:00
maintenance.pl Bug 17989: Include full path logic in _get_template_file 2017-11-01 13:10:17 -03:00
oai.pl
opac-account-pay-paypal-return.pl
opac-account-pay-return.pl
opac-account-pay.pl
opac-account.pl Bug 12001: Move GetMemberAccountRecords to the Koha namespace 2018-02-23 10:57:30 -03:00
opac-addbybiblionumber.pl
opac-alert-subscribe.pl Bug 19855: Move getalert, addalert and delalert to Koha::Subscription 2018-04-23 14:22:15 -03:00
opac-article-request-cancel.pl
opac-authorities-home.pl
opac-authoritiesdetail.pl
opac-basket.pl Bug 19708: Improve code for printing the cart in OPAC 2018-03-26 17:31:16 -03:00
opac-blocked.pl
opac-browser.pl
opac-changelanguage.pl
opac-course-details.pl
opac-course-reserves.pl
opac-detail.pl Bug 20737: Use https for baker and taylor cover images 2018-05-11 11:36:23 -03:00
opac-discharge.pl Bug 20953: Prevent several discharge requests on OPAC 2018-07-13 10:34:28 +00:00
opac-downloadcart.pl
opac-downloadshelf.pl
opac-export.pl Bug 20097: Use same regex in marc2dcxml and opac-export 2018-03-19 12:23:19 -03:00
opac-ics.pl Bug 19935: Replace GetPendingIssues - opac-ics.pl 2018-04-03 11:43:38 -03:00
opac-idref.pl Bug 19640: fix OPAC IdRef webservice display 2017-12-07 09:37:09 -03:00
opac-illrequests.pl Bug 20284: Fix minor compilation errors 2018-05-07 11:55:01 -03:00
opac-image.pl
opac-imageviewer.pl
opac-ISBDdetail.pl Bug 19301: Move C4::Reserves::OnShelfHoldsAllowed to get_onshelfholds_policy 2018-02-13 13:36:00 -03:00
opac-issue-note.pl Bug 18915: Fix checkout note email message 2018-01-15 12:14:00 -03:00
opac-main.pl Bug 19892: Replace numbersphr variable with Koha.Preference('OPACNumbersPreferPhrase') in OPAC 2018-04-02 18:08:07 -03:00
opac-MARCdetail.pl Bug 19301: (QA follow-up) Add POD, use statements and correct typo 2018-02-13 13:36:00 -03:00
opac-memberentry.pl Bug 18403: Add new methods Koha::Patrons->search_limited and use it where needed 2018-02-12 15:41:39 -03:00
opac-messaging.pl
opac-modrequest-suspend.pl
opac-modrequest.pl
opac-mymessages.pl
opac-news-rss.pl
opac-overdrive-search.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
opac-passwd.pl Bug 18298: Add server-side checks and refactor stuffs 2017-10-16 09:44:32 -03:00
opac-password-recovery.pl Bug 18956: Fix empty to in message queue 2017-10-27 13:57:10 -03:00
opac-patron-image.pl
opac-privacy.pl Bug 20363: (bug 16966 follow-up) better messages handling 2018-04-23 14:22:16 -03:00
opac-ratings-ajax.pl
opac-ratings.pl
opac-readingrecord.pl
opac-registration-verify.pl Bug 19579: Do not confirm the registration if email already used - PatronSelfRegistrationEmailMustBeUnique 2018-05-11 10:52:46 -03:00
opac-renew.pl
opac-request-article.pl
opac-reserve.pl Bug 20724: (QA follow-up) Remove two obsolete comment lines 2018-05-16 10:53:13 -03:00
opac-restrictedpage.pl
opac-retrieve-file.pl
opac-review.pl Bug 19843: (bug 15839 follow-up) Set reviews.datereviewed when the review is made 2017-12-21 11:07:51 -03:00
opac-routing-lists.pl Bug 20666: Correct permissions on opac-routing-lists.pl 2018-05-03 13:26:48 -03:00
opac-search-history.pl Bug 12497: Fix OPAC search history reachable by URL even when disabled 2017-12-07 10:09:52 -03:00
opac-search.pl Bug 19502: Retrieve index.max_result_window from ES 2018-07-12 13:04:21 +00:00
opac-sendbasket.pl Bug 18975: Retrieve up-to-date CGISESSID when just logged in 2018-02-18 14:47:42 -03:00
opac-sendshelf.pl
opac-serial-issues.pl Bug 19855: Move getalert, addalert and delalert to Koha::Subscription 2018-04-23 14:22:15 -03:00
opac-shareshelf.pl Bug 20687: (follow-up) Look for invitekey in show_accept and fix error codes 2018-05-07 11:55:13 -03:00
opac-shelves.pl Bug 19301: Move C4::Reserves::OnShelfHoldsAllowed to get_onshelfholds_policy 2018-02-13 13:36:00 -03:00
opac-showmarc.pl Bug 20083: (follow-up) use same logic in opac-showmarc 2018-04-04 15:45:34 -03:00
opac-showreviews.pl Bug 19808: Handle deleted reviewers gracefully - opac-showreview 2017-12-21 11:07:37 -03:00
opac-suggestions.pl Bug 20763: Remove unecessary Koha::Patron fetch 2018-06-04 12:58:53 +00:00
opac-tags.pl
opac-tags_subject.pl
opac-topissues.pl
opac-user.pl Bug 17153: Redirect to search when logging in from search 2018-06-29 20:49:51 +00:00
tracklinks.pl Bug 20218: Fix matching of uri in tracklinks 2018-02-27 15:58:32 -03:00
unapi Bug 19439: (follow-up) Remove four spaces from lines 133-149 2017-12-11 11:34:24 -03:00