Merge branch 'master' of git://github.com/colosa/processmaker into BUG-11603
This commit is contained in:
@@ -413,27 +413,7 @@ class Applications
|
||||
if (($action == "sent" || $action == "search" || $action == "simple_search" || $action == "to_revise" || $action == "to_reassign") && ($status != "TO_DO")) {
|
||||
switch ($sort) {
|
||||
case "APP_CACHE_VIEW.APP_CURRENT_USER":
|
||||
$sort = "USRCR_USR_LASTNAME";
|
||||
|
||||
$confEnvSetting = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "");
|
||||
|
||||
if (is_array($confEnvSetting)) {
|
||||
$arrayAux = explode(" ", str_replace(array("(", ")", ","), array(null, null, null), $confEnvSetting["format"]));
|
||||
|
||||
if (isset($arrayAux[0])) {
|
||||
switch (trim($arrayAux[0])) {
|
||||
case "@userName":
|
||||
$sort = "USRCR_USR_USERNAME";
|
||||
break;
|
||||
case "@firstName":
|
||||
$sort = "USRCR_USR_FIRSTNAME";
|
||||
break;
|
||||
case "@lastName":
|
||||
$sort = "USRCR_USR_LASTNAME";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sort = "USRCR_" . $conf->userNameFormatGetFirstFieldByUsersTable();
|
||||
break;
|
||||
case "APP_CACHE_VIEW.APP_TAS_TITLE":
|
||||
$sort = "APPCVCR_APP_TAS_TITLE";
|
||||
|
||||
@@ -315,7 +315,6 @@ class Configurations // extends Configuration
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function userNameFormat($username, $fullname)
|
||||
{
|
||||
|
||||
@@ -338,6 +337,48 @@ class Configurations // extends Configuration
|
||||
}
|
||||
}
|
||||
|
||||
public function usersNameFormatBySetParameters($formatUserName, $userName, $firstName, $lastName)
|
||||
{
|
||||
$usersNameFormat = (!empty($formatUserName))? str_replace(array("@userName", "@firstName", "@lastName"), array($userName, $firstName, $lastName), $formatUserName) : null;
|
||||
$usersNameFormat = trim($usersNameFormat);
|
||||
|
||||
return $usersNameFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the first field of the UserName format
|
||||
*
|
||||
* Returns the field, based on the field name in the USERS table
|
||||
*
|
||||
* @return string Return the field
|
||||
*/
|
||||
public function userNameFormatGetFirstFieldByUsersTable()
|
||||
{
|
||||
$field = "USR_LASTNAME";
|
||||
|
||||
$confEnvSetting = $this->getConfiguration("ENVIRONMENT_SETTINGS", "");
|
||||
|
||||
if (is_array($confEnvSetting) && isset($confEnvSetting["format"])) {
|
||||
$arrayAux = explode(" ", str_replace(array("(", ")", ","), array(null, null, null), $confEnvSetting["format"]));
|
||||
|
||||
if (isset($arrayAux[0])) {
|
||||
switch (trim($arrayAux[0])) {
|
||||
case "@userName":
|
||||
$field = "USR_USERNAME";
|
||||
break;
|
||||
case "@firstName":
|
||||
$field = "USR_FIRSTNAME";
|
||||
break;
|
||||
case "@lastName":
|
||||
$field = "USR_LASTNAME";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* getFormats
|
||||
*
|
||||
@@ -524,9 +565,9 @@ class Configurations // extends Configuration
|
||||
$newCreation = '';
|
||||
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%e', 'l' => '%A', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%P', 'A' => '%p', 'g' => '%l', 'G' => '%k', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
|
||||
$creationDateMask = trim($creationDateMask);
|
||||
|
||||
|
||||
if (strpos($creationDateMask, ' \\d\\e ') !== false) {
|
||||
$creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
|
||||
$creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
|
||||
}
|
||||
|
||||
|
||||
@@ -569,15 +610,15 @@ class Configurations // extends Configuration
|
||||
$dateTime = utf8_encode(strftime($newCreation, mktime(0, 0, 0, $m, $d, $y)));
|
||||
|
||||
if (strpos($dateTime, ' ') !== false) {
|
||||
$dateTime = ucwords($dateTime);
|
||||
$dateTime = ucwords($dateTime);
|
||||
}
|
||||
|
||||
|
||||
if (strpos($dateTime, ' [xx] ') !== false) {
|
||||
$dateTime = str_replace('[xx]', ' de ', $dateTime);
|
||||
$dateTime = str_replace('[xx]', ' de ', $dateTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $dateTime;
|
||||
|
||||
@@ -248,8 +248,11 @@ class processMap
|
||||
$oTask->color = "#939598"; //Gray
|
||||
}
|
||||
} else {
|
||||
//$oTask->color = "#FF9900"; //Yellow
|
||||
$oTask->color = "#FF0000"; //Red
|
||||
if ($aRow3) {
|
||||
$oTask->color = "#FF0000"; //Red
|
||||
} else {
|
||||
$oTask->color = "#939598"; //Gray
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class workspaceTools
|
||||
$stop = microtime(true);
|
||||
$final = $stop - $start;
|
||||
CLI::logging("<*> Updating cache view Process took $final seconds.\n");
|
||||
|
||||
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Updating cases directories structure...\n");
|
||||
$this->upgradeCasesDirectoryStructure($workSpace);
|
||||
@@ -460,6 +460,20 @@ class workspaceTools
|
||||
//Update APP_DELEGATION.DEL_LAST_INDEX data
|
||||
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
|
||||
|
||||
CLI::logging("-> Verifying roles permissions in RBAC \n");
|
||||
//Update table RBAC permissions
|
||||
Bootstrap::LoadSystem( 'rbac' );
|
||||
$RBAC = & RBAC::getSingleton();
|
||||
$RBAC->initRBAC();
|
||||
$result = $RBAC->verifyPermissions();
|
||||
if (count($result) > 1) {
|
||||
foreach($result as $item) {
|
||||
CLI::logging(" $item... \n");
|
||||
}
|
||||
} else {
|
||||
CLI::logging(" All roles permissions already updated \n");
|
||||
}
|
||||
|
||||
CLI::logging("-> Creating triggers\n");
|
||||
//now check if we have the triggers installed
|
||||
$triggers = array();
|
||||
|
||||
@@ -105,8 +105,8 @@ class AppNotes extends BaseAppNotes
|
||||
$response['success'] = G::LoadTranslation("ID_FAILURE");
|
||||
$response['message'] = $msg;
|
||||
} else {
|
||||
$response['success'] = "success";
|
||||
$response['message'] = G::LoadTranslation("ID_SAVED");
|
||||
$response['success'] = 'success';
|
||||
$response['message'] = '';
|
||||
}
|
||||
|
||||
if ($notify) {
|
||||
|
||||
@@ -124,7 +124,16 @@ class AppProxy extends HttpProxyController
|
||||
|
||||
//Add note case
|
||||
$appNote = new AppNotes();
|
||||
$response = $appNote->addCaseNote($appUid, $usrUid, $noteContent, intval($httpData->swSendMail));
|
||||
try {
|
||||
$response = $appNote->addCaseNote($appUid, $usrUid, $noteContent, intval($httpData->swSendMail));
|
||||
} catch (Exception $error) {
|
||||
$response = new stdclass();
|
||||
$response->success = 'success';
|
||||
$response->message = G::LoadTranslation('ID_ERROR_SEND_NOTIFICATIONS');
|
||||
$response->message .= '<br /><br />' . $error->getMessage() . '<br /><br />';
|
||||
$response->message .= G::LoadTranslation('ID_CONTACT_ADMIN');
|
||||
die(G::json_encode($response));
|
||||
}
|
||||
|
||||
//Send the response to client
|
||||
@ini_set("implicit_flush", 1);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
die();
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
die();
|
||||
}
|
||||
/**
|
||||
* casesList_Ajax.php
|
||||
@@ -54,19 +54,35 @@ if ($actionAjax == "userValues") {
|
||||
switch ($action) {
|
||||
case 'search_simple':
|
||||
case 'search':
|
||||
G::LoadClass("configuration");
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$confEnvSetting = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "");
|
||||
$formatUserName = null;
|
||||
|
||||
if (is_array($confEnvSetting) && isset($confEnvSetting["format"])) {
|
||||
$formatUserName = $confEnvSetting["format"];
|
||||
}
|
||||
|
||||
$cUsers = new Criteria( 'workflow' );
|
||||
$cUsers->clearSelectColumns();
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_UID );
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_UID);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$cUsers->add( UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL );
|
||||
$cUsers->addAscendingOrderByColumn( UsersPeer::USR_LASTNAME );
|
||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||
$oDataset = UsersPeer::doSelectRS( $cUsers );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$users[] = array ("USR_UID" => $aRow['USR_UID'],"USR_FULLNAME" => $aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME']);
|
||||
$oDataset->next();
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($formatUserName, $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
$usrFullName = (!empty($usrFullName))? $usrFullName : $row["USR_LASTNAME"] . " " . $row["USR_FIRSTNAME"];
|
||||
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -363,8 +363,21 @@ function sendNote()
|
||||
Ext.getCmp('caseNoteText').setDisabled(false);
|
||||
Ext.getCmp('sendBtn').setDisabled(false);
|
||||
Ext.getCmp('addCancelBtn').setDisabled(false);
|
||||
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
|
||||
storeNotes.load();
|
||||
if (data.message != '') {
|
||||
Ext.Msg.show({
|
||||
title : _('ID_CASES_NOTE_POST_ERROR'),
|
||||
msg : data.message,
|
||||
icon : Ext.MessageBox.WARNING,
|
||||
buttons : Ext.Msg.OK,
|
||||
fn : function(btn) {
|
||||
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
|
||||
storeNotes.load();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
|
||||
storeNotes.load();
|
||||
}
|
||||
} else if (data.lostSession) {
|
||||
Ext.Msg.show({
|
||||
title : _('ID_CASES_NOTE_POST_ERROR'),
|
||||
|
||||
@@ -59,17 +59,106 @@ var sw_func_users;
|
||||
|
||||
var pm_admin = '00000000000000000000000000000002';
|
||||
|
||||
//Function DoSearch Available
|
||||
DoSearchA = function(){
|
||||
availableGrid.store.load({params: {textFilter: searchTextA.getValue()}});
|
||||
};
|
||||
|
||||
//Function DoSearch Assigned
|
||||
DoSearchP = function(){
|
||||
assignedGrid.store.load({params: {textFilter: searchTextP.getValue()}});
|
||||
};
|
||||
|
||||
//Load Grid By Default Available Members
|
||||
GridByDefaultA = function(){
|
||||
searchTextA.reset();
|
||||
availableGrid.store.load();
|
||||
};
|
||||
|
||||
//Load Grid By Default Assigned Members
|
||||
GridByDefaultP = function(){
|
||||
searchTextP.reset();
|
||||
assignedGrid.store.load();
|
||||
};
|
||||
|
||||
//Function DoSearch Available
|
||||
DoSearchU = function(){
|
||||
availableUGrid.store.load({params: {textFilter: searchTextU.getValue()}});
|
||||
};
|
||||
|
||||
//Function DoSearch Assigned
|
||||
DoSearchX = function(){
|
||||
assignedUGrid.store.load({params: {textFilter: searchTextX.getValue()}});
|
||||
};
|
||||
|
||||
//Load Grid By Default Available Members
|
||||
GridByDefaultU = function(){
|
||||
searchTextU.reset();
|
||||
availableUGrid.store.load();
|
||||
};
|
||||
|
||||
//Load Grid By Default Assigned Members
|
||||
GridByDefaultX = function(){
|
||||
searchTextX.reset();
|
||||
assignedUGrid.store.load();
|
||||
};
|
||||
|
||||
//edit permissions action
|
||||
EditPermissionsAction = function(){
|
||||
availableGrid.show();
|
||||
buttonsPanel.show();
|
||||
editPermissionsButton.disable();
|
||||
//cancelEditPermissionsButton.show();
|
||||
PermissionsPanel.doLayout();
|
||||
};
|
||||
|
||||
EditPermissionsContentsAction = function(){
|
||||
//availableGrid.show();
|
||||
//buttonsPanel.show();
|
||||
editPermissionsContentsButton.disable();
|
||||
editPermissionsButton.disable();
|
||||
EditPermissionsWindow();
|
||||
};
|
||||
|
||||
//CancelEditPermissions Function
|
||||
CancelEditPermissionsAction = function(){
|
||||
availableGrid.hide();
|
||||
buttonsPanel.hide();
|
||||
editPermissionsButton.enable();
|
||||
//cancelEditPermissionsButton.hide();
|
||||
PermissionsPanel.doLayout();
|
||||
};
|
||||
|
||||
//edit users action
|
||||
EditPermissionsActionU = function(){
|
||||
availableUGrid.show();
|
||||
buttonsUPanel.show();
|
||||
editPermissionsUButton.disable();
|
||||
//cancelEditPermissionsUButton.show();
|
||||
UsersPanel.doLayout();
|
||||
};
|
||||
|
||||
//CancelEditUsers Function
|
||||
CancelEditPermissionsActionU = function(){
|
||||
availableUGrid.hide();
|
||||
buttonsUPanel.hide();
|
||||
editPermissionsUButton.enable();
|
||||
//cancelEditPermissionsUButton.hide();
|
||||
UsersPanel.doLayout();
|
||||
};
|
||||
|
||||
|
||||
Ext.onReady(function(){
|
||||
|
||||
|
||||
sw_func_permissions = false;
|
||||
sw_func_users = false;
|
||||
|
||||
|
||||
editPermissionsButton = new Ext.Action({
|
||||
text: _('ID_EDIT_PERMISSIONS'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_key_add',
|
||||
handler: EditPermissionsAction
|
||||
});
|
||||
|
||||
|
||||
editPermissionsContentsButton = new Ext.Action({
|
||||
text: _('ID_EDIT_PERMISSIONS_CONTENT'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_key_add',
|
||||
@@ -81,7 +170,7 @@ Ext.onReady(function(){
|
||||
iconCls: 'button_menu_ext ss_sprite ss_cancel',
|
||||
handler: CancelEditPermissionsAction
|
||||
});
|
||||
|
||||
|
||||
editPermissionsUButton = new Ext.Action({
|
||||
text: _('ID_ASSIGN_USERS'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_user_add',
|
||||
@@ -93,13 +182,13 @@ Ext.onReady(function(){
|
||||
iconCls: 'button_menu_ext ss_sprite ss_cancel',
|
||||
handler: CancelEditPermissionsActionU
|
||||
});
|
||||
|
||||
|
||||
backButton = new Ext.Action({
|
||||
text: _('ID_BACK'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_arrow_redo',
|
||||
handler: BackToRoles
|
||||
});
|
||||
|
||||
|
||||
storeP = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_rolesPermissions?rUID=' + ROLES.ROL_UID + '&type=list'
|
||||
@@ -115,7 +204,7 @@ Ext.onReady(function(){
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
storeA = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_rolesPermissions?rUID=' + ROLES.ROL_UID + '&type=show'
|
||||
@@ -131,7 +220,7 @@ Ext.onReady(function(){
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
cmodelP = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 50,
|
||||
@@ -143,19 +232,19 @@ Ext.onReady(function(){
|
||||
{header: _('ID_PERMISSION_NAME'), dataIndex: 'PER_NAME', width: 60, align:'left'}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
smodelA = new Ext.grid.RowSelectionModel({
|
||||
selectSingle: false,
|
||||
listeners:{
|
||||
selectionchange: function(sm){
|
||||
switch(sm.getCount()){
|
||||
case 0: Ext.getCmp('assignButton').disable(); break;
|
||||
default: Ext.getCmp('assignButton').enable(); break;
|
||||
default: Ext.getCmp('assignButton').enable(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
smodelP = new Ext.grid.RowSelectionModel({
|
||||
selectSingle: false,
|
||||
listeners:{
|
||||
@@ -195,13 +284,13 @@ Ext.onReady(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
clearTextButtonA = new Ext.Action({
|
||||
text: 'X',
|
||||
ctCls:'pm_search_x_button',
|
||||
handler: GridByDefaultA
|
||||
});
|
||||
|
||||
|
||||
searchTextP = new Ext.form.TextField ({
|
||||
id: 'searchTextP',
|
||||
ctCls:'pm_search_text_field',
|
||||
@@ -216,13 +305,13 @@ Ext.onReady(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
clearTextButtonP = new Ext.Action({
|
||||
text: 'X',
|
||||
ctCls:'pm_search_x_button',
|
||||
handler: GridByDefaultP
|
||||
});
|
||||
|
||||
|
||||
availableGrid = new Ext.grid.GridPanel({
|
||||
layout : 'fit',
|
||||
title : _('ID_AVAILABLE_PERMISSIONS'),
|
||||
@@ -281,7 +370,7 @@ Ext.onReady(function(){
|
||||
groupTextTpl: '{text}'
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
buttonsPanel = new Ext.Panel({
|
||||
width : 40,
|
||||
layout : {
|
||||
@@ -299,7 +388,7 @@ Ext.onReady(function(){
|
||||
],
|
||||
hidden : true
|
||||
});
|
||||
|
||||
|
||||
RefreshPermissions();
|
||||
|
||||
//PERMISSIONS DRAG AND DROP PANEL
|
||||
@@ -314,7 +403,7 @@ Ext.onReady(function(){
|
||||
//bbar: [{xtype: 'tbfill'},editPermissionsButton, cancelEditPermissionsButton]
|
||||
|
||||
});
|
||||
|
||||
|
||||
storeU = new Ext.data.GroupingStore({
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_rolesUsers?rUID=' + ROLES.ROL_UID + '&type=list'
|
||||
@@ -329,7 +418,7 @@ Ext.onReady(function(){
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
storeX = new Ext.data.GroupingStore({
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_rolesUsers?rUID=' + ROLES.ROL_UID + '&type=show'
|
||||
@@ -344,7 +433,7 @@ Ext.onReady(function(){
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
cmodelU = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 50,
|
||||
@@ -357,31 +446,31 @@ Ext.onReady(function(){
|
||||
{header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 60, align:'left'}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
smodelX = new Ext.grid.RowSelectionModel({
|
||||
selectSingle: false,
|
||||
listeners:{
|
||||
selectionchange: function(sm){
|
||||
switch(sm.getCount()){
|
||||
case 0: Ext.getCmp('assignUButton').disable(); break;
|
||||
default: Ext.getCmp('assignUButton').enable(); break;
|
||||
default: Ext.getCmp('assignUButton').enable(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
smodelU = new Ext.grid.RowSelectionModel({
|
||||
selectSingle: false,
|
||||
listeners:{
|
||||
selectionchange: function(sm){
|
||||
switch(sm.getCount()){
|
||||
case 0: Ext.getCmp('removeUButton').disable(); break;
|
||||
default: Ext.getCmp('removeUButton').enable(); break;
|
||||
default: Ext.getCmp('removeUButton').enable(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
searchTextU = new Ext.form.TextField ({
|
||||
id: 'searchTextU',
|
||||
ctCls:'pm_search_text_field',
|
||||
@@ -396,13 +485,13 @@ Ext.onReady(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
clearTextButtonU = new Ext.Action({
|
||||
text: 'X',
|
||||
ctCls:'pm_search_x_button',
|
||||
handler: GridByDefaultU
|
||||
});
|
||||
|
||||
|
||||
searchTextX = new Ext.form.TextField ({
|
||||
id: 'searchTextX',
|
||||
ctCls:'pm_search_text_field',
|
||||
@@ -417,13 +506,13 @@ Ext.onReady(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
clearTextButtonX = new Ext.Action({
|
||||
text: 'X',
|
||||
ctCls:'pm_search_x_button',
|
||||
handler: GridByDefaultX
|
||||
});
|
||||
|
||||
|
||||
availableUGrid = new Ext.grid.GridPanel({
|
||||
layout : 'fit',
|
||||
title : _('ID_AVAILABLE_USERS'),
|
||||
@@ -451,7 +540,7 @@ Ext.onReady(function(){
|
||||
listeners: {rowdblclick: AssignUserAction},
|
||||
hidden : true
|
||||
});
|
||||
|
||||
|
||||
assignedUGrid = new Ext.grid.GridPanel({
|
||||
layout : 'fit',
|
||||
title : _('ID_ASSIGNED_USERS'),
|
||||
@@ -476,9 +565,9 @@ Ext.onReady(function(){
|
||||
tbar: [editPermissionsUButton,{xtype: 'tbfill'},'-',searchTextX, clearTextButtonX],
|
||||
//bbar: [{xtype: 'tbfill'},removeUAllButton],
|
||||
listeners: {rowdblclick: function(){
|
||||
(availableUGrid.hidden)? DoNothing() : RemoveUserAction();}}
|
||||
(availableUGrid.hidden)? DoNothing() : RemoveUserAction();}}
|
||||
});
|
||||
|
||||
|
||||
buttonsUPanel = new Ext.Panel({
|
||||
width : 40,
|
||||
layout : {
|
||||
@@ -496,7 +585,7 @@ Ext.onReady(function(){
|
||||
],
|
||||
hidden: true
|
||||
});
|
||||
|
||||
|
||||
RefreshUsers();
|
||||
|
||||
//PERMISSIONS DRAG AND DROP PANEL
|
||||
@@ -510,14 +599,14 @@ Ext.onReady(function(){
|
||||
viewConfig : {forceFit:true}//,
|
||||
//bbar: [{xtype: 'tbfill'},editPermissionsUButton, cancelEditPermissionsUButton]
|
||||
});
|
||||
|
||||
|
||||
//NORTH PANEL WITH TITLE AND ROLE DETAILS
|
||||
northPanel = new Ext.Panel({
|
||||
region: 'north',
|
||||
xtype: 'panel',
|
||||
tbar: ['<b>'+_('ID_ROLE') + ' : ' + ROLES.ROL_CODE+'</b>',{xtype: 'tbfill'},backButton]
|
||||
});
|
||||
|
||||
|
||||
//TABS PANEL
|
||||
tabsPanel = new Ext.TabPanel({
|
||||
region: 'center',
|
||||
@@ -536,13 +625,13 @@ Ext.onReady(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//LOAD ALL PANELS
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'border',
|
||||
items: [northPanel, tabsPanel]
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
//Do Nothing Function
|
||||
@@ -603,7 +692,7 @@ DDLoadUsers = function(){
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//USERS DRAG N DROP ASSIGNED
|
||||
var assignedUGridDropTargetEl = assignedUGrid.getView().scroller.dom;
|
||||
var assignedUGridDropTarget = new Ext.dd.DropTarget(assignedUGridDropTargetEl, {
|
||||
@@ -665,7 +754,7 @@ DeletePermissionsRole = function(arr_per, function_success, function_failure){
|
||||
params: {request: 'deletePermissionToRoleMultiple', ROL_UID: ROLES.ROL_UID, PER_UID: arr_per.join(',')},
|
||||
success: function(){
|
||||
function_success();
|
||||
viewport.getEl().unmask();
|
||||
viewport.getEl().unmask();
|
||||
},
|
||||
failure: function(){
|
||||
function_failure();
|
||||
@@ -851,7 +940,7 @@ updatePermissionContent = function() {
|
||||
permission_name.trim();
|
||||
if (permission_name != '') {
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
|
||||
|
||||
Ext.Ajax.request({
|
||||
url: 'roles_Ajax',
|
||||
params: {request: 'updatePermissionContent', PER_NAME: permission_name, PER_UID: rowSelected[0].get('PER_UID')},
|
||||
@@ -865,7 +954,7 @@ updatePermissionContent = function() {
|
||||
}
|
||||
Ext.getCmp('w').hide();
|
||||
editPermissionsContentsButton.enable();
|
||||
editPermissionsButton.enable();
|
||||
editPermissionsButton.enable();
|
||||
};
|
||||
|
||||
//Close Popup Window
|
||||
@@ -910,92 +999,4 @@ EditPermissionsWindow = function(){
|
||||
w.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Function DoSearch Available
|
||||
DoSearchA = function(){
|
||||
availableGrid.store.load({params: {textFilter: searchTextA.getValue()}});
|
||||
};
|
||||
|
||||
//Function DoSearch Assigned
|
||||
DoSearchP = function(){
|
||||
assignedGrid.store.load({params: {textFilter: searchTextP.getValue()}});
|
||||
};
|
||||
|
||||
//Load Grid By Default Available Members
|
||||
GridByDefaultA = function(){
|
||||
searchTextA.reset();
|
||||
availableGrid.store.load();
|
||||
};
|
||||
|
||||
//Load Grid By Default Assigned Members
|
||||
GridByDefaultP = function(){
|
||||
searchTextP.reset();
|
||||
assignedGrid.store.load();
|
||||
};
|
||||
|
||||
//Function DoSearch Available
|
||||
DoSearchU = function(){
|
||||
availableUGrid.store.load({params: {textFilter: searchTextU.getValue()}});
|
||||
};
|
||||
|
||||
//Function DoSearch Assigned
|
||||
DoSearchX = function(){
|
||||
assignedUGrid.store.load({params: {textFilter: searchTextX.getValue()}});
|
||||
};
|
||||
|
||||
//Load Grid By Default Available Members
|
||||
GridByDefaultU = function(){
|
||||
searchTextU.reset();
|
||||
availableUGrid.store.load();
|
||||
};
|
||||
|
||||
//Load Grid By Default Assigned Members
|
||||
GridByDefaultX = function(){
|
||||
searchTextX.reset();
|
||||
assignedUGrid.store.load();
|
||||
};
|
||||
|
||||
//edit permissions action
|
||||
EditPermissionsAction = function(){
|
||||
availableGrid.show();
|
||||
buttonsPanel.show();
|
||||
editPermissionsButton.disable();
|
||||
//cancelEditPermissionsButton.show();
|
||||
PermissionsPanel.doLayout();
|
||||
};
|
||||
|
||||
EditPermissionsContentsAction = function(){
|
||||
//availableGrid.show();
|
||||
//buttonsPanel.show();
|
||||
editPermissionsContentsButton.disable();
|
||||
editPermissionsButton.disable();
|
||||
EditPermissionsWindow();
|
||||
};
|
||||
|
||||
//CancelEditPermissions Function
|
||||
CancelEditPermissionsAction = function(){
|
||||
availableGrid.hide();
|
||||
buttonsPanel.hide();
|
||||
editPermissionsButton.enable();
|
||||
//cancelEditPermissionsButton.hide();
|
||||
PermissionsPanel.doLayout();
|
||||
};
|
||||
|
||||
//edit users action
|
||||
EditPermissionsActionU = function(){
|
||||
availableUGrid.show();
|
||||
buttonsUPanel.show();
|
||||
editPermissionsUButton.disable();
|
||||
//cancelEditPermissionsUButton.show();
|
||||
UsersPanel.doLayout();
|
||||
};
|
||||
|
||||
//CancelEditUsers Function
|
||||
CancelEditPermissionsActionU = function(){
|
||||
availableUGrid.hide();
|
||||
buttonsUPanel.hide();
|
||||
editPermissionsUButton.enable();
|
||||
//cancelEditPermissionsUButton.hide();
|
||||
UsersPanel.doLayout();
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user