Bug 29082

Summary: Add filtering methods to Koha::ArticleRequests
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle, m.de.rooy, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28684
Change sponsored?: --- Patch complexity: Trivial patch
Text to go in the release notes:
Add re-usable pre-filtered searches to the Article Requests system.
Version(s) released in:
21.11.00
Bug Depends on: 27947    
Bug Blocks: 29083    
Attachments: Bug 29082: Add filtering methods to Koha::ArticleRequests
Bug 29082: Add filtering methods to Koha::ArticleRequests
Bug 29082: Add filtering methods to Koha::ArticleRequests
Bug 29082: Add filtering methods to Koha::ArticleRequests
Bug 29082: Simplify tests

Description Tomás Cohen Arazi 2021-09-22 18:18:04 UTC
I propose to add:
- filter_by_current
- filter_by_finished

to be reused in several areas.
Comment 1 Tomás Cohen Arazi 2021-09-22 18:25:18 UTC
Created attachment 125159 [details] [review]
Bug 29082: Add filtering methods to Koha::ArticleRequests

This patch adds handy methods for filtering Koha::ArticleRequests
resultsets.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/ArticleRequests.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2021-09-22 19:18:47 UTC
*** Bug 28684 has been marked as a duplicate of this bug. ***
Comment 3 Marcel de Rooy 2021-09-23 07:57:27 UTC
Please specify on top of which bug this should be placed.
Comment 4 Tomás Cohen Arazi 2021-09-23 11:23:30 UTC
(In reply to Marcel de Rooy from comment #3)
> Please specify on top of which bug this should be placed.

No particular dependency, it is a standalone dev, self-contained.
Comment 5 Marcel de Rooy 2021-09-23 11:37:55 UTC
(In reply to Tomás Cohen Arazi from comment #4)
> (In reply to Marcel de Rooy from comment #3)
> > Please specify on top of which bug this should be placed.
> 
> No particular dependency, it is a standalone dev, self-contained.

Sure? I thought I saw a new status somewhere ;)
Comment 6 Tomás Cohen Arazi 2021-09-23 12:28:53 UTC
(In reply to Marcel de Rooy from comment #5)
> (In reply to Tomás Cohen Arazi from comment #4)
> > (In reply to Marcel de Rooy from comment #3)
> > > Please specify on top of which bug this should be placed.
> > 
> > No particular dependency, it is a standalone dev, self-contained.
> 
> Sure? I thought I saw a new status somewhere ;)

Right
Comment 7 Martin Renvoize 2021-09-24 12:52:51 UTC
Created attachment 125239 [details] [review]
Bug 29082: Add filtering methods to Koha::ArticleRequests

This patch adds handy methods for filtering Koha::ArticleRequests
resultsets.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/ArticleRequests.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2021-09-24 12:53:36 UTC
Works as expected, it well covered by tests.

Signing off
Comment 9 Nick Clemens 2021-09-24 15:14:54 UTC
Created attachment 125263 [details] [review]
Bug 29082: Add filtering methods to Koha::ArticleRequests

This patch adds handy methods for filtering Koha::ArticleRequests
resultsets.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/ArticleRequests.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Tomás Cohen Arazi 2021-10-01 22:08:58 UTC
Created attachment 125639 [details] [review]
Bug 29082: Add filtering methods to Koha::ArticleRequests

This patch adds handy methods for filtering Koha::ArticleRequests
resultsets.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/ArticleRequests.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Tomás Cohen Arazi 2021-10-01 22:09:58 UTC
Rebased on top of bug 27945 changes.
Comment 12 Jonathan Druart 2021-10-04 10:45:49 UTC
Created attachment 125691 [details] [review]
Bug 29082: Simplify tests
Comment 13 Jonathan Druart 2021-10-07 09:20:55 UTC
Pushed to master for 21.11, thanks to everybody involved!