diff --git a/gulliver/js/ext/ux.locationbar/Ext.ux.LocationBar.js b/gulliver/js/ext/ux.locationbar/Ext.ux.LocationBar.js new file mode 100755 index 000000000..2cfd71b56 --- /dev/null +++ b/gulliver/js/ext/ux.locationbar/Ext.ux.LocationBar.js @@ -0,0 +1,438 @@ +/* + * Copyright 2008, brainbits GmbH All rights reserved. + * Author: Stephan Wentz. swentz[at]brainbits.net + * + * http://www.brainbits.net/ + */ + +/** + * LocationBar class + * Version: 0.1 + * @class Ext.ux.Locationbar + * @extends Ext.Toolbar + * Locationbar class. + * @constructor + * Creates a new LocationBar + * @param {Object/Array} config A config object or an array of buttons to add + */ +Ext.ux.LocationBar = Ext.extend(Ext.Toolbar, { + + /** + * @cfg {Number} maxItem Maximum number of items the Locationbar takes before the first items are removed (defaults to 15). + * Set to 0 for unlimited items. + */ + maxItems: 15, + + /** + * @cfg {String} emptyText The that is shown if no history is available (defaults to 'No node selected.'). + */ + emptyText: 'No node selected.', + + /** + * @cfg {Boolean} noReload If set to true the reload button will not be visible (defaults to false). + */ + noReload: false, + + /** + * @cfg {Function} selectHandler The function to + * call when clicked. Arguments passed are: + */ + selectHandler: null, + + /** + * @cfg {Function} reloadHandler The function to + * call when clicked. Arguments passed are: + */ + reloadHandler: null, + + /** + * @cfg {String} locationItems Initial items (defaults to []). + */ + locationItems: [], + + /** + * @cfg {String} folderIconCls Iconclass for folder icons. + */ + folderIconCls: 'x-locationbar-folder-icon', + + /** + * @cfg {String} folderIconCls Iconclass for the backward icon. + */ + backwardIconCls: 'x-locationbar-back-icon', + + /** + * @cfg {String} folderIconCls Iconclass for the forward icon. + */ + forwardIconCls: 'x-locationbar-forward-icon', + + /** + * @cfg {String} folderIconCls Iconclass for the reload icon. + */ + reloadIconCls: 'x-locationbar-reload-icon', + + /** + * @cfg {Ext.tree.TreePanel} tree The treePanel this Locationbar is associated with. + */ + tree: null, + + // private + historyItemNodes: {}, + + // private + historyItems: [], + + // private + currentItem: false, + + // private + historyNext: true, + + // private + initComponent: function() { + //console.log("initComponent location bar"); + if(this.tree) { + //console.log("tree exists"); + //console.debug(this.tree); + //console.log("adding listener LOAD"); + this.tree.getLoader().addListener('load',function(tl,node,resp){ + //console.log("tree get loader LOAD -> "+node); + if(node){ + node.loaded=true; + this.setNode(node); + } + },this); + //console.log("complete listener LOAD"); + //console.log("adding listenr SELECTIONCHANGE"); + this.tree.getSelectionModel().addListener('selectionchange', function(sm, node) { + //console.log("tree get loader SELECTION CHANGE"); + if( node && node.id ) { + //console.log("changing to dir (form location bar) "+node.id); + chDir( node.id, true ); + } + if (node.isLeaf()==false && node.childNodes.length==0){ + //console.log(node.isLeaf(),node.childNodes.length) + this.nodeJustLoaded=node; + //this.tree.getLoader().load(node); + //this.loadNode(node); + }else{ + this.setNode(node); + } + }, this); + //console.log("complete add listener SELECTIONCHANGE"); + + } + + //this.addListener('render', this.repaint, this); + + // Ext.ux.LocationBar.superclass.initComponent.call(this); + }, + + // private + autoCreate: { + cls:'x-toolbar x-small-editor x-locationbar', + html:'
' + }, + + // private + onRender: function(ct, position) { + Ext.ux.LocationBar.superclass.onRender.call(this, ct, position); + + this.repaint(); + }, + + // private + onClick: function(node) { + if (this.selectHandler) { + this.selectHandler(node); + } else { + if(node.parentNode) { + node.parentNode.expand(false,true); + node.ensureVisible(); + } + node.select(); + } + }, + + // private + onReload: function(node) { + if (this.reloadHandler) { + this.reloadHandler(node); + } else if(node.reload) { + node.reload(); + } + }, + + /** + * Clears all items from the LocationBar. + */ + clear: function() { + this.locationItems = []; + + this.repaint; + }, + + /** + * Sets the current Treenode + * If a tree was provided as a config to this LocationBar, this should + * be called automatically. + * @param {Ext.ux.TreeNode} node The currently selected TreeNode + */ + setNode: function(node) { + var path = []; + var pNode = node; + var i; + do { + var conf = { + text: pNode.attributes.text, + node: pNode, + handler: this.onClick.createDelegate(this, [pNode], false) + }; + if (pNode.childNodes.length) { + var childs = []; + + for (i = 0; i < pNode.childNodes.length; i++) { + + childs[i] = { + text: pNode.childNodes[i].attributes.text, + node: pNode.childNodes[i], + iconCls: this.folderIconCls, + handler: this.onClick.createDelegate(this, [pNode.childNodes[i]], false) + }; + } + conf.xtype = 'tbsplit'; + conf.menu = childs; + } + conf.fullPath = pNode.getPath('text').substr(1); + path.unshift(conf); + } while (pNode.parentNode && (pNode = pNode.parentNode) && pNode.id != 'root'); + + this.locationItems = []; + + for(i=0; i maxItems, remove last + if(this.maxItems && this.locationItems.length > this.maxItems) { + this.locationItems.pop(); + } + + // put new item at the end + this.locationItems.push(item); + }, + + // private + repaint: function() { + if (this.items && this.items.length) { + var _doLayout = true; + this.items.each(function(item){ + this.items.remove(item); + item.destroy(); + }, this.items); + } else { + var _doLayout = false; + } + try { + this.items.each(function(item){ + this.items.remove(item); + item.destroy(); + }, this.items); + } catch(e) {} + // back button + this.add({ + cls: 'x-btn-icon', + iconCls: this.backwardIconCls, + handler: function() { + this.historyNext = this.historyItems.pop(); + var itemKey = this.historyItems.pop(); + var item = this.historyItemNodes[itemKey]; + this.onClick(item.node); + }, + scope: this, + disabled: this.historyItems.length > 1 ? false : true + }); + + // forward button + // TODO: disabled, FUBAR + this.add({ + cls: 'x-btn-icon', + iconCls: this.forwardIconCls, + handler: function() { + var node = this.historyNext.node; + this.historyNext = false; + this.onClick(node); + }, + scope: this, + disabled: true //this.historyNext ? false : true + }); + + this.add(' ','-',' '); + + if (this.locationItems.length) { + // folder icon + this.add({ + cls: 'x-btn-icon', + iconCls: this.folderIconCls, + ctCls: 'x-locationbar-location x-locationbar-location-first', + disabled: true + }); + + var text; + for (var i = 0; i < this.locationItems.length; i++) { + var locationItem = this.locationItems[i]; + + var item = {}; + + if (typeof locationItem == 'object') { + item = locationItem; + } + else { + item.text = locationItem; + } + + if(!item.text) { + item.text = 'n/a'; + } + + item.handler = this.onClick.createDelegate(this, [locationItem.node], false); + + item.ctCls = 'x-locationbar-location'; + + this.add(item); + } + + // spacer + this.addItem( + { + cls: 'x-locationbar-location x-locationbar-location-last', + xtype: 'tbfill' + }); + + menu = []; + for(var i=this.historyItems.length-2; i>=0; i--) { + menu.push({ + text: this.historyItemNodes[this.historyItems[i]].fullPath, + iconCls: this.folderIconCls, + node: this.historyItemNodes[this.historyItems[i]].node, + handler: function(item) { + this.onClick(item.node); + }, + scope: this + }); + } + this.add({ + cls: 'x-btn-icon', + ctCls: 'x-locationbar-location x-locationbar-location-last', + menuAlign: 'tr-br?', + menu: menu + }); + if(!this.noReload) { + this.add(' '); + // reload button + this.add({ + cls: 'x-btn-icon', + iconCls: this.reloadIconCls, + handler: function() { + this.onReload(this.currentItem.node); + }, + scope: this + }); + } + this.add(' '); + } else { + this.add({ + cls: 'x-btn-icon', + iconCls: this.folderIconCls, + ctCls: 'x-locationbar-location x-locationbar-location-first', + disabled: true + }); + + if(this.emptyText) { + this.add({ + xtype: 'lbtext', + text: this.emptyText + }); + } + + this.addItem(new Ext.ux.LocationBar.Fill()); + + this.add({ + cls: 'x-btn-icon', + ctCls: 'x-locationbar-location x-locationbar-location-last', + menuAlign: 'tr-br?', + disabled: true + }); + this.add(' '); + this.add({ + cls: 'x-btn-icon', + iconCls: this.reloadIconCls, + disabled: true + }); + this.add(' '); + } + if (_doLayout === true) { + this.doLayout(); + } + + } +}); + +Ext.reg('locationbar', Ext.ux.LocationBar); + +Ext.ux.Fill = Ext.extend(Ext.Toolbar.Spacer, { + // private + render : function(td){ + + td.style.width = '100%'; + Ext.fly(td).addClass('x-locationbar-location'); + Ext.ux.Fill.superclass.render.call(this, td); + } +}); +Ext.reg('tbfill', Ext.ux.Fill); + +Ext.ux.LocationBar.Fill = Ext.extend(Ext.Toolbar.Fill, { + // private + render : function(td){ + td.className = 'x-locationbar-location'; + + // insert a   + var data = document.createTextNode('\u00a0'); + this.el.appendChild(data); + + Ext.ux.LocationBar.Fill.superclass.render.call(this, td); + } +}); +Ext.reg('lbfill', Ext.ux.LocationBar.Fill); + +Ext.ux.LocationBar.TextItem = Ext.extend(Ext.Toolbar.TextItem, { + // private + render : function(td){ + td.className = 'x-locationbar-location'; + + Ext.ux.LocationBar.Fill.superclass.render.call(this, td); + } +}); +Ext.reg('lbtext', Ext.ux.LocationBar.TextItem); diff --git a/gulliver/js/ext/ux.statusbar/ext-statusbar.js b/gulliver/js/ext/ux.statusbar/ext-statusbar.js new file mode 100755 index 000000000..195bcd5b9 --- /dev/null +++ b/gulliver/js/ext/ux.statusbar/ext-statusbar.js @@ -0,0 +1,80 @@ +Ext.namespace('Ext.ux'); + +Ext.ux.StatusBar = Ext.extend(Ext.Toolbar, { + textId: '', + defaultText: '', + autoClear: 5000, + task: null, + initComponent: function() { + this.textId = Ext.id(); + this.defaultText = this.initialConfig.defaultText || ''; + var text = this.initialConfig.text || this.defaultText; + + var config = { + items: [ + ''+text+'', // status text + '->' // make it greedy + ] + }; + if (this.initialConfig.items) { + config.items = config.items.concat(this.initialConfig.items); + delete this.initialConfig.items; + } + Ext.apply(this, Ext.apply(this.initialConfig, config)); + Ext.ux.StatusBar.superclass.initComponent.apply(this, arguments); + this.task = new Ext.util.DelayedTask(function() { + var el = Ext.get(this.textId); + var defaultText = this.defaultText; + el.fadeOut({ + callback: function() { + el.update(defaultText); + el.show(); + }, + duration: 1 + }); + }, this); + }, + onRender: function() { + Ext.ux.StatusBar.superclass.onRender.apply(this, arguments); + }, + setText: function(text) { + var el = Ext.get(this.textId); + el.update(text); + }, + setStatus: function(config) { + var defaults = { + clear: { + wait: this.autoClear, + anim: true, + useDefaults: true + } + }; + + if (config.clear === true) { + delete config.clear; + } + if (!Ext.isArray(config)) { + config = { + text: config.text || '' + } + } + Ext.apply(config, defaults); + var el = Ext.get(this.textId); + el.update(config.text); + var clear = config.clear; + var defaultText = this.defaultText; + if (clear.wait) { + this.task.delay(clear.wait); + } + else { + this.task.cancel(); + } + }, + clearStatus: function() { + this.setText(this.defaultText); + this.task.cancel(); + }, + showBusy: function(msg) { + // stub for now + } +}); \ No newline at end of file diff --git a/gulliver/js/ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js b/gulliver/js/ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js new file mode 100755 index 000000000..343d2dbeb --- /dev/null +++ b/gulliver/js/ext/ux.treefilterx/Ext.ux.tree.TreeFilterX.js @@ -0,0 +1,159 @@ +// vim: ts=4:sw=4:nu:fdc=4:nospell +/* global Ext */ +/** + * @class Ext.ux.tree.TreeFilterX + * @extends Ext.tree.TreeFilter + * + *

+ * Shows also parents of matching nodes as opposed to default TreeFilter. In + * other words this filter works "deep way". + *

+ * + * @author Ing. Jozef Sakáloš + * @version 1.0 + * @date 17. December 2008 + * @revision $Id: Ext.ux.tree.TreeFilterX.js 589 2009-02-21 23:30:18Z jozo $ + * @see http://extjs.com/forum/showthread.php?p=252709 + * + * @license Ext.ux.tree.CheckTreePanel is licensed under the terms of the Open + * Source LGPL 3.0 license. Commercial use is permitted to the extent + * that the code/component(s) do NOT become part of another Open Source + * or Commercially licensed development library or toolkit without + * explicit permission. + * + *

+ * License details: http://www.gnu.org/licenses/lgpl.html + *

+ * + * @forum 55489 + * @demo http://remotetree.extjs.eu + * + * @donate
+ *
+ */ + +Ext.ns('Ext.ux.tree'); + +/** + * Creates new TreeFilterX + * + * @constructor + * @param {Ext.tree.TreePanel} + * tree The tree panel to attach this filter to + * @param {Object} + * config A config object of this filter + */ +Ext.ux.tree.TreeFilterX = Ext.extend(Ext.tree.TreeFilter, { + /** + * @cfg {Boolean} expandOnFilter Deeply expands startNode before filtering + * (defaults to true) + */ + expandOnFilter : true + + // {{{ + /** + * Filter the data by a specific attribute. + * + * @param {String/RegExp} + * value Either string that the attribute value should start with + * or a RegExp to test against the attribute + * @param {String} + * attr (optional) The attribute passed in your node's attributes + * collection. Defaults to "text". + * @param {TreeNode} + * startNode (optional) The node to start the filter at. + */ + , + filter : function(value, attr, startNode) { + + // expand start node + if (false !== this.expandOnFilter) { + startNode = startNode || this.tree.root; + var animate = this.tree.animate; + this.tree.animate = false; + startNode.expand(true, false, function() { + + // call parent after expand + Ext.ux.tree.TreeFilterX.superclass.filter.call(this, value, + attr, startNode); + + }.createDelegate(this)); + this.tree.animate = animate; + } else { + // call parent + Ext.ux.tree.TreeFilterX.superclass.filter.apply(this, arguments); + } + + } // eo function filter + // }}} + // {{{ + /** + * Filter by a function. The passed function will be called with each node + * in the tree (or from the startNode). If the function returns true, the + * node is kept otherwise it is filtered. If a node is filtered, its + * children are also filtered. Shows parents of matching nodes. + * + * @param {Function} + * fn The filter function + * @param {Object} + * scope (optional) The scope of the function (defaults to the + * current node) + */ + , + filterBy : function(fn, scope, startNode) { + startNode = startNode || this.tree.root; + if (this.autoClear) { + this.clear(); + } + var af = this.filtered, rv = this.reverse; + + var f = function(n) { + if (n === startNode) { + return true; + } + if (af[n.id]) { + return false; + } + var m = fn.call(scope || n, n); + if (!m || rv) { + af[n.id] = n; + n.ui.hide(); + return true; + } else { + n.ui.show(); + var p = n.parentNode; + while (p && p !== this.root) { + p.ui.show(); + p = p.parentNode; + } + return true; + } + return true; + }; + startNode.cascade(f); + + if (this.remove) { + for ( var id in af) { + if (typeof id != "function") { + var n = af[id]; + if (n && n.parentNode) { + n.parentNode.removeChild(n); + } + } + } + } + } // eo function filterBy + // }}} + +}); // eo extend + +// eof \ No newline at end of file diff --git a/workflow/engine/classes/model/AppFolder.php b/workflow/engine/classes/model/AppFolder.php index 4d3a85fa4..1211f1106 100644 --- a/workflow/engine/classes/model/AppFolder.php +++ b/workflow/engine/classes/model/AppFolder.php @@ -24,7 +24,12 @@ class AppFolder extends BaseAppFolder { * @param strin(32) $folderParent * @return Ambigous <>|number */ - function createFolder($folderName, $folderParent = "/") { + function createFolder($folderName, $folderParent = "/", $action="createifnotexists") { + $validActions=array("createifnotexists","create","update"); + if(!in_array($action,$validActions)) $action="createifnotexists"; + //Clean Folder and Parent names (delete spaces...) + $folderName=trim($folderName); + $folderParent=trim($folderParent); //Try to Load the folder (Foldername+FolderParent) $oCriteria = new Criteria ( 'workflow' ); $oCriteria->add ( AppFolderPeer::FOLDER_NAME, $folderName ); @@ -32,11 +37,13 @@ class AppFolder extends BaseAppFolder { $oDataset = AppFolderPeer::doSelectRS ( $oCriteria ); $oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $oDataset->next (); - if ($aRow = $oDataset->getRow ()) { //Folder exist, then return the ID - return ($aRow ['FOLDER_UID']); - } else { //Folder doesn't exist. Create and return the ID - - + if ($aRow = $oDataset->getRow ()) {//Folder exist, then return the ID + $response['success']=false; + $response['message']=$response['error']="Can't create folder
A folder with same name already exists.
$folderParent$folderName"; + $response['folderUID']=$aRow ['FOLDER_UID']; + //return ($aRow ['FOLDER_UID']); + return ($response); + } else {//Folder doesn't exist. Create and return the ID $folderUID = G::GenerateUniqueID (); $tr = new AppFolder ( ); $tr->setFolderUid ( $folderUID ); @@ -47,7 +54,11 @@ class AppFolder extends BaseAppFolder { if ($tr->validate ()) { // we save it, since we get no validation errors, or do whatever else you like. $res = $tr->save (); - return $folderUID; + $response['success']=true; + $response['message']=$response['error']="Folder successfully created.
$folderParent$folderName"; + $response['folderUID']=$folderUID; + return ($response); + //return $folderUID; } else { // Something went wrong. We can now get the validationFailures and handle them. $msg = ''; @@ -55,7 +66,10 @@ class AppFolder extends BaseAppFolder { foreach ( $validationFailuresArray as $objValidationFailure ) { $msg .= $objValidationFailure->getMessage () . "
"; } - krumo ( $msg ); + $response['success']=false; + + $response['message']=$response['error']="Can't create folder \n A \n ".$msg; + return ($response); } } } @@ -64,45 +78,46 @@ class AppFolder extends BaseAppFolder { * @param strin(32) $sessionID * @return string Last Folder ID generated */ - function createFromPath($folderPath, $sessionID = "") { + function createFromPath($folderPath, $sessionID = "") { if ($sessionID == "") - $sessionID = $_SESSION ['APPLICATION']; - //Get current Application Fields + $sessionID = $_SESSION ['APPLICATION']; + //Get current Application Fields $oApplication = new Application ( ); - + $appFields = $oApplication->Load ( $sessionID ); - + $folderPathParsed = G::replaceDataField ( $folderPath, $appFields ); $folderPathParsed = G::replaceDataField ( $folderPath, unserialize ( $appFields ['APP_DATA'] ) ); - + $folderPathParsedArray = explode ( "/", $folderPathParsed ); - + $folderRoot = "/"; //Always starting from Root foreach ( $folderPathParsedArray as $folderName ) { if (trim ( $folderName ) != "") { - $folderRoot = $this->createFolder ( $folderName, $folderRoot ); + $response = $this->createFolder ( $folderName, $folderRoot ); + $folderRoot=$response['folderUID']; } } return $folderRoot != "/" ? $folderRoot : ""; } - + /** - * @param string $fileTags + * @param string $fileTags * @param string(32) $sessionID Application ID * @return string */ function parseTags($fileTags, $sessionID = "") { - + if ($sessionID == "") - $sessionID = $_SESSION ['APPLICATION']; - //Get current Application Fields + $sessionID = $_SESSION ['APPLICATION']; + //Get current Application Fields $oApplication = new Application ( ); - + $appFields = $oApplication->Load ( $sessionID ); - + $fileTagsParsed = G::replaceDataField ( $fileTags, $appFields ); $fileTagsParsed = G::replaceDataField ( $fileTags, unserialize ( $appFields ['APP_DATA'] ) ); - + return $fileTagsParsed; } /** @@ -112,17 +127,17 @@ class AppFolder extends BaseAppFolder { function getFolderList($folderID) { $Criteria = new Criteria ( 'workflow' ); $Criteria->clearSelectColumns ()->clearOrderByColumns (); - + $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_UID ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_PARENT_UID ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_NAME ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_CREATE_DATE ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_UPDATE_DATE ); - + $Criteria->add ( appFolderPeer::FOLDER_PARENT_UID, $folderID, CRITERIA::EQUAL ); - + $Criteria->addAscendingOrderByColumn ( AppFolderPeer::FOLDER_NAME ); - + $rs = appFolderPeer::doSelectRS ( $Criteria ); $rs->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $rs->next (); @@ -157,32 +172,32 @@ class AppFolder extends BaseAppFolder { return $fields; } function getFolderStructure($folderId) { - + $folderObj = $this->load ( $folderId ); $folderArray [$folderObj ['FOLDER_UID']] = array ("NAME" => $folderObj ['FOLDER_NAME'], "PARENT" => $folderObj ['FOLDER_PARENT_UID'] ); $folderArray ['PATH_ARRAY'] [] = $folderObj ['FOLDER_NAME']; - + while ( $folderObj ['FOLDER_PARENT_UID'] != "" ) { $folderObj = $this->load ( $folderObj ['FOLDER_PARENT_UID'] ); $folderArray [$folderObj ['FOLDER_UID']] = array ("NAME" => $folderObj ['FOLDER_NAME'], "PARENT" => $folderObj ['FOLDER_PARENT_UID'] ); $folderArray ['PATH_ARRAY'] [] = $folderObj ['FOLDER_NAME']; } - + $folderArray ['PATH'] = str_replace ( "//", "/", implode ( "/", array_reverse ( $folderArray ['PATH_ARRAY'] ) ) ); return $folderArray; } - + function getFolderContent($folderID, $docIdFilter = array(), $keyword = NULL, $searchType = NULL) { require_once ("classes/model/AppDocument.php"); require_once ("classes/model/InputDocument.php"); require_once ("classes/model/OutputDocument.php"); require_once ("classes/model/Users.php"); - + G::LoadClass ( 'case' ); $oCase = new Cases ( ); G::LoadClass ( 'process' ); $oProcess = new Process ( ); - + $oAppDocument = new AppDocument ( ); $oCriteria = new Criteria ( ); if ((is_array ( $docIdFilter )) && (count ( $docIdFilter ) > 0)) { //Search by App Doc UID no matter what Folder it is @@ -192,11 +207,15 @@ class AppFolder extends BaseAppFolder { } elseif ($searchType == "TAG") { $oCriteria->add ( AppDocumentPeer::APP_DOC_TAGS, "%" . $keyword . "%", CRITERIA::LIKE ); } - + $oCase->verifyTable (); - + + $oCriteria->setOffset(0); + $oCriteria->setLimit(150); + $oCriteria->addAscendingOrderByColumn ( AppDocumentPeer::APP_DOC_INDEX ); - + $oCriteria->addDescendingOrderByColumn ( AppDocumentPeer::DOC_VERSION ); + $rs = AppDocumentPeer::doSelectRS ( $oCriteria ); $rs->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $rs->next (); @@ -205,12 +224,13 @@ class AppFolder extends BaseAppFolder { //**** start get Doc Info $oApp = new Application ( ); if (($oApp->exists ( $row ['APP_UID'] )) || ($row ['APP_UID'] == "00000000000000000000000000000000")) { - + + $completeInfo = array("APP_DOC_FILENAME" => $row ["APP_DOC_UID"],"APP_DOC_UID"=>$row ['APP_UID']); $completeInfo = $this->getCompleteDocumentInfo ( $row ['APP_UID'], $row ['APP_DOC_UID'], $row ['DOC_VERSION'], $row ['DOC_UID'], $row ['USR_UID'] ); - + $oAppDocument = new AppDocument ( ); $lastVersion = $oAppDocument->getLastAppDocVersion ( $row ['APP_DOC_UID'], $row ['APP_UID'] ); - + $filesResult [] = $completeInfo; if ($completeInfo ['APP_DOC_STATUS'] != "DELETED") { if ((in_array ( $row ['APP_DOC_UID'], $completeInfo ['INPUT_DOCUMENTS'] )) || (in_array ( $row ['APP_DOC_UID'], $completeInfo ['OUTPUT_DOCUMENTS'] )) || (in_array ( $completeInfo ['USR_UID'], array ($_SESSION ['USER_LOGGED'], '-1' ) ))) { if (count ( $docIdFilter ) > 0) { @@ -221,12 +241,12 @@ class AppFolder extends BaseAppFolder { if ($searchType == "ALL") {// If search in name of docs is active then filter if ((stripos ( $completeInfo ['APP_DOC_FILENAME'], $keyword ) !== false) || (stripos ( $completeInfo ['APP_DOC_TAGS'], $keyword ) !== false)) { $filesResult [] = $completeInfo; - } + } } else {//No search filter active $filesResult [] = $completeInfo; } } - + } } } @@ -257,7 +277,7 @@ class AppFolder extends BaseAppFolder { $row3 = $oProcess->Load ( $row2 ['PRO_UID'] ); } $lastVersion = $oAppDocument->getLastAppDocVersion ( $appDocUid, $appUid ); - + switch ($row1 ['APP_DOC_TYPE']) { case "OUTPUT" : $oOutputDocument = new OutputDocument ( ); @@ -283,7 +303,7 @@ class AppFolder extends BaseAppFolder { $downloadLabel1 = ".doc"; break; } - + break; case "INPUT" : $oInputDocument = new InputDocument ( ); @@ -316,15 +336,15 @@ class AppFolder extends BaseAppFolder { $downloadLabel = G::LoadTranslation ( 'ID_DOWNLOAD' ); $downloadLabel1 = ""; break; - + } $oUser = new Users ( ); - if ($usrId != "-1") { + if (($usrId != "-1")&&($oUser->userExists($usrId))) { $row5 = $oUser->load ( $usrId ); } else { $row5 ['USR_USERNAME'] = "***"; } - + //Labels/Links $row6 = array (); $row6 ['DELETE_LABEL'] = G::LoadTranslation('ID_DELETE'); @@ -340,12 +360,12 @@ class AppFolder extends BaseAppFolder { $row6 ['NEWVERSION_LABEL'] = G::LoadTranslation ( 'ID_NEW_VERSION' ); } $row6 ['APP_DOC_UID_VERSION'] = $appDocUid . "_" . $docVersion; - + if ($appUid == "00000000000000000000000000000000") { //External Files $row1 ['APP_DOC_TYPE'] = G::LoadTranslation ( 'ID_EXTERNAL_FILE' ); } //**** End get docinfo - + $infoMerged = array_merge ( $row1, $row2, $row3, $row4, $row5, $row6 ); //krumo($infoMerged); @@ -355,7 +375,7 @@ class AppFolder extends BaseAppFolder { if (isset ( $infoMerged ['PRO_UID'] )) { $aObjectPermissions = $oCase->getAllObjects ( $infoMerged ['PRO_UID'], $infoMerged ['APP_UID'], '', $sUserUID ); } - + if (! is_array ( $aObjectPermissions )) { $aObjectPermissions = array ('DYNAFORMS' => array (- 1 ), 'INPUT_DOCUMENTS' => array (- 1 ), 'OUTPUT_DOCUMENTS' => array (- 1 ) ); } @@ -381,7 +401,7 @@ class AppFolder extends BaseAppFolder { } } //**************************************************************************************************** - + return array_merge ( $infoMerged, $aObjectPermissions ); } @@ -395,26 +415,26 @@ class AppFolder extends BaseAppFolder { } return (array_merge ( $folderArray, $foldersList )); } - + function getFolderTags($rootFolder) { $folderArray [$rootFolder] = $rootFolder; $foldersToProcess = $this->getFolderChilds ( $rootFolder, $folderArray ); $tagsInfo = array (); - + foreach ( $foldersToProcess as $folderkey => $foldername ) { $filesList = $this->getFolderContent ( $folderkey ); - + foreach ( $filesList as $key => $fileInfo ) { $fileTags = explode ( ",", $fileInfo ['APP_DOC_TAGS'] ); foreach ( $fileTags as $key1 => $tag ) { if (! (isset ( $tagsInfo [$tag] ))) - $tagsInfo [$tag] = 0; + $tagsInfo [$tag] = 0; $tagsInfo [$tag] ++; } } } return $tagsInfo; - + } function remove ($FolderUid, $rootfolder ) { $oCriteria = new Criteria('workflow'); diff --git a/workflow/engine/classes/model/Users.php b/workflow/engine/classes/model/Users.php index 9c43736ce..d1267aace 100644 --- a/workflow/engine/classes/model/Users.php +++ b/workflow/engine/classes/model/Users.php @@ -63,6 +63,24 @@ class Users extends BaseUsers { throw($e); } } + +public function userExists($UsrUid) + { + try { + $oRow = UsersPeer::retrieveByPK( $UsrUid ); + if (!is_null($oRow)) + { + return true; + } + else { + return false; + } + } + catch (Exception $oError) { + return false; + } + } + public function load($UsrUid) { try { diff --git a/workflow/engine/menus/cases.php b/workflow/engine/menus/cases.php index 13234adab..59ebcd4d7 100644 --- a/workflow/engine/menus/cases.php +++ b/workflow/engine/menus/cases.php @@ -60,7 +60,7 @@ $G_TMP_MENU->AddIdRawOption('CASES_HOME', 'casesStartPage', G::LoadTranslation('ID_CASES_START_PAGE'), '', '', 'blockHeader'); - //$G_TMP_MENU->AddIdRawOption('CASES_FOLDERS', 'casesStartPage?action=documents', G::LoadTranslation('ID_FOLDERS'), 'folderV2.gif' ); + $G_TMP_MENU->AddIdRawOption('CASES_FOLDERS', 'casesStartPage?action=documents', G::LoadTranslation('ID_FOLDERS'), 'folderV2.gif' ); //$G_TMP_MENU->AddIdRawOption('CASES_START_PAGE', 'casesStartPage?action=mainDashboard', ucwords(strtolower(G::LoadTranslation('ID_DASHBOARD'))), '' ); //Load Other registered Dashboards (From plugins) diff --git a/workflow/engine/methods/appFolder/appFolderAjax.php b/workflow/engine/methods/appFolder/appFolderAjax.php index b6106d8c1..293324829 100755 --- a/workflow/engine/methods/appFolder/appFolderAjax.php +++ b/workflow/engine/methods/appFolder/appFolderAjax.php @@ -10,83 +10,204 @@ $oPMFolder = new AppFolder ( ); $rootFolder = "/"; switch ($_POST ['action']) { - - case 'expandNode': - $folderList = $oPMFolder->getFolderList ( $_POST ['node'] != 'root' ? $_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder ); - $folderContent = $oPMFolder->getFolderContent ( $_POST ['node'] != 'root' ? $_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder ); - //G::pr($folderContent); - $processListTree=array(); - foreach ( $folderList as $key => $obj ) { - $tempTree ['text'] = $obj['FOLDER_NAME']; + + case 'expandNode': + if($_POST ['node']=="") $_POST ['node'] ="/"; + if($_POST ['node']=="root") $_POST ['node'] ="/"; + if(!(isset($_POST['sendWhat']))) $_POST['sendWhat']="both"; + if(($_POST['sendWhat']=="dirs")||($_POST['sendWhat']=="both")){ + $folderList = $oPMFolder->getFolderList ( $_POST ['node'] != 'root' ? $_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder ); + //G::pr($folderList); + } + if(($_POST['sendWhat']=="files")||($_POST['sendWhat']=="both")){ + $folderContent = $oPMFolder->getFolderContent ( $_POST ['node'] != 'root' ? $_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder ); + //G::pr($folderContent); + } + //G::pr($folderContent); + $processListTree=array(); + if(isset($folderList)){ + $tempTree=array(); + foreach ( $folderList as $key => $obj ) { + //$tempTree ['all-obj'] = $obj; + $tempTree ['text'] = $obj['FOLDER_NAME']; $tempTree ['id'] = $obj['FOLDER_UID']; $tempTree ['folderID'] = $obj['FOLDER_UID']; $tempTree ['cls'] = 'folder'; $tempTree ['draggable'] = true; + $tempTree ['name'] = $obj['FOLDER_NAME']; + $tempTree ['type'] = "Directory"; + $tempTree ['is_file'] = false; + $tempTree ['appDocCreateDate'] = $obj['FOLDER_CREATE_DATE']; + $tempTree ['qtip'] ='Directory: '.$obj['FOLDER_NAME'].'
Create Date: '.$obj['FOLDER_CREATE_DATE'].''; + $tempTree ['is_writable'] =true; + $tempTree ['is_chmodable'] =true; + $tempTree ['is_readable'] =true; + $tempTree ['is_deletable'] =true; + + + + + + if((isset($_POST['option']))&&($_POST['option']=="gridDocuments")){ + $tempTree ['icon'] = "/images/documents/extension/folder.png"; + } //$tempTree ['leaf'] = true; //$tempTree ['optionType'] = "category"; //$tempTree['allowDrop']=false; - $tempTree ['singleClickExpand'] = true; + //$tempTree ['singleClickExpand'] = false; /* - if ($key != "No Category") { - $tempTree ['expanded'] = true; - } else { - //$tempTree ['expanded'] = false; - $tempTree ['expanded'] = true; - } - */ + if ($key != "No Category") { + $tempTree ['expanded'] = true; + } else { + //$tempTree ['expanded'] = false; + $tempTree ['expanded'] = true; + } + */ $processListTree [] = $tempTree; + $tempTree=array(); + } + + if($_POST ['node'] == '/'){ + $notInFolderLabel = G::LoadTranslation ( 'ID_NOT_IN_FOLDER' ); + $tempTree ['text'] = $notInFolderLabel; + $tempTree ['id'] = "NA"; + $tempTree ['folderID'] = "NA"; + $tempTree ['cls'] = 'folder'; + $tempTree ['draggable'] = true; + $tempTree ['name'] = $notInFolderLabel; + $tempTree ['type'] = "Directory"; + $tempTree ['is_file'] = false; + $tempTree ['qtip'] ='Directory: '.$notInFolderLabel.'
Unfiled Files '; + $tempTree ['is_writable'] =true; + $tempTree ['is_chmodable'] =true; + $tempTree ['is_readable'] =true; + $tempTree ['is_deletable'] =true; + + if((isset($_POST['option']))&&($_POST['option']=="gridDocuments")){ + $tempTree ['icon'] = "/images/documents/extension/bz2.png"; + } + //$tempTree ['leaf'] = true; + //$tempTree ['optionType'] = "category"; + //$tempTree['allowDrop']=false; + //$tempTree ['singleClickExpand'] = false; + /* + if ($key != "No Category") { + $tempTree ['expanded'] = true; + } else { + //$tempTree ['expanded'] = false; + $tempTree ['expanded'] = true; + } + */ + $processListTree [] = $tempTree; + $tempTree=array(); + + } } - foreach ( $folderContent as $key => $obj ) { - $tempTree ['text'] = $obj['APP_DOC_FILENAME']; + + if(isset($folderContent)){ + foreach ( $folderContent as $key => $obj ) { + $tempTree ['text'] = $obj['APP_DOC_FILENAME']; $tempTree ['id'] = $obj['APP_DOC_UID']; - + $tempTree ['cls'] = 'file'; //$tempTree ['draggable'] = true; $tempTree ['leaf'] = true; + $tempTree ['name'] = $obj['APP_DOC_FILENAME']; + $mimeInformation=getMime($obj['APP_DOC_FILENAME']); + $tempTree ['type'] = $mimeInformation['description']; + $tempTree ['is_file'] = true; + //if((isset($_POST['option']))&&($_POST['option']=="gridDocuments")){ + $tempTree ['icon'] = $mimeInformation['icon']; + //} + + $tempTree ['docVersion'] = $obj['DOC_VERSION']; + $tempTree ['appUid'] = $obj['APP_UID']; + $tempTree ['usrUid'] = $obj['USR_UID']; + $tempTree ['appDocType'] = $obj['APP_DOC_TYPE']; + $tempTree ['appDocCreateDate'] = $obj['APP_DOC_CREATE_DATE']; + $tempTree ['appDocPlugin'] = $obj['APP_DOC_PLUGIN']; + $tempTree ['appDocTags'] = $obj['APP_DOC_TAGS']; + $tempTree ['appDocTitle'] = $obj['APP_DOC_TITLE']; + $tempTree ['appDocComment'] = $obj['APP_DOC_COMMENT']; + $tempTree ['appDocFileName'] = $obj['APP_DOC_FILENAME']; + if(isset($obj['APP_NUMBER'])){ + $tempTree ['appLabel'] = sprintf("%s '%s' (%s)",$obj['APP_NUMBER'],$obj['APP_TITLE'],$obj['STATUS']); + }else{ + $tempTree ['appLabel'] = "No case related"; + } + $tempTree ['proTitle'] = $obj['PRO_TITLE']; + $tempTree ['appDocVersionable'] = 0; + if(isset($obj['OUT_DOC_VERSIONING'])){ + $tempTree ['appDocVersionable'] = $obj['OUT_DOC_VERSIONING']; + }elseif(isset($obj['INP_DOC_VERSIONING'])){ + $tempTree ['appDocVersionable'] = $obj['INP_DOC_VERSIONING']; + } + + if(isset($obj['USR_LASTNAME'])&&isset($obj['USR_LASTNAME'])){ + $tempTree ['owner'] = sprintf("%s %s (%s)",$obj['USR_LASTNAME'],$obj['USR_FIRSTNAME'],$obj['USR_USERNAME']); + }else{ + $tempTree ['owner'] = sprintf("%s",$obj['USR_USERNAME']); + + } + $tempTree ['deletelabel'] = $obj['DELETE_LABEL']; + $tempTree ['downloadLabel'] = $obj['DOWNLOAD_LABEL']; + $tempTree ['downloadLink'] = $obj['DOWNLOAD_LINK']; + $tempTree ['downloadLabel1'] = $obj['DOWNLOAD_LABEL1']; + $tempTree ['downloadLink1'] = $obj['DOWNLOAD_LINK1']; + $tempTree ['appDocUidVersion'] = $obj['APP_DOC_UID_VERSION']; + //$tempTree ['optionType'] = "category"; //$tempTree['allowDrop']=false; //$tempTree ['singleClickExpand'] = true; /* - if ($key != "No Category") { - $tempTree ['expanded'] = true; - } else { - //$tempTree ['expanded'] = false; - $tempTree ['expanded'] = true; - } - */ + if ($key != "No Category") { + $tempTree ['expanded'] = true; + } else { + //$tempTree ['expanded'] = false; + $tempTree ['expanded'] = true; + } + */ $processListTree [] = $tempTree; + $tempTree=array(); + } + } + if((isset($_POST['option']))&&($_POST['option']=="gridDocuments")){ + $processListTreeTemp['totalCount']=count($processListTree); + $processListTreeTemp['items']=$processListTree; + $processListTree = $processListTreeTemp; } - print G::json_encode ( $processListTree ); - break; - case 'openPMFolder' : - $WIDTH_PANEL = 350; - G::LoadClass ( 'tree' ); - $folderContent = $oPMFolder->getFolderList ( $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder ); - //krumo($folderContent); - if (! is_array ( $folderContent )) { - echo $folderContent; - exit (); - } - - $tree = new Tree ( ); - $tree->name = 'DMS'; - $tree->nodeType = "blank"; - - //$tree->width="350px"; - $tree->value = ''; - $tree->showSign = false; - - $i = 0; - foreach ( $folderContent as $key => $obj ) { - $i ++; - //if($obj->item_type=="F"){ - - $RowClass = ($i % 2 == 0) ? 'Row1' : 'Row2'; - $id_delete = G::LoadTranslation('ID_DELETE'); - $id_edit = G::LoadTranslation('ID_EDIT'); - - $htmlGroup = <<getFolderList ( $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder ); + //krumo($folderContent); + if (! is_array ( $folderContent )) { + echo $folderContent; + exit (); + } + + $tree = new Tree ( ); + $tree->name = 'DMS'; + $tree->nodeType = "blank"; + + //$tree->width="350px"; + $tree->value = ''; + $tree->showSign = false; + + $i = 0; + foreach ( $folderContent as $key => $obj ) { + $i ++; + //if($obj->item_type=="F"){ + + + $RowClass = ($i % 2 == 0) ? 'Row1' : 'Row2'; + $id_delete = G::LoadTranslation('ID_DELETE'); + $id_edit = G::LoadTranslation('ID_EDIT'); + + $htmlGroup = << @@ -97,16 +218,16 @@ switch ($_POST ['action']) {
GHTML; - - $ch = & $tree->addChild ( $key, $htmlGroup, array ('nodeType' => 'child' ) ); - $ch->point = ' '; - - } - $RowClass = ($i % 2 == 0) ? 'Row1' : 'Row2'; - $key = 0; - if ($_POST ['folderID'] == '0') { - $notInFolderLabel = G::LoadTranslation ( 'ID_NOT_IN_FOLDER' ); - $htmlGroup = <<addChild ( $key, $htmlGroup, array ('nodeType' => 'child' ) ); + $ch->point = ' '; + + } + $RowClass = ($i % 2 == 0) ? 'Row1' : 'Row2'; + $key = 0; + if ($_POST ['folderID'] == '0') { + $notInFolderLabel = G::LoadTranslation ( 'ID_NOT_IN_FOLDER' ); + $htmlGroup = <<
 - {$notInFolderLabel} -  @@ -115,191 +236,839 @@ GHTML;
GHTML; - - $ch = & $tree->addChild ( $key, $htmlGroup, array ('nodeType' => 'child' ) ); - $ch->point = ' '; - } - - print ($tree->render ()) ; - - break; - case 'getPMFolderContent' : - $swSearch = false; - - if (isset ( $_POST ['folderID'] )) { //Render content of a folder - $folderID = $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder; - $folderContent = $oPMFolder->getFolderContent ( $folderID ); - } else { // Perform a Search - $swSearch = true; - $folderContent = $oPMFolder->getFolderContent ( NULL, array (), $_POST ['searchKeyword'], $_POST ['type'] ); - } - array_unshift ( $folderContent, array ('id' => 'char' ) ); - if (! is_array ( $folderContent )) { - echo $folderContent; - exit (); - } - - $_DBArray ['PM_FOLDER_DOC'] = $folderContent; - $_SESSION ['_DBArray'] = $_DBArray; - - G::LoadClass ( 'ArrayPeer' ); - $c = new Criteria ( 'dbarray' ); - $c->setDBArrayTable ( 'PM_FOLDER_DOC' ); - $c->addAscendingOrderByColumn ( 'id' ); - $G_PUBLISH = new Publisher ( ); - require_once ('classes/class.xmlfield_InputPM.php'); - - $labelFolderAddFile = ""; - $labelFolderAddFolder = ""; - if ($RBAC->userCanAccess ( 'PM_FOLDERS_ADD_FILE' ) == 1) { - $labelFolderAddFile = G::LoadTranslation ( 'ID_ATTACH' ); - } - if ($RBAC->userCanAccess ( 'PM_FOLDERS_ADD_FOLDER' ) == 1) { - $labelFolderAddFolder = G::LoadTranslation ( 'ID_NEW_FOLDER' ); - } - - if (! $swSearch) { - $G_PUBLISH->AddContent ( 'propeltable', 'paged-table', 'appFolder/appFolderDocumentList', $c, array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "/" : $_POST ['folderID'] : $rootFolder, 'labelFolderAddFile' => $labelFolderAddFile, 'labelFolderAddFolder' => $labelFolderAddFolder ) ); - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderDocumentListHeader', '', array (), 'appFolderList?folderID=' . $_POST ['folderID'] ); - } else { - $G_PUBLISH->AddContent ( 'propeltable', 'paged-table', 'appFolder/appFolderDocumentListSearch', $c, array () ); - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderDocumentListHeader', '', array (), 'appFolderList?folderID=/' ); - } - - G::RenderPage ( 'publish', 'raw' ); - - break; - - case "getPMFolderTags" : - // Default font sizes - $min_font_size = 12; - $max_font_size = 30; - - $rootFolder = "/"; - $folderID = $_POST ['rootFolder'] != '0' ? $_POST ['rootFolder'] == 'NA' ? "" : $_POST ['rootFolder'] : $rootFolder; - $tags = $oPMFolder->getFolderTags ( $folderID ); - $minimum_count = 0; - $maximum_count = 0; - if ((is_array ( $tags )) && (count ( $tags ) > 0)) { - $minimum_count = min ( array_values ( $tags ) ); - $maximum_count = max ( array_values ( $tags ) ); - } - $spread = $maximum_count - $minimum_count; - - if ($spread == 0) { - $spread = 1; - } - - $cloud_html = ''; - $cloud_tags = array (); // create an array to hold tag code - foreach ( $tags as $tag => $count ) { - $href = "#"; - //$href="?q="$tag; - $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; - $cloud_tags [] = '' . htmlspecialchars ( stripslashes ( $tag ) ) . ''; - } - $cloud_html = join ( "\n", $cloud_tags ) . "\n"; - - print "$cloud_html"; - - break; - - case "uploadDocument" : - //krumo($_POST); - G::LoadClass ( 'case' ); - $oCase = new Cases ( ); - - $G_PUBLISH = new Publisher ( ); - $Fields ['DOC_UID'] = $_POST ['docID']; - $Fields ['APP_DOC_UID'] = $_POST ['appDocId']; - $Fields ['actionType'] = $_POST ['actionType']; - $Fields ['docVersion'] = $_POST ['docVersion']; - - $Fields ['appId'] = $_POST ['appId']; - $Fields ['docType'] = $_POST ['docType']; - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'appFolderSaveDocument?UID=' . $_POST ['docID'] . '&appId=' . $_POST ['appId'] . '&docType=' . $_POST ['docType'] ); - G::RenderPage ( 'publish', 'raw' ); - - break; - case "documentVersionHistory" : - - $folderID = $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder; - $folderContent = $oPMFolder->getFolderContent ( $folderID, array ($_POST ['appDocId'] ) ); - - array_unshift ( $folderContent, array ('id' => 'char' ) ); - if (! is_array ( $folderContent )) { - echo $folderContent; - exit (); - } - - $_DBArray ['PM_FOLDER_DOC_HISTORY'] = $folderContent; - $_SESSION ['_DBArray'] = $_DBArray; - - G::LoadClass ( 'ArrayPeer' ); - $c = new Criteria ( 'dbarray' ); - $c->setDBArrayTable ( 'PM_FOLDER_DOC_HISTORY' ); - $c->addAscendingOrderByColumn ( 'id' ); - $G_PUBLISH = new Publisher ( ); - require_once ('classes/class.xmlfield_InputPM.php'); - - $G_PUBLISH->AddContent ( 'propeltable', 'paged-table', 'appFolder/appFolderDocumentListHistory', $c, array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "/" : $_POST ['folderID'] : $rootFolder ) ); - - G::RenderPage ( 'publish', 'raw' ); - - break; - - case "uploadExternalDocument" : - G::LoadClass ( 'case' ); - $oCase = new Cases ( ); - - $G_PUBLISH = new Publisher ( ); - $Fields ['DOC_UID'] = "-1"; - - $Fields ['appId'] = "00000000000000000000000000000000"; - - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'appFolderSaveDocument?UID=-1&appId=' . $Fields ['appId'] . "&folderId=" . $_POST ['folderID'] ); - G::RenderPage ( 'publish', 'raw' ); - - break; - - case "newFolder" : - $oFolder = new AppFolder ( ); - $folderStructure = $oPMFolder->getFolderStructure ( $_POST ['folderID'] ); - $Fields ['FOLDER_PATH'] = $folderStructure ['PATH']; - $Fields ['FOLDER_PARENT_UID'] = $_POST ['folderID']; - $Fields ['FOLDER_UID'] = G::GenerateUniqueID (); - $G_PUBLISH = new Publisher ( ); - - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderEdit', '', $Fields, 'appFolderSave' ); - G::RenderPage ( 'publish', 'raw' ); - - break; - - case "documentInfo" : - $oFolder = new AppFolder ( ); - $Fields = $oPMFolder->getCompleteDocumentInfo ( $_POST ['appId'], $_POST ['appDocId'], $_POST ['docVersion'], $_POST ['docID'], $_POST ['usrUid'] ); - $G_PUBLISH = new Publisher ( ); - - $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderDocumentInfo', '', $Fields, '' ); - G::RenderPage ( 'publish', 'raw' ); - - break; - - case "documentdelete": - include_once ("classes/model/AppDocument.php"); - $oAppDocument = new AppDocument ( ); - $oAppDocument->remove($_POST['sFileUID'],$_POST['docVersion']); - /*we need to delete fisicaly the file use the follow code - $appId= "00000000000000000000000000000000"; - $sPathName = PATH_DOCUMENT . $appId . PATH_SEP; - unlink($sPathName.$_POST['sFileUID'].'_1.jpg');*/ - break; - - case "deletePMFolder": - include_once ("classes/model/AppFolder.php"); - $oAppFoder = new AppFolder ( ); - $oAppFoder->remove($_POST['sFileUID'],$_POST['rootfolder']); + + $ch = & $tree->addChild ( $key, $htmlGroup, array ('nodeType' => 'child' ) ); + $ch->point = ' '; + } - break; + print ($tree->render ()) ; + break; + case 'getPMFolderContent' : + $swSearch = false; + + if (isset ( $_POST ['folderID'] )) { //Render content of a folder + $folderID = $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder; + $folderContent = $oPMFolder->getFolderContent ( $folderID ); + } else { // Perform a Search + $swSearch = true; + $folderContent = $oPMFolder->getFolderContent ( NULL, array (), $_POST ['searchKeyword'], $_POST ['type'] ); + } + array_unshift ( $folderContent, array ('id' => 'char' ) ); + if (! is_array ( $folderContent )) { + echo $folderContent; + exit (); + } + + $_DBArray ['PM_FOLDER_DOC'] = $folderContent; + $_SESSION ['_DBArray'] = $_DBArray; + + G::LoadClass ( 'ArrayPeer' ); + $c = new Criteria ( 'dbarray' ); + $c->setDBArrayTable ( 'PM_FOLDER_DOC' ); + $c->addAscendingOrderByColumn ( 'id' ); + $G_PUBLISH = new Publisher ( ); + require_once ('classes/class.xmlfield_InputPM.php'); + + $labelFolderAddFile = ""; + $labelFolderAddFolder = ""; + if ($RBAC->userCanAccess ( 'PM_FOLDERS_ADD_FILE' ) == 1) { + $labelFolderAddFile = G::LoadTranslation ( 'ID_ATTACH' ); + } + if ($RBAC->userCanAccess ( 'PM_FOLDERS_ADD_FOLDER' ) == 1) { + $labelFolderAddFolder = G::LoadTranslation ( 'ID_NEW_FOLDER' ); + } + + if (! $swSearch) { + $G_PUBLISH->AddContent ( 'propeltable', 'paged-table', 'appFolder/appFolderDocumentList', $c, array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "/" : $_POST ['folderID'] : $rootFolder, 'labelFolderAddFile' => $labelFolderAddFile, 'labelFolderAddFolder' => $labelFolderAddFolder ) ); + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderDocumentListHeader', '', array (), 'appFolderList?folderID=' . $_POST ['folderID'] ); + } else { + $G_PUBLISH->AddContent ( 'propeltable', 'paged-table', 'appFolder/appFolderDocumentListSearch', $c, array () ); + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderDocumentListHeader', '', array (), 'appFolderList?folderID=/' ); + } + + G::RenderPage ( 'publish', 'raw' ); + + break; + + case "getPMFolderTags" : + // Default font sizes + $min_font_size = 12; + $max_font_size = 30; + + $rootFolder = "/"; + $folderID = $_POST ['rootFolder'] != '0' ? $_POST ['rootFolder'] == 'NA' ? "" : $_POST ['rootFolder'] : $rootFolder; + $tags = $oPMFolder->getFolderTags ( $folderID ); + $minimum_count = 0; + $maximum_count = 0; + if ((is_array ( $tags )) && (count ( $tags ) > 0)) { + $minimum_count = min ( array_values ( $tags ) ); + $maximum_count = max ( array_values ( $tags ) ); + } + $spread = $maximum_count - $minimum_count; + + if ($spread == 0) { + $spread = 1; + } + + $cloud_html = ''; + $cloud_tags = array (); // create an array to hold tag code + foreach ( $tags as $tag => $count ) { + $href = "#"; + //$href="?q="$tag; + $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; + $cloud_tags [] = '' . htmlspecialchars ( stripslashes ( $tag ) ) . ''; + } + $cloud_html = join ( "\n", $cloud_tags ) . "\n"; + + print "$cloud_html"; + + break; + + case "uploadDocument" : + + $uploadDocumentComponent=array(); + + + $uploadDocumentComponent["xtype"]= "tabpanel"; + $uploadDocumentComponent["stateId"]= "upload_tabpanel"; + $uploadDocumentComponent["activeTab"]= "uploadform"; + $uploadDocumentComponent["dialogtitle"]= "actupload"; + $uploadDocumentComponent["stateful"]= true; + + $uploadDocumentComponent["stateEvents"]= array("tabchange"); + $uploadDocumentComponent["getState"]= "function_getState"; + $functionsToReplace['function_getState']="function() { return { + activeTab:this.items.indexOf(this.getActiveTab()) + }; + }"; + $uploadDocumentComponent["listeners"]["resize"]["fn"]="function_listeners_resize"; + $functionsToReplace['function_listeners_resize'] = "function(panel) { + panel.items.each( function(item) { item.setHeight(500);return true } ); + }"; + $uploadDocumentComponent["items"]=array(); + + $itemA=array(); + + + $itemA["xtype"]= "swfuploadpanel"; + $itemA["title"]= "flashupload"; + $itemA["height"]= "300"; + $itemA["id"]= "swfuploader"; + $itemA["viewConfig"]["forceFit"]=true; + $itemA["listeners"]["allUploadsComplete"]["fn"]="function_listeners_allUploadsComplete"; + $functionsToReplace['function_listeners_allUploadsComplete'] = "function(panel) { + datastore.reload(); + panel.destroy(); + Ext.getCmp('dialog').destroy(); + statusBarMessage('upload_completed', false ); + }"; + + // Uploader Params + $itemA["upload_url"]= "../appFolder/appFolderAjax.php"; + $itemA["post_params"][session_name()]=session_id(); + $itemA["post_params"]["option"]="uploadFile"; + $itemA["post_params"]["action"]="upload"; + $itemA["post_params"]["dir"]="datastore.directory"; + $itemA["post_params"]["requestType"]="xmlhttprequest"; + $itemA["post_params"]["confirm"]="true"; + + $itemA["flash_url"]="/scripts/extjs3-ext/ux.swfupload/swfupload.swf"; + $itemA["file_size_limit"]=get_max_file_size(); + // Custom Params + $itemA["single_file_select"]=false; // Set to true if you only want to select one file from the FileDialog. + $itemA["confirm_delete"]=false; // This will prompt for removing files from queue. + $itemA["remove_completed"]=false; // Remove file from grid after uploaded. +//$uploadDocumentComponent["items"][]=$itemA; + + //Standard Upload + $itemA=array(); + $itemA["xtype"]="form"; + $itemA["autoScroll"]=true; + $itemA["autoHeight"]=true; + $itemA["id"]="uploadform"; + $itemA["fileUpload"]=true; + $itemA["labelWidth"]="125"; + $itemA["url"]="URL_SCRIPT"; + $itemA["title"]="standardupload"; + //$itemA["tooltip"]="Max File Size ". ((get_max_file_size() / 1024) / 1024)." MB
Max Post Size". ((get_max_upload_limit() / 1024) / 1024)." MB
"; + $itemA["frame"]=true; + $itemA["items"]=array(); + $itemB=array(); + + $itemB["xtype"]="displayfield"; + $itemB["value"]="Max File Size ". ((get_max_file_size() / 1024) / 1024)." MB
Max Post Size". ((get_max_upload_limit() / 1024) / 1024)." MB
"; + //$itemA["items"][]=$itemB; + + for($i=0;$i<7;$i++) { + $itemB=array(); + + $itemB["xtype"]="fileuploadfield"; + $itemB["fieldLabel"]="File ".($i+1); + $itemB["id"]="uploadedFile[$i]"; + $itemB["name"]="uploadedFile[$i]"; + $itemB["width"]=275; + $itemB["buttonOnly"]= false; + $itemA["items"][]=$itemB; + } + + $itemB=array(); + + $itemB["xtype"]="checkbox"; + $itemB["fieldLabel"]="overwrite_files"; + $itemB["name"]="overwrite_files"; + $itemB["checked"]=true; + $itemA["items"][]=$itemB; + + $itemA["buttons"]=array(); + + $buttonA=array(); + $buttonA["text"]="btnsave"; + $buttonA["handler"]="function_standardupload_btnsave"; + $functionsToReplace["function_standardupload_btnsave"]=' function() { + statusBarMessage( "upload_processing", true ); + form = Ext.getCmp("uploadform").getForm(); + + //Ext.getCmp("uploadform").getForm().submit(); + console.log(form); + console.log(form.url); + Ext.getCmp("uploadform").getForm().submit({ + //reset: true, + reset: false, + success: function(form, action) { + + datastore.reload(); + statusBarMessage( action.result.message, false, true ); + Ext.getCmp("dialog").destroy(); + }, + failure: function(form, action) { + + if( !action.result ) return; + Ext.MessageBox.alert("error", action.result.error); + statusBarMessage( action.result.error, false, false ); + }, + scope: Ext.getCmp("uploadform"), + // add some vars to the request, similar to hidden fields + params: { + option: "standardupload", + action: "uploadExternalDocument", + dir: datastore.directory, + requestType: "xmlhttprequest", + confirm: "true", + docUid: "-1", + appId: "00000000000000000000000000000000" + } + }); + }'; + + $itemA["buttons"][]=$buttonA; + + $buttonA=array(); + + $buttonA["text"]= "btncancel"; + $buttonA["handler"]="function_standardupload_btncancel"; + $functionsToReplace["function_standardupload_btncancel"]=' function() { Ext.getCmp("dialog").destroy(); }'; +$itemA["buttons"][]=$buttonA; + + $uploadDocumentComponent["items"][]=$itemA; + + $itemA=array(); + + $itemA["xtype"]="form"; + $itemA["id"]="transferform"; + $itemA["url"]="../appFolder/appFolderAjax.php"; + $itemA["hidden"]="true"; + $itemA["title"]="acttransfer"; + $itemA["autoHeight"]="true"; + $itemA["labelWidth"]=225; + $itemA["frame"]= true; + $itemA["items"]=array(); + + + for($i=0;$i<7;$i++) { + $itemB=array(); + $itemB["xtype"]= "textfield"; + $itemB["fieldLabel"]= "url_to_file"; + $itemB["name"]= "userfile[$i]"; + $itemB["width"]=275; + $itemA["items"][]=$itemB; + } + $itemB=array(); + $itemB["xtype"]="checkbox"; + $itemB["fieldLabel"]="overwrite_files"; + $itemB["name"]="overwrite_files"; + $itemB["checked"]=true; + $itemA["items"][]=$itemB; + + $itemA["buttons"]=array(); + + $buttonA=array(); + + $buttonA["text"]="btnsave"; + $buttonA["handler"]="function_transfer_btnsave"; + $functionsToReplace["function_transfer_btnsave"]='function() { + statusBarMessage( "transfer_processing", true ); + transfer = Ext.getCmp("transferform").getForm(); + transfer.submit({ + //reset: true, + reset: false, + success: function(form, action) { + datastore.reload(); + statusBarMessage( action.result.message, false, true ); + Ext.getCmp("dialog").destroy(); + }, + failure: function(form, action) { + if( !action.result ) return; + Ext.MessageBox.alert("error", action.result.error); + statusBarMessage( action.result.error, false, false ); + }, + scope: transfer, + // add some vars to the request, similar to hidden fields + params: { + "option": "com_extplorer", + "action": "transfer", + "dir": datastore.directory, + "confirm": "true" + } + }); + }'; + + $itemA["buttons"]=$buttonA; + + $buttonA=array(); + $buttonA["text"]="btncancel"; + $buttonA["handler"]="function_transfer_btncancel"; + $functionsToReplace["function_transfer_btncancel"]='function() { Ext.getCmp("dialog").destroy(); }'; +$itemA["buttons"]=$buttonA; + + // $uploadDocumentComponent["items"][]=$itemA; + +$finalResponse=G::json_encode($uploadDocumentComponent); +$finalResponse=str_replace("URL_SCRIPT","../appFolder/appFolderAjax.php",$finalResponse); +foreach($functionsToReplace as $key => $originalFunction){ + + $finalResponse=str_replace('"'.$key.'"',$originalFunction,$finalResponse); +} + echo ($finalResponse); + +/* + //krumo($_POST); + G::LoadClass ( 'case' ); + $oCase = new Cases ( ); + + $G_PUBLISH = new Publisher ( ); + $Fields ['DOC_UID'] = $_POST ['docID']; + $Fields ['APP_DOC_UID'] = $_POST ['appDocId']; + $Fields ['actionType'] = $_POST ['actionType']; + $Fields ['docVersion'] = $_POST ['docVersion']; + + $Fields ['appId'] = $_POST ['appId']; + $Fields ['docType'] = $_POST ['docType']; + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'appFolderSaveDocument?UID=' . $_POST ['docID'] . '&appId=' . $_POST ['appId'] . '&docType=' . $_POST ['docType'] ); + G::RenderPage ( 'publish', 'raw' ); +*/ + break; + case "documentVersionHistory" : + + $folderID = $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder; + $folderContent = $oPMFolder->getFolderContent ( $folderID, array ($_POST ['appDocId'] ) ); + + array_unshift ( $folderContent, array ('id' => 'char' ) ); + if (! is_array ( $folderContent )) { + echo $folderContent; + exit (); + } + + $_DBArray ['PM_FOLDER_DOC_HISTORY'] = $folderContent; + $_SESSION ['_DBArray'] = $_DBArray; + + G::LoadClass ( 'ArrayPeer' ); + $c = new Criteria ( 'dbarray' ); + $c->setDBArrayTable ( 'PM_FOLDER_DOC_HISTORY' ); + $c->addAscendingOrderByColumn ( 'id' ); + $G_PUBLISH = new Publisher ( ); + require_once ('classes/class.xmlfield_InputPM.php'); + + $G_PUBLISH->AddContent ( 'propeltable', 'paged-table', 'appFolder/appFolderDocumentListHistory', $c, array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "/" : $_POST ['folderID'] : $rootFolder ) ); + + G::RenderPage ( 'publish', 'raw' ); + + break; + + case "uploadExternalDocument" : + + $response['action']=$_POST['action']. " - ".$_POST['option']; + $response['error']="error"; + $response['message']="error"; + $response['success']=false; + if(isset($_POST["confirm"]) && $_POST["confirm"]=="true") { + //G::pr($_FILES); + $uploadedInstances=count($_FILES['uploadedFile']['name']); + $sw_error=false; + $sw_error_exists=isset($_FILES['uploadedFile']['error']); + $emptyInstances=0; + $quequeUpload=array(); + // upload files & check for errors + for($i=0;$i<$uploadedInstances;$i++) { + $errors[$i]=NULL; + $tmp = $_FILES['uploadedFile']['tmp_name'][$i]; + $items[$i] = stripslashes($_FILES['uploadedFile']['name'][$i]); + if($sw_error_exists) $up_err = $_FILES['uploadedFile']['error'][$i]; + else $up_err=(file_exists($tmp)?0:4); + + + if($items[$i]=="" || $up_err==4){ + $emptyInstances++; + continue; + } + if($up_err==1 || $up_err==2) { + $errors[$i]='miscfilesize'; + $sw_error=true; continue; + } + if($up_err==3) { + $errors[$i]='miscfilepart'; + $sw_error=true; continue; + } + if(!@is_uploaded_file($tmp)) { + $errors[$i]='uploadfile'; + $sw_error=true; continue; + } + + //The uplaoded files seems to be correct and ready to be uploaded. Add to the Queque + $fileInfo=array("tempName"=>$tmp,"fileName"=>$items[$i]); + $quequeUpload[]=$fileInfo; + } + //G::pr($quequeUpload); + + //Read. Instance Document classes + if(!empty($quequeUpload)){ + $docUid=$_POST['docUid']; + $appDocUid=isset($_POST['APP_DOC_UID'])?$_POST['APP_DOC_UID']:""; + $docVersion=isset($_POST['docVersion'])?$_POST['docVersion']:""; + $actionType=isset($_POST['actionType'])?$_POST['actionType']:""; + $folderId=$_POST['dir']==""?"/":$_POST['dir']; + $appId=$_POST['appId']; + $docType=isset($_POST['docType'])?$_GET['docType']:"INPUT"; + + //save info + + require_once ( "classes/model/AppDocument.php" ); + require_once ('classes/model/AppFolder.php'); + require_once ('classes/model/InputDocument.php'); + + $oInputDocument = new InputDocument(); + if($docUid!=-1){ + $aID = $oInputDocument->load($docUid); + }else{ + $oFolder=new AppFolder(); + $folderStructure=$oFolder->getFolderStructure($folderId); + $aID=array('INP_DOC_DESTINATION_PATH'=>$folderStructure['PATH']); + } + + + $oAppDocument = new AppDocument(); + + + //Get the Custom Folder ID (create if necessary) + $oFolder=new AppFolder(); + if($docUid!=-1){ + //krumo("jhl"); + $folderId=$oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH'],$appId); + //Tags + $fileTags=$oFolder->parseTags($aID['INP_DOC_TAGS'],$appId); + }else{ + $folderId=$folderId; + $fileTags="EXTERNAL"; + } + + foreach($quequeUpload as $key =>$fileObj){ + switch($actionType){ + case "R": //replace + $aFields = array('APP_DOC_UID' => $appDocUid, + 'APP_UID' => $appId, + 'DOC_VERSION' => $docVersion, + 'DEL_INDEX' => 1, + 'USR_UID' => $_SESSION['USER_LOGGED'], + 'DOC_UID' => $docUid, + 'APP_DOC_TYPE' => $docType, + 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), + 'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '', + 'APP_DOC_TITLE' => '', + 'APP_DOC_FILENAME' => $fileObj['fileName'], + 'FOLDER_UID' => $folderId, + 'APP_DOC_TAGS' => $fileTags); + + + $oAppDocument->update($aFields); + break; + case "NV": //New Version + + + $aFields = array('APP_DOC_UID' => $appDocUid, + 'APP_UID' => $appId, + + 'DEL_INDEX' => 1, + 'USR_UID' => $_SESSION['USER_LOGGED'], + 'DOC_UID' => $docUid, + 'APP_DOC_TYPE' => $docType, + 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), + 'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '', + 'APP_DOC_TITLE' => '', + 'APP_DOC_FILENAME' => $fileObj['fileName'], + 'FOLDER_UID' => $folderId, + 'APP_DOC_TAGS' => $fileTags); + + $oAppDocument->create($aFields); + break; + default: //New + $aFields = array('APP_UID' => $appId, + 'DEL_INDEX' => isset($_SESSION['INDEX'])?$_SESSION['INDEX']:1, + 'USR_UID' => $_SESSION['USER_LOGGED'], + 'DOC_UID' => $docUid, + 'APP_DOC_TYPE' => $docType, + 'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), + 'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '', + 'APP_DOC_TITLE' => '', + 'APP_DOC_FILENAME' => $fileObj['fileName'], + 'FOLDER_UID' => $folderId, + 'APP_DOC_TAGS' => $fileTags); + + + $oAppDocument->create($aFields); + break; + } + + + $sAppDocUid = $oAppDocument->getAppDocUid(); + $iDocVersion = $oAppDocument->getDocVersion(); + $info = pathinfo( $oAppDocument->getAppDocFilename() ); + $ext = (isset($info['extension']) ? $info['extension'] : ''); + + //save the file +// if (!empty($_FILES['form'])) { + // if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) { + $sPathName = PATH_DOCUMENT . $appId . PATH_SEP; + $sFileName = $sAppDocUid . "_".$iDocVersion. '.' . $ext; + G::uploadFile($fileObj['tempName'], $sPathName, $sFileName ); + + //Plugin Hook PM_UPLOAD_DOCUMENT for upload document + $oPluginRegistry =& PMPluginRegistry::getSingleton(); + if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) { + + $oData['APP_UID'] = $appId; + $documentData = new uploadDocumentData ( + $appId, + $_SESSION['USER_LOGGED'], + $sPathName . $sFileName, + $fileObj['fileName'], + $sAppDocUid + ); + + //$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT , $documentData ); + //unlink ( $sPathName . $sFileName ); + } + //end plugin + } + } + + if($sw_error) { // there were errors + $err_msg=""; + for($i=0;$i<$uploadedInstances;$i++) { + if($errors[$i]==NULL) continue; + $err_msg .= $items[$i]." : ".$errors[$i]."\n"; + } + + $response['error']=$err_msg; + $response['message']=$err_msg; + $response['success']=false; + }elseif($emptyInstances==$uploadedInstances){ + $response['error']="You may upload at least one file"; + $response['message']="You may upload at least one file"; + $response['success']=false; + }else{ + $response['error']="Upload complete"; + $response['message']="Upload complete"; + $response['success']=true; + + + } + + + + + + } + + print_r(G::json_encode($response)); +/* + G::LoadClass ( 'case' ); + $oCase = new Cases ( ); + + $G_PUBLISH = new Publisher ( ); + $Fields ['DOC_UID'] = "-1"; + + $Fields ['appId'] = "00000000000000000000000000000000"; + + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'appFolderSaveDocument?UID=-1&appId=' . $Fields ['appId'] . "&folderId=" . $_POST ['folderID'] ); + G::RenderPage ( 'publish', 'raw' ); +*/ + break; + + case "newFolder" : + //G::pr($_POST); + if($_POST ['dir']=="") $_POST ['dir']="/"; + $folderStructure = $oPMFolder->getFolderStructure ( $_POST ['dir'] ); + //G::pr($folderStructure); + $folderPath = $folderStructure ['PATH']; + $parentUid = $_POST ['dir']; + $folderUid = G::GenerateUniqueID (); + + $formNewFolder=array(); + + + $formNewFolder["xtype"]="form"; + $formNewFolder["id"]= "simpleform"; + $formNewFolder["labelWidth"]=125; + $formNewFolder["url"]="../appFolder/appFolderAjax.php"; + $formNewFolder["dialogtitle"]= "Create New Folder"; + $formNewFolder["frame"]= true; + $formNewFolder["items"]= array(); + + + + $field=array(); + $field["xtype"]= "label"; + $field["fieldLabel"]= "Path"; + $field["name"]= "form[FOLDER_PATH]"; + $field["id"]= "form[FOLDER_PATH]"; + $field["width"]=175; + $field["allowBlank"]=false; + $field["value"]=$folderPath; + $field["text"]=$folderPath; + $formNewFolder["items"][]= $field; + + $field=array(); + $field["xtype"]= "hidden"; + $field["fieldLabel"]= "Uid"; + $field["name"]= "form[FOLDER_UID]"; + $field["id"]= "form[FOLDER_UID]"; + $field["width"]=175; + $field["allowBlank"]=false; + $field["value"]=$folderUid; + $formNewFolder["items"][]= $field; + + $field=array(); + $field["xtype"]= "hidden"; + $field["fieldLabel"]= "Parent"; + $field["name"]= "form[FOLDER_PARENT_UID]"; + $field["id"]= "form[FOLDER_PARENT_UID]"; + $field["width"]=175; + $field["allowBlank"]=false; + $field["value"]=$parentUid; + $formNewFolder["items"][]= $field; + + $field=array(); + $field["xtype"]= "textfield"; + $field["fieldLabel"]= "Name"; + $field["name"]= "form[FOLDER_NAME]"; + $field["id"]= "form[FOLDER_NAME]"; + $field["width"]=175; + $field["allowBlank"]=false; + $formNewFolder["items"][]= $field; + + + $formNewFolder["buttons"]= array(); + + + + $button=array(); + $button["text"]= "Create"; + $button["handler"]= 'handlerCreate'; + $formNewFolder["buttons"][]= $button; + + $button=array(); + $button["text"]= "Cancel"; + $button["handler"]= 'handlerCancel'; + $formNewFolder["buttons"][]= $button; + + $handlerCreate='function() { + statusBarMessage( "Please wait...", true ); + Ext.getCmp("simpleform").getForm().submit({ + //reset: true, + reset: false, + success: function(form, action) { + statusBarMessage( action.result.message, false, true ); + try{ + dirTree.getSelectionModel().getSelectedNode().reload(); + } catch(e) {} + datastore.reload(); + Ext.getCmp("dialog").destroy(); + }, + failure: function(form, action) { + if( !action.result ) return; + Ext.Msg.alert("Error!", action.result.error); + statusBarMessage( action.result.error, false, false ); + }, + scope: Ext.getCmp("simpleform"), + // add some vars to the request, similar to hidden fields + params: {option: "new", + action: "appFolderSave", + dir: datastore.directory, + confirm: "true"} + }) + }'; + + $handlerCancel='function() { Ext.getCmp("dialog").destroy(); }'; + + $response=G::json_encode($formNewFolder); + //This will add the functions to the Json response without quotes! + $response=str_replace('"handlerCreate"',$handlerCreate,$response); + $response=str_replace('"handlerCancel"',$handlerCancel,$response); + print_r($response); + + /* + $oFolder = new AppFolder ( ); + $folderStructure = $oPMFolder->getFolderStructure ( $_POST ['folderID'] ); + $Fields ['FOLDER_PATH'] = $folderStructure ['PATH']; + $Fields ['FOLDER_PARENT_UID'] = $_POST ['folderID']; + $Fields ['FOLDER_UID'] = G::GenerateUniqueID (); + $G_PUBLISH = new Publisher ( ); + + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderEdit', '', $Fields, 'appFolderSave' ); + G::RenderPage ( 'publish', 'raw' ); + */ + break; + case "appFolderSave": + $form = $_POST['form']; + $FolderUid = $form['FOLDER_UID']; + $FolderParentUid = $form['FOLDER_PARENT_UID']; + $FolderName = $form['FOLDER_NAME']; + $FolderCreateDate = 'now'; + $FolderUpdateDate = 'now'; + $response['action']=$_POST['action']. " - ".$_POST['option']; + $response['error']="error"; + $response['message']="error"; + $response['success']=false; + $folderCreateResponse = $oPMFolder->createFolder ( $FolderName, $FolderParentUid, "new" ); + + $response=array_merge($response,$folderCreateResponse); + + print_r(G::json_encode($response)); + + + break; + case "documentInfo" : + $oFolder = new AppFolder ( ); + $Fields = $oPMFolder->getCompleteDocumentInfo ( $_POST ['appId'], $_POST ['appDocId'], $_POST ['docVersion'], $_POST ['docID'], $_POST ['usrUid'] ); + $G_PUBLISH = new Publisher ( ); + + $G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'appFolder/appFolderDocumentInfo', '', $Fields, '' ); + G::RenderPage ( 'publish', 'raw' ); + + break; + + case "documentdelete": + include_once ("classes/model/AppDocument.php"); + $oAppDocument = new AppDocument ( ); + $oAppDocument->remove($_POST['sFileUID'],$_POST['docVersion']); + /*we need to delete fisicaly the file use the follow code + $appId= "00000000000000000000000000000000"; + $sPathName = PATH_DOCUMENT . $appId . PATH_SEP; + unlink($sPathName.$_POST['sFileUID'].'_1.jpg');*/ + break; + + case "deletePMFolder": + include_once ("classes/model/AppFolder.php"); + $oAppFoder = new AppFolder ( ); + $oAppFoder->remove($_POST['sFileUID'],$_POST['rootfolder']); + + break; + +} +function getMime($fileName){ + $fileName=basename($fileName); + $fileNameA=explode(".",$fileName); + $return['description']=G::LoadTranslation("MIME_DES_DOCUMENT"); + $return['icon']="/images/documents/extension/document.png"; + if(count($fileNameA)>1){ + $extension=$fileNameA[count($fileNameA)-1]; + $return['description']=G::LoadTranslation("MIME_DES_".strtoupper($extension)); + $return['icon']="/images/documents/extension/".strtolower($extension).".png"; + } + return $return; +} +function get_max_file_size() { // get php max_upload_file_size + return calc_php_setting_bytes( ini_get("upload_max_filesize") ); +} +function get_max_upload_limit() { + return calc_php_setting_bytes( ini_get('post_max_size')); +} + +function calc_php_setting_bytes( $value ) { + if(@eregi("G$",$value)) { + $value = substr($value,0,-1); + $value = round($value*1073741824); + } elseif(@eregi("M$",$value)) { + $value = substr($value,0,-1); + $value = round($value*1048576); + } elseif(@eregi("K$",$value)) { + $value = substr($value,0,-1); + $value = round($value*1024); + } + + return $value; +} +function get_abs_item($dir, $item) { // get absolute file+path + if( is_array( $item )) { + // FTP Mode + $abs_item = '/' . get_abs_dir($dir)."/".$item['name']; + if( get_is_dir($item)) $abs_item.='/'; + return extPathName($abs_item); + } + return extPathName( get_abs_dir($dir)."/".$item ); +} +function extPathName($p_path,$p_addtrailingslash = false) { + $retval = ""; + + $isWin = (substr(PHP_OS, 0, 3) == 'WIN'); + + if ($isWin) { + $retval = str_replace( '/', '\\', $p_path ); + if ($p_addtrailingslash) { + if (substr( $retval, -1 ) != '\\') { + $retval .= '\\'; + } + } + + // Check if UNC path + $unc = substr($retval,0,2) == '\\\\' ? 1 : 0; + + // Remove double \\ + $retval = str_replace( '\\\\', '\\', $retval ); + + // If UNC path, we have to add one \ in front or everything breaks! + if ( $unc == 1 ) { + $retval = '\\'.$retval; + } + } else { + $retval = str_replace( '\\', '/', $p_path ); + if ($p_addtrailingslash) { + if (substr( $retval, -1 ) != '/') { + $retval .= '/'; + } + } + + // Check if UNC path + $unc = substr($retval,0,2) == '//' ? 1 : 0; + + // Remove double // + $retval = str_replace('//','/',$retval); + + // If UNC path, we have to add one / in front or everything breaks! + if ( $unc == 1 ) { + $retval = '/'.$retval; + } + } + + return $retval; } \ No newline at end of file diff --git a/workflow/engine/methods/cases/casesStartPage.php b/workflow/engine/methods/cases/casesStartPage.php index 57f27be5a..0cf76c835 100644 --- a/workflow/engine/methods/cases/casesStartPage.php +++ b/workflow/engine/methods/cases/casesStartPage.php @@ -5,6 +5,14 @@ } $oHeadPublisher =& headPublisher::getSingleton(); + //$oHeadPublisher->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. diff --git a/workflow/engine/templates/cases/casesStartPage.js b/workflow/engine/templates/cases/casesStartPage.js index cda3f1648..1f811b38b 100644 --- a/workflow/engine/templates/cases/casesStartPage.js +++ b/workflow/engine/templates/cases/casesStartPage.js @@ -4,42 +4,11 @@ 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 caseStatusByProcess = new Ext.data.JsonStore({ - fields : [ 'process', 'inbox', 'draft', 'unassigned' ], - root : 'caseStatusByProcess' -}); - -var caseDelayed = new Ext.data.JsonStore({ - fields : [ 'delayed', 'total' ], - root : 'caseDelayed' -}); - -function getDashboardData() { - - var parameters = { - action : 'getSimpleDashboardData' - }; - conn.request({ - url : 'casesStartPage_Ajax.php', - method : 'POST', - params : { - "action" : 'getSimpleDashboardData' - }, - success : function(responseObject) { - var responseData = Ext.decode(responseObject.responseText); - - // Load store from here - caseStatusByProcess.loadData(responseData); - caseDelayed.loadData(responseData); - }, - failure : function() { - Ext.Msg.alert('Status', 'Unable to get list of Process'); - } - }); -} function getOtherDashboards(dashboardTabPanels) { conn.request({ @@ -49,7 +18,6 @@ function getOtherDashboards(dashboardTabPanels) { "action" : 'getRegisteredDashboards' }, success : function(responseObject) { - var response = Ext.util.JSON.decode(responseObject.responseText); for ( var i = 0; i < response.length; i++) { tabInfo = response[i]; @@ -76,70 +44,6 @@ function getOtherDashboards(dashboardTabPanels) { }); } -function getDashboardItems() { - dashboardItems = [ { - store : caseDelayed, - xtype : 'piechart', - dataField : 'total', - categoryField : 'delayed', - width : 250, - height : 250, - draggable : true, - disableCaching : true, - expressInstall : true, - // extra styles get applied to the chart defaults - extraStyle : { - legend : { - display : 'bottom', - padding : 5, - font : { - family : 'Tahoma', - size : 13 - } - } - } - - }, { - title : 'Status by Process', - xtype : 'columnchart', - store : caseStatusByProcess, - width : 450, - height : 400, - series : [ { - yField : 'inbox', - displayName : 'Inbox' - }, { - yField : 'draft', - displayName : 'Draft' - }, { - yField : 'unassigned', - displayName : 'Unassigned' - } ], - xField : 'process', - draggable : true, - xAxis : new Ext.chart.CategoryAxis({ - // title : 'Case Status', - labelRenderer : this.customFormat - }), - customFormat : function(value) { - return 'Year: '; - }, - yAxis : new Ext.chart.NumericAxis({ - title : 'Total' - }), - extraStyle : { - xAxis : { - labelRotation : -45 - }, - legend : { - display : 'right' - } - } - } ]; - getDashboardData(); - return dashboardItems; -} - function getDefaultDashboard(dashboardTabPanels) { defaultDashboard = "mainDashboard"; dashboardTabPanels.setActiveTab(defaultDashboard); @@ -185,243 +89,237 @@ function getDefaultDashboard(dashboardTabPanels) { Docs = {}; // console.info("Doc Panel - Start"); +/* +DocPanel = Ext.extend(Ext.Panel, + { + closable : true, + autoScroll : true, -DocPanel = Ext.extend(Ext.Panel, { - closable : true, - autoScroll : true, + initComponent : function() { + // var ps = this.cclass.split('.'); + // this.title = ps[ps.length-1]; + Ext.apply(this, { + tbar : [ + '->', + { + text : 'Config Options', + handler : this.scrollToMember.createDelegate( + this, [ 'configs' ]), + iconCls : 'icon-config' + }, + '-', + { + text : 'Properties', + handler : this.scrollToMember.createDelegate( + this, [ 'props' ]), + iconCls : 'icon-prop' + }, + '-', + { + text : 'Methods', + handler : this.scrollToMember.createDelegate( + this, [ 'methods' ]), + iconCls : 'icon-method' + }, + '-', + { + text : 'Events', + handler : this.scrollToMember.createDelegate( + this, [ 'events' ]), + iconCls : 'icon-event' + }, + '-', + { + text : 'Direct Link', + handler : this.directLink, + scope : this, + iconCls : 'icon-fav' + }, + '-', + { + tooltip : 'Hide Inherited Members', + iconCls : 'icon-hide-inherited', + enableToggle : true, + scope : this, + toggleHandler : function(b, pressed) { + this.body[pressed ? 'addClass' + : 'removeClass']('hide-inherited'); + } + }, + '-', + { + tooltip : 'Expand All Members', + iconCls : 'icon-expand-members', + enableToggle : true, + scope : this, + toggleHandler : function(b, pressed) { + this.body[pressed ? 'addClass' + : 'removeClass']('full-details'); + } + } ] + }); + DocPanel.superclass.initComponent.call(this); + }, - initComponent : function() { - // var ps = this.cclass.split('.'); - // this.title = ps[ps.length-1]; - Ext.apply(this, { - tbar : [ - '->', - { - text : 'Config Options', - handler : this.scrollToMember.createDelegate( - this, [ 'configs' ]), - iconCls : 'icon-config' - }, - '-', - { - text : 'Properties', - handler : this.scrollToMember.createDelegate( - this, [ 'props' ]), - iconCls : 'icon-prop' - }, - '-', - { - text : 'Methods', - handler : this.scrollToMember.createDelegate( - this, [ 'methods' ]), - iconCls : 'icon-method' - }, - '-', - { - text : 'Events', - handler : this.scrollToMember.createDelegate( - this, [ 'events' ]), - iconCls : 'icon-event' - }, - '-', - { - text : 'Direct Link', - handler : this.directLink, - scope : this, - iconCls : 'icon-fav' - }, - '-', - { - tooltip : 'Hide Inherited Members', - iconCls : 'icon-hide-inherited', - enableToggle : true, - scope : this, - toggleHandler : function(b, pressed) { - this.body[pressed ? 'addClass' - : 'removeClass']('hide-inherited'); - } - }, - '-', - { - tooltip : 'Expand All Members', - iconCls : 'icon-expand-members', - enableToggle : true, - scope : this, - toggleHandler : function(b, pressed) { - this.body[pressed ? 'addClass' - : 'removeClass']('full-details'); - } - } ] - }); - DocPanel.superclass.initComponent.call(this); - }, + directLink : function() { + var link = String.format( + "{0}", + document.location.href + '?class=' + this.cclass); + Ext.Msg.alert('Direct Link to ' + this.cclass, link); + }, - directLink : function() { - var link = String.format( - "{0}", - document.location.href + '?class=' + this.cclass); - Ext.Msg.alert('Direct Link to ' + this.cclass, link); - }, - - scrollToMember : function(member) { - var el = Ext.fly(this.cclass + '-' + member); - if (el) { - var top = (el.getOffsetsTo(this.body)[1]) - + this.body.dom.scrollTop; - this.body.scrollTo('top', top - 25, { - duration : 0.75, - callback : this.hlMember.createDelegate(this, - [ member ]) - }); - } - }, - - scrollToSection : function(id) { - var el = Ext.getDom(id); - if (el) { - var top = (Ext.fly(el).getOffsetsTo(this.body)[1]) - + this.body.dom.scrollTop; - this.body.scrollTo('top', top - 25, { - duration : 0.5, - callback : function() { - Ext.fly(el).next('h2').pause(0.2).highlight( - '#8DB2E3', { - attr : 'color' - }); - } - }); - } - }, - - hlMember : function(member) { - var el = Ext.fly(this.cclass + '-' + member); - if (el) { - if (tr = el.up('tr')) { - tr.highlight('#cadaf9'); - } - } - } -}); + scrollToMember : function(member) { + var el = Ext.fly(this.cclass + '-' + member); + if (el) { + var top = (el.getOffsetsTo(this.body)[1]) + + this.body.dom.scrollTop; + this.body.scrollTo('top', top - 25, { + duration : 0.75, + callback : this.hlMember.createDelegate(this, + [ member ]) + }); + } + }, + scrollToSection : function(id) { + var el = Ext.getDom(id); + if (el) { + var top = (Ext.fly(el).getOffsetsTo(this.body)[1]) + + this.body.dom.scrollTop; + this.body.scrollTo('top', top - 25, { + duration : 0.5, + callback : function() { + Ext.fly(el).next('h2').pause(0.2).highlight( + '#8DB2E3', { + attr : 'color' + }); + } + }); + } + }, + hlMember : function(member) { + var el = Ext.fly(this.cclass + '-' + member); + if (el) { + if (tr = el.up('tr')) { + tr.highlight('#cadaf9'); + } + } + } + }); +*/ 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({ + 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) { - if (n.attributes.optionType == "startProcess") { - Ext.Msg.show({ - title : 'Start Case', - msg : 'Starting new case

' - + n.attributes.text - + '', - icon : Ext.MessageBox.INFO - }); - Ext.Ajax.request({ - url : 'casesStartPage_Ajax.php', - params : { - action : 'startCase', - processId : n.attributes.pro_uid, - taskId : n.attributes.tas_uid - }, - success : function(response) { - 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 : '', - 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) { - mainPanel.showDetails(n); - } - }, - root : { - nodeType : 'async', - draggable : false, - id : 'root', - expanded : true - } + dataUrl : 'casesStartPage_Ajax.php', + baseParams : { + action : 'getProcessList' + } + }), + listeners : { + dblclick : function(n) { + if (n.attributes.optionType == "startProcess") { + Ext.Msg.show({ + title : 'Start Case', + msg : 'Starting new case

' + n.attributes.text + + '', + icon : Ext.MessageBox.INFO + }); + Ext.Ajax.request({ + url : 'casesStartPage_Ajax.php', + params : { + action : 'startCase', + processId : n.attributes.pro_uid, + taskId : n.attributes.tas_uid + }, + success : function(response) { + 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 : '', + 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) { + mainPanel.showDetails(n); + } + }, + root : { + nodeType : 'async', + draggable : false, + id : 'root', + expanded : true + } }; var startCaseTab = { - id : 'startCase', - title : 'Start Case', - iconCls : 'ICON_CASES_START_CASE', - layout : 'border', - items : [ - { - id : 'img-chooser-view', - region : 'center', + id : 'startCase', + title : 'Start Case', + iconCls : 'ICON_CASES_START_CASE', + layout : 'border', + items : [ { + id : 'img-chooser-view', + region : 'center', style : { width : '50%' - }, - // autoScroll: true, - items : [ newCaseTree ] - }, { + // autoScroll: true, + items : [ newCaseTree ] + }, { xtype:'form', - id : 'process-detail-panel', - region : 'east', - //autoHeight : true, - split : true, - style : { - width : '50%' + id : 'process-detail-panel', + region : 'east', + // autoHeight : true, + split : true, + style : { + width : '50%' }, -// minWidth : 150, - frame: true, +// minWidth : 150, + //frame: true, labelAlign: 'right', labelWidth: 85, - // width:340, + // width:340, waitMsgTarget: true, title:'Process Information', layout:'form', defaults: {width: 350}, defaultType: 'textfield', - - items: [{ fieldLabel: 'Process', name: 'processName', allowBlank:false, value: '', disabled: true, - //readonly:true, + // readonly:true, id:"processName" },{ fieldLabel: 'Task', @@ -471,7 +369,6 @@ var startCaseTab = { {boxLabel: 'Fri', name: '5'}, {boxLabel: 'Sat', name: '6'} ] - }, { xtype:'checkbox', fieldLabel: 'Debug Mode', @@ -482,430 +379,1642 @@ var startCaseTab = { } ], - 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 - } - );*/ + 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); + 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', - 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); - } - } - ] + handler : function() { + tree = Ext.getCmp('startCaseTreePanel'); + tree.getLoader().load(tree.root); + } + } ] }; + + 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 ['
', + '
', + '

', t, '

', s, '
', + '
', + '
'].join(''); + } + return { + msg : function(title, format){ + if(!msgCt){ + msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true); + } + msgCt.alignTo(document, 't-t'); + var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1)); + var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true); + m.setWidth(400 ); + m.position(null, 5000 ); + m.alignTo(document, 't-t'); + Ext.get('x-box-mc-inner' ).setStyle('background-image', 'url("/images/documents/_accept.png")'); + Ext.get('x-box-mc-inner' ).setStyle('background-position', '5px 10px'); + Ext.get('x-box-mc-inner' ).setStyle('background-repeat', 'no-repeat'); + Ext.get('x-box-mc-inner' ).setStyle('padding-left', '35px'); + m.slideIn('t').pause(3).ghost("t", {remove:true}); + } + }; + }(); + + + function statusBarMessage( msg, isLoading, success ) { + //console.log("Status Bar needed"); + var statusBar = Ext.getCmp('statusPanel'); + if( !statusBar ) return; + //console.log("Status bar acceced: "+msg); + if( isLoading ) { + statusBar.showBusy(); + } + else { + statusBar.setStatus("Done."); + } + if( success ) { + statusBar.setStatus({ + text: 'success: ' + msg, + iconCls: 'success', + clear: true + }); + Ext.msgBoxSlider.msg('success', msg ); + } else if( success != null ) { + statusBar.setStatus({ + text: 'error: ' + msg, + iconCls: 'error', + clear: true + }); + + } + + + } + + function selectFile( dir, file ) { + //console.log("file selected: "+dir+" - "+file); + chDir( dir ); + var conn = datastore.proxy.getConnection(); + if( conn.isLoading() ) { + setTimeout( "selectFile(\"" + dir + "\", \""+ file + "\")", 1000 ); + } + idx = datastore.find( "name", file ); + if( idx >= 0 ) { + ext_itemgrid.getSelectionModel().selectRow( idx ); + } + } + + /** + * Debug Function, that works like print_r for Objects in Javascript + */ + function var_dump(obj) { + var vartext = ""; + for (var prop in obj) { + if( isNaN( prop.toString() )) { + vartext += "\t->"+prop+" = "+ eval( "obj."+prop.toString()) +"\n"; + } + } + if(typeof obj == "object") { + return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "") + "\n" + vartext; + } else { + return "Type: "+typeof(obj)+"\n" + vartext; + } + }// end function var_dump + + +datastore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : "../appFolder/appFolderAjax.php", + directory : "/", + params : { + start : 0, + limit : 150, + dir : this.directory, + node : this.directory, + option : "gridDocuments", + action : "expandNode" + } + }), + directory : "/", + sendWhat : "both", + // create reader that reads the File records + reader : new Ext.data.JsonReader({ + root : "items", + totalProperty : "totalCount" + }, Ext.data.Record.create([ { + name : "name" + }, { + name : "size" + }, { + name : "type" + }, { + name : "modified" + }, { + name : "perms" + }, { + name : "icon" + }, { + name : "owner" + }, { + name : "is_deletable" + }, { + name : "is_file" + }, { + name : "is_archive" + }, { + name : "is_writable" + }, { + name : "is_chmodable" + }, { + name : "is_readable" + }, { + name : "is_deletable" + }, { + name : "is_editable" + }, { + name : "id" + }, { + name : "docVersion" + }, { + name : "appDocType" + }, { + name : "appDocCreateDate" + }, { + name : "appLabel" + }, { + name : "proTitle" + }, { + name : "appDocVersionable" + } + ])), + + // turn on remote sorting + remoteSort : true +}); +datastore.paramNames["dir"] = "direction"; +datastore.paramNames["sort"] = "order"; + +datastore.on("beforeload", + function(ds, options) { + options.params.dir = options.params.dir ? options.params.dir + : ds.directory; + node = options.params.dir ? options.params.dir : ds.directory; + options.params.option = "gridDocuments"; + options.params.action = "expandNode"; + options.params.sendWhat = datastore.sendWhat; + }); +// pluggable renders +function renderFileName(value, p, record) { + return String.format( + '*  {1}', + record.get('icon'), value); +} +function renderType(value) { + return String.format('{0}', value); +} +function renderVersion(value, p, record) { + // addcc.png + // system-search.png + if(record.get("appDocVersionable")=="1"){ + if(value>1){ + return String.format( + '{1}  * ', + "/images/addc.png", value); + }else{ + return String.format( + '{1}  * ', + "/images/addc.png", value); + } + }else{ + + return String.format( + '-', + value); + } +} + +var gridtb = new Ext.Toolbar( + [ + { + xtype : "tbbutton", + id : 'tb_home', + icon : '/images/documents/_home.png', + //text : 'Root', + tooltip : 'Root Folder', + //cls : 'x-btn-text-icon', + cls : 'x-btn-icon', + handler : function() { + chDir(''); + } + }, + { + xtype : "tbbutton", + id : 'tb_reload', + icon : '/images/documents/_reload.png', + //text : 'Reload', + tooltip : 'Reload', + //cls : 'x-btn-text-icon', + cls : 'x-btn-icon', + handler : loadDir + }, + + { + xtype : "tbbutton", + id : 'tb_search', + icon : '/images/documents/_filefind.png', + //text : 'Search', + tooltip : 'Search', + //cls : 'x-btn-text-icon', + cls : 'x-btn-icon', + disabled : true, + handler : function() { + openActionDialog(this, 'search'); + } + }, + '-', + { + xtype : "tbbutton", + id : 'tb_new', + icon : '/images/documents/_filenew.png', + tooltip : 'New Folder', + cls : 'x-btn-icon', + disabled : false, + handler : function() { + openActionDialog(this, 'newFolder'); + } + }, + { + xtype : "tbbutton", + id : 'tb_copy', + icon : '/images/documents/_editcopy.png', + tooltip : 'Copy', + cls : 'x-btn-icon', + disabled : 'true', + handler : function() { + openActionDialog(this, 'copy'); + } + }, + { + xtype : "tbbutton", + id : 'tb_move', + icon : '/images/documents/_move.png', + tooltip : 'Move', + cls : 'x-btn-icon', + disabled : 'true', + handler : function() { + openActionDialog(this, 'move'); + } + }, + { + xtype : "tbbutton", + id : 'tb_delete', + icon : '/images/documents/_editdelete.png', + tooltip : 'dellink', + cls : 'x-btn-icon', + disabled : 'true', + handler : function() { + openActionDialog(this, 'delete'); + } + }, + { + xtype : "tbbutton", + id : 'tb_rename', + icon : '/images/documents/_fonts.png', + tooltip : 'renamelink', + cls : 'x-btn-icon', + disabled : 'true', + handler : function() { + openActionDialog(this, 'rename'); + } + }, + '-', + { + xtype : "tbbutton", + id : 'tb_download', + icon : '/images/documents/_down.png', + tooltip : 'downlink', + cls : 'x-btn-icon', + disabled : 'true', + handler : function() { + openActionDialog(this, 'download'); + } + }, + { + xtype : "tbbutton", + id : 'tb_upload', + icon : '/images/documents/_up.png', + tooltip : 'Upload', + cls : 'x-btn-icon', + disabled : false, + handler : function() { + /* + Ext.ux.OnDemandLoad + .load("/scripts/extjs3-ext/ux.swfupload/SwfUploadPanel.css"); + Ext.ux.OnDemandLoad + .load("/scripts/extjs3-ext/ux.swfupload/SwfUpload.js"); + Ext.ux.OnDemandLoad + .load( + "/scripts/extjs3-ext/ux.swfupload/SwfUploadPanel.js", + function(options) { + openActionDialog(this, 'upload'); + });*/ + openActionDialog(this, 'uploadDocument'); + } + }, + '-', + new Ext.Toolbar.Button({ + text : 'Show Dirs', + enableToggle : true, + pressed : true, + handler : function(btn, e) { + if (btn.pressed) { + datastore.sendWhat = 'both'; + loadDir(); + } else { + datastore.sendWhat = 'files'; + loadDir(); + } + } + }), '-', new Ext.form.TextField({ + name : "filterValue", + id : "filterField", + enableKeyEvents : true, + title : "Filter current view", + emptyText : 'Filter current view', + listeners : { + "keypress" : { + fn : function(textfield, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + filterDataStore(); + } + } + } + } + }), new Ext.Toolbar.Button({ + text : ' X ', + handler : function() { + datastore.clearFilter(); + Ext.getCmp("filterField").setValue(""); + } + }) + + ]); +function filterDataStore(btn, e) { + var filterVal = Ext.getCmp("filterField").getValue(); + if (filterVal.length > 1) { + datastore.filter('name', eval('/' + filterVal + '/gi')); + } else { + datastore.clearFilter(); + } +} +// add a paging toolbar to the grid's footer +var gridbb = new Ext.PagingToolbar({ + store : datastore, + pageSize : 25 , + displayInfo : true, + displayMsg : '% % %', + emptyMsg : 'No items to display', + beforePageText : 'Page', + afterPageText : 'of %', + firstText : 'First', + lastText : 'Last', + nextText : 'Next', + prevText : 'Previous', + refreshText : 'Reload', + items : [ '-', ' ', ' ', ' ', ' ', ' ', new Ext.ux.StatusBar({ + defaultText : 'Done', + id : 'statusPanel' + }) ] +}); + +// the column model has information about grid columns +// dataIndex maps the column to the specific data field in +// the data store +var cm = new Ext.grid.ColumnModel([ { + id : 'gridcm', // id assigned so we can apply custom css (e.g. + // .x-grid-col-topic b { color:#333 }) + header : "Name", + dataIndex : 'name', + width : 250, + renderer : renderFileName, + editor : new Ext.form.TextField({ + allowBlank : false + }), + css : 'white-space:normal;' +}, { + header : "Version", + dataIndex : 'docVersion', + width : 50, + align : 'center', + renderer : renderVersion +}, { + header : "Modified", + dataIndex : 'appDocCreateDate', + width : 90 +}, { + header : "Owner", + dataIndex : 'owner', + width : 150 + // sortable : false +}, { + header : "PM Type", + dataIndex : 'appDocType', + width : 70// , + // align : 'right' + // renderer : renderType +}, { + header : "Type", + dataIndex : 'type', + width : 70, + // align : 'right', + renderer : renderType +}, { + header : "Process", + dataIndex : 'proTitle', + width : 150// , + // align : 'right' + // renderer : renderType +}, { + header : "Case", + dataIndex : 'appLabel', + width : 150// , + // align : 'right' + // renderer : renderType +},{ + header : "Size", + dataIndex : 'size', + width : 50, + hidden:true +}, { + header : "Permissions", + dataIndex : 'perms', + width : 100, + hidden:true +}, { + dataIndex : 'is_deletable', + header : "is_deletable", + hidden : true, + hideable : false +}, { + dataIndex : 'is_file', + hidden : true, + hideable : false +}, { + dataIndex : 'is_archive', + hidden : true, + hideable : false +}, { + dataIndex : 'is_writable', + hidden : true, + hideable : false +}, { + dataIndex : 'is_chmodable', + hidden : true, + hideable : false +}, { + dataIndex : 'is_readable', + hidden : true, + hideable : false +}, { + dataIndex : 'is_deletable', + hidden : true, + hideable : false +}, { + dataIndex : 'is_editable', + hidden : true, + hideable : false +}, { + dataIndex : 'id', + hidden : true, + hideable : false +} ]); + +// by default columns are sortable +cm.defaultSortable = true; + +// Unregister the default double click action (which makes the name field +// editable - we want this when the user clicks "Rename" in the menu) +// ext_itemgrid.un('celldblclick', ext_itemgrid.onCellDblClick); + +function handleRowClick(sm, rowIndex) { + //console.log("Row Clicked: "+rowIndex); + var selections = sm.getSelections(); + tb = ext_itemgrid.getTopToolbar(); + if (selections.length > 1) { + tb.items.get('tb_delete').enable(); + tb.items.get('tb_rename').disable(); + tb.items.get('tb_download').disable(); + } else if (selections.length == 1) { + tb.items.get('tb_delete')[selections[0].get('is_deletable') ? 'enable' + : 'disable'](); + tb.items.get('tb_rename')[selections[0].get('is_deletable') ? 'enable' + : 'disable'](); + tb.items.get('tb_download')[selections[0].get('is_readable') + && selections[0].get('is_file') ? 'enable' : 'disable'](); + } else { + tb.items.get('tb_delete').disable(); + tb.items.get('tb_rename').disable(); + tb.items.get('tb_download').disable(); + } + return true; +} + + +// trigger the data store load +function loadDir() { + //console.info("loadDir"); + //console.trace(); + datastore.load({ + params : { + start : 0, + limit : 150, + dir : datastore.directory, + node : datastore.directory, + option : 'gridDocuments', + action : 'expandNode', + sendWhat : datastore.sendWhat + } + }); +} + +function rowContextMenu(grid, rowIndex, e, f) { + //console.log("Context menu: "+grid+" - "+rowIndex); + if (typeof e == 'object') { + e.preventDefault(); + } else { + e = f; + } + gsm = ext_itemgrid.getSelectionModel(); + gsm.clickedRow = rowIndex; + var selections = gsm.getSelections(); + if (selections.length > 1) { + gridCtxMenu.items.get('gc_delete').enable(); + gridCtxMenu.items.get('gc_rename').disable(); + gridCtxMenu.items.get('gc_download').disable(); + } else if (selections.length == 1) { + gridCtxMenu.items.get('gc_delete')[selections[0].get('is_deletable') ? 'enable' + : 'disable'](); + gridCtxMenu.items.get('gc_rename')[selections[0].get('is_deletable') ? 'enable' + : 'disable'](); + gridCtxMenu.items.get('gc_download')[selections[0].get('is_readable') + && selections[0].get('is_file') ? 'enable' : 'disable'](); + } + gridCtxMenu.show(e.getTarget(), 'tr-br?'); + +} +gridCtxMenu = new Ext.menu.Menu({ + id : 'gridCtxMenu', + + items : [ { + id : 'gc_rename', + icon : '/images/documents/_fonts.png', + text : 'renamelink', + handler : function() { + ext_itemgrid.onCellDblClick(ext_itemgrid, gsm.clickedRow, 0); + gsm.clickedRow = null; + } + }, { + id : 'gc_copy', + icon : '/images/documents/_editcopy.png', + text : 'copylink', + handler : function() { + openActionDialog(this, 'copy'); + } + }, { + id : 'gc_move', + icon : '/images/documents/_move.png', + text : 'movelink', + handler : function() { + openActionDialog(this, 'move'); + } + }, { + id : 'gc_delete', + icon : '/images/documents/_editdelete.png', + text : 'dellink', + handler : function() { + openActionDialog(this, 'delete'); + } + }, '-', { + id : 'gc_download', + icon : '/images/documents/_down.png', + text : 'downlink', + handler : function() { + openActionDialog(this, 'download'); + } + }, + + '-', { + id : 'cancel', + icon : '/images/documents/_cancel.png', + text : 'btncancel', + handler : function() { + gridCtxMenu.hide(); + } + } ] +}); + +function dirContext(node, e) { + //console.log("Dir context menu: "+node); + // Select the node that was right clicked + node.select(); + // Unselect all files in the grid + ext_itemgrid.getSelectionModel().clearSelections(); + + dirCtxMenu.items.get('dirCtxMenu_rename')[node.attributes.is_deletable ? 'enable' + : 'disable'](); + dirCtxMenu.items.get('dirCtxMenu_remove')[node.attributes.is_deletable ? 'enable' + : 'disable'](); + + dirCtxMenu.node = node; + dirCtxMenu.show(e.getTarget(), 't-b?'); + +} + +function copymove(action) { + var s = dropEvent.data.selections, r = []; + if (s) { + // Dragged from the Grid + requestParams = getRequestParams(); + requestParams.new_dir = dropEvent.target.id.replace(/_RRR_/g, '/'); + requestParams.new_dir = requestParams.new_dir.replace(/ext_root/g, ''); + requestParams.confirm = 'true'; + requestParams.action = action; + handleCallback(requestParams); + } else { + // Dragged from inside the tree + // alert('Move ' + dropEvent.data.node.id.replace( /_RRR_/g, '/' )+' to + // '+ dropEvent.target.id.replace( /_RRR_/g, '/' )); + requestParams = getRequestParams(); + requestParams.dir = datastore.directory.substring(0, + datastore.directory.lastIndexOf('/')); + requestParams.new_dir = dropEvent.target.id.replace(/_RRR_/g, '/'); + requestParams.new_dir = requestParams.new_dir.replace(/ext_root/g, ''); + requestParams.selitems = Array(dropEvent.data.node.id.replace(/_RRR_/g, + '/')); + requestParams.confirm = 'true'; + requestParams.action = action; + handleCallback(requestParams); + } +} +// context menus +var dirCtxMenu = new Ext.menu.Menu( + { + id : 'dirCtxMenu', + items : [ + { + id : 'dirCtxMenu_new', + icon : '/images/documents/_folder_new.png', + text : 'New', + handler : function() { + dirCtxMenu.hide(); + openActionDialog(this, 'newFolder'); + } + }, + { + id : 'dirCtxMenu_rename', + icon : '/images/documents/_fonts.png', + text : 'Rename', + handler : function() { + dirCtxMenu.hide(); + openActionDialog(this, 'rename'); + } + }, + { + id : 'dirCtxMenu_copy', + icon : '/images/documents/_editcopy.png', + text : 'Copy', + handler : function() { + dirCtxMenu.hide(); + openActionDialog(this, 'copy'); + } + }, + { + id : 'dirCtxMenu_move', + icon : '/images/documents/_move.png', + text : 'Move', + handler : function() { + dirCtxMenu.hide(); + openActionDialog(this, 'move'); + } + }, + { + id : 'dirCtxMenu_remove', + icon : '/images/documents/_editdelete.png', + text : 'Remove', + handler : function() { + dirCtxMenu.hide(); + var num = 1; + Ext.Msg + .confirm( + 'Confirm', + String + .format( + "Delete?", + num), + function(btn) { + deleteDir(btn, dirCtxMenu.node); + }); + } + }, '-', { + id : 'dirCtxMenu_reload', + icon : '/images/documents/_reload.png', + text : 'Refresh', + handler : function() { + dirCtxMenu.hide(); + dirCtxMenu.node.reload(); + } + }, '-', { + id : 'dirCtxMenu_cancel', + icon : '/images/documents/_cancel.png', + text : 'Cancel', + handler : function() { + dirCtxMenu.hide(); + } + } ] + }); +var copymoveCtxMenu = new Ext.menu.Menu({ + id : 'copyCtx', + items : [ { + id : 'copymoveCtxMenu_copy', + icon : '/images/documents/_editcopy.png', + text : 'copylink', + handler : function() { + copymoveCtxMenu.hide(); + copymove('copy'); + } + }, { + id : 'copymoveCtxMenu_move', + icon : '/images/documents/_move.png', + text : 'movelink', + handler : function() { + copymoveCtxMenu.hide(); + copymove('move'); + } + }, '-', { + id : 'copymoveCtxMenu_cancel', + icon : '/images/documents/_cancel.png', + text : 'btncancel', + handler : function() { + copymoveCtxMenu.hide(); + } + } ] +}); + +function copymoveCtx(e) { + // ctxMenu.items.get('remove')[node.attributes.allowDelete ? 'enable' : + // 'disable'](); + copymoveCtxMenu.showAt(e.rawEvent.getXY()); +} + var documentsTab = { - id : 'documents', - title : 'Documents', - iconCls : 'ICON_FOLDERS', - layout : 'border', - items : [ { - id : 'documentsView', - region : 'center', - // autoScroll: true, - items : [ { - xtype : 'treepanel', - id : 'documentsTree', - style : { - // width: '50%', - height : '100%', - overflow : 'auto' - }, - useArrows : true, - border : false, - split : true, - itemId : 'documentsTreePanel', - id : 'documentsTreePanel', - rootVisible : true, - treePanel : this, - clearOnReLoad : false, - loader : new Ext.tree.TreeLoader( - { - dataUrl : '../appFolder/appFolderAjax.php', - baseParams : { - action : 'expandNode' - } - } - ), - listeners : { - dblclick : function(n) { - if (n.attributes.optionType == "startProcess") { - Ext.Msg.show({ - title : 'Start Case', - msg : 'Starting new case

' - + n.attributes.text - + '', - icon : Ext.MessageBox.INFO - }); - Ext.Ajax.request({ - url : 'casesStartPage_Ajax.php', - params : { - action : 'startCase', - processId : n.attributes.pro_uid, - taskId : n.attributes.tas_uid - }, - success : function( - response) { - 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 : '', - 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) { - mainPanel.showDetails(n); - } - }, - root : { - nodeType : 'async', - draggable : false, - id : 'root', - expanded : true - } - } ] - // items - } ], + id : 'documents', + title : 'Documents', + iconCls : 'ICON_FOLDERS', + layout : 'border', + defaults : { + split : true + }, + items : [ + { + xtype : "treepanel", + id : "dirTree", + region : "west", + title : 'DirectoryReload', + closable : false, + collapsible: true, + collapseMode: 'mini', + // collapsed:true, + width : 250, + 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; - tbar : [ - { - xtype : 'textfield', - name : 'field1', - emptyText : 'Filter', - enableKeyEvents : true, - listeners : { - render : function(f) { - Ext.getCmp("documentsTreePanel").filter = new Ext.tree.TreeFilter( - this, - { - clearBlank : true, - autoClear : true - } - ); - }, - keydown : function(t, e) { - treeFiltered = Ext.getCmp("documentsTreePanel"); - var text = t.getValue(); - if (!text) { - treeFiltered.filter - .clear(); - return; - } - treeFiltered - .expandAll(); + 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; + } + } + }, - var re = new RegExp( - '^' - + Ext - .escapeRe(text), - 'i'); - treeFiltered.filter - .filterBy(function( - n) { - // return - // !n.attributes.isClass - // || - // re.test(n.text); - }); - /* - * // hide empty - * packages that weren't - * filtered - * this.hiddenPkgs = []; - * var me = this; - * this.root.cascade(function(n){ - * if(!n.attributes.isClass && - * n.ui.ctNode.offsetHeight < - * 3){ n.ui.hide(); - * me.hiddenPkgs.push(n); } - * }); - */ - }, - scope : this - } - }, - ' ', - ' ', - { - iconCls : 'icon-expand-all', - tooltip : 'Expand All', - handler : function() { - Ext - .getCmp("documentsTreePanel").root - .expand(true); - }, - scope : this - }, - '-', - { - iconCls : 'icon-collapse-all', - tooltip : 'Collapse All', - handler : function() { - Ext - .getCmp("documentsTreePanel").root - .collapse(true); - }, - scope : this - }, - ' ', - ' ', - { - xtype : 'tbbutton', - cls : 'x-btn-icon', - icon : '/images/refresh.gif', + 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"); + + } + + } + } - handler : function() { - tree = Ext - .getCmp('documentsTreePanel'); - tree.getLoader().load( - tree.root); - } - } - ] }; /* -var dashboardTab = { - title : 'Dashboard', - id : 'mainDashboard', - iconCls : 'ICON_CASES_START_PAGE', - xtype : 'container', - autoHeight : true, - enableDD : false, - items : getDashboardItems() -}; -*/ + * 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', - region : 'center', - resizeTabs : true, - minTabWidth : 135, - tabWidth : 135, - plugins : new Ext.ux.TabCloseMenu(), - enableTabScroll : true, - activeTab : 0, - items : [startCaseTab/*, documentsTab, dashboardTab*/] - }); + id : 'doc-body', + region : 'center', + resizeTabs : true, + minTabWidth : 135, + tabWidth : 135, + plugins : new Ext.ux.TabCloseMenu(), + enableTabScroll : true, + activeTab : 0, + items : [ startCaseTab, documentsTab /* , dashboardTab */] + }); }; // console.info("Main Panel - End"); -Ext.extend( - MainPanel, - Ext.TabPanel, - { - initEvents : function() { - MainPanel.superclass.initEvents.call(this); - // this.body.on('click', this.onClick, this); - - }, +Ext + .extend( + MainPanel, + Ext.TabPanel, + { + initEvents : function() { + MainPanel.superclass.initEvents.call(this); + this.body.on('click', this.onClick, this); + }, - onClick : function(e, target, elementselected) { - return; - if (target = e.getTarget('a:not(.exi)', 3)) { - var cls = Ext.fly(target).getAttributeNS('ext', - 'cls'); - e.stopEvent(); - if (cls) { - var member = Ext.fly(target).getAttributeNS( - 'ext', 'member'); - this.loadClass(target.href, cls, member); - } else if (target.className == 'inner-link') { - this.getActiveTab().scrollToSection( - target.href.split('#')[1]); - } else { - window.open(target.href); - } - } else if (target = e.getTarget('.micon', 2)) { - e.stopEvent(); - var tr = Ext.fly(target.parentNode); - if (tr.hasClass('expandable')) { - tr.toggleClass('expanded'); - } - } - }, + onClick : function(e, target, elementselected) { + return; + if (target = e.getTarget('a:not(.exi)', 3)) { + var cls = Ext.fly(target).getAttributeNS('ext', + 'cls'); + e.stopEvent(); + if (cls) { + var member = Ext.fly(target).getAttributeNS( + 'ext', 'member'); + this.loadClass(target.href, cls, member); + } else if (target.className == 'inner-link') { + this.getActiveTab().scrollToSection( + target.href.split('#')[1]); + } else { + window.open(target.href); + } + } else if (target = e.getTarget('.micon', 2)) { + e.stopEvent(); + var tr = Ext.fly(target.parentNode); + if (tr.hasClass('expandable')) { + tr.toggleClass('expanded'); + } + } + }, +/* + loadClass : function(href, cls, member) { + var id = 'docs-' + cls; + var tab = this.getComponent(id); + if (tab) { + this.setActiveTab(tab); + if (member) { + tab.scrollToMember(member); + } + } else { + var autoLoad = { + url : href + }; + if (member) { + autoLoad.callback = function() { + Ext.getCmp(id).scrollToMember(member); + }; + } + var p = this.add(new DocPanel({ + id : id, + cclass : cls, + autoLoad : autoLoad + })); + this.setActiveTab(p); + } + }, +*/ + + showDetails : function(selectedNode) { - loadClass : function(href, cls, member) { - var id = 'docs-' + cls; - var tab = this.getComponent(id); - if (tab) { - this.setActiveTab(tab); - if (member) { - tab.scrollToMember(member); - } - } else { - var autoLoad = { - url : href - }; - if (member) { - autoLoad.callback = function() { - Ext.getCmp(id).scrollToMember(member); - }; - } - var p = this.add(new DocPanel({ - id : id, - cclass : cls, - autoLoad : autoLoad - })); - this.setActiveTab(p); - } - }, - - initTemplates : function() { - - this.detailsTemplate = new Ext.XTemplate( - '
', - '', - '', - '
', - - '', - '

{taskName}


', - 'Process Name:', - '{processName}', - 'Description: ', - '{processDescription}', - '', - '', - '', - '', - '', - '', - '
', - 'Category: ', - - '{processCategory}', - - '', - 'Calendar: ', - '{calendarName} ({calendarDescription})', - '', - 'Working Days: ', - '{calendarWorkDays}', - '', - 'Debug mode: ', - '{processDebug}', - '
', - 'Statistics: ', - 'Active Cases (Mine/Total):{myInbox} / {totalInbox}', - - '
Double click to start any Process/Case', - '', - - '', '
'); - this.detailsTemplate.compile(); - }, - - showDetails : function(selectedNode) { - - // console.log(selectedNode); - var detailEl = Ext.getCmp('process-detail-panel').body; - if (selectedNode) { + // console.log(selectedNode); + var detailEl = Ext.getCmp('process-detail-panel').body; + if (selectedNode) { - //this.initTemplates(); - //detailEl.hide(); - // detailEl.sequenceFx(); - // detailEl.slideOut('l', - // {stopFx:true,duration:.9}); - - + // this.initTemplates(); + // detailEl.hide(); + // detailEl.sequenceFx(); + // detailEl.slideOut('l', + // {stopFx:true,duration:.9}); - otherAttributes = selectedNode.attributes.otherAttributes; + otherAttributes = selectedNode.attributes.otherAttributes; calendarDays=(otherAttributes.CALENDAR_WORK_DAYS).split("|"); calendarObj={}; @@ -918,7 +2027,7 @@ Ext.extend( calendarName : otherAttributes.CALENDAR_NAME, calendarDescription : otherAttributes.CALENDAR_DESCRIPTION, processCalendar:otherAttributes.CALENDAR_NAME+" "+otherAttributes.CALENDAR_DESCRIPTION, - calendarWorkDays : calendarObj,/*(otherAttributes.CALENDAR_WORK_DAYS).split("|"),*/ + calendarWorkDays : calendarObj,/* (otherAttributes.CALENDAR_WORK_DAYS).split("|"), */ processCategory : otherAttributes.PRO_CATEGORY_LABEL, processDebug : otherAttributes.PRO_DEBUG, processDescription : otherAttributes.PRO_DESCRIPTION, @@ -931,89 +2040,88 @@ Ext.extend( - //this.detailsTemplate.overwrite(detailEl, data); - //detailEl.slideIn('t', {stopFx:true,duration:.0}); - //detailEl.highlight('#000', { - // block : true - //}); - } else { - detailEl.update(''); - } + // this.detailsTemplate.overwrite(detailEl, data); + // detailEl.slideIn('t', {stopFx:true,duration:.0}); + detailEl.highlight('#c3daf9', { + block : true + }); + } else { + detailEl.update(''); + } - return; - // var selNode = this.getSelectedNodes(); + return; + // var selNode = this.getSelectedNodes(); - }, - /* - * startNewCase:function(){ alert("asdasdasd"); }, - */ - loadOtherDashboards : function() { - // console.info("Getting other Dashboards"); - dashboardTabPanels = this; - // console.log(dashboardTabPanels); - conn.request({ - url : 'casesStartPage_Ajax.php', - method : 'POST', - params : { - "action" : 'getRegisteredDashboards' - }, - success : function(responseObject) { + }, + /* + * startNewCase:function(){ alert("asdasdasd"); }, + */ + loadOtherDashboards : function() { + // console.info("Getting other Dashboards"); + dashboardTabPanels = this; + // console.log(dashboardTabPanels); + conn.request({ + url : 'casesStartPage_Ajax.php', + method : 'POST', + params : { + "action" : 'getRegisteredDashboards' + }, + success : function(responseObject) { + var response = Ext.util.JSON + .decode(responseObject.responseText); + for (var i in response) { + tabInfo = response[i]; + if (tabInfo.sName) { + dashboardTabPanels.add({ + title : tabInfo.sName, + id : tabInfo.sNamespace + "-" + + tabInfo.sName, + iconCls : tabInfo.sIcon,// 'ICON_CASES_START_PAGE', + autoLoad : { + url : tabInfo.sPage, + scripts : true + } + // disabled:true, + }); + } + } + // getDefaultDashboard(dashboardTabPanels); + dashboardTabPanels.activateDefaultTab(); + }, + failure : function() { + // grid.getGridEl().unmask(true); + // getDefaultDashboard(dashboardTabPanels); + dashboardTabPanels.activateDefaultTab(); + Ext.Msg.alert('Status', + 'Unable to get Dashboards'); + } + }); + }, + activateDefaultTab : function() { + // api.expandPath('/root/apidocs'); + // allow for link in + var page = window.location.href.split('?')[1]; + // console.info("page : "+page); + if (page) { + var ps = Ext.urlDecode(page); + // console.log(ps.action); + if (ps.action) { + defaultDashboard = ps.action; + if (this.getItem(defaultDashboard)) { + // console.info("Setting the new default + // dashboard: + // "+defaultDashboard); + this.setActiveTab(defaultDashboard); + } - var response = Ext.util.JSON - .decode(responseObject.responseText); - for ( var i = 0; i < response.length; i++) { - tabInfo = response[i]; - if (tabInfo.sName) { - dashboardTabPanels.add({ - title : tabInfo.sName, - id : tabInfo.sNamespace + "-" - + tabInfo.sName, - iconCls : tabInfo.sIcon,// 'ICON_CASES_START_PAGE', - autoLoad : { - url : tabInfo.sPage, - scripts : true - } - // disabled:true, - }); - } - } - // getDefaultDashboard(dashboardTabPanels); - dashboardTabPanels.activateDefaultTab(); - }, - failure : function() { - // grid.getGridEl().unmask(true); - // getDefaultDashboard(dashboardTabPanels); - dashboardTabPanels.activateDefaultTab(); - Ext.Msg.alert('Status', - 'Unable to get Dashboards'); - } - }); - }, - activateDefaultTab : function() { - // api.expandPath('/root/apidocs'); - // allow for link in - var page = window.location.href.split('?')[1]; - // console.info("page : "+page); - if (page) { - var ps = Ext.urlDecode(page); - // console.log(ps.action); - if (ps.action) { - defaultDashboard = ps.action; - if (this.getItem(defaultDashboard)) { - // console.info("Setting the new default - // dashboard: - // "+defaultDashboard); - this.setActiveTab(defaultDashboard); - } + } + // var cls = ps['class']; + // mainPanel.loadClass('output/' + cls + '.html', + // cls, ps.member); + } + } - } - // var cls = ps['class']; - // mainPanel.loadClass('output/' + cls + '.html', - // cls, ps.member); - } - } - - }); + }); var mainPanel = new MainPanel(); @@ -1068,31 +2176,7 @@ Ext.onReady(function() { return unescape(document.cookie.substring(offset, endstr)); }; - // function that loads store when it is called - function getDashboardData() { - var parameters = { - action : 'getSimpleDashboardData' - }; - conn.request({ - url : 'casesStartPage_Ajax.php', - method : 'POST', - params : { - "action" : 'getSimpleDashboardData' - }, - success : function(responseObject) { - var responseData = Ext.decode(responseObject.responseText); - - // Load store from here - caseStatusByProcess.loadData(responseData); - caseDelayed.loadData(responseData); - }, - failure : function() { - Ext.Msg.alert('Status', 'Unable to get list of Process'); - } - }); - } - - Ext.QuickTips.init(); + mainPanel.on('tabchange', function(tp, tab) { if (tab.getUpdater) { @@ -1106,10 +2190,6 @@ Ext.onReady(function() { var viewport = new Ext.Viewport({ layout : 'border', items : [ - /* - * { // cls: 'docs-header', // height: 36, region:'north', xtype:'box', - * el:'header', border:false// , // margins: '0 0 5 0' }, - */ mainPanel ] }); @@ -1119,163 +2199,12 @@ Ext.onReady(function() { 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(); + } - //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(); - } - -}); - - - - - - -// vim: ts=4:sw=4:nu:fdc=4:nospell -/*global Ext */ -/** - * @class Ext.ux.tree.TreeFilterX - * @extends Ext.tree.TreeFilter - * - *

- * Shows also parents of matching nodes as opposed to default TreeFilter. In other words - * this filter works "deep way". - *

- * - * @author Ing. Jozef Sakáloš - * @version 1.0 - * @date 17. December 2008 - * @revision $Id: Ext.ux.tree.TreeFilterX.js 589 2009-02-21 23:30:18Z jozo $ - * @see http://extjs.com/forum/showthread.php?p=252709 - * - * @license Ext.ux.tree.CheckTreePanel is licensed under the terms of - * the Open Source LGPL 3.0 license. Commercial use is permitted to the extent - * that the code/component(s) do NOT become part of another Open Source or Commercially - * licensed development library or toolkit without explicit permission. - * - *

License details: http://www.gnu.org/licenses/lgpl.html

- * - * @forum 55489 - * @demo http://remotetree.extjs.eu - * - * @donate - *
- * - * - * - * - *
- */ - -Ext.ns('Ext.ux.tree'); - -/** - * Creates new TreeFilterX - * @constructor - * @param {Ext.tree.TreePanel} tree The tree panel to attach this filter to - * @param {Object} config A config object of this filter - */ -Ext.ux.tree.TreeFilterX = Ext.extend(Ext.tree.TreeFilter, { - /** - * @cfg {Boolean} expandOnFilter Deeply expands startNode before filtering (defaults to true) - */ - expandOnFilter:true - - // {{{ - /** - * Filter the data by a specific attribute. - * - * @param {String/RegExp} value Either string that the attribute value - * should start with or a RegExp to test against the attribute - * @param {String} attr (optional) The attribute passed in your node's attributes collection. Defaults to "text". - * @param {TreeNode} startNode (optional) The node to start the filter at. - */ - ,filter:function(value, attr, startNode) { - - // expand start node - if(false !== this.expandOnFilter) { - startNode = startNode || this.tree.root; - var animate = this.tree.animate; - this.tree.animate = false; - startNode.expand(true, false, function() { - - // call parent after expand - Ext.ux.tree.TreeFilterX.superclass.filter.call(this, value, attr, startNode); - - }.createDelegate(this)); - this.tree.animate = animate; - } - else { - // call parent - Ext.ux.tree.TreeFilterX.superclass.filter.apply(this, arguments); - } - - } // eo function filter - // }}} - // {{{ - /** - * Filter by a function. The passed function will be called with each - * node in the tree (or from the startNode). If the function returns true, the node is kept - * otherwise it is filtered. If a node is filtered, its children are also filtered. - * Shows parents of matching nodes. - * - * @param {Function} fn The filter function - * @param {Object} scope (optional) The scope of the function (defaults to the current node) - */ - ,filterBy:function(fn, scope, startNode) { - startNode = startNode || this.tree.root; - if(this.autoClear) { - this.clear(); - } - var af = this.filtered, rv = this.reverse; - - var f = function(n) { - if(n === startNode) { - return true; - } - if(af[n.id]) { - return false; - } - var m = fn.call(scope || n, n); - if(!m || rv) { - af[n.id] = n; - n.ui.hide(); - return true; - } - else { - n.ui.show(); - var p = n.parentNode; - while(p && p !== this.root) { - p.ui.show(); - p = p.parentNode; - } - return true; - } - return true; - }; - startNode.cascade(f); - - if(this.remove){ - for(var id in af) { - if(typeof id != "function") { - var n = af[id]; - if(n && n.parentNode) { - n.parentNode.removeChild(n); - } - } - } - } - } // eo function filterBy - // }}} - -}); // eo extend - -// eof - - +}); \ No newline at end of file diff --git a/workflow/public_html/images/documents/_.gif b/workflow/public_html/images/documents/_.gif new file mode 100755 index 000000000..f44a942b9 Binary files /dev/null and b/workflow/public_html/images/documents/_.gif differ diff --git a/workflow/public_html/images/documents/_accept.png b/workflow/public_html/images/documents/_accept.png new file mode 100755 index 000000000..3e5a30035 Binary files /dev/null and b/workflow/public_html/images/documents/_accept.png differ diff --git a/workflow/public_html/images/documents/_admin.gif b/workflow/public_html/images/documents/_admin.gif new file mode 100755 index 000000000..04d231946 Binary files /dev/null and b/workflow/public_html/images/documents/_admin.gif differ diff --git a/workflow/public_html/images/documents/_archive.png b/workflow/public_html/images/documents/_archive.png new file mode 100755 index 000000000..4a9fe1737 Binary files /dev/null and b/workflow/public_html/images/documents/_archive.png differ diff --git a/workflow/public_html/images/documents/_arrowdown.gif b/workflow/public_html/images/documents/_arrowdown.gif new file mode 100755 index 000000000..1191cc57a Binary files /dev/null and b/workflow/public_html/images/documents/_arrowdown.gif differ diff --git a/workflow/public_html/images/documents/_arrowup.gif b/workflow/public_html/images/documents/_arrowup.gif new file mode 100755 index 000000000..b7c7db69b Binary files /dev/null and b/workflow/public_html/images/documents/_arrowup.gif differ diff --git a/workflow/public_html/images/documents/_bookmark_add.png b/workflow/public_html/images/documents/_bookmark_add.png new file mode 100755 index 000000000..95105ad98 Binary files /dev/null and b/workflow/public_html/images/documents/_bookmark_add.png differ diff --git a/workflow/public_html/images/documents/_cancel.png b/workflow/public_html/images/documents/_cancel.png new file mode 100755 index 000000000..a432b492c Binary files /dev/null and b/workflow/public_html/images/documents/_cancel.png differ diff --git a/workflow/public_html/images/documents/_chmod.png b/workflow/public_html/images/documents/_chmod.png new file mode 100755 index 000000000..ef0b0301b Binary files /dev/null and b/workflow/public_html/images/documents/_chmod.png differ diff --git a/workflow/public_html/images/documents/_down.png b/workflow/public_html/images/documents/_down.png new file mode 100755 index 000000000..f3bc4cd09 Binary files /dev/null and b/workflow/public_html/images/documents/_down.png differ diff --git a/workflow/public_html/images/documents/_edit.png b/workflow/public_html/images/documents/_edit.png new file mode 100755 index 000000000..b6000a714 Binary files /dev/null and b/workflow/public_html/images/documents/_edit.png differ diff --git a/workflow/public_html/images/documents/_editcopy.png b/workflow/public_html/images/documents/_editcopy.png new file mode 100755 index 000000000..b7c938a99 Binary files /dev/null and b/workflow/public_html/images/documents/_editcopy.png differ diff --git a/workflow/public_html/images/documents/_editdelete.png b/workflow/public_html/images/documents/_editdelete.png new file mode 100755 index 000000000..d33c34454 Binary files /dev/null and b/workflow/public_html/images/documents/_editdelete.png differ diff --git a/workflow/public_html/images/documents/_extract.gif b/workflow/public_html/images/documents/_extract.gif new file mode 100755 index 000000000..fb7e53e6c Binary files /dev/null and b/workflow/public_html/images/documents/_extract.gif differ diff --git a/workflow/public_html/images/documents/_extract.png b/workflow/public_html/images/documents/_extract.png new file mode 100755 index 000000000..66e13a2cc Binary files /dev/null and b/workflow/public_html/images/documents/_extract.png differ diff --git a/workflow/public_html/images/documents/_filefind.png b/workflow/public_html/images/documents/_filefind.png new file mode 100755 index 000000000..6dd193158 Binary files /dev/null and b/workflow/public_html/images/documents/_filefind.png differ diff --git a/workflow/public_html/images/documents/_filenew.png b/workflow/public_html/images/documents/_filenew.png new file mode 100755 index 000000000..f38d02ee5 Binary files /dev/null and b/workflow/public_html/images/documents/_filenew.png differ diff --git a/workflow/public_html/images/documents/_folder_new.png b/workflow/public_html/images/documents/_folder_new.png new file mode 100755 index 000000000..cc6020b46 Binary files /dev/null and b/workflow/public_html/images/documents/_folder_new.png differ diff --git a/workflow/public_html/images/documents/_fonts.png b/workflow/public_html/images/documents/_fonts.png new file mode 100755 index 000000000..3aab3bd2d Binary files /dev/null and b/workflow/public_html/images/documents/_fonts.png differ diff --git a/workflow/public_html/images/documents/_help.png b/workflow/public_html/images/documents/_help.png new file mode 100755 index 000000000..28a0f9e5e Binary files /dev/null and b/workflow/public_html/images/documents/_help.png differ diff --git a/workflow/public_html/images/documents/_home.gif b/workflow/public_html/images/documents/_home.gif new file mode 100755 index 000000000..3b62135e5 Binary files /dev/null and b/workflow/public_html/images/documents/_home.gif differ diff --git a/workflow/public_html/images/documents/_home.png b/workflow/public_html/images/documents/_home.png new file mode 100755 index 000000000..2347d165d Binary files /dev/null and b/workflow/public_html/images/documents/_home.png differ diff --git a/workflow/public_html/images/documents/_indicator.gif b/workflow/public_html/images/documents/_indicator.gif new file mode 100755 index 000000000..085ccaeca Binary files /dev/null and b/workflow/public_html/images/documents/_indicator.gif differ diff --git a/workflow/public_html/images/documents/_log_error.png b/workflow/public_html/images/documents/_log_error.png new file mode 100755 index 000000000..df63d7507 Binary files /dev/null and b/workflow/public_html/images/documents/_log_error.png differ diff --git a/workflow/public_html/images/documents/_logout.png b/workflow/public_html/images/documents/_logout.png new file mode 100755 index 000000000..63232417a Binary files /dev/null and b/workflow/public_html/images/documents/_logout.png differ diff --git a/workflow/public_html/images/documents/_messagebox_warning.png b/workflow/public_html/images/documents/_messagebox_warning.png new file mode 100755 index 000000000..82d3fc796 Binary files /dev/null and b/workflow/public_html/images/documents/_messagebox_warning.png differ diff --git a/workflow/public_html/images/documents/_move.png b/workflow/public_html/images/documents/_move.png new file mode 100755 index 000000000..805f7643f Binary files /dev/null and b/workflow/public_html/images/documents/_move.png differ diff --git a/workflow/public_html/images/documents/_reload.png b/workflow/public_html/images/documents/_reload.png new file mode 100755 index 000000000..188ed61ed Binary files /dev/null and b/workflow/public_html/images/documents/_reload.png differ diff --git a/workflow/public_html/images/documents/_remove.png b/workflow/public_html/images/documents/_remove.png new file mode 100755 index 000000000..ff39d8c2d Binary files /dev/null and b/workflow/public_html/images/documents/_remove.png differ diff --git a/workflow/public_html/images/documents/_rename.gif b/workflow/public_html/images/documents/_rename.gif new file mode 100755 index 000000000..0d155c084 Binary files /dev/null and b/workflow/public_html/images/documents/_rename.gif differ diff --git a/workflow/public_html/images/documents/_rename_.gif b/workflow/public_html/images/documents/_rename_.gif new file mode 100755 index 000000000..0668f58e5 Binary files /dev/null and b/workflow/public_html/images/documents/_rename_.gif differ diff --git a/workflow/public_html/images/documents/_save.png b/workflow/public_html/images/documents/_save.png new file mode 100755 index 000000000..fd0048ded Binary files /dev/null and b/workflow/public_html/images/documents/_save.png differ diff --git a/workflow/public_html/images/documents/_up.png b/workflow/public_html/images/documents/_up.png new file mode 100755 index 000000000..184c118b6 Binary files /dev/null and b/workflow/public_html/images/documents/_up.png differ diff --git a/workflow/public_html/images/documents/_view.png b/workflow/public_html/images/documents/_view.png new file mode 100755 index 000000000..e167acf20 Binary files /dev/null and b/workflow/public_html/images/documents/_view.png differ diff --git a/workflow/public_html/images/documents/extension/avi.png b/workflow/public_html/images/documents/extension/avi.png new file mode 100755 index 000000000..27ddf385e Binary files /dev/null and b/workflow/public_html/images/documents/extension/avi.png differ diff --git a/workflow/public_html/images/documents/extension/bmp.png b/workflow/public_html/images/documents/extension/bmp.png new file mode 100755 index 000000000..246a66cad Binary files /dev/null and b/workflow/public_html/images/documents/extension/bmp.png differ diff --git a/workflow/public_html/images/documents/extension/bz2.png b/workflow/public_html/images/documents/extension/bz2.png new file mode 100755 index 000000000..184f959df Binary files /dev/null and b/workflow/public_html/images/documents/extension/bz2.png differ diff --git a/workflow/public_html/images/documents/extension/c.png b/workflow/public_html/images/documents/extension/c.png new file mode 100755 index 000000000..e237b3f2d Binary files /dev/null and b/workflow/public_html/images/documents/extension/c.png differ diff --git a/workflow/public_html/images/documents/extension/cc.png b/workflow/public_html/images/documents/extension/cc.png new file mode 100755 index 000000000..e237b3f2d Binary files /dev/null and b/workflow/public_html/images/documents/extension/cc.png differ diff --git a/workflow/public_html/images/documents/extension/cgi.png b/workflow/public_html/images/documents/extension/cgi.png new file mode 100755 index 000000000..751424557 Binary files /dev/null and b/workflow/public_html/images/documents/extension/cgi.png differ diff --git a/workflow/public_html/images/documents/extension/class.png b/workflow/public_html/images/documents/extension/class.png new file mode 100755 index 000000000..d7aa15e1f Binary files /dev/null and b/workflow/public_html/images/documents/extension/class.png differ diff --git a/workflow/public_html/images/documents/extension/cpp.png b/workflow/public_html/images/documents/extension/cpp.png new file mode 100755 index 000000000..e237b3f2d Binary files /dev/null and b/workflow/public_html/images/documents/extension/cpp.png differ diff --git a/workflow/public_html/images/documents/extension/css.png b/workflow/public_html/images/documents/extension/css.png new file mode 100755 index 000000000..7c5616027 Binary files /dev/null and b/workflow/public_html/images/documents/extension/css.png differ diff --git a/workflow/public_html/images/documents/extension/cxx.png b/workflow/public_html/images/documents/extension/cxx.png new file mode 100755 index 000000000..e237b3f2d Binary files /dev/null and b/workflow/public_html/images/documents/extension/cxx.png differ diff --git a/workflow/public_html/images/documents/extension/dhtml.png b/workflow/public_html/images/documents/extension/dhtml.png new file mode 100755 index 000000000..f56567f11 Binary files /dev/null and b/workflow/public_html/images/documents/extension/dhtml.png differ diff --git a/workflow/public_html/images/documents/extension/doc.png b/workflow/public_html/images/documents/extension/doc.png new file mode 100755 index 000000000..53a675feb Binary files /dev/null and b/workflow/public_html/images/documents/extension/doc.png differ diff --git a/workflow/public_html/images/documents/extension/document.png b/workflow/public_html/images/documents/extension/document.png new file mode 100755 index 000000000..24c9c5757 Binary files /dev/null and b/workflow/public_html/images/documents/extension/document.png differ diff --git a/workflow/public_html/images/documents/extension/docx.png b/workflow/public_html/images/documents/extension/docx.png new file mode 100755 index 000000000..53a675feb Binary files /dev/null and b/workflow/public_html/images/documents/extension/docx.png differ diff --git a/workflow/public_html/images/documents/extension/exe.png b/workflow/public_html/images/documents/extension/exe.png new file mode 100755 index 000000000..751424557 Binary files /dev/null and b/workflow/public_html/images/documents/extension/exe.png differ diff --git a/workflow/public_html/images/documents/extension/folder.png b/workflow/public_html/images/documents/extension/folder.png new file mode 100755 index 000000000..9232553fc Binary files /dev/null and b/workflow/public_html/images/documents/extension/folder.png differ diff --git a/workflow/public_html/images/documents/extension/fon.png b/workflow/public_html/images/documents/extension/fon.png new file mode 100755 index 000000000..3aab3bd2d Binary files /dev/null and b/workflow/public_html/images/documents/extension/fon.png differ diff --git a/workflow/public_html/images/documents/extension/gif.png b/workflow/public_html/images/documents/extension/gif.png new file mode 100755 index 000000000..246a66cad Binary files /dev/null and b/workflow/public_html/images/documents/extension/gif.png differ diff --git a/workflow/public_html/images/documents/extension/gz.png b/workflow/public_html/images/documents/extension/gz.png new file mode 100755 index 000000000..4a9fe1737 Binary files /dev/null and b/workflow/public_html/images/documents/extension/gz.png differ diff --git a/workflow/public_html/images/documents/extension/h.png b/workflow/public_html/images/documents/extension/h.png new file mode 100755 index 000000000..3523f98bb Binary files /dev/null and b/workflow/public_html/images/documents/extension/h.png differ diff --git a/workflow/public_html/images/documents/extension/hpp.png b/workflow/public_html/images/documents/extension/hpp.png new file mode 100755 index 000000000..3523f98bb Binary files /dev/null and b/workflow/public_html/images/documents/extension/hpp.png differ diff --git a/workflow/public_html/images/documents/extension/htm.png b/workflow/public_html/images/documents/extension/htm.png new file mode 100755 index 000000000..f56567f11 Binary files /dev/null and b/workflow/public_html/images/documents/extension/htm.png differ diff --git a/workflow/public_html/images/documents/extension/html.png b/workflow/public_html/images/documents/extension/html.png new file mode 100755 index 000000000..f56567f11 Binary files /dev/null and b/workflow/public_html/images/documents/extension/html.png differ diff --git a/workflow/public_html/images/documents/extension/inc.png b/workflow/public_html/images/documents/extension/inc.png new file mode 100755 index 000000000..b0afbd529 Binary files /dev/null and b/workflow/public_html/images/documents/extension/inc.png differ diff --git a/workflow/public_html/images/documents/extension/jar.png b/workflow/public_html/images/documents/extension/jar.png new file mode 100755 index 000000000..568bffa24 Binary files /dev/null and b/workflow/public_html/images/documents/extension/jar.png differ diff --git a/workflow/public_html/images/documents/extension/java.png b/workflow/public_html/images/documents/extension/java.png new file mode 100755 index 000000000..d7aa15e1f Binary files /dev/null and b/workflow/public_html/images/documents/extension/java.png differ diff --git a/workflow/public_html/images/documents/extension/jpeg.png b/workflow/public_html/images/documents/extension/jpeg.png new file mode 100755 index 000000000..246a66cad Binary files /dev/null and b/workflow/public_html/images/documents/extension/jpeg.png differ diff --git a/workflow/public_html/images/documents/extension/jpg.png b/workflow/public_html/images/documents/extension/jpg.png new file mode 100755 index 000000000..246a66cad Binary files /dev/null and b/workflow/public_html/images/documents/extension/jpg.png differ diff --git a/workflow/public_html/images/documents/extension/js.png b/workflow/public_html/images/documents/extension/js.png new file mode 100755 index 000000000..0be6c262d Binary files /dev/null and b/workflow/public_html/images/documents/extension/js.png differ diff --git a/workflow/public_html/images/documents/extension/m3u.png b/workflow/public_html/images/documents/extension/m3u.png new file mode 100755 index 000000000..3f1bd5692 Binary files /dev/null and b/workflow/public_html/images/documents/extension/m3u.png differ diff --git a/workflow/public_html/images/documents/extension/midi.png b/workflow/public_html/images/documents/extension/midi.png new file mode 100755 index 000000000..bbc5e594d Binary files /dev/null and b/workflow/public_html/images/documents/extension/midi.png differ diff --git a/workflow/public_html/images/documents/extension/mov.png b/workflow/public_html/images/documents/extension/mov.png new file mode 100755 index 000000000..27ddf385e Binary files /dev/null and b/workflow/public_html/images/documents/extension/mov.png differ diff --git a/workflow/public_html/images/documents/extension/mp3.png b/workflow/public_html/images/documents/extension/mp3.png new file mode 100755 index 000000000..3f1bd5692 Binary files /dev/null and b/workflow/public_html/images/documents/extension/mp3.png differ diff --git a/workflow/public_html/images/documents/extension/mpeg.png b/workflow/public_html/images/documents/extension/mpeg.png new file mode 100755 index 000000000..27ddf385e Binary files /dev/null and b/workflow/public_html/images/documents/extension/mpeg.png differ diff --git a/workflow/public_html/images/documents/extension/mpg.png b/workflow/public_html/images/documents/extension/mpg.png new file mode 100755 index 000000000..27ddf385e Binary files /dev/null and b/workflow/public_html/images/documents/extension/mpg.png differ diff --git a/workflow/public_html/images/documents/extension/pdf.png b/workflow/public_html/images/documents/extension/pdf.png new file mode 100755 index 000000000..f4863cb6c Binary files /dev/null and b/workflow/public_html/images/documents/extension/pdf.png differ diff --git a/workflow/public_html/images/documents/extension/php.png b/workflow/public_html/images/documents/extension/php.png new file mode 100755 index 000000000..02fb3eb25 Binary files /dev/null and b/workflow/public_html/images/documents/extension/php.png differ diff --git a/workflow/public_html/images/documents/extension/php3.png b/workflow/public_html/images/documents/extension/php3.png new file mode 100755 index 000000000..02fb3eb25 Binary files /dev/null and b/workflow/public_html/images/documents/extension/php3.png differ diff --git a/workflow/public_html/images/documents/extension/php4.png b/workflow/public_html/images/documents/extension/php4.png new file mode 100755 index 000000000..02fb3eb25 Binary files /dev/null and b/workflow/public_html/images/documents/extension/php4.png differ diff --git a/workflow/public_html/images/documents/extension/php5.png b/workflow/public_html/images/documents/extension/php5.png new file mode 100755 index 000000000..02fb3eb25 Binary files /dev/null and b/workflow/public_html/images/documents/extension/php5.png differ diff --git a/workflow/public_html/images/documents/extension/phtml.png b/workflow/public_html/images/documents/extension/phtml.png new file mode 100755 index 000000000..02fb3eb25 Binary files /dev/null and b/workflow/public_html/images/documents/extension/phtml.png differ diff --git a/workflow/public_html/images/documents/extension/pl.png b/workflow/public_html/images/documents/extension/pl.png new file mode 100755 index 000000000..7c38cb606 Binary files /dev/null and b/workflow/public_html/images/documents/extension/pl.png differ diff --git a/workflow/public_html/images/documents/extension/pls.png b/workflow/public_html/images/documents/extension/pls.png new file mode 100755 index 000000000..3f1bd5692 Binary files /dev/null and b/workflow/public_html/images/documents/extension/pls.png differ diff --git a/workflow/public_html/images/documents/extension/png.png b/workflow/public_html/images/documents/extension/png.png new file mode 100755 index 000000000..246a66cad Binary files /dev/null and b/workflow/public_html/images/documents/extension/png.png differ diff --git a/workflow/public_html/images/documents/extension/py.png b/workflow/public_html/images/documents/extension/py.png new file mode 100755 index 000000000..e8d15f169 Binary files /dev/null and b/workflow/public_html/images/documents/extension/py.png differ diff --git a/workflow/public_html/images/documents/extension/ra.png b/workflow/public_html/images/documents/extension/ra.png new file mode 100755 index 000000000..85725f593 Binary files /dev/null and b/workflow/public_html/images/documents/extension/ra.png differ diff --git a/workflow/public_html/images/documents/extension/ram.png b/workflow/public_html/images/documents/extension/ram.png new file mode 100755 index 000000000..85725f593 Binary files /dev/null and b/workflow/public_html/images/documents/extension/ram.png differ diff --git a/workflow/public_html/images/documents/extension/rar.png b/workflow/public_html/images/documents/extension/rar.png new file mode 100755 index 000000000..184f959df Binary files /dev/null and b/workflow/public_html/images/documents/extension/rar.png differ diff --git a/workflow/public_html/images/documents/extension/rm.png b/workflow/public_html/images/documents/extension/rm.png new file mode 100755 index 000000000..85725f593 Binary files /dev/null and b/workflow/public_html/images/documents/extension/rm.png differ diff --git a/workflow/public_html/images/documents/extension/sh.png b/workflow/public_html/images/documents/extension/sh.png new file mode 100755 index 000000000..5a218fe92 Binary files /dev/null and b/workflow/public_html/images/documents/extension/sh.png differ diff --git a/workflow/public_html/images/documents/extension/shtml.png b/workflow/public_html/images/documents/extension/shtml.png new file mode 100755 index 000000000..f56567f11 Binary files /dev/null and b/workflow/public_html/images/documents/extension/shtml.png differ diff --git a/workflow/public_html/images/documents/extension/sql.png b/workflow/public_html/images/documents/extension/sql.png new file mode 100755 index 000000000..5a218fe92 Binary files /dev/null and b/workflow/public_html/images/documents/extension/sql.png differ diff --git a/workflow/public_html/images/documents/extension/swf.png b/workflow/public_html/images/documents/extension/swf.png new file mode 100755 index 000000000..4b7dc4583 Binary files /dev/null and b/workflow/public_html/images/documents/extension/swf.png differ diff --git a/workflow/public_html/images/documents/extension/tar.png b/workflow/public_html/images/documents/extension/tar.png new file mode 100755 index 000000000..184f959df Binary files /dev/null and b/workflow/public_html/images/documents/extension/tar.png differ diff --git a/workflow/public_html/images/documents/extension/tbz.png b/workflow/public_html/images/documents/extension/tbz.png new file mode 100755 index 000000000..184f959df Binary files /dev/null and b/workflow/public_html/images/documents/extension/tbz.png differ diff --git a/workflow/public_html/images/documents/extension/tgz.png b/workflow/public_html/images/documents/extension/tgz.png new file mode 100755 index 000000000..4a9fe1737 Binary files /dev/null and b/workflow/public_html/images/documents/extension/tgz.png differ diff --git a/workflow/public_html/images/documents/extension/txt.gif b/workflow/public_html/images/documents/extension/txt.gif new file mode 100755 index 000000000..f229509ce Binary files /dev/null and b/workflow/public_html/images/documents/extension/txt.gif differ diff --git a/workflow/public_html/images/documents/extension/txt.png b/workflow/public_html/images/documents/extension/txt.png new file mode 100755 index 000000000..3c3b4b00c Binary files /dev/null and b/workflow/public_html/images/documents/extension/txt.png differ diff --git a/workflow/public_html/images/documents/extension/wav.png b/workflow/public_html/images/documents/extension/wav.png new file mode 100755 index 000000000..3f1bd5692 Binary files /dev/null and b/workflow/public_html/images/documents/extension/wav.png differ diff --git a/workflow/public_html/images/documents/extension/xhtml.png b/workflow/public_html/images/documents/extension/xhtml.png new file mode 100755 index 000000000..f56567f11 Binary files /dev/null and b/workflow/public_html/images/documents/extension/xhtml.png differ diff --git a/workflow/public_html/images/documents/extension/xls.png b/workflow/public_html/images/documents/extension/xls.png new file mode 100755 index 000000000..c1a32d0b1 Binary files /dev/null and b/workflow/public_html/images/documents/extension/xls.png differ diff --git a/workflow/public_html/images/documents/extension/xlsx.png b/workflow/public_html/images/documents/extension/xlsx.png new file mode 100755 index 000000000..c1a32d0b1 Binary files /dev/null and b/workflow/public_html/images/documents/extension/xlsx.png differ diff --git a/workflow/public_html/images/documents/extension/xml.png b/workflow/public_html/images/documents/extension/xml.png new file mode 100755 index 000000000..e8c7d1dba Binary files /dev/null and b/workflow/public_html/images/documents/extension/xml.png differ diff --git a/workflow/public_html/images/documents/extension/zip.png b/workflow/public_html/images/documents/extension/zip.png new file mode 100755 index 000000000..184f959df Binary files /dev/null and b/workflow/public_html/images/documents/extension/zip.png differ diff --git a/workflow/public_html/images/documents/systeminfo.gif b/workflow/public_html/images/documents/systeminfo.gif new file mode 100755 index 000000000..a6e7b9bbd Binary files /dev/null and b/workflow/public_html/images/documents/systeminfo.gif differ diff --git a/workflow/public_html/skins/ext/images/default/locationbar/btn-arrow.gif b/workflow/public_html/skins/ext/images/default/locationbar/btn-arrow.gif new file mode 100755 index 000000000..876f4e103 Binary files /dev/null and b/workflow/public_html/skins/ext/images/default/locationbar/btn-arrow.gif differ diff --git a/workflow/public_html/skins/ext/images/default/locationbar/location_back.png b/workflow/public_html/skins/ext/images/default/locationbar/location_back.png new file mode 100755 index 000000000..5dc696781 Binary files /dev/null and b/workflow/public_html/skins/ext/images/default/locationbar/location_back.png differ diff --git a/workflow/public_html/skins/ext/images/default/locationbar/location_folder.png b/workflow/public_html/skins/ext/images/default/locationbar/location_folder.png new file mode 100755 index 000000000..784e8fa48 Binary files /dev/null and b/workflow/public_html/skins/ext/images/default/locationbar/location_folder.png differ diff --git a/workflow/public_html/skins/ext/images/default/locationbar/location_forward.png b/workflow/public_html/skins/ext/images/default/locationbar/location_forward.png new file mode 100755 index 000000000..b1a181923 Binary files /dev/null and b/workflow/public_html/skins/ext/images/default/locationbar/location_forward.png differ diff --git a/workflow/public_html/skins/ext/images/default/locationbar/location_reload.png b/workflow/public_html/skins/ext/images/default/locationbar/location_reload.png new file mode 100755 index 000000000..0de26566d Binary files /dev/null and b/workflow/public_html/skins/ext/images/default/locationbar/location_reload.png differ diff --git a/workflow/public_html/skins/ext/images/default/locationbar/tb-btn-sprite.gif b/workflow/public_html/skins/ext/images/default/locationbar/tb-btn-sprite.gif new file mode 100755 index 000000000..19bbef3c6 Binary files /dev/null and b/workflow/public_html/skins/ext/images/default/locationbar/tb-btn-sprite.gif differ diff --git a/workflow/public_html/skins/ext/images/gray/locationbar/btn-arrow.gif b/workflow/public_html/skins/ext/images/gray/locationbar/btn-arrow.gif new file mode 100755 index 000000000..876f4e103 Binary files /dev/null and b/workflow/public_html/skins/ext/images/gray/locationbar/btn-arrow.gif differ diff --git a/workflow/public_html/skins/ext/images/gray/locationbar/location_back.png b/workflow/public_html/skins/ext/images/gray/locationbar/location_back.png new file mode 100755 index 000000000..5dc696781 Binary files /dev/null and b/workflow/public_html/skins/ext/images/gray/locationbar/location_back.png differ diff --git a/workflow/public_html/skins/ext/images/gray/locationbar/location_folder.png b/workflow/public_html/skins/ext/images/gray/locationbar/location_folder.png new file mode 100755 index 000000000..784e8fa48 Binary files /dev/null and b/workflow/public_html/skins/ext/images/gray/locationbar/location_folder.png differ diff --git a/workflow/public_html/skins/ext/images/gray/locationbar/location_forward.png b/workflow/public_html/skins/ext/images/gray/locationbar/location_forward.png new file mode 100755 index 000000000..b1a181923 Binary files /dev/null and b/workflow/public_html/skins/ext/images/gray/locationbar/location_forward.png differ diff --git a/workflow/public_html/skins/ext/images/gray/locationbar/location_reload.png b/workflow/public_html/skins/ext/images/gray/locationbar/location_reload.png new file mode 100755 index 000000000..0de26566d Binary files /dev/null and b/workflow/public_html/skins/ext/images/gray/locationbar/location_reload.png differ diff --git a/workflow/public_html/skins/ext/images/gray/locationbar/tb-btn-sprite.gif b/workflow/public_html/skins/ext/images/gray/locationbar/tb-btn-sprite.gif new file mode 100755 index 000000000..19bbef3c6 Binary files /dev/null and b/workflow/public_html/skins/ext/images/gray/locationbar/tb-btn-sprite.gif differ diff --git a/workflow/public_html/skins/ext/pmos-xtheme-gray.css b/workflow/public_html/skins/ext/pmos-xtheme-gray.css index 9bbc01dfb..de71aaa44 100644 --- a/workflow/public_html/skins/ext/pmos-xtheme-gray.css +++ b/workflow/public_html/skins/ext/pmos-xtheme-gray.css @@ -212,4 +212,42 @@ left: 0; z-index: 3; color: #777; +} +.x-locationbar { + padding-left: 5px; +} +.x-locationbar .x-locationbar-location { + background-color: white; + border-top: 1px solid #96969D; + border-bottom: 1px solid #96969D; +} +.x-locationbar .x-locationbar-location-first { + border-left: 1px solid #96969D; +} +.x-locationbar .x-locationbar-location-last { + border-right: 1px solid #96969D; +} +.x-locationbar-folder-icon { + background-image: url("/skins/ext/images/gray/locationbar/location_folder.png") !important; +} +.x-locationbar-back-icon { + background-image: url("/skins/ext/images/gray/locationbar/location_back.png") !important; +} +.x-locationbar-forward-icon { + background-image: url("/skins/ext/images/gray/locationbar/location_forward.png") !important; +} +.x-locationbar-reload-icon { + background-image: url("/skins/ext/images/gray/locationbar/location_reload.png") !important; +} +.x-locationbar .x-btn-menu-arrow-wrap .x-btn-center button { + background:transparent url(/skins/ext/images/gray/locationbar/btn-arrow.gif) no-repeat scroll 0pt 3px; + width: 12px; +} +.x-locationbar .x-btn-menu-active .x-btn-menu-arrow-wrap .x-btn-center button { + background-position: 0pt -97px; +} +.x-locationbar .x-btn-click .x-btn-center, +.x-locationbar .x-btn-pressed .x-btn-center, +.x-locationbar .x-btn-menu-active .x-btn-center { + background:transparent url(/skins/ext/images/gray/locationbar/tb-btn-sprite.gif) repeat-x scroll 0pt -105px; } \ No newline at end of file