Bugzilla – Attachment 172529 Details for
Bug 29194
Patron messaging preferences should be logically ordered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29194: Create logical ordering of patron messaging preferences
Bug-29194-Create-logical-ordering-of-patron-messag.patch (text/plain), 2.33 KB, created by
Marcel de Rooy
on 2024-10-08 14:44:29 UTC
(
hide
)
Description:
Bug 29194: Create logical ordering of patron messaging preferences
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-10-08 14:44:29 UTC
Size:
2.33 KB
patch
obsolete
>From 9dd92dc93e22bcb48cb4f70c05d66a2df07cd606 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Fri, 26 Jul 2024 16:42:12 +0000 >Subject: [PATCH] Bug 29194: Create logical ordering of patron messaging > preferences >Content-Type: text/plain; charset=utf-8 > >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 ;) >--- > C4/Members/Messaging.pm | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm >index 25e6a04a0f..e3b93f614b 100644 >--- a/C4/Members/Messaging.pm >+++ b/C4/Members/Messaging.pm >@@ -215,7 +215,25 @@ END_SQL > > my @return = values %$choices; > >- @return = sort { $a->{message_attribute_id} <=> $b->{message_attribute_id} } @return; >+ # Define messaging sort order based on logical grouping of events >+ my %messaging_order = ( >+ '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 >+ ); >+ >+ @return = >+ sort { ( $messaging_order{ $a->{message_name} } // 999 ) <=> ( $messaging_order{ $b->{message_name} } // 999 ) } >+ @return; > > # warn( Data::Dumper->Dump( [ \@return ], [ 'return' ] ) ); > return \@return; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29194
:
169763
|
169772
| 172529