Bugzilla – Attachment 172818 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]
[23.11]Bug 37891: Submit SMS related data even if SMSSendDriver is empty
2311Bug-37891-Submit-SMS-related-data-even-if-SMSS.patch (text/plain), 11.76 KB, created by
Pedro Amorim
on 2024-10-16 12:48:23 UTC
(
hide
)
Description:
[23.11]Bug 37891: Submit SMS related data even if SMSSendDriver is empty
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-16 12:48:23 UTC
Size:
11.76 KB
patch
obsolete
>From 7d756d1bdee533aa96fe87cf714c3a586175a496 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 16 Oct 2024 12:38:46 +0000 >Subject: [PATCH] [23.11]Bug 37891: Submit SMS related data even if > SMSSendDriver is empty > >This is a squash of both patches for 23.11.x. > >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. > >Signed-off-by: Jason Robb <jrobb@sekls.org> > >Amended-by: Jonathan Druart >Align > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >[24.05]Bug 37891: (QA follow-up): Fix tt_valid QA test > >1) Apply both patches >2) $ qa -c 2 -v 2 > >Amended-by: Jonathan Druart >Add the different attribute at the end of the node so that we can easily >see what's different between the two lines > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/tools/letter.tt | 60 +++++++++++++------ > 1 file changed, 43 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 9c72db65ac..0b614fdc82 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -594,12 +594,11 @@ > </div> <!-- /.panel-heading --> > <div id="[% letter.message_transport_type | html %]_[% lang | html %]" class="panel-collapse collapse" role="tabpanel" aria-labelledby="[% letter.message_transport_type | html %]_[% lang | html %]Heading"> > <div class="panel-body"> >- [% 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="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div> >- [% ELSE %] >- <fieldset class="rows mtt"> >- [% END %] >+ [% END %] > <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" /> > <input type="hidden" name="lang" value="[% lang | html %]" /> > <ol> >@@ -618,39 +617,66 @@ > <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" /> >+ [% IF sms_readonly %] >+ <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" disabled="disabled" /> >+ [% 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" checked="checked" /> >+ [% END %] > [% 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" /> >+ [% IF sms_readonly %] >+ <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" disabled="disabled" /> >+ [% 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" /> >+ [% END %] > [% 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> >+ [% IF sms_readonly %] >+ <input type="text" id="title_[% letter.message_transport_type | html %]_[% lang | html %]" name="title" size="60" value="[% letter.title | html %]" readonly /> >+ [% ELSE %] >+ <input type="text" id="title_[% letter.message_transport_type | html %]_[% lang | html %]" name="title" size="60" value="[% letter.title | html %]" /> >+ [% END %] > </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"> >+ [% IF sms_readonly %] >+ <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9" disabled="disabled" > >+ [% ELSE%] >+ <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9"> >+ [% END %] > [% 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> >+ [% IF sms_readonly %] >+ <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" disabled="disabled"></i></button> >+ [% ELSE %] >+ <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> >+ [% END %] > </td> > <td> >+ [% IF sms_readonly %] >+ <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" readonly>[% letter.content | html %]</textarea> >+ [% ELSE %] > <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> >+ [% END %] > </td> > </tr> > </table> >-- >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 37891
:
171300
|
172037
|
172222
|
172224
|
172225
|
172812
|
172813
| 172818