From 015f77dea1b5ce9bbe7b8f15b6b1242988b006cc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 14 Jul 2014 10:32:11 -0400 Subject: [PATCH] Bug 12572 - Use jQueryUI Accordion to display message transport types The notice edit view has separate sections for each of the various message transport types. This patch groups them in a jQueryUI accordion to simplify the view. Also changed: Some label/id pairs have been changed to eliminate duplicate ids. To test, apply the patch an edit any notice under Tools -> Notices & Slips. - The message transport type fields for email, feed, phone, etc. should be correctly grouped in a collapsed accordion. The acccordion should look correct and work correctly. - Clicking the label for any form field should correctly highlight the corresponding field. - Submitting updates to the notice should work correctly for all message transport types. Signed-off-by: Katrin Fischer This works as described. Something small: the top border of the uncollapsed/opened section doesn't display correctly, but this is working a lot nicer than before, as now changing a message requires a lot less scrolling. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/css/staff-global.css | 12 ++++++ .../prog/en/modules/tools/letter.tt | 42 +++++++++---------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index f7678f0804..3b4d768d71 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2426,6 +2426,18 @@ div.authorizedheading { font-weight: bold; font-size : 110%; } +fieldset.rows.ui-accordion-content { + border-top-left-radius: 0; + border-top-right-radius: 0; + margin: 0; + padding: 0; + width: auto; +} + +fieldset.rows.ui-accordion-content table { + margin : 0; +} + video { width: 480px; } 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 7964e4147c..08d3ec5175 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -93,6 +93,7 @@ $(document).ready(function() { $("#sms_counter").css("color", "black"); } }); + $( "#transport-types" ).accordion({ collapsible: true, active:false, animate: 200 }); }); [% IF add_form or copy_form %] @@ -338,26 +339,18 @@ $(document).ready(function() { [% IF copying %] You must change this code to reflect the copy. [% END %] - +
  • Required -
  • - + + + +
    [% FOREACH letter IN letters %] -
  • - [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] -
    -
    You should enable the SMSSendDriver preference to use the SMS templates.
    - [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %] -
    -
    You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.
    - [% ELSE %] -
    - [% END %] - +

    [% SWITCH letter.message_transport_type %] [% CASE 'email' %] Email @@ -372,7 +365,16 @@ $(document).ready(function() { [% CASE %] [% letter.message_transport_type %] [% END %] - +

    + [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] +
    +
    You should enable the SMSSendDriver preference to use the SMS templates.
    + [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %] +
    +
    You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.
    + [% ELSE %] +
    + [% END %]
    1. @@ -384,17 +386,17 @@ $(document).ready(function() { [% END %]
    2. - +
    3. - + [% IF letter.message_transport_type == 'sms' %] [% IF letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters [% END %]
      - [% FOREACH SQLfieldnam IN SQLfieldname %] [% END %] @@ -407,12 +409,10 @@ $(document).ready(function() { - [% END %] - + [% IF code.search('DGST') %] Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch. [% END %] -
      Cancel
      -- 2.39.5