Bug 19933 - Move C4::Members::patronflags to the Koha namespace - part 1
Summary: Move C4::Members::patronflags to the Koha namespace - part 1
Status: CLOSED FIXED
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: Josef Moravec
URL:
Keywords:
Depends on: 12001
Blocks: 16846 19934 20338 19935 21796
  Show dependency treegraph
 
Reported: 2018-01-09 14:13 UTC by Jonathan Druart
Modified: 2018-12-05 07:53 UTC (History)
2 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 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl (2.08 KB, patch)
2018-01-09 14:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - In CanBookBeIssued (1.41 KB, patch)
2018-01-09 14:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - easy ones (7.43 KB, patch)
2018-01-09 14:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - tricky ones (13.43 KB, patch)
2018-01-09 14:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl (2.08 KB, patch)
2018-02-16 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - In CanBookBeIssued (1.40 KB, patch)
2018-02-16 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - easy ones (6.21 KB, patch)
2018-02-16 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - tricky ones (13.47 KB, patch)
2018-02-16 14:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl (2.06 KB, patch)
2018-02-20 15:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - In CanBookBeIssued (1.30 KB, patch)
2018-02-20 15:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - easy ones (5.59 KB, patch)
2018-02-20 15:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - tricky ones (13.35 KB, patch)
2018-02-20 15:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: (follow-up) Remove patronflags - easy ones (1021 bytes, patch)
2018-02-22 17:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: (follow-up) Remove patronflags - easy ones (1.29 KB, patch)
2018-02-22 17:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl (2.11 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - In CanBookBeIssued (1.35 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - easy ones (5.62 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - tricky ones (13.38 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: (follow-up) Remove patronflags - easy ones (1.46 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: Move instantiation of in deletemem.pl (1.53 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: Fix typo in template plugin name (1.11 KB, patch)
2018-03-02 11:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - unused vars oldamount/amountold in circulation.pl (2.16 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - In CanBookBeIssued (1.41 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - easy ones (5.67 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19933: Remove patronflags - tricky ones (13.43 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19933: (follow-up) Remove patronflags - easy ones (1.51 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19933: Move instantiation of in deletemem.pl (1.58 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19933: Fix typo in template plugin name (1.16 KB, patch)
2018-03-06 14:06 UTC, Josef Moravec
Details | Diff | 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 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 2018-03-26 12:11:43 UTC
Enhancement, not backported for 17.11