Start Case Button
This commit is contained in:
@@ -79,6 +79,7 @@ function getProcessList() {
|
|||||||
$processInfoChild ['myInbox']=0;
|
$processInfoChild ['myInbox']=0;
|
||||||
$processInfoChild ['totalInbox']=0;
|
$processInfoChild ['totalInbox']=0;
|
||||||
$tempTreeChild ['otherAttributes'] = array_merge($processInfoChild,$oProcess->load ( $processInfoChild ['pro_uid'] ),$calendar->getCalendarFor ( $processInfoChild ['uid'], $processInfoChild ['uid'], $processInfoChild ['uid'] ));
|
$tempTreeChild ['otherAttributes'] = array_merge($processInfoChild,$oProcess->load ( $processInfoChild ['pro_uid'] ),$calendar->getCalendarFor ( $processInfoChild ['uid'], $processInfoChild ['uid'], $processInfoChild ['uid'] ));
|
||||||
|
$tempTreeChild ['otherAttributes']['PRO_TAS_TITLE']=str_replace(")","",str_replace("(","",trim(str_replace($tempTreeChild ['otherAttributes']['PRO_TITLE'],"",$tempTreeChild ['otherAttributes']["value"]))));
|
||||||
$tempTreeChild ['qtip']=$tempTreeChild ['otherAttributes']['PRO_DESCRIPTION'];
|
$tempTreeChild ['qtip']=$tempTreeChild ['otherAttributes']['PRO_DESCRIPTION'];
|
||||||
|
|
||||||
//$tempTree['cls']='file';
|
//$tempTree['cls']='file';
|
||||||
@@ -106,6 +107,7 @@ function getProcessList() {
|
|||||||
$processInfo ['myInbox']=0;
|
$processInfo ['myInbox']=0;
|
||||||
$processInfo ['totalInbox']=0;
|
$processInfo ['totalInbox']=0;
|
||||||
$tempTree ['otherAttributes'] = array_merge($processInfo,$oProcess->load ( $processInfo ['pro_uid'] ),$calendar->getCalendarFor ( $processInfo ['uid'], $processInfo ['uid'], $processInfo ['uid'] ));
|
$tempTree ['otherAttributes'] = array_merge($processInfo,$oProcess->load ( $processInfo ['pro_uid'] ),$calendar->getCalendarFor ( $processInfo ['uid'], $processInfo ['uid'], $processInfo ['uid'] ));
|
||||||
|
$tempTree ['otherAttributes']['PRO_TAS_TITLE']=str_replace(")","",str_replace("(","",trim(str_replace($tempTree ['otherAttributes']['PRO_TITLE'],"",$tempTree ['otherAttributes']["value"]))));
|
||||||
$tempTree ['qtip']=$tempTree ['otherAttributes']['PRO_DESCRIPTION'];
|
$tempTree ['qtip']=$tempTree ['otherAttributes']['PRO_DESCRIPTION'];
|
||||||
//$tempTree['cls']='file';
|
//$tempTree['cls']='file';
|
||||||
$processListTree [] = $tempTree;
|
$processListTree [] = $tempTree;
|
||||||
|
|||||||
@@ -113,60 +113,9 @@ var newCaseTree = {
|
|||||||
}),
|
}),
|
||||||
listeners : {
|
listeners : {
|
||||||
dblclick : function(n) {
|
dblclick : function(n) {
|
||||||
if (n.attributes.optionType == "startProcess") {
|
mainPanel.openCase(n);
|
||||||
Ext.Msg.show({
|
|
||||||
title : 'Start Case',
|
|
||||||
msg : 'Starting new case<br><br><b>' + n.attributes.text
|
|
||||||
+ '</b>',
|
|
||||||
icon : Ext.MessageBox.INFO,
|
|
||||||
// width:300,
|
|
||||||
wait:true,
|
|
||||||
waitConfig: {interval:500}
|
|
||||||
});
|
|
||||||
Ext.Ajax.request({
|
|
||||||
url : 'casesStartPage_Ajax.php',
|
|
||||||
params : {
|
|
||||||
action : 'startCase',
|
|
||||||
processId : n.attributes.pro_uid,
|
|
||||||
taskId : n.attributes.tas_uid
|
|
||||||
},
|
|
||||||
success : function(response) {
|
|
||||||
|
|
||||||
try{
|
|
||||||
var res = Ext.util.JSON.decode(response.responseText);
|
|
||||||
|
|
||||||
if (res.openCase) {
|
|
||||||
window.location = res.openCase.PAGE;
|
|
||||||
} else {
|
|
||||||
Ext.Msg.show({
|
|
||||||
title : 'Error creating a new Case',
|
|
||||||
msg : '<textarea cols="50" rows="10">'
|
|
||||||
+ res.message + '</textarea>',
|
|
||||||
icon : Ext.MessageBox.ERROR,
|
|
||||||
buttons : Ext.Msg.OK
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch(e) {
|
|
||||||
Ext.Msg.show({
|
|
||||||
title : 'Error creating a new Case',
|
|
||||||
msg : 'JSON Decode Error:<br /><textarea cols="50" rows="2">'
|
|
||||||
+ e.message + '</textarea><br />Server Response<br /><textarea cols="50" rows="5">'+response.responseText+'</textarea>',
|
|
||||||
icon : Ext.MessageBox.ERROR,
|
|
||||||
buttons : Ext.Msg.OK
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
failure : function() {
|
|
||||||
// grid.getGridEl().unmask(true);
|
|
||||||
Ext.Msg.alert('Error', 'Unable to start a case');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
click : function(n) {
|
click : function(n) {
|
||||||
mainPanel.showDetails(n);
|
mainPanel.showDetails(n);
|
||||||
@@ -222,14 +171,47 @@ var startCaseTab = {
|
|||||||
// disabled: true,
|
// disabled: true,
|
||||||
// readonly:true,
|
// readonly:true,
|
||||||
id:"processName"
|
id:"processName"
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
|
xtype: 'compositefield',
|
||||||
|
|
||||||
|
items: [
|
||||||
|
|
||||||
|
{
|
||||||
|
xtype : 'displayfield',
|
||||||
|
|
||||||
fieldLabel: 'Task',
|
fieldLabel: 'Task',
|
||||||
name: 'taskName',
|
name: 'taskName',
|
||||||
allowBlank:false,
|
allowBlank:false,
|
||||||
value: '',
|
value: '',
|
||||||
|
width:200,
|
||||||
// disabled: true,
|
// disabled: true,
|
||||||
id:"taskName"
|
id:"taskName"
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
|
xtype : 'button',
|
||||||
|
id : 'starCaseButton',
|
||||||
|
disabled : true,
|
||||||
|
//cls : 'x-btn-icon',
|
||||||
|
//icon : '/images/refresh.gif',
|
||||||
|
iconCls: "ICON_CASES_START_CASE",
|
||||||
|
text:"Start Case",
|
||||||
|
//margins:"5 5 5 5",
|
||||||
|
autoWidth:true,
|
||||||
|
handler : function() {
|
||||||
|
tree = Ext.getCmp('startCaseTreePanel');
|
||||||
|
var selectedNode = tree.getSelectionModel().getSelectedNode();
|
||||||
|
if(selectedNode){
|
||||||
|
mainPanel.openCase(selectedNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
xtype:'textarea',
|
xtype:'textarea',
|
||||||
fieldLabel: 'Description',
|
fieldLabel: 'Description',
|
||||||
name: 'processDescription',
|
name: 'processDescription',
|
||||||
@@ -1883,6 +1865,62 @@ Ext
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
openCase : function(n){
|
||||||
|
if (n.attributes.optionType == "startProcess") {
|
||||||
|
Ext.Msg.show({
|
||||||
|
title : 'Start Case',
|
||||||
|
msg : 'Starting new case<br><br><b>' + n.attributes.text
|
||||||
|
+ '</b>',
|
||||||
|
icon : Ext.MessageBox.INFO,
|
||||||
|
// width:300,
|
||||||
|
wait:true,
|
||||||
|
waitConfig: {interval:500}
|
||||||
|
});
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url : 'casesStartPage_Ajax.php',
|
||||||
|
params : {
|
||||||
|
action : 'startCase',
|
||||||
|
processId : n.attributes.pro_uid,
|
||||||
|
taskId : n.attributes.tas_uid
|
||||||
|
},
|
||||||
|
success : function(response) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
var res = Ext.util.JSON.decode(response.responseText);
|
||||||
|
|
||||||
|
if (res.openCase) {
|
||||||
|
window.location = res.openCase.PAGE;
|
||||||
|
} else {
|
||||||
|
Ext.Msg.show({
|
||||||
|
title : 'Error creating a new Case',
|
||||||
|
msg : '<textarea cols="50" rows="10">'
|
||||||
|
+ res.message + '</textarea>',
|
||||||
|
icon : Ext.MessageBox.ERROR,
|
||||||
|
buttons : Ext.Msg.OK
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
Ext.Msg.show({
|
||||||
|
title : 'Error creating a new Case',
|
||||||
|
msg : 'JSON Decode Error:<br /><textarea cols="50" rows="2">'
|
||||||
|
+ e.message + '</textarea><br />Server Response<br /><textarea cols="50" rows="5">'+response.responseText+'</textarea>',
|
||||||
|
icon : Ext.MessageBox.ERROR,
|
||||||
|
buttons : Ext.Msg.OK
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
failure : function() {
|
||||||
|
// grid.getGridEl().unmask(true);
|
||||||
|
Ext.Msg.alert('Error', 'Unable to start a case');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
showDetails : function(selectedNode) {
|
showDetails : function(selectedNode) {
|
||||||
|
|
||||||
@@ -1898,9 +1936,11 @@ Ext
|
|||||||
calendarObj[calendarDays[i]]=true;
|
calendarObj[calendarDays[i]]=true;
|
||||||
}
|
}
|
||||||
// console.log(otherAttributes);
|
// console.log(otherAttributes);
|
||||||
|
//starCaseButton
|
||||||
|
Ext.ComponentMgr.get("starCaseButton").enable();
|
||||||
Ext.getCmp('process-detail-panel').getForm().setValues({
|
Ext.getCmp('process-detail-panel').getForm().setValues({
|
||||||
processName : otherAttributes.PRO_TITLE,
|
processName : otherAttributes.PRO_TITLE,
|
||||||
taskName : selectedNode.attributes.text,
|
taskName : otherAttributes.PRO_TAS_TITLE,
|
||||||
calendarName : otherAttributes.CALENDAR_NAME,
|
calendarName : otherAttributes.CALENDAR_NAME,
|
||||||
calendarDescription : otherAttributes.CALENDAR_DESCRIPTION,
|
calendarDescription : otherAttributes.CALENDAR_DESCRIPTION,
|
||||||
processCalendar:otherAttributes.CALENDAR_NAME+" "+otherAttributes.CALENDAR_DESCRIPTION,
|
processCalendar:otherAttributes.CALENDAR_NAME+" "+otherAttributes.CALENDAR_DESCRIPTION,
|
||||||
@@ -1919,9 +1959,10 @@ Ext
|
|||||||
|
|
||||||
// this.detailsTemplate.overwrite(detailEl, data);
|
// this.detailsTemplate.overwrite(detailEl, data);
|
||||||
// detailEl.slideIn('t', {stopFx:true,duration:.0});
|
// detailEl.slideIn('t', {stopFx:true,duration:.0});
|
||||||
|
/*
|
||||||
detailEl.highlight('#c3daf9', {
|
detailEl.highlight('#c3daf9', {
|
||||||
block : true
|
block : true
|
||||||
});
|
});*/
|
||||||
} else {
|
} else {
|
||||||
detailEl.update('');
|
detailEl.update('');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user