From 36e4f00c56b3a11f99c6dd1b253fb87479473290 Mon Sep 17 00:00:00 2001 From: bfederle Date: Tue, 7 Feb 2012 13:56:10 -0800 Subject: [PATCH] Add projects tab pre-filter; misc. fixes --- ui/scripts/projects.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 5c954c71041..35175c5b2b1 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -299,14 +299,7 @@ data: args.data, args.response.success({ _custom: { - jobId: data.addaccounttoprojectresponse.jobid, - onComplete: function(json) { - if (args.data.email) { - cloudStack.dialog.notice({ - message: 'Invitation sent to ' + args.data.email - }); - } - } + jobId: data.addaccounttoprojectresponse.jobid }, notification: { label: 'Invited user to project', @@ -358,6 +351,7 @@ $.ajax({ url: createURL('listProjectInvitations', { ignoreProject: true }), data: { + state: 'Pending', listAll: true, projectId: args.context.projects[0].id }, @@ -783,6 +777,16 @@ } } }, + tabFilter: function(args) { + var project = args.context.projects[0]; + var projectOwner = project.account; + var currentAccount = args.context.users[0].account; + + if ((!isAdmin() && !isDomainAdmin()) && + (currentAccount != projectOwner)) return ['accounts', 'invitations', 'resources']; + + return []; + }, tabs: { details: { title: 'Details', @@ -883,9 +887,6 @@ $.ajax({ url: createURL('listProjectInvitations'), data: { - listAll: true, - account: cloudStack.context.users[0].account, - domainid: cloudStack.context.users[0].domainid, state: 'Pending' }, success: function(data) {