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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-19 / +20 lines)
Lines 607-618 Link Here
607
                    [% END %]
607
                    [% END %]
608
                [% END %]
608
                [% END %]
609
                [% WRAPPER accordion_panel panel_id="${letter.message_transport_type}_${lang}" %]
609
                [% WRAPPER accordion_panel panel_id="${letter.message_transport_type}_${lang}" %]
610
                    [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
610
                    [% SET sms_readonly = letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
611
                        <fieldset class="rows mtt" disabled="disabled">
611
                    <fieldset class="rows mtt">
612
                        [% IF sms_readonly %]
612
                            <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
613
                            <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
613
                    [% ELSE %]
614
                        [% END %]
614
                        <fieldset class="rows mtt">
615
                    [% END %]
616
                        <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
615
                        <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type | html %]" />
617
                        <input type="hidden" name="lang" value="[% lang | html %]" />
616
                        <input type="hidden" name="lang" value="[% lang | html %]" />
618
                        <ol>
617
                        <ol>
Lines 631-669 Link Here
631
                            <li>
630
                            <li>
632
                                <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
631
                                <label for="is_html_[% letter.message_transport_type | html %]_[% lang | html %]">HTML message:</label>
633
                                [% IF letter.is_html %]
632
                                [% IF letter.is_html %]
634
                                    <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" />
633
                                    <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" />
635
                                [% ELSE %]
634
                                [% ELSE %]
636
                                    <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" />
635
                                    <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" />
637
                                [% END %]
636
                                [% END %]
638
                            </li>
637
                            </li>
639
                            <li>
638
                            <li>
640
                                <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 %]" />
639
                                <label for="title_[% letter.message_transport_type | html %]_[% lang | html %]">Message subject:</label>
640
                                <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 %]" />
641
                            </li>
641
                            </li>
642
                            <li>
642
                            <li>
643
                                <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
643
                                <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label>
644
                                [% IF letter.message_transport_type == 'sms' %]
644
                                [% IF letter.message_transport_type == 'sms' %]
645
                                    <span class="sms_counter" id="sms_counter_[% lang | html %]">
645
                                    [% IF !sms_readonly %]
646
                                        [% IF letter.content && letter.content.length > 0 %]
646
                                        <span class="sms_counter" id="sms_counter_[% lang | html %]">
647
                                            [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %]
647
                                            [% IF letter.content && letter.content.length > 0 %]
648
                                        [% ELSE %]
648
                                                [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %]
649
                                            [% tx("{content_length} / 160 characters", {content_length = 0} ) %]
649
                                            [% ELSE %]
650
                                        [% END %]
650
                                                [% tx("{content_length} / 160 characters", {content_length = 0} ) %]
651
                                    </span>
651
                                            [% END %]
652
                                        </span>
653
                                    [% END %]
652
                                [% END %]
654
                                [% END %]
653
                                <table>
655
                                <table>
654
                                    <tr>
656
                                    <tr>
655
                                        <td>
657
                                        <td>
656
                                            <select name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
658
                                            <select [% IF sms_readonly %] disabled="disabled" [% END %] name="SQLfieldname" id="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]" multiple="multiple" size="9">
657
                                                [% FOREACH SQLfieldname IN SQLfieldnames %]
659
                                                [% FOREACH SQLfieldname IN SQLfieldnames %]
658
                                                    <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
660
                                                    <option value="[% SQLfieldname.value | html %]">[% SQLfieldname.text | html %]</option>
659
                                                [% END %]
661
                                                [% END %]
660
                                            </select>
662
                                            </select>
661
                                        </td>
663
                                        </td>
662
                                        <td class="actions">
664
                                        <td class="actions">
663
                                            <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>
665
                                            <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>
664
                                        </td>
666
                                        </td>
665
                                        <td>
667
                                        <td>
666
                                            <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>
668
                                            <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>
667
                                        </td>
669
                                        </td>
668
                                    </tr>
670
                                    </tr>
669
                                </table>
671
                                </table>
670
- 

Return to bug 37891