Update Look n Feel and Functionality of User Manager
This commit is contained in:
@@ -52,6 +52,7 @@ class Configurations // extends Configuration
|
||||
{
|
||||
var $aConfig = array();
|
||||
private $Configuration = null;
|
||||
private $UserConfig = null;
|
||||
|
||||
/**
|
||||
* Set Configurations
|
||||
@@ -255,6 +256,33 @@ class Configurations // extends Configuration
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* usersNameFormat
|
||||
* @author Qennix
|
||||
* @param string $username
|
||||
* @param string $firstname
|
||||
* @param string $lastname
|
||||
* @return string User Name Well-Formatted
|
||||
*/
|
||||
|
||||
function usersNameFormat($username, $firstname, $lastname){
|
||||
try{
|
||||
if (!isset($this->UserConfig)) $this->UserConfig = $this->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($this->UserConfig['format'])){
|
||||
$aux = '';
|
||||
$aux = str_replace('@userName', $username, $this->UserConfig['format']);
|
||||
$aux = str_replace('@firstName', $firstname, $aux);
|
||||
$aux = str_replace('@lastName', $lastname, $aux);
|
||||
return $aux;
|
||||
}else{
|
||||
return $username;
|
||||
}
|
||||
}catch(Exception $oError){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setConfig
|
||||
*
|
||||
|
||||
@@ -1194,4 +1194,20 @@ class AppCacheView extends BaseAppCacheView {
|
||||
return ($rowData);
|
||||
}
|
||||
|
||||
//Added By Qennix
|
||||
function getTotalCasesByAllUsers(){
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(AppCacheViewPeer::USR_UID);
|
||||
$oCriteria->addAsColumn('CNT', 'COUNT(DISTINCT(APP_UID))');
|
||||
$oCriteria->addGroupByColumn(AppCacheViewPeer::USR_UID);
|
||||
$Dat = AppCacheViewPeer::doSelectRS ($oCriteria);
|
||||
$Dat->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$aRows = Array();
|
||||
while ($Dat->next()){
|
||||
$row = $Dat->getRow();
|
||||
$aRows[$row['USR_UID']] = $row['CNT'];
|
||||
}
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
} // AppCacheView
|
||||
|
||||
@@ -394,20 +394,36 @@ protected $depo_title = '';
|
||||
|
||||
// select departments
|
||||
// this function is used to draw the hierachy tree view
|
||||
function getDepartments( $DepParent ) {
|
||||
function getDepartments( $DepParent ) {
|
||||
try {
|
||||
$result = array();
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DepartmentPeer::DEP_PARENT, $DepParent, Criteria::EQUAL);
|
||||
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
||||
$objects = DepartmentPeer::doSelect($criteria, $con);
|
||||
global $RBAC;
|
||||
|
||||
foreach( $objects as $oDepartment ) {
|
||||
$node = array();
|
||||
$node['DEP_UID'] = $oDepartment->getDepUid();
|
||||
$node['DEP_PARENT'] = $oDepartment->getDepParent();
|
||||
$node['DEP_TITLE'] = $oDepartment->getDepTitle();
|
||||
$node['DEP_STATUS'] = $oDepartment->getDepStatus();
|
||||
$node['DEP_MANAGER'] = $oDepartment->getDepManager();
|
||||
$node['DEP_LAST'] = 0;
|
||||
|
||||
$manager = $oDepartment->getDepManager();
|
||||
if ($manager != ''){
|
||||
$UserUID = $RBAC->load($manager);
|
||||
$node['DEP_MANAGER_USERNAME'] = $UserUID['USR_USERNAME'];
|
||||
$node['DEP_MANAGER_FIRSTNAME'] = $UserUID['USR_FIRSTNAME'];
|
||||
$node['DEP_MANAGER_LASTNAME'] = $UserUID['USR_LASTNAME'];
|
||||
}else{
|
||||
$node['DEP_MANAGER_USERNAME'] = '';
|
||||
$node['DEP_MANAGER_FIRSTNAME'] = '';
|
||||
$node['DEP_MANAGER_LASTNAME'] = '';
|
||||
}
|
||||
|
||||
$criteriaCount = new Criteria('workflow');
|
||||
$criteriaCount->clearSelectColumns();
|
||||
$criteriaCount->addSelectColumn( 'COUNT(*)' );
|
||||
@@ -556,4 +572,22 @@ protected $depo_title = '';
|
||||
return $c;
|
||||
}
|
||||
|
||||
//Added by Qennix
|
||||
function getAllDepartmentsByUser(){
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn(UsersPeer::USR_UID);
|
||||
$c->addAsColumn('DEP_TITLE', ContentPeer::CON_VALUE);
|
||||
$c->add(ContentPeer::CON_LANG,defined(SYS_LANG)?SYS_LANG:'en');
|
||||
$c->add(ContentPeer::CON_CATEGORY,'DEPO_TITLE');
|
||||
$c->addJoin(UsersPeer::DEP_UID, ContentPeer::CON_ID,Criteria::INNER_JOIN);
|
||||
$Dat = UsersPeer::doSelectRS ($c);
|
||||
$Dat->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$aRows = Array();
|
||||
while ($Dat->next()){
|
||||
$row = $Dat->getRow();
|
||||
$aRows[$row['USR_UID']] = $row['DEP_TITLE'];
|
||||
}
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
} // Department
|
||||
|
||||
@@ -110,4 +110,34 @@ class LoginLog extends BaseLoginLog {
|
||||
}
|
||||
}
|
||||
|
||||
//Added by Qennix
|
||||
function getLastLoginByUser($sUID){
|
||||
$c = new Criteria();
|
||||
$c->addSelectColumn(LoginLogPeer::LOG_INIT_DATE);
|
||||
$c->add(LoginLogPeer::USR_UID,$sUID);
|
||||
$c->setLimit(1);
|
||||
$c->addDescendingOrderByColumn(LoginLogPeer::LOG_INIT_DATE);
|
||||
$Dat = LoginLogPeer::doSelectRS ($c);
|
||||
$Dat->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
$Dat->next();
|
||||
$aRow = $Dat->getRow();
|
||||
return isset($aRow['LOG_INIT_DATE']) ? $aRow['LOG_INIT_DATE'] : '';
|
||||
}
|
||||
|
||||
//Added by Qennix
|
||||
function getLastLoginAllUsers(){
|
||||
$c = new Criteria();
|
||||
$c->addSelectColumn(LoginLogPeer::USR_UID);
|
||||
$c->addAsColumn('LAST_LOGIN', 'MAX(LOG_INIT_DATE)');
|
||||
$c->addGroupByColumn(LoginLogPeer::USR_UID);
|
||||
$Dat = LoginLogPeer::doSelectRS ($c);
|
||||
$Dat->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$aRows = Array();
|
||||
while ($Dat->next()){
|
||||
$row = $Dat->getRow();
|
||||
$aRows[$row['USR_UID']] = $row['LAST_LOGIN'];
|
||||
}
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
} // LoginLog
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* users_List.php
|
||||
* usersGroups.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
@@ -53,20 +53,12 @@ $G_ID_SUB_MENU_SELECTED = 'USERS';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
//$oHeadPublisher->usingExtJs('ux/Ext.ux.fileUploadField');
|
||||
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
||||
|
||||
$labels = G::getTranslations(Array('ID_USERS','ID_ASSIGN','ID_ASSIGN_ALL_GROUPS','ID_REMOVE','ID_REMOVE_ALL_GROUPS',
|
||||
'ID_BACK','ID_GROUP_NAME','ID_AVAILABLE_GROUPS','ID_ASSIGNED_GROUPS','ID_GROUPS','ID_USERS',
|
||||
'ID_MSG_AJAX_FAILURE','ID_PROCESSING','ID_AUTHENTICATION','ID_CLOSE','ID_SAVE','ID_AUTHENTICATION_SOURCE',
|
||||
'ID_AUTHENTICATION_DN','ID_AUTHENTICATION_FORM_TITLE','ID_SELECT_AUTH_SOURCE','ID_SAVE_CHANGES','ID_DISCARD_CHANGES',
|
||||
'ID_ENTER_SEARCH_TERM'));
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
$Config['fullNameFormat'] = isset($configEnv['format']) ? $configEnv['format'] : '@userName';
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
@@ -77,13 +69,23 @@ $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
switch($_REQUEST['type']){
|
||||
case 'summary': $ctab = 0; break;
|
||||
case 'group': $ctab = 1; break;
|
||||
case 'auth': $ctab = 2; break;
|
||||
}
|
||||
|
||||
$users = Array();
|
||||
$users['USR_UID'] = $_GET['uUID'];
|
||||
$users['USR_COMPLETENAME'] = $aRow['USR_LASTNAME'].' '.$aRow['USR_FIRSTNAME'];
|
||||
$users['USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
|
||||
$users['USR_LASTNAME'] = $aRow['USR_LASTNAME'];
|
||||
$users['USR_USERNAME'] = $aRow['USR_USERNAME'];
|
||||
$users['CURRENT_TAB'] = ($_REQUEST['type']=='group') ? 0 : 1;
|
||||
$users['fullNameFormat'] = $Config['fullNameFormat'];
|
||||
$users['CURRENT_TAB'] = $ctab;
|
||||
|
||||
|
||||
$oHeadPublisher->assign('TRANSLATIONS', $labels);
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('USERS', $users);
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
@@ -115,7 +115,6 @@ try {
|
||||
case 'changeView':
|
||||
$_SESSION['iType'] = $_POST['TU_TYPE'];
|
||||
break;
|
||||
|
||||
case 'deleteGroup':
|
||||
G::LoadClass('groups');
|
||||
$oGroup = new Groups();
|
||||
@@ -125,28 +124,24 @@ try {
|
||||
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'showUserGroupInterface':
|
||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'users/users_AssignGroup' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'showUserGroups':
|
||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'assignUserToGroup':
|
||||
G::LoadClass('groups');
|
||||
$oGroup = new Groups();
|
||||
$oGroup->addUserToGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
||||
echo '<div align="center"><h2><font color="blue">'.G::LoadTranslation('ID_MSG_ASSIGN_DONE').'</font></h2></div>';
|
||||
break;
|
||||
|
||||
case 'usersGroup':
|
||||
G::LoadClass('groups');
|
||||
$oGroup = new Groups();
|
||||
@@ -161,17 +156,14 @@ try {
|
||||
$USR_UID = $_POST['uUID'];
|
||||
$total = 0;
|
||||
$history = 0;
|
||||
|
||||
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
|
||||
$total += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
|
||||
$total += ApplicationPeer::doCount($c);
|
||||
|
||||
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
||||
$history += ApplicationPeer::doCount($c);
|
||||
|
||||
$response = '{success: true, candelete: ';
|
||||
$response .= ($total > 0) ? 'false' : 'true';
|
||||
$response .= ', hashistory: ';
|
||||
@@ -190,7 +182,6 @@ try {
|
||||
$RBAC->changeUserStatus($UID, 'CLOSED');
|
||||
$_GET['USR_USERNAME']='';
|
||||
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aFields = $oUser->load($UID);
|
||||
@@ -246,7 +237,6 @@ try {
|
||||
$criteria = $RBAC->getAllAuthSources();
|
||||
$objects = AuthenticationSourcePeer::doSelectRS($criteria);
|
||||
$objects->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$started = Array();
|
||||
$started['AUTH_SOURCE_UID'] = '00000000000000000000000000000000';
|
||||
$started['AUTH_SOURCE_NAME'] = 'ProcessMaker';
|
||||
@@ -300,6 +290,130 @@ try {
|
||||
$RBAC->updateUser($aData);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'usersList':
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/LoginLog.php';
|
||||
require_once 'classes/model/Department.php';
|
||||
require_once 'classes/model/AppCacheView.php';
|
||||
G::LoadClass('configuration');
|
||||
$co = new Configurations();
|
||||
$config = $co->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$env = $co->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
||||
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
if ($filter != ''){
|
||||
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)));
|
||||
$oCriteria->add($cc);
|
||||
}
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
$oDataset = UsersPeer::DoSelectRs ($oCriteria);
|
||||
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$row = $oDataset->getRow();
|
||||
$totalRows = $row['CNT'];
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_ROLE);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_STATUS);
|
||||
$oCriteria->addSelectColumn(UsersPeer::DEP_UID);
|
||||
$oCriteria->addAsColumn('LAST_LOGIN', 0);
|
||||
$oCriteria->addAsColumn('DEP_TITLE', 0);
|
||||
$oCriteria->addAsColumn('TOTAL_CASES', 0);
|
||||
$oCriteria->addAsColumn('DUE_DATE_OK', 1);
|
||||
$sep = "'";
|
||||
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
|
||||
if ($filter != ''){
|
||||
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME,'%'.$filter.'%',Criteria::LIKE)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME,'%'.$filter.'%',Criteria::LIKE)));
|
||||
$oCriteria->add($cc);
|
||||
}
|
||||
$oCriteria->setOffset($start);
|
||||
$oCriteria->setLimit($limit);
|
||||
$oDataset = UsersPeer::DoSelectRs ($oCriteria);
|
||||
$oDataset->setFetchmode (ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$Login = new LoginLog();
|
||||
$aLogin = $Login->getLastLoginAllUsers();
|
||||
$Cases = new AppCacheView();
|
||||
$aCases = $Cases->getTotalCasesByAllUsers();
|
||||
$Department = new Department();
|
||||
$aDepart = $Department->getAllDepartmentsByUser();
|
||||
|
||||
$dateFormat = $env['dateFormat'];
|
||||
|
||||
$rows = Array();
|
||||
while($oDataset->next()){
|
||||
$rows[] = $oDataset->getRow();
|
||||
$index = sizeof($rows) - 1;
|
||||
$rows[$index]['DUE_DATE_OK'] = (date('Y-m-d')>date('Y-m-d',strtotime($rows[$index]['USR_DUE_DATE'])))? 0 : 1;
|
||||
$rows[$index]['LAST_LOGIN'] = isset($aLogin[$rows[$index]['USR_UID']]) ? $aLogin[$rows[$index]['USR_UID']] : '';
|
||||
$rows[$index]['TOTAL_CASES'] = isset($aCases[$rows[$index]['USR_UID']]) ? $aCases[$rows[$index]['USR_UID']] : 0;
|
||||
$rows[$index]['DEP_TITLE'] = isset($aDepart[$rows[$index]['USR_UID']]) ? $aDepart[$rows[$index]['USR_UID']] : '';
|
||||
$rows[$index]['LAST_LOGIN'] = ($rows[$index]['LAST_LOGIN'] != '') ? date($dateFormat,strtotime($rows[$index]['LAST_LOGIN'])) : $rows[$index]['LAST_LOGIN'];
|
||||
$rows[$index]['USR_DUE_DATE'] = ($rows[$index]['USR_DUE_DATE'] != '') ? date($dateFormat,strtotime($rows[$index]['USR_DUE_DATE'])) : $rows[$index]['USR_DUE_DATE'];
|
||||
}
|
||||
echo '{users: '.G::json_encode($rows).', total_users: '.$totalRows.'}';
|
||||
break;
|
||||
case 'updatePageSize':
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$arr['pageSize'] = $_REQUEST['size'];
|
||||
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||
$config = Array();
|
||||
$config[] = $arr;
|
||||
$c->aConfig = $config;
|
||||
$c->saveConfig('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
echo '{success: true}';
|
||||
break;
|
||||
case 'summaryUserData':
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Department.php';
|
||||
require_once 'classes/model/AppCacheView.php';
|
||||
G::LoadClass('configuration');
|
||||
$oUser = new Users();
|
||||
$data = $oUser->load($_REQUEST['USR_UID']);
|
||||
$oAppCache = new AppCacheView();
|
||||
$aTypes = Array();
|
||||
$aTypes['to_do'] = 'CASES_INBOX';
|
||||
$aTypes['draft'] = 'CASES_DRAFT';
|
||||
$aTypes['cancelled'] = 'CASES_CANCELLED';
|
||||
$aTypes['sent'] = 'CASES_SENT';
|
||||
$aTypes['paused'] = 'CASES_PAUSED';
|
||||
$aTypes['completed'] = 'CASES_COMPLETED';
|
||||
$aTypes['selfservice'] = 'CASES_SELFSERVICE';
|
||||
$aCount = $oAppCache->getAllCounters( array_keys($aTypes), $_REQUEST['USR_UID']);
|
||||
$dep = new Department();
|
||||
if ($dep->existsDepartment($data['DEP_UID'])){
|
||||
$dep->Load($data['DEP_UID']);
|
||||
$dep_name = $dep->getDepTitle();
|
||||
}else{
|
||||
$dep_name = '';
|
||||
}
|
||||
if ($data['USR_REPLACED_BY']!=''){
|
||||
$user = new Users();
|
||||
$u = $user->load($data['USR_REPLACED_BY']);
|
||||
$c = new Configurations();
|
||||
$replaced_by = $c->usersNameFormat($u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME']);
|
||||
}else{
|
||||
$replaced_by = '';
|
||||
}
|
||||
$misc = Array();
|
||||
$misc['DEP_TITLE'] = $dep_name;
|
||||
$misc['REPLACED_NAME'] = $replaced_by;
|
||||
echo '{success: true, userdata: '.G::json_encode($data).', cases: '.G::json_encode($aCount).', misc: '.G::json_encode($misc).'}';
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
|
||||
@@ -46,6 +46,7 @@ if( $access != 1 ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
@@ -53,17 +54,17 @@ $G_ID_SUB_MENU_SELECTED = 'USERS';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
G::LoadClass('configuration');
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
$Config['fullNameFormat'] = isset($configEnv['format']) ? $configEnv['format'] : '@userName';
|
||||
$Config['dateFormat'] = isset($configEnv['dateFormat']) ? $configEnv['dateFormat'] : 'Y/m/d';
|
||||
|
||||
//$oHeadPublisher->usingExtJs('ux/Ext.ux.fileUploadField');
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('users/usersList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('users/usersList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
|
||||
$labels = G::getTranslations(Array('ID_USERS','ID_EDIT','ID_DELETE','ID_NEW','ID_GROUPS','ID_USERS_DELETE_WITH_HISTORY',
|
||||
'ID_USER_NAME','ID_PHOTO','ID_EMAIL','ID_FULL_NAME','ID_SEARCH','ID_ENTER_SEARCH_TERM',
|
||||
'ID_ROLE','ID_DUE_DATE','ID_CANNOT_DELETE_ADMIN_USER','ID_CONFIRM','ID_MSG_CONFIRM_DELETE_USER',
|
||||
'ID_MSG_CANNOT_DELETE_USER','ID_USERS_SUCCESS_DELETE','ID_AUTHENTICATION'));
|
||||
|
||||
$oHeadPublisher->assign('TRANSLATIONS', $labels);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @author: Qennix
|
||||
* Jan 25th, 2011
|
||||
*/
|
||||
* @author: Qennix
|
||||
* Jan 25th, 2011
|
||||
*/
|
||||
|
||||
//Keyboard Events
|
||||
new Ext.KeyMap(document, {
|
||||
@@ -26,16 +26,13 @@ var storeA;
|
||||
var cmodelP;
|
||||
var smodelA;
|
||||
var smodelP;
|
||||
|
||||
var availableGrid;
|
||||
var assignedGrid;
|
||||
|
||||
var GroupsPanel;
|
||||
var AuthenticationPanel;
|
||||
var northPanel;
|
||||
var tabsPanel;
|
||||
var viewport;
|
||||
|
||||
var assignButton;
|
||||
var assignAllButton;
|
||||
var removeButton;
|
||||
@@ -43,45 +40,46 @@ var removeAllButton;
|
||||
var backButton;
|
||||
var discardChangesButton;
|
||||
var saveChangesButton;
|
||||
|
||||
var sw_func_groups;
|
||||
//var sw_func_reassign;
|
||||
var sw_func_auth;
|
||||
var sw_form_changed;
|
||||
var sw_user_summary;
|
||||
|
||||
Ext.onReady(function(){
|
||||
|
||||
sw_func_groups = false;
|
||||
//sw_func_reassign = false;
|
||||
sw_func_auth = false;
|
||||
sw_user_summary = false;
|
||||
|
||||
assignAllButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_ASSIGN_ALL_GROUPS,
|
||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
||||
handler: AssignAllGroupsAction
|
||||
editMembersButton = new Ext.Action({
|
||||
text: _('ID_EDIT_MEMBEROF'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_user_add',
|
||||
handler: EditMembersAction
|
||||
});
|
||||
|
||||
removeAllButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_REMOVE_ALL_GROUPS,
|
||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||
handler: RemoveAllGroupsAction
|
||||
cancelEditMembersButton = new Ext.Action({
|
||||
text: _('ID_FINISH_EDITION'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_cancel',
|
||||
handler: CancelEditMenbersAction,
|
||||
hidden: true
|
||||
});
|
||||
|
||||
backButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_BACK,
|
||||
text : _('ID_BACK'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||
handler: BackToUsers
|
||||
});
|
||||
|
||||
saveChangesButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_SAVE_CHANGES,
|
||||
text: _('ID_SAVE_CHANGES'),
|
||||
//iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||
handler: SaveChangesAuthForm,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
discardChangesButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_DISCARD_CHANGES,
|
||||
text: _('ID_DISCARD_CHANGES'),
|
||||
//iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||
handler: LoadAuthForm,
|
||||
disabled: true
|
||||
@@ -122,7 +120,7 @@ Ext.onReady(function(){
|
||||
},
|
||||
columns: [
|
||||
{id:'GRP_UID', dataIndex: 'GRP_UID', hidden:true, hideable:false},
|
||||
{header: TRANSLATIONS.ID_GROUP_NAME, dataIndex: 'CON_VALUE', width: 60, align:'left'}
|
||||
{header: _('ID_GROUP_NAME'), dataIndex: 'CON_VALUE', width: 60, align:'left'}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -155,7 +153,7 @@ Ext.onReady(function(){
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 110,
|
||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
@@ -176,7 +174,7 @@ Ext.onReady(function(){
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 110,
|
||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
@@ -213,9 +211,10 @@ Ext.onReady(function(){
|
||||
frame : false,
|
||||
columnLines : false,
|
||||
viewConfig : {forceFit:true},
|
||||
tbar: [TRANSLATIONS.ID_AVAILABLE_GROUPS,{xtype: 'tbfill'},'-',searchTextA,clearTextButtonA],
|
||||
bbar: [{xtype: 'tbfill'}, assignAllButton],
|
||||
listeners: {rowdblclick: AssignGroupsAction}
|
||||
tbar: [_('ID_AVAILABLE_GROUPS'),{xtype: 'tbfill'},'-',searchTextA,clearTextButtonA],
|
||||
//bbar: [{xtype: 'tbfill'}, cancelEditMembersButton],
|
||||
listeners: {rowdblclick: AssignGroupsAction},
|
||||
hidden: true
|
||||
});
|
||||
|
||||
assignedGrid = new Ext.grid.GridPanel({
|
||||
@@ -238,9 +237,11 @@ Ext.onReady(function(){
|
||||
frame : false,
|
||||
columnLines : false,
|
||||
viewConfig : {forceFit:true},
|
||||
tbar: [TRANSLATIONS.ID_ASSIGNED_GROUPS,{xtype: 'tbfill'},'-',searchTextP,clearTextButtonP],
|
||||
bbar: [{xtype: 'tbfill'},removeAllButton],
|
||||
listeners: {rowdblclick: RemoveGroupsAction}
|
||||
tbar: [_('ID_MEMBER_OF'),{xtype: 'tbfill'},'-',searchTextP,clearTextButtonP],
|
||||
//bbar: [{xtype: 'tbfill'},editMembersButton],
|
||||
listeners: {rowdblclick: function(){
|
||||
(availableGrid.hidden)? DoNothing() : RemoveGroupsAction();
|
||||
}}
|
||||
});
|
||||
|
||||
buttonsPanel = new Ext.Panel({
|
||||
@@ -253,23 +254,24 @@ Ext.onReady(function(){
|
||||
},
|
||||
defaults:{margins:'0 0 35 0'},
|
||||
items:[
|
||||
{xtype:'button',text: '>>', handler: AssignGroupsAction, id: 'assignButton', disabled: true},
|
||||
{xtype:'button',text: '<<', handler: RemoveGroupsAction, id: 'removeButton', disabled: true}
|
||||
]
|
||||
{xtype:'button',text: '> ', handler: AssignGroupsAction, id: 'assignButton', disabled: true},
|
||||
{xtype:'button',text: ' <', handler: RemoveGroupsAction, id: 'removeButton', disabled: true},
|
||||
{xtype:'button',text: '>>', handler: AssignAllGroupsAction, id: 'assignButtonAll', disabled: false},
|
||||
{xtype:'button',text: '<<', handler: RemoveAllGroupsAction, id: 'removeButtonAll', disabled: false}
|
||||
],
|
||||
hidden: true
|
||||
});
|
||||
|
||||
RefreshGroups();
|
||||
|
||||
//GROUPS DRAG AND DROP PANEL
|
||||
GroupsPanel = new Ext.Panel({
|
||||
title : TRANSLATIONS.ID_GROUPS,
|
||||
title : _('ID_GROUPS'),
|
||||
autoWidth : true,
|
||||
layout : 'hbox',
|
||||
defaults : { flex : 1 }, //auto stretch
|
||||
layoutConfig : { align : 'stretch' },
|
||||
items : [availableGrid,buttonsPanel,assignedGrid],
|
||||
viewConfig : {forceFit:true}
|
||||
|
||||
viewConfig : {forceFit:true},
|
||||
bbar: [{xtype: 'tbfill'},editMembersButton, cancelEditMembersButton]
|
||||
});
|
||||
|
||||
comboAuthSourcesStore = new Ext.data.GroupingStore({
|
||||
@@ -292,12 +294,12 @@ Ext.onReady(function(){
|
||||
authForm = new Ext.FormPanel({
|
||||
url: 'users_Ajax?function=updateAuthServices',
|
||||
frame: true,
|
||||
title: TRANSLATIONS.ID_AUTHENTICATION_FORM_TITLE,
|
||||
title: _('ID_AUTHENTICATION_FORM_TITLE'),
|
||||
items:[
|
||||
{xtype: 'textfield', name: 'usr_uid', hidden: true },
|
||||
{
|
||||
xtype: 'combo',
|
||||
fieldLabel: TRANSLATIONS.ID_AUTHENTICATION_SOURCE,
|
||||
fieldLabel: _('ID_AUTHENTICATION_SOURCE'),
|
||||
hiddenName: 'auth_source',
|
||||
name: 'auth_source_uid',
|
||||
typeAhead: true,
|
||||
@@ -309,20 +311,22 @@ Ext.onReady(function(){
|
||||
submitValue: true,
|
||||
//hiddenValue: 'AUTH_SOURCE_UID',
|
||||
triggerAction: 'all',
|
||||
emptyText: TRANSLATIONS.ID_SELECT_AUTH_SOURCE,
|
||||
emptyText: _('ID_SELECT_AUTH_SOURCE'),
|
||||
selectOnFocus:true,
|
||||
listeners:{select: function(c,r,i){
|
||||
listeners:{
|
||||
select: function(c,r,i){
|
||||
ReportChanges();
|
||||
if (i==0){
|
||||
authForm.getForm().findField('auth_dn').disable();
|
||||
}else{
|
||||
authForm.getForm().findField('auth_dn').enable();
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'textfield',
|
||||
fieldLabel: TRANSLATIONS.ID_AUTHENTICATION_DN,
|
||||
fieldLabel: _('ID_AUTHENTICATION_DN'),
|
||||
name: 'auth_dn',
|
||||
width: 350,
|
||||
allowBlank: true,
|
||||
@@ -334,12 +338,9 @@ Ext.onReady(function(){
|
||||
buttons: [discardChangesButton,saveChangesButton]
|
||||
});
|
||||
|
||||
LoadAuthForm();
|
||||
|
||||
|
||||
//AUTHENTICATION EDITING PANEL
|
||||
AuthenticationPanel = new Ext.Panel({
|
||||
title : TRANSLATIONS.ID_AUTHENTICATION,
|
||||
title : _('ID_AUTHENTICATION'),
|
||||
autoWidth : true,
|
||||
layout : 'hbox',
|
||||
defaults : { flex : 1 }, //auto stretch
|
||||
@@ -350,25 +351,97 @@ Ext.onReady(function(){
|
||||
hideLabel: true
|
||||
});
|
||||
|
||||
//SUMMARY VIEW FORM
|
||||
|
||||
userFields = new Ext.form.FieldSet({
|
||||
title: _('ID_USER_INFORMATION'),
|
||||
items: [
|
||||
{xtype: 'label', fieldLabel: _('ID_FIRST_NAME'), id: 'fname', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_LAST_NAME'), id: 'lname', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_USER_NAME'), id: 'uname', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_EMAIL'), id: 'email', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_ADDRESS'), id: 'address', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_ZIP_CODE'), id: 'zipcode', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_COUNTRY'), id: 'country', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_STATE_REGION'), id: 'state', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_LOCATION'), id: 'location', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_PHONE_NUMBER'), id: 'phone', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_POSITION'), id: 'position', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_DEPARTMENT'), id: 'department', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_REPLACED_BY'), id: 'replaced', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_EXPIRATION_DATE'), id: 'duedate', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_STATUS'), id: 'status', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_ROLE'), id: 'role', width: 250}
|
||||
]
|
||||
});
|
||||
|
||||
caseFields = new Ext.form.FieldSet({
|
||||
title: _('ID_CASES_SUMMARY'),
|
||||
labelWidth: 200,
|
||||
items: [
|
||||
{xtype: 'label', fieldLabel: _('ID_INBOX'), id: 'inbox', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_DRAFT'), id: 'draft', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_TITLE_PARTICIPATED'), id: 'participated', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_UNASSIGNED'), id: 'unassigned', width: 250},
|
||||
{xtype: 'label', fieldLabel: _('ID_PAUSED'), id: 'pause', width: 250}
|
||||
]
|
||||
});
|
||||
|
||||
viewForm = new Ext.FormPanel({
|
||||
frame: true,
|
||||
//autoScroll: true,
|
||||
//autoWidth: true,
|
||||
layout: 'fit',
|
||||
items:[{
|
||||
layout: 'column',
|
||||
autoScroll: true,
|
||||
items:[
|
||||
{columnWidth:.6, padding: 3, layout: 'form', items: [userFields]},
|
||||
{columnWidth:.4, padding: 3, layout: 'form', items: [caseFields]}
|
||||
]
|
||||
}]
|
||||
});
|
||||
|
||||
SummaryPanel = new Ext.Panel({
|
||||
title: _('ID_SUMMARY'),
|
||||
autoScroll : true,
|
||||
layout : 'fit',
|
||||
items: [viewForm],
|
||||
viewConfig : {forceFit:true},
|
||||
hidden: true,
|
||||
hideLabel: true
|
||||
});
|
||||
|
||||
//NORTH PANEL WITH TITLE AND ROLE DETAILS
|
||||
northPanel = new Ext.Panel({
|
||||
region: 'north',
|
||||
xtype: 'panel',
|
||||
tbar: [TRANSLATIONS.ID_USERS + ' : ' + USERS.USR_COMPLETENAME + ' (' + USERS.USR_USERNAME + ')',{xtype: 'tbfill'},backButton]
|
||||
tbar: ['<b>'+_('ID_USER') + ' : ' + parseFullName(USERS.USR_USERNAME,USERS.USR_FIRSTNAME,USERS.USR_LASTNAME,USERS.fullNameFormat) + '</b>',{xtype: 'tbfill'},backButton]
|
||||
});
|
||||
|
||||
//TABS PANEL
|
||||
tabsPanel = new Ext.TabPanel({
|
||||
region: 'center',
|
||||
activeTab: USERS.CURRENT_TAB,
|
||||
items:[GroupsPanel,AuthenticationPanel],
|
||||
items:[SummaryPanel,GroupsPanel,AuthenticationPanel],
|
||||
listeners:{
|
||||
beforetabchange: function(p,t,c){
|
||||
switch(t.title){
|
||||
case TRANSLATIONS.ID_GROUPS:
|
||||
case _('ID_GROUPS'):
|
||||
if (sw_form_changed){
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_USERS, 'Do you want discard changes?',
|
||||
Ext.Msg.confirm(_('ID_USERS'), _('ID_CONFIRM_DISCARD_CHANGES'),
|
||||
function(btn, text){
|
||||
if (btn=="no"){
|
||||
p.setActiveTab(c);
|
||||
}else{
|
||||
LoadAuthForm();
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case _('ID_SUMMARY'):
|
||||
if (sw_form_changed){
|
||||
Ext.Msg.confirm(_('ID_USERS'), _('ID_CONFIRM_DISCARD_CHANGES'),
|
||||
function(btn, text){
|
||||
if (btn=="no"){
|
||||
p.setActiveTab(c);
|
||||
@@ -382,12 +455,16 @@ Ext.onReady(function(){
|
||||
},
|
||||
tabchange: function(p,t){
|
||||
switch(t.title){
|
||||
case TRANSLATIONS.ID_GROUPS:
|
||||
case _('ID_GROUPS'):
|
||||
sw_func_groups ? DoNothing() : RefreshGroups();
|
||||
sw_func_groups ? DoNothing() : DDLoadGroups();
|
||||
break;
|
||||
case TRANSLATIONS.ID_AUTHENTICATION:
|
||||
case _('ID_AUTHENTICATION'):
|
||||
//LoadAuthForm();
|
||||
sw_func_auth ? DoNothing() : LoadAuthForm();
|
||||
break;
|
||||
case _('ID_SUMMARY'):
|
||||
sw_user_summary ? DoNothing(): LoadSummary();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,16 +475,15 @@ Ext.onReady(function(){
|
||||
layout: 'border',
|
||||
items: [northPanel, tabsPanel]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//Do Nothing Function
|
||||
DoNothing = function(){}
|
||||
DoNothing = function(){};
|
||||
|
||||
//Return to Roles Main Page
|
||||
BackToUsers = function(){
|
||||
location.href = 'users_List';
|
||||
}
|
||||
};
|
||||
|
||||
//Loads Drag N Drop Functionality for Permissions
|
||||
DDLoadGroups = function(){
|
||||
@@ -424,7 +500,7 @@ DDLoadGroups = function(){
|
||||
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//GROUPS DRAG N DROP ASSIGNED
|
||||
var assignedGridDropTargetEl = assignedGrid.getView().scroller.dom;
|
||||
@@ -441,7 +517,7 @@ DDLoadGroups = function(){
|
||||
}
|
||||
});
|
||||
sw_func_groups = true;
|
||||
}
|
||||
};
|
||||
|
||||
//LOAD AUTHTENTICATION FORM DATA
|
||||
LoadAuthForm = function(){
|
||||
@@ -461,31 +537,30 @@ LoadAuthForm = function(){
|
||||
},
|
||||
failure: DoNothing
|
||||
});
|
||||
|
||||
sw_func_auth = true;
|
||||
sw_form_changed = false;
|
||||
saveChangesButton.disable();
|
||||
discardChangesButton.disable();
|
||||
}
|
||||
};
|
||||
|
||||
//ReportChanges
|
||||
ReportChanges = function(){
|
||||
saveChangesButton.enable();
|
||||
discardChangesButton.enable();
|
||||
sw_form_changed = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//REFRESH GROUPS GRIDS
|
||||
RefreshGroups = function(){
|
||||
DoSearchA();
|
||||
DoSearchP();
|
||||
}
|
||||
};
|
||||
|
||||
//SAVE AUTHENTICATION CHANGES
|
||||
|
||||
SaveChangesAuthForm = function(){
|
||||
viewport.getEl().mask(TRANSLATIONS.ID_PROCESSING);
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
authForm.getForm().submit({
|
||||
success: function(f,a){
|
||||
LoadAuthForm();
|
||||
@@ -496,17 +571,17 @@ SaveChangesAuthForm = function(){
|
||||
viewport.getEl().unmask();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//FAILURE AJAX FUNCTION
|
||||
FailureProcess = function(){
|
||||
Ext.Msg.alert(TRANSLATIONS.ID_USERS, TRANSLATIONS.ID_MSG_AJAX_FAILURE);
|
||||
}
|
||||
Ext.Msg.alert(_('ID_USERS'), _('ID_MSG_AJAX_FAILURE'));
|
||||
};
|
||||
|
||||
//ASSIGN GROUPS TO A USER
|
||||
SaveGroupsUser = function(arr_grp, function_success, function_failure){
|
||||
var sw_response;
|
||||
viewport.getEl().mask(TRANSLATIONS.ID_PROCESSING);
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
Ext.Ajax.request({
|
||||
url: 'users_Ajax',
|
||||
params: {'function': 'assignGroupsToUserMultiple', USR_UID: USERS.USR_UID, GRP_UID: arr_grp.join(',')},
|
||||
@@ -519,12 +594,12 @@ SaveGroupsUser = function(arr_grp, function_success, function_failure){
|
||||
viewport.getEl().unmask();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//REMOVE GROUPS FROM A USER
|
||||
DeleteGroupsUser = function(arr_grp, function_success, function_failure){
|
||||
var sw_response;
|
||||
viewport.getEl().mask(TRANSLATIONS.ID_PROCESSING);
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
Ext.Ajax.request({
|
||||
url: 'users_Ajax',
|
||||
params: {'function': 'deleteGroupsToUserMultiple', USR_UID: USERS.USR_UID, GRP_UID: arr_grp.join(',')},
|
||||
@@ -537,7 +612,7 @@ DeleteGroupsUser = function(arr_grp, function_success, function_failure){
|
||||
viewport.getEl().unmask();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//AssignButton Functionality
|
||||
AssignGroupsAction = function(){
|
||||
@@ -547,7 +622,7 @@ AssignGroupsAction = function(){
|
||||
arrAux[a] = rowsSelected[a].get('GRP_UID');
|
||||
}
|
||||
SaveGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||
}
|
||||
};
|
||||
|
||||
//RemoveButton Functionality
|
||||
RemoveGroupsAction = function(){
|
||||
@@ -557,7 +632,7 @@ RemoveGroupsAction = function(){
|
||||
arrAux[a] = rowsSelected[a].get('GRP_UID');
|
||||
}
|
||||
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||
}
|
||||
};
|
||||
|
||||
//AssignALLButton Functionality
|
||||
AssignAllGroupsAction = function(){
|
||||
@@ -570,7 +645,7 @@ AssignAllGroupsAction = function(){
|
||||
}
|
||||
SaveGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//RevomeALLButton Functionality
|
||||
RemoveAllGroupsAction = function(){
|
||||
@@ -583,26 +658,92 @@ RemoveAllGroupsAction = function(){
|
||||
}
|
||||
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Function DoSearch Available
|
||||
DoSearchA = function(){
|
||||
availableGrid.store.load({params: {textFilter: searchTextA.getValue()}});
|
||||
}
|
||||
};
|
||||
|
||||
//Function DoSearch Assigned
|
||||
DoSearchP = function(){
|
||||
assignedGrid.store.load({params: {textFilter: searchTextP.getValue()}});
|
||||
}
|
||||
};
|
||||
|
||||
//Load Grid By Default Available Members
|
||||
GridByDefaultA = function(){
|
||||
searchTextA.reset();
|
||||
availableGrid.store.load();
|
||||
}
|
||||
};
|
||||
|
||||
//Load Grid By Default Assigned Members
|
||||
GridByDefaultP = function(){
|
||||
searchTextP.reset();
|
||||
assignedGrid.store.load();
|
||||
}
|
||||
};
|
||||
|
||||
//edit members action
|
||||
EditMembersAction = function(){
|
||||
availableGrid.show();
|
||||
buttonsPanel.show();
|
||||
editMembersButton.hide();
|
||||
cancelEditMembersButton.show();
|
||||
GroupsPanel.doLayout();
|
||||
};
|
||||
|
||||
//CancelEditMenbers Function
|
||||
CancelEditMenbersAction = function(){
|
||||
availableGrid.hide();
|
||||
buttonsPanel.hide();
|
||||
editMembersButton.show();
|
||||
cancelEditMembersButton.hide();
|
||||
GroupsPanel.doLayout();
|
||||
};
|
||||
|
||||
//Function Parse Full Name Format
|
||||
parseFullName = function(uN, fN, lN, f){
|
||||
var aux = f;
|
||||
aux = aux.replace('@userName',uN);
|
||||
aux = aux.replace('@firstName',fN);
|
||||
aux = aux.replace('@lastName',lN);
|
||||
return aux;
|
||||
};
|
||||
|
||||
//Load Summary Function
|
||||
LoadSummary = function(){
|
||||
//viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
Ext.Ajax.request({
|
||||
url: 'users_Ajax',
|
||||
params: {'function': 'summaryUserData', USR_UID: USERS.USR_UID},
|
||||
success: function(r,o){
|
||||
//viewport.getEl().unmask();
|
||||
sw_user_summary = true;
|
||||
var user = Ext.util.JSON.decode(r.responseText);
|
||||
Ext.getCmp('fname').setText(user.userdata.USR_FIRSTNAME);
|
||||
Ext.getCmp('lname').setText(user.userdata.USR_LASTNAME);
|
||||
Ext.getCmp('uname').setText(user.userdata.USR_USERNAME);
|
||||
Ext.getCmp('email').setText(user.userdata.USR_EMAIL);
|
||||
Ext.getCmp('country').setText(user.userdata.USR_COUNTRY);
|
||||
Ext.getCmp('state').setText(user.userdata.USR_CITY);
|
||||
Ext.getCmp('location').setText(user.userdata.USR_LOCATION);
|
||||
Ext.getCmp('role').setText(user.userdata.USR_ROLE);
|
||||
Ext.getCmp('address').setText(user.userdata.USR_ADDRESS);
|
||||
Ext.getCmp('phone').setText(user.userdata.USR_PHONE);
|
||||
Ext.getCmp('zipcode').setText(user.userdata.USR_ZIP_CODE);
|
||||
Ext.getCmp('duedate').setText(user.userdata.USR_DUE_DATE);
|
||||
Ext.getCmp('status').setText(user.userdata.USR_STATUS);
|
||||
Ext.getCmp('replaced').setText(user.misc.REPLACED_NAME);
|
||||
Ext.getCmp('department').setText(user.misc.DEP_TITLE);
|
||||
|
||||
Ext.getCmp('inbox').setText(user.cases.to_do);
|
||||
Ext.getCmp('draft').setText(user.cases.draft);
|
||||
Ext.getCmp('participated').setText(user.cases.sent);
|
||||
Ext.getCmp('unassigned').setText(user.cases.selfservice);
|
||||
Ext.getCmp('pause').setText(user.cases.paused);
|
||||
|
||||
},
|
||||
failure:function(r,o){
|
||||
//viewport.getEl().unmask();
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -38,60 +38,71 @@ var cmodel;
|
||||
var infoGrid;
|
||||
var viewport;
|
||||
var smodel;
|
||||
|
||||
var newButton;
|
||||
var editButton;
|
||||
var deleteButton;
|
||||
var summaryButton;
|
||||
var groupsButton;
|
||||
//var reassignButton;
|
||||
var authenticationButton;
|
||||
var searchButton;
|
||||
|
||||
var searchText;
|
||||
|
||||
var contextMenu;
|
||||
|
||||
var user_admin = '00000000000000000000000000000001';
|
||||
var pageSize;
|
||||
var fullNameFormat;
|
||||
var dateFormat;
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.QuickTips.init();
|
||||
|
||||
fullNameFormat = CONFIG.fullNameFormat;
|
||||
dateFormat = CONFIG.dateFormat;
|
||||
pageSize = parseInt(CONFIG.pageSize);
|
||||
|
||||
newButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_NEW,
|
||||
text: _('ID_NEW'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
||||
handler: NewUserAction
|
||||
});
|
||||
|
||||
summaryButton = new Ext.Action({
|
||||
text: _('ID_SUMMARY'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_table',
|
||||
handler: SummaryTabOpen,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
editButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_EDIT,
|
||||
text: _('ID_EDIT'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||
handler: EditUserAction,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
deleteButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_DELETE,
|
||||
text: _('ID_DELETE'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||
handler: DeleteUserAction,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
groupsButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_GROUPS,
|
||||
text: _('ID_GROUPS'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_group_add',
|
||||
handler: UsersGroupPage,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
// reassignButton = new Ext.Action({
|
||||
// text: TRANSLATIONS.ID_REASSIGN_CASES,
|
||||
// text: _('ID_REASSIGN_CASES'),
|
||||
// iconCls: 'button_menu_ext ss_sprite ss_arrow_rotate_clockwise',
|
||||
// handler: DoNothing,
|
||||
// disabled: true
|
||||
// });
|
||||
|
||||
authenticationButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_AUTHENTICATION,
|
||||
text: _('ID_AUTHENTICATION'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_key',
|
||||
handler: AuthUserPage,
|
||||
disabled: true
|
||||
@@ -99,12 +110,12 @@ Ext.onReady(function(){
|
||||
|
||||
|
||||
searchButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_SEARCH,
|
||||
text: _('ID_SEARCH'),
|
||||
handler: DoSearch
|
||||
});
|
||||
|
||||
contextMenu = new Ext.menu.Menu({
|
||||
items: [editButton, deleteButton,'-',groupsButton,'-',authenticationButton]
|
||||
items: [editButton, deleteButton,'-',groupsButton,'-',authenticationButton,'-',summaryButton]
|
||||
});
|
||||
|
||||
searchText = new Ext.form.TextField ({
|
||||
@@ -112,7 +123,7 @@ Ext.onReady(function(){
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 150,
|
||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,//'enter search term',
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),//'enter search term',
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
@@ -132,7 +143,6 @@ Ext.onReady(function(){
|
||||
handler: GridByDefault
|
||||
});
|
||||
|
||||
|
||||
smodel = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true,
|
||||
listeners:{
|
||||
@@ -142,6 +152,7 @@ Ext.onReady(function(){
|
||||
groupsButton.enable();
|
||||
//reassignButton.enable();
|
||||
authenticationButton.enable();
|
||||
summaryButton.enable();
|
||||
},
|
||||
rowdeselect: function(sm){
|
||||
editButton.disable();
|
||||
@@ -149,27 +160,70 @@ Ext.onReady(function(){
|
||||
groupsButton.disable();
|
||||
//reassignButton.disable();
|
||||
authenticationButton.disable();
|
||||
summaryButton.disable();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_usersList'
|
||||
url: 'users_Ajax?function=usersList'
|
||||
}),
|
||||
reader : new Ext.data.JsonReader( {
|
||||
root: 'users',
|
||||
totalProperty: 'total_users',
|
||||
fields : [
|
||||
{name : 'USR_UID'},
|
||||
{name : 'USR_USERNAME'},
|
||||
{name : 'USR_COMPLETENAME'},
|
||||
{name : 'USR_FIRSTNAME'},
|
||||
{name : 'USR_LASTNAME'},
|
||||
{name : 'USR_EMAIL'},
|
||||
{name : 'USR_ROLE'},
|
||||
{name : 'USR_DUE_DATE'}
|
||||
{name : 'USR_DUE_DATE'},
|
||||
{name : 'DEP_TITLE'},
|
||||
{name : 'LAST_LOGIN'},
|
||||
{name : 'USR_STATUS'},
|
||||
{name : 'TOTAL_CASES'},
|
||||
{name : 'DUE_DATE_OK'}
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
storePageSize = new Ext.data.SimpleStore({
|
||||
fields: ['size'],
|
||||
data: [['20'],['30'],['40'],['50'],['100']],
|
||||
autoLoad: true
|
||||
});
|
||||
|
||||
comboPageSize = new Ext.form.ComboBox({
|
||||
typeAhead : false,
|
||||
mode : 'local',
|
||||
triggerAction : 'all',
|
||||
store: storePageSize,
|
||||
valueField: 'size',
|
||||
displayField: 'size',
|
||||
width: 50,
|
||||
editable: false,
|
||||
listeners:{
|
||||
select: function(c,d,i){
|
||||
UpdatePageConfig(d.data['size']);
|
||||
bbarpaging.pageSize = parseInt(d.data['size']);
|
||||
bbarpaging.moveFirst();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
comboPageSize.setValue(pageSize);
|
||||
|
||||
bbarpaging = new Ext.PagingToolbar({
|
||||
pageSize: pageSize,
|
||||
store: store,
|
||||
displayInfo: true,
|
||||
displayMsg: _('ID_GRID_PAGE_DISPLAYING_USERS_MESSAGE') + ' ',
|
||||
emptyMsg: _('ID_GRID_PAGE_NO_USERS_MESSAGE'),
|
||||
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
|
||||
});
|
||||
|
||||
cmodel = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 50,
|
||||
@@ -177,12 +231,16 @@ Ext.onReady(function(){
|
||||
},
|
||||
columns: [
|
||||
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
||||
{header: TRANSLATIONS.ID_PHOTO, dataIndex: 'USR_UID', width: 14, align:'center', sortable: false, renderer: photo_user},
|
||||
{header: TRANSLATIONS.ID_FULL_NAME, dataIndex: 'USR_COMPLETENAME', width: 80, align:'left'},
|
||||
{header: TRANSLATIONS.ID_USER_NAME, dataIndex: 'USR_USERNAME', width: 60, hidden:false, align:'left'},
|
||||
{header: TRANSLATIONS.ID_EMAIL, dataIndex: 'USR_EMAIL', width: 60, hidden: false, align: 'left'},
|
||||
{header: TRANSLATIONS.ID_ROLE, dataIndex: 'USR_ROLE', width: 70, hidden:false, align:'left'},
|
||||
{header: TRANSLATIONS.ID_DUE_DATE, dataIndex: 'USR_DUE_DATE', width: 30, hidden:false, align:'center'}
|
||||
{header: '', dataIndex: 'USR_UID', width: 30, align:'center', sortable: false, renderer: photo_user},
|
||||
{header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 90, hidden:false, align:'left'},
|
||||
{header: _('ID_FULL_NAME'), dataIndex: 'USR_USERNAME', width: 175, align:'left', renderer: full_name},
|
||||
{header: _('ID_EMAIL'), dataIndex: 'USR_EMAIL', width: 120, hidden: true, align: 'left'},
|
||||
{header: _('ID_STATUS'), dataIndex: 'USR_STATUS', width: 50, hidden: false, align: 'center', renderer: render_status},
|
||||
{header: _('ID_ROLE'), dataIndex: 'USR_ROLE', width: 180, hidden:false, align:'left'},
|
||||
{header: _('ID_DEPARTMENT'), dataIndex: 'DEP_TITLE', width: 150, hidden:true, align:'left'},
|
||||
{header: _('ID_LAST_LOGIN'), dataIndex: 'LAST_LOGIN', width: 108, hidden:false, align:'center'},
|
||||
{header: _('ID_CASES'), dataIndex: 'TOTAL_CASES', width: 45, hidden:false, align:'right'},
|
||||
{header: _('ID_DUE_DATE'), dataIndex: 'USR_DUE_DATE', width: 108, hidden:false, align:'center', renderer: render_duedate}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -202,13 +260,14 @@ Ext.onReady(function(){
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
title : TRANSLATIONS.ID_USERS,
|
||||
title : _('ID_USERS'),
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar: [newButton, '-', editButton, deleteButton,'-',groupsButton,'-',authenticationButton, {xtype: 'tbfill'}, searchText,clearTextButton,searchButton],
|
||||
tbar: [newButton, '-',summaryButton,'-', editButton, deleteButton,'-',groupsButton,'-',authenticationButton, {xtype: 'tbfill'}, searchText,clearTextButton,searchButton],
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
rowdblclick: EditUserAction
|
||||
rowdblclick: SummaryTabOpen
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
@@ -238,70 +297,65 @@ Ext.onReady(function(){
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [
|
||||
infoGrid
|
||||
]
|
||||
items: [infoGrid]
|
||||
});
|
||||
});
|
||||
|
||||
//Funtion Handles Context Menu Opening
|
||||
//Function Handles Context Menu Opening
|
||||
onMessageContextMenu = function (grid, rowIndex, e) {
|
||||
e.stopEvent();
|
||||
var coords = e.getXY();
|
||||
contextMenu.showAt([coords[0], coords[1]]);
|
||||
}
|
||||
};
|
||||
|
||||
//Do Nothing Function
|
||||
DoNothing = function(){}
|
||||
DoNothing = function(){};
|
||||
|
||||
//Open New User Form
|
||||
NewUserAction = function(){
|
||||
location.href = 'users_New';
|
||||
}
|
||||
|
||||
//Edit User Action
|
||||
EditUserAction = function(){
|
||||
var uid = infoGrid.getSelectionModel().getSelected();
|
||||
if (uid){
|
||||
location.href = 'users_Edit?USR_UID=' + uid.data.USR_UID;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Delete User Action
|
||||
DeleteUserAction = function(){
|
||||
var uid = infoGrid.getSelectionModel().getSelected();
|
||||
if (uid){
|
||||
if (uid.data.USR_UID==user_admin){
|
||||
Ext.Msg.alert(TRANSLATIONS.ID_USERS, TRANSLATIONS.ID_CANNOT_DELETE_ADMIN_USER);
|
||||
Ext.Msg.alert(_('ID_USERS'), _('ID_CANNOT_DELETE_ADMIN_USER'));
|
||||
}else{
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
Ext.Ajax.request({
|
||||
url: 'users_Ajax',
|
||||
params: {'function': 'canDeleteUser', uUID: uid.data.USR_UID},
|
||||
success: function(res, opt){
|
||||
viewport.getEl().unmask();
|
||||
response = Ext.util.JSON.decode(res.responseText);
|
||||
if (response.candelete){
|
||||
if (response.hashistory){
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_CONFIRM, TRANSLATIONS.ID_USERS_DELETE_WITH_HISTORY,
|
||||
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_USERS_DELETE_WITH_HISTORY'),
|
||||
function(btn){
|
||||
if (btn=='yes') DeleteUser(uid.data.USR_UID);
|
||||
}
|
||||
);
|
||||
}else{
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_CONFIRM, TRANSLATIONS.ID_MSG_CONFIRM_DELETE_USER,
|
||||
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_MSG_CONFIRM_DELETE_USER'),
|
||||
function(btn){
|
||||
if (btn=='yes') DeleteUser(uid.data.USR_UID);
|
||||
}
|
||||
);
|
||||
}
|
||||
}else{
|
||||
Ext.Msg.alert(TRANSLATIONS.ID_USERS, TRANSLATIONS.ID_MSG_CANNOT_DELETE_USER);
|
||||
PMExt.error(_('ID_USERS'), _('ID_MSG_CANNOT_DELETE_USER'));
|
||||
}
|
||||
},
|
||||
failure: DoNothing
|
||||
failure: function(r,o){
|
||||
viewport.getEl().unmask();
|
||||
DoNothing();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Open User-Groups Manager
|
||||
UsersGroupPage = function(value){
|
||||
@@ -310,7 +364,24 @@ UsersGroupPage = function(value){
|
||||
value = rowSelected.data.USR_UID;
|
||||
location.href = 'usersGroups?uUID=' + value + '&type=group';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Open Summary Tab
|
||||
SummaryTabOpen = function(){
|
||||
rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected){
|
||||
value = rowSelected.data.USR_UID;
|
||||
location.href = 'usersGroups?uUID=' + value + '&type=summary';
|
||||
}
|
||||
};
|
||||
|
||||
//Edit User Action
|
||||
EditUserAction = function(){
|
||||
var uid = infoGrid.getSelectionModel().getSelected();
|
||||
if (uid){
|
||||
location.href = 'users_Edit?USR_UID=' + uid.data.USR_UID;
|
||||
}
|
||||
};
|
||||
|
||||
//Open Authentication-User Manager
|
||||
AuthUserPage = function(value){
|
||||
@@ -319,23 +390,45 @@ AuthUserPage = function(value){
|
||||
value = rowSelected.data.USR_UID;
|
||||
location.href = 'usersGroups?uUID=' + value + '&type=auth';;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Renderer Active/Inactive Role
|
||||
photo_user = function(value){
|
||||
return '<img border="0" src="users_ViewPhotoGrid?pUID=' + value + '" width="20" />';
|
||||
}
|
||||
return '<img border="0" src="users_ViewPhotoGrid?h=' + Math.random() +'&pUID=' + value + '" width="20" />';
|
||||
};
|
||||
|
||||
//Render Full Name
|
||||
full_name = function(v,x,s){
|
||||
return parseFullName(v, s.data.USR_FIRSTNAME, s.data.USR_LASTNAME, fullNameFormat);
|
||||
};
|
||||
|
||||
//Render Status
|
||||
render_status = function(v){
|
||||
switch(v){
|
||||
case 'ACTIVE': return '<font color="green">' + _('ID_ACTIVE') + '</font>'; break;
|
||||
case 'INACTIVE': return '<font color="red">' + _('ID_INACTIVE') + '</font>';; break;
|
||||
case 'VACATION': return '<font color="blue">' + _('ID_VACATION') + '</font>';; break;
|
||||
}
|
||||
};
|
||||
|
||||
//Render Due Date
|
||||
render_duedate = function(v,x,s){
|
||||
if (s.data.DUE_DATE_OK)
|
||||
return v;
|
||||
else
|
||||
return '<font color="red">' + v + '</font>';
|
||||
};
|
||||
|
||||
//Load Grid By Default
|
||||
GridByDefault = function(){
|
||||
searchText.reset();
|
||||
infoGrid.store.load();
|
||||
}
|
||||
};
|
||||
|
||||
//Do Search Function
|
||||
DoSearch = function(){
|
||||
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
||||
}
|
||||
};
|
||||
|
||||
//Delete User Function
|
||||
DeleteUser = function(uid){
|
||||
@@ -344,8 +437,25 @@ DeleteUser = function(uid){
|
||||
params: {'function': 'deleteUser', USR_UID: uid},
|
||||
success: function(res, opt){
|
||||
DoSearch();
|
||||
Ext.Msg.alert(TRANSLATIONS.ID_USERS,TRANSLATIONS.ID_USERS_SUCCESS_DELETE);
|
||||
PMExt.notify(_('ID_USERS'),_('ID_USERS_SUCCESS_DELETE'));
|
||||
},
|
||||
failure: DoNothing
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//Update Page Size Configuration
|
||||
UpdatePageConfig = function(pageSize){
|
||||
Ext.Ajax.request({
|
||||
url: 'users_Ajax',
|
||||
params: {'function':'updatePageSize', size: pageSize}
|
||||
});
|
||||
};
|
||||
|
||||
//Function Parse Full Name Format
|
||||
parseFullName = function(uN, fN, lN, f){
|
||||
var aux = f;
|
||||
aux = aux.replace('@userName',uN);
|
||||
aux = aux.replace('@firstName',fN);
|
||||
aux = aux.replace('@lastName',lN);
|
||||
return aux;
|
||||
};
|
||||
Reference in New Issue
Block a user