The association table widget and facet have been modified to accept
titles for the add and delete dialogs. The table and facet definitions
have been modified to specify the appropriate titles.

Some unused code have been removed.

Ticket #1629

--
Endi S. Dewata
From c5c8d97ce08c7a64aa5755a0ef2e32346816bf8d Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Fri, 19 Aug 2011 10:20:40 -0500
Subject: [PATCH] Updated add and delete association dialog titles.

The association table widget and facet have been modified to accept
titles for the add and delete dialogs. The table and facet definitions
have been modified to specify the appropriate titles.

Some unused code have been removed.

Ticket #1629
---
 install/ui/association.js          |   45 +++++---
 install/ui/entity.js               |    3 +
 install/ui/hbac.js                 |  110 ++++++++----------
 install/ui/host.js                 |   23 +----
 install/ui/service.js              |   18 ---
 install/ui/sudo.js                 |  222 +++++++++++-------------------------
 install/ui/test/data/ipa_init.json |   22 ++++-
 ipalib/plugins/internal.py         |   22 ++++-
 8 files changed, 187 insertions(+), 278 deletions(-)

diff --git a/install/ui/association.js b/install/ui/association.js
index 2c6a1d2003be0668b61b230b8317263b06a822a5..87c60a16d4312d1e10ad96a0ba10ea62034381a3 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -282,6 +282,11 @@ IPA.association_config = function (spec) {
 IPA.association_table_widget = function (spec) {
 
     spec = spec || {};
+
+    var index = spec.name.indexOf('_');
+    spec.attribute_member = spec.attribute_member || spec.name.substring(0, index);
+    spec.other_entity = spec.other_entity || spec.name.substring(index+1);
+
     spec.managed_entity_name = spec.other_entity;
 
     var that = IPA.table_widget(spec);
@@ -293,6 +298,9 @@ IPA.association_table_widget = function (spec) {
     that.add_method = spec.add_method || 'add_member';
     that.remove_method = spec.remove_method || 'remove_member';
 
+    that.add_title = spec.add_title || IPA.messages.association.add.member;
+    that.remove_title = spec.remove_title || IPA.messages.association.remove.member;
+
     that.adder_columns = $.ordered_map();
 
     that.get_adder_column = function(name) {
@@ -492,11 +500,9 @@ IPA.association_table_widget = function (spec) {
     that.create_add_dialog = function() {
         var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
         var label = IPA.metadata.objects[that.other_entity].label;
-        var title = IPA.messages.association.add;
 
-        title = title.replace(
-            '${entity}',
-            that.entity.metadata.label_singular);
+        var title = that.add_title;
+        title = title.replace('${entity}', that.entity.metadata.label_singular);
         title = title.replace('${primary_key}', pkey);
         title = title.replace('${other_entity}', label);
 
@@ -564,11 +570,9 @@ IPA.association_table_widget = function (spec) {
 
         var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
         var label = IPA.metadata.objects[that.other_entity].label;
-        var title = IPA.messages.association.remove;
 
-        title = title.replace(
-            '${entity}',
-            that.entity.metadata.label_singular);
+        var title = that.remove_title;
+        title = title.replace('${entity}', that.entity.metadata.label_singular);
         title = title.replace('${primary_key}', pkey);
         title = title.replace('${other_entity}', label);
 
@@ -674,8 +678,8 @@ IPA.association_facet = function (spec) {
        link must be set before the call to the base class, to affect the  table.
      */
     spec.link = spec.link === undefined ? true : spec.link;
-
     spec.managed_entity_name = spec.other_entity;
+
     var that = IPA.table_facet(spec);
 
     that.entity = spec.entity;
@@ -693,6 +697,9 @@ IPA.association_facet = function (spec) {
     that.add_method = spec.add_method || 'add_member';
     that.remove_method = spec.remove_method || 'remove_member';
 
+    that.add_title = spec.add_title || IPA.messages.association.add.member;
+    that.remove_title = spec.remove_title || IPA.messages.association.remove.member;
+
     that.adder_columns = $.ordered_map();
 
     that.page_length = spec.page_length === undefined ? 20 : spec.page_length;
@@ -727,7 +734,7 @@ IPA.association_facet = function (spec) {
         var i;
 
         var pkey_name;
-        if (that.other_entity){
+        if (that.other_entity) {
             pkey_name = IPA.metadata.objects[that.other_entity].primary_key;
         }
 
@@ -739,6 +746,12 @@ IPA.association_facet = function (spec) {
             });
         }
 
+        if (!that.adder_columns.length) {
+            that.create_adder_column({
+                name: pkey_name,
+                primary_key: true
+            });
+        }
 
         var label = IPA.metadata.objects[that.other_entity] ?
             IPA.metadata.objects[that.other_entity].label : that.other_entity;
@@ -914,11 +927,9 @@ IPA.association_facet = function (spec) {
 
         var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
         var label = IPA.metadata.objects[that.other_entity] ? IPA.metadata.objects[that.other_entity].label : that.other_entity;
-        var title = IPA.messages.association.add;
 
-        title = title.replace(
-            '${entity}',
-            that.entity.metadata.label_singular);
+        var title = that.add_title;
+        title = title.replace('${entity}', that.entity.metadata.label_singular);
         title = title.replace('${primary_key}', pkey);
         title = title.replace('${other_entity}', label);
 
@@ -973,11 +984,9 @@ IPA.association_facet = function (spec) {
         }
 
         var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
-        var title = IPA.messages.association.remove;
 
-        title = title.replace(
-            '${entity}',
-            that.entity.metadata.label_singular);
+        var title = that.remove_title;
+        title = title.replace('${entity}', that.entity.metadata.label_singular);
         title = title.replace('${primary_key}', pkey);
         title = title.replace('${other_entity}', label);
 
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 6317eebf5fd1c0c9c3b6ac341181c1c28058a9c5..ce028a2eb930054be33e17e3d71270988cdde068 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -795,6 +795,9 @@ IPA.entity_builder = function(){
         spec.other_entity = spec.other_entity ||
             spec.name.substring(index+1);
 
+        spec.add_title = IPA.messages.association.add[spec.attribute_member];
+        spec.remove_title = IPA.messages.association.remove[spec.attribute_member];
+
         spec.facet_group = spec.facet_group ||
             spec.attribute_member;
 
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 0e775aa0bf1213f8d9ce1aae9a342beeacf8d813..274c52d6839c2ec39ed118ada49084563802aa74 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -134,44 +134,6 @@ IPA.entity_factories.hbacsvcgroup = function() {
         build();
 };
 
-IPA.hbacsvcgroup_member_hbacsvc_table_widget = function(spec) {
-
-    spec = spec || {};
-
-    var that = IPA.association_table_widget(spec);
-
-
-    var column = that.create_column({
-        name: 'cn',
-        primary_key: true,
-        width: '150px',
-        entity:that.entity,
-        link: true
-    });
-
-    that.create_column({
-        name: 'description',
-        entity:that.entity,
-
-        width: '350px'
-    });
-
-    that.create_adder_column({
-        name: 'cn',
-        primary_key: true,
-        width: '100px'
-    });
-
-    that.create_adder_column({
-        name: 'description',
-        width: '100px'
-    });
-
-    return that;
-};
-
-
-
 IPA.hbacrule_details_facet = function(spec) {
 
     spec = spec || {};
@@ -224,15 +186,21 @@ IPA.hbacrule_details_facet = function(spec) {
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-memberuser_user',
-            name: 'memberuser_user', category: category,
-            other_entity: 'user', add_method: 'add_user',
-            remove_method: 'remove_user'
+            name: 'memberuser_user',
+            category: category,
+            add_method: 'add_user',
+            remove_method: 'remove_user',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-memberuser_group',
-            name: 'memberuser_group', category: category,
-            other_entity: 'group', add_method: 'add_user',
-            remove_method: 'remove_user'
+            name: 'memberuser_group',
+            category: category,
+            add_method: 'add_user',
+            remove_method: 'remove_user',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         return section;
     }
@@ -259,15 +227,21 @@ IPA.hbacrule_details_facet = function(spec) {
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-memberhost_host',
-            name: 'memberhost_host', category: category,
-            other_entity: 'host', add_method: 'add_host',
-            remove_method: 'remove_host'
+            name: 'memberhost_host',
+            category: category,
+            add_method: 'add_host',
+            remove_method: 'remove_host',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-memberhost_hostgroup',
-            name: 'memberhost_hostgroup', category: category,
-            other_entity: 'hostgroup', add_method: 'add_host',
-        remove_method: 'remove_host'
+            name: 'memberhost_hostgroup',
+            category: category,
+            add_method: 'add_host',
+            remove_method: 'remove_host',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         return section;
     }
@@ -295,15 +269,21 @@ IPA.hbacrule_details_facet = function(spec) {
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-memberservice_hbacsvc',
-            name: 'memberservice_hbacsvc', category: category,
-            other_entity: 'hbacsvc', add_method: 'add_service',
-            remove_method: 'remove_service'
+            name: 'memberservice_hbacsvc',
+            category: category,
+            add_method: 'add_service',
+            remove_method: 'remove_service',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-memberservice_hbacsvcgroup',
-            name: 'memberservice_hbacsvcgroup', category: category,
-            other_entity: 'hbacsvcgroup', add_method: 'add_service',
-            remove_method: 'remove_service'
+            name: 'memberservice_hbacsvcgroup',
+            category: category,
+            add_method: 'add_service',
+            remove_method: 'remove_service',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         return section;
     }
@@ -330,15 +310,21 @@ IPA.hbacrule_details_facet = function(spec) {
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-sourcehost_host',
-            name: 'sourcehost_host', category: category,
-            other_entity: 'host', add_method: 'add_sourcehost',
-            remove_method: 'remove_sourcehost'
+            name: 'sourcehost_host',
+            category: category,
+            add_method: 'add_sourcehost',
+            remove_method: 'remove_sourcehost',
+            add_title: IPA.messages.association.add.sourcehost,
+            remove_title: IPA.messages.association.remove.sourcehost
         }));
         section.add_field(IPA.rule_association_table_widget({
             id: that.entity.name+'-sourcehost_hostgroup',
-            name: 'sourcehost_hostgroup', category: category,
-            other_entity: 'hostgroup', add_method: 'add_sourcehost',
-            remove_method: 'remove_sourcehost'
+            name: 'sourcehost_hostgroup',
+            category: category,
+            add_method: 'add_sourcehost',
+            remove_method: 'remove_sourcehost',
+            add_title: IPA.messages.association.add.sourcehost,
+            remove_title: IPA.messages.association.remove.sourcehost
         }));
         return section;
     }
diff --git a/install/ui/host.js b/install/ui/host.js
index 05484a030c0199a9aea1d026986651538cca33ec..5a786b016c2f8e98b52b9e3cd9395f46efd533a7 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -73,8 +73,9 @@ IPA.entity_factories.host = function () {
                 ]
             }]}).
         association_facet({
-            factory: IPA.host_managedby_host_facet,
-            name: 'managedby_host'
+            name: 'managedby_host',
+            add_method: 'add_managedby',
+            remove_method: 'remove_managedby'
         }).
         association_facet({
             name: 'memberof_hostgroup',
@@ -622,21 +623,3 @@ IPA.host_certificate_status_widget = function (spec) {
 
     return that;
 };
-
-IPA.host_managedby_host_facet = function (spec) {
-
-    spec = spec || {};
-
-    var that = IPA.association_facet(spec);
-
-    that.add_method = 'add_managedby';
-    that.remove_method = 'remove_managedby';
-
-    that.create_adder_column({
-        name: 'fqdn',
-        primary_key: true,
-        width: '200px'
-    });
-
-    return that;
-};
diff --git a/install/ui/service.js b/install/ui/service.js
index 6128dd1f6d7fecb627d44053cf69c7f67bec133b..eef90911529aba4a67fe27cbefa51090a5650168 100644
--- a/install/ui/service.js
+++ b/install/ui/service.js
@@ -64,7 +64,6 @@ IPA.entity_factories.service = function() {
                 }]
             }]}).
         association_facet({
-            factory: IPA.service_managedby_host_facet,
             name: 'managedby_host',
             add_method: 'add_host',
             remove_method: 'remove_host'
@@ -340,20 +339,3 @@ IPA.service_certificate_status_widget = function (spec) {
 
     return that;
 };
-
-IPA.service_managedby_host_facet = function(spec) {
-
-    spec = spec || {};
-
-    var that = IPA.association_facet(spec);
-
-    that.create_adder_column({
-        name: 'fqdn',
-        label: IPA.messages.objects.service.host,
-        primary_key: true,
-        width: '200px'
-    });
-
-
-    return that;
-};
\ No newline at end of file
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 280bec4740ef8b860ab3ba332c8bb7402dc44a97..5af5a8d234c28ec26826c0457511224edbf6d865 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -124,117 +124,8 @@ IPA.entity_factories.sudocmdgroup = function() {
         build();
 };
 
-
-/*
-* TODO:  user the serial associator to perform back end operations.
-*/
-IPA.sudocmd_member_sudocmdgroup_table_widget = function(spec) {
-
-    spec = spec || {};
-
-    var that = IPA.association_table_widget(spec);
-
-    that.get_records = function(on_success, on_error) {
-
-        var length = that.values.length;
-        if (!length) return;
-
-        if (length > 100) {
-            length = 100;
-        }
-
-        if (!that.values.length) return;
-
-        var batch = IPA.batch_command({
-            'name': that.entity.name+'_'+that.name+'_show',
-            'on_success': on_success,
-            'on_error': on_error
-        });
-
-        for (var i=0; i<length; i++) {
-            var value = that.values[i];
-
-            var command = IPA.command({
-                entity: that.other_entity,
-                method: 'show',
-                args: [value],
-                options: {
-                    all: true,
-                    rights: true
-                }
-            });
-
-            batch.add_command(command);
-        }
-
-        batch.execute();
-    };
-
-    that.add = function(values, on_success, on_error) {
-
-        if (!values.length) return;
-
-        var batch = IPA.batch_command({
-            'name': that.entity.name+'_'+that.name+'_add',
-            'on_success': on_success,
-            'on_error': on_error
-        });
-
-        var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
-
-        for (var i=0; i<values.length; i++) {
-            var value = values[i];
-
-            var command = IPA.command({
-                entity: that.other_entity,
-                method: 'add_member',
-                args: [value]
-            });
-
-            command.set_option('sudocmd', pkey);
-
-            batch.add_command(command);
-        }
-
-        batch.execute();
-    };
-
-    that.remove = function(values, on_success, on_error) {
-
-        if (!values.length) return;
-
-        var batch = IPA.batch_command({
-            'name': that.entity.name+'_'+that.name+'_remove',
-            'on_success': on_success,
-            'on_error': on_error
-        });
-
-        var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
-
-        for (var i=0; i<values.length; i++) {
-            var value = values[i];
-
-            var command = IPA.command({
-                entity: that.other_entity,
-                method: 'remove_member',
-                args: [value]
-            });
-
-            command.set_option('sudocmd', pkey);
-
-            batch.add_command(command);
-        }
-
-        batch.execute();
-    };
-
-    return that;
-};
-
-
 IPA.sudo = {};
 
-
 IPA.sudorule_details_facet = function(spec) {
 
     spec = spec || {};
@@ -294,21 +185,25 @@ IPA.sudorule_details_facet = function(spec) {
             name: 'usercategory'
         }));
         section.add_field(IPA.sudorule_association_table_widget({
-            'id': that.entity.name+'-memberuser_user',
+            id: that.entity.name+'-memberuser_user',
             entity: that.entity,
-            'name': 'memberuser_user', 'category': category,
-            'other_entity': 'user',
-            'add_method': 'add_user',
-            'remove_method': 'remove_user',
-            'external': 'externaluser'
+            name: 'memberuser_user',
+            category: category,
+            add_method: 'add_user',
+            remove_method: 'remove_user',
+            external: 'externaluser',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         section.add_field(IPA.sudorule_association_table_widget({
-            'id': that.entity.name+'-memberuser_group',
+            id: that.entity.name+'-memberuser_group',
             entity: that.entity,
-            'name': 'memberuser_group', 'category': category,
-            'other_entity': 'group',
-            'add_method': 'add_user',
-            'remove_method': 'remove_user'
+            name: 'memberuser_group',
+            category: category,
+            add_method: 'add_user',
+            remove_method: 'remove_user',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         return section;
     }
@@ -334,17 +229,25 @@ IPA.sudorule_details_facet = function(spec) {
             name: 'hostcategory'
         }));
         section.add_field(IPA.sudorule_association_table_widget({
-            'id': that.entity.name+'-memberhost_host',
+            id: that.entity.name+'-memberhost_host',
             entity: that.entity,
-            'name': 'memberhost_host', 'category': category,
-            'other_entity': 'host', 'add_method': 'add_host', 'remove_method': 'remove_host',
-            'external': 'externalhost'
+            name: 'memberhost_host',
+            category: category,
+            add_method: 'add_host',
+            remove_method: 'remove_host',
+            external: 'externalhost',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         section.add_field(IPA.sudorule_association_table_widget({
-            'id': that.entity.name+'-memberhost_hostgroup',
+            id: that.entity.name+'-memberhost_hostgroup',
             entity: that.entity,
-            'name': 'memberhost_hostgroup', 'category': category,
-            'other_entity': 'hostgroup', 'add_method': 'add_host', 'remove_method': 'remove_host'
+            name: 'memberhost_hostgroup',
+            category: category,
+            add_method: 'add_host',
+            remove_method: 'remove_host',
+            add_title: IPA.messages.association.add.member,
+            remove_title: IPA.messages.association.remove.member
         }));
         return section;
     }
@@ -778,35 +681,39 @@ IPA.sudo.rule_details_command_section = function(spec) {
             }));
 
         that.add_field(IPA.rule_association_table_widget({
-            'id': that.entity.name+'-memberallowcmd_sudocmd',
-            'name': 'memberallowcmd_sudocmd',
-            'category': that.category,
-            'other_entity': 'sudocmd',
-            'add_method': 'add_allow_command',
-            'remove_method': 'remove_allow_command'
+            id: that.entity.name+'-memberallowcmd_sudocmd',
+            name: 'memberallowcmd_sudocmd',
+            category: that.category,
+            add_method: 'add_allow_command',
+            remove_method: 'remove_allow_command',
+            add_title: IPA.messages.association.add.memberallowcmd,
+            remove_title: IPA.messages.association.remove.memberallowcmd
         }));
         that.add_field(IPA.rule_association_table_widget({
-            'id': that.entity.name+'-memberallowcmd_sudocmdgroup',
-            'name': 'memberallowcmd_sudocmdgroup',
-            'category': that.category,
-            'other_entity': 'sudocmdgroup',
-            'add_method': 'add_allow_command',
-            'remove_method': 'remove_allow_command'
+            id: that.entity.name+'-memberallowcmd_sudocmdgroup',
+            name: 'memberallowcmd_sudocmdgroup',
+            category: that.category,
+            add_method: 'add_allow_command',
+            remove_method: 'remove_allow_command',
+            add_title: IPA.messages.association.add.memberallowcmd,
+            remove_title: IPA.messages.association.remove.memberallowcmd
         }));
 
         that.add_field(IPA.rule_association_table_widget({
-            'id': that.entity.name+'-memberdenycmd_sudocmd',
-            'name': 'memberdenycmd_sudocmd',
-            'other_entity': 'sudocmd',
-            'add_method': 'add_deny_command',
-            'remove_method': 'remove_deny_command'
+            id: that.entity.name+'-memberdenycmd_sudocmd',
+            name: 'memberdenycmd_sudocmd',
+            add_method: 'add_deny_command',
+            remove_method: 'remove_deny_command',
+            add_title: IPA.messages.association.add.memberdenycmd,
+            remove_title: IPA.messages.association.remove.memberdenycmd
         }));
         that.add_field(IPA.rule_association_table_widget({
-            'id': that.entity.name+'-memberdenycmd_sudocmdgroup',
-            'name': 'memberdenycmd_sudocmdgroup',
-            'other_entity': 'sudocmdgroup',
-            'add_method': 'add_deny_command',
-            'remove_method': 'remove_deny_command'
+            id: that.entity.name+'-memberdenycmd_sudocmdgroup',
+            name: 'memberdenycmd_sudocmdgroup',
+            add_method: 'add_deny_command',
+            remove_method: 'remove_deny_command',
+            add_title: IPA.messages.association.add.memberdenycmd,
+            remove_title: IPA.messages.association.remove.memberdenycmd
         }));
     }
 
@@ -945,17 +852,19 @@ IPA.sudo.rule_details_runas_section = function(spec) {
             id: that.entity.name+'-runasruser_user',
             name: 'ipasudorunas_user',
             category: category,
-            other_entity: 'user',
             add_method: 'add_runasuser',
-            remove_method: 'remove_runasuser'
+            remove_method: 'remove_runasuser',
+            add_title: IPA.messages.association.add.ipasudorunas,
+            remove_title: IPA.messages.association.remove.ipasudorunas
         }));
         that.add_field(IPA.sudorule_association_table_widget({
             id: that.entity.name+'-runasuser_group',
             name: 'ipasudorunas_group',
             category: category,
-            other_entity: 'group',
             add_method: 'add_runasuser',
-            remove_method: 'remove_runasuser'
+            remove_method: 'remove_runasuser',
+            add_title: IPA.messages.association.add.ipasudorunas,
+            remove_title: IPA.messages.association.remove.ipasudorunas
         }));
 
         category = that.add_field(
@@ -977,9 +886,10 @@ IPA.sudo.rule_details_runas_section = function(spec) {
             id: that.entity.name+'-runasgroup_group',
             name: 'ipasudorunasgroup_group',
             category: category,
-            other_entity: 'group',
             add_method: 'add_runasgroup',
-            remove_method: 'remove_runasgroup'
+            remove_method: 'remove_runasgroup',
+            add_title: IPA.messages.association.add.ipasudorunasgroup,
+            remove_title: IPA.messages.association.remove.ipasudorunasgroup
         }));
     }
 
@@ -1118,7 +1028,7 @@ IPA.sudorule_association_table_widget = function(spec) {
 
         var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
 
-        var title = IPA.messages.association.add;
+        var title = that.add_title;
         title = title.replace('${other_entity}', IPA.metadata.objects[that.other_entity].label);
         title = title.replace('${entity}', IPA.metadata.objects[that.entity.name].label_singular);
         title = title.replace('${primary_key}', pkey);
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index bd3255054745eb749ea768f2892727052e46f346..ed7aa73cc781146140931ad42b2258df7c976c07 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -15840,12 +15840,30 @@
                         "401": "Your Kerberos ticket is no longer valid. Please run kinit and then click 'Retry'. If this is your first time running the IPA Web UI <a href='/ipa/config/unauthorized.html'>follow these directions</a> to configure your browser."
                     },
                     "association": {
-                        "add": "Add ${other_entity} into ${entity} ${primary_key}",
+                        "add": {
+                            "ipasudorunas": "Add RunAs ${other_entity} into ${entity} ${primary_key}",
+                            "ipasudorunasgroup": "Add RunAs Groups into ${entity} ${primary_key}",
+                            "member": "Add ${other_entity} into ${entity} ${primary_key}",
+                            "memberallowcmd": "Add Allow ${other_entity} into ${entity} ${primary_key}",
+                            "memberdenycmd": "Add Deny ${other_entity} into ${entity} ${primary_key}",
+                            "memberof": "Add ${entity} ${primary_key} into ${other_entity}",
+                            "managedby": "Add ${other_entity} Managing ${entity} ${primary_key}",
+                            "sourcehost": "Add Source ${other_entity} into ${entity} ${primary_key}"
+                        },
                         "direct_enrollment": "Direct Enrollment",
                         "indirect_enrollment": "Indirect Enrollment",
                         "no_entries": "No entries.",
                         "paging": "Showing ${start} to ${end} of ${total} entries.",
-                        "remove": "Remove ${other_entity} from ${entity} ${primary_key}",
+                        "remove": {
+                            "ipasudorunas": "Remove RunAs ${other_entity} from ${entity} ${primary_key}",
+                            "ipasudorunasgroup": "Remove RunAs Groups from ${entity} ${primary_key}",
+                            "member": "Remove ${other_entity} from ${entity} ${primary_key}",
+                            "memberallowcmd": "Remove Allow ${other_entity} from ${entity} ${primary_key}",
+                            "memberdenycmd": "Remove Deny ${other_entity} from ${entity} ${primary_key}",
+                            "memberof": "Remove ${entity} ${primary_key} from ${other_entity}",
+                            "managedby": "Remove ${other_entity} Managing ${entity} ${primary_key}",
+                            "sourcehost": "Remove Source ${other_entity} from ${entity} ${primary_key}"
+                        },
                         "show_results": "Show Results"
                     },
                     "buttons": {
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 84d8fd3fa6f966c636ff46cdd4ff38e29a60957f..0689aeb349c01b9268bda5e9badca9b67d00e8f2 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -401,12 +401,30 @@ class i18n_messages(Command):
             "automount":_("Automount")
             },
         "association": {
-            "add":_("Add ${other_entity} into ${entity} ${primary_key}"),
+            "add": {
+                "ipasudorunas":_("Add RunAs ${other_entity} into ${entity} ${primary_key}"),
+                "ipasudorunasgroup":_("Add RunAs Groups into ${entity} ${primary_key}"),
+                "member":_("Add ${other_entity} into ${entity} ${primary_key}"),
+                "memberallowcmd":_("Add Allow ${other_entity} into ${entity} ${primary_key}"),
+                "memberdenycmd":_("Add Deny ${other_entity} into ${entity} ${primary_key}"),
+                "memberof":_("Add ${entity} ${primary_key} into ${other_entity}"),
+                "managedby":_("Add ${other_entity} Managing ${entity} ${primary_key}"),
+                "sourcehost":_("Add Source ${other_entity} into ${entity} ${primary_key}"),
+            },
             "direct_enrollment":_("Direct Enrollment"),
             "indirect_enrollment":_("Indirect Enrollment"),
             "no_entries":_("No entries."),
             "paging":_("Showing ${start} to ${end} of ${total} entries."),
-            "remove":_("Remove ${other_entity} from ${entity} ${primary_key}"),
+            "remove": {
+                "ipasudorunas":_("Remove RunAs ${other_entity} from ${entity} ${primary_key}"),
+                "ipasudorunasgroup":_("Remove RunAs Groups from ${entity} ${primary_key}"),
+                "member":_("Remove ${other_entity} from ${entity} ${primary_key}"),
+                "memberallowcmd":_("Remove Allow ${other_entity} from ${entity} ${primary_key}"),
+                "memberdenycmd":_("Remove Deny ${other_entity} from ${entity} ${primary_key}"),
+                "memberof":_("Remove ${entity} ${primary_key} from ${other_entity}"),
+                "managedby":_("Remove ${other_entity} Managing ${entity} ${primary_key}"),
+                "sourcehost":_("Remove Source ${other_entity} from ${entity} ${primary_key}"),
+            },
             "show_results":_("Show Results"),
             },
         "widget": {
-- 
1.7.5.1

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

Reply via email to