2011-02-04 15:57:06 +00:00
|
|
|
var Actions = {};
|
|
|
|
|
var showCaseNavigatorPanel;
|
|
|
|
|
var hideCaseNavigatorPanel;
|
|
|
|
|
var informationMenu;
|
|
|
|
|
var caseMenuOpen = false;
|
2011-02-25 14:14:38 +00:00
|
|
|
var toReviseTreeOpen = false;
|
2011-02-04 15:57:06 +00:00
|
|
|
var menuSelectedTitle = Array();
|
|
|
|
|
var _ENV_CURRENT_DATE;
|
|
|
|
|
|
|
|
|
|
Ext.onReady(function(){
|
|
|
|
|
Ext.QuickTips.init();
|
2011-03-25 09:14:06 -04:00
|
|
|
|
|
|
|
|
showCaseNavigatorPanel = function(app_status) {
|
|
|
|
|
|
|
|
|
|
if (typeof(treeToReviseTitle) != 'undefined'){
|
2011-02-25 14:14:38 +00:00
|
|
|
var treeToRevise = new Ext.tree.TreePanel({
|
|
|
|
|
title: treeToReviseTitle,
|
|
|
|
|
width: 250,
|
|
|
|
|
height: 250,
|
|
|
|
|
userArrows: true,
|
|
|
|
|
animate: true,
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
rootVisible: false,
|
|
|
|
|
dataUrl: casesPanelUrl,
|
|
|
|
|
root: {
|
|
|
|
|
nodeType : 'async',
|
|
|
|
|
text : 'To Revise',
|
|
|
|
|
id : 'node-root'
|
|
|
|
|
},
|
|
|
|
|
listeners: {
|
|
|
|
|
render: function() {
|
|
|
|
|
this.expandAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2011-02-25 16:45:05 +00:00
|
|
|
|
|
|
|
|
if(typeof(winTree)=='undefined'){
|
|
|
|
|
var winTree = new Ext.Window({
|
2011-02-25 14:14:38 +00:00
|
|
|
id:'toReviseWindow',
|
|
|
|
|
width:220,
|
|
|
|
|
height:300,
|
|
|
|
|
el:'toReviseTree',
|
|
|
|
|
collapsible: true,
|
|
|
|
|
plain: true,
|
|
|
|
|
x:100,
|
|
|
|
|
y:100,
|
|
|
|
|
closeAction:'hide',
|
|
|
|
|
items: [treeToRevise]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!toReviseTreeOpen){
|
2011-02-25 16:45:05 +00:00
|
|
|
winTree.show(this);
|
2011-02-25 14:14:38 +00:00
|
|
|
toReviseTreeOpen = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-25 09:14:06 -04:00
|
|
|
if( caseMenuOpen )
|
2011-02-04 15:57:06 +00:00
|
|
|
return false;
|
|
|
|
|
else
|
|
|
|
|
caseMenuOpen = true;
|
|
|
|
|
|
2011-03-25 09:14:06 -04:00
|
|
|
//get the menu
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener',
|
|
|
|
|
params : {action : 'getCaseMenu', app_status:app_status},
|
|
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
for(i=0; i<data.length; i++) {
|
|
|
|
|
switch(data[i].id) {
|
|
|
|
|
case 'STEPS':
|
|
|
|
|
Ext.getCmp('casesStepTree').root.reload();
|
|
|
|
|
Ext.getCmp('stepsMenu').show();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'INFO':
|
|
|
|
|
//filling information menu
|
|
|
|
|
var informationMenu = Ext.getCmp('informationMenu');
|
|
|
|
|
informationMenu.menu.removeAll();
|
|
|
|
|
for(j=0; j<data[i].options.length; j++) {
|
|
|
|
|
informationMenu.menu.add({
|
|
|
|
|
text: data[i].options[j].text,
|
|
|
|
|
handler: data[i].options[j].fn != '' ? Actions[data[i].options[j].fn] : function(){}
|
|
|
|
|
});
|
|
|
|
|
menuSelectedTitle[data[i].options[j].fn] = data[i].options[j].text;
|
|
|
|
|
}
|
|
|
|
|
informationMenu.show();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'ACTIONS':
|
|
|
|
|
var actionMenu = Ext.getCmp('actionMenu');
|
|
|
|
|
actionMenu.menu.removeAll();
|
|
|
|
|
for(j=0; j<data[i].options.length; j++) {
|
|
|
|
|
actionMenu.menu.add({
|
|
|
|
|
text: data[i].options[j].text,
|
|
|
|
|
handler: data[i].options[j].fn != '' ? Actions[data[i].options[j].fn] : function(){}
|
|
|
|
|
});
|
|
|
|
|
menuSelectedTitle[data[i].options[j].fn] = data[i].options[j].text;
|
|
|
|
|
}
|
|
|
|
|
actionMenu.show();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
2011-02-04 15:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hideCaseNavigatorPanel = function(){
|
|
|
|
|
Ext.getCmp('stepsMenu').pressed = false;
|
|
|
|
|
caseMenuOpen = false;
|
|
|
|
|
|
|
|
|
|
Ext.getCmp('navPanelWest').hide();
|
|
|
|
|
Ext.getCmp('navPanelWest').ownerCt.doLayout();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function togglePreview(btn, pressed){
|
|
|
|
|
var preview = Ext.getCmp('navPanelWest');
|
|
|
|
|
preview[pressed ? 'show' : 'hide']();
|
|
|
|
|
Ext.getCmp('navPanel').ownerCt.doLayout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var casesStepTree = new Ext.tree.TreePanel({
|
|
|
|
|
id: 'casesStepTree',
|
|
|
|
|
autoWidth: true,
|
|
|
|
|
userArrows: true,
|
|
|
|
|
animate: true,
|
|
|
|
|
autoScroll: true,
|
|
|
|
|
dataUrl: 'ajaxListener?action=steps',
|
|
|
|
|
rootVisible: false,
|
|
|
|
|
containerScroll: true,
|
|
|
|
|
border: false,
|
|
|
|
|
root: {
|
|
|
|
|
nodeType: 'async'
|
|
|
|
|
},
|
|
|
|
|
listeners: {
|
|
|
|
|
render: function() {
|
|
|
|
|
this.getRootNode().expand();
|
|
|
|
|
},
|
|
|
|
|
click: function(tp) {
|
|
|
|
|
if( tp.attributes.url ){
|
|
|
|
|
|
|
|
|
|
document.getElementById('openCaseFrame').src = tp.attributes.url;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var navPanelWest = {
|
|
|
|
|
id: 'navPanelWest',
|
|
|
|
|
region: 'west',
|
|
|
|
|
xtype:'panel',
|
|
|
|
|
width: 250,
|
|
|
|
|
height: 500,
|
|
|
|
|
maxSize: 400,
|
|
|
|
|
split: true,
|
|
|
|
|
collapsible: false,
|
|
|
|
|
margins: '0 0 0 0',
|
|
|
|
|
items:[casesStepTree]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var fnChangeStatus =function(){
|
|
|
|
|
alert('loaded');
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-24 20:34:14 +00:00
|
|
|
var screenWidth = (PMExt.getBrowser().screen.width-140).toString() + 'px';
|
|
|
|
|
|
2011-02-04 15:57:06 +00:00
|
|
|
var navPanelCenter = {
|
|
|
|
|
id: 'navPanelCenter',
|
2011-04-08 19:11:30 -04:00
|
|
|
region: 'center', layout:'fit',forceLayout: true,
|
2011-02-04 15:57:06 +00:00
|
|
|
xtype:'panel',
|
|
|
|
|
items:[{
|
|
|
|
|
xtype:"tabpanel",
|
|
|
|
|
id: 'caseTabPanel',
|
|
|
|
|
deferredRender:false,
|
|
|
|
|
defaults:{autoScroll: true},
|
|
|
|
|
defaultType:"iframepanel",
|
|
|
|
|
activeTab: 0,
|
|
|
|
|
|
|
|
|
|
//defaults: Ext.apply({}, Ext.isGecko? {style:{position:'absolute'},hideMode:'visibility'}:false),
|
|
|
|
|
|
|
|
|
|
items:[{
|
2011-03-17 15:32:01 -04:00
|
|
|
title: _('ID_CASE') +' ' + _APP_NUM,
|
2011-02-04 15:57:06 +00:00
|
|
|
frameConfig:{name:'openCaseFrame', id:'openCaseFrame'},
|
|
|
|
|
defaultSrc : uri,
|
|
|
|
|
loadMask:{msg:'Loading...'},
|
2011-02-24 20:34:14 +00:00
|
|
|
bodyStyle:{height: (PMExt.getBrowser().screen.height-60) + 'px', overflow:'auto'},
|
|
|
|
|
width:screenWidth
|
2011-02-04 15:57:06 +00:00
|
|
|
|
2011-03-25 09:30:45 -04:00
|
|
|
}
|
2011-02-04 15:57:06 +00:00
|
|
|
],
|
|
|
|
|
listeners: {
|
|
|
|
|
render : function(panel){
|
2011-03-25 09:30:45 -04:00
|
|
|
Ext.each([this.el, this[this.collapseEl]] ,
|
|
|
|
|
function( elm ) {
|
|
|
|
|
elm.setVisibilityMode(Ext.Element.VISIBILITY).originalDisplay ='visible';
|
2011-02-04 15:57:06 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var navPanel = {
|
|
|
|
|
id: 'navPanel',
|
|
|
|
|
region: 'center',
|
|
|
|
|
layout: 'border',
|
|
|
|
|
items:[navPanelWest, navPanelCenter],
|
|
|
|
|
tbar:[{
|
|
|
|
|
id: 'stepsMenu',
|
2011-02-10 14:37:52 +00:00
|
|
|
text: ' '+_('ID_STEPS'),
|
2011-02-04 15:57:06 +00:00
|
|
|
pressed: false,
|
|
|
|
|
enableToggle:true,
|
|
|
|
|
tooltip: {
|
2011-02-10 14:37:52 +00:00
|
|
|
title: _('ID_CASES_STEPS'),
|
|
|
|
|
text:_('ID_SHOW_HIDE_CASES_STEPS')
|
2011-02-04 15:57:06 +00:00
|
|
|
},
|
|
|
|
|
iconCls: 'ICON_STEPS',
|
|
|
|
|
toggleHandler: togglePreview
|
|
|
|
|
}, {
|
|
|
|
|
id: 'informationMenu',
|
2011-02-10 14:37:52 +00:00
|
|
|
text: _('ID_INFORMATION'),
|
2011-03-17 15:32:01 -04:00
|
|
|
menu: []
|
2011-02-04 15:57:06 +00:00
|
|
|
}, {
|
|
|
|
|
id: 'actionMenu',
|
2011-02-10 14:37:52 +00:00
|
|
|
text: _('ID_ACTIONS'),
|
2011-02-04 15:57:06 +00:00
|
|
|
menu: []
|
2011-03-17 15:32:01 -04:00
|
|
|
}]
|
2011-02-04 15:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var viewport = new Ext.Viewport({
|
|
|
|
|
layout: 'border',
|
|
|
|
|
items: [navPanel]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ext.getCmp('stepsMenu').hide();
|
|
|
|
|
Ext.getCmp('informationMenu').hide();
|
|
|
|
|
Ext.getCmp('actionMenu').hide();
|
|
|
|
|
|
|
|
|
|
hideCaseNavigatorPanel();
|
|
|
|
|
|
|
|
|
|
// Actions methods
|
|
|
|
|
|
|
|
|
|
Actions.processMap = function()
|
|
|
|
|
{
|
|
|
|
|
Actions.tabFrame('processMap');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.processInformation = function()
|
|
|
|
|
{
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'getProcessInformation'},
|
2011-02-25 16:45:05 +00:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
|
2011-02-04 15:57:06 +00:00
|
|
|
fieldset = {
|
|
|
|
|
xtype : 'fieldset',
|
|
|
|
|
autoHeight : true,
|
2011-02-25 16:45:05 +00:00
|
|
|
defaults : {
|
2011-02-04 15:57:06 +00:00
|
|
|
width : 170,
|
|
|
|
|
xtype:'label',
|
|
|
|
|
labelStyle : 'padding: 0px;',
|
|
|
|
|
style: 'font-weight: bold'
|
|
|
|
|
},
|
|
|
|
|
items : [
|
|
|
|
|
{fieldLabel: 'Title', text: data.PRO_TITLE},
|
|
|
|
|
{fieldLabel: 'Description', text: data.PRO_DESCRIPTION},
|
|
|
|
|
{fieldLabel: 'Category', text: data.PRO_CATEGORY_LABEL},
|
|
|
|
|
{fieldLabel: 'Author', text: data.PRO_AUTHOR},
|
2011-02-25 16:45:05 +00:00
|
|
|
{fieldLabel: 'Create date', text: data.PRO_CREATE_DATE}
|
2011-02-04 15:57:06 +00:00
|
|
|
]
|
|
|
|
|
}
|
2011-02-25 16:45:05 +00:00
|
|
|
|
2011-02-04 15:57:06 +00:00
|
|
|
var frm = new Ext.FormPanel( {
|
|
|
|
|
labelAlign : 'right',
|
|
|
|
|
bodyStyle : 'padding:5px 5px 0',
|
|
|
|
|
width : 400,
|
2011-04-01 09:54:13 -04:00
|
|
|
autoScroll:true,
|
2011-02-04 15:57:06 +00:00
|
|
|
items : [fieldset],
|
|
|
|
|
buttons : [{
|
|
|
|
|
text : 'OK',
|
|
|
|
|
handler : function() {
|
|
|
|
|
win.close();
|
|
|
|
|
}
|
2011-02-25 16:45:05 +00:00
|
|
|
}]
|
2011-02-04 15:57:06 +00:00
|
|
|
});
|
2011-02-25 16:45:05 +00:00
|
|
|
|
2011-02-04 15:57:06 +00:00
|
|
|
var win = new Ext.Window({
|
|
|
|
|
title: '',
|
|
|
|
|
width: 450,
|
|
|
|
|
height: 280,
|
|
|
|
|
layout:'fit',
|
|
|
|
|
autoScroll:true,
|
|
|
|
|
modal: true,
|
|
|
|
|
maximizable: false,
|
|
|
|
|
items: [frm]
|
|
|
|
|
});
|
|
|
|
|
win.show();
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.taskInformation = function()
|
|
|
|
|
{
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'getTaskInformation'},
|
2011-02-04 15:57:06 +00:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
|
|
|
|
|
fieldset = {
|
|
|
|
|
xtype : 'fieldset',
|
|
|
|
|
autoHeight : true,
|
|
|
|
|
defaults : {
|
|
|
|
|
width : 170,
|
|
|
|
|
xtype:'label',
|
|
|
|
|
labelStyle : 'padding: 0px;',
|
|
|
|
|
style: 'font-weight: bold'
|
|
|
|
|
},
|
|
|
|
|
items : [
|
|
|
|
|
{fieldLabel: 'Title', text: data.TAS_TITLE},
|
|
|
|
|
{fieldLabel: 'Description', text: data.TAS_DESCRIPTION},
|
|
|
|
|
{fieldLabel: 'Init Date', text: data.INIT_DATE},
|
|
|
|
|
{fieldLabel: 'Due Date', text: data.DUE_DATE},
|
|
|
|
|
{fieldLabel: 'Finish Date', text: data.FINISH},
|
2011-02-25 16:45:05 +00:00
|
|
|
{fieldLabel: 'Duration', text: data.DURATION}
|
2011-02-04 15:57:06 +00:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var frm = new Ext.FormPanel( {
|
|
|
|
|
labelAlign : 'right',
|
|
|
|
|
bodyStyle : 'padding:5px 5px 0',
|
|
|
|
|
width : 400,
|
2011-04-01 09:54:13 -04:00
|
|
|
autoScroll:true,
|
2011-02-04 15:57:06 +00:00
|
|
|
items : [fieldset],
|
|
|
|
|
buttons : [{
|
|
|
|
|
text : 'OK',
|
|
|
|
|
handler : function() {
|
|
|
|
|
win.close();
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var win = new Ext.Window({
|
|
|
|
|
title: '',
|
|
|
|
|
width: 450,
|
|
|
|
|
height: 280,
|
|
|
|
|
layout:'fit',
|
|
|
|
|
autoScroll:true,
|
|
|
|
|
modal: true,
|
|
|
|
|
maximizable: false,
|
|
|
|
|
items: [frm]
|
|
|
|
|
});
|
|
|
|
|
win.show();
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.caseHistory = function()
|
|
|
|
|
{
|
|
|
|
|
Actions.tabFrame('caseHistory');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.messageHistory = function()
|
|
|
|
|
{
|
|
|
|
|
Actions.tabFrame('messageHistory');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.dynaformHistory = function()
|
|
|
|
|
{
|
|
|
|
|
Actions.tabFrame('dynaformHistory');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.uploadedDocuments = function()
|
|
|
|
|
{
|
|
|
|
|
Actions.tabFrame('uploadedDocuments');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.generatedDocuments = function()
|
|
|
|
|
{
|
|
|
|
|
Actions.tabFrame('generatedDocuments');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.cancelCase = function()
|
|
|
|
|
{
|
|
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_CANCEL_CASE'), function(){
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'cancelCase'},
|
2011-02-04 15:57:06 +00:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
parent.notify('', 'The case ' + parent._CASE_TITLE + ' was cancelled!');
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.getUsersToReassign = function()
|
|
|
|
|
{
|
|
|
|
|
var store = new Ext.data.Store( {
|
|
|
|
|
autoLoad: true,
|
|
|
|
|
proxy : new Ext.data.HttpProxy({
|
|
|
|
|
url: 'ajaxListener?action=getUsersToReassign'
|
|
|
|
|
}),
|
|
|
|
|
reader : new Ext.data.JsonReader( {
|
|
|
|
|
root: 'data',
|
|
|
|
|
fields : [
|
|
|
|
|
{name : 'USR_UID'},
|
|
|
|
|
{name : 'PRO_USERNAME'},
|
|
|
|
|
{name : 'USR_FIRSTNAME'},
|
|
|
|
|
{name : 'PRO_LASTNAME'}
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var grid = new Ext.grid.GridPanel( {
|
|
|
|
|
id: 'reassignGrid',
|
|
|
|
|
height:300,
|
|
|
|
|
width:'300',
|
|
|
|
|
title : '',
|
|
|
|
|
stateful : true,
|
|
|
|
|
stateId : 'grid',
|
|
|
|
|
enableColumnResize: true,
|
|
|
|
|
enableHdMenu: true,
|
|
|
|
|
frame:false,
|
|
|
|
|
cls : 'grid_with_checkbox',
|
|
|
|
|
columnLines: true,
|
|
|
|
|
|
|
|
|
|
viewConfig: {
|
|
|
|
|
forceFit:true
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cm: new Ext.grid.ColumnModel({
|
|
|
|
|
defaults: {
|
|
|
|
|
width: 200,
|
|
|
|
|
sortable: true
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false},
|
|
|
|
|
{header: _('ID_FIRSTNAME'), dataIndex: 'USR_FIRSTNAME', width: 300},
|
|
|
|
|
{header: _('ID_LASTNAME'), dataIndex: 'USR_LASTNAME', width: 300}
|
|
|
|
|
]
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
store: store,
|
|
|
|
|
|
|
|
|
|
tbar:[
|
|
|
|
|
{
|
|
|
|
|
text:_('ID_REASSIGN'),
|
|
|
|
|
iconCls: 'ICON_CASES_TO_REASSIGN',
|
|
|
|
|
handler: Actions.reassignCase
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
listeners: {
|
|
|
|
|
//rowdblclick: openCase,
|
|
|
|
|
render: function(){
|
|
|
|
|
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')});
|
|
|
|
|
this.ownerCt.doLayout();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var win = new Ext.Window({
|
|
|
|
|
title: '',
|
|
|
|
|
width: 450,
|
|
|
|
|
height: 280,
|
|
|
|
|
layout:'fit',
|
|
|
|
|
autoScroll:true,
|
|
|
|
|
modal: true,
|
|
|
|
|
maximizable: false,
|
|
|
|
|
items: [grid]
|
|
|
|
|
});
|
|
|
|
|
win.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.reassignCase = function()
|
|
|
|
|
{
|
|
|
|
|
var rowSelected = Ext.getCmp('reassignGrid').getSelectionModel().getSelected();
|
|
|
|
|
if( rowSelected ) {
|
|
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_REASSIGN_CONFIRM'), function(){
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'reassignCase', USR_UID: rowSelected.data.USR_UID},
|
2011-02-04 15:57:06 +00:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.status == 0 ) {
|
|
|
|
|
parent.notify('', data.msg);
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
} else {
|
|
|
|
|
alert(data.msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.setUnpauseCaseDate = function()
|
|
|
|
|
{
|
2011-04-04 15:15:27 -04:00
|
|
|
curDate = _ENV_CURRENT_DATE.split('-');
|
|
|
|
|
filterDate = curDate[0]+'-'+curDate[1]+'-';
|
|
|
|
|
nDay = '' + (parseInt(curDate[2])+1);
|
|
|
|
|
nDay = nDay.length == 1 ? '0' + nDay : nday;
|
|
|
|
|
filterDate += nDay;
|
|
|
|
|
|
2011-02-04 15:57:06 +00:00
|
|
|
var fieldset = {
|
|
|
|
|
xtype : 'fieldset',
|
|
|
|
|
autoHeight : true,
|
2011-04-04 15:15:27 -04:00
|
|
|
defaults : {
|
2011-02-04 15:57:06 +00:00
|
|
|
width : 170,
|
|
|
|
|
xtype:'label',
|
|
|
|
|
labelStyle : 'padding: 0px;',
|
|
|
|
|
style: 'font-weight: bold'
|
|
|
|
|
},
|
|
|
|
|
items : [
|
|
|
|
|
{fieldLabel: 'Case', text: parent._CASE_TITLE},
|
|
|
|
|
{fieldLabel: 'Pause Date', text: _ENV_CURRENT_DATE},
|
|
|
|
|
new Ext.form.DateField({
|
2011-04-04 15:15:27 -04:00
|
|
|
id: 'unpauseDate',
|
2011-02-04 15:57:06 +00:00
|
|
|
format: 'Y-m-d',
|
|
|
|
|
fieldLabel: 'Unpause Date',
|
|
|
|
|
name: 'unpauseDate',
|
2011-04-04 15:15:27 -04:00
|
|
|
allowBlank: false,
|
|
|
|
|
minValue: new Date(filterDate)
|
2011-02-04 15:57:06 +00:00
|
|
|
})
|
|
|
|
|
],
|
|
|
|
|
buttons : [
|
|
|
|
|
{
|
|
|
|
|
id: 'submitPauseCase',
|
2011-02-10 14:37:52 +00:00
|
|
|
text : _('ID_PAUSE_CASE'),
|
2011-02-04 15:57:06 +00:00
|
|
|
handler : Actions.pauseCase,
|
2011-02-09 21:21:33 +00:00
|
|
|
disabled:false
|
2011-02-04 15:57:06 +00:00
|
|
|
},{
|
|
|
|
|
text : 'Cancel',
|
|
|
|
|
handler : function() {
|
|
|
|
|
win.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var frm = new Ext.FormPanel( {
|
|
|
|
|
id: 'unpauseFrm',
|
|
|
|
|
labelAlign : 'right',
|
|
|
|
|
bodyStyle : 'padding:5px 5px 0',
|
|
|
|
|
width : 250,
|
|
|
|
|
items : [fieldset]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var win = new Ext.Window({
|
|
|
|
|
title: 'Pause Case',
|
|
|
|
|
width: 340,
|
|
|
|
|
height: 170,
|
|
|
|
|
layout:'fit',
|
|
|
|
|
autoScroll:true,
|
|
|
|
|
modal: true,
|
|
|
|
|
maximizable: false,
|
|
|
|
|
items: [frm]
|
|
|
|
|
});
|
|
|
|
|
win.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.pauseCase = function()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var unpauseDate = Ext.getCmp('unpauseDate').getValue();
|
|
|
|
|
if( unpauseDate == '') {
|
|
|
|
|
//Ext.getCmp('submitPauseCase').setDisabled(true);
|
|
|
|
|
return;
|
|
|
|
|
} else
|
|
|
|
|
//Ext.getCmp('submitPauseCase').enable();
|
|
|
|
|
|
|
|
|
|
unpauseDate = unpauseDate.format('Y-m-d');
|
|
|
|
|
|
|
|
|
|
Ext.getCmp('unpauseFrm').getForm().submit({
|
|
|
|
|
url:'ajaxListener?action=pauseCase&unpauseDate=' + unpauseDate,
|
|
|
|
|
waitMsg:'Pausing Case '+parent._CASE_TITLE+'...',
|
|
|
|
|
timeout : 36000,
|
|
|
|
|
success : function(res, req) {
|
|
|
|
|
if(req.result.success) {
|
|
|
|
|
parent.notify('PAUSE CASE', req.result.msg);
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
} else {
|
2011-02-09 21:21:33 +00:00
|
|
|
PMExt.error(_('ID_ERROR'), req.result.msg);
|
2011-02-04 15:57:06 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.unpauseCase = function()
|
|
|
|
|
{
|
2011-02-09 21:21:33 +00:00
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_UNPAUSE_CASE'), function(){
|
|
|
|
|
var loadMask = new Ext.LoadMask(document.body, {msg:'Unpausing case...'});
|
|
|
|
|
loadMask.show();
|
|
|
|
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'unpauseCase'},
|
2011-02-09 21:21:33 +00:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
loadMask.hide();
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.success ) {
|
|
|
|
|
parent.PMExt.notify(_('ID_UNPAUSE_ACTION'), data.msg);
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
} else {
|
|
|
|
|
PMExt.error(_('ID_ERROR'), data.msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2011-02-04 15:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.deleteCase = function()
|
|
|
|
|
{
|
|
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_DELETE_CASE'), function(){
|
2011-02-09 21:21:33 +00:00
|
|
|
var loadMask = new Ext.LoadMask(document.body, {msg:'Deleting case...'});
|
|
|
|
|
loadMask.show();
|
2011-02-04 15:57:06 +00:00
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'deleteCase'},
|
2011-02-04 15:57:06 +00:00
|
|
|
success: function ( result, request ) {
|
2011-02-09 21:21:33 +00:00
|
|
|
loadMask.hide();
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.success ) {
|
|
|
|
|
parent.PMExt.notify(_('ID_DELETE_ACTION'), data.msg);
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
} else {
|
|
|
|
|
PMExt.error(_('ID_ERROR'), data.msg);
|
|
|
|
|
}
|
2011-02-04 15:57:06 +00:00
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Actions.reactivateCase = function()
|
|
|
|
|
{
|
2011-02-09 21:21:33 +00:00
|
|
|
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_REACTIVATE_CASE'), function(){
|
|
|
|
|
var loadMask = new Ext.LoadMask(document.body, {msg:'Reactivating case...'});
|
|
|
|
|
loadMask.show();
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url : 'ajaxListener' ,
|
2011-02-24 20:34:14 +00:00
|
|
|
params : {action : 'reactivateCase'},
|
2011-02-09 21:21:33 +00:00
|
|
|
success: function ( result, request ) {
|
|
|
|
|
loadMask.hide();
|
|
|
|
|
var data = Ext.util.JSON.decode(result.responseText);
|
|
|
|
|
if( data.success ) {
|
|
|
|
|
parent.PMExt.notify(_('ID_REACTIVATE_ACTION'), data.msg);
|
|
|
|
|
location.href = 'casesListExtJs';
|
|
|
|
|
} else {
|
|
|
|
|
PMExt.error(_('ID_ERROR'), data.msg);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
failure: function ( result, request) {
|
|
|
|
|
Ext.MessageBox.alert('Failed', result.responseText);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2011-02-04 15:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
Actions.tabFrame = function(name)
|
|
|
|
|
{
|
|
|
|
|
tabId = name + 'MenuOption';
|
|
|
|
|
var uri = 'ajaxListener?action=' + name;
|
|
|
|
|
var TabPanel = Ext.getCmp('caseTabPanel');
|
|
|
|
|
var tab = TabPanel.getItem(tabId);
|
|
|
|
|
|
|
|
|
|
if( tab ) {
|
|
|
|
|
TabPanel.setActiveTab(tabId);
|
|
|
|
|
} else {
|
|
|
|
|
TabPanel.add({
|
|
|
|
|
id: tabId,
|
|
|
|
|
title: menuSelectedTitle[name],
|
|
|
|
|
frameConfig:{name: name + 'Frame', id: name + 'Frame'},
|
|
|
|
|
defaultSrc : uri,
|
|
|
|
|
loadMask:{msg:'Loading...'},
|
2011-04-08 19:11:30 -04:00
|
|
|
autoWidth: true,
|
|
|
|
|
closable:true,
|
|
|
|
|
autoScroll: true,
|
2011-04-11 09:40:01 -04:00
|
|
|
bodyStyle:{height: (PMExt.getBrowser().screen.height-60) + 'px', overflow:'auto'}
|
2011-02-04 15:57:06 +00:00
|
|
|
}).show();
|
|
|
|
|
|
|
|
|
|
TabPanel.doLayout();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2011-04-04 15:15:27 -04:00
|
|
|
/*Date.prototype.dateFormat = function(format) {
|
|
|
|
|
var result = "";
|
|
|
|
|
for (var i = 0; i < format.length; ++i) {
|
|
|
|
|
result += this.dateToString(format.charAt(i));
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2011-02-04 15:57:06 +00:00
|
|
|
|
2011-04-04 15:15:27 -04:00
|
|
|
Date.prototype.dateToString = function(character) {
|
|
|
|
|
switch (character) {
|
|
|
|
|
case "Y":
|
|
|
|
|
return this.getFullYear();
|
|
|
|
|
|
|
|
|
|
case "d":
|
|
|
|
|
return this.getDate();
|
|
|
|
|
|
|
|
|
|
case "m":
|
|
|
|
|
return this.getMonth();
|
|
|
|
|
// snip a bunch of lines
|
|
|
|
|
default:
|
|
|
|
|
return character;
|
|
|
|
|
}
|
2011-04-08 19:11:30 -04:00
|
|
|
}*/
|