Bug 19933 - Move C4::Members::patronflags to the Koha namespace - part 1
Summary: Move C4::Members::patronflags to the Koha namespace - part 1
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 12001
Blocks: 16846 19934 19935
  Show dependency treegraph
 
Reported: 2018-01-09 14:13 UTC by Jonathan Druart
Modified: 2018-01-09 17:29 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl (2.08 KB, patch)
2018-01-09 14:24 UTC, Jonathan Druart
Details | Splinter Review
Bug 19933: Remove patronflags - In CanBookBeIssued (1.41 KB, patch)
2018-01-09 14:24 UTC, Jonathan Druart
Details | Splinter Review
Bug 19933: Remove patronflags - easy ones (7.43 KB, patch)
2018-01-09 14:24 UTC, Jonathan Druart
Details | Splinter Review
Bug 19933: Remove patronflags - tricky ones (13.43 KB, patch)
2018-01-09 14:25 UTC, Jonathan Druart
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-01-09 14:13:05 UTC
C4::Members::patronflags does a lot of things and most of the time they are not even used by the callers.
We should split this subroutine and fetch only the data we need.
Comment 1 Jonathan Druart 2018-01-09 14:24:53 UTC
Created attachment 70347 [details] [review]
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl

There is oldamound/amountold variable that is sent to the template but
never used later. Let remove it now to avoid useless replacement.
Comment 2 Jonathan Druart 2018-01-09 14:24:56 UTC
Created attachment 70348 [details] [review]
Bug 19933: Remove patronflags - In CanBookBeIssued

The change is trivial here, we only want to pass gonenoaddress, lost and
is_debared to the template.
Comment 3 Jonathan Druart 2018-01-09 14:24:59 UTC
Created attachment 70349 [details] [review]
Bug 19933: Remove patronflags - easy ones

This patch replaces the easy occurrences of patronflags.

These calls only need the CHARGES->amount value, that is the non issues
charges. Luckily we now have a Koha::Account->non_issues_charges that
deal with that.
Comment 4 Jonathan Druart 2018-01-09 14:25:03 UTC
Created attachment 70350 [details] [review]
Bug 19933: Remove patronflags - tricky ones

Here we are, patronflags is used in a couple of places where (almost) all flags
were really useful: C4::SIP::ILS::Patron->new and circulation.pl

This patch only deal with the circulation code as I am not convident
enough with SIP code.

The change does not seems trivial because of the complexity of the
existing code, but the logic is the same. We send a variable to the
template depending on the situation of the patron.

I guess only code eyes ball could catch issue in this patch quickly.

Maybe we need to find a good place in a Koha module to move this code
and provide code coverage (especially when C4::SIP::ILS::Patron will
reuse it).
Comment 5 M. Tompsett 2018-01-09 17:29:06 UTC
Comment on attachment 70348 [details] [review]
Bug 19933: Remove patronflags - In CanBookBeIssued

Review of attachment 70348 [details] [review]:
-----------------------------------------------------------------

Nice.