From ce57ca8c5e8d50bffe783c01e1804f85459f152e Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 14 Feb 2014 12:25:26 -0500
Subject: [PATCH] Fix issue in displaying filter form when managesieve_kolab_master=true and sieve variables extension is supported by the server (#1489599)
---
plugins/managesieve/Changelog | 2 ++
plugins/managesieve/lib/Roundcube/rcube_sieve_script.php | 1 +
plugins/managesieve/managesieve.js | 12 +++++++++---
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index 8d40f19..fb46a41 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -2,6 +2,8 @@
- Add Filters tab/section using plugin API hook
- Fix issue where folder selector wasn't visible on new filter form
- Fix issue where multi-select fields were not visible in new filter action rows (#1489600)
+- Fix issue in displaying filter form when managesieve_kolab_master=true
+ and sieve variables extension is supported by the server (#1489599)
* version 7.1 [2013-11-22]
-----------------------------------------------------------
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php
index 6fbc3f8..c6ad78a 100644
--- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php
+++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php
@@ -585,6 +585,7 @@
if ($rule[0]['type'] == 'set') {
unset($rule[0]['type']);
$this->vars[] = $rule[0];
+ unset($rule);
}
else {
$rule = array('actions' => $rule);
diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js
index 53696ec..8e344ad 100644
--- a/plugins/managesieve/managesieve.js
+++ b/plugins/managesieve/managesieve.js
@@ -226,7 +226,7 @@
// Delete filter row
case 'del':
- var i = 0, list = this.filters_list;
+ var id = o.id, list = this.filters_list;
list.remove_row(this.managesieve_rowid(o.id));
list.clear_selection();
@@ -241,8 +241,14 @@
return;
}
- // modify ID and remove all attached events
- $(this).attr('id', 'rcmrow'+(i++)).unbind();
+ var rowid = this.id.substr(6);
+
+ // remove all attached events
+ $(this).unbind();
+
+ // update row id
+ if (rowid > id)
+ $(this).attr('id', 'rcmrow' + (rowid-1));
});
list.init();
--
Gitblit v1.9.1