Bugzilla – Attachment 187226 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), 3.73 KB, created by
Lari Taskula
on 2025-10-01 20:36:36 UTC
(
hide
)
Description:
Bug 40933: Add the ability to send custom SMS messages to a patron
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-10-01 20:36:36 UTC
Size:
3.73 KB
patch
obsolete
>From 357beb7ae8683219933b7165a189e07d2f44eb37 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 >--- > circ/add_message.pl | 5 +++-- > .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 3 +++ > koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 7 +++++++ > 3 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/circ/add_message.pl b/circ/add_message.pl >index a5e82b9f049..d2367b78d74 100755 >--- a/circ/add_message.pl >+++ b/circ/add_message.pl >@@ -63,7 +63,8 @@ if ( $op eq 'cud-edit_message' && $message_id ) { > )->store; > } > >- if ( $message_type eq 'E' ) { >+ if ( $message_type eq 'E' or $message_type eq 'SMS' ) { >+ my $message_transport_type = $message_type eq 'E' ? 'email' : 'sms'; > 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' ); >@@ -92,7 +93,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 62faf67702e..8ba45bd3fed 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..a0f693ea495 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >@@ -114,6 +114,13 @@ $(document).ready(function () { > $("#borrower_message").prop("disabled", false); > $("#select_patron_messages").val(""); > } >+ if ($(this).val() == "SMS") { >+ $("#borrower_subject").val(__("SMS added by a librarian")); >+ } 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