diff --git a/workflow/engine/menus/cases.php b/workflow/engine/menus/cases.php index 9287eb7e1..72a8c5606 100644 --- a/workflow/engine/menus/cases.php +++ b/workflow/engine/menus/cases.php @@ -22,58 +22,61 @@ * Coral Gables, FL, 33134, USA, or email info@colosa.com. * */ - global $RBAC; - global $G_TMP_MENU; - - $G_TMP_MENU->AddIdRawOption('FOLDERS', '', G::LoadTranslation('ID_CASES_MENU_FOLDERS'), '', '', 'blockHeader'); - $G_TMP_MENU->AddIdRawOption('CASES_START_CASE', 'casesStartPage?action=startCase', G::LoadTranslation('ID_NEW_CASE'), '' ); - $G_TMP_MENU->AddIdRawOption('CASES_INBOX', 'casesListExtJs?action=todo', G::LoadTranslation('ID_INBOX'), 'icon-cases-inbox.png' ); - $G_TMP_MENU->AddIdRawOption('CASES_DRAFT', 'casesListExtJs?action=draft', G::LoadTranslation('ID_DRAFT'), 'mail-mark-task.png' ); - $G_TMP_MENU->AddIdRawOption('CASES_SENT', 'casesListExtJs?action=sent', G::LoadTranslation('ID_SENT'), 'icon-cases-outbox.png'); - $G_TMP_MENU->AddIdRawOption('CASES_SELFSERVICE', 'casesListExtJs?action=selfservice',G::LoadTranslation('ID_UNASSIGNED'), 'rotate_cw.png' ); - $G_TMP_MENU->AddIdRawOption('CASES_PAUSED', 'casesListExtJs?action=paused', G::LoadTranslation('ID_PAUSED'), 'mail-queue.png' ); - //$G_TMP_MENU->AddIdRawOption('CASES_CANCELLED', 'casesListExtJs?action=cancelled', G::LoadTranslation('ID_CANCELLED'), 'edit-clear-list.png' ); - //$G_TMP_MENU->AddIdRawOption('CASES_FOLDERS1', '../appFolder/appFolderList', G::LoadTranslation('ID_FOLDERS'), 'folderV2.gif' ); - - if ( $RBAC->userCanAccess('PM_ALLCASES') == 1 ) { - //$G_TMP_MENU->AddIdRawOption('CASES_GRAL', 'casesListExtJs?action=gral', G::LoadTranslation('ID_GENERAL')); - } - - $G_TMP_MENU->AddIdRawOption('SEARCHS', '', G::LoadTranslation('ID_CASES_MENU_SEARCH'), '', '', 'blockHeader'); +global $RBAC; +global $G_TMP_MENU; - if ( $RBAC->userCanAccess('PM_ALLCASES') == 1 ) { - $G_TMP_MENU->AddIdRawOption('CASES_SEARCH', 'casesListExtJs?action=search', G::LoadTranslation('ID_ADVANCEDSEARCH'), 'system-search.png' ); - } +$G_TMP_MENU->AddIdRawOption('FOLDERS', '', G::LoadTranslation('ID_CASES_MENU_FOLDERS'), '', '', 'blockHeader'); +$G_TMP_MENU->AddIdRawOption('CASES_START_CASE', 'casesStartPage?action=startCase', G::LoadTranslation('ID_NEW_CASE'), '' ); +$G_TMP_MENU->AddIdRawOption('CASES_INBOX', 'casesListExtJs?action=todo', G::LoadTranslation('ID_INBOX'), 'icon-cases-inbox.png' ); +$G_TMP_MENU->AddIdRawOption('CASES_DRAFT', 'casesListExtJs?action=draft', G::LoadTranslation('ID_DRAFT'), 'mail-mark-task.png' ); +$G_TMP_MENU->AddIdRawOption('CASES_SENT', 'casesListExtJs?action=sent', G::LoadTranslation('ID_SENT'), 'icon-cases-outbox.png'); +$G_TMP_MENU->AddIdRawOption('CASES_SELFSERVICE', 'casesListExtJs?action=selfservice',G::LoadTranslation('ID_UNASSIGNED'), 'rotate_cw.png' ); +$G_TMP_MENU->AddIdRawOption('CASES_PAUSED', 'casesListExtJs?action=paused', G::LoadTranslation('ID_PAUSED'), 'mail-queue.png' ); +//$G_TMP_MENU->AddIdRawOption('CASES_CANCELLED', 'casesListExtJs?action=cancelled', G::LoadTranslation('ID_CANCELLED'), 'edit-clear-list.png' ); +//$G_TMP_MENU->AddIdRawOption('CASES_FOLDERS1', '../appFolder/appFolderList', G::LoadTranslation('ID_FOLDERS'), 'folderV2.gif' ); - $G_TMP_MENU->AddIdRawOption('ADMIN', '', G::LoadTranslation('ID_CASES_MENU_ADMIN'), '', '', 'blockHeader'); - if ( $RBAC->userCanAccess('PM_SUPERVISOR') == 1 ) { - //$G_TMP_MENU->AddIdRawOption('CASES_TO_REVISE_NORMAL', 'cases_List?l=to_revise', G::LoadTranslation('ID_TO_REVISE'), 'document-review.png' ); - $G_TMP_MENU->AddIdRawOption('CASES_TO_REVISE', 'casesListExtJs?action=to_revise', G::LoadTranslation('ID_TO_REVISE'), 'document-review.png' ); - //$G_TMP_MENU->AddIdRawOption('CASES_SCHEDULER', 'cases_Scheduler_List', G::LoadTranslation('ID_SCHEDULER_LIST' )); - //$G_TMP_MENU->AddIdRawOption('CASES_SCHEDULER_LOG', 'cases_Scheduler_Log', G::LoadTranslation('ID_SCHEDULER_LOG' )); - } - - if ( $RBAC->userCanAccess('PM_REASSIGNCASE') == 1 ) { - //$G_TMP_MENU->AddIdRawOption('CASES_TO_REASSIGN_NORMAL', 'cases_List?l=to_reassign', G::LoadTranslation('ID_TO_REASSIGN'), 'reassing.png' ); - $G_TMP_MENU->AddIdRawOption('CASES_TO_REASSIGN', 'casesListExtJs?action=to_reassign', G::LoadTranslation('ID_TO_REASSIGN'), 'reassing.png' ); - } +if ( $RBAC->userCanAccess('PM_ALLCASES') == 1 ) { + //$G_TMP_MENU->AddIdRawOption('CASES_GRAL', 'casesListExtJs?action=gral', G::LoadTranslation('ID_GENERAL')); +} - $G_TMP_MENU->AddIdRawOption('CASES_FOLDERS', 'casesStartPage?action=documents', G::LoadTranslation('ID_FOLDERS'), 'folderV2.gif','','blockHeaderNoChild' ); +$G_TMP_MENU->AddIdRawOption('SEARCHS', '', G::LoadTranslation('ID_CASES_MENU_SEARCH'), '', '', 'blockHeader'); + +if ( $RBAC->userCanAccess('PM_ALLCASES') == 1 ) { + $G_TMP_MENU->AddIdRawOption('CASES_SEARCH', 'casesListExtJs?action=search', G::LoadTranslation('ID_ADVANCEDSEARCH'), 'system-search.png' ); +} + +$G_TMP_MENU->AddIdRawOption('ADMIN', '', G::LoadTranslation('ID_CASES_MENU_ADMIN'), '', '', 'blockHeader'); +if ( $RBAC->userCanAccess('PM_SUPERVISOR') == 1 ) { + //$G_TMP_MENU->AddIdRawOption('CASES_TO_REVISE_NORMAL', 'cases_List?l=to_revise', G::LoadTranslation('ID_TO_REVISE'), 'document-review.png' ); + $G_TMP_MENU->AddIdRawOption('CASES_TO_REVISE', 'casesListExtJs?action=to_revise', G::LoadTranslation('ID_TO_REVISE'), 'document-review.png' ); + //$G_TMP_MENU->AddIdRawOption('CASES_SCHEDULER', 'cases_Scheduler_List', G::LoadTranslation('ID_SCHEDULER_LIST' )); + //$G_TMP_MENU->AddIdRawOption('CASES_SCHEDULER_LOG', 'cases_Scheduler_Log', G::LoadTranslation('ID_SCHEDULER_LOG' )); +} + +if ( $RBAC->userCanAccess('PM_REASSIGNCASE') == 1 ) { + //$G_TMP_MENU->AddIdRawOption('CASES_TO_REASSIGN_NORMAL', 'cases_List?l=to_reassign', G::LoadTranslation('ID_TO_REASSIGN'), 'reassing.png' ); + $G_TMP_MENU->AddIdRawOption('CASES_TO_REASSIGN', 'casesListExtJs?action=to_reassign', G::LoadTranslation('ID_TO_REASSIGN'), 'reassing.png' ); +} + +$G_TMP_MENU->AddIdRawOption('CASES_FOLDERS', 'casesStartPage?action=documents', G::LoadTranslation('ID_FOLDERS'), 'folderV2.gif','','blockHeaderNoChild' ); + + + +//$G_TMP_MENU->AddIdRawOption('CASES_START_PAGE', 'casesStartPage?action=mainDashboard', ucwords(strtolower(G::LoadTranslation('ID_DASHBOARD'))), '' ); + +//Load Other registered Dashboards (From plugins) +$oPluginRegistry = & PMPluginRegistry::getSingleton (); +$dashBoardPages = $oPluginRegistry->getDashboardPages (); +if(count($dashBoardPages)>0){ $G_TMP_MENU->AddIdRawOption('PLUGINS', '', G::LoadTranslation('ID_PLUGINS'), '', '', 'blockHeader'); - - - //$G_TMP_MENU->AddIdRawOption('CASES_START_PAGE', 'casesStartPage?action=mainDashboard', ucwords(strtolower(G::LoadTranslation('ID_DASHBOARD'))), '' ); - - //Load Other registered Dashboards (From plugins) - $oPluginRegistry = & PMPluginRegistry::getSingleton (); - $dashBoardPages = $oPluginRegistry->getDashboardPages (); foreach($dashBoardPages as $key => $tabInfo) { $tabNameSpace=$tabInfo->sNamespace; $tabName=$tabInfo->sName; - $tabIcon=str_replace("ICON_","",$tabInfo->sIcon); + $tabIcon=str_replace("ICON_","",$tabInfo->sIcon); if ( $tabName!= "" ) { $G_TMP_MENU->AddIdRawOption($tabIcon, 'casesStartPage?action='.$tabNameSpace.'-'.$tabName, ucwords(strtolower($tabName)), '' ); - } + } } +} diff --git a/workflow/engine/methods/cases/casesStartPage.php b/workflow/engine/methods/cases/casesStartPage.php index 0cf76c835..6505e5d0f 100644 --- a/workflow/engine/methods/cases/casesStartPage.php +++ b/workflow/engine/methods/cases/casesStartPage.php @@ -1,19 +1,43 @@ setExtSkin( 'xtheme-gray'); //$oHeadPublisher->usingExtJs('ux/TabCloseMenu'); + - $oHeadPublisher->usingExtJs('ux.treefilterx/Ext.ux.tree.TreeFilterX'); - $oHeadPublisher->usingExtJs('ux.locationbar/Ext.ux.LocationBar'); - $oHeadPublisher->usingExtJs('ux.statusbar/ext-statusbar'); //$oHeadPublisher->usingExtJs('ux/ColumnHeaderGroup'); - $oHeadPublisher->addExtJsScript('cases/casesStartPage', false); //adding a javascript file .js - $oHeadPublisher->addContent( 'cases/casesStartPage'); //adding a html file .html. + switch($page){ + case "startCase": + $oHeadPublisher->usingExtJs('ux.treefilterx/Ext.ux.tree.TreeFilterX'); + $oHeadPublisher->addExtJsScript('cases/casesStartCase', false); //adding a javascript file .js + $oHeadPublisher->addContent( 'cases/casesStartCase'); //adding a html file .html. + break; + case "documents": + $oHeadPublisher->usingExtJs('ux.locationbar/Ext.ux.LocationBar'); + $oHeadPublisher->usingExtJs('ux.statusbar/ext-statusbar'); + $oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js + $oHeadPublisher->addContent( 'cases/casesDocuments'); //adding a html file .html. + break; + default: + + $oHeadPublisher->usingExtJs('ux.treefilterx/Ext.ux.tree.TreeFilterX'); + + $oHeadPublisher->usingExtJs('ux.locationbar/Ext.ux.LocationBar'); + $oHeadPublisher->usingExtJs('ux.statusbar/ext-statusbar'); + $oHeadPublisher->addExtJsScript('cases/casesStartPage', false); //adding a javascript file .js + $oHeadPublisher->addContent( 'cases/casesStartPage'); //adding a html file .html. + break; + + } + G::RenderPage('publish', 'extJs'); \ No newline at end of file diff --git a/workflow/engine/templates/cases/casesDocuments.html b/workflow/engine/templates/cases/casesDocuments.html new file mode 100644 index 000000000..c7a056eb9 --- /dev/null +++ b/workflow/engine/templates/cases/casesDocuments.html @@ -0,0 +1,2 @@ +
+ diff --git a/workflow/engine/templates/cases/casesDocuments.js b/workflow/engine/templates/cases/casesDocuments.js new file mode 100644 index 000000000..210ef3ba2 --- /dev/null +++ b/workflow/engine/templates/cases/casesDocuments.js @@ -0,0 +1,1498 @@ +//Ext.BLANK_IMAGE_URL = 'resources/s.gif'; + +Ext.chart.Chart.CHART_URL = '/images/charts.swf'; +Ext.FlashComponent.EXPRESS_INSTALL_URL = '/images/expressinstall.swf'; +// The Quicktips are used for the toolbar and Tree mouseover tooltips! +Ext.QuickTips.init(); + +var conn = new Ext.data.Connection(); + + function chDir( directory, loadGridOnly ) { + // console.info("**** Changing Directory: "+directory+" -- + // "+loadGridOnly); + if( datastore.directory.replace( /\//g, '' ) == directory.replace( /\//g, '' ) + && datastore.getTotalCount() > 0 && directory != '') { + // Prevent double loading + return; + } + datastore.directory = directory; + var conn = datastore.proxy.getConnection(); + if( directory == '' || conn && !conn.isLoading()) { + datastore.load({params:{start:0, limit:150, dir: directory, node: directory, option:'gridDocuments', action:'expandNode', sendWhat: datastore.sendWhat }}); + } + + if( !loadGridOnly ) { + expandTreeToDir( null, directory ); + } + } + + function expandTreeToDir( node, dir ) { + // console.info("Expanding Tree to Dir "+node+" - "+dir); + dir = dir ? dir : new String(''); + var dirs = dir.split('/'); + if( dirs[0] == '') { dirs.shift(); } + if( dirs.length > 0 ) { + // console.log("Dir to expand... "+dirs[0]); + node = dirTree.getNodeById( dirs[0] ); + if( !node ) return; + if( node.isExpanded() ) { + expandNode( node, dir ); + return; + } + node.on('load', function() { expandNode( node, dir ); } ); + node.expand(); + } + } + function expandNode( node, dir ) { + // console.info("Expanding Node "+node+" - "+dir); + var fulldirpath, dirpath; + + var dirs = dir.split('/'); + if( dirs[0] == '') { dirs.shift(); } + if( dirs.length > 0 ) { + fulldirpath = ''; + for( i=0; i < dirs.length; i++ ) { + fulldirpath += dirs[i]; + } + if( node.id.substr( 0, 5 ) != '_RRR_' ) { + fulldirpath = fulldirpath.substr( 5 ); + } + + if( node.id != fulldirpath ) { + dirpath = ''; + + var nodedirs = node.id.split('_RRR_'); + if( nodedirs[0] == '' ) nodedirs.shift(); + for( i=0; i < dirs.length; i++ ) { + if( nodedirs[i] ) { + dirpath += '_RRR_'+ dirs[i]; + } else { + dirpath += '_RRR_'+ dirs[i]; + // dirpath = dirpath.substr( 5 ); + var nextnode = dirTree.getNodeById( dirpath ); + if( !nextnode ) { return; } + if( nextnode.isExpanded() ) { expandNode( nextnode, dir ); return;} + nextnode.on( 'load', function() { expandNode( nextnode, dir ); } ); + + nextnode.expand(); + break; + } + } + } + else { + node.select(); + } + + } + } + function handleNodeClick( sm, node ) { + if( node && node.id ) { + // console.log("Node Clicked: "+node); + chDir( node.id ); + } + } + + function showLoadingIndicator( el, replaceContent ) { + // console.info("showLoadingIndicator"); + if( !el ) return; + var loadingimg = '/images/documents/_indicator.gif'; + var imgtag = '<' + 'img src="'+ loadingimg + '" alt="Loading..." border="0" name="Loading" align="absmiddle" />'; + + if( replaceContent ) { + el.innerHTML = imgtag; + } + else { + el.innerHTML += imgtag; + } + } + function getURLParam( strParamName, myWindow){ + // console.info("getURLParam"); + // console.trace(); + if( !myWindow ){ + myWindow = window; + } + var strReturn = ""; + var strHref = myWindow.location.href; + if ( strHref.indexOf("?") > -1 ){ + var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase(); + var aQueryString = strQueryString.split("&"); + for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){ + if ( aQueryString[iParam].indexOf(strParamName + "=") > -1 ){ + var aParam = aQueryString[iParam].split("="); + strReturn = aParam[1]; + break; + } + } + } + return strReturn; + } + + function openActionDialog( caller, action ) { + // console.log("Dialog open: "+caller+" ->"+action); + var dialog; + var selectedRows = ext_itemgrid.getSelectionModel().getSelections(); + if( selectedRows.length < 1 ) { + var selectedNode = dirTree.getSelectionModel().getSelectedNode(); + if( selectedNode ) { + selectedRows = Array( dirTree.getSelectionModel().getSelectedNode().id.replace( /_RRR_/g, '/' ) ); + } + } + var dontNeedSelection = { newFolder:1, uploadDocument:1, search:1 }; + if( dontNeedSelection[action] == null && selectedRows.length < 1 ) { + Ext.Msg.alert( 'error','No items Selected'); + return false; + } + + switch( action ) { + case 'copy': + case 'edit': + case 'newFolder': + case 'move': + case 'rename': + case 'search': + case 'uploadDocument': + case 'move': + requestParams = getRequestParams(); + requestParams.action = action; + if( action != "edit" ) { + dialog = new Ext.Window( { + id: "dialog", + autoCreate: true, + modal:true, + width:600, + height:400, + shadow:true, + minWidth:300, + minHeight:200, + proxyDrag: true, + resizable: true, + // renderTo: Ext.getBody(), + keys: { + key: 27, + fn : function(){ + dialog.hide(); + } + }// , + // animateTarget: typeof caller.getEl == 'function' + // ? caller.getEl() : caller, + // title: 'dialog_title' + + }); + } + Ext.Ajax.request( { url: '../appFolder/appFolderAjax.php', + params: Ext.urlEncode( requestParams ), + scripts: true, + callback: function(oElement, bSuccess, oResponse) { + if( !bSuccess ) { + msgbox = Ext.Msg.alert( "Ajax communication failure!"); + msgbox.setIcon( Ext.MessageBox.ERROR ); + } + if( oResponse && oResponse.responseText ) { + + // Ext.Msg.alert("Debug", + // oResponse.responseText + // ); + try{ json = Ext.decode( oResponse.responseText ); + if( json.error && typeof json.error != 'xml' ) { + Ext.Msg.alert( "error", json.error ); + dialog.destroy(); + return false; + } + } catch(e) { + msgbox = Ext.Msg.alert( "error", "JSON Decode Error: " + e.message ); + msgbox.setIcon( Ext.MessageBox.ERROR ); + return false; + } + if( action == "edit" ) { + Ext.getCmp("mainpanel").add(json); + Ext.getCmp("mainpanel").activate(json.id); + } + else { + // we expect the + // returned JSON to + // be an object that + // contains an + // "Ext.Component" + // or derivative in + // xtype notation + // so we can simply + // add it to the + // Window + // console.log(json); + dialog.add(json); + if( json.dialogtitle ) { + // if the + // component + // delivers a + // title for our + // dialog we can + // set the title + // of the window + dialog.setTitle(json.dialogtitle); + } + + try { + // recalculate + // layout + dialog.doLayout(); + // recalculate + // dimensions, + // based on + // those of the + // newly added + // child + // component + firstComponent = dialog.getComponent(0); + newWidth = firstComponent.getWidth() + dialog.getFrameWidth(); + newHeight = firstComponent.getHeight() + dialog.getFrameHeight(); + dialog.setSize( newWidth, newHeight ); + + } catch(e) {} + // alert( "Before: + // Dialog.width: " + + // dialog.getWidth() + // + ", Client + // Width: "+ + // Ext.getBody().getWidth()); + if( dialog.getWidth() >= Ext.getBody().getWidth() ) { + dialog.setWidth( Ext.getBody().getWidth() * 0.8 ); + } + // alert( "After: + // Dialog.width: " + + // dialog.getWidth() + // + ", Client + // Width: "+ + // Ext.getBody().getWidth()); + if( dialog.getHeight() >= Ext.getBody().getHeight() ) { + dialog.setHeight( Ext.getBody().getHeight() * 0.7 ); + } else if( dialog.getHeight() < Ext.getBody().getHeight() * 0.3 ) { + dialog.setHeight( Ext.getBody().getHeight() * 0.5 ); + } + + // recalculate + // Window size + dialog.syncSize(); + // center the window + dialog.center(); + } + } else if( !response || !oResponse.responseText) { + msgbox = Ext.Msg.alert( "error", "Received an empty response"); + msgbox.setIcon( Ext.MessageBox.ERROR ); + + } + } + }); + + if( action != "edit" ) { + dialog.on( 'hide', function() { dialog.destroy(true); } ); + dialog.show(); + } + break; + + case 'delete': + var num = selectedRows.length; + Ext.Msg.confirm('dellink?', String.format("miscdelitems", num ), deleteFiles); + break; + case 'download': + document.location = '?option=com_extplorer&action=download&item='+ encodeURIComponent(ext_itemgrid.getSelectionModel().getSelected().get('name')) + '&dir=' + encodeURIComponent( datastore.directory ); + break; + } + } + function handleCallback(requestParams, node) { + // console.log("handleCallback "+requestParams +" -- "+node); + // console.trace(); + var conn = new Ext.data.Connection(); + + conn.request({ + url: '../appFolder/appFolderAjax.php', + params: requestParams, + callback: function(options, success, response ) { + if( success ) { + json = Ext.decode( response.responseText ); + if( json.success ) { + statusBarMessage( json.message, false, true ); + try { + if( dropEvent) { + dropEvent.target.parentNode.reload(); + dropEvent = null; + } + if( node ) { + if( options.params.action == 'delete' || options.params.action == 'rename' ) { + node.parentNode.select(); + } + node.parentNode.reload(); + } else { + datastore.reload(); + } + } catch(e) { datastore.reload(); } + } else { + Ext.Msg.alert( 'Failure', json.error ); + } + } + else { + Ext.Msg.alert( 'Error', 'Failed to connect to the server.'); + } + + } + }); + } + function getRequestParams() { + // console.info("Get Request params "); + var selitems, dir, node; + var selectedRows = ext_itemgrid.getSelectionModel().getSelections(); + if( selectedRows.length < 1 ) { + node = dirTree.getSelectionModel().getSelectedNode(); + if( node ) { + var dir = dirTree.getSelectionModel().getSelectedNode().id.replace( /_RRR_/g, '/' ); + var lastSlash = dir.lastIndexOf( '/' ); + if( lastSlash > 0 ) { + selitems = Array( dir.substring(lastSlash+1) ); + } else { + selitems = Array( dir ); + } + } else { + selitems = {}; + } + dir = datastore.directory.substring( 0, datastore.directory.lastIndexOf('/')); + } + else { + selitems = Array(selectedRows.length); + + if( selectedRows.length > 0 ) { + for( i=0; i < selectedRows.length;i++) { + selitems[i] = selectedRows[i].get('name'); + } + } + dir = datastore.directory; + } + // Ext.Msg.alert("Debug", datastore.directory ); + var requestParams = { + option: 'new', + dir: datastore.directory, + item: selitems.length > 0 ? selitems[0]:'', + 'selitems[]': selitems + }; + return requestParams; + } + /** + * Function for actions, which don't require a form like download, + * extraction, deletion etc. + */ + function deleteFiles(btn) { + if( btn != 'yes') { + return; + } + requestParams = getRequestParams(); + requestParams.action = 'delete'; + handleCallback(requestParams); + } + function extractArchive(btn) { + if( btn != 'yes') { + return; + } + requestParams = getRequestParams(); + requestParams.action = 'extract'; + handleCallback(requestParams); + } + function deleteDir( btn, node ) { + if( btn != 'yes') { + return; + } + requestParams = getRequestParams(); + requestParams.dir = datastore.directory.substring( 0, datastore.directory.lastIndexOf('/')); + requestParams.selitems = Array( node.id.replace( /_RRR_/g, '/' ) ); + requestParams.action = 'delete'; + handleCallback(requestParams, node); + } + + Ext.msgBoxSlider = function(){ + var msgCt; + + function createBox(t, s){ + return ['
',
+ closable : false,
+ collapsible: true,
+ collapseMode: 'mini',
+ // collapsed:true,
+ width : 180,
+ titlebar : true,
+ autoScroll : true,
+ animate : true,
+
+ // rootVisible: false,
+ loader : new Ext.tree.TreeLoader({
+ preloadChildren : true,
+ dataUrl : '../appFolder/appFolderAjax.php',
+ baseParams : {
+ action : 'expandNode',
+ sendWhat : 'dirs'
+ }
+ }),
+ containerScroll : true,
+ enableDD : true,
+ ddGroup : 'TreeDD',
+ listeners : {
+ // "load": { fn: function(node) { chDir( node.id.replace(
+ // /_RRR_/g, '/' ), true ); } },
+ 'contextmenu' : {
+ fn : dirContext
+ },
+ 'textchange' : {
+ fn : function(node, text, oldText) {
+ if (text == oldText)
+ return true;
+ var requestParams = getRequestParams();
+ var dir = node.parentNode.id.replace(/_RRR_/g, '/');
+ if (dir == 'root')
+ dir = '';
+ requestParams.dir = dir;
+ requestParams.newitemname = text;
+ requestParams.item = oldText;
+
+ requestParams.confirm = 'true';
+ requestParams.action = 'rename';
+ handleCallback(requestParams);
+ ext_itemgrid.stopEditing();
+ return true;
+ }
+ },
+ 'beforenodedrop' : {
+ fn : function(e) {
+ dropEvent = e;
+ copymoveCtx(e);
+ }
+ },
+ 'beforemove' : {
+ fn : function() {
+ return false;
+ }
+ }
+ },
+
+ root : new Ext.tree.AsyncTreeNode({
+ text : '/',
+ draggable : false,
+ expanded : true,
+ id : 'root'
+ })
+ },
+ {
+ layout : "border",
+ region : "center",
+ items : [
+ {
+ region : "north",
+ xtype : "locationbar",
+ id : "locationbarcmp",
+ height : 28,
+ tree : Ext.getCmp("dirTree")
+ },
+ {
+ // region : "center",
+ // layout:'fit',
+ // items : [ {
+ region : "center",
+ // xtype : "tabpanel",
+ layout:'fit',
+ id : "mainpanel",
+ // autoHeight : true,
+ // enableTabScroll : true,
+ // activeTab : 0,
+ // hideTabStripItem:0,
+ items : [ {
+ xtype : "editorgrid",
+ layout:'fit',
+ region : "center",
+ // title : "Documents",
+ // autoHeight : true,
+ // autoScroll : true,
+ // collapsible : false,
+ // closeOnTab : true,
+ id : "gridpanel",
+ ds : datastore,
+ cm : cm,
+ tbar : gridtb,
+ bbar : gridbb,
+ ddGroup : 'TreeDD',
+ selModel : new Ext.grid.RowSelectionModel({
+ listeners : {
+ 'rowselect' : {
+ fn : handleRowClick
+ },
+ 'selectionchange' : {
+ fn : handleRowClick
+ }
+ }
+ }),
+ loadMask : true,
+ keys : [
+ {
+ key : 'c',
+ ctrl : true,
+ stopEvent : true,
+ handler : function() {
+ openActionDialog(this,
+ 'copy');
+ }
+
+ },
+ {
+ key : 'x',
+ ctrl : true,
+ stopEvent : true,
+ handler : function() {
+ openActionDialog(this,
+ 'move');
+ }
+
+ },
+ {
+ key : 'a',
+ ctrl : true,
+ stopEvent : true,
+ handler : function() {
+ ext_itemgrid
+ .getSelectionModel()
+ .selectAll();
+ }
+ },
+ {
+ key : Ext.EventObject.DELETE,
+ handler : function() {
+ openActionDialog(this,
+ 'delete');
+ }
+ } ],
+ listeners : {
+ 'rowcontextmenu' : {
+ fn : rowContextMenu
+ },
+ 'celldblclick' : {
+ fn : function(grid, rowIndex,
+ columnIndex, e) {
+ if (Ext.isOpera) {
+ // because Opera <= 9
+ // doesn't support the
+ // right-mouse-button-clicked
+ // event (contextmenu)
+ // we need to simulate it
+ // using the ondblclick
+ // event
+ rowContextMenu(grid,
+ rowIndex, e);
+ } else {
+ gsm = ext_itemgrid
+ .getSelectionModel();
+ gsm.clickedRow = rowIndex;
+ var selections = gsm
+ .getSelections();
+ if (!selections[0]
+ .get('is_file')) {
+ // console.log(datastore.directory);
+ chDir(/*
+ * datastore.directory +
+ * "/"+
+ */selections[0]
+ .get('id'));
+ } else if (selections[0]
+ .get('is_editable')) {
+ openActionDialog(this,
+ 'edit');
+ } else if (selections[0]
+ .get('is_readable')) {
+ openActionDialog(this,
+ 'view');
+ }
+ }
+ }
+ },
+ 'validateedit' : {
+ fn : function(e) {
+ if (e.value == e.originalValue)
+ return true;
+ var requestParams = getRequestParams();
+ requestParams.newitemname = e.value;
+ requestParams.item = e.originalValue;
+
+ requestParams.confirm = 'true';
+ requestParams.action = 'rename';
+ handleCallback(requestParams);
+ return true;
+ }
+ }
+ }
+
+ } ]// another level
+
+ // } /* jj */]
+ }
+ ]
+ } ],
+
+ listeners : {
+ "afterlayout" : {
+ fn : function() {
+ // alert(Ext.getCmp("locationbarcmp"));
+ // Ext.getCmp("documents").
+ /*
+ * if(typeof(sw_afterlayout)!="undefined"){
+ * //console.log("starting locatiobar");
+ * Ext.getCmp("locationbarcmp").tree =
+ * Ext.getCmp("dirTree");
+ * Ext.getCmp("locationbarcmp").initComponent();
+ * //console.log("location abr started"); return; }
+ */
+ // console.log(typeof(sw_afterlayout));
+ sw_afterlayout=true;
+ ext_itemgrid = Ext.getCmp("gridpanel");
+ // console.log("variable ext_itemgrid created");
+ // console.trace();
+ ext_itemgrid.un('celldblclick', ext_itemgrid.onCellDblClick);
+ // console.log("celldoublde click removed");
+ dirTree = Ext.getCmp("dirTree");
+ // console.log("dirtree created");
+
+ /*
+ * dirTree.loader.on('load', function(loader, o,
+ * response ) { if( response && response.responseText ) {
+ * var json = Ext.decode( response.responseText ); if(
+ * json && json.error ) { Ext.Msg.alert('Error',
+ * json.error +'onLoad'); } } });
+ */
+
+ var tsm = dirTree.getSelectionModel();
+ // console.log("tried to gtet selection model");
+ tsm.on('selectionchange',
+ handleNodeClick);
+
+ // create the editor for the directory
+ // tree
+ var dirTreeEd = new Ext.tree.TreeEditor(
+ dirTree,
+ {
+ allowBlank : false,
+ blankText : 'A name is required',
+ selectOnFocus : true
+ });
+ // console.log("tree editor created");
+
+ // console.log("before the first chdir");
+ chDir('');
+ // console.log("starting locatiobar first time");
+ Ext.getCmp("locationbarcmp").tree = Ext.getCmp("dirTree");
+ Ext.getCmp("locationbarcmp").initComponent();
+ // console.log("location abr started first time");
+
+ }
+
+ }
+ }
+
+};
+Ext.onReady(function() {
+
+ var viewport = new Ext.Viewport({
+ layout : 'border',
+ items : [
+documentsTab ]
+ });
+
+ // console.info("viewport -end");
+
+ viewport.doLayout();
+
+ // routine to hide the debug panel if it is open
+ if (parent.PANEL_EAST_OPEN) {
+ parent.PANEL_EAST_OPEN = false;
+ var debugPanel = parent.Ext.getCmp('debugPanel');
+ debugPanel.hide();
+ debugPanel.ownerCt.doLayout();
+ }
+
+});
\ No newline at end of file
diff --git a/workflow/engine/templates/cases/casesStartCase.html b/workflow/engine/templates/cases/casesStartCase.html
new file mode 100644
index 000000000..9a6e4afb5
--- /dev/null
+++ b/workflow/engine/templates/cases/casesStartCase.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/workflow/engine/templates/cases/casesStartCase.js b/workflow/engine/templates/cases/casesStartCase.js
new file mode 100644
index 000000000..2acc5fbde
--- /dev/null
+++ b/workflow/engine/templates/cases/casesStartCase.js
@@ -0,0 +1,460 @@
+//Ext.BLANK_IMAGE_URL = 'resources/s.gif';
+
+var startCaseFilter;
+
+Ext.chart.Chart.CHART_URL = '/images/charts.swf';
+Ext.FlashComponent.EXPRESS_INSTALL_URL = '/images/expressinstall.swf';
+// The Quicktips are used for the toolbar and Tree mouseover tooltips!
+Ext.QuickTips.init();
+
+var conn = new Ext.data.Connection();
+
+
+var processNumbers = new Ext.data.ArrayStore({
+ fields: [
+ {name: 'CASES_COUNT_TO_DO', type: 'integer'},
+ {name: 'CASES_COUNT_DRAFT', type: 'integer'},
+ {name: 'CASES_COUNT_COMPLETED', type: 'integer'},
+ {name: 'CASES_COUNT_CANCELLED', type: 'integer'},
+ {name: 'CASES_COUNT', type: 'integer'}
+ ]
+});
+
+var processNumbersData = [
+ [0,0,0,0,0]
+ ];
+processNumbers.loadData(processNumbersData);
+
+
+Docs = {};
+
+var newCaseTree = {
+ xtype : 'treepanel',
+ id : 'processTree',
+ style : {
+ height : '100%',
+ overflow : 'auto'
+ },
+ useArrows : true,
+ border : false,
+ split : true,
+ itemId : 'startCaseTreePanel',
+ id : 'startCaseTreePanel',
+ rootVisible : false,
+ treePanel : this,
+ clearOnReLoad : false,
+ loader : new Ext.tree.TreeLoader({
+ preloadChildren : true,
+ dataUrl : 'casesStartPage_Ajax.php',
+ baseParams : {
+ action : 'getProcessList'
+ }
+ }),
+ listeners : {
+ dblclick : function(n) {
+ //mainPanel.openCase(n);
+ openCaseA(n);
+
+ },
+ click : function(n) {
+ //mainPanel.showDetails(n);
+ showDetailsA(n);
+ }
+ },
+ root : {
+ nodeType : 'async',
+ draggable : false,
+ id : 'root',
+ expanded : true
+ }
+};
+
+var startCaseTab = {
+ id : 'startCase',
+ //title : 'Start Case',
+ //iconCls : 'ICON_CASES_START_CASE',
+ layout : 'border',
+ region : 'center',
+ items : [ {
+ id : 'img-chooser-view',
+ region : 'center',
+ style : {
+ width : '50%'
+ },
+ // autoScroll: true,
+ items : [ newCaseTree ]
+ }, {
+ xtype:'form',
+ id : 'process-detail-panel',
+ region : 'east',
+ // autoHeight : true,
+ split : true,
+ style : {
+ width : '50%'
+
+ },
+
+// minWidth : 150,
+ // frame: true,
+ labelAlign: 'right',
+ labelWidth: 85,
+ // width:340,
+ waitMsgTarget: true,
+ title:'Process Information',
+ layout:'form',
+ defaults: {width: 350},
+ defaultType: 'displayfield',
+ items: [{
+ fieldLabel: 'Process',
+ name: 'processName',
+ allowBlank:false,
+ value: '',
+ labelStyle: 'font-weight:bold;',
+ // disabled: true,
+ // readonly:true,
+ id:"processName"
+ },
+ {
+ xtype: 'compositefield',
+ fieldLabel: 'Task',
+ labelStyle: 'font-weight:bold;',
+
+ items: [
+
+ {
+ xtype : 'displayfield',
+
+ //fieldLabel: 'Task',
+ //labelStyle: 'font-weight:bold;',
+ name: 'taskName',
+ allowBlank:false,
+ value: '',
+ //autoWitdh:true,
+ width:200,
+ // disabled: true,
+ 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);
+ openCaseA(selectedNode);
+ }
+ }
+ }
+ ]
+ },
+
+
+
+ {
+ xtype:'textarea',
+ fieldLabel: 'Description',
+ name: 'processDescription',
+ value: '',
+ readOnly: true,
+ labelStyle: 'font-weight:bold;',
+ // disabled: true,
+ id:"processDescription"
+ },{
+ fieldLabel: 'Category',
+ name: 'processCategory',
+ value: '',
+ readOnly: true,
+ labelStyle: 'font-weight:bold;',
+ // disabled: true,
+ id:"processCategory"
+ },
+ {
+ xtype: 'grid',
+
+ ds: processNumbers,
+ cm: new Ext.grid.ColumnModel([
+ {id:'inbox',header: "Inbox", width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_TO_DO'},
+ {id:'draft',header: "Draft", width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_DRAFT'},
+ {id:'completed',header: "Completed", width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_COMPLETED'},
+ {id:'canceled',header: "Canceled", width:70, sortable: false, locked:true, dataIndex: 'CASES_COUNT_CANCELLED'},
+ {id:'totalCases',header: "Total Cases", width:70, sortable: false, locked:true , dataIndex: 'CASES_COUNT'}
+
+ ])
+,
+
+ //autoExpandColumn: 'company',
+ //height: 350,
+ width:355,
+ title:'General Process Numbers',
+ border: true,
+ listeners: {
+ viewready: function(g) {
+ //g.getSelectionModel().selectRow(0);
+ } // Allow rows to be rendered.
+ }
+ },
+
+
+ {
+ fieldLabel: 'Calendar',
+ name: 'calendarName',
+ labelStyle: 'font-weight:bold;',
+ // disabled: true,
+ id:"calendarName"
+ },{
+ xtype:'textarea',
+ fieldLabel: 'Calendar Description',
+ name: 'calendarDescription',
+ value: '',
+ labelStyle: 'font-weight:bold;',
+ // disabled: true,
+ readOnly: true,
+ id:"calendarDescription"
+ },{
+ xtype:'checkboxgroup',
+ fieldLabel: 'Working days',
+ name: 'calendarWorkDays',
+ // disabled: true,
+ readOnly: true,
+ labelStyle: 'font-weight:bold;',
+ id:"calendarWorkDays",
+ columns: 7,
+ items: [
+ {boxLabel: 'Sun', name: '0'},
+ {boxLabel: 'Mon', name: '1'},
+ {boxLabel: 'Tue', name: '2'},
+ {boxLabel: 'Wen', name: '3'},
+ {boxLabel: 'Thu', name: '4'},
+ {boxLabel: 'Fri', name: '5'},
+ {boxLabel: 'Sat', name: '6'}
+ ]
+ }, {
+ xtype:'checkbox',
+ fieldLabel: 'Debug Mode',
+ name: 'processDebug',
+ labelStyle: 'font-weight:bold;',
+ // disabled: true,
+ readOnly: true,
+ id:"processDebug"
+ }]
+ }
+ ],
+
+ tbar : [
+ {
+ xtype : 'textfield',
+ name : 'processesFilter',
+ id : 'processesFilter',
+ emptyText : 'Find a Process',
+ enableKeyEvents : true,
+ listeners : {
+ render : function(f) {
+ /*
+ * Ext.getCmp("startCaseTreePanel").filter = new
+ * Ext.tree.TreeFilter( this, { clearBlank : true,
+ * autoClear : true } );
+ */
+
+ startCaseFilter = new Ext.ux.tree.TreeFilterX(Ext
+ .getCmp('startCaseTreePanel'));
+ }, /*
+ * keydown : function(t, e) { treeFiltered =
+ * Ext.getCmp("startCaseTreePanel");
+ * //console.log(treeFiltered);
+ *
+ * var text = t.getValue();
+ *
+ * //console.log(text); if (!text) {
+ * treeFiltered.filter.clear(); return; }
+ * treeFiltered.expandAll();
+ *
+ * var re = new RegExp('^'+ Ext.escapeRe(text), 'i');
+ * console.log(re);
+ * treeFiltered.filter.filterBy(function(n) { return
+ * !n.attributes.isClass || re.test(n.text); }); },
+ */
+ specialkey : function(f, e) {
+ if (e.getKey() == e.ENTER) {
+ txt = Ext.getCmp('processesFilter').getValue();
+ startCaseFilter.clear();
+ var re = new RegExp('.*' + txt + '.*', 'i');
+ startCaseFilter.filter(re, 'text');
+ }
+ },
+ scope : this
+ }
+ }, {
+ text : 'X',
+ ctCls : 'pm_search_x_button',
+ handler : function() {
+ Ext.getCmp('processesFilter').setValue('');
+ startCaseFilter.clear();
+ }
+ }, ' ', ' ', {
+ iconCls : 'icon-expand-all',
+ tooltip : 'Expand All',
+ handler : function() {
+ Ext.getCmp("startCaseTreePanel").root.expand(true);
+ },
+ scope : this
+ }, '-', {
+ iconCls : 'icon-collapse-all',
+ tooltip : 'Collapse All',
+ handler : function() {
+ Ext.getCmp("startCaseTreePanel").root.collapse(true);
+ },
+ scope : this
+ }, ' ', ' ', {
+ xtype : 'tbbutton',
+ cls : 'x-btn-icon',
+ icon : '/images/refresh.gif',
+
+ handler : function() {
+ tree = Ext.getCmp('startCaseTreePanel');
+ tree.getLoader().load(tree.root);
+ }
+ } ]
+};
+
+
+
+Ext.onReady(function() {
+
+ var viewport = new Ext.Viewport({
+ layout : 'border',
+ items : [
+ startCaseTab ]
+ });
+
+ // console.info("viewport -end");
+
+ viewport.doLayout();
+
+ // routine to hide the debug panel if it is open
+ if (parent.PANEL_EAST_OPEN) {
+ parent.PANEL_EAST_OPEN = false;
+ var debugPanel = parent.Ext.getCmp('debugPanel');
+ debugPanel.hide();
+ debugPanel.ownerCt.doLayout();
+ }
+
+});
+function openCaseA(n){
+ if (n.attributes.optionType == "startProcess") {
+ Ext.Msg.show({
+ title : 'Start Case',
+ msg : 'Starting new case
',
- closable : false,
- collapsible: true,
- collapseMode: 'mini',
- // collapsed:true,
- width : 180,
- titlebar : true,
- autoScroll : true,
- animate : true,
-
- // rootVisible: false,
- loader : new Ext.tree.TreeLoader({
- preloadChildren : true,
- dataUrl : '../appFolder/appFolderAjax.php',
- baseParams : {
- action : 'expandNode',
- sendWhat : 'dirs'
- }
- }),
- containerScroll : true,
- enableDD : true,
- ddGroup : 'TreeDD',
- listeners : {
- // "load": { fn: function(node) { chDir( node.id.replace(
- // /_RRR_/g, '/' ), true ); } },
- 'contextmenu' : {
- fn : dirContext
- },
- 'textchange' : {
- fn : function(node, text, oldText) {
- if (text == oldText)
- return true;
- var requestParams = getRequestParams();
- var dir = node.parentNode.id.replace(/_RRR_/g, '/');
- if (dir == 'root')
- dir = '';
- requestParams.dir = dir;
- requestParams.newitemname = text;
- requestParams.item = oldText;
-
- requestParams.confirm = 'true';
- requestParams.action = 'rename';
- handleCallback(requestParams);
- ext_itemgrid.stopEditing();
- return true;
- }
- },
- 'beforenodedrop' : {
- fn : function(e) {
- dropEvent = e;
- copymoveCtx(e);
- }
- },
- 'beforemove' : {
- fn : function() {
- return false;
- }
- }
- },
-
- root : new Ext.tree.AsyncTreeNode({
- text : '/',
- draggable : false,
- expanded : true,
- id : 'root'
- })
- },
- {
- layout : "border",
- region : "center",
- items : [
- {
- region : "north",
- xtype : "locationbar",
- id : "locationbarcmp",
- height : 28,
- tree : Ext.getCmp("dirTree")
- },
- {
- // region : "center",
- // layout:'fit',
- // items : [ {
- region : "center",
- // xtype : "tabpanel",
- layout:'fit',
- id : "mainpanel",
- // autoHeight : true,
- // enableTabScroll : true,
- // activeTab : 0,
- // hideTabStripItem:0,
- items : [ {
- xtype : "editorgrid",
- layout:'fit',
- region : "center",
- // title : "Documents",
- // autoHeight : true,
- // autoScroll : true,
- // collapsible : false,
- // closeOnTab : true,
- id : "gridpanel",
- ds : datastore,
- cm : cm,
- tbar : gridtb,
- bbar : gridbb,
- ddGroup : 'TreeDD',
- selModel : new Ext.grid.RowSelectionModel({
- listeners : {
- 'rowselect' : {
- fn : handleRowClick
- },
- 'selectionchange' : {
- fn : handleRowClick
- }
- }
- }),
- loadMask : true,
- keys : [
- {
- key : 'c',
- ctrl : true,
- stopEvent : true,
- handler : function() {
- openActionDialog(this,
- 'copy');
- }
-
- },
- {
- key : 'x',
- ctrl : true,
- stopEvent : true,
- handler : function() {
- openActionDialog(this,
- 'move');
- }
-
- },
- {
- key : 'a',
- ctrl : true,
- stopEvent : true,
- handler : function() {
- ext_itemgrid
- .getSelectionModel()
- .selectAll();
- }
- },
- {
- key : Ext.EventObject.DELETE,
- handler : function() {
- openActionDialog(this,
- 'delete');
- }
- } ],
- listeners : {
- 'rowcontextmenu' : {
- fn : rowContextMenu
- },
- 'celldblclick' : {
- fn : function(grid, rowIndex,
- columnIndex, e) {
- if (Ext.isOpera) {
- // because Opera <= 9
- // doesn't support the
- // right-mouse-button-clicked
- // event (contextmenu)
- // we need to simulate it
- // using the ondblclick
- // event
- rowContextMenu(grid,
- rowIndex, e);
- } else {
- gsm = ext_itemgrid
- .getSelectionModel();
- gsm.clickedRow = rowIndex;
- var selections = gsm
- .getSelections();
- if (!selections[0]
- .get('is_file')) {
- // console.log(datastore.directory);
- chDir(/*
- * datastore.directory +
- * "/"+
- */selections[0]
- .get('id'));
- } else if (selections[0]
- .get('is_editable')) {
- openActionDialog(this,
- 'edit');
- } else if (selections[0]
- .get('is_readable')) {
- openActionDialog(this,
- 'view');
- }
- }
- }
- },
- 'validateedit' : {
- fn : function(e) {
- if (e.value == e.originalValue)
- return true;
- var requestParams = getRequestParams();
- requestParams.newitemname = e.value;
- requestParams.item = e.originalValue;
-
- requestParams.confirm = 'true';
- requestParams.action = 'rename';
- handleCallback(requestParams);
- return true;
- }
- }
- }
-
- } ]// another level
-
- // } /* jj */]
- }
- ]
- } ],
-
- listeners : {
- "afterlayout" : {
- fn : function() {
- // alert(Ext.getCmp("locationbarcmp"));
- // Ext.getCmp("documents").
- /*
- * if(typeof(sw_afterlayout)!="undefined"){
- * //console.log("starting locatiobar");
- * Ext.getCmp("locationbarcmp").tree =
- * Ext.getCmp("dirTree");
- * Ext.getCmp("locationbarcmp").initComponent();
- * //console.log("location abr started"); return; }
- */
- // console.log(typeof(sw_afterlayout));
- sw_afterlayout=true;
- ext_itemgrid = Ext.getCmp("gridpanel");
- // console.log("variable ext_itemgrid created");
- // console.trace();
- ext_itemgrid.un('celldblclick', ext_itemgrid.onCellDblClick);
- // console.log("celldoublde click removed");
- dirTree = Ext.getCmp("dirTree");
- // console.log("dirtree created");
-
- /*
- * dirTree.loader.on('load', function(loader, o,
- * response ) { if( response && response.responseText ) {
- * var json = Ext.decode( response.responseText ); if(
- * json && json.error ) { Ext.Msg.alert('Error',
- * json.error +'onLoad'); } } });
- */
-
- var tsm = dirTree.getSelectionModel();
- // console.log("tried to gtet selection model");
- tsm.on('selectionchange',
- handleNodeClick);
-
- // create the editor for the directory
- // tree
- var dirTreeEd = new Ext.tree.TreeEditor(
- dirTree,
- {
- allowBlank : false,
- blankText : 'A name is required',
- selectOnFocus : true
- });
- // console.log("tree editor created");
-
- // console.log("before the first chdir");
- chDir('');
- // console.log("starting locatiobar first time");
- Ext.getCmp("locationbarcmp").tree = Ext.getCmp("dirTree");
- Ext.getCmp("locationbarcmp").initComponent();
- // console.log("location abr started first time");
-
- }
-
- }
- }
-
-};
-/*
- * var dashboardTab = { title : 'Dashboard', id : 'mainDashboard', iconCls :
- * 'ICON_CASES_START_PAGE', xtype : 'container', autoHeight : true, enableDD :
- * false, items : getDashboardItems() };
- */
var MainPanel = function() {
MainPanel.superclass.constructor.call(this, {
id : 'doc-body',
@@ -1879,8 +95,8 @@ var MainPanel = function() {
tabWidth : 135,
plugins : new Ext.ux.TabCloseMenu(),
enableTabScroll : true,
- activeTab : -1,
- items : [ startCaseTab, documentsTab /* , dashboardTab */]
+ activeTab : 0,
+ items : []
});
};
@@ -1919,118 +135,7 @@ Ext
}
}
},
- openCase : function(n){
- if (n.attributes.optionType == "startProcess") {
- Ext.Msg.show({
- title : 'Start Case',
- msg : 'Starting new case