Bugzilla – Attachment 171300 Details for
Bug 37891
Editing a notice's name having SMSSendDriver disabled causes notice to be listed twice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37891: Submit SMS related data even if SMSSendDriver is empty.
Bug-37891-Submit-SMS-related-data-even-if-SMSSendD.patch (text/plain), 8.82 KB, created by
Pedro Amorim
on 2024-09-11 11:08:58 UTC
(
hide
)
Description:
Bug 37891: Submit SMS related data even if SMSSendDriver is empty.
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-09-11 11:08:58 UTC
Size:
8.82 KB
patch
obsolete
>From 7173e6cb5c06f8c4ed4bdd979e7a45835649b367 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 11 Sep 2024 10:40:17 +0000 >Subject: [PATCH] Bug 37891: Submit SMS related data even if SMSSendDriver is > empty. > >The bug is caused by the SMS data not being submitted as its fieldset is disabled if SMSSendDriver is empty. >This causes the SMS instance of the notice to not be updated when the edit happens, becoming out of sync. >Once it becomes out of sync with the other notices of same code but different transport_type, the 'GROUP BY branchcode,module,code,name,branchname' in letter.pl will fail, as the name no longer matches, listing the same notice twice on the notices table. > >This patch updates the logic on the template to have the SMS input elements be disabled/readonly instead of having disabled='disabled' on the SMS fieldset. >This keeps the same functionality i.e. staff member is unable to edit SMS notice if SMSSendDriver is disabled, but ensures that SMS related data is submitted to the controller when the notice edit save happens. > >Test plan: >1) Visit notices and slips: > <staff_url>/cgi-bin/koha/tools/letter.pl >2) Search for a notice code e.g. 'ILL_REQUEST_UPDATE'. >3) Notice only one result is returned. Click 'Edit'. >4) Edit the 'Name'. Click 'Save'. >5) Repeat 2. Notice two results are now returned. >6) Apply patch. Repeat test plan. Notice only one result is returned at the end. >--- > .../prog/en/modules/tools/letter.tt | 36 ++++++++++--------- > 1 file changed, 19 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index c8fea2b378..9470f12cd2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -633,11 +633,10 @@ > [% END %] > [% END %] > [% WRAPPER accordion_panel panel_id="${letter.message_transport_type}_${lang}" %] >- [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] >- <fieldset class="rows mtt" disabled="disabled"> >+ [% SET sms_readonly = letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] >+ <fieldset class="rows mtt"> >+ [% IF sms_readonly %] > <div class="alert alert-info">You should enable the SMSSendDriver preference to use the SMS templates.</div> >- [% ELSE %] >- <fieldset class="rows mtt"> > [% END %] > <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" /> > <input type="hidden" name="lang" value="[% lang | html %]" /> >@@ -657,39 +656,42 @@ > <li> > <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label> > [% IF letter.is_html %] >- <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" checked="checked" /> >+ <input [% IF sms_readonly %] disabled="disabled" [% END %] type="checkbox" name="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" checked="checked" /> > [% ELSE %] >- <input type="checkbox" name="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" /> >+ <input [% IF sms_readonly %] disabled="disabled" [% END %] type="checkbox" name="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" id="is_html_[% letter.message_transport_type | html %]_[% lang | html %]" value="1" /> > [% END %] > </li> > <li> >- <label for="title_[% letter.message_transport_type | html %]_[% lang | html %]">Message subject:</label><input type="text" id="title_[% letter.message_transport_type | html %]_[% lang | html %]" name="title" size="60" value="[% letter.title | html %]" /> >+ <label for="title_[% letter.message_transport_type | html %]_[% lang | html %]">Message subject:</label> >+ <input [% IF sms_readonly %] readonly [% END %] type="text" id="title_[% letter.message_transport_type | html %]_[% lang | html %]" name="title" size="60" value="[% letter.title | html %]" /> > </li> > <li> > <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label> > [% IF letter.message_transport_type == 'sms' %] >- <span class="sms_counter" id="sms_counter_[% lang | html %]"> >- [% IF letter.content && letter.content.length > 0 %] >- [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %] >- [% ELSE %] >- [% tx("{content_length} / 160 characters", {content_length = 0} ) %] >- [% END %] >- </span> >+ [% IF !sms_readonly %] >+ <span class="sms_counter" id="sms_counter_[% lang | html %]"> >+ [% IF letter.content && letter.content.length > 0 %] >+ [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %] >+ [% ELSE %] >+ [% tx("{content_length} / 160 characters", {content_length = 0} ) %] >+ [% END %] >+ </span> >+ [% END %] > [% END %] > <table> > <tr> > <td> >- <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9"> >+ <select [% IF sms_readonly %] disabled="disabled" [% END %] name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9"> > [% FOREACH SQLfieldname IN SQLfieldnames %] > <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option> > [% END %] > </select> > </td> > <td class="actions"> >- <button type="button" data-containerid="[% letter.message_transport_type | html %]_[% lang | html %]" class="btn btn-default btn-sm insert">Insert <i class="fa-solid fa-right-long"></i></button> >+ <button [% IF sms_readonly %] disabled="disabled" [% END %] type="button" data-containerid="[% letter.message_transport_type | html %]_[% lang | html %]" class="btn btn-default btn-sm insert">Insert <i class="fa-solid fa-right-long"></i></button> > </td> > <td> >- <textarea name="content" data-lang="[% lang | html %]" class="content_[% letter.message_transport_type | html %]" id="content_[% letter.message_transport_type | html %]_[% lang | html %]" cols="80" rows="15">[% letter.content | html %]</textarea> >+ <textarea [% IF sms_readonly %] readonly [% END %] name="content" data-lang="[% lang | html %]" class="content_[% letter.message_transport_type | html %]" id="content_[% letter.message_transport_type | html %]_[% lang | html %]" cols="80" rows="15">[% letter.content | html %]</textarea> > </td> > </tr> > </table> >-- >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 37891
:
171300
|
172037
|
172222
|
172224
|
172225
|
172812
|
172813
|
172818