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();
|
var $aConfig = array();
|
||||||
private $Configuration = null;
|
private $Configuration = null;
|
||||||
|
private $UserConfig = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Configurations
|
* 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
|
* setConfig
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1194,4 +1194,20 @@ class AppCacheView extends BaseAppCacheView {
|
|||||||
return ($rowData);
|
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
|
} // AppCacheView
|
||||||
|
|||||||
@@ -394,20 +394,36 @@ protected $depo_title = '';
|
|||||||
|
|
||||||
// select departments
|
// select departments
|
||||||
// this function is used to draw the hierachy tree view
|
// this function is used to draw the hierachy tree view
|
||||||
function getDepartments( $DepParent ) {
|
function getDepartments( $DepParent ) {
|
||||||
try {
|
try {
|
||||||
$result = array();
|
$result = array();
|
||||||
$criteria = new Criteria('workflow');
|
$criteria = new Criteria('workflow');
|
||||||
$criteria->add(DepartmentPeer::DEP_PARENT, $DepParent, Criteria::EQUAL);
|
$criteria->add(DepartmentPeer::DEP_PARENT, $DepParent, Criteria::EQUAL);
|
||||||
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
|
||||||
$objects = DepartmentPeer::doSelect($criteria, $con);
|
$objects = DepartmentPeer::doSelect($criteria, $con);
|
||||||
|
global $RBAC;
|
||||||
|
|
||||||
foreach( $objects as $oDepartment ) {
|
foreach( $objects as $oDepartment ) {
|
||||||
$node = array();
|
$node = array();
|
||||||
$node['DEP_UID'] = $oDepartment->getDepUid();
|
$node['DEP_UID'] = $oDepartment->getDepUid();
|
||||||
$node['DEP_PARENT'] = $oDepartment->getDepParent();
|
$node['DEP_PARENT'] = $oDepartment->getDepParent();
|
||||||
$node['DEP_TITLE'] = $oDepartment->getDepTitle();
|
$node['DEP_TITLE'] = $oDepartment->getDepTitle();
|
||||||
|
$node['DEP_STATUS'] = $oDepartment->getDepStatus();
|
||||||
|
$node['DEP_MANAGER'] = $oDepartment->getDepManager();
|
||||||
$node['DEP_LAST'] = 0;
|
$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 = new Criteria('workflow');
|
||||||
$criteriaCount->clearSelectColumns();
|
$criteriaCount->clearSelectColumns();
|
||||||
$criteriaCount->addSelectColumn( 'COUNT(*)' );
|
$criteriaCount->addSelectColumn( 'COUNT(*)' );
|
||||||
@@ -556,4 +572,22 @@ protected $depo_title = '';
|
|||||||
return $c;
|
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
|
} // 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
|
} // LoginLog
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* users_List.php
|
* usersGroups.php
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||||
@@ -53,20 +53,12 @@ $G_ID_SUB_MENU_SELECTED = 'USERS';
|
|||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher;
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
G::LoadClass('configuration');
|
||||||
|
$c = new Configurations();
|
||||||
//$oHeadPublisher->usingExtJs('ux/Ext.ux.fileUploadField');
|
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||||
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
$Config['fullNameFormat'] = isset($configEnv['format']) ? $configEnv['format'] : '@userName';
|
||||||
$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'));
|
|
||||||
|
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
|
|
||||||
$oCriteria = new Criteria();
|
$oCriteria = new Criteria();
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||||
@@ -77,13 +69,23 @@ $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
|
||||||
|
switch($_REQUEST['type']){
|
||||||
|
case 'summary': $ctab = 0; break;
|
||||||
|
case 'group': $ctab = 1; break;
|
||||||
|
case 'auth': $ctab = 2; break;
|
||||||
|
}
|
||||||
|
|
||||||
$users = Array();
|
$users = Array();
|
||||||
$users['USR_UID'] = $_GET['uUID'];
|
$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['USR_USERNAME'] = $aRow['USR_USERNAME'];
|
||||||
$users['CURRENT_TAB'] = ($_REQUEST['type']=='group') ? 0 : 1;
|
$users['fullNameFormat'] = $Config['fullNameFormat'];
|
||||||
|
$users['CURRENT_TAB'] = $ctab;
|
||||||
|
|
||||||
|
$oHeadPublisher =& headPublisher::getSingleton();
|
||||||
$oHeadPublisher->assign('TRANSLATIONS', $labels);
|
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
||||||
|
$oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
||||||
$oHeadPublisher->assign('USERS', $users);
|
$oHeadPublisher->assign('USERS', $users);
|
||||||
|
|
||||||
G::RenderPage('publish', 'extJs');
|
G::RenderPage('publish', 'extJs');
|
||||||
@@ -115,7 +115,6 @@ try {
|
|||||||
case 'changeView':
|
case 'changeView':
|
||||||
$_SESSION['iType'] = $_POST['TU_TYPE'];
|
$_SESSION['iType'] = $_POST['TU_TYPE'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'deleteGroup':
|
case 'deleteGroup':
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
@@ -125,28 +124,24 @@ try {
|
|||||||
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
|
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'showUserGroupInterface':
|
case 'showUserGroupInterface':
|
||||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
$_GET['sUserUID'] = $_POST['sUserUID'];
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher;
|
||||||
$G_PUBLISH->AddContent('view', 'users/users_AssignGroup' );
|
$G_PUBLISH->AddContent('view', 'users/users_AssignGroup' );
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'showUserGroups':
|
case 'showUserGroups':
|
||||||
$_GET['sUserUID'] = $_POST['sUserUID'];
|
$_GET['sUserUID'] = $_POST['sUserUID'];
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher;
|
||||||
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
|
$G_PUBLISH->AddContent('view', 'users/users_Tree' );
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'assignUserToGroup':
|
case 'assignUserToGroup':
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
$oGroup->addUserToGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
$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>';
|
echo '<div align="center"><h2><font color="blue">'.G::LoadTranslation('ID_MSG_ASSIGN_DONE').'</font></h2></div>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'usersGroup':
|
case 'usersGroup':
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
@@ -161,17 +156,14 @@ try {
|
|||||||
$USR_UID = $_POST['uUID'];
|
$USR_UID = $_POST['uUID'];
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$history = 0;
|
$history = 0;
|
||||||
|
|
||||||
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
|
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
|
||||||
$total += ApplicationPeer::doCount($c);
|
$total += ApplicationPeer::doCount($c);
|
||||||
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
|
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
|
||||||
$total += ApplicationPeer::doCount($c);
|
$total += ApplicationPeer::doCount($c);
|
||||||
|
|
||||||
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
|
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
|
||||||
$history += ApplicationPeer::doCount($c);
|
$history += ApplicationPeer::doCount($c);
|
||||||
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
|
||||||
$history += ApplicationPeer::doCount($c);
|
$history += ApplicationPeer::doCount($c);
|
||||||
|
|
||||||
$response = '{success: true, candelete: ';
|
$response = '{success: true, candelete: ';
|
||||||
$response .= ($total > 0) ? 'false' : 'true';
|
$response .= ($total > 0) ? 'false' : 'true';
|
||||||
$response .= ', hashistory: ';
|
$response .= ', hashistory: ';
|
||||||
@@ -190,7 +182,6 @@ try {
|
|||||||
$RBAC->changeUserStatus($UID, 'CLOSED');
|
$RBAC->changeUserStatus($UID, 'CLOSED');
|
||||||
$_GET['USR_USERNAME']='';
|
$_GET['USR_USERNAME']='';
|
||||||
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
|
$RBAC->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']),'');
|
||||||
|
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
$oUser = new Users();
|
$oUser = new Users();
|
||||||
$aFields = $oUser->load($UID);
|
$aFields = $oUser->load($UID);
|
||||||
@@ -246,7 +237,6 @@ try {
|
|||||||
$criteria = $RBAC->getAllAuthSources();
|
$criteria = $RBAC->getAllAuthSources();
|
||||||
$objects = AuthenticationSourcePeer::doSelectRS($criteria);
|
$objects = AuthenticationSourcePeer::doSelectRS($criteria);
|
||||||
$objects->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
$objects->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
|
||||||
$started = Array();
|
$started = Array();
|
||||||
$started['AUTH_SOURCE_UID'] = '00000000000000000000000000000000';
|
$started['AUTH_SOURCE_UID'] = '00000000000000000000000000000000';
|
||||||
$started['AUTH_SOURCE_NAME'] = 'ProcessMaker';
|
$started['AUTH_SOURCE_NAME'] = 'ProcessMaker';
|
||||||
@@ -300,6 +290,130 @@ try {
|
|||||||
$RBAC->updateUser($aData);
|
$RBAC->updateUser($aData);
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
break;
|
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) {
|
catch (Exception $oException) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ if( $access != 1 ){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$G_MAIN_MENU = 'processmaker';
|
||||||
$G_SUB_MENU = 'users';
|
$G_SUB_MENU = 'users';
|
||||||
$G_ID_MENU_SELECTED = 'USERS';
|
$G_ID_MENU_SELECTED = 'USERS';
|
||||||
@@ -53,17 +54,17 @@ $G_ID_SUB_MENU_SELECTED = 'USERS';
|
|||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
$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->addExtJsScript('users/usersList', false); //adding a javascript file .js
|
||||||
$oHeadPublisher->addContent('users/usersList'); //adding a html file .html.
|
$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');
|
G::RenderPage('publish', 'extJs');
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @author: Qennix
|
* @author: Qennix
|
||||||
* Jan 25th, 2011
|
* Jan 25th, 2011
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Keyboard Events
|
//Keyboard Events
|
||||||
new Ext.KeyMap(document, {
|
new Ext.KeyMap(document, {
|
||||||
@@ -26,16 +26,13 @@ var storeA;
|
|||||||
var cmodelP;
|
var cmodelP;
|
||||||
var smodelA;
|
var smodelA;
|
||||||
var smodelP;
|
var smodelP;
|
||||||
|
|
||||||
var availableGrid;
|
var availableGrid;
|
||||||
var assignedGrid;
|
var assignedGrid;
|
||||||
|
|
||||||
var GroupsPanel;
|
var GroupsPanel;
|
||||||
var AuthenticationPanel;
|
var AuthenticationPanel;
|
||||||
var northPanel;
|
var northPanel;
|
||||||
var tabsPanel;
|
var tabsPanel;
|
||||||
var viewport;
|
var viewport;
|
||||||
|
|
||||||
var assignButton;
|
var assignButton;
|
||||||
var assignAllButton;
|
var assignAllButton;
|
||||||
var removeButton;
|
var removeButton;
|
||||||
@@ -43,45 +40,46 @@ var removeAllButton;
|
|||||||
var backButton;
|
var backButton;
|
||||||
var discardChangesButton;
|
var discardChangesButton;
|
||||||
var saveChangesButton;
|
var saveChangesButton;
|
||||||
|
|
||||||
var sw_func_groups;
|
var sw_func_groups;
|
||||||
//var sw_func_reassign;
|
//var sw_func_reassign;
|
||||||
var sw_func_auth;
|
var sw_func_auth;
|
||||||
var sw_form_changed;
|
var sw_form_changed;
|
||||||
|
var sw_user_summary;
|
||||||
|
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
|
|
||||||
sw_func_groups = false;
|
sw_func_groups = false;
|
||||||
//sw_func_reassign = false;
|
//sw_func_reassign = false;
|
||||||
sw_func_auth = false;
|
sw_func_auth = false;
|
||||||
|
sw_user_summary = false;
|
||||||
|
|
||||||
assignAllButton = new Ext.Action({
|
editMembersButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_ASSIGN_ALL_GROUPS,
|
text: _('ID_EDIT_MEMBEROF'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
iconCls: 'button_menu_ext ss_sprite ss_user_add',
|
||||||
handler: AssignAllGroupsAction
|
handler: EditMembersAction
|
||||||
});
|
});
|
||||||
|
|
||||||
removeAllButton = new Ext.Action({
|
cancelEditMembersButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_REMOVE_ALL_GROUPS,
|
text: _('ID_FINISH_EDITION'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
iconCls: 'button_menu_ext ss_sprite ss_cancel',
|
||||||
handler: RemoveAllGroupsAction
|
handler: CancelEditMenbersAction,
|
||||||
|
hidden: true
|
||||||
});
|
});
|
||||||
|
|
||||||
backButton = new Ext.Action({
|
backButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_BACK,
|
text : _('ID_BACK'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||||
handler: BackToUsers
|
handler: BackToUsers
|
||||||
});
|
});
|
||||||
|
|
||||||
saveChangesButton = new Ext.Action({
|
saveChangesButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_SAVE_CHANGES,
|
text: _('ID_SAVE_CHANGES'),
|
||||||
//iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
//iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||||
handler: SaveChangesAuthForm,
|
handler: SaveChangesAuthForm,
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
discardChangesButton = new Ext.Action({
|
discardChangesButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_DISCARD_CHANGES,
|
text: _('ID_DISCARD_CHANGES'),
|
||||||
//iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
//iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||||
handler: LoadAuthForm,
|
handler: LoadAuthForm,
|
||||||
disabled: true
|
disabled: true
|
||||||
@@ -122,7 +120,7 @@ Ext.onReady(function(){
|
|||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{id:'GRP_UID', dataIndex: 'GRP_UID', hidden:true, hideable:false},
|
{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',
|
ctCls:'pm_search_text_field',
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
width: 110,
|
width: 110,
|
||||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,
|
emptyText: _('ID_ENTER_SEARCH_TERM'),
|
||||||
listeners: {
|
listeners: {
|
||||||
specialkey: function(f,e){
|
specialkey: function(f,e){
|
||||||
if (e.getKey() == e.ENTER) {
|
if (e.getKey() == e.ENTER) {
|
||||||
@@ -176,7 +174,7 @@ Ext.onReady(function(){
|
|||||||
ctCls:'pm_search_text_field',
|
ctCls:'pm_search_text_field',
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
width: 110,
|
width: 110,
|
||||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,
|
emptyText: _('ID_ENTER_SEARCH_TERM'),
|
||||||
listeners: {
|
listeners: {
|
||||||
specialkey: function(f,e){
|
specialkey: function(f,e){
|
||||||
if (e.getKey() == e.ENTER) {
|
if (e.getKey() == e.ENTER) {
|
||||||
@@ -213,9 +211,10 @@ Ext.onReady(function(){
|
|||||||
frame : false,
|
frame : false,
|
||||||
columnLines : false,
|
columnLines : false,
|
||||||
viewConfig : {forceFit:true},
|
viewConfig : {forceFit:true},
|
||||||
tbar: [TRANSLATIONS.ID_AVAILABLE_GROUPS,{xtype: 'tbfill'},'-',searchTextA,clearTextButtonA],
|
tbar: [_('ID_AVAILABLE_GROUPS'),{xtype: 'tbfill'},'-',searchTextA,clearTextButtonA],
|
||||||
bbar: [{xtype: 'tbfill'}, assignAllButton],
|
//bbar: [{xtype: 'tbfill'}, cancelEditMembersButton],
|
||||||
listeners: {rowdblclick: AssignGroupsAction}
|
listeners: {rowdblclick: AssignGroupsAction},
|
||||||
|
hidden: true
|
||||||
});
|
});
|
||||||
|
|
||||||
assignedGrid = new Ext.grid.GridPanel({
|
assignedGrid = new Ext.grid.GridPanel({
|
||||||
@@ -238,9 +237,11 @@ Ext.onReady(function(){
|
|||||||
frame : false,
|
frame : false,
|
||||||
columnLines : false,
|
columnLines : false,
|
||||||
viewConfig : {forceFit:true},
|
viewConfig : {forceFit:true},
|
||||||
tbar: [TRANSLATIONS.ID_ASSIGNED_GROUPS,{xtype: 'tbfill'},'-',searchTextP,clearTextButtonP],
|
tbar: [_('ID_MEMBER_OF'),{xtype: 'tbfill'},'-',searchTextP,clearTextButtonP],
|
||||||
bbar: [{xtype: 'tbfill'},removeAllButton],
|
//bbar: [{xtype: 'tbfill'},editMembersButton],
|
||||||
listeners: {rowdblclick: RemoveGroupsAction}
|
listeners: {rowdblclick: function(){
|
||||||
|
(availableGrid.hidden)? DoNothing() : RemoveGroupsAction();
|
||||||
|
}}
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonsPanel = new Ext.Panel({
|
buttonsPanel = new Ext.Panel({
|
||||||
@@ -253,23 +254,24 @@ Ext.onReady(function(){
|
|||||||
},
|
},
|
||||||
defaults:{margins:'0 0 35 0'},
|
defaults:{margins:'0 0 35 0'},
|
||||||
items:[
|
items:[
|
||||||
{xtype:'button',text: '>>', handler: AssignGroupsAction, id: 'assignButton', disabled: true},
|
{xtype:'button',text: '> ', handler: AssignGroupsAction, id: 'assignButton', disabled: true},
|
||||||
{xtype:'button',text: '<<', handler: RemoveGroupsAction, id: 'removeButton', 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
|
//GROUPS DRAG AND DROP PANEL
|
||||||
GroupsPanel = new Ext.Panel({
|
GroupsPanel = new Ext.Panel({
|
||||||
title : TRANSLATIONS.ID_GROUPS,
|
title : _('ID_GROUPS'),
|
||||||
autoWidth : true,
|
autoWidth : true,
|
||||||
layout : 'hbox',
|
layout : 'hbox',
|
||||||
defaults : { flex : 1 }, //auto stretch
|
defaults : { flex : 1 }, //auto stretch
|
||||||
layoutConfig : { align : 'stretch' },
|
layoutConfig : { align : 'stretch' },
|
||||||
items : [availableGrid,buttonsPanel,assignedGrid],
|
items : [availableGrid,buttonsPanel,assignedGrid],
|
||||||
viewConfig : {forceFit:true}
|
viewConfig : {forceFit:true},
|
||||||
|
bbar: [{xtype: 'tbfill'},editMembersButton, cancelEditMembersButton]
|
||||||
});
|
});
|
||||||
|
|
||||||
comboAuthSourcesStore = new Ext.data.GroupingStore({
|
comboAuthSourcesStore = new Ext.data.GroupingStore({
|
||||||
@@ -292,12 +294,12 @@ Ext.onReady(function(){
|
|||||||
authForm = new Ext.FormPanel({
|
authForm = new Ext.FormPanel({
|
||||||
url: 'users_Ajax?function=updateAuthServices',
|
url: 'users_Ajax?function=updateAuthServices',
|
||||||
frame: true,
|
frame: true,
|
||||||
title: TRANSLATIONS.ID_AUTHENTICATION_FORM_TITLE,
|
title: _('ID_AUTHENTICATION_FORM_TITLE'),
|
||||||
items:[
|
items:[
|
||||||
{xtype: 'textfield', name: 'usr_uid', hidden: true },
|
{xtype: 'textfield', name: 'usr_uid', hidden: true },
|
||||||
{
|
{
|
||||||
xtype: 'combo',
|
xtype: 'combo',
|
||||||
fieldLabel: TRANSLATIONS.ID_AUTHENTICATION_SOURCE,
|
fieldLabel: _('ID_AUTHENTICATION_SOURCE'),
|
||||||
hiddenName: 'auth_source',
|
hiddenName: 'auth_source',
|
||||||
name: 'auth_source_uid',
|
name: 'auth_source_uid',
|
||||||
typeAhead: true,
|
typeAhead: true,
|
||||||
@@ -309,20 +311,22 @@ Ext.onReady(function(){
|
|||||||
submitValue: true,
|
submitValue: true,
|
||||||
//hiddenValue: 'AUTH_SOURCE_UID',
|
//hiddenValue: 'AUTH_SOURCE_UID',
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText: TRANSLATIONS.ID_SELECT_AUTH_SOURCE,
|
emptyText: _('ID_SELECT_AUTH_SOURCE'),
|
||||||
selectOnFocus:true,
|
selectOnFocus:true,
|
||||||
listeners:{select: function(c,r,i){
|
listeners:{
|
||||||
|
select: function(c,r,i){
|
||||||
ReportChanges();
|
ReportChanges();
|
||||||
if (i==0){
|
if (i==0){
|
||||||
authForm.getForm().findField('auth_dn').disable();
|
authForm.getForm().findField('auth_dn').disable();
|
||||||
}else{
|
}else{
|
||||||
authForm.getForm().findField('auth_dn').enable();
|
authForm.getForm().findField('auth_dn').enable();
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
fieldLabel: TRANSLATIONS.ID_AUTHENTICATION_DN,
|
fieldLabel: _('ID_AUTHENTICATION_DN'),
|
||||||
name: 'auth_dn',
|
name: 'auth_dn',
|
||||||
width: 350,
|
width: 350,
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
@@ -334,12 +338,9 @@ Ext.onReady(function(){
|
|||||||
buttons: [discardChangesButton,saveChangesButton]
|
buttons: [discardChangesButton,saveChangesButton]
|
||||||
});
|
});
|
||||||
|
|
||||||
LoadAuthForm();
|
|
||||||
|
|
||||||
|
|
||||||
//AUTHENTICATION EDITING PANEL
|
//AUTHENTICATION EDITING PANEL
|
||||||
AuthenticationPanel = new Ext.Panel({
|
AuthenticationPanel = new Ext.Panel({
|
||||||
title : TRANSLATIONS.ID_AUTHENTICATION,
|
title : _('ID_AUTHENTICATION'),
|
||||||
autoWidth : true,
|
autoWidth : true,
|
||||||
layout : 'hbox',
|
layout : 'hbox',
|
||||||
defaults : { flex : 1 }, //auto stretch
|
defaults : { flex : 1 }, //auto stretch
|
||||||
@@ -350,25 +351,97 @@ Ext.onReady(function(){
|
|||||||
hideLabel: true
|
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
|
//NORTH PANEL WITH TITLE AND ROLE DETAILS
|
||||||
northPanel = new Ext.Panel({
|
northPanel = new Ext.Panel({
|
||||||
region: 'north',
|
region: 'north',
|
||||||
xtype: 'panel',
|
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
|
//TABS PANEL
|
||||||
tabsPanel = new Ext.TabPanel({
|
tabsPanel = new Ext.TabPanel({
|
||||||
region: 'center',
|
region: 'center',
|
||||||
activeTab: USERS.CURRENT_TAB,
|
activeTab: USERS.CURRENT_TAB,
|
||||||
items:[GroupsPanel,AuthenticationPanel],
|
items:[SummaryPanel,GroupsPanel,AuthenticationPanel],
|
||||||
listeners:{
|
listeners:{
|
||||||
beforetabchange: function(p,t,c){
|
beforetabchange: function(p,t,c){
|
||||||
switch(t.title){
|
switch(t.title){
|
||||||
case TRANSLATIONS.ID_GROUPS:
|
case _('ID_GROUPS'):
|
||||||
if (sw_form_changed){
|
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){
|
function(btn, text){
|
||||||
if (btn=="no"){
|
if (btn=="no"){
|
||||||
p.setActiveTab(c);
|
p.setActiveTab(c);
|
||||||
@@ -382,12 +455,16 @@ Ext.onReady(function(){
|
|||||||
},
|
},
|
||||||
tabchange: function(p,t){
|
tabchange: function(p,t){
|
||||||
switch(t.title){
|
switch(t.title){
|
||||||
case TRANSLATIONS.ID_GROUPS:
|
case _('ID_GROUPS'):
|
||||||
|
sw_func_groups ? DoNothing() : RefreshGroups();
|
||||||
sw_func_groups ? DoNothing() : DDLoadGroups();
|
sw_func_groups ? DoNothing() : DDLoadGroups();
|
||||||
break;
|
break;
|
||||||
case TRANSLATIONS.ID_AUTHENTICATION:
|
case _('ID_AUTHENTICATION'):
|
||||||
|
//LoadAuthForm();
|
||||||
sw_func_auth ? DoNothing() : LoadAuthForm();
|
sw_func_auth ? DoNothing() : LoadAuthForm();
|
||||||
break;
|
break;
|
||||||
|
case _('ID_SUMMARY'):
|
||||||
|
sw_user_summary ? DoNothing(): LoadSummary();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -398,16 +475,15 @@ Ext.onReady(function(){
|
|||||||
layout: 'border',
|
layout: 'border',
|
||||||
items: [northPanel, tabsPanel]
|
items: [northPanel, tabsPanel]
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Do Nothing Function
|
//Do Nothing Function
|
||||||
DoNothing = function(){}
|
DoNothing = function(){};
|
||||||
|
|
||||||
//Return to Roles Main Page
|
//Return to Roles Main Page
|
||||||
BackToUsers = function(){
|
BackToUsers = function(){
|
||||||
location.href = 'users_List';
|
location.href = 'users_List';
|
||||||
}
|
};
|
||||||
|
|
||||||
//Loads Drag N Drop Functionality for Permissions
|
//Loads Drag N Drop Functionality for Permissions
|
||||||
DDLoadGroups = function(){
|
DDLoadGroups = function(){
|
||||||
@@ -424,7 +500,7 @@ DDLoadGroups = function(){
|
|||||||
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//GROUPS DRAG N DROP ASSIGNED
|
//GROUPS DRAG N DROP ASSIGNED
|
||||||
var assignedGridDropTargetEl = assignedGrid.getView().scroller.dom;
|
var assignedGridDropTargetEl = assignedGrid.getView().scroller.dom;
|
||||||
@@ -441,7 +517,7 @@ DDLoadGroups = function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
sw_func_groups = true;
|
sw_func_groups = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
//LOAD AUTHTENTICATION FORM DATA
|
//LOAD AUTHTENTICATION FORM DATA
|
||||||
LoadAuthForm = function(){
|
LoadAuthForm = function(){
|
||||||
@@ -461,31 +537,30 @@ LoadAuthForm = function(){
|
|||||||
},
|
},
|
||||||
failure: DoNothing
|
failure: DoNothing
|
||||||
});
|
});
|
||||||
|
|
||||||
sw_func_auth = true;
|
sw_func_auth = true;
|
||||||
sw_form_changed = false;
|
sw_form_changed = false;
|
||||||
saveChangesButton.disable();
|
saveChangesButton.disable();
|
||||||
discardChangesButton.disable();
|
discardChangesButton.disable();
|
||||||
}
|
};
|
||||||
|
|
||||||
//ReportChanges
|
//ReportChanges
|
||||||
ReportChanges = function(){
|
ReportChanges = function(){
|
||||||
saveChangesButton.enable();
|
saveChangesButton.enable();
|
||||||
discardChangesButton.enable();
|
discardChangesButton.enable();
|
||||||
sw_form_changed = true;
|
sw_form_changed = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
//REFRESH GROUPS GRIDS
|
//REFRESH GROUPS GRIDS
|
||||||
RefreshGroups = function(){
|
RefreshGroups = function(){
|
||||||
DoSearchA();
|
DoSearchA();
|
||||||
DoSearchP();
|
DoSearchP();
|
||||||
}
|
};
|
||||||
|
|
||||||
//SAVE AUTHENTICATION CHANGES
|
//SAVE AUTHENTICATION CHANGES
|
||||||
|
|
||||||
SaveChangesAuthForm = function(){
|
SaveChangesAuthForm = function(){
|
||||||
viewport.getEl().mask(TRANSLATIONS.ID_PROCESSING);
|
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||||
authForm.getForm().submit({
|
authForm.getForm().submit({
|
||||||
success: function(f,a){
|
success: function(f,a){
|
||||||
LoadAuthForm();
|
LoadAuthForm();
|
||||||
@@ -496,17 +571,17 @@ SaveChangesAuthForm = function(){
|
|||||||
viewport.getEl().unmask();
|
viewport.getEl().unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
//FAILURE AJAX FUNCTION
|
//FAILURE AJAX FUNCTION
|
||||||
FailureProcess = 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
|
//ASSIGN GROUPS TO A USER
|
||||||
SaveGroupsUser = function(arr_grp, function_success, function_failure){
|
SaveGroupsUser = function(arr_grp, function_success, function_failure){
|
||||||
var sw_response;
|
var sw_response;
|
||||||
viewport.getEl().mask(TRANSLATIONS.ID_PROCESSING);
|
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'users_Ajax',
|
url: 'users_Ajax',
|
||||||
params: {'function': 'assignGroupsToUserMultiple', USR_UID: USERS.USR_UID, GRP_UID: arr_grp.join(',')},
|
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();
|
viewport.getEl().unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
//REMOVE GROUPS FROM A USER
|
//REMOVE GROUPS FROM A USER
|
||||||
DeleteGroupsUser = function(arr_grp, function_success, function_failure){
|
DeleteGroupsUser = function(arr_grp, function_success, function_failure){
|
||||||
var sw_response;
|
var sw_response;
|
||||||
viewport.getEl().mask(TRANSLATIONS.ID_PROCESSING);
|
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'users_Ajax',
|
url: 'users_Ajax',
|
||||||
params: {'function': 'deleteGroupsToUserMultiple', USR_UID: USERS.USR_UID, GRP_UID: arr_grp.join(',')},
|
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();
|
viewport.getEl().unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
//AssignButton Functionality
|
//AssignButton Functionality
|
||||||
AssignGroupsAction = function(){
|
AssignGroupsAction = function(){
|
||||||
@@ -547,7 +622,7 @@ AssignGroupsAction = function(){
|
|||||||
arrAux[a] = rowsSelected[a].get('GRP_UID');
|
arrAux[a] = rowsSelected[a].get('GRP_UID');
|
||||||
}
|
}
|
||||||
SaveGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
SaveGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||||
}
|
};
|
||||||
|
|
||||||
//RemoveButton Functionality
|
//RemoveButton Functionality
|
||||||
RemoveGroupsAction = function(){
|
RemoveGroupsAction = function(){
|
||||||
@@ -557,7 +632,7 @@ RemoveGroupsAction = function(){
|
|||||||
arrAux[a] = rowsSelected[a].get('GRP_UID');
|
arrAux[a] = rowsSelected[a].get('GRP_UID');
|
||||||
}
|
}
|
||||||
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||||
}
|
};
|
||||||
|
|
||||||
//AssignALLButton Functionality
|
//AssignALLButton Functionality
|
||||||
AssignAllGroupsAction = function(){
|
AssignAllGroupsAction = function(){
|
||||||
@@ -570,7 +645,7 @@ AssignAllGroupsAction = function(){
|
|||||||
}
|
}
|
||||||
SaveGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
SaveGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
//RevomeALLButton Functionality
|
//RevomeALLButton Functionality
|
||||||
RemoveAllGroupsAction = function(){
|
RemoveAllGroupsAction = function(){
|
||||||
@@ -583,26 +658,92 @@ RemoveAllGroupsAction = function(){
|
|||||||
}
|
}
|
||||||
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
DeleteGroupsUser(arrAux,RefreshGroups,FailureProcess);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
//Function DoSearch Available
|
//Function DoSearch Available
|
||||||
DoSearchA = function(){
|
DoSearchA = function(){
|
||||||
availableGrid.store.load({params: {textFilter: searchTextA.getValue()}});
|
availableGrid.store.load({params: {textFilter: searchTextA.getValue()}});
|
||||||
}
|
};
|
||||||
|
|
||||||
//Function DoSearch Assigned
|
//Function DoSearch Assigned
|
||||||
DoSearchP = function(){
|
DoSearchP = function(){
|
||||||
assignedGrid.store.load({params: {textFilter: searchTextP.getValue()}});
|
assignedGrid.store.load({params: {textFilter: searchTextP.getValue()}});
|
||||||
}
|
};
|
||||||
|
|
||||||
//Load Grid By Default Available Members
|
//Load Grid By Default Available Members
|
||||||
GridByDefaultA = function(){
|
GridByDefaultA = function(){
|
||||||
searchTextA.reset();
|
searchTextA.reset();
|
||||||
availableGrid.store.load();
|
availableGrid.store.load();
|
||||||
}
|
};
|
||||||
|
|
||||||
//Load Grid By Default Assigned Members
|
//Load Grid By Default Assigned Members
|
||||||
GridByDefaultP = function(){
|
GridByDefaultP = function(){
|
||||||
searchTextP.reset();
|
searchTextP.reset();
|
||||||
assignedGrid.store.load();
|
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 infoGrid;
|
||||||
var viewport;
|
var viewport;
|
||||||
var smodel;
|
var smodel;
|
||||||
|
|
||||||
var newButton;
|
var newButton;
|
||||||
var editButton;
|
var editButton;
|
||||||
var deleteButton;
|
var deleteButton;
|
||||||
|
var summaryButton;
|
||||||
var groupsButton;
|
var groupsButton;
|
||||||
//var reassignButton;
|
//var reassignButton;
|
||||||
var authenticationButton;
|
var authenticationButton;
|
||||||
var searchButton;
|
var searchButton;
|
||||||
|
|
||||||
var searchText;
|
var searchText;
|
||||||
|
|
||||||
var contextMenu;
|
var contextMenu;
|
||||||
|
|
||||||
var user_admin = '00000000000000000000000000000001';
|
var user_admin = '00000000000000000000000000000001';
|
||||||
|
var pageSize;
|
||||||
|
var fullNameFormat;
|
||||||
|
var dateFormat;
|
||||||
|
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
Ext.QuickTips.init();
|
Ext.QuickTips.init();
|
||||||
|
|
||||||
|
fullNameFormat = CONFIG.fullNameFormat;
|
||||||
|
dateFormat = CONFIG.dateFormat;
|
||||||
|
pageSize = parseInt(CONFIG.pageSize);
|
||||||
|
|
||||||
newButton = new Ext.Action({
|
newButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_NEW,
|
text: _('ID_NEW'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
iconCls: 'button_menu_ext ss_sprite ss_add',
|
||||||
handler: NewUserAction
|
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({
|
editButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_EDIT,
|
text: _('ID_EDIT'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||||
handler: EditUserAction,
|
handler: EditUserAction,
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
deleteButton = new Ext.Action({
|
deleteButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_DELETE,
|
text: _('ID_DELETE'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||||
handler: DeleteUserAction,
|
handler: DeleteUserAction,
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
groupsButton = new Ext.Action({
|
groupsButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_GROUPS,
|
text: _('ID_GROUPS'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_group_add',
|
iconCls: 'button_menu_ext ss_sprite ss_group_add',
|
||||||
handler: UsersGroupPage,
|
handler: UsersGroupPage,
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// reassignButton = new Ext.Action({
|
// reassignButton = new Ext.Action({
|
||||||
// text: TRANSLATIONS.ID_REASSIGN_CASES,
|
// text: _('ID_REASSIGN_CASES'),
|
||||||
// iconCls: 'button_menu_ext ss_sprite ss_arrow_rotate_clockwise',
|
// iconCls: 'button_menu_ext ss_sprite ss_arrow_rotate_clockwise',
|
||||||
// handler: DoNothing,
|
// handler: DoNothing,
|
||||||
// disabled: true
|
// disabled: true
|
||||||
// });
|
// });
|
||||||
|
|
||||||
authenticationButton = new Ext.Action({
|
authenticationButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_AUTHENTICATION,
|
text: _('ID_AUTHENTICATION'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_key',
|
iconCls: 'button_menu_ext ss_sprite ss_key',
|
||||||
handler: AuthUserPage,
|
handler: AuthUserPage,
|
||||||
disabled: true
|
disabled: true
|
||||||
@@ -99,12 +110,12 @@ Ext.onReady(function(){
|
|||||||
|
|
||||||
|
|
||||||
searchButton = new Ext.Action({
|
searchButton = new Ext.Action({
|
||||||
text: TRANSLATIONS.ID_SEARCH,
|
text: _('ID_SEARCH'),
|
||||||
handler: DoSearch
|
handler: DoSearch
|
||||||
});
|
});
|
||||||
|
|
||||||
contextMenu = new Ext.menu.Menu({
|
contextMenu = new Ext.menu.Menu({
|
||||||
items: [editButton, deleteButton,'-',groupsButton,'-',authenticationButton]
|
items: [editButton, deleteButton,'-',groupsButton,'-',authenticationButton,'-',summaryButton]
|
||||||
});
|
});
|
||||||
|
|
||||||
searchText = new Ext.form.TextField ({
|
searchText = new Ext.form.TextField ({
|
||||||
@@ -112,7 +123,7 @@ Ext.onReady(function(){
|
|||||||
ctCls:'pm_search_text_field',
|
ctCls:'pm_search_text_field',
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,//'enter search term',
|
emptyText: _('ID_ENTER_SEARCH_TERM'),//'enter search term',
|
||||||
listeners: {
|
listeners: {
|
||||||
specialkey: function(f,e){
|
specialkey: function(f,e){
|
||||||
if (e.getKey() == e.ENTER) {
|
if (e.getKey() == e.ENTER) {
|
||||||
@@ -132,7 +143,6 @@ Ext.onReady(function(){
|
|||||||
handler: GridByDefault
|
handler: GridByDefault
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
smodel = new Ext.grid.RowSelectionModel({
|
smodel = new Ext.grid.RowSelectionModel({
|
||||||
singleSelect: true,
|
singleSelect: true,
|
||||||
listeners:{
|
listeners:{
|
||||||
@@ -142,6 +152,7 @@ Ext.onReady(function(){
|
|||||||
groupsButton.enable();
|
groupsButton.enable();
|
||||||
//reassignButton.enable();
|
//reassignButton.enable();
|
||||||
authenticationButton.enable();
|
authenticationButton.enable();
|
||||||
|
summaryButton.enable();
|
||||||
},
|
},
|
||||||
rowdeselect: function(sm){
|
rowdeselect: function(sm){
|
||||||
editButton.disable();
|
editButton.disable();
|
||||||
@@ -149,27 +160,70 @@ Ext.onReady(function(){
|
|||||||
groupsButton.disable();
|
groupsButton.disable();
|
||||||
//reassignButton.disable();
|
//reassignButton.disable();
|
||||||
authenticationButton.disable();
|
authenticationButton.disable();
|
||||||
|
summaryButton.disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
store = new Ext.data.GroupingStore( {
|
store = new Ext.data.GroupingStore( {
|
||||||
proxy : new Ext.data.HttpProxy({
|
proxy : new Ext.data.HttpProxy({
|
||||||
url: 'data_usersList'
|
url: 'users_Ajax?function=usersList'
|
||||||
}),
|
}),
|
||||||
reader : new Ext.data.JsonReader( {
|
reader : new Ext.data.JsonReader( {
|
||||||
root: 'users',
|
root: 'users',
|
||||||
|
totalProperty: 'total_users',
|
||||||
fields : [
|
fields : [
|
||||||
{name : 'USR_UID'},
|
{name : 'USR_UID'},
|
||||||
{name : 'USR_USERNAME'},
|
{name : 'USR_USERNAME'},
|
||||||
{name : 'USR_COMPLETENAME'},
|
{name : 'USR_FIRSTNAME'},
|
||||||
|
{name : 'USR_LASTNAME'},
|
||||||
{name : 'USR_EMAIL'},
|
{name : 'USR_EMAIL'},
|
||||||
{name : 'USR_ROLE'},
|
{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({
|
cmodel = new Ext.grid.ColumnModel({
|
||||||
defaults: {
|
defaults: {
|
||||||
width: 50,
|
width: 50,
|
||||||
@@ -177,12 +231,16 @@ Ext.onReady(function(){
|
|||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
{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: '', dataIndex: 'USR_UID', width: 30, align:'center', sortable: false, renderer: photo_user},
|
||||||
{header: TRANSLATIONS.ID_FULL_NAME, dataIndex: 'USR_COMPLETENAME', width: 80, align:'left'},
|
{header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 90, hidden:false, align:'left'},
|
||||||
{header: TRANSLATIONS.ID_USER_NAME, dataIndex: 'USR_USERNAME', width: 60, hidden:false, align:'left'},
|
{header: _('ID_FULL_NAME'), dataIndex: 'USR_USERNAME', width: 175, align:'left', renderer: full_name},
|
||||||
{header: TRANSLATIONS.ID_EMAIL, dataIndex: 'USR_EMAIL', width: 60, hidden: false, align: 'left'},
|
{header: _('ID_EMAIL'), dataIndex: 'USR_EMAIL', width: 120, hidden: true, align: 'left'},
|
||||||
{header: TRANSLATIONS.ID_ROLE, dataIndex: 'USR_ROLE', width: 70, hidden:false, align:'left'},
|
{header: _('ID_STATUS'), dataIndex: 'USR_STATUS', width: 50, hidden: false, align: 'center', renderer: render_status},
|
||||||
{header: TRANSLATIONS.ID_DUE_DATE, dataIndex: 'USR_DUE_DATE', width: 30, hidden:false, align:'center'}
|
{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: {
|
viewConfig: {
|
||||||
forceFit:true
|
forceFit:true
|
||||||
},
|
},
|
||||||
title : TRANSLATIONS.ID_USERS,
|
title : _('ID_USERS'),
|
||||||
store: store,
|
store: store,
|
||||||
cm: cmodel,
|
cm: cmodel,
|
||||||
sm: smodel,
|
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: {
|
listeners: {
|
||||||
rowdblclick: EditUserAction
|
rowdblclick: SummaryTabOpen
|
||||||
},
|
},
|
||||||
view: new Ext.grid.GroupingView({
|
view: new Ext.grid.GroupingView({
|
||||||
forceFit:true,
|
forceFit:true,
|
||||||
@@ -238,70 +297,65 @@ Ext.onReady(function(){
|
|||||||
viewport = new Ext.Viewport({
|
viewport = new Ext.Viewport({
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
autoScroll: false,
|
autoScroll: false,
|
||||||
items: [
|
items: [infoGrid]
|
||||||
infoGrid
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//Funtion Handles Context Menu Opening
|
//Function Handles Context Menu Opening
|
||||||
onMessageContextMenu = function (grid, rowIndex, e) {
|
onMessageContextMenu = function (grid, rowIndex, e) {
|
||||||
e.stopEvent();
|
e.stopEvent();
|
||||||
var coords = e.getXY();
|
var coords = e.getXY();
|
||||||
contextMenu.showAt([coords[0], coords[1]]);
|
contextMenu.showAt([coords[0], coords[1]]);
|
||||||
}
|
};
|
||||||
|
|
||||||
//Do Nothing Function
|
//Do Nothing Function
|
||||||
DoNothing = function(){}
|
DoNothing = function(){};
|
||||||
|
|
||||||
//Open New User Form
|
//Open New User Form
|
||||||
NewUserAction = function(){
|
NewUserAction = function(){
|
||||||
location.href = 'users_New';
|
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
|
//Delete User Action
|
||||||
DeleteUserAction = function(){
|
DeleteUserAction = function(){
|
||||||
var uid = infoGrid.getSelectionModel().getSelected();
|
var uid = infoGrid.getSelectionModel().getSelected();
|
||||||
if (uid){
|
if (uid){
|
||||||
if (uid.data.USR_UID==user_admin){
|
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{
|
}else{
|
||||||
|
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'users_Ajax',
|
url: 'users_Ajax',
|
||||||
params: {'function': 'canDeleteUser', uUID: uid.data.USR_UID},
|
params: {'function': 'canDeleteUser', uUID: uid.data.USR_UID},
|
||||||
success: function(res, opt){
|
success: function(res, opt){
|
||||||
|
viewport.getEl().unmask();
|
||||||
response = Ext.util.JSON.decode(res.responseText);
|
response = Ext.util.JSON.decode(res.responseText);
|
||||||
if (response.candelete){
|
if (response.candelete){
|
||||||
if (response.hashistory){
|
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){
|
function(btn){
|
||||||
if (btn=='yes') DeleteUser(uid.data.USR_UID);
|
if (btn=='yes') DeleteUser(uid.data.USR_UID);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}else{
|
}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){
|
function(btn){
|
||||||
if (btn=='yes') DeleteUser(uid.data.USR_UID);
|
if (btn=='yes') DeleteUser(uid.data.USR_UID);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}else{
|
}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
|
//Open User-Groups Manager
|
||||||
UsersGroupPage = function(value){
|
UsersGroupPage = function(value){
|
||||||
@@ -310,7 +364,24 @@ UsersGroupPage = function(value){
|
|||||||
value = rowSelected.data.USR_UID;
|
value = rowSelected.data.USR_UID;
|
||||||
location.href = 'usersGroups?uUID=' + value + '&type=group';
|
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
|
//Open Authentication-User Manager
|
||||||
AuthUserPage = function(value){
|
AuthUserPage = function(value){
|
||||||
@@ -319,23 +390,45 @@ AuthUserPage = function(value){
|
|||||||
value = rowSelected.data.USR_UID;
|
value = rowSelected.data.USR_UID;
|
||||||
location.href = 'usersGroups?uUID=' + value + '&type=auth';;
|
location.href = 'usersGroups?uUID=' + value + '&type=auth';;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
//Renderer Active/Inactive Role
|
//Renderer Active/Inactive Role
|
||||||
photo_user = function(value){
|
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
|
//Load Grid By Default
|
||||||
GridByDefault = function(){
|
GridByDefault = function(){
|
||||||
searchText.reset();
|
searchText.reset();
|
||||||
infoGrid.store.load();
|
infoGrid.store.load();
|
||||||
}
|
};
|
||||||
|
|
||||||
//Do Search Function
|
//Do Search Function
|
||||||
DoSearch = function(){
|
DoSearch = function(){
|
||||||
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
||||||
}
|
};
|
||||||
|
|
||||||
//Delete User Function
|
//Delete User Function
|
||||||
DeleteUser = function(uid){
|
DeleteUser = function(uid){
|
||||||
@@ -344,8 +437,25 @@ DeleteUser = function(uid){
|
|||||||
params: {'function': 'deleteUser', USR_UID: uid},
|
params: {'function': 'deleteUser', USR_UID: uid},
|
||||||
success: function(res, opt){
|
success: function(res, opt){
|
||||||
DoSearch();
|
DoSearch();
|
||||||
Ext.Msg.alert(TRANSLATIONS.ID_USERS,TRANSLATIONS.ID_USERS_SUCCESS_DELETE);
|
PMExt.notify(_('ID_USERS'),_('ID_USERS_SUCCESS_DELETE'));
|
||||||
},
|
},
|
||||||
failure: DoNothing
|
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