This is an automated email from the ASF dual-hosted git repository. jfthomps pushed a commit to branch VCL-1116_use_database_hostnames_for_ad_joined_computers in repository https://gitbox.apache.org/repos/asf/vcl.git
The following commit(s) were added to refs/heads/VCL-1116_use_database_hostnames_for_ad_joined_computers by this push: new 4724fdb VCL-1116 - use database hostnames for ad joined computers 4724fdb is described below commit 4724fdb35dadf70e776dc77db18d9e0c64c8fea3 Author: Josh Thompson <jftho...@ncsu.edu> AuthorDate: Tue Jul 9 15:47:59 2019 -0400 VCL-1116 - use database hostnames for ad joined computers addomain.php: modified fieldDisplayName: added case for usedbhostnames addomain.js: -added ADdomain.prototype.colformatter to set displayed value for Use Database Hostnames field to 'true' or 'false' -modified inlineEditResourceCB: always set value for usedbhostnames instead of only setting it when it is set to 1 -modified saveResourceCB: set usedbhostnames for the item in the dojo store when saving an item --- web/.ht-inc/addomain.php | 2 ++ web/js/resources/addomain.js | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/web/.ht-inc/addomain.php b/web/.ht-inc/addomain.php index 7e9f5a1..f86ebf7 100644 --- a/web/.ht-inc/addomain.php +++ b/web/.ht-inc/addomain.php @@ -119,6 +119,8 @@ class ADdomain extends Resource { return 'Domain DNS Name'; case 'dnsservers': return 'DNS Server(s)'; + case 'usedbhostnames': + return 'Use Database Hostnames'; } return ucfirst($field); } diff --git a/web/js/resources/addomain.js b/web/js/resources/addomain.js index e782586..cffbf94 100644 --- a/web/js/resources/addomain.js +++ b/web/js/resources/addomain.js @@ -21,6 +21,16 @@ function ADdomain() { } ADdomain.prototype = new Resource(); +ADdomain.prototype.colformatter = function(value, rowIndex, obj) { + if(obj.field == 'usedbhostnames') { + if(value == "0") + return '<span class="rederrormsg">' + _('false') + '</span>'; + if(value == "1") + return '<span class="ready">' + _('true') + '</span>'; + } + return value; +} + var resource = new ADdomain(); function addNewResource(title) { @@ -44,9 +54,7 @@ function inlineEditResourceCB(data, ioArgs) { dijit.byId('domaindnsname').set('value', data.items.data.domaindnsname); dijit.byId('username').set('value', data.items.data.username); dijit.byId('dnsservers').set('value', data.items.data.dnsservers); - if(data.items.data.usedbhostnames == 1) { - dijit.byId('usedbhostnames').set('checked', data.items.data.usedbhostnames) - } + dijit.byId('usedbhostnames').set('checked', parseInt(data.items.data.usedbhostnames)) dijit.byId('password').set('value', '********'); dijit.byId('password2').set('value', 'xxxxxxxx'); @@ -132,7 +140,7 @@ function saveResourceCB(data, ioArgs) { resourcegrid.store.fetch({ query: {id: data.items.data.id}, onItem: function(item) { - var fields = ['name', 'owner', 'domaindnsname', 'username','dnsservers']; + var fields = ['name', 'owner', 'domaindnsname', 'username', 'usedbhostnames', 'dnsservers']; for(var i = 0; i < fields.length; i++) { dijit.byId(fields[i]).reset(); resourcegrid.store.setValue(item, fields[i], data.items.data[fields[i]]);