BUG 8919 La opcion "user experience" se puede aplicar al usuario Admin
- The validation doesn't consider the enter key when select a value - Modify the logic of the validation
This commit is contained in:
@@ -182,22 +182,23 @@ class adminProxy extends HttpProxyController
|
||||
|
||||
function uxGroupUpdate($httpData)
|
||||
{
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
$data = (array) G::json_decode($httpData->groups);
|
||||
|
||||
$group = GroupwfPeer::retrieveByPK($data['GRP_UID']);
|
||||
$group->setGrpUx($data['GRP_UX']);
|
||||
G::LoadClass('groups');
|
||||
$groups = new Groups();
|
||||
$users = $groups->getUsersOfGroup($httpData->GRP_UID);
|
||||
$success = true;
|
||||
$usersAdmin = '';
|
||||
foreach ($users as $user) {
|
||||
if ($user['USR_ROLE'] == 'PROCESSMAKER_ADMIN' && ($httpData->GRP_UX == 'SIMPLIFIED' || $httpData->GRP_UX == 'SINGLE')) {
|
||||
$success = false;
|
||||
$usersAdmin .= $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME'] . ', ';
|
||||
}
|
||||
}
|
||||
if ($success) {
|
||||
$group = GroupwfPeer::retrieveByPK($httpData->GRP_UID);
|
||||
$group->setGrpUx($httpData->GRP_UX);
|
||||
$group->save();
|
||||
|
||||
$g = new Groupwf();
|
||||
//$row = $group->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$row = $g->Load($group->getGrpUid());
|
||||
$row['CON_VALUE'] = $row['GRP_TITLE'];
|
||||
|
||||
$uxList = self::getUxTypesList();
|
||||
$row['GRP_UX'] = $uxList[$group->getGrpUx()];
|
||||
|
||||
return array('success' => true, 'message'=>'done', 'groups'=>$row);
|
||||
}
|
||||
return array('success' => $success, 'users' => $usersAdmin);
|
||||
}
|
||||
|
||||
function getUxTypesList($type = 'assoc')
|
||||
|
||||
@@ -223,10 +223,7 @@ Ext.onReady(function(){
|
||||
// GROUPS
|
||||
var proxyGroups = new Ext.data.HttpProxy({
|
||||
api: {
|
||||
read : '../groups/groups_Ajax?action=groupsList',
|
||||
//create : 'app.php/users/create',
|
||||
update: '../adminProxy/uxGroupUpdate'//,
|
||||
//destroy: 'app.php/users/destroy'
|
||||
read: '../groups/groups_Ajax?action=groupsList'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -251,13 +248,10 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
storeGroups = new Ext.data.GroupingStore({
|
||||
// proxy: new Ext.data.HttpProxy({
|
||||
// url: '../groups/groups_Ajax?action=groupsList'
|
||||
// }),
|
||||
proxy: proxyGroups,
|
||||
reader: readerGroups,
|
||||
writer: writerGroups, // <-- plug a DataWriter into the store just as you would a Reader
|
||||
autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||
autoSave: false // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||
});
|
||||
|
||||
cmodelGroups = new Ext.grid.ColumnModel({
|
||||
@@ -289,18 +283,27 @@ Ext.onReady(function(){
|
||||
}),
|
||||
listeners: {
|
||||
select: function(a, b) {
|
||||
var uidGroup = groupsGrid.getSelectionModel().selection['record'].data['GRP_UID'];
|
||||
Ext.Ajax.request({
|
||||
url: '../users/users_Ajax?function=usersAdminGroupExtJS',
|
||||
params: { GRP_UID: uidGroup },
|
||||
url: '../adminProxy/uxGroupUpdate',
|
||||
params: {GRP_UID: groupsGrid.getSelectionModel().selection['record'].data['GRP_UID'],
|
||||
GRP_UX: Ext.getCmp('GRP_UXCombo').getValue()},
|
||||
success: function(result, request) {
|
||||
var res = Ext.decode(result.responseText);
|
||||
if ((res.reponse == 'true') && (Ext.getCmp('GRP_UXCombo').getValue()!='SWITCHABLE') && (Ext.getCmp('GRP_UXCombo').getValue()!='NORMAL')) {
|
||||
PMExt.warning(_('ID_WARNING'), _('ID_ADMINS_CANT_USE_UXS')+'<br/> <b>'+_('ID_USERS_LIST')+':</b> '+res.users);
|
||||
Ext.getCmp('GRP_UXCombo').setValue('NORMAL');
|
||||
var response = Ext.decode(result.responseText);
|
||||
if (!response.success) {
|
||||
a.setValue('NORMAL');
|
||||
PMExt.warning(_('ID_WARNING'), _('ID_ADMINS_CANT_USE_UXS') + '<br/> <b>' + _('ID_USERS_LIST') + ':</b> ' + response.users);
|
||||
}
|
||||
else {
|
||||
a.fireEvent('blur');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
specialkey: function (f, e) {
|
||||
if (e.getKey() == e.ENTER) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user