Documents at 65%. Display folders and documents, no pagination yet.. Posible to create Folders and upload external files. Working on Download, search

This commit is contained in:
Hugo Loza
2010-12-17 22:30:02 +00:00
parent 09a7399838
commit 779a87e046
121 changed files with 3746 additions and 1287 deletions

View File

@@ -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:<ul>
* <li><b>node</b> : Object<p style="margin-left:1em">The node associated with the clicked item.</p></li>
* </ul>
*/
selectHandler: null,
/**
* @cfg {Function} reloadHandler The function to
* call when clicked. Arguments passed are:<ul>
* <li><b>node</b> : Object<p style="margin-left:1em">The node associated with the current item.</p></li>
* </ul>
*/
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:'<table cellspacing="0"><tr></tr></table>'
},
// 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<path.length; i++) {
this.addPathItemRaw(path[i]);
}
this.currentItem = path[path.length - 1];
this.addHistoryItemRaw(this.currentItem);
this.repaint();
},
// private
addHistoryItemRaw: function(item){
if(this.historyItems.indexOf(item.text) != -1) {
this.historyItems.remove(item.text);
delete this.historyItemNodes[item.text];
}
this.historyItems.push(item.text);
this.historyItemNodes[item.text] = item;
},
// private
addPathItemRaw: function(item){
// if number of items > 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 &nbsp;
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);

View File

@@ -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: [
'<span id="'+this.textId+'">'+text+'</span>', // 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
}
});

View File

@@ -0,0 +1,159 @@
// vim: ts=4:sw=4:nu:fdc=4:nospell
/* global Ext */
/**
* @class Ext.ux.tree.TreeFilterX
* @extends Ext.tree.TreeFilter
*
* <p>
* Shows also parents of matching nodes as opposed to default TreeFilter. In
* other words this filter works "deep way".
* </p>
*
* @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 <a
* href="http://extjs.com/forum/showthread.php?p=252709">http://extjs.com/forum/showthread.php?p=252709</a>
*
* @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.
*
* <p>
* License details: <a href="http://www.gnu.org/licenses/lgpl.html"
* target="_blank">http://www.gnu.org/licenses/lgpl.html</a>
* </p>
*
* @forum 55489
* @demo http://remotetree.extjs.eu
*
* @donate <form action="https://www.paypal.com/cgi-bin/webscr" method="post"
* target="_blank"> <input type="hidden" name="cmd" value="_s-xclick">
* <input type="hidden" name="hosted_button_id" value="3430419"> <input
* type="image"
* src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif"
* border="0" name="submit" alt="PayPal - The safer, easier way to pay
* online."> <img alt="" border="0"
* src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
* height="1"> </form>
*/
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

View File

@@ -24,7 +24,12 @@ class AppFolder extends BaseAppFolder {
* @param strin(32) $folderParent * @param strin(32) $folderParent
* @return Ambigous <>|number * @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) //Try to Load the folder (Foldername+FolderParent)
$oCriteria = new Criteria ( 'workflow' ); $oCriteria = new Criteria ( 'workflow' );
$oCriteria->add ( AppFolderPeer::FOLDER_NAME, $folderName ); $oCriteria->add ( AppFolderPeer::FOLDER_NAME, $folderName );
@@ -32,11 +37,13 @@ class AppFolder extends BaseAppFolder {
$oDataset = AppFolderPeer::doSelectRS ( $oCriteria ); $oDataset = AppFolderPeer::doSelectRS ( $oCriteria );
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$oDataset->next (); $oDataset->next ();
if ($aRow = $oDataset->getRow ()) { //Folder exist, then return the ID if ($aRow = $oDataset->getRow ()) {//Folder exist, then return the ID
return ($aRow ['FOLDER_UID']); $response['success']=false;
} else { //Folder doesn't exist. Create and return the ID $response['message']=$response['error']="Can't create folder <br /> A folder with same name already exists. <br /> $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 (); $folderUID = G::GenerateUniqueID ();
$tr = new AppFolder ( ); $tr = new AppFolder ( );
$tr->setFolderUid ( $folderUID ); $tr->setFolderUid ( $folderUID );
@@ -47,7 +54,11 @@ class AppFolder extends BaseAppFolder {
if ($tr->validate ()) { if ($tr->validate ()) {
// we save it, since we get no validation errors, or do whatever else you like. // we save it, since we get no validation errors, or do whatever else you like.
$res = $tr->save (); $res = $tr->save ();
return $folderUID; $response['success']=true;
$response['message']=$response['error']="Folder successfully created. <br /> $folderParent$folderName";
$response['folderUID']=$folderUID;
return ($response);
//return $folderUID;
} else { } else {
// Something went wrong. We can now get the validationFailures and handle them. // Something went wrong. We can now get the validationFailures and handle them.
$msg = ''; $msg = '';
@@ -55,7 +66,10 @@ class AppFolder extends BaseAppFolder {
foreach ( $validationFailuresArray as $objValidationFailure ) { foreach ( $validationFailuresArray as $objValidationFailure ) {
$msg .= $objValidationFailure->getMessage () . "<br/>"; $msg .= $objValidationFailure->getMessage () . "<br/>";
} }
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 * @param strin(32) $sessionID
* @return string Last Folder ID generated * @return string Last Folder ID generated
*/ */
function createFromPath($folderPath, $sessionID = "") { function createFromPath($folderPath, $sessionID = "") {
if ($sessionID == "") if ($sessionID == "")
$sessionID = $_SESSION ['APPLICATION']; $sessionID = $_SESSION ['APPLICATION'];
//Get current Application Fields //Get current Application Fields
$oApplication = new Application ( ); $oApplication = new Application ( );
$appFields = $oApplication->Load ( $sessionID ); $appFields = $oApplication->Load ( $sessionID );
$folderPathParsed = G::replaceDataField ( $folderPath, $appFields ); $folderPathParsed = G::replaceDataField ( $folderPath, $appFields );
$folderPathParsed = G::replaceDataField ( $folderPath, unserialize ( $appFields ['APP_DATA'] ) ); $folderPathParsed = G::replaceDataField ( $folderPath, unserialize ( $appFields ['APP_DATA'] ) );
$folderPathParsedArray = explode ( "/", $folderPathParsed ); $folderPathParsedArray = explode ( "/", $folderPathParsed );
$folderRoot = "/"; //Always starting from Root $folderRoot = "/"; //Always starting from Root
foreach ( $folderPathParsedArray as $folderName ) { foreach ( $folderPathParsedArray as $folderName ) {
if (trim ( $folderName ) != "") { if (trim ( $folderName ) != "") {
$folderRoot = $this->createFolder ( $folderName, $folderRoot ); $response = $this->createFolder ( $folderName, $folderRoot );
$folderRoot=$response['folderUID'];
} }
} }
return $folderRoot != "/" ? $folderRoot : ""; return $folderRoot != "/" ? $folderRoot : "";
} }
/** /**
* @param string $fileTags * @param string $fileTags
* @param string(32) $sessionID Application ID * @param string(32) $sessionID Application ID
* @return string * @return string
*/ */
function parseTags($fileTags, $sessionID = "") { function parseTags($fileTags, $sessionID = "") {
if ($sessionID == "") if ($sessionID == "")
$sessionID = $_SESSION ['APPLICATION']; $sessionID = $_SESSION ['APPLICATION'];
//Get current Application Fields //Get current Application Fields
$oApplication = new Application ( ); $oApplication = new Application ( );
$appFields = $oApplication->Load ( $sessionID ); $appFields = $oApplication->Load ( $sessionID );
$fileTagsParsed = G::replaceDataField ( $fileTags, $appFields ); $fileTagsParsed = G::replaceDataField ( $fileTags, $appFields );
$fileTagsParsed = G::replaceDataField ( $fileTags, unserialize ( $appFields ['APP_DATA'] ) ); $fileTagsParsed = G::replaceDataField ( $fileTags, unserialize ( $appFields ['APP_DATA'] ) );
return $fileTagsParsed; return $fileTagsParsed;
} }
/** /**
@@ -112,17 +127,17 @@ class AppFolder extends BaseAppFolder {
function getFolderList($folderID) { function getFolderList($folderID) {
$Criteria = new Criteria ( 'workflow' ); $Criteria = new Criteria ( 'workflow' );
$Criteria->clearSelectColumns ()->clearOrderByColumns (); $Criteria->clearSelectColumns ()->clearOrderByColumns ();
$Criteria->addSelectColumn ( AppFolderPeer::FOLDER_UID ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_UID );
$Criteria->addSelectColumn ( AppFolderPeer::FOLDER_PARENT_UID ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_PARENT_UID );
$Criteria->addSelectColumn ( AppFolderPeer::FOLDER_NAME ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_NAME );
$Criteria->addSelectColumn ( AppFolderPeer::FOLDER_CREATE_DATE ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_CREATE_DATE );
$Criteria->addSelectColumn ( AppFolderPeer::FOLDER_UPDATE_DATE ); $Criteria->addSelectColumn ( AppFolderPeer::FOLDER_UPDATE_DATE );
$Criteria->add ( appFolderPeer::FOLDER_PARENT_UID, $folderID, CRITERIA::EQUAL ); $Criteria->add ( appFolderPeer::FOLDER_PARENT_UID, $folderID, CRITERIA::EQUAL );
$Criteria->addAscendingOrderByColumn ( AppFolderPeer::FOLDER_NAME ); $Criteria->addAscendingOrderByColumn ( AppFolderPeer::FOLDER_NAME );
$rs = appFolderPeer::doSelectRS ( $Criteria ); $rs = appFolderPeer::doSelectRS ( $Criteria );
$rs->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $rs->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$rs->next (); $rs->next ();
@@ -157,32 +172,32 @@ class AppFolder extends BaseAppFolder {
return $fields; return $fields;
} }
function getFolderStructure($folderId) { function getFolderStructure($folderId) {
$folderObj = $this->load ( $folderId ); $folderObj = $this->load ( $folderId );
$folderArray [$folderObj ['FOLDER_UID']] = array ("NAME" => $folderObj ['FOLDER_NAME'], "PARENT" => $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_ARRAY'] [] = $folderObj ['FOLDER_NAME'];
while ( $folderObj ['FOLDER_PARENT_UID'] != "" ) { while ( $folderObj ['FOLDER_PARENT_UID'] != "" ) {
$folderObj = $this->load ( $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 [$folderObj ['FOLDER_UID']] = array ("NAME" => $folderObj ['FOLDER_NAME'], "PARENT" => $folderObj ['FOLDER_PARENT_UID'] );
$folderArray ['PATH_ARRAY'] [] = $folderObj ['FOLDER_NAME']; $folderArray ['PATH_ARRAY'] [] = $folderObj ['FOLDER_NAME'];
} }
$folderArray ['PATH'] = str_replace ( "//", "/", implode ( "/", array_reverse ( $folderArray ['PATH_ARRAY'] ) ) ); $folderArray ['PATH'] = str_replace ( "//", "/", implode ( "/", array_reverse ( $folderArray ['PATH_ARRAY'] ) ) );
return $folderArray; return $folderArray;
} }
function getFolderContent($folderID, $docIdFilter = array(), $keyword = NULL, $searchType = NULL) { function getFolderContent($folderID, $docIdFilter = array(), $keyword = NULL, $searchType = NULL) {
require_once ("classes/model/AppDocument.php"); require_once ("classes/model/AppDocument.php");
require_once ("classes/model/InputDocument.php"); require_once ("classes/model/InputDocument.php");
require_once ("classes/model/OutputDocument.php"); require_once ("classes/model/OutputDocument.php");
require_once ("classes/model/Users.php"); require_once ("classes/model/Users.php");
G::LoadClass ( 'case' ); G::LoadClass ( 'case' );
$oCase = new Cases ( ); $oCase = new Cases ( );
G::LoadClass ( 'process' ); G::LoadClass ( 'process' );
$oProcess = new Process ( ); $oProcess = new Process ( );
$oAppDocument = new AppDocument ( ); $oAppDocument = new AppDocument ( );
$oCriteria = new Criteria ( ); $oCriteria = new Criteria ( );
if ((is_array ( $docIdFilter )) && (count ( $docIdFilter ) > 0)) { //Search by App Doc UID no matter what Folder it is 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") { } elseif ($searchType == "TAG") {
$oCriteria->add ( AppDocumentPeer::APP_DOC_TAGS, "%" . $keyword . "%", CRITERIA::LIKE ); $oCriteria->add ( AppDocumentPeer::APP_DOC_TAGS, "%" . $keyword . "%", CRITERIA::LIKE );
} }
$oCase->verifyTable (); $oCase->verifyTable ();
$oCriteria->setOffset(0);
$oCriteria->setLimit(150);
$oCriteria->addAscendingOrderByColumn ( AppDocumentPeer::APP_DOC_INDEX ); $oCriteria->addAscendingOrderByColumn ( AppDocumentPeer::APP_DOC_INDEX );
$oCriteria->addDescendingOrderByColumn ( AppDocumentPeer::DOC_VERSION );
$rs = AppDocumentPeer::doSelectRS ( $oCriteria ); $rs = AppDocumentPeer::doSelectRS ( $oCriteria );
$rs->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $rs->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$rs->next (); $rs->next ();
@@ -205,12 +224,13 @@ class AppFolder extends BaseAppFolder {
//**** start get Doc Info //**** start get Doc Info
$oApp = new Application ( ); $oApp = new Application ( );
if (($oApp->exists ( $row ['APP_UID'] )) || ($row ['APP_UID'] == "00000000000000000000000000000000")) { 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'] ); $completeInfo = $this->getCompleteDocumentInfo ( $row ['APP_UID'], $row ['APP_DOC_UID'], $row ['DOC_VERSION'], $row ['DOC_UID'], $row ['USR_UID'] );
$oAppDocument = new AppDocument ( ); $oAppDocument = new AppDocument ( );
$lastVersion = $oAppDocument->getLastAppDocVersion ( $row ['APP_DOC_UID'], $row ['APP_UID'] ); $lastVersion = $oAppDocument->getLastAppDocVersion ( $row ['APP_DOC_UID'], $row ['APP_UID'] );
$filesResult [] = $completeInfo;
if ($completeInfo ['APP_DOC_STATUS'] != "DELETED") { 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 ((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) { 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 ($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)) { if ((stripos ( $completeInfo ['APP_DOC_FILENAME'], $keyword ) !== false) || (stripos ( $completeInfo ['APP_DOC_TAGS'], $keyword ) !== false)) {
$filesResult [] = $completeInfo; $filesResult [] = $completeInfo;
} }
} else {//No search filter active } else {//No search filter active
$filesResult [] = $completeInfo; $filesResult [] = $completeInfo;
} }
} }
} }
} }
} }
@@ -257,7 +277,7 @@ class AppFolder extends BaseAppFolder {
$row3 = $oProcess->Load ( $row2 ['PRO_UID'] ); $row3 = $oProcess->Load ( $row2 ['PRO_UID'] );
} }
$lastVersion = $oAppDocument->getLastAppDocVersion ( $appDocUid, $appUid ); $lastVersion = $oAppDocument->getLastAppDocVersion ( $appDocUid, $appUid );
switch ($row1 ['APP_DOC_TYPE']) { switch ($row1 ['APP_DOC_TYPE']) {
case "OUTPUT" : case "OUTPUT" :
$oOutputDocument = new OutputDocument ( ); $oOutputDocument = new OutputDocument ( );
@@ -283,7 +303,7 @@ class AppFolder extends BaseAppFolder {
$downloadLabel1 = ".doc"; $downloadLabel1 = ".doc";
break; break;
} }
break; break;
case "INPUT" : case "INPUT" :
$oInputDocument = new InputDocument ( ); $oInputDocument = new InputDocument ( );
@@ -316,15 +336,15 @@ class AppFolder extends BaseAppFolder {
$downloadLabel = G::LoadTranslation ( 'ID_DOWNLOAD' ); $downloadLabel = G::LoadTranslation ( 'ID_DOWNLOAD' );
$downloadLabel1 = ""; $downloadLabel1 = "";
break; break;
} }
$oUser = new Users ( ); $oUser = new Users ( );
if ($usrId != "-1") { if (($usrId != "-1")&&($oUser->userExists($usrId))) {
$row5 = $oUser->load ( $usrId ); $row5 = $oUser->load ( $usrId );
} else { } else {
$row5 ['USR_USERNAME'] = "***"; $row5 ['USR_USERNAME'] = "***";
} }
//Labels/Links //Labels/Links
$row6 = array (); $row6 = array ();
$row6 ['DELETE_LABEL'] = G::LoadTranslation('ID_DELETE'); $row6 ['DELETE_LABEL'] = G::LoadTranslation('ID_DELETE');
@@ -340,12 +360,12 @@ class AppFolder extends BaseAppFolder {
$row6 ['NEWVERSION_LABEL'] = G::LoadTranslation ( 'ID_NEW_VERSION' ); $row6 ['NEWVERSION_LABEL'] = G::LoadTranslation ( 'ID_NEW_VERSION' );
} }
$row6 ['APP_DOC_UID_VERSION'] = $appDocUid . "_" . $docVersion; $row6 ['APP_DOC_UID_VERSION'] = $appDocUid . "_" . $docVersion;
if ($appUid == "00000000000000000000000000000000") { //External Files if ($appUid == "00000000000000000000000000000000") { //External Files
$row1 ['APP_DOC_TYPE'] = G::LoadTranslation ( 'ID_EXTERNAL_FILE' ); $row1 ['APP_DOC_TYPE'] = G::LoadTranslation ( 'ID_EXTERNAL_FILE' );
} }
//**** End get docinfo //**** End get docinfo
$infoMerged = array_merge ( $row1, $row2, $row3, $row4, $row5, $row6 ); $infoMerged = array_merge ( $row1, $row2, $row3, $row4, $row5, $row6 );
//krumo($infoMerged); //krumo($infoMerged);
@@ -355,7 +375,7 @@ class AppFolder extends BaseAppFolder {
if (isset ( $infoMerged ['PRO_UID'] )) { if (isset ( $infoMerged ['PRO_UID'] )) {
$aObjectPermissions = $oCase->getAllObjects ( $infoMerged ['PRO_UID'], $infoMerged ['APP_UID'], '', $sUserUID ); $aObjectPermissions = $oCase->getAllObjects ( $infoMerged ['PRO_UID'], $infoMerged ['APP_UID'], '', $sUserUID );
} }
if (! is_array ( $aObjectPermissions )) { if (! is_array ( $aObjectPermissions )) {
$aObjectPermissions = array ('DYNAFORMS' => array (- 1 ), 'INPUT_DOCUMENTS' => array (- 1 ), 'OUTPUT_DOCUMENTS' => array (- 1 ) ); $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 ); return array_merge ( $infoMerged, $aObjectPermissions );
} }
@@ -395,26 +415,26 @@ class AppFolder extends BaseAppFolder {
} }
return (array_merge ( $folderArray, $foldersList )); return (array_merge ( $folderArray, $foldersList ));
} }
function getFolderTags($rootFolder) { function getFolderTags($rootFolder) {
$folderArray [$rootFolder] = $rootFolder; $folderArray [$rootFolder] = $rootFolder;
$foldersToProcess = $this->getFolderChilds ( $rootFolder, $folderArray ); $foldersToProcess = $this->getFolderChilds ( $rootFolder, $folderArray );
$tagsInfo = array (); $tagsInfo = array ();
foreach ( $foldersToProcess as $folderkey => $foldername ) { foreach ( $foldersToProcess as $folderkey => $foldername ) {
$filesList = $this->getFolderContent ( $folderkey ); $filesList = $this->getFolderContent ( $folderkey );
foreach ( $filesList as $key => $fileInfo ) { foreach ( $filesList as $key => $fileInfo ) {
$fileTags = explode ( ",", $fileInfo ['APP_DOC_TAGS'] ); $fileTags = explode ( ",", $fileInfo ['APP_DOC_TAGS'] );
foreach ( $fileTags as $key1 => $tag ) { foreach ( $fileTags as $key1 => $tag ) {
if (! (isset ( $tagsInfo [$tag] ))) if (! (isset ( $tagsInfo [$tag] )))
$tagsInfo [$tag] = 0; $tagsInfo [$tag] = 0;
$tagsInfo [$tag] ++; $tagsInfo [$tag] ++;
} }
} }
} }
return $tagsInfo; return $tagsInfo;
} }
function remove ($FolderUid, $rootfolder ) { function remove ($FolderUid, $rootfolder ) {
$oCriteria = new Criteria('workflow'); $oCriteria = new Criteria('workflow');

View File

@@ -63,6 +63,24 @@ class Users extends BaseUsers {
throw($e); 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) public function load($UsrUid)
{ {
try { try {

View File

@@ -60,7 +60,7 @@
$G_TMP_MENU->AddIdRawOption('CASES_HOME', 'casesStartPage', G::LoadTranslation('ID_CASES_START_PAGE'), '', '', 'blockHeader'); $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'))), '' ); //$G_TMP_MENU->AddIdRawOption('CASES_START_PAGE', 'casesStartPage?action=mainDashboard', ucwords(strtolower(G::LoadTranslation('ID_DASHBOARD'))), '' );
//Load Other registered Dashboards (From plugins) //Load Other registered Dashboards (From plugins)

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,14 @@
} }
$oHeadPublisher =& headPublisher::getSingleton(); $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->addExtJsScript('cases/casesStartPage', false); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartPage'); //adding a html file .html. $oHeadPublisher->addContent( 'cases/casesStartPage'); //adding a html file .html.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More