Bug 31289

Summary: Hide article requests column in circulation rules when ArticleRequests syspref is disabled
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: System AdministrationAssignee: Caroline Cyr La Rose <caroline.cyr-la-rose>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, lucas, tomascohen, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/679
Text to go in the release notes:
Version(s) released in:
22.11.00,22.05.06,21.11.12
Attachments: Bug 31289: Hide Article requests column in circulation rules when ArticleRequests syspref is disabled
Bug 31289: Hide Article requests column in circulation rules when ArticleRequests syspref is disabled
Bug 31289: Hide Article requests column in circulation rules when ArticleRequests syspref is disabled

Description Caroline Cyr La Rose 2022-08-03 13:42:50 UTC
Hi!

Some rules are hidden when a syspref is disabled (like the rules for recalls, and the article request fee and limit of open article requests), but even if the ArticleRequests system preference is disabled, there is still an "Article requests" column in the big circulation rules matrix.
Like the recalls rules and the other article requests rules, this column should be hidden if the system preference is disabled.

To reproduce:
1) With ArticleRequests disabled, go to Administration > Circulation and fines rules
2) Scroll right in the first table
--> There should be an article requests yes/no column (this should be hidden)
3) Scroll down to see the other tables in the page
--> There are no other article requests tables (this is ok)
4) Enable ArticleRequests in Administration > System preferences
5) Go back to the Circulation and fines rules and refresh the page
6) 2) Scroll right in the first table
--> There should be an article requests yes/no column (this is ok)
7) Scroll down to see the other tables in the page
--> There are other article requests tables, Default open article requests limit and Default article request fees (this is ok)

At step 2, users don't need to see the Article request column since the system preference is disabled.
Comment 1 Caroline Cyr La Rose 2022-08-03 13:59:00 UTC Comment hidden (obsolete)
Comment 2 Caroline Cyr La Rose 2022-08-03 14:00:28 UTC
I did some copy-pasting from the UseRecalls mentions in smart-rules.tt... I hope it's ok
Comment 3 Owen Leonard 2022-08-03 15:29:15 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2022-08-05 11:03:46 UTC
Please don't forget to set Assignee! :)
Comment 5 Katrin Fischer 2022-08-05 12:35:44 UTC
Created attachment 138688 [details] [review]
Bug 31289: Hide Article requests column in circulation rules when ArticleRequests syspref is disabled

This patch hides the Article requests column in the large circulation
rules table when the ArticleRequests system preference is disabled.

To test:
0) Apply patch
1) With ArticleRequests disabled, go to Administration > Circulation and fines
   rules
2) Scroll right in the first table
--> There isn't any mention of article requests in the table
3) Scroll down to see the other tables in the page
--> There are no other article requests tables
4) Enable ArticleRequests in Administration > System preferences
5) Go back to the Circulation and fines rules and refresh the page
6) Scroll right in the first table
--> There should be an article requests yes/no column
7) Scroll down to see the other tables in the page
--> There are other article requests tables, Default open article requests
    limit and Default article request fees

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 6 Katrin Fischer 2022-08-05 12:37:44 UTC
This makes things more consistent and simplifies for those not using Article requests, so I am going to pass it.

There might be some discussion to be had if it makes sense to be able to configure a feature without having it exposed to users immediately. But that's complicated and should probably be a general decision (maybe something like having 3 options for the prefs? (Enable config|Enable feature|Disable)
Comment 7 Tomás Cohen Arazi 2022-08-05 14:58:37 UTC
(In reply to Katrin Fischer from comment #6)
> This makes things more consistent and simplifies for those not using Article
> requests, so I am going to pass it.
> 
> There might be some discussion to be had if it makes sense to be able to
> configure a feature without having it exposed to users immediately. But
> that's complicated and should probably be a general decision (maybe
> something like having 3 options for the prefs? (Enable config|Enable
> feature|Disable)

With the new table (circulation_rules) and the granularity it provides, I think we should move article requests-specific rules to their own section, and probably collapse them by default if the feature is disabled, but editable. For the same reasons you mentioned.
Comment 8 Katrin Fischer 2022-08-05 15:14:55 UTC
Article request is only one column - so I think we should not start the discussion here. Having separate for all suspension/fine, holds, recalls etc. would certainly make sense, but this is a small enhancement that fits the current pattern well.

The other is reopening the discussion on a new editor for circulation rules, which is needed, but out of scope.
Comment 9 Tomás Cohen Arazi 2022-08-05 17:55:16 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Lucas Gass 2022-09-29 17:10:35 UTC
Backported to 22.05.x for 22.05.06
Comment 11 Victor Grousset/tuxayo 2022-10-13 16:22:02 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.
Maybe something to document.
Comment 12 Arthur Suzuki 2022-10-22 22:09:44 UTC
Thanks!

Pushed to 21.11 for 21.11.12