Bug 19990

Summary: opac/opac-discharge.pl has a FIXME that can be fixed
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jwayway, katrin.fischer, kyle.m.hall, maksim.sen
Version: unspecifiedKeywords: Academy
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20953
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug-19960: FIXME $available is not needed
Bug-19960: FIXME $available is not needed
Bug 19990: Removing unnecessary variable from opac/opac-discharge.pl

Description Aleisha Amohia 2018-01-17 02:33:38 UTC
The variable $available is unnecessary and can be removed.
Comment 1 jwayway 2018-01-17 04:02:52 UTC Comment hidden (obsolete)
Comment 2 Maksim Sen 2018-02-16 21:32:41 UTC
Created attachment 71864 [details] [review]
Bug-19960: FIXME $available is not needed

Test plan:
1. Open opac-discharge.pl
2. Check that $available doesn't exist

https://bugs.koha-community.org/show_bug.cgi?id=19990
Signed-off-by: Maksim Sen <maksim@inlibro.com>
Comment 3 Katrin Fischer 2018-02-18 11:20:20 UTC
Hm, I am seeing this in the template:

[% ELSIF available %]
  <a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></li>

I think available is in use or patch is incomplete.
Comment 4 Fridolin Somers 2018-06-15 10:20:08 UTC
I see $available means discharge is validated by a librarian in staff interface, different from $pending.
Comment 5 Fridolin Somers 2018-06-15 10:47:40 UTC
(In reply to Fridolin SOMERS from comment #4)
> I see $available means discharge is validated by a librarian in staff
> interface, different from $pending.

Oh I think I get it now :

FIXME means 'available' template param could directly be Koha::Patron::Discharge::is_discharged({borrowernumber => $loggedinuser}).
Because Koha::Patron::Discharge::is_discharged() looks if discharge is validated.

Is it correct ?
Comment 6 Aleisha Amohia 2018-06-28 23:48:04 UTC
Created attachment 76554 [details] [review]
Bug 19990: Removing unnecessary variable from opac/opac-discharge.pl

To test:
1) Ensure useDischarge syspref is enabled
2) Go to OPAC, click ask for a discharge
3) Go to staff side homepage, click 'Discharge requests pending'
4) Allow Discharge
5) Go to the user's page and remove the discharge restriction
6) Apply patch and repeat steps 2-4, ensuring that all behaviour stays
the same

Sponsored-by: Catalyst IT
Comment 7 Katrin Fischer 2018-07-11 05:50:41 UTC
I think this is a duplicate of another bug in PQA (please reset if I am wrong:


Bug 20953 - Discharge can be requested several times on OPAC
>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") // ''

*** This bug has been marked as a duplicate of bug 20953 ***