BUG 0000 "Start Case Detail Panel Compatibility on new Pmos UI"

This commit is contained in:
Erik Amaru Ortiz
2012-05-02 11:25:54 -04:00
parent c96cbae164
commit 27eac4dfc2

View File

@@ -19,15 +19,12 @@ var processNumbers = new Ext.data.ArrayStore({
}); });
var processNumbersData = [[0,0,0,0,0]]; var processNumbersData = [[0,0,0,0,0]];
//processNumbers.loadData(processNumbersData);
Docs = {}; Docs = {};
Ext.onReady(function() { Ext.onReady(function() {
var newCaseTree = new Ext.ux.MaskTree({ var newCaseTree = new Ext.ux.MaskTree({
id: 'startCaseTreePanel', id: 'startCaseTreePanel',
region: 'center', region: 'center',
//autoWidth: true,
useArrows: true, useArrows: true,
animate: true, animate: true,
split : true, split : true,
@@ -45,7 +42,7 @@ Ext.onReady(function() {
xtype : 'textfield', xtype : 'textfield',
name : 'processesFilter', name : 'processesFilter',
id : 'processesFilter', id : 'processesFilter',
emptyText : _('ID_FIND_A_PROCESS'), // 'Find a Process', emptyText : _('ID_FIND_A_PROCESS'),
enableKeyEvents : true, enableKeyEvents : true,
listeners : { listeners : {
render : function(f) { render : function(f) {
@@ -70,14 +67,14 @@ Ext.onReady(function() {
} }
}, ' ', ' ', { }, ' ', ' ', {
iconCls : 'icon-expand-all', iconCls : 'icon-expand-all',
tooltip : _('ID_EXPAND_ALL'), //'Expand All', tooltip : _('ID_EXPAND_ALL'),
handler : function() { handler : function() {
Ext.getCmp("startCaseTreePanel").root.expand(true); Ext.getCmp("startCaseTreePanel").root.expand(true);
}, },
scope : this scope : this
}, '-', { }, '-', {
iconCls : 'icon-collapse-all', iconCls : 'icon-collapse-all',
tooltip : _('ID_COLLAPSE_ALL'), //'Collapse All', tooltip : _('ID_COLLAPSE_ALL'),
handler : function() { handler : function() {
Ext.getCmp("startCaseTreePanel").root.collapse(true); Ext.getCmp("startCaseTreePanel").root.collapse(true);
}, },
@@ -95,12 +92,9 @@ Ext.onReady(function() {
], ],
listeners : { listeners : {
dblclick : function(n) { dblclick : function(n) {
//mainPanel.openCase(n);
openCaseA(n); openCaseA(n);
}, },
click : function(n) { click : function(n) {
//mainPanel.showDetails(n);
showDetailsA(n); showDetailsA(n);
} }
} }
@@ -110,94 +104,70 @@ Ext.onReady(function() {
xtype:'form', xtype:'form',
id : 'process-detail-panel', id : 'process-detail-panel',
region : 'east', region : 'east',
// autoHeight : true,
split : true, split : true,
width : 450,
style : { style : {
width : '450' width : '450'
}, },
// minWidth : 150, minWidth : 250,
// frame: true,
labelAlign: 'right', labelAlign: 'right',
labelWidth: 85, labelWidth: 85,
// width:340,
waitMsgTarget: true, waitMsgTarget: true,
title: TRANSLATIONS.ID_PROCESS_INFORMATION, // 'Process Information', // title: TRANSLATIONS.ID_PROCESS_INFORMATION,
layout:'form', layout:'form',
defaults: {width: 350}, defaults: {width: 350},
defaultType: 'displayfield', defaultType: 'displayfield',
items: [{ items: [{
fieldLabel: TRANSLATIONS.ID_PROCESS, // 'Process', fieldLabel: TRANSLATIONS.ID_PROCESS,
name: 'processName', name: 'processName',
allowBlank:false, allowBlank:false,
value: '', value: '',
labelStyle: 'font-weight:bold;', labelStyle: 'font-weight:bold;',
// disabled: true,
// readonly:true,
id:"processName" id:"processName"
}, },
{ {
xtype: 'compositefield', xtype: 'compositefield',
fieldLabel: TRANSLATIONS.ID_TASK, // 'Task', fieldLabel: TRANSLATIONS.ID_TASK,
labelStyle: 'font-weight:bold;', labelStyle: 'font-weight:bold;',
items: [ items: [
{ {
xtype : 'button', xtype : 'button',
id : 'starCaseButton', id : 'starCaseButton',
disabled : true, disabled : true,
// cls :
// 'x-btn-icon',
// icon :
// '/images/refresh.gif',
iconCls : "ICON_CASES_START_CASE", iconCls : "ICON_CASES_START_CASE",
text : TRANSLATIONS.ID_TITLE_START_CASE, // "Start text : TRANSLATIONS.ID_TITLE_START_CASE,
// Case",
// margins:"5 5
// 5 5",
autoWidth : true, autoWidth : true,
handler : function() { handler : function() {
tree = Ext tree = Ext.getCmp('startCaseTreePanel');
.getCmp('startCaseTreePanel'); var selectedNode = tree.getSelectionModel().getSelectedNode();
var selectedNode = tree
.getSelectionModel()
.getSelectedNode();
if (selectedNode) { if (selectedNode) {
//mainPanel.openCase(selectedNode);
openCaseA(selectedNode); openCaseA(selectedNode);
} }
} }
}, },
{ {
xtype : 'displayfield', xtype : 'displayfield',
//fieldLabel: 'Task',
//labelStyle: 'font-weight:bold;',
name: 'taskName', name: 'taskName',
allowBlank:false, allowBlank:false,
value: '', value: '',
//autoWitdh:true,
width:200, width:200,
// disabled: true,
id:"taskName" id:"taskName"
} }
]}, ]},
{ {
xtype:'textarea', xtype:'textarea',
fieldLabel: TRANSLATIONS.ID_DESCRIPTION, // 'Description', fieldLabel: TRANSLATIONS.ID_DESCRIPTION,
name: 'processDescription', name: 'processDescription',
value: '', value: '',
readOnly: true, readOnly: true,
labelStyle: 'font-weight:bold;', labelStyle: 'font-weight:bold;',
// disabled: true,
id:"processDescription" id:"processDescription"
},{ },{
fieldLabel: TRANSLATIONS.ID_CATEGORY, // 'Category', fieldLabel: TRANSLATIONS.ID_CATEGORY,
name: 'processCategory', name: 'processCategory',
value: '', value: '',
readOnly: true, readOnly: true,
labelStyle: 'font-weight:bold;', labelStyle: 'font-weight:bold;',
// disabled: true,
id:"processCategory" id:"processCategory"
}, },
{ {
@@ -205,7 +175,6 @@ Ext.onReady(function() {
fieldLabel: ' ', fieldLabel: ' ',
labelSeparator : '', labelSeparator : '',
labelStyle: 'font-color:white;', labelStyle: 'font-color:white;',
// height: 15,
ds: processNumbers, ds: processNumbers,
cm: new Ext.grid.ColumnModel([ cm: new Ext.grid.ColumnModel([
{id:'inbox',header: TRANSLATIONS.ID_INBOX, width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_TO_DO'}, {id:'inbox',header: TRANSLATIONS.ID_INBOX, width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_TO_DO'},
@@ -213,40 +182,20 @@ Ext.onReady(function() {
{id:'completed',header: TRANSLATIONS.ID_COMPLETED, width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_COMPLETED'}, {id:'completed',header: TRANSLATIONS.ID_COMPLETED, width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_COMPLETED'},
{id:'canceled',header: TRANSLATIONS.ID_CANCELLED, width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_CANCELLED'}, {id:'canceled',header: TRANSLATIONS.ID_CANCELLED, width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_CANCELLED'},
{id:'totalCases',header: TRANSLATIONS.ID_TOTAL_CASES, width:70, sortable: false, locked:true , dataIndex: 'CASES_COUNT'} {id:'totalCases',header: TRANSLATIONS.ID_TOTAL_CASES, width:70, sortable: false, locked:true , dataIndex: 'CASES_COUNT'}
]),
])
,
//autoExpandColumn: 'company',
height: 49, height: 49,
width: 355, width: 355,
//title: TRANSLATIONS.ID_GENERAL_PROCESS_NUMBERS, // 'General Process Numbers', border: true
border: true,
listeners: {
viewready: function(g) {
//g.getSelectionModel().selectRow(0);
} // Allow rows to be rendered.
}
}, },
{ {
fieldLabel: TRANSLATIONS.ID_CALENDAR, // 'Calendar', fieldLabel: TRANSLATIONS.ID_CALENDAR,
name: 'calendarName', name: 'calendarName',
labelStyle: 'font-weight:bold;', labelStyle: 'font-weight:bold;',
// disabled: true,
id:"calendarName" id:"calendarName"
},/*{ },
xtype:'textarea', {
fieldLabel: TRANSLATIONS.ID_CALENDAR_DESCRIPTION, // 'Calendar Description',
name: 'calendarDescription',
value: '',
labelStyle: 'font-weight:bold;',
// disabled: true,
readOnly: true,
id:"calendarDescription"
},*/{
xtype:'checkboxgroup', xtype:'checkboxgroup',
fieldLabel: TRANSLATIONS.ID_WORKING_DAYS, // 'Working days', fieldLabel: TRANSLATIONS.ID_WORKING_DAYS,
name: 'calendarWorkDays', name: 'calendarWorkDays',
disabled: true, disabled: true,
readOnly: true, readOnly: true,
@@ -263,19 +212,19 @@ Ext.onReady(function() {
{boxLabel: TRANSLATIONS.ID_FRI, name: '5',disabledClass:""}, {boxLabel: TRANSLATIONS.ID_FRI, name: '5',disabledClass:""},
{boxLabel: TRANSLATIONS.ID_SAT, name: '6',disabledClass:""} {boxLabel: TRANSLATIONS.ID_SAT, name: '6',disabledClass:""}
] ]
}, { },
{
xtype:'checkbox', xtype:'checkbox',
fieldLabel: TRANSLATIONS.ID_DEBUG_MODE, // 'Debug Mode', fieldLabel: TRANSLATIONS.ID_DEBUG_MODE,
name: 'processDebug', name: 'processDebug',
labelStyle: 'font-weight:bold;', labelStyle: 'font-weight:bold;',
disabled: true, disabled: true,
readOnly: true, readOnly: true,
id:"processDebug", id:"processDebug",
disabledClass:"" disabledClass:""
}]
} }
]
}
Ext.QuickTips.init(); Ext.QuickTips.init();
@@ -302,11 +251,8 @@ Ext.onReady(function() {
function openCaseA(n){ function openCaseA(n){
if (n.attributes.optionType == "startProcess") { if (n.attributes.optionType == "startProcess") {
Ext.Msg.show({ Ext.Msg.show({
title : '', //TRANSLATIONS.ID_TITLE_START_CASE, //'Start Case', title : '',
msg : TRANSLATIONS.ID_STARTING_NEW_CASE // 'Starting new case' msg : TRANSLATIONS.ID_STARTING_NEW_CASE + '<br><br><b>' + n.attributes.text + '</b>',
+ '<br><br><b>' + n.attributes.text + '</b>',
//icon : Ext.MessageBox.INFO,
// width:300,
wait:true, wait:true,
waitConfig: {interval:500} waitConfig: {interval:500}
}); });
@@ -319,12 +265,12 @@ function openCaseA(n){
}, },
success : function(response) { success : function(response) {
try{ try {
var res = Ext.util.JSON.decode(response.responseText); var res = Ext.util.JSON.decode(response.responseText);
if (res.openCase) { if (res.openCase) {
window.location = res.openCase.PAGE; window.location = res.openCase.PAGE;
} else { }
else {
Ext.Msg.show({ Ext.Msg.show({
title : TRANSLATIONS.ID_ERROR_CREATING_NEW_CASE, // 'Error creating a new Case', title : TRANSLATIONS.ID_ERROR_CREATING_NEW_CASE, // 'Error creating a new Case',
msg : '<textarea cols="50" rows="10">' msg : '<textarea cols="50" rows="10">'
@@ -333,7 +279,8 @@ function openCaseA(n){
buttons : Ext.Msg.OK buttons : Ext.Msg.OK
}); });
} }
} catch(e) { }
catch(e) {
Ext.Msg.show({ Ext.Msg.show({
title : TRANSLATIONS.ID_ERROR_CREATING_NEW_CASE, // 'Error creating a new Case', title : TRANSLATIONS.ID_ERROR_CREATING_NEW_CASE, // 'Error creating a new Case',
msg : 'JSON Decode Error:<br /><textarea cols="50" rows="2">' msg : 'JSON Decode Error:<br /><textarea cols="50" rows="2">'
@@ -341,13 +288,9 @@ function openCaseA(n){
icon : Ext.MessageBox.ERROR, icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK buttons : Ext.Msg.OK
}); });
} }
}, },
failure : function() { failure : function() {
// grid.getGridEl().unmask(true); UNABLE_START_CASE
// Ext.Msg.alert('Error', 'Unable to start a case');
Ext.Msg.alert(TRANSLATIONS.ID_ERROR, TRANSLATIONS.ID_UNABLE_START_CASE); Ext.Msg.alert(TRANSLATIONS.ID_ERROR, TRANSLATIONS.ID_UNABLE_START_CASE);
} }
}); });