Arreglo para ABM de grupos con idiomas
This commit is contained in:
@@ -144,7 +144,7 @@ switch ($_POST['action']) {
|
|||||||
case 'saveNewGroup':
|
case 'saveNewGroup':
|
||||||
G::LoadClass( 'groups' );
|
G::LoadClass( 'groups' );
|
||||||
$newGroup['GRP_UID'] = '';
|
$newGroup['GRP_UID'] = '';
|
||||||
$newGroup['GRP_STATUS'] = G::toUpper( $_POST['status'] );
|
$newGroup['GRP_STATUS'] = ($_POST['status'] == '1') ? 'ACTIVE' : 'INACTIVE';
|
||||||
$newGroup['GRP_TITLE'] = trim( $_POST['name'] );
|
$newGroup['GRP_TITLE'] = trim( $_POST['name'] );
|
||||||
unset( $newGroup['GRP_UID'] );
|
unset( $newGroup['GRP_UID'] );
|
||||||
$group = new Groupwf();
|
$group = new Groupwf();
|
||||||
@@ -154,7 +154,7 @@ switch ($_POST['action']) {
|
|||||||
case 'saveEditGroup':
|
case 'saveEditGroup':
|
||||||
G::LoadClass( 'groups' );
|
G::LoadClass( 'groups' );
|
||||||
$editGroup['GRP_UID'] = $_POST['grp_uid'];
|
$editGroup['GRP_UID'] = $_POST['grp_uid'];
|
||||||
$editGroup['GRP_STATUS'] = G::toUpper( $_POST['status'] );
|
$editGroup['GRP_STATUS'] = ($_POST['status'] == '1') ? 'ACTIVE' : 'INACTIVE';
|
||||||
$editGroup['GRP_TITLE'] = trim( $_POST['name'] );
|
$editGroup['GRP_TITLE'] = trim( $_POST['name'] );
|
||||||
$group = new Groupwf();
|
$group = new Groupwf();
|
||||||
$group->update( $editGroup );
|
$group->update( $editGroup );
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ Ext.onReady(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
comboStatusStore = new Ext.data.SimpleStore({
|
comboStatusStore = new Ext.data.SimpleStore({
|
||||||
fields: ['id','value'],
|
fields: ['changeInt','value'],
|
||||||
data: [['1',_('ID_ACTIVE').toUpperCase()],['0', _('ID_INACTIVE').toUpperCase()]]
|
data: [['1',_('ID_ACTIVE').toUpperCase()],['0', _('ID_INACTIVE').toUpperCase()]]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -164,11 +164,11 @@ Ext.onReady(function(){
|
|||||||
store: comboStatusStore,
|
store: comboStatusStore,
|
||||||
listeners : {
|
listeners : {
|
||||||
beforerender: function(status){
|
beforerender: function(status){
|
||||||
status.setValue(_('ID_ACTIVE').toUpperCase());
|
status.setValue('1');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
displayField: 'value',
|
displayField: 'value',
|
||||||
valueField:'value',
|
valueField:'changeInt',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
emptyText: _('ID_SELECT_STATUS'),
|
emptyText: _('ID_SELECT_STATUS'),
|
||||||
@@ -189,13 +189,15 @@ Ext.onReady(function(){
|
|||||||
{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: 'statusEdit',
|
||||||
|
name: 'statusEdit',
|
||||||
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:'changeInt',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
editable:false,
|
editable:false,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
@@ -409,6 +411,7 @@ DuplicateGroupName = function(){
|
|||||||
|
|
||||||
//Save New Group
|
//Save New Group
|
||||||
SaveNewGroup = function(){
|
SaveNewGroup = function(){
|
||||||
|
document.getElementById('status').value = Ext.getCmp('status').getValue();
|
||||||
newForm.getForm().submit({
|
newForm.getForm().submit({
|
||||||
waitTitle : " ",
|
waitTitle : " ",
|
||||||
success: function(f,a){
|
success: function(f,a){
|
||||||
@@ -438,7 +441,8 @@ EditGroupWindow = function(){
|
|||||||
|
|
||||||
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(strName);
|
editForm.getForm().findField('name').setValue(strName);
|
||||||
editForm.getForm().findField('status').setValue(rowSelected.data.GRP_STATUS);
|
var valueEditChangeInt = (rowSelected.data.GRP_STATUS == 'ACTIVE') ? '1' : '0';
|
||||||
|
editForm.getForm().findField('status').setValue(valueEditChangeInt);
|
||||||
w = new Ext.Window({
|
w = new Ext.Window({
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
width: 440,
|
width: 440,
|
||||||
@@ -467,6 +471,7 @@ SaveEditGroupAction = function(){
|
|||||||
|
|
||||||
//Save Edit Group
|
//Save Edit Group
|
||||||
SaveEditGroup = function(){
|
SaveEditGroup = function(){
|
||||||
|
document.getElementById('statusEdit').value = Ext.getCmp('statusEdit').getValue();
|
||||||
editForm.getForm().submit({
|
editForm.getForm().submit({
|
||||||
waitTitle : " ",
|
waitTitle : " ",
|
||||||
success: function(f,a){
|
success: function(f,a){
|
||||||
|
|||||||
Reference in New Issue
Block a user