The host adder dialog has been modified to specify the new flag
for retrieving the forward zones only.

Ticket #1458

--
Endi S. Dewata
From abea002ce23b74db537103658bfbb8a147e2c39e Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Mon, 18 Jul 2011 11:42:22 -0500
Subject: [PATCH] Removed reverse zones from host adder dialog.

The host adder dialog has been modified to specify the new flag
for retrieving the forward zones only.

Ticket #1458
---
 install/ui/host.js   |   25 ++++++++++++++++++++++---
 install/ui/widget.js |   15 +++++++++------
 2 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/install/ui/host.js b/install/ui/host.js
index e9adcd4f796860ff41aadda59f0410ca4a28fbf5..14f16d93d918325a0d42b823c43ce7280b0704c5 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -106,10 +106,8 @@ IPA.entity_factories.host = function () {
             height: 250,
             fields:[
                 {
-                    factory: IPA.entity_select_widget,
+                    factory: IPA.dnszone_select_widget,
                     name: 'fqdn',
-                    other_entity: 'dnszone',
-                    other_field: 'idnsname',
                     label: IPA.messages.objects.service.host,
                     editable: true,
                     undo: false
@@ -127,6 +125,27 @@ IPA.entity_factories.host = function () {
         build();
 };
 
+IPA.dnszone_select_widget = function(spec) {
+
+    spec = spec || {};
+    spec.other_entity = 'dnszone';
+    spec.other_field = 'idnsname';
+
+    var that = IPA.entity_select_widget(spec);
+
+    that.create_search_command = function() {
+        return IPA.command({
+            entity: that.other_entity,
+            method: 'find',
+            args: [that.filter.val()],
+            options: {
+                forward_only: true
+            }
+        });
+    };
+
+    return that;
+};
 
 IPA.host_dnsrecord_entity_link_widget = function(spec){
     var that = IPA.entity_link_widget(spec);
diff --git a/install/ui/widget.js b/install/ui/widget.js
index f5ed036525cf405e5fcf256902848e8995e0e6c3..1932bee7582f1430fe35725b291359d4885de136 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1821,15 +1821,17 @@ IPA.entity_select_widget = function(spec) {
     that.other_entity = spec.other_entity;
     that.other_field = spec.other_field;
 
-    that.search = function() {
-
-        var filter = that.filter.val();
-
-        var command = IPA.command({
+    that.create_search_command = function() {
+        return IPA.command({
             entity: that.other_entity,
             method: 'find',
-            args: [filter]
+            args: [that.filter.val()]
         });
+    };
+
+    that.search = function() {
+
+        var command = that.create_search_command();
 
         command.on_success = function(data, text_status, xhr) {
 
@@ -1837,6 +1839,7 @@ IPA.entity_select_widget = function(spec) {
 
             that.create_option();
 
+            var filter = that.filter.val();
             var entries = data.result.result;
             for (var i=0; i<data.result.count; i++) {
                 var entry = entries[i];
-- 
1.7.5.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to