From ea8cc3693c49438a114fecc45abfb0417fe66080 Mon Sep 17 00:00:00 2001 From: marcelo Date: Tue, 30 Apr 2013 16:14:04 -0400 Subject: [PATCH] BUG 11246 "P.M.2.0.46Testing11: Department's supervisor's flaws" SOLVED -When you set a user as supervisor in: Admin/User/Departaments, if i made a mistake and i dont want any user to be the departments supervisor, there should be an Unset Supervisor option. When you add users to the department, the last user that its added is set up as supervisor. -Updgraded, according to the modules original design, there should always be a departments supervisor, thats why all the asked options are not being added. It has been made an upgrade to the clauses so there should always be a departments supervisor. --- .../engine/templates/departments/departmentUsers.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/workflow/engine/templates/departments/departmentUsers.js b/workflow/engine/templates/departments/departmentUsers.js index 76833d68d..e190020ae 100755 --- a/workflow/engine/templates/departments/departmentUsers.js +++ b/workflow/engine/templates/departments/departmentUsers.js @@ -341,10 +341,13 @@ DDLoadUsers = function(){ var records = ddSource.dragData.selections; var arrAux = new Array(); for (var r=0; r < records.length; r++){ - arrAux[r] = records[r].data['USR_UID']; + if (records[r].data['USR_SUPERVISOR']==false) { + arrAux[r] = records[r].data['USR_UID']; + }else{ + PMExt.notify(_('ID_DEPARTMENTS'),_('ID_DELETE_SUPERVISOR')); + }; } DeleteDepartmentUser(arrAux,RefreshUsers,FailureProcess); - return true; } }); @@ -427,7 +430,11 @@ RemoveGroupsAction = function(){ rowsSelected = assignedGrid.getSelectionModel().getSelections(); var arrAux = new Array(); for(var a=0; a < rowsSelected.length; a++){ - arrAux[a] = rowsSelected[a].get('USR_UID'); + if (rowsSelected[a].get('USR_SUPERVISOR')==false) { + arrAux[a] = rowsSelected[a].get('USR_UID'); + }else{ + PMExt.notify(_('ID_DEPARTMENTS'),_('ID_DELETE_SUPERVISOR')); + }; } DeleteDepartmentUser(arrAux,RefreshUsers,FailureProcess); };