View | Details | Raw Unified | Return to bug 37891
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-18 / +19 lines)
Lines 617-627 Link Here
617
                    [% END %]
617
                    [% END %]
618
                [% END %]
618
                [% END %]
619
                [% WRAPPER accordion_panel panel_id="${letter.message_transport_type}_${lang}" %]
619
                [% WRAPPER accordion_panel panel_id="${letter.message_transport_type}_${lang}" %]
620
                    [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
620
                    [% SET sms_readonly = letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
621
                        <fieldset class="rows mtt" disabled="disabled">
621
                    <fieldset class="rows mtt">
622
                    [% IF sms_readonly %]
622
                            <div class="alert alert-info">You should enable the SMSSendDriver preference to use the SMS templates.</div>
623
                            <div class="alert alert-info">You should enable the SMSSendDriver preference to use the SMS templates.</div>
623
                    [% ELSE %]
624
                        <fieldset class="rows mtt">
625
                    [% END %]
624
                    [% END %]
626
                        <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
625
                        <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
627
                        <input type="hidden" name="lang" value="[% lang | html %]" />
626
                        <input type="hidden" name="lang" value="[% lang | html %]" />
Lines 641-679 Link Here
641
                            <li>
640
                            <li>
642
                                <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
641
                                <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
643
                                [% IF letter.is_html %]
642
                                [% IF letter.is_html %]
644
                                    <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" />
643
                                    <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" />
645
                                [% ELSE %]
644
                                [% ELSE %]
646
                                    <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" />
645
                                    <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" />
647
                                [% END %]
646
                                [% END %]
648
                            </li>
647
                            </li>
649
                            <li>
648
                            <li>
650
                                <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 %]" />
649
                                <label for="title_[% letter.message_transport_type | html %]_[% lang | html %]">Message subject:</label>
650
                                <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 %]" />
651
                            </li>
651
                            </li>
652
                            <li>
652
                            <li>
653
                                <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
653
                                <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
654
                                [% IF letter.message_transport_type == 'sms' %]
654
                                [% IF letter.message_transport_type == 'sms' %]
655
                                    <span class="sms_counter" id="sms_counter_[% lang | html %]">
655
                                    [% IF !sms_readonly %]
656
                                        [% IF letter.content && letter.content.length > 0 %]
656
                                        <span class="sms_counter" id="sms_counter_[% lang | html %]">
657
                                            [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %]
657
                                            [% IF letter.content && letter.content.length > 0 %]
658
                                        [% ELSE %]
658
                                                [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %]
659
                                            [% tx("{content_length} / 160 characters", {content_length = 0} ) %]
659
                                            [% ELSE %]
660
                                        [% END %]
660
                                                [% tx("{content_length} / 160 characters", {content_length = 0} ) %]
661
                                    </span>
661
                                            [% END %]
662
                                        </span>
663
                                    [% END %]
662
                                [% END %]
664
                                [% END %]
663
                                <table>
665
                                <table>
664
                                    <tr>
666
                                    <tr>
665
                                        <td>
667
                                        <td>
666
                                            <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
668
                                            <select [% IF sms_readonly %] disabled="disabled" [% END %] name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
667
                                                [% FOREACH SQLfieldname IN SQLfieldnames %]
669
                                                [% FOREACH SQLfieldname IN SQLfieldnames %]
668
                                                    <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
670
                                                    <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
669
                                                [% END %]
671
                                                [% END %]
670
                                            </select>
672
                                            </select>
671
                                        </td>
673
                                        </td>
672
                                        <td class="actions">
674
                                        <td class="actions">
673
                                            <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>
675
                                            <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>
674
                                        </td>
676
                                        </td>
675
                                        <td>
677
                                        <td>
676
                                            <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>
678
                                            <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>
677
                                        </td>
679
                                        </td>
678
                                    </tr>
680
                                    </tr>
679
                                </table>
681
                                </table>
680
- 

Return to bug 37891