Bug 19933

Summary: Move C4::Members::patronflags to the Koha namespace - part 1
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: enhancement    
Priority: P5 - low CC: josef.moravec, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 12001    
Bug Blocks: 16846, 19934, 20338, 19935, 21796    
Attachments: Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl
Bug 19933: Remove patronflags - In CanBookBeIssued
Bug 19933: Remove patronflags - easy ones
Bug 19933: Remove patronflags - tricky ones
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl
Bug 19933: Remove patronflags - In CanBookBeIssued
Bug 19933: Remove patronflags - easy ones
Bug 19933: Remove patronflags - tricky ones
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl
Bug 19933: Remove patronflags - In CanBookBeIssued
Bug 19933: Remove patronflags - easy ones
Bug 19933: Remove patronflags - tricky ones
Bug 19933: (follow-up) Remove patronflags - easy ones
Bug 19933: (follow-up) Remove patronflags - easy ones
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl
Bug 19933: Remove patronflags - In CanBookBeIssued
Bug 19933: Remove patronflags - easy ones
Bug 19933: Remove patronflags - tricky ones
Bug 19933: (follow-up) Remove patronflags - easy ones
Bug 19933: Move instantiation of in deletemem.pl
Bug 19933: Fix typo in template plugin name
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl
Bug 19933: Remove patronflags - In CanBookBeIssued
Bug 19933: Remove patronflags - easy ones
Bug 19933: Remove patronflags - tricky ones
Bug 19933: (follow-up) Remove patronflags - easy ones
Bug 19933: Move instantiation of in deletemem.pl
Bug 19933: Fix typo in template plugin name

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 Mark 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.
Comment 6 Jonathan Druart 2018-02-16 14:44:40 UTC
Created attachment 71803 [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 7 Jonathan Druart 2018-02-16 14:44:44 UTC
Created attachment 71804 [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 8 Jonathan Druart 2018-02-16 14:44:47 UTC
Created attachment 71805 [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 9 Jonathan Druart 2018-02-16 14:44:51 UTC
Created attachment 71806 [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 10 Jonathan Druart 2018-02-20 15:50:17 UTC
Created attachment 72004 [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 11 Jonathan Druart 2018-02-20 15:50:21 UTC
Created attachment 72005 [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 12 Jonathan Druart 2018-02-20 15:50:26 UTC
Created attachment 72006 [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 13 Jonathan Druart 2018-02-20 15:50:29 UTC
Created attachment 72007 [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 14 Jonathan Druart 2018-02-22 17:16:18 UTC
Created attachment 72094 [details] [review]
Bug 19933: (follow-up) Remove patronflags - easy ones
Comment 15 Jonathan Druart 2018-02-22 17:18:30 UTC
Created attachment 72095 [details] [review]
Bug 19933: (follow-up) Remove patronflags - easy ones
Comment 16 Kyle M Hall 2018-03-02 11:18:15 UTC
Created attachment 72350 [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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 17 Kyle M Hall 2018-03-02 11:18:23 UTC
Created attachment 72351 [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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Kyle M Hall 2018-03-02 11:18:26 UTC
Created attachment 72352 [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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Kyle M Hall 2018-03-02 11:18:29 UTC
Created attachment 72353 [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).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 20 Kyle M Hall 2018-03-02 11:18:32 UTC
Created attachment 72354 [details] [review]
Bug 19933: (follow-up) Remove patronflags - easy ones

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 21 Kyle M Hall 2018-03-02 11:18:35 UTC
Created attachment 72355 [details] [review]
Bug 19933: Move instantiation of  in deletemem.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 22 Kyle M Hall 2018-03-02 11:18:38 UTC
Created attachment 72356 [details] [review]
Bug 19933: Fix typo in template plugin name

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Josef Moravec 2018-03-06 14:06:32 UTC
Created attachment 72472 [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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 24 Josef Moravec 2018-03-06 14:06:35 UTC
Created attachment 72473 [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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 25 Josef Moravec 2018-03-06 14:06:38 UTC
Created attachment 72474 [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.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 26 Josef Moravec 2018-03-06 14:06:41 UTC
Created attachment 72475 [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).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 27 Josef Moravec 2018-03-06 14:06:45 UTC
Created attachment 72476 [details] [review]
Bug 19933: (follow-up) Remove patronflags - easy ones

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 28 Josef Moravec 2018-03-06 14:06:48 UTC
Created attachment 72477 [details] [review]
Bug 19933: Move instantiation of in deletemem.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 29 Josef Moravec 2018-03-06 14:06:51 UTC
Created attachment 72478 [details] [review]
Bug 19933: Fix typo in template plugin name

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 30 Jonathan Druart 2018-03-23 15:36:22 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 31 Nick Clemens (kidclamp) 2018-03-26 12:11:43 UTC
Enhancement, not backported for 17.11