Bugzilla – Attachment 169763 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.13 KB, created by
Sam Lau
on 2024-07-26 16:46:02 UTC
(
hide
)
Description:
Bug 29194: Create logical ordering of patron messaging preferences
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-07-26 16:46:02 UTC
Size:
2.13 KB
patch
obsolete
>From 7079095487967d8eb5a3fe86ced41acdf8678eaf 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 > >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 >--- > 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.2
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