Bug 29194 - Patron messaging preferences should be logically ordered
Summary: Patron messaging preferences should be logically ordered
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Sam Lau
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 28153
Blocks: 37498
  Show dependency treegraph
 
Reported: 2021-10-08 12:45 UTC by Nick Clemens (kidclamp)
Modified: 2024-11-19 14:32 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This changes the sequence of the notices in the messaging preferences table to be more logical and roughly chronological.
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 29194: Create logical ordering of patron messaging preferences (2.13 KB, patch)
2024-07-26 16:46 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 29194: Create logical ordering of patron messaging preferences (2.18 KB, patch)
2024-07-26 18:37 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 29194: Create logical ordering of patron messaging preferences (2.33 KB, patch)
2024-10-08 14:44 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2021-10-08 12:45:23 UTC
Bug 28153 comment 3 suggests the preferences should be ordered

Alphabetical could differ in different languages, and I think that would be confusing

I would suggest a 'logical' ordering - Holds options together, ILL options together, and item option in process order: Checkout, Predue, Due, Checkin

Currently the table is ordered by 'message_attribute_id' and these is not a simple way to sort as desired
Comment 1 Katrin Fischer 2023-06-24 20:07:07 UTC
+1
Comment 2 Magnus Enger 2024-06-26 07:03:35 UTC
+1
Comment 3 Sam Lau 2024-07-26 16:46:02 UTC
Created attachment 169763 [details] [review]
Bug 29194: Create logical ordering of patron messaging preferences

This patch introduces a default ordering for patron messaging preferences. The prefs are then sorted by this ordering before being displayed.

To test:
1) Visit a patrons detail page.
2) Note the message prefs aren't ordered (or rather sorted by 'message_attribute_id')
3) Apply patch, restart_all
4) Ensure they are now sorted in teh following fashion:
        'Hold_Filled'      => 1,
        'Hold_Reminder'    => 2,
        'Recall_Requested' => 3,
        'Recall_Waiting'   => 4,
        'Ill_ready'        => 5,
        'Ill_unavailable'  => 6,
        'Ill_update'       => 7,
        'Item_Checkout'    => 8,
        'Auto_Renewals'    => 9,
        'Advance_Notice'   => 10,
        'Item_Due'         => 11,
        'Item_Check_in'    => 12
Comment 4 Sam Lau 2024-07-26 16:52:23 UTC
This should probably be configurable also, filed Bug 37498 for that additional feature.
Comment 5 Roman Dolny 2024-07-26 18:37:30 UTC
Created attachment 169772 [details] [review]
Bug 29194: Create logical ordering of patron messaging preferences

This patch introduces a default ordering for patron messaging preferences. The prefs are then sorted by this ordering before being displayed.

To test:
1) Visit a patrons detail page.
2) Note the message prefs aren't ordered (or rather sorted by 'message_attribute_id')
3) Apply patch, restart_all
4) Ensure they are now sorted in teh following fashion:
        'Hold_Filled'      => 1,
        'Hold_Reminder'    => 2,
        'Recall_Requested' => 3,
        'Recall_Waiting'   => 4,
        'Ill_ready'        => 5,
        'Ill_unavailable'  => 6,
        'Ill_update'       => 7,
        'Item_Checkout'    => 8,
        'Auto_Renewals'    => 9,
        'Advance_Notice'   => 10,
        'Item_Due'         => 11,
        'Item_Check_in'    => 12

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 6 Marcel de Rooy 2024-08-16 07:53:12 UTC
(In reply to Nick Clemens (kidclamp) from comment #0)
> Bug 28153 comment 3 suggests the preferences should be ordered
> 
> Alphabetical could differ in different languages, and I think that would be
> confusing

Not sure why. A staff user will normally use one particular language, I suppose.

> Currently the table is ordered by 'message_attribute_id' and these is not a
> simple way to sort as desired

True.

(In reply to Sam Lau from comment #3)
> 4) Ensure they are now sorted in teh following fashion:
>         'Hold_Filled'      => 1,
>         'Hold_Reminder'    => 2,
>         'Recall_Requested' => 3,
>         'Recall_Waiting'   => 4,
>         'Ill_ready'        => 5,
>         'Ill_unavailable'  => 6,
>         'Ill_update'       => 7,
>         'Item_Checkout'    => 8,
>         'Auto_Renewals'    => 9,
>         'Advance_Notice'   => 10,
>         'Item_Due'         => 11,
>         'Item_Check_in'    => 12

This creates maintenance. For each new notice we need to edit this list. While just sorting by name is simple and effective here imo.
Comment 7 Nick Clemens (kidclamp) 2024-08-28 11:26:20 UTC
(In reply to Marcel de Rooy from comment #6)
> (In reply to Nick Clemens (kidclamp) from comment #0)
> > Bug 28153 comment 3 suggests the preferences should be ordered
> > 
> > Alphabetical could differ in different languages, and I think that would be
> > confusing
> 
> Not sure why. A staff user will normally use one particular language, I
> suppose.

I think assuming there are bilingual staff in some libraries is not a stretch. The point was really that it won't be a logical grouping if alphabetical


> (In reply to Sam Lau from comment #3)
> > 4) Ensure they are now sorted in teh following fashion:
> >         'Hold_Filled'      => 1,
> >         'Hold_Reminder'    => 2,
> >         'Recall_Requested' => 3,
> >         'Recall_Waiting'   => 4,
> >         'Ill_ready'        => 5,
> >         'Ill_unavailable'  => 6,
> >         'Ill_update'       => 7,
> >         'Item_Checkout'    => 8,
> >         'Auto_Renewals'    => 9,
> >         'Advance_Notice'   => 10,
> >         'Item_Due'         => 11,
> >         'Item_Check_in'    => 12
> 
> This creates maintenance. For each new notice we need to edit this list.
> While just sorting by name is simple and effective here imo.

We will sort any new ones to the bottom if not specified here:
sort { ( $messaging_order{ $a->{message_name} } // 999 ) <=> ( $messaging_order{ $b->{message_name} } // 999 ) }

It is 'maintenance' to force specifying an order here, but I think it is worth it for having a sensical order
Comment 8 Katrin Fischer 2024-08-28 13:45:02 UTC
+1 for logical ordering over alphabetical. Alphabetical really has no meaning in a short list, because you are going to browse it by functional aspects more likely and it's a short list still. 

Maybe we could add something a grouping and sort alphabetical within?

Groups could be ill, holds, circulation, etc.
Comment 9 Marcel de Rooy 2024-08-28 14:28:59 UTC
I do not really mind but personally the alphabetical one seems the best. No problem.
Comment 10 Katrin Fischer 2024-08-28 15:33:46 UTC
But then we need to sort on translation in the templates... and the sequence will vary for everyone.
Comment 11 Magnus Enger 2024-08-29 06:05:08 UTC
(In reply to Katrin Fischer from comment #10)
> But then we need to sort on translation in the templates... and the sequence
> will vary for everyone.

That's the same problem as the tabs with the syspref categories. Nice and alphabetical in English, random when translated. :-)
Comment 12 Katrin Fischer 2024-08-29 08:27:27 UTC
(In reply to Magnus Enger from comment #11)
> (In reply to Katrin Fischer from comment #10)
> > But then we need to sort on translation in the templates... and the sequence
> > will vary for everyone.
> 
> That's the same problem as the tabs with the syspref categories. Nice and
> alphabetical in English, random when translated. :-)

Exactly.
Comment 13 Marcel de Rooy 2024-10-08 14:44:29 UTC
Created attachment 172529 [details] [review]
Bug 29194: Create logical ordering of patron messaging preferences

This patch introduces a default ordering for patron messaging preferences. The prefs are then sorted by this ordering before being displayed.

To test:
1) Visit a patrons detail page.
2) Note the message prefs aren't ordered (or rather sorted by 'message_attribute_id')
3) Apply patch, restart_all
4) Ensure they are now sorted in teh following fashion:
        'Hold_Filled'      => 1,
        'Hold_Reminder'    => 2,
        'Recall_Requested' => 3,
        'Recall_Waiting'   => 4,
        'Ill_ready'        => 5,
        'Ill_unavailable'  => 6,
        'Ill_update'       => 7,
        'Item_Checkout'    => 8,
        'Auto_Renewals'    => 9,
        'Advance_Notice'   => 10,
        'Item_Due'         => 11,
        'Item_Check_in'    => 12

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Please note discussion on BZ about the preferred order ;)
Comment 14 Marcel de Rooy 2024-10-08 14:45:36 UTC
(In reply to Marcel de Rooy from comment #9)
> I do not really mind but personally the alphabetical one seems the best. No
> problem.

So, passed QA. Note that I could have asked for a test too. But this is a small change and I wont insist given time passed too.
Comment 15 Marcel de Rooy 2024-10-08 14:47:35 UTC
(In reply to Katrin Fischer from comment #12)
> (In reply to Magnus Enger from comment #11)
> > (In reply to Katrin Fischer from comment #10)
> > > But then we need to sort on translation in the templates... and the sequence
> > > will vary for everyone.
> > 
> > That's the same problem as the tabs with the syspref categories. Nice and
> > alphabetical in English, random when translated. :-)
> 
> Exactly.

Just a side note, discussion no longer needed. But js should be able to sort those translations too..
Comment 16 Katrin Fischer 2024-10-11 09:10:37 UTC
As this affects behavior and also documentation for users and staff, I feel it should not be backported as a bug fix. If you are used now that certain options are always in a certain page, you don't want to be surprised by them suddenly moving in a minor or security update.

Updating to enhancement.

I'd also like to give a chance to have some feedback on the ordering.
 
I see that this is a "chronological" ordering now. That is one way to do it. 
Personally, I was still irritated by the Checkout and Checkin no longer being next to each other.
Comment 17 Katrin Fischer 2024-10-11 09:15:25 UTC
Pushed for 24.11!

Well done everyone, thank you!