From b9abe2a14510766cef11944722e9a0b697098bc8 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Mon, 21 Jan 2013 18:43:20 +0000 Subject: [PATCH] Fix the CF destination set view. --- root/js/csc.js | 2 +- root/tt/callforward_destination.tt | 106 +++++++++++++---------------- 2 files changed, 49 insertions(+), 59 deletions(-) diff --git a/root/js/csc.js b/root/js/csc.js index 144c3c6..e96184a 100644 --- a/root/js/csc.js +++ b/root/js/csc.js @@ -21,7 +21,7 @@ function move_down (item) { function update_priority(item) { var i = 1; - var form = $('#'+item).parent().siblings('.set-item').children("form"); + var form = $('#'+item).parent().find("div form"); $('#'+item).parent().children('.sub-container').each(function(index) { var id = $(this).children('form').children("[name='dtarget_id']").val(); diff --git a/root/tt/callforward_destination.tt b/root/tt/callforward_destination.tt index ea6ce5e..bcf3a92 100644 --- a/root/tt/callforward_destination.tt +++ b/root/tt/callforward_destination.tt @@ -20,57 +20,48 @@
[% FOREACH dset IN destination_sets %] -
-   -
- [% IF dset_id == dset.id %] - [% PROCESS set action = 'edit' %] - [% ELSE %] - [% PROCESS set action = 'view' %] - [% END %] -   -
+
+
+ [% IF dset_id == dset.id %] + [% PROCESS set action = 'edit' %] + [% ELSE %] + [% PROCESS set action = 'view' %] + [% END %] +
- [% priority = 0 %] -
- [% FOREACH dest IN dset.destinations %] - -
-   - - [% IF (dest.id == -1) %] - [% PROCESS target action = 'add' %] - [% ELSIF dtarget_id == dest.id %] - [% PROCESS target action = 'edit' %] -
- [% ELSE %] - [% PROCESS target action = 'view' %] - [% END %] + [% priority = 0 %] + [% FOREACH dest IN dset.destinations %] + +
+ [% IF (dest.id == -1) %] + [% PROCESS target action = 'add' %] + [% ELSIF dtarget_id == dest.id %] + [% PROCESS target action = 'edit' %] + [% ELSE %] + [% PROCESS target action = 'view' %] + [% END %] [% priority = priority + 1 %]
- [% END %] + [% END %] -
- - [%# dest is still available. this is expected behaviour - see: http://template-toolkit.org/docs/manual/Directives.html#section_FOREACH %] + [%# dest is still available. this is expected behaviour + see: http://template-toolkit.org/docs/manual/Directives.html#section_FOREACH %] - [% IF priority == 0 or dset_id == dset.id %] [%# either editing set or nothing here so far, offer empty one %] - [% dest = undef %] [%# dest still holds the last one %] -
- [% PROCESS target action = 'add' %] -
- [% END %] + [% IF priority == 0 or dset_id == dset.id %] [%# either editing set or nothing here so far, offer empty one %] + [% dest = undef %] [%# dest still holds the last one %] +
+ [% PROCESS target action = 'add' %] +
+ [% END %]

[% END %] -
  -
+
+
[% PROCESS set action = 'add' %] -  
@@ -90,17 +81,17 @@ [% IF action == 'edit' or action == 'add' %]
[% IF action == 'edit' %] -
+
[% FOREACH dest IN dset.destinations %] - + [% END %] [% ELSE %] -
+
[% END %] [% ELSE %] -
[% dset.name %]
+
[% dset.name %]
[% END %] @@ -110,7 +101,7 @@ [% END %] [% IF action == 'edit' %] -
+
[% ELSIF action == 'add' %]
-
+
[% ELSIF action == 'view' %] - +
[% IF mapped.${dset.id} %]

[% mapped.${dset.id} %] [% Catalyst.loc('times(s) mapped') %]

@@ -163,7 +154,8 @@ [% END %] [% IF action == 'edit' or action == 'add' %] -
+
 
+
[% IF Catalyst.config.voicemail_features %] @@ -211,36 +203,34 @@
[% IF action == 'edit' %] -
+
-
+ [% ELSIF action == 'add' %] -
+
-
[% END %] [% ELSIF action == 'view' %] - [% IF dset.id == dset_id %]
+ [% IF dset.id == dset_id %] + [% ELSE %]  + [% END %]
- [% ELSE %] -
- [% END %] -
+
[% IF Catalyst.config.voicemail_features and dest.destination == "voicebox" %] [% Catalyst.loc('Voicebox') %] [% ELSIF Catalyst.config.fax_features and dest.destination == "fax2mail" %] @@ -251,8 +241,8 @@ [% dest.destination %] [% Catalyst.loc('for') %] [% dest.timeout %] [% Catalyst.loc('seconds') %] [% END %]
- -
+ +