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)
|
function uxGroupUpdate($httpData)
|
||||||
{
|
{
|
||||||
require_once 'classes/model/Groupwf.php';
|
G::LoadClass('groups');
|
||||||
$data = (array) G::json_decode($httpData->groups);
|
$groups = new Groups();
|
||||||
|
$users = $groups->getUsersOfGroup($httpData->GRP_UID);
|
||||||
$group = GroupwfPeer::retrieveByPK($data['GRP_UID']);
|
$success = true;
|
||||||
$group->setGrpUx($data['GRP_UX']);
|
$usersAdmin = '';
|
||||||
$group->save();
|
foreach ($users as $user) {
|
||||||
|
if ($user['USR_ROLE'] == 'PROCESSMAKER_ADMIN' && ($httpData->GRP_UX == 'SIMPLIFIED' || $httpData->GRP_UX == 'SINGLE')) {
|
||||||
$g = new Groupwf();
|
$success = false;
|
||||||
//$row = $group->toArray(BasePeer::TYPE_FIELDNAME);
|
$usersAdmin .= $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME'] . ', ';
|
||||||
$row = $g->Load($group->getGrpUid());
|
}
|
||||||
$row['CON_VALUE'] = $row['GRP_TITLE'];
|
}
|
||||||
|
if ($success) {
|
||||||
$uxList = self::getUxTypesList();
|
$group = GroupwfPeer::retrieveByPK($httpData->GRP_UID);
|
||||||
$row['GRP_UX'] = $uxList[$group->getGrpUx()];
|
$group->setGrpUx($httpData->GRP_UX);
|
||||||
|
$group->save();
|
||||||
return array('success' => true, 'message'=>'done', 'groups'=>$row);
|
}
|
||||||
|
return array('success' => $success, 'users' => $usersAdmin);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUxTypesList($type = 'assoc')
|
function getUxTypesList($type = 'assoc')
|
||||||
|
|||||||
@@ -223,10 +223,7 @@ Ext.onReady(function(){
|
|||||||
// GROUPS
|
// GROUPS
|
||||||
var proxyGroups = new Ext.data.HttpProxy({
|
var proxyGroups = new Ext.data.HttpProxy({
|
||||||
api: {
|
api: {
|
||||||
read : '../groups/groups_Ajax?action=groupsList',
|
read: '../groups/groups_Ajax?action=groupsList'
|
||||||
//create : 'app.php/users/create',
|
|
||||||
update: '../adminProxy/uxGroupUpdate'//,
|
|
||||||
//destroy: 'app.php/users/destroy'
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -250,14 +247,11 @@ Ext.onReady(function(){
|
|||||||
writeAllFields: false
|
writeAllFields: false
|
||||||
});
|
});
|
||||||
|
|
||||||
storeGroups = new Ext.data.GroupingStore( {
|
storeGroups = new Ext.data.GroupingStore({
|
||||||
// proxy: new Ext.data.HttpProxy({
|
|
||||||
// url: '../groups/groups_Ajax?action=groupsList'
|
|
||||||
// }),
|
|
||||||
proxy: proxyGroups,
|
proxy: proxyGroups,
|
||||||
reader: readerGroups,
|
reader: readerGroups,
|
||||||
writer: writerGroups, // <-- plug a DataWriter into the store just as you would a Reader
|
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({
|
cmodelGroups = new Ext.grid.ColumnModel({
|
||||||
@@ -289,18 +283,27 @@ Ext.onReady(function(){
|
|||||||
}),
|
}),
|
||||||
listeners: {
|
listeners: {
|
||||||
select: function(a, b) {
|
select: function(a, b) {
|
||||||
var uidGroup = groupsGrid.getSelectionModel().selection['record'].data['GRP_UID'];
|
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: '../users/users_Ajax?function=usersAdminGroupExtJS',
|
url: '../adminProxy/uxGroupUpdate',
|
||||||
params: { GRP_UID: uidGroup },
|
params: {GRP_UID: groupsGrid.getSelectionModel().selection['record'].data['GRP_UID'],
|
||||||
|
GRP_UX: Ext.getCmp('GRP_UXCombo').getValue()},
|
||||||
success: function(result, request) {
|
success: function(result, request) {
|
||||||
var res = Ext.decode(result.responseText);
|
var response = Ext.decode(result.responseText);
|
||||||
if ((res.reponse == 'true') && (Ext.getCmp('GRP_UXCombo').getValue()!='SWITCHABLE') && (Ext.getCmp('GRP_UXCombo').getValue()!='NORMAL')) {
|
if (!response.success) {
|
||||||
PMExt.warning(_('ID_WARNING'), _('ID_ADMINS_CANT_USE_UXS')+'<br/> <b>'+_('ID_USERS_LIST')+':</b> '+res.users);
|
a.setValue('NORMAL');
|
||||||
Ext.getCmp('GRP_UXCombo').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