BUG 9012 Hide Step List SOLVED

- The steps tree cannot be closed
- Added a close icon to the steps tree panel and the panel now can be open when click in the "Steps" button
This commit is contained in:
Julio Cesar Laura
2012-09-04 13:29:32 -04:00
parent ba1fab77dd
commit 77e05f7e84

View File

@@ -3,8 +3,7 @@ var showCaseNavigatorPanel;
var hideCaseNavigatorPanel; var hideCaseNavigatorPanel;
var informationMenu; var informationMenu;
var caseMenuOpen = false; var caseMenuOpen = false;
var toReviseTreeOpen = false; var menuSelectedTitle = [];
var menuSelectedTitle = Array();
var _ENV_CURRENT_DATE; var _ENV_CURRENT_DATE;
var winTree; var winTree;
@@ -23,69 +22,70 @@ ActionTabFrameGlobal.tabTitle = '';
ActionTabFrameGlobal.tabData = ''; ActionTabFrameGlobal.tabData = '';
Ext.onReady(function(){ Ext.onReady(function(){
openToRevisePanel = function() {
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();
}
}
});
if (typeof(winTree) == 'undefined') {
winTree = new Ext.Window({
id : 'toReviseWindow',
width : 220,
height : 300,
el : 'toReviseTree',
collapsible : true,
plain : true,
x : 100,
y : 100,
constrain : true,
items : [treeToRevise]
});
}
};
Ext.QuickTips.init(); Ext.QuickTips.init();
showCaseNavigatorPanel = function(app_status) { showCaseNavigatorPanel = function(app_status) {
if (typeof(treeToReviseTitle) != 'undefined') {
if (typeof(treeToReviseTitle) != 'undefined'){ openToRevisePanel();
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();
}
}
});
if (typeof(winTree) == 'undefined') {
winTree = new Ext.Window({
id : 'toReviseWindow',
width : 220,
height : 300,
el : 'toReviseTree',
collapsible : true,
plain : true,
x : 100,
y : 100,
closable : false,
constrain : true,
items : [treeToRevise]
});
}
if (!toReviseTreeOpen){
winTree.show(this);
toReviseTreeOpen = true;
}
} }
if( caseMenuOpen ) if (caseMenuOpen) {
return false; return false;
else }
else {
caseMenuOpen = true; caseMenuOpen = true;
}
//get the menu //get the menu
Ext.Ajax.request({ Ext.Ajax.request({
url : 'ajaxListener', url : 'ajaxListener',
params : {action : 'getCaseMenu', app_status:app_status}, params : {action : 'getCaseMenu', app_status:app_status},
success: function ( result, request ) { success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText); var data = Ext.util.JSON.decode(result.responseText);
for(i=0; i<data.length; i++) { for(i=0; i<data.length; i++) {
switch(data[i].id) { switch(data[i].id) {
case 'STEPS': case 'STEPS':
Ext.getCmp('casesStepTree').root.reload(); if (typeof(treeToReviseTitle) == 'undefined') {
Ext.getCmp('stepsMenu').enable(); Ext.getCmp('casesStepTree').root.reload();
}
Ext.getCmp('stepsMenu').enable();
break; break;
case 'NOTES': case 'NOTES':
Ext.getCmp('caseNotes').show(); Ext.getCmp('caseNotes').show();
@@ -137,10 +137,10 @@ Ext.onReady(function(){
tb.add(menu); tb.add(menu);
} }
} }
if (Ext.getCmp('stepsMenu').disabled === true) { if (Ext.getCmp('stepsMenu').disabled === true) {
Ext.getCmp('stepsMenu').hide(); Ext.getCmp('stepsMenu').hide();
} }
}, },
failure: function ( result, request) { failure: function ( result, request) {
Ext.MessageBox.alert('Failed', result.responseText); Ext.MessageBox.alert('Failed', result.responseText);
@@ -158,40 +158,55 @@ Ext.onReady(function(){
} }
function togglePreview(btn, pressed){ function togglePreview(btn, pressed){
var preview = Ext.getCmp('navPanelWest'); if (typeof(treeToReviseTitle) == 'undefined') {
preview[pressed ? 'show' : 'hide'](); var preview = Ext.getCmp('navPanelWest');
Ext.getCmp('navPanel').ownerCt.doLayout(); preview[pressed ? 'show' : 'hide']();
Ext.getCmp('navPanel').ownerCt.doLayout();
}
else {
if (winTree.isVisible()) {
winTree.hide();
}
else {
winTree.show();
}
}
} }
var casesStepTree = new Ext.tree.TreePanel({ if (typeof(treeToReviseTitle) == 'undefined') {
id: 'casesStepTree', var casesStepTree = new Ext.tree.TreePanel({
autoWidth: true, id: 'casesStepTree',
userArrows: true, autoWidth: true,
animate: true, userArrows: true,
autoScroll: true, animate: true,
dataUrl: 'ajaxListener?action=steps', autoScroll: true,
rootVisible: false, dataUrl: 'ajaxListener?action=steps',
containerScroll: true, rootVisible: false,
border: false, containerScroll: true,
root: { border: false,
nodeType: 'async' root: {
}, nodeType: 'async'
listeners: {
render: function() {
this.getRootNode().expand();
}, },
click: function(tp) {
if( tp.attributes.url ){
document.getElementById('openCaseFrame').src = tp.attributes.url;
}
}
}
})
var loader = casesStepTree.getLoader(); listeners: {
loader.on("load", setNodeini); render: function() {
this.getRootNode().expand();
},
click: function(tp) {
if( tp.attributes.url ){
document.getElementById('openCaseFrame').src = tp.attributes.url;
}
}
}
})
var loader = casesStepTree.getLoader();
loader.on("load", setNodeini);
}
else {
var casesStepTree = {};
}
function setNodeini() function setNodeini()
{ {
setNode(idfirstform); setNode(idfirstform);
@@ -508,7 +523,7 @@ Ext.onReady(function(){
var noteReasonTxt = ''; var noteReasonTxt = '';
} }
var notifyReasonVal = Ext.getCmp('notifyReason').getValue() == true ? 1 : 0; var notifyReasonVal = Ext.getCmp('notifyReason').getValue() == true ? 1 : 0;
Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} }); Ext.MessageBox.show({ msg: _('ID_PROCESSING'), wait:true,waitConfig: {interval:200} });
Ext.Ajax.request({ Ext.Ajax.request({
url : 'ajaxListener' , url : 'ajaxListener' ,
@@ -660,7 +675,7 @@ Ext.onReady(function(){
//autoHeight : true, //autoHeight : true,
defaults : { defaults : {
width : 170, width : 170,
xtype:'label', xtype:'label',
labelStyle : 'padding: 0px;', labelStyle : 'padding: 0px;',
style: 'font-weight: bold' style: 'font-weight: bold'
}, },
@@ -855,7 +870,7 @@ Ext.onReady(function(){
// //
Actions.tabFrame = function(name) Actions.tabFrame = function(name)
{ {
tabId = name + 'MenuOption'; tabId = name + 'MenuOption';
var uri = 'ajaxListener?action=' + name; var uri = 'ajaxListener?action=' + name;
var TabPanel = Ext.getCmp('caseTabPanel'); var TabPanel = Ext.getCmp('caseTabPanel');
@@ -879,47 +894,47 @@ Ext.onReady(function(){
var uri = 'ajaxListener?action=' + name; var uri = 'ajaxListener?action=' + name;
if (name.indexOf("changeLogTab") != -1) { if (name.indexOf("changeLogTab") != -1) {
var uri = 'ajaxListener?action=' + 'changeLogTab'; var uri = 'ajaxListener?action=' + 'changeLogTab';
//!historyGridListChangeLogGlobal //!historyGridListChangeLogGlobal
historyGridListChangeLogGlobal.idHistory = historyGridListChangeLogGlobal.idHistory; historyGridListChangeLogGlobal.idHistory = historyGridListChangeLogGlobal.idHistory;
historyGridListChangeLogGlobal.tasTitle = historyGridListChangeLogGlobal.tasTitle; historyGridListChangeLogGlobal.tasTitle = historyGridListChangeLogGlobal.tasTitle;
//dataSystem //dataSystem
idHistory = historyGridListChangeLogGlobal.idHistory; idHistory = historyGridListChangeLogGlobal.idHistory;
var tasTitle = historyGridListChangeLogGlobal.tasTitle; var tasTitle = historyGridListChangeLogGlobal.tasTitle;
menuSelectedTitle[name] = tasTitle; menuSelectedTitle[name] = tasTitle;
Actions[name]; Actions[name];
uri += "&idHistory="+idHistory; uri += "&idHistory="+idHistory;
} }
if (name.indexOf("dynaformViewFromHistory") != -1) { if (name.indexOf("dynaformViewFromHistory") != -1) {
var uri = 'ajaxListener?action=' + 'dynaformViewFromHistory'; var uri = 'ajaxListener?action=' + 'dynaformViewFromHistory';
uri += '&DYN_UID='+historyGridListChangeLogGlobal.viewIdDin+'&HISTORY_ID='+historyGridListChangeLogGlobal.viewIdHistory; uri += '&DYN_UID='+historyGridListChangeLogGlobal.viewIdDin+'&HISTORY_ID='+historyGridListChangeLogGlobal.viewIdHistory;
menuSelectedTitle[name] = 'View('+dynTitle+' '+historyGridListChangeLogGlobal.dynDate+')'; menuSelectedTitle[name] = 'View('+dynTitle+' '+historyGridListChangeLogGlobal.dynDate+')';
} }
if (name.indexOf("previewMessage") != -1) { if (name.indexOf("previewMessage") != -1) {
var uri = 'caseMessageHistory_Ajax?actionAjax=' + 'showHistoryMessage'; var uri = 'caseMessageHistory_Ajax?actionAjax=' + 'showHistoryMessage';
var tabNameArray = tabName.split('_'); var tabNameArray = tabName.split('_');
var APP_UID = tabNameArray[1]; var APP_UID = tabNameArray[1];
var APP_MSG_UID = tabNameArray[2]; var APP_MSG_UID = tabNameArray[2];
uri += '&APP_UID='+APP_UID+'&APP_MSG_UID='+APP_MSG_UID; uri += '&APP_UID='+APP_UID+'&APP_MSG_UID='+APP_MSG_UID;
menuSelectedTitle[tabName] = tabTitle; menuSelectedTitle[tabName] = tabTitle;
} }
if (name.indexOf("previewMessage") != -1) { if (name.indexOf("previewMessage") != -1) {
var uri = 'caseMessageHistory_Ajax?actionAjax=' + 'showHistoryMessage'; var uri = 'caseMessageHistory_Ajax?actionAjax=' + 'showHistoryMessage';
var tabNameArray = tabName.split('_'); var tabNameArray = tabName.split('_');
var APP_UID = tabNameArray[1]; var APP_UID = tabNameArray[1];
var APP_MSG_UID = tabNameArray[2]; var APP_MSG_UID = tabNameArray[2];
uri += '&APP_UID='+APP_UID+'&APP_MSG_UID='+APP_MSG_UID; uri += '&APP_UID='+APP_UID+'&APP_MSG_UID='+APP_MSG_UID;
menuSelectedTitle[tabName] = tabTitle; menuSelectedTitle[tabName] = tabTitle;
} }
if (name.indexOf("sendMailMessage") != -1) { if (name.indexOf("sendMailMessage") != -1) {
var uri = 'caseMessageHistory_Ajax?actionAjax=' + 'sendMailMessage_JXP'; var uri = 'caseMessageHistory_Ajax?actionAjax=' + 'sendMailMessage_JXP';
var tabNameArray = tabName.split('_'); var tabNameArray = tabName.split('_');
var APP_UID = tabNameArray[1]; var APP_UID = tabNameArray[1];
var APP_MSG_UID = tabNameArray[2]; var APP_MSG_UID = tabNameArray[2];
uri += '&APP_UID='+APP_UID+'&APP_MSG_UID='+APP_MSG_UID; uri += '&APP_UID='+APP_UID+'&APP_MSG_UID='+APP_MSG_UID;
menuSelectedTitle[tabName] = tabTitle; menuSelectedTitle[tabName] = tabTitle;
} }
@@ -930,18 +945,18 @@ Ext.onReady(function(){
if (name.indexOf("historyDynaformGridHistory") != -1) { if (name.indexOf("historyDynaformGridHistory") != -1) {
var historyDynaformGridHistoryGlobal = Ext.util.JSON.decode(ActionTabFrameGlobal.tabData); var historyDynaformGridHistoryGlobal = Ext.util.JSON.decode(ActionTabFrameGlobal.tabData);
var tabTitle = ActionTabFrameGlobal.tabTitle; var tabTitle = ActionTabFrameGlobal.tabTitle;
var PRO_UID = historyDynaformGridHistoryGlobal.PRO_UID; var PRO_UID = historyDynaformGridHistoryGlobal.PRO_UID;
var APP_UID = historyDynaformGridHistoryGlobal.APP_UID; var APP_UID = historyDynaformGridHistoryGlobal.APP_UID;
var TAS_UID = historyDynaformGridHistoryGlobal.TAS_UID; var TAS_UID = historyDynaformGridHistoryGlobal.TAS_UID;
var DYN_UID = historyDynaformGridHistoryGlobal.DYN_UID; var DYN_UID = historyDynaformGridHistoryGlobal.DYN_UID;
var DYN_TITLE = historyDynaformGridHistoryGlobal.DYN_TITLE; var DYN_TITLE = historyDynaformGridHistoryGlobal.DYN_TITLE;
var uri = 'casesHistoryDynaformPage_Ajax?actionAjax=showDynaformListHistory'; var uri = 'casesHistoryDynaformPage_Ajax?actionAjax=showDynaformListHistory';
uri += '&PRO_UID='+PRO_UID+'&APP_UID='+APP_UID+'&TAS_UID='+TAS_UID+'&DYN_UID='+DYN_UID; uri += '&PRO_UID='+PRO_UID+'&APP_UID='+APP_UID+'&TAS_UID='+TAS_UID+'&DYN_UID='+DYN_UID;
menuSelectedTitle[name] = tabTitle; menuSelectedTitle[name] = tabTitle;
} }
if (name.indexOf("dynaformChangeLogViewHistory") != -1) { if (name.indexOf("dynaformChangeLogViewHistory") != -1) {
var showDynaformHistoryGlobal = Ext.util.JSON.decode(ActionTabFrameGlobal.tabData); var showDynaformHistoryGlobal = Ext.util.JSON.decode(ActionTabFrameGlobal.tabData);
var tabTitle = ActionTabFrameGlobal.tabTitle; var tabTitle = ActionTabFrameGlobal.tabTitle;
var dynUID = showDynaformHistoryGlobal.dynUID; var dynUID = showDynaformHistoryGlobal.dynUID;
@@ -977,7 +992,7 @@ Ext.onReady(function(){
if( tab ) { if( tab ) {
TabPanel.setActiveTab(tabId); TabPanel.setActiveTab(tabId);
} }
else { else {
TabPanel.add({ TabPanel.add({
id: tabId, id: tabId,
@@ -1057,8 +1072,8 @@ Ext.onReady(function(){
store: store, store: store,
tbar:[ tbar:[
{ {
text:_('ID_ASSIGN'), text:_('ID_ASSIGN'),
iconCls: 'silk-add', iconCls: 'silk-add',
icon: '/images/cases-selfservice.png', icon: '/images/cases-selfservice.png',
handler: assignAdHocUser handler: assignAdHocUser
} }
@@ -1096,7 +1111,7 @@ Ext.onReady(function(){
if( data.success ) { if( data.success ) {
CloseWindow(); CloseWindow();
location.href = 'casesListExtJs'; location.href = 'casesListExtJs';
} }
else { else {
PMExt.error(_('ID_ERROR'), data.msg); PMExt.error(_('ID_ERROR'), data.msg);
} }
@@ -1125,6 +1140,6 @@ Ext.onReady(function(){
if (!node) { if (!node) {
return false; return false;
} }
node.select(); node.select();
} }