Cases Scheduler Log ExtJs update look n feel
This commit is contained in:
44
workflow/engine/methods/cases/casesSchedulerLog_Ajax.php
Normal file
44
workflow/engine/methods/cases/casesSchedulerLog_Ajax.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* casesSchedulerLog_Ajax.php
|
||||||
|
*
|
||||||
|
* ProcessMaker Open Source Edition
|
||||||
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
|
||||||
|
G::LoadInclude('ajax');
|
||||||
|
$_POST['action'] = get_ajax_value('action');
|
||||||
|
|
||||||
|
switch ($_POST['action'])
|
||||||
|
{
|
||||||
|
case 'updatePageSize':
|
||||||
|
G::LoadClass('configuration');
|
||||||
|
$c = new Configurations();
|
||||||
|
$arr['pageSize'] = $_REQUEST['size'];
|
||||||
|
$arr['dateSave'] = date('Y-m-d H:i:s');
|
||||||
|
$config = Array();
|
||||||
|
$config[] = $arr;
|
||||||
|
$c->aConfig = $config;
|
||||||
|
$c->saveConfig('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||||
|
echo '{success: true}';
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -26,6 +26,10 @@
|
|||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
|
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher;
|
||||||
|
G::LoadClass('configuration');
|
||||||
|
$c = new Configurations();
|
||||||
|
$configPage = $c->getConfiguration('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||||
|
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher =& headPublisher::getSingleton();
|
||||||
|
|
||||||
@@ -33,11 +37,9 @@ $oHeadPublisher =& headPublisher::getSingleton();
|
|||||||
$oHeadPublisher->addExtJsScript('cases/casesSchedulerLog', false); //adding a javascript file .js
|
$oHeadPublisher->addExtJsScript('cases/casesSchedulerLog', false); //adding a javascript file .js
|
||||||
$oHeadPublisher->addContent('cases/casesSchedulerLog'); //adding a html file .html.
|
$oHeadPublisher->addContent('cases/casesSchedulerLog'); //adding a html file .html.
|
||||||
|
|
||||||
$labels = G::getTranslations(Array('ID_DATE_LABEL','ID_TIME_LABEL','ID_USER','ID_RESULT', 'ID_CREATED_CASE_STATUS',
|
$oHeadPublisher->assign('CONFIG', $Config);
|
||||||
'ID_ROUTED_CASE_STATUS','ID_CLOSE','ID_LOG_CASE_SCHEDULER','ID_VIEW','ID_TITLE_LOG_DETAIL','ID_ENTER_SEARCH_TERM','ID_SEARCH',
|
|
||||||
'ID_SCHEDULER_TASK','ID_TASK_ID','ID_PROCESS_ID','ID_EXECUTION_DATE','ID_EXECUTION_HOUR','ID_EXECUTION_STATUS'));
|
|
||||||
|
|
||||||
$oHeadPublisher->assign('TRANSLATIONS', $labels);
|
|
||||||
G::RenderPage('publish', 'extJs');
|
G::RenderPage('publish', 'extJs');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -25,10 +25,14 @@
|
|||||||
|
|
||||||
require_once 'classes/model/LogCasesSchedulerPeer.php';
|
require_once 'classes/model/LogCasesSchedulerPeer.php';
|
||||||
require_once 'classes/model/LogCasesScheduler.php';
|
require_once 'classes/model/LogCasesScheduler.php';
|
||||||
|
G::LoadClass('configuration');
|
||||||
|
|
||||||
|
$co = new Configurations();
|
||||||
|
$config = $co->getConfiguration('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||||
|
$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'] : 20;
|
$limit = isset($_REQUEST['limit'])? $_REQUEST['limit'] : $limit_size;
|
||||||
|
|
||||||
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
|
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
|
||||||
|
|
||||||
$oCriteria = new Criteria('workflow');
|
$oCriteria = new Criteria('workflow');
|
||||||
|
|||||||
@@ -5,20 +5,20 @@
|
|||||||
|
|
||||||
//Keyboard Events
|
//Keyboard Events
|
||||||
new Ext.KeyMap(document, {
|
new Ext.KeyMap(document, {
|
||||||
key: Ext.EventObject.F5,
|
key: Ext.EventObject.F5,
|
||||||
fn: function(keycode, e) {
|
fn: function(keycode, e) {
|
||||||
if (! e.ctrlKey) {
|
if (! e.ctrlKey) {
|
||||||
if (Ext.isIE) {
|
if (Ext.isIE) {
|
||||||
// IE6 doesn't allow cancellation of the F5 key, so trick it into
|
// IE6 doesn't allow cancellation of the F5 key, so trick it into
|
||||||
// thinking some other key was pressed (backspace in this case)
|
// thinking some other key was pressed (backspace in this case)
|
||||||
e.browserEvent.keyCode = 8;
|
e.browserEvent.keyCode = 8;
|
||||||
}
|
}
|
||||||
e.stopEvent();
|
e.stopEvent();
|
||||||
document.location = document.location;
|
document.location = document.location;
|
||||||
}else{
|
}else{
|
||||||
Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5');
|
Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var store;
|
var store;
|
||||||
@@ -32,193 +32,225 @@ var w;
|
|||||||
var viewButton;
|
var viewButton;
|
||||||
var searchButton;
|
var searchButton;
|
||||||
var contextMenu;
|
var contextMenu;
|
||||||
|
var pageSize;
|
||||||
|
|
||||||
|
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
Ext.QuickTips.init();
|
Ext.QuickTips.init();
|
||||||
|
|
||||||
viewButton = new Ext.Action({
|
pageSize = parseInt(CONFIG.pageSize);
|
||||||
text: TRANSLATIONS.ID_VIEW,
|
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_table',
|
viewButton = new Ext.Action({
|
||||||
handler: ShowSelectedLog,
|
text: _('ID_VIEW'),
|
||||||
disabled: true
|
iconCls: 'button_menu_ext ss_sprite ss_table',
|
||||||
});
|
handler: ShowSelectedLog,
|
||||||
|
disabled: true
|
||||||
searchButton = new Ext.Action({
|
});
|
||||||
text: TRANSLATIONS.ID_SEARCH,
|
|
||||||
handler: DoSearch
|
searchButton = new Ext.Action({
|
||||||
});
|
text: _('ID_SEARCH'),
|
||||||
|
handler: DoSearch
|
||||||
contextMenu = new Ext.menu.Menu({
|
});
|
||||||
items: [viewButton]
|
|
||||||
});
|
contextMenu = new Ext.menu.Menu({
|
||||||
|
items: [viewButton]
|
||||||
searchText = new Ext.form.TextField ({
|
});
|
||||||
id: 'searchTxt',
|
|
||||||
ctCls:'pm_search_text_field',
|
searchText = new Ext.form.TextField ({
|
||||||
allowBlank: true,
|
id: 'searchTxt',
|
||||||
width: 150,
|
ctCls:'pm_search_text_field',
|
||||||
emptyText: TRANSLATIONS.ID_ENTER_SEARCH_TERM,//'enter search term',
|
allowBlank: true,
|
||||||
listeners: {
|
width: 150,
|
||||||
specialkey: function(f,e){
|
emptyText: _('ID_ENTER_SEARCH_TERM'),//'enter search term',
|
||||||
if (e.getKey() == e.ENTER) {
|
listeners: {
|
||||||
DoSearch();
|
specialkey: function(f,e){
|
||||||
}
|
if (e.getKey() == e.ENTER) {
|
||||||
},
|
DoSearch();
|
||||||
focus: function(f,e) {
|
|
||||||
var row = infoGrid.getSelectionModel().getSelected();
|
|
||||||
infoGrid.getSelectionModel().deselectRow(infoGrid.getStore().indexOf(row));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
focus: function(f,e) {
|
||||||
clearTextButton = new Ext.Action({
|
var row = infoGrid.getSelectionModel().getSelected();
|
||||||
text: 'X',
|
infoGrid.getSelectionModel().deselectRow(infoGrid.getStore().indexOf(row));
|
||||||
ctCls:'pm_search_x_button',
|
}
|
||||||
handler: GridByDefault
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
viewForm = new Ext.FormPanel({
|
|
||||||
url: 'data_casesSchedulerLog',
|
|
||||||
frame: true,
|
|
||||||
title: TRANSLATIONS.ID_TITLE_LOG_DETAIL,
|
|
||||||
labelWidth: 150,
|
|
||||||
items:[
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_SCHEDULER_TASK, id: 'stask', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_TASK_ID, id: 'task', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_PROCESS_ID, id: 'process', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_USER, id: 'user', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_EXECUTION_DATE, id: 'date', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_EXECUTION_HOUR, id: 'hour', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_EXECUTION_STATUS, id: 'status', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_CREATED_CASE_STATUS, id: 'cstatus', width: 250},
|
|
||||||
{xtype: 'label', fieldLabel: TRANSLATIONS.ID_ROUTED_CASE_STATUS, id: 'rstatus', width: 250}
|
|
||||||
],
|
|
||||||
|
|
||||||
buttons: [
|
|
||||||
{text: TRANSLATIONS.ID_CLOSE, handler: CloseView}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
store = new Ext.data.GroupingStore( {
|
clearTextButton = new Ext.Action({
|
||||||
proxy : new Ext.data.HttpProxy({
|
text: 'X',
|
||||||
url: 'data_casesSchedulerLog'
|
ctCls:'pm_search_x_button',
|
||||||
}),
|
handler: GridByDefault
|
||||||
reader : new Ext.data.JsonReader( {
|
});
|
||||||
root: 'rows',
|
|
||||||
totalProperty: 'results',
|
|
||||||
fields : [
|
|
||||||
{name : 'LOG_CASE_UID'},
|
|
||||||
{name : 'PRO_UID'},
|
|
||||||
{name : 'TAS_UID'},
|
|
||||||
{name : 'USR_NAME'},
|
|
||||||
{name : 'EXEC_DATE'},
|
|
||||||
{name : 'EXEC_HOUR'},
|
|
||||||
{name : 'RESULT'},
|
|
||||||
{name : 'SCH_UID'},
|
|
||||||
{name : 'WS_CREATE_CASE_STATUS'},
|
|
||||||
{name : 'WS_ROUTE_CASE_STATUS'}
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
cmodel = new Ext.grid.ColumnModel({
|
|
||||||
defaults: {
|
|
||||||
width: 50,
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{id:'LOG_CASE_UID', dataIndex: 'LOG_CASE_UID', hidden:true, hideable:false},
|
|
||||||
{header: TRANSLATIONS.ID_DATE_LABEL, dataIndex: 'EXEC_DATE', width: 30, align:'left'},
|
|
||||||
{header: TRANSLATIONS.ID_TIME_LABEL, dataIndex: 'EXEC_HOUR', width: 30, hidden:false, align:'left'},
|
|
||||||
{header: TRANSLATIONS.ID_USER, dataIndex: 'USR_NAME', width: 40, hidden:false, align:'left'},
|
|
||||||
{header: TRANSLATIONS.ID_RESULT, dataIndex: 'RESULT', width: 40, hidden:false, align:'left'},
|
|
||||||
{header: TRANSLATIONS.ID_CREATED_CASE_STATUS, dataIndex: 'WS_CREATE_CASE_STATUS', width: 80, hidden:false, align:'left'},
|
|
||||||
{header: TRANSLATIONS.ID_ROUTED_CASE_STATUS, dataIndex: 'WS_ROUTE_CASE_STATUS', width: 80, hidden:false, align:'left'}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
smodel = new Ext.grid.RowSelectionModel({
|
|
||||||
singleSelect: true,
|
|
||||||
listeners:{
|
|
||||||
rowselect: function(sm){
|
|
||||||
viewButton.enable();
|
|
||||||
},
|
|
||||||
rowdeselect: function(sm){
|
|
||||||
viewButton.disable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bbarpaging = new Ext.PagingToolbar({
|
|
||||||
pageSize: 20,
|
|
||||||
store: store
|
|
||||||
});
|
|
||||||
|
|
||||||
infoGrid = new Ext.grid.GridPanel({
|
viewForm = new Ext.FormPanel({
|
||||||
title : TRANSLATIONS.ID_LOG_CASE_SCHEDULER,
|
url: 'data_casesSchedulerLog',
|
||||||
region: 'center',
|
frame: true,
|
||||||
layout: 'fit',
|
title: _('ID_TITLE_LOG_DETAIL'),
|
||||||
id: 'infoGrid',
|
labelWidth: 150,
|
||||||
height:100,
|
items:[
|
||||||
autoWidth : true,
|
{xtype: 'label', fieldLabel: _('ID_SCHEDULER_TASK'), id: 'stask', width: 250},
|
||||||
stateful : true,
|
{xtype: 'label', fieldLabel: _('ID_TASK_ID'), id: 'task', width: 250},
|
||||||
stateId : 'grid',
|
{xtype: 'label', fieldLabel: _('ID_PROCESS_ID'), id: 'process', width: 250},
|
||||||
enableColumnResize: true,
|
{xtype: 'label', fieldLabel: _('ID_USER'), id: 'user', width: 250},
|
||||||
enableHdMenu: true,
|
{xtype: 'label', fieldLabel: _('ID_EXECUTION_DATE'), id: 'date', width: 250},
|
||||||
frame:false,
|
{xtype: 'label', fieldLabel: _('ID_EXECUTION_HOUR'), id: 'hour', width: 250},
|
||||||
iconCls:'icon-grid',
|
{xtype: 'label', fieldLabel: _('ID_EXECUTION_STATUS'), id: 'status', width: 250},
|
||||||
columnLines: false,
|
{xtype: 'label', fieldLabel: _('ID_CREATED_CASE_STATUS'), id: 'cstatus', width: 250},
|
||||||
viewConfig: {
|
{xtype: 'label', fieldLabel: _('ID_ROUTED_CASE_STATUS'), id: 'rstatus', width: 250}
|
||||||
forceFit:true
|
],
|
||||||
},
|
|
||||||
store: store,
|
|
||||||
cm: cmodel,
|
|
||||||
sm: smodel,
|
|
||||||
tbar: [viewButton,{xtype: 'tbfill'},searchText,clearTextButton,searchButton],
|
|
||||||
bbar: [{xtype: 'tbfill'}, bbarpaging],
|
|
||||||
listeners: {
|
|
||||||
rowdblclick: ShowSelectedLog
|
|
||||||
},
|
|
||||||
view: new Ext.grid.GroupingView({
|
|
||||||
forceFit:true,
|
|
||||||
groupTextTpl: '{text}'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
infoGrid.on('rowcontextmenu',
|
|
||||||
function (grid, rowIndex, evt) {
|
|
||||||
var sm = grid.getSelectionModel();
|
|
||||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
|
||||||
},
|
|
||||||
this
|
|
||||||
);
|
|
||||||
|
|
||||||
infoGrid.on('contextmenu',
|
|
||||||
function (evt) {
|
|
||||||
evt.preventDefault();
|
|
||||||
},
|
|
||||||
this
|
|
||||||
);
|
|
||||||
|
|
||||||
infoGrid.addListener('rowcontextmenu',onMessageContextMenu,this);
|
|
||||||
|
|
||||||
GridByDefault();
|
buttons: [
|
||||||
|
{text: _('ID_CLOSE'), handler: CloseView}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
viewport = new Ext.Viewport({
|
store = new Ext.data.GroupingStore( {
|
||||||
layout: 'fit',
|
proxy : new Ext.data.HttpProxy({
|
||||||
autoScroll: false,
|
url: 'data_casesSchedulerLog'
|
||||||
items: [
|
}),
|
||||||
infoGrid
|
reader : new Ext.data.JsonReader( {
|
||||||
]
|
root: 'rows',
|
||||||
});
|
totalProperty: 'results',
|
||||||
|
fields : [
|
||||||
|
{name : 'LOG_CASE_UID'},
|
||||||
|
{name : 'PRO_UID'},
|
||||||
|
{name : 'TAS_UID'},
|
||||||
|
{name : 'USR_NAME'},
|
||||||
|
{name : 'EXEC_DATE'},
|
||||||
|
{name : 'EXEC_HOUR'},
|
||||||
|
{name : 'RESULT'},
|
||||||
|
{name : 'SCH_UID'},
|
||||||
|
{name : 'WS_CREATE_CASE_STATUS'},
|
||||||
|
{name : 'WS_ROUTE_CASE_STATUS'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
cmodel = new Ext.grid.ColumnModel({
|
||||||
|
defaults: {
|
||||||
|
width: 50,
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{id:'LOG_CASE_UID', dataIndex: 'LOG_CASE_UID', hidden:true, hideable:false},
|
||||||
|
{header: _('ID_DATE_LABEL'), dataIndex: 'EXEC_DATE', width: 30, align:'left'},
|
||||||
|
{header: _('ID_TIME_LABEL'), dataIndex: 'EXEC_HOUR', width: 30, hidden:false, align:'left'},
|
||||||
|
{header: _('ID_USER'), dataIndex: 'USR_NAME', width: 40, hidden:false, align:'left'},
|
||||||
|
{header: _('ID_RESULT'), dataIndex: 'RESULT', width: 40, hidden:false, align:'left'},
|
||||||
|
{header: _('ID_CREATED_CASE_STATUS'), dataIndex: 'WS_CREATE_CASE_STATUS', width: 80, hidden:false, align:'left'},
|
||||||
|
{header: _('ID_ROUTED_CASE_STATUS'), dataIndex: 'WS_ROUTE_CASE_STATUS', width: 80, hidden:false, align:'left'}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
smodel = new Ext.grid.RowSelectionModel({
|
||||||
|
singleSelect: true,
|
||||||
|
listeners:{
|
||||||
|
rowselect: function(sm){
|
||||||
|
viewButton.enable();
|
||||||
|
},
|
||||||
|
rowdeselect: function(sm){
|
||||||
|
viewButton.disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
storePageSize = new Ext.data.SimpleStore({
|
||||||
|
fields: ['size'],
|
||||||
|
data: [['20'],['30'],['40'],['50'],['100']],
|
||||||
|
autoLoad: true
|
||||||
|
});
|
||||||
|
|
||||||
|
comboPageSize = new Ext.form.ComboBox({
|
||||||
|
typeAhead : false,
|
||||||
|
mode : 'local',
|
||||||
|
triggerAction : 'all',
|
||||||
|
store: storePageSize,
|
||||||
|
valueField: 'size',
|
||||||
|
displayField: 'size',
|
||||||
|
width: 50,
|
||||||
|
editable: false,
|
||||||
|
listeners:{
|
||||||
|
select: function(c,d,i){
|
||||||
|
UpdatePageConfig(d.data['size']);
|
||||||
|
bbarpaging.pageSize = parseInt(d.data['size']);
|
||||||
|
bbarpaging.moveFirst();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
comboPageSize.setValue(pageSize);
|
||||||
|
|
||||||
|
bbarpaging = new Ext.PagingToolbar({
|
||||||
|
pageSize: pageSize,
|
||||||
|
store: store,
|
||||||
|
displayInfo: true,
|
||||||
|
displayMsg: _('ID_GRID_PAGE_DISPLAYING_ROWS_MESSAGE') + ' ',
|
||||||
|
emptyMsg: _('ID_GRID_PAGE_NO_ROWS_MESSAGE'),
|
||||||
|
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
|
||||||
|
});
|
||||||
|
|
||||||
|
infoGrid = new Ext.grid.GridPanel({
|
||||||
|
title : _('ID_LOG_CASE_SCHEDULER'),
|
||||||
|
region: 'center',
|
||||||
|
layout: 'fit',
|
||||||
|
id: 'infoGrid',
|
||||||
|
height:100,
|
||||||
|
autoWidth : true,
|
||||||
|
stateful : true,
|
||||||
|
stateId : 'grid',
|
||||||
|
enableColumnResize: true,
|
||||||
|
enableHdMenu: true,
|
||||||
|
frame:false,
|
||||||
|
columnLines: false,
|
||||||
|
viewConfig: {
|
||||||
|
forceFit:true
|
||||||
|
},
|
||||||
|
store: store,
|
||||||
|
cm: cmodel,
|
||||||
|
sm: smodel,
|
||||||
|
tbar: [viewButton,{xtype: 'tbfill'},searchText,clearTextButton,searchButton],
|
||||||
|
bbar: bbarpaging,
|
||||||
|
listeners: {
|
||||||
|
rowdblclick: ShowSelectedLog
|
||||||
|
},
|
||||||
|
view: new Ext.grid.GroupingView({
|
||||||
|
forceFit:true,
|
||||||
|
groupTextTpl: '{text}'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
infoGrid.on('rowcontextmenu',
|
||||||
|
function (grid, rowIndex, evt) {
|
||||||
|
var sm = grid.getSelectionModel();
|
||||||
|
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||||
|
},
|
||||||
|
this
|
||||||
|
);
|
||||||
|
|
||||||
|
infoGrid.on('contextmenu',
|
||||||
|
function (evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
},
|
||||||
|
this
|
||||||
|
);
|
||||||
|
|
||||||
|
infoGrid.addListener('rowcontextmenu',onMessageContextMenu,this);
|
||||||
|
|
||||||
|
GridByDefault();
|
||||||
|
|
||||||
|
viewport = new Ext.Viewport({
|
||||||
|
layout: 'fit',
|
||||||
|
autoScroll: false,
|
||||||
|
items: [
|
||||||
|
infoGrid
|
||||||
|
]
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//Funtion Handles Context Menu Opening
|
//Funtion Handles Context Menu Opening
|
||||||
onMessageContextMenu = function (grid, rowIndex, e) {
|
onMessageContextMenu = function (grid, rowIndex, e) {
|
||||||
e.stopEvent();
|
e.stopEvent();
|
||||||
var coords = e.getXY();
|
var coords = e.getXY();
|
||||||
contextMenu.showAt([coords[0], coords[1]]);
|
contextMenu.showAt([coords[0], coords[1]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Do Nothing Function
|
//Do Nothing Function
|
||||||
@@ -226,43 +258,52 @@ DoNothing = function(){}
|
|||||||
|
|
||||||
//Handles DoubleClick's Grid
|
//Handles DoubleClick's Grid
|
||||||
ShowSelectedLog = function(){
|
ShowSelectedLog = function(){
|
||||||
rowSelected = infoGrid.getSelectionModel().getSelected();
|
rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||||
if (rowSelected){
|
if (rowSelected){
|
||||||
Ext.getCmp('stask').setText(rowSelected.data.SCH_UID);
|
Ext.getCmp('stask').setText(rowSelected.data.SCH_UID);
|
||||||
Ext.getCmp('task').setText(rowSelected.data.TAS_UID);
|
Ext.getCmp('task').setText(rowSelected.data.TAS_UID);
|
||||||
Ext.getCmp('process').setText(rowSelected.data.PRO_UID);
|
Ext.getCmp('process').setText(rowSelected.data.PRO_UID);
|
||||||
Ext.getCmp('user').setText(rowSelected.data.USR_NAME);
|
Ext.getCmp('user').setText(rowSelected.data.USR_NAME);
|
||||||
Ext.getCmp('date').setText(rowSelected.data.EXEC_DATE);
|
Ext.getCmp('date').setText(rowSelected.data.EXEC_DATE);
|
||||||
Ext.getCmp('hour').setText(rowSelected.data.EXEC_HOUR);
|
Ext.getCmp('hour').setText(rowSelected.data.EXEC_HOUR);
|
||||||
Ext.getCmp('status').setText(rowSelected.data.RESULT);
|
Ext.getCmp('status').setText(rowSelected.data.RESULT);
|
||||||
Ext.getCmp('cstatus').setText(rowSelected.data.WS_CREATE_CASE_STATUS);
|
Ext.getCmp('cstatus').setText(rowSelected.data.WS_CREATE_CASE_STATUS);
|
||||||
Ext.getCmp('rstatus').setText(rowSelected.data.WS_ROUTE_CASE_STATUS);
|
Ext.getCmp('rstatus').setText(rowSelected.data.WS_ROUTE_CASE_STATUS);
|
||||||
w = new Ext.Window({
|
w = new Ext.Window({
|
||||||
height: 320,
|
autoHeight: true,
|
||||||
width: 550,
|
width: 550,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
closable: false,
|
closable: false,
|
||||||
items: [viewForm]
|
modal: true,
|
||||||
});
|
items: [viewForm]
|
||||||
w.show();
|
});
|
||||||
}
|
w.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Load Grid By Default
|
//Load Grid By Default
|
||||||
GridByDefault = function(){
|
GridByDefault = function(){
|
||||||
searchText.reset();
|
searchText.reset();
|
||||||
infoGrid.store.load();
|
infoGrid.store.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Close View Dialog
|
//Close View Dialog
|
||||||
CloseView = function(){
|
CloseView = function(){
|
||||||
w.hide();
|
w.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Do Search Function
|
//Do Search Function
|
||||||
DoSearch = function(){
|
DoSearch = function(){
|
||||||
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Update Page Size Configuration
|
||||||
|
UpdatePageConfig = function(pageSize){
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url: 'casesSchedulerLog_Ajax',
|
||||||
|
params: {action:'updatePageSize', size: pageSize}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user