Fixed permission page issues.

This commit is contained in:
chouseknecht 2013-06-28 08:16:20 -04:00
parent de4fac5548
commit 7065086a1c
5 changed files with 33 additions and 26 deletions

View File

@ -1,7 +1,7 @@
function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath)
ClearScope, ProcessErrors, GetBasePath, CheckAccess)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@ -22,13 +22,13 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Res
LoadBreadCrumbs();
scope.addPermission = function() {
if (checkAccess()) {
if (CheckAccess()) {
$location.path($location.path() + '/add');
}
}
scope.editPermission = function(id) {
if (checkAccess()) {
if (CheckAccess()) {
$location.path($location.path() + '/' + id);
}
}
@ -60,7 +60,7 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Res
PermissionsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'PermissionList',
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller',
'ClearScope', 'ProcessErrors', 'GetBasePath'
'ClearScope', 'ProcessErrors', 'GetBasePath', 'CheckAccess'
];

View File

@ -126,17 +126,20 @@ angular.module('TeamFormDefinition', [])
label: 'Name',
ngClick: "edit('permissions', \{\{ permission.id \}\}, '\{\{ permission.name \}\}')"
},
inventory: {
label: 'Inventory',
sourceModel: 'inventory',
sourceField: 'name',
ngBind: 'permission.summary_fields.inventory.name',
},
project: {
label: 'Project',
sourceModel: 'project',
sourceField: 'name',
ngBind: 'permission.summary_fields.project.name',
},
inventory: {
label: 'Inventory',
sourceModel: 'inventory',
sourceField: 'name',
ngBind: 'permission.summary_fields.inventory.name',
permission_type: {
label: 'Permission'
}
},

View File

@ -163,18 +163,22 @@ angular.module('UserFormDefinition', [])
label: 'Name',
ngClick: "edit('permissions', \{\{ permission.id \}\}, '\{\{ permission.name \}\}')"
},
inventory: {
label: 'Inventory',
sourceModel: 'inventory',
sourceField: 'name',
ngBind: 'permission.summary_fields.inventory.name',
},
project: {
label: 'Project',
sourceModel: 'project',
sourceField: 'name',
ngBind: 'permission.summary_fields.project.name',
},
inventory: {
label: 'Inventory',
sourceModel: 'inventory',
sourceField: 'name',
ngBind: 'permission.summary_fields.inventory.name',
permission_type: {
label: 'Permission'
}
},
fieldActions: {

View File

@ -60,7 +60,7 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
for (var related in form.related) {
if ( form.related[related].iterator == iterator ) {
var f = form.related[set].fields[fld];
var f = form.related[related].fields[fld];
}
}
@ -71,15 +71,15 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
scope[iterator + 'HideSearchType'] = false;
scope[iterator + 'InputHide'] = false;
if (f.searchType && f.searchType == 'gtzero') {
if (f.searchType !== undefined && f.searchType == 'gtzero') {
scope[iterator + "InputHide"] = true;
}
if (f.searchType && (f.searchType == 'boolean'
if (f.searchType !== undefined && (f.searchType == 'boolean'
|| f.searchType == 'select')) {
scope[iterator + 'SelectShow'] = true;
scope[iterator + 'SearchSelectOpts'] = f.searchOptions;
}
if (f.searchType && f.searchType == 'int') {
if (f.searchType !== undefined && f.searchType == 'int') {
scope[iterator + 'HideSearchType'] = true;
}

View File

@ -24,8 +24,11 @@ angular.module('PermissionListDefinition', [])
label: 'Name',
ngClick: 'editPermission(\{\{ permission.id \}\})'
},
description: {
label: 'Description'
inventory: {
label: 'Inventory',
sourceModel: 'inventory',
sourceField: 'name',
ngBind: 'permission.summary_fields.inventory.name'
},
project: {
label: 'Project',
@ -33,12 +36,9 @@ angular.module('PermissionListDefinition', [])
sourceField: 'name',
ngBind: 'permission.summary_fields.project.name'
},
inventory: {
label: 'Inventory',
sourceModel: 'inventory',
sourceField: 'name',
ngBind: 'permission.summary_fields.inventory.name'
},
permission_type: {
label: 'Permission'
}
},
actions: {