Module: check_mk
Branch: master
Commit: c45c5dc2fadf879a1942ec54b2ac993473c5b472
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c45c5dc2fadf87…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 16 12:21:45 2015 +0200
#2203 FIX Fix sorting of unselected elements in a list choice with two panes
---
.werks/2203 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 7 ++++---
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/2203 b/.werks/2203
new file mode 100644
index 0000000..ee67927
--- /dev/null
+++ b/.werks/2203
@@ -0,0 +1,9 @@
+Title: Fix sorting of unselected elements in a list choice with two panes
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i1
+Date: 1429179695
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index eecf934..f965069 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -447,6 +447,7 @@
* 2191 FIX: Fixed handling of URL variable 'mode' in web API for discovering
services...
* 1956 FIX: WATO Web-API: Fixed exception information for single sites...
* 2178 FIX: Fixed handling of user erros in WATO when using Python < 2.5
+ * 2203 FIX: Fix sorting of unselected elements in a list choice with two panes
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 6945703..3054f8f 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1621,7 +1621,8 @@ class DualListChoice(ListChoice):
for v in value:
if v in allowed_keys:
selected.append((v, edict[v]))
- for v in allowed_keys:
+
+ for v, name in self._elements:
if v not in value:
unselected.append((v, edict[v]))
else:
@@ -1655,7 +1656,8 @@ class DualListChoice(ListChoice):
onchange_selected += ';vs_duallist_enlarge(\'selected\',
\'%s\')' % varprefix
onchange_unselected += ';vs_duallist_enlarge(\'unselected\',
\'%s\')' % varprefix
- html.sorted_select(varprefix + '_unselected', unselected,
+ func = self._custom_order and html.select or html.sorted_select
+ func(varprefix + '_unselected', unselected,
attrs = {
'size' : self._rows,
'multiple' : 'multiple',
@@ -1664,7 +1666,6 @@ class DualListChoice(ListChoice):
},
onchange = onchange_unselected)
html.write('</td><td>')
- func = self._custom_order and html.select or html.sorted_select
func(varprefix + '_selected', selected,
attrs = {
'size' : self._rows,