BUG 9560 "List of Departments correct except for items with..." SOLVED
- There problems with the names of departments and groups that have the characters "<" and ">" - Solved the problem with the characters "<" and ">" in departments and groups (in the list and modification)
This commit is contained in:
@@ -24,16 +24,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function LookForChildren($parent, $level,$aDepUsers){
|
function LookForChildren($parent, $level,$aDepUsers){
|
||||||
G::LoadClass('configuration');
|
G::LoadClass('configuration');
|
||||||
$conf = new Configurations();
|
$conf = new Configurations();
|
||||||
$oDept = new Department();
|
$oDept = new Department();
|
||||||
$allDepartments = $oDept->getDepartments ( $parent );
|
$allDepartments = $oDept->getDepartments ( $parent );
|
||||||
$level++;
|
$level++;
|
||||||
$rows = Array();
|
$rows = Array();
|
||||||
foreach($allDepartments as $department){
|
foreach($allDepartments as $department){
|
||||||
unset($depto);
|
unset($depto);
|
||||||
$depto['DEP_TITLE'] = $department['DEP_TITLE'];
|
$depto['DEP_TITLE'] = str_replace(array("<", ">"), array("<", ">"), $department['DEP_TITLE']);
|
||||||
$depto['DEP_STATUS'] = $department['DEP_STATUS'];
|
$depto['DEP_STATUS'] = $department['DEP_STATUS'];
|
||||||
if ($department['DEP_MANAGER_USERNAME']!=''){
|
if ($department['DEP_MANAGER_USERNAME']!=''){
|
||||||
$depto['DEP_MANAGER_NAME'] = $conf->usersNameFormat($department['DEP_MANAGER_USERNAME'], $department['DEP_MANAGER_FIRSTNAME'], $department['DEP_MANAGER_LASTNAME']);
|
$depto['DEP_MANAGER_NAME'] = $conf->usersNameFormat($department['DEP_MANAGER_USERNAME'], $department['DEP_MANAGER_FIRSTNAME'], $department['DEP_MANAGER_LASTNAME']);
|
||||||
@@ -47,7 +47,7 @@ function LookForChildren($parent, $level,$aDepUsers){
|
|||||||
if ($department['HAS_CHILDREN'] > 0){
|
if ($department['HAS_CHILDREN'] > 0){
|
||||||
$depto['children'] = LookForChildren($department['DEP_UID'], $level, $aDepUsers);
|
$depto['children'] = LookForChildren($department['DEP_UID'], $level, $aDepUsers);
|
||||||
$depto['iconCls'] = 'ss_sprite ss_chart_organisation';
|
$depto['iconCls'] = 'ss_sprite ss_chart_organisation';
|
||||||
$depto['expanded'] = true;
|
$depto['expanded'] = true;
|
||||||
}else{
|
}else{
|
||||||
$depto['leaf'] = true;
|
$depto['leaf'] = true;
|
||||||
if ($level==1){
|
if ($level==1){
|
||||||
@@ -55,10 +55,10 @@ function LookForChildren($parent, $level,$aDepUsers){
|
|||||||
}else{
|
}else{
|
||||||
$depto['iconCls'] = 'ss_sprite ss_plugin';
|
$depto['iconCls'] = 'ss_sprite ss_plugin';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[] = $depto;
|
$rows[] = $depto;
|
||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,26 +79,26 @@ switch ($_POST['action'])
|
|||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'departments/departments_Edit', '', $aFields , '');
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'departments/departments_Edit', '', $aFields , '');
|
||||||
|
|
||||||
$criteria = $oDept->getUsersFromDepartment( $_POST['sDptoUID'], $aFields ['DEP_MANAGER'] );
|
$criteria = $oDept->getUsersFromDepartment( $_POST['sDptoUID'], $aFields ['DEP_MANAGER'] );
|
||||||
|
|
||||||
$G_PUBLISH->AddContent('propeltable', 'departments/paged-table2', 'departments/departments_UsersList', $criteria, $aFields );
|
$G_PUBLISH->AddContent('propeltable', 'departments/paged-table2', 'departments/departments_UsersList', $criteria, $aFields );
|
||||||
//$G_PUBLISH->AddContent('propeltable', 'paged-table', 'departments/departments_UsersList', $criteria, $aFields);
|
//$G_PUBLISH->AddContent('propeltable', 'paged-table', 'departments/departments_UsersList', $criteria, $aFields);
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher =& headPublisher::getSingleton();
|
||||||
$oHeadPublisher->addScriptCode("groupname='{$aFields["DEPO_TITLE"]}';");
|
$oHeadPublisher->addScriptCode("groupname='{$aFields["DEPO_TITLE"]}';");
|
||||||
$oHeadPublisher->addScriptCode("depUid='{$aFields["DEP_UID"]}';");
|
$oHeadPublisher->addScriptCode("depUid='{$aFields["DEP_UID"]}';");
|
||||||
|
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'assignAllUsers':
|
case 'assignAllUsers':
|
||||||
$aUsers = explode(',', $_POST['aUsers']);
|
$aUsers = explode(',', $_POST['aUsers']);
|
||||||
$oDept = new Department();
|
$oDept = new Department();
|
||||||
$depUid = $_POST['DEP_UID'];
|
$depUid = $_POST['DEP_UID'];
|
||||||
$cant = $oDept->cantUsersInDepartment( $depUid);
|
$cant = $oDept->cantUsersInDepartment( $depUid);
|
||||||
|
|
||||||
if ( $cant == 0 ) $manager = true;
|
if ( $cant == 0 ) $manager = true;
|
||||||
|
|
||||||
for( $i=0; $i<count($aUsers); $i++) {
|
for( $i=0; $i<count($aUsers); $i++) {
|
||||||
$oDept->addUserToDepartment( $depUid, $aUsers[$i], $manager, false );
|
$oDept->addUserToDepartment( $depUid, $aUsers[$i], $manager, false );
|
||||||
$manager = false;
|
$manager = false;
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ switch ($_POST['action'])
|
|||||||
$oDept = new Department();
|
$oDept = new Department();
|
||||||
$oDept->removeUserFromDepartment($_POST['DEP_UID'], $_POST['USR_UID']);
|
$oDept->removeUserFromDepartment($_POST['DEP_UID'], $_POST['USR_UID']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'verifyDptoname':
|
case 'verifyDptoname':
|
||||||
$_POST['sOriginalGroupname'] = get_ajax_value('sOriginalGroupname');
|
$_POST['sOriginalGroupname'] = get_ajax_value('sOriginalGroupname');
|
||||||
$_POST['sGroupname'] = get_ajax_value('sGroupname');
|
$_POST['sGroupname'] = get_ajax_value('sGroupname');
|
||||||
@@ -136,20 +136,20 @@ switch ($_POST['action'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'showUnAssignedUsers':
|
case 'showUnAssignedUsers':
|
||||||
$_POST['UID'] = get_ajax_value('UID');
|
$_POST['UID'] = get_ajax_value('UID');
|
||||||
require_once ( 'classes/class.xmlfield_InputPM.php' );
|
require_once ( 'classes/class.xmlfield_InputPM.php' );
|
||||||
|
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
|
if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
|
||||||
G::LoadClass ( 'departments');
|
G::LoadClass ( 'departments');
|
||||||
$oDept = new Department();
|
$oDept = new Department();
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$G_PUBLISH->AddContent('propeltable', 'departments/paged-table3', 'departments/departments_AddUnAssignedUsers', $oDept->getAvailableUsersCriteria(''));
|
$G_PUBLISH->AddContent('propeltable', 'departments/paged-table3', 'departments/departments_AddUnAssignedUsers', $oDept->getAvailableUsersCriteria(''));
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'departmentList':
|
case 'departmentList':
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
@@ -160,9 +160,9 @@ switch ($_POST['action'])
|
|||||||
case 'checkDepartmentName':
|
case 'checkDepartmentName':
|
||||||
$parent = $_REQUEST['parent'];
|
$parent = $_REQUEST['parent'];
|
||||||
$dep_name = $_REQUEST['name'];
|
$dep_name = $_REQUEST['name'];
|
||||||
|
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
|
|
||||||
$oCriteria->clearSelectColumns();
|
$oCriteria->clearSelectColumns();
|
||||||
$oCriteria->addSelectColumn( ContentPeer::CON_CATEGORY );
|
$oCriteria->addSelectColumn( ContentPeer::CON_CATEGORY );
|
||||||
$oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
|
$oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||||
@@ -170,26 +170,26 @@ switch ($_POST['action'])
|
|||||||
$oCriteria->add(ContentPeer::CON_CATEGORY, 'DEPO_TITLE');
|
$oCriteria->add(ContentPeer::CON_CATEGORY, 'DEPO_TITLE');
|
||||||
$oCriteria->addJoin(ContentPeer::CON_ID, DepartmentPeer::DEP_UID, Criteria::LEFT_JOIN);
|
$oCriteria->addJoin(ContentPeer::CON_ID, DepartmentPeer::DEP_UID, Criteria::LEFT_JOIN);
|
||||||
$oCriteria->add(ContentPeer::CON_VALUE, $dep_name);
|
$oCriteria->add(ContentPeer::CON_VALUE, $dep_name);
|
||||||
$oCriteria->add(ContentPeer::CON_LANG, SYS_LANG );
|
$oCriteria->add(ContentPeer::CON_LANG, SYS_LANG );
|
||||||
$oCriteria->add(DepartmentPeer::DEP_PARENT,$parent);
|
$oCriteria->add(DepartmentPeer::DEP_PARENT,$parent);
|
||||||
|
|
||||||
$oDataset = DepartmentPeer::doSelectRS($oCriteria);
|
$oDataset = DepartmentPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
|
||||||
echo (!$aRow) ? 'true' : 'false';
|
echo (!$aRow) ? 'true' : 'false';
|
||||||
break;
|
break;
|
||||||
case 'checkEditDepartmentName':
|
case 'checkEditDepartmentName':
|
||||||
$parent = $_REQUEST['parent'];
|
$parent = $_REQUEST['parent'];
|
||||||
$dep_name = $_REQUEST['name'];
|
$dep_name = $_REQUEST['name'];
|
||||||
$dep_uid = $_REQUEST['uid'];
|
$dep_uid = $_REQUEST['uid'];
|
||||||
|
|
||||||
$oDepartment = new Department();
|
$oDepartment = new Department();
|
||||||
$checkVal = $oDepartment->checkDepartmentName($dep_name, $parent, $dep_uid );
|
$checkVal = $oDepartment->checkDepartmentName($dep_name, $parent, $dep_uid );
|
||||||
echo ( !$checkVal ) ? 'true' : 'false';
|
echo ( !$checkVal ) ? 'true' : 'false';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'saveDepartment':
|
case 'saveDepartment':
|
||||||
$parent = $_REQUEST['parent'];
|
$parent = $_REQUEST['parent'];
|
||||||
$dep_name = $_REQUEST['name'];
|
$dep_name = $_REQUEST['name'];
|
||||||
@@ -210,25 +210,25 @@ switch ($_POST['action'])
|
|||||||
$oCriteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
|
$oCriteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
|
||||||
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||||
$oCriteria->add(UsersPeer::DEP_UID, $sDepUid);
|
$oCriteria->add(UsersPeer::DEP_UID, $sDepUid);
|
||||||
|
|
||||||
$oDataset = DepartmentPeer::doSelectRS($oCriteria);
|
$oDataset = DepartmentPeer::doSelectRS($oCriteria);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
$rows = Array();
|
$rows = Array();
|
||||||
unset($first);
|
unset($first);
|
||||||
$first['USR_UID'] = '';
|
$first['USR_UID'] = '';
|
||||||
$first['USR_VALUE'] = G::LoadTranslation('ID_NO_MANAGER_SELECTED');
|
$first['USR_VALUE'] = G::LoadTranslation('ID_NO_MANAGER_SELECTED');
|
||||||
$rows[] = $first;
|
$rows[] = $first;
|
||||||
|
|
||||||
$conf = new Configurations();
|
$conf = new Configurations();
|
||||||
|
|
||||||
while ($oDataset->next()){
|
while ($oDataset->next()){
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
$user['USR_UID'] = $aRow['USR_UID'];
|
$user['USR_UID'] = $aRow['USR_UID'];
|
||||||
$user['USR_VALUE'] = $conf->usersNameFormat($aRow['USR_USERNAME'], $aRow['USR_FIRSTNAME'], $aRow['USR_LASTNAME']);
|
$user['USR_VALUE'] = $conf->usersNameFormat($aRow['USR_USERNAME'], $aRow['USR_FIRSTNAME'], $aRow['USR_LASTNAME']);
|
||||||
$rows[] = $user;
|
$rows[] = $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '{users: '.G::json_encode($rows).'}';
|
echo '{users: '.G::json_encode($rows).'}';
|
||||||
break;
|
break;
|
||||||
case 'updateDepartment':
|
case 'updateDepartment':
|
||||||
@@ -255,9 +255,9 @@ switch ($_POST['action'])
|
|||||||
if (isset($aDEPTS[$_POST['dep_uid']])){
|
if (isset($aDEPTS[$_POST['dep_uid']])){
|
||||||
echo '{success: false, users: '.$aDEPTS[$_POST['dep_uid']].'}';
|
echo '{success: false, users: '.$aDEPTS[$_POST['dep_uid']].'}';
|
||||||
}else{
|
}else{
|
||||||
echo '{success: true}';
|
echo '{success: true}';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'deleteDepartment':
|
case 'deleteDepartment':
|
||||||
$DEP_UID = $_POST['DEP_UID'];
|
$DEP_UID = $_POST['DEP_UID'];
|
||||||
$oDept = new Department();
|
$oDept = new Department();
|
||||||
@@ -330,7 +330,7 @@ switch ($_POST['action'])
|
|||||||
$dep = new Department();
|
$dep = new Department();
|
||||||
$dep->Load($DEP_UID);
|
$dep->Load($DEP_UID);
|
||||||
$dep_manager = $dep->getDepManager();
|
$dep_manager = $dep->getDepManager();
|
||||||
$manager = ($dep_manager=='')? true : false;
|
$manager = ($dep_manager=='')? true : false;
|
||||||
foreach ($aUsers as $USR_UID){
|
foreach ($aUsers as $USR_UID){
|
||||||
$dep->addUserToDepartment($DEP_UID, $USR_UID, $manager, false);
|
$dep->addUserToDepartment($DEP_UID, $USR_UID, $manager, false);
|
||||||
$manager = false;
|
$manager = false;
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ switch ($_POST['action'])
|
|||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_UsersListTitle', '', array('GRP_NAME' => $aFields['GRP_TITLE']));
|
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'groups/groups_UsersListTitle', '', array('GRP_NAME' => $aFields['GRP_TITLE']));
|
||||||
$G_PUBLISH->AddContent('propeltable', 'groups/paged-table2', 'groups/groups_UsersList', $oGroups->getUsersGroupCriteria($_POST['sGroupUID']), array('GRP_UID' => $_POST['sGroupUID'], 'GRP_NAME' => $aFields['GRP_TITLE']));
|
$G_PUBLISH->AddContent('propeltable', 'groups/paged-table2', 'groups/groups_UsersList', $oGroups->getUsersGroupCriteria($_POST['sGroupUID']), array('GRP_UID' => $_POST['sGroupUID'], 'GRP_NAME' => $aFields['GRP_TITLE']));
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher =& headPublisher::getSingleton();
|
||||||
$oHeadPublisher->addScriptCode("groupname=\"{$aFields["GRP_TITLE"]}\";");
|
$oHeadPublisher->addScriptCode("groupname=\"{$aFields["GRP_TITLE"]}\";");
|
||||||
|
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ switch ($_POST['action'])
|
|||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
$aUsers=explode(',', $_POST['aUsers']);
|
$aUsers=explode(',', $_POST['aUsers']);
|
||||||
|
|
||||||
for($i=0; $i<count($aUsers); $i++)
|
for($i=0; $i<count($aUsers); $i++)
|
||||||
{
|
{
|
||||||
$oGroup->addUserToGroup($_POST['GRP_UID'], $aUsers[$i]);
|
$oGroup->addUserToGroup($_POST['GRP_UID'], $aUsers[$i]);
|
||||||
@@ -104,34 +104,34 @@ switch ($_POST['action'])
|
|||||||
$env = $co->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
$env = $co->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||||
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
|
||||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
||||||
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
|
||||||
|
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
if ($limit == $start) $limit = $limit +$limit ;
|
if ($limit == $start) $limit = $limit +$limit ;
|
||||||
$tasks = new TaskUser();
|
$tasks = new TaskUser();
|
||||||
$aTask = $tasks->getCountAllTaksByGroups();
|
$aTask = $tasks->getCountAllTaksByGroups();
|
||||||
|
|
||||||
$members = new GroupUser();
|
$members = new GroupUser();
|
||||||
$aMembers = $members->getCountAllUsersByGroup();
|
$aMembers = $members->getCountAllUsersByGroup();
|
||||||
|
|
||||||
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
||||||
$uxList = adminProxy::getUxTypesList();
|
$uxList = adminProxy::getUxTypesList();
|
||||||
|
|
||||||
$groups = new Groupwf();
|
$groups = new Groupwf();
|
||||||
$data = $groups->getAllGroup($start,$limit,$filter);
|
$data = $groups->getAllGroup($start,$limit,$filter);
|
||||||
$result = $data['rows'];
|
$result = $data['rows'];
|
||||||
|
|
||||||
$totalRows = 0;
|
$totalRows = 0;
|
||||||
$arrData = array();
|
$arrData = array();
|
||||||
foreach ($result as $results) {
|
foreach ($result as $results) {
|
||||||
$totalRows ++;
|
$totalRows ++;
|
||||||
$results['CON_VALUE'] = $results['GRP_TITLE'];
|
$results['CON_VALUE'] = str_replace(array("<", ">"), array("<", ">"), $results['GRP_TITLE']);
|
||||||
$results['GRP_TASKS'] = isset($aTask[$results['GRP_UID']]) ? $aTask[$results['GRP_UID']] : 0;
|
$results['GRP_TASKS'] = isset($aTask[$results['GRP_UID']]) ? $aTask[$results['GRP_UID']] : 0;
|
||||||
$results['GRP_USERS'] = isset($aMembers[$results['GRP_UID']]) ? $aMembers[$results['GRP_UID']] : 0;
|
$results['GRP_USERS'] = isset($aMembers[$results['GRP_UID']]) ? $aMembers[$results['GRP_UID']] : 0;
|
||||||
$arrData[] = $results;
|
$arrData[] = $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = new StdClass();
|
$result = new StdClass();
|
||||||
$result->success = true;
|
$result->success = true;
|
||||||
$result->groups = $arrData;
|
$result->groups = $arrData;
|
||||||
@@ -150,7 +150,7 @@ switch ($_POST['action'])
|
|||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
$response = ($aRow) ? 'true' : 'false';
|
$response = ($aRow) ? 'true' : 'false';
|
||||||
echo $response;
|
echo $response;
|
||||||
break;
|
break;
|
||||||
case 'saveNewGroup':
|
case 'saveNewGroup':
|
||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$newGroup['GRP_UID'] = '';
|
$newGroup['GRP_UID'] = '';
|
||||||
@@ -324,7 +324,7 @@ switch ($_POST['action'])
|
|||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
foreach ($uUIDs as $USR_UID){
|
foreach ($uUIDs as $USR_UID){
|
||||||
$oGroup->addUserToGroup($GRP_UID, $USR_UID);
|
$oGroup->addUserToGroup($GRP_UID, $USR_UID);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'deleteUsersToGroupsMultiple':
|
case 'deleteUsersToGroupsMultiple':
|
||||||
@@ -333,7 +333,7 @@ switch ($_POST['action'])
|
|||||||
G::LoadClass('groups');
|
G::LoadClass('groups');
|
||||||
$oGroup = new Groups();
|
$oGroup = new Groups();
|
||||||
foreach ($uUIDs as $USR_UID){
|
foreach ($uUIDs as $USR_UID){
|
||||||
$oGroup->removeUserOfGroup($GRP_UID, $USR_UID);
|
$oGroup->removeUserOfGroup($GRP_UID, $USR_UID);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'updatePageSize':
|
case 'updatePageSize':
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ waitLoading.show = function() {
|
|||||||
};
|
};
|
||||||
waitLoading.hide = function() {
|
waitLoading.hide = function() {
|
||||||
Ext.getBody().unmask();
|
Ext.getBody().unmask();
|
||||||
};
|
};
|
||||||
|
|
||||||
var treePanel;
|
var treePanel;
|
||||||
var rootNode;
|
var rootNode;
|
||||||
@@ -97,7 +97,7 @@ Ext.onReady(function() {
|
|||||||
deleteButton.disable();
|
deleteButton.disable();
|
||||||
}else{
|
}else{
|
||||||
if (node.attributes.leaf){
|
if (node.attributes.leaf){
|
||||||
deleteButton.enable();
|
deleteButton.enable();
|
||||||
}else{
|
}else{
|
||||||
deleteButton.disable();
|
deleteButton.disable();
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ Ext.onReady(function() {
|
|||||||
|
|
||||||
newForm = new Ext.FormPanel({
|
newForm = new Ext.FormPanel({
|
||||||
url: 'departments_Ajax?request=saveNewDepartment',
|
url: 'departments_Ajax?request=saveNewDepartment',
|
||||||
frame: true,
|
frame: true,
|
||||||
items:[
|
items:[
|
||||||
{xtype: 'textfield', name: 'parent', hidden: true},
|
{xtype: 'textfield', name: 'parent', hidden: true},
|
||||||
{xtype: 'textfield', fieldLabel: _('ID_DEPARTMENT_NAME'), name: 'dep_name', width: 230, allowBlank: false}
|
{xtype: 'textfield', fieldLabel: _('ID_DEPARTMENT_NAME'), name: 'dep_name', width: 230, allowBlank: false}
|
||||||
@@ -141,36 +141,36 @@ Ext.onReady(function() {
|
|||||||
|
|
||||||
editForm = new Ext.FormPanel({
|
editForm = new Ext.FormPanel({
|
||||||
url: 'departments_Ajax?request=saveEditDepartment',
|
url: 'departments_Ajax?request=saveEditDepartment',
|
||||||
frame: true,
|
frame: true,
|
||||||
items:[
|
items:[
|
||||||
{xtype: 'textfield', name: 'dep_uid', hidden: true},
|
{xtype: 'textfield', name: 'dep_uid', hidden: true},
|
||||||
{xtype: 'textfield', name: 'dep_parent', hidden: true},
|
{xtype: 'textfield', name: 'dep_parent', hidden: true},
|
||||||
{xtype: 'textfield', fieldLabel: _('ID_DEPARTMENT_NAME'), name: 'dep_name', width: 230, allowBlank: false},
|
{xtype: 'textfield', fieldLabel: _('ID_DEPARTMENT_NAME'), name: 'dep_name', width: 230, allowBlank: false},
|
||||||
{
|
{
|
||||||
xtype: 'combo',
|
xtype: 'combo',
|
||||||
fieldLabel: _('ID_STATUS'),
|
fieldLabel: _('ID_STATUS'),
|
||||||
hiddenName: 'status',
|
hiddenName: 'status',
|
||||||
typeAhead: true,
|
typeAhead: true,
|
||||||
mode: 'local',
|
mode: 'local',
|
||||||
store: comboStatusStore,
|
store: comboStatusStore,
|
||||||
displayField: 'value',
|
displayField: 'value',
|
||||||
valueField:'id',
|
valueField:'id',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText: _('ID_SELECT_STATUS'),
|
emptyText: _('ID_SELECT_STATUS'),
|
||||||
selectOnFocus:true
|
selectOnFocus:true
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
xtype: 'combo',
|
xtype: 'combo',
|
||||||
fieldLabel: 'Manager',
|
fieldLabel: 'Manager',
|
||||||
hiddenName: 'manager',
|
hiddenName: 'manager',
|
||||||
typeAhead: true,
|
typeAhead: true,
|
||||||
mode: 'local',
|
mode: 'local',
|
||||||
store: comboDepManager,
|
store: comboDepManager,
|
||||||
displayField: 'USR_VALUE',
|
displayField: 'USR_VALUE',
|
||||||
valueField:'USR_UID',
|
valueField:'USR_UID',
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText: '',
|
emptyText: '',
|
||||||
selectOnFocus:true
|
selectOnFocus:true
|
||||||
@@ -289,15 +289,15 @@ CloseWindow = function(){
|
|||||||
Ext.getCmp('w').hide();
|
Ext.getCmp('w').hide();
|
||||||
};
|
};
|
||||||
SaveNewDepartment = function(){
|
SaveNewDepartment = function(){
|
||||||
waitLoading.show();
|
waitLoading.show();
|
||||||
var dep_node = Ext.getCmp('treePanel').getSelectionModel().getSelectedNode();
|
var dep_node = Ext.getCmp('treePanel').getSelectionModel().getSelectedNode();
|
||||||
if (dep_node) dep_node.unselect();
|
if (dep_node) dep_node.unselect();
|
||||||
var dep_name = newForm.getForm().findField('dep_name').getValue();
|
var dep_name = newForm.getForm().findField('dep_name').getValue();
|
||||||
dep_name = dep_name.trim();
|
dep_name = dep_name.trim();
|
||||||
if (dep_name==''){
|
if (dep_name==''){
|
||||||
waitLoading.hide();
|
waitLoading.hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var dep_parent = newForm.getForm().findField('parent').getValue();
|
var dep_parent = newForm.getForm().findField('parent').getValue();
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'departments_Ajax',
|
url: 'departments_Ajax',
|
||||||
@@ -319,7 +319,7 @@ SaveNewDepartment = function(){
|
|||||||
newForm.getForm().findField('dep_name').reset();
|
newForm.getForm().findField('dep_name').reset();
|
||||||
CloseWindow();
|
CloseWindow();
|
||||||
PMExt.notify(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_SUCCESS_NEW'));
|
PMExt.notify(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_SUCCESS_NEW'));
|
||||||
},
|
},
|
||||||
failure: function(r,o){
|
failure: function(r,o){
|
||||||
waitLoading.hide();
|
waitLoading.hide();
|
||||||
DoNothing();
|
DoNothing();
|
||||||
@@ -327,7 +327,7 @@ SaveNewDepartment = function(){
|
|||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
waitLoading.hide();
|
waitLoading.hide();
|
||||||
PMExt.error(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_EXISTS'));
|
PMExt.error(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_EXISTS'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
failure: function(resp, opt){
|
failure: function(resp, opt){
|
||||||
@@ -366,13 +366,13 @@ SaveEditDepartment = function(){
|
|||||||
newForm.getForm().findField('dep_name').reset();
|
newForm.getForm().findField('dep_name').reset();
|
||||||
CloseWindow();
|
CloseWindow();
|
||||||
PMExt.notify(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_SUCCESS_UPDATE'));
|
PMExt.notify(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_SUCCESS_UPDATE'));
|
||||||
},
|
},
|
||||||
failure: function(r,o){
|
failure: function(r,o){
|
||||||
DoNothing();
|
DoNothing();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
PMExt.error(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_EXISTS'));
|
PMExt.error(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_EXISTS'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
failure: function(resp, opt){
|
failure: function(resp, opt){
|
||||||
@@ -384,9 +384,12 @@ SaveEditDepartment = function(){
|
|||||||
//Edit Department Action
|
//Edit Department Action
|
||||||
EditDepartmentAction = function(){
|
EditDepartmentAction = function(){
|
||||||
var dep_node = Ext.getCmp('treePanel').getSelectionModel().getSelectedNode();
|
var dep_node = Ext.getCmp('treePanel').getSelectionModel().getSelectedNode();
|
||||||
|
var strName = stringReplace("<", "<", dep_node.attributes.DEP_TITLE);
|
||||||
|
strName = stringReplace(">", ">", strName);
|
||||||
|
|
||||||
editForm.getForm().findField('dep_uid').setValue(dep_node.attributes.DEP_UID);
|
editForm.getForm().findField('dep_uid').setValue(dep_node.attributes.DEP_UID);
|
||||||
editForm.getForm().findField('dep_parent').setValue(dep_node.attributes.DEP_PARENT);
|
editForm.getForm().findField('dep_parent').setValue(dep_node.attributes.DEP_PARENT);
|
||||||
editForm.getForm().findField('dep_name').setValue(dep_node.attributes.DEP_TITLE);
|
editForm.getForm().findField('dep_name').setValue(strName);
|
||||||
editForm.getForm().findField('status').setValue(dep_node.attributes.DEP_STATUS);
|
editForm.getForm().findField('status').setValue(dep_node.attributes.DEP_STATUS);
|
||||||
editForm.getForm().findField('manager').getStore().addListener('load',function(s,r,o){
|
editForm.getForm().findField('manager').getStore().addListener('load',function(s,r,o){
|
||||||
editForm.getForm().findField('manager').setValue(dep_node.attributes.DEP_MANAGER);
|
editForm.getForm().findField('manager').setValue(dep_node.attributes.DEP_MANAGER);
|
||||||
@@ -417,9 +420,9 @@ DeleteDepartmentAction = function(){
|
|||||||
success: function(r,o){
|
success: function(r,o){
|
||||||
viewport.getEl().unmask();
|
viewport.getEl().unmask();
|
||||||
var response = Ext.util.JSON.decode(r.responseText);
|
var response = Ext.util.JSON.decode(r.responseText);
|
||||||
if (response.success){
|
if (response.success){
|
||||||
|
|
||||||
Ext.Msg.confirm(_('ID_DEPARTMENTS'), _('ID_CONFIRM_DELETE_DEPARTMENT'),
|
Ext.Msg.confirm(_('ID_DEPARTMENTS'), _('ID_CONFIRM_DELETE_DEPARTMENT'),
|
||||||
function(btn, text){
|
function(btn, text){
|
||||||
if (btn=='yes'){
|
if (btn=='yes'){
|
||||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||||
@@ -427,7 +430,7 @@ DeleteDepartmentAction = function(){
|
|||||||
url: 'departments_Ajax',
|
url: 'departments_Ajax',
|
||||||
params: {action: 'deleteDepartment', DEP_UID: DEP_UID},
|
params: {action: 'deleteDepartment', DEP_UID: DEP_UID},
|
||||||
success: function(r,o){
|
success: function(r,o){
|
||||||
viewport.getEl().unmask();
|
viewport.getEl().unmask();
|
||||||
treePanel.getRootNode().reload();
|
treePanel.getRootNode().reload();
|
||||||
newSubButton.disable();
|
newSubButton.disable();
|
||||||
editButton.disable();
|
editButton.disable();
|
||||||
@@ -436,9 +439,9 @@ DeleteDepartmentAction = function(){
|
|||||||
PMExt.notify(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_SUCCESS_DELETE'));
|
PMExt.notify(_('ID_DEPARTMENTS'), _('ID_DEPARTMENT_SUCCESS_DELETE'));
|
||||||
},
|
},
|
||||||
failure: function(r,o){
|
failure: function(r,o){
|
||||||
viewport.getEl().unmask();
|
viewport.getEl().unmask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//Keyboard Events
|
//Keyboard Events
|
||||||
new Ext.KeyMap(document,
|
new Ext.KeyMap(document,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
key: Ext.EventObject.F5,
|
key: Ext.EventObject.F5,
|
||||||
@@ -76,7 +76,7 @@ Ext.onReady(function(){
|
|||||||
text: _('ID_EDIT'),
|
text: _('ID_EDIT'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||||
handler: EditGroupWindow,
|
handler: EditGroupWindow,
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
deleteButton = new Ext.Action({
|
deleteButton = new Ext.Action({
|
||||||
@@ -155,22 +155,22 @@ Ext.onReady(function(){
|
|||||||
items:[
|
items:[
|
||||||
{xtype: 'textfield', fieldLabel: _('ID_GROUP_NAME'), name: 'name', width: 200, allowBlank: false},
|
{xtype: 'textfield', fieldLabel: _('ID_GROUP_NAME'), name: 'name', width: 200, allowBlank: false},
|
||||||
{
|
{
|
||||||
xtype: 'combo',
|
xtype: 'combo',
|
||||||
id : 'status',
|
id : 'status',
|
||||||
name : 'status',
|
name : 'status',
|
||||||
fieldLabel: _('ID_STATUS'),
|
fieldLabel: _('ID_STATUS'),
|
||||||
hiddenName: 'status',
|
hiddenName: 'status',
|
||||||
typeAhead: true,
|
typeAhead: true,
|
||||||
mode: 'local',
|
mode: 'local',
|
||||||
store: comboStatusStore,
|
store: comboStatusStore,
|
||||||
listeners : {
|
listeners : {
|
||||||
beforerender: function(status){
|
beforerender: function(status){
|
||||||
status.setValue('ACTIVE');
|
status.setValue('ACTIVE');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
displayField: 'value',
|
displayField: 'value',
|
||||||
valueField:'value',
|
valueField:'value',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText: _('ID_SELECT_STATUS'),
|
emptyText: _('ID_SELECT_STATUS'),
|
||||||
selectOnFocus:true
|
selectOnFocus:true
|
||||||
@@ -189,18 +189,18 @@ Ext.onReady(function(){
|
|||||||
{xtype: 'textfield', name: 'grp_uid', hidden: true},
|
{xtype: 'textfield', name: 'grp_uid', hidden: true},
|
||||||
{xtype: 'textfield', fieldLabel: _('ID_GROUP_NAME'), name: 'name', width: 200, allowBlank: false},
|
{xtype: 'textfield', fieldLabel: _('ID_GROUP_NAME'), name: 'name', width: 200, allowBlank: false},
|
||||||
{
|
{
|
||||||
xtype: 'combo',
|
xtype: 'combo',
|
||||||
fieldLabel: _('ID_STATUS'),
|
fieldLabel: _('ID_STATUS'),
|
||||||
hiddenName: 'status',
|
hiddenName: 'status',
|
||||||
typeAhead: true,
|
typeAhead: true,
|
||||||
mode: 'local',
|
mode: 'local',
|
||||||
store: comboStatusStore,
|
store: comboStatusStore,
|
||||||
displayField: 'value',
|
displayField: 'value',
|
||||||
valueField:'value',
|
valueField:'value',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText: _('ID_SELECT_STATUS'),
|
emptyText: _('ID_SELECT_STATUS'),
|
||||||
selectOnFocus:true
|
selectOnFocus:true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -208,7 +208,7 @@ Ext.onReady(function(){
|
|||||||
{text: _('ID_CANCEL'), handler: CloseWindow}
|
{text: _('ID_CANCEL'), handler: CloseWindow}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
store = new Ext.data.GroupingStore( {
|
store = new Ext.data.GroupingStore( {
|
||||||
proxy : new Ext.data.HttpProxy({
|
proxy : new Ext.data.HttpProxy({
|
||||||
url: 'groups_Ajax?action=groupsList'
|
url: 'groups_Ajax?action=groupsList'
|
||||||
@@ -314,7 +314,7 @@ Ext.onReady(function(){
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
infoGrid.on('rowcontextmenu',
|
infoGrid.on('rowcontextmenu',
|
||||||
function (grid, rowIndex, evt) {
|
function (grid, rowIndex, evt) {
|
||||||
var sm = grid.getSelectionModel();
|
var sm = grid.getSelectionModel();
|
||||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||||
@@ -369,7 +369,7 @@ GridByDefault = function(){
|
|||||||
|
|
||||||
//Do Search Function
|
//Do Search Function
|
||||||
DoSearch = function(){
|
DoSearch = function(){
|
||||||
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
||||||
};
|
};
|
||||||
|
|
||||||
//Close Popup Window
|
//Close Popup Window
|
||||||
@@ -431,9 +431,12 @@ SaveNewGroup = function(){
|
|||||||
|
|
||||||
//Open Edit Group Form
|
//Open Edit Group Form
|
||||||
EditGroupWindow = function(){
|
EditGroupWindow = function(){
|
||||||
rowSelected = infoGrid.getSelectionModel().getSelected();
|
var rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||||
|
var strName = stringReplace("<", "<", rowSelected.data.CON_VALUE);
|
||||||
|
strName = stringReplace(">", ">", strName);
|
||||||
|
|
||||||
editForm.getForm().findField('grp_uid').setValue(rowSelected.data.GRP_UID);
|
editForm.getForm().findField('grp_uid').setValue(rowSelected.data.GRP_UID);
|
||||||
editForm.getForm().findField('name').setValue(rowSelected.data.CON_VALUE);
|
editForm.getForm().findField('name').setValue(strName);
|
||||||
editForm.getForm().findField('status').setValue(rowSelected.data.GRP_STATUS);
|
editForm.getForm().findField('status').setValue(rowSelected.data.GRP_STATUS);
|
||||||
w = new Ext.Window({
|
w = new Ext.Window({
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
@@ -456,7 +459,7 @@ SaveEditGroupAction = function(){
|
|||||||
if (rowSelected.data.CON_VALUE.toUpperCase() == group.toUpperCase()){
|
if (rowSelected.data.CON_VALUE.toUpperCase() == group.toUpperCase()){
|
||||||
SaveEditGroup();
|
SaveEditGroup();
|
||||||
}else{
|
}else{
|
||||||
CheckGroupName(group, SaveEditGroup, DuplicateGroupName);
|
CheckGroupName(group, SaveEditGroup, DuplicateGroupName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user