The variable $available is unnecessary and can be removed.
Created attachment 70599 [details] [review] Bug-19960: FIXME $available is not needed Test plan: 1. Open opac-discharge.pl 2. Check that $available doesn't exist
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>
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.
I see $available means discharge is validated by a librarian in staff interface, different from $pending.
(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 ?
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
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 ***