Bugzilla – Attachment 191346 Details for
Bug 40933
Add SMS support under Add message feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40933: Add the ability to send custom SMS messages to a patron
Bug-40933-Add-the-ability-to-send-custom-SMS-messa.patch (text/plain), 5.29 KB, created by
Lari Taskula
on 2026-01-13 11:31:23 UTC
(
hide
)
Description:
Bug 40933: Add the ability to send custom SMS messages to a patron
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2026-01-13 11:31:23 UTC
Size:
5.29 KB
patch
obsolete
>From be335ca80566e4ca7c1f6513794915d23560eda0 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Wed, 1 Oct 2025 23:33:01 +0300 >Subject: [PATCH] Bug 40933: Add the ability to send custom SMS messages to a > patron > >To test: >1. Make sure SMSSendDriver system preference is enabled >2. In staff client, navigate to patron details of any patron >3. From the members menu toolbar, click "Add Message" >4. Under "Add a message for", select "SMS - sms number of patron" >5. Write a custom message >6. Click "Save" >7. Navigate to patron's Notices tab >8. Observe a new notice titled "SMS added by a librarian" >9. Click it >10. Observe the content you wrote in step 5 >11. Repeat steps 2-4 >12. Select predefined patron notice. If you don't have one, >navigate to Tools > Notices and slips > New notice > Patrons (custom message) >and add content under sms delivery option >13. Repeat steps 6-7 >14. Observe your custom message in the notices table >15. Observe your custom message content when you click the notice >--- > circ/add_message.pl | 16 +++++++++------- > .../prog/en/includes/members-toolbar.inc | 3 +++ > koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 12 +++++++++++- > 3 files changed, 23 insertions(+), 8 deletions(-) > >diff --git a/circ/add_message.pl b/circ/add_message.pl >index a5e82b9f049..33dc1d8c60d 100755 >--- a/circ/add_message.pl >+++ b/circ/add_message.pl >@@ -63,8 +63,9 @@ if ( $op eq 'cud-edit_message' && $message_id ) { > )->store; > } > >- if ( $message_type eq 'E' ) { >- my $logged_in_patron = Koha::Patrons->find($loggedinuser); >+ if ( $message_type eq 'E' or $message_type eq 'SMS' ) { >+ my $message_transport_type = $message_type eq 'SMS' ? 'sms' : 'email'; >+ my $logged_in_patron = Koha::Patrons->find($loggedinuser); > if ( !$logged_in_patron->has_permission( { borrowers => 'send_messages_to_borrowers' } ) ) { > C4::Output::output_and_exit( $input, $cookie, $template, 'insufficient_permission' ); > } >@@ -78,10 +79,11 @@ if ( $op eq 'cud-edit_message' && $message_id ) { > > if ($letter_code) { > $letter = C4::Letters::GetPreparedLetter( >- module => 'add_message', >- letter_code => $letter_code, >- lang => $patron->lang, >- tables => { >+ module => 'add_message', >+ letter_code => $letter_code, >+ lang => $patron->lang, >+ message_transport_type => $message_transport_type, >+ tables => { > 'borrowers' => $borrowernumber, > 'branches' => $branchcode, > }, >@@ -92,7 +94,7 @@ if ( $op eq 'cud-edit_message' && $message_id ) { > { > letter => $letter, > borrowernumber => $borrowernumber, >- message_transport_type => 'email', >+ message_transport_type => $message_transport_type, > } > ) or warn "can't enqueue letter"; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index ce3975958d8..41c47f48c5d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -188,6 +188,9 @@ > <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option> > [% IF CAN_user_borrowers_send_messages_to_borrowers %] > <option value="E">Email - email addresses of patron</option> >+ [% IF Koha.Preference("SMSSendDriver") %] >+ <option value="SMS">SMS - sms number of patron</option> >+ [% END %] > [% END %] > </select> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >index f47b5c2e38a..730c4c32a89 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >@@ -94,7 +94,7 @@ $(document).ready(function () { > }); > > $("#message_type").on("change", function () { >- if ($(this).val() == "E") { >+ if ($(this).val() == "E" || $(this).val() == "SMS") { > $("label[for='borrower_message']").show(); > $("#subject_form").show(); > $("label[for='select_patron_notice']").show(); >@@ -114,6 +114,16 @@ $(document).ready(function () { > $("#borrower_message").prop("disabled", false); > $("#select_patron_messages").val(""); > } >+ if ($(this).val() == "SMS") { >+ $("#borrower_subject").val(__("SMS added by a librarian")); >+ $("#subject_form").hide(); >+ } else { >+ if ( >+ $("#borrower_subject").val() == __("SMS added by a librarian") >+ ) { >+ $("#borrower_subject").val(""); >+ } >+ } > }); > > $("#select_patron_notice").on("change", function () { >-- >2.34.1
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 40933
:
187226
|
188643
|
191346
|
191374
|
191709