Bug 19990 - opac/opac-discharge.pl has a FIXME that can be fixed
Summary: opac/opac-discharge.pl has a FIXME that can be fixed
Status: RESOLVED DUPLICATE of bug 20953
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2018-01-17 02:33 UTC by Aleisha Amohia
Modified: 2018-07-11 05:50 UTC (History)
6 users (show)

See Also:
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 (1.08 KB, patch)
2018-01-17 04:02 UTC, jwayway
Details | Diff | Splinter Review
Bug-19960: FIXME $available is not needed (1.13 KB, patch)
2018-02-16 21:32 UTC, Maksim Sen
Details | Diff | Splinter Review
Bug 19990: Removing unnecessary variable from opac/opac-discharge.pl (1.45 KB, patch)
2018-06-28 23:48 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 ***