Merge pull request #1773 from ralpheav/master
Uncommenting code, just in case.
This commit is contained in:
@@ -388,6 +388,127 @@ class AppFolder extends BaseAppFolder
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDirectoryContentSortedBy ($folderID, $docIdFilter = array(), $keyword = null, $searchType = null, $limit = 0, $start = 0, $user = '', $onlyActive = false, $direction = 'ASC', $ColumnSort = 'appDocCreateDate')
|
||||||
|
{
|
||||||
|
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
|
||||||
|
$oCriteria->add( AppDocumentPeer::APP_DOC_UID, $docIdFilter, CRITERIA::IN );
|
||||||
|
} elseif ($folderID != null) {
|
||||||
|
if ($folderID == "/") {
|
||||||
|
$oCriteria->add( AppDocumentPeer::FOLDER_UID, array ('root','',null), CRITERIA::IN );
|
||||||
|
} else {
|
||||||
|
$oCriteria->add( AppDocumentPeer::FOLDER_UID, $folderID );
|
||||||
|
}
|
||||||
|
} elseif ($searchType == "TAG") {
|
||||||
|
$oCriteria->add( AppDocumentPeer::APP_DOC_TAGS, "%" . $keyword . "%", CRITERIA::LIKE );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user != '') {
|
||||||
|
require_once ("classes/model/AppDelegation.php");
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||||
|
$criteria->setDistinct();
|
||||||
|
|
||||||
|
$conditions = array ();
|
||||||
|
$conditions[] = array (AppDelegationPeer::APP_UID,AppDocumentPeer::APP_UID);
|
||||||
|
$conditions[] = array (AppDelegationPeer::DEL_INDEX,AppDocumentPeer::DEL_INDEX);
|
||||||
|
|
||||||
|
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
||||||
|
|
||||||
|
$criteria->add( AppDelegationPeer::USR_UID, $user );
|
||||||
|
|
||||||
|
$rs2 = AppDocumentPeer::doSelectRS( $criteria );
|
||||||
|
|
||||||
|
$rs2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$data = array ();
|
||||||
|
while ($rs2->next()) {
|
||||||
|
$row = $rs2->getRow();
|
||||||
|
$data[] = $row['APP_UID'];
|
||||||
|
}
|
||||||
|
$oCriteria->add( AppDocumentPeer::APP_UID, $data, CRITERIA::IN );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($onlyActive) {
|
||||||
|
$oCriteria->add( AppDocumentPeer::APP_DOC_STATUS, 'ACTIVE' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$numRecTotal = AppDocumentPeer::doCount($oCriteria);
|
||||||
|
|
||||||
|
$oCase->verifyTable();
|
||||||
|
|
||||||
|
//Need to review hot to get the Column Type name
|
||||||
|
switch($ColumnSort) {
|
||||||
|
case 'appDocCreateDate' : $ColumnSort = AppDocumentPeer::APP_DOC_CREATE_DATE; break;
|
||||||
|
//...
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($direction == 'ASC') {
|
||||||
|
$oCriteria->addAscendingOrderByColumn( $ColumnSort );
|
||||||
|
} else {
|
||||||
|
$oCriteria->addDescendingOrderByColumn( $ColumnSort );
|
||||||
|
}
|
||||||
|
|
||||||
|
$response['documents'] = array ();
|
||||||
|
|
||||||
|
$oCriteria->setLimit( $limit );
|
||||||
|
$oCriteria->setOffset( $start );
|
||||||
|
|
||||||
|
$rs = AppDocumentPeer::doSelectRS( $oCriteria );
|
||||||
|
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$rs->next();
|
||||||
|
$filesResult = array ();
|
||||||
|
while (is_array( $row = $rs->getRow() )) {
|
||||||
|
//**** 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'] );
|
||||||
|
|
||||||
|
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")) || $user == "") {
|
||||||
|
if (count( $docIdFilter ) > 0) {
|
||||||
|
if (in_array( $row['APP_DOC_UID'], $docIdFilter )) {
|
||||||
|
$response['documents'][] = $completeInfo;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($lastVersion == $row["DOC_VERSION"]) {
|
||||||
|
//Only Last Document version
|
||||||
|
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) {
|
||||||
|
$response["documents"][] = $completeInfo;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//No search filter active
|
||||||
|
$response["documents"][] = $completeInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$rs->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
$response["totalDocumentsCount"] = $numRecTotal;
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
||||||
{
|
{
|
||||||
//require_once ("classes/model/AppDocument.php");
|
//require_once ("classes/model/AppDocument.php");
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ if (! isset ($_SESSION ['USER_LOGGED'])) {
|
|||||||
print G::json_encode ($res);
|
print G::json_encode ($res);
|
||||||
die ();
|
die ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset ($_REQUEST ['action']) && isset($_REQUEST['sort']) && isset($_REQUEST['dir'])) {
|
||||||
|
if ($_REQUEST['sort'] == "appDocCreateDate" && ($_REQUEST['dir'] == 'ASC' || $_REQUEST['dir'] == 'DESC')) {
|
||||||
|
sortContent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! isset ($_REQUEST ['action'])) {
|
if (! isset ($_REQUEST ['action'])) {
|
||||||
$res ['success'] = false;
|
$res ['success'] = false;
|
||||||
$res ['message'] = 'You may request an action';
|
$res ['message'] = 'You may request an action';
|
||||||
@@ -460,6 +468,252 @@ function expandNode()
|
|||||||
echo G::json_encode($processListTree);
|
echo G::json_encode($processListTree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sortContent()
|
||||||
|
{
|
||||||
|
extract(getExtJSParams());
|
||||||
|
|
||||||
|
$rootFolder = "/";
|
||||||
|
|
||||||
|
$oPMFolder = new AppFolder();
|
||||||
|
|
||||||
|
global $RBAC;
|
||||||
|
|
||||||
|
$user = ($RBAC->userCanAccess('PM_ALLCASES') == 1)? '' : $_SESSION['USER_LOGGED'];
|
||||||
|
|
||||||
|
$totalItems = 0;
|
||||||
|
$totalFolders = 0;
|
||||||
|
$totalDocuments = 0;
|
||||||
|
|
||||||
|
if (!(isset($_POST['sendWhat']))) {
|
||||||
|
$_POST['sendWhat'] = "both";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['renderTree'])) {
|
||||||
|
$limit = 1000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
$direction = "DESC";
|
||||||
|
if (isset($_POST['dir'])) {
|
||||||
|
$direction = $_POST['dir'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($_POST['sendWhat'] == "dirs") || ($_POST['sendWhat'] == "both")) {
|
||||||
|
$folderListObj = $oPMFolder->getFolderList(
|
||||||
|
($_POST["node"] != "root")? (($_POST["node"] == "NA")? "" : $_POST["node"]) : $rootFolder,
|
||||||
|
$limit,
|
||||||
|
$start
|
||||||
|
);
|
||||||
|
|
||||||
|
$folderList=$folderListObj['folders'];
|
||||||
|
$totalFolders=$folderListObj['totalFoldersCount'];
|
||||||
|
$totalItems+=count($folderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($_POST['sendWhat'] == "files") || ($_POST['sendWhat'] == "both")) {
|
||||||
|
global $RBAC;
|
||||||
|
|
||||||
|
$user = ($RBAC->userCanAccess('PM_ALLCASES') == 1)? '' : $_SESSION['USER_LOGGED'];
|
||||||
|
|
||||||
|
$folderContentObj = $oPMFolder->getDirectoryContentSortedBy(
|
||||||
|
($_POST["node"] != "root")? (($_POST["node"] == "NA")? "" : $_POST["node"]) : $rootFolder,
|
||||||
|
array(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
$limit,
|
||||||
|
$start,
|
||||||
|
$user,
|
||||||
|
true,
|
||||||
|
$direction,
|
||||||
|
(isset($_POST["sort"]))? $_POST["sort"]:"appDocCreateDate"
|
||||||
|
);
|
||||||
|
|
||||||
|
$folderContent = $folderContentObj['documents'];
|
||||||
|
$totalDocuments = $folderContentObj['totalDocumentsCount'];
|
||||||
|
$totalItems += count($folderContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
$processListTree = array();
|
||||||
|
$tempTree = array();
|
||||||
|
|
||||||
|
if (isset($folderList) && sizeof($folderList)>0) {
|
||||||
|
//$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'] ='<strong>Directory: </strong>'.$obj['FOLDER_NAME'].
|
||||||
|
'<br /><strong>Create Date:</strong> '.$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";
|
||||||
|
}
|
||||||
|
$processListTree [] = $tempTree;
|
||||||
|
$tempTree=array();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($_POST ['node'] == '/') {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($folderContent)) {
|
||||||
|
foreach ($folderContent as $key => $obj) {
|
||||||
|
$mimeInformation = getMime($obj["APP_DOC_FILENAME"]);
|
||||||
|
|
||||||
|
$tempTree["text"] = $obj["APP_DOC_FILENAME"];
|
||||||
|
$tempTree["name"] = $obj["APP_DOC_FILENAME"];
|
||||||
|
$tempTree["type"] = $mimeInformation["description"];
|
||||||
|
$tempTree["icon"] = $mimeInformation["icon"];
|
||||||
|
|
||||||
|
$tempTree ['appdocid'] = $obj['APP_DOC_UID'];
|
||||||
|
$tempTree ['id'] = $obj['APP_DOC_UID_VERSION'];
|
||||||
|
$tempTree ['cls'] = 'file';
|
||||||
|
//$tempTree ['draggable'] = true;
|
||||||
|
$tempTree ['leaf'] = true;
|
||||||
|
$tempTree ['is_file'] = true;
|
||||||
|
//if ((isset($_POST['option']))&&($_POST['option']=="gridDocuments")) {
|
||||||
|
//}
|
||||||
|
$tempTree ['docVersion'] = $obj['DOC_VERSION'];
|
||||||
|
$tempTree ['appUid'] = $obj['APP_UID'];
|
||||||
|
$tempTree ['usrUid'] = $obj['USR_UID'];
|
||||||
|
$tempTree ['appDocType'] = ucfirst(strtolower($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'] = $tempTree ['qtip'] = $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'] = $obj['USR_USERNAME'];
|
||||||
|
$tempTree ['owner_firstname'] = $obj['USR_FIRSTNAME'];
|
||||||
|
$tempTree ['owner_lastname'] = $obj['USR_LASTNAME'];
|
||||||
|
} else {
|
||||||
|
$tempTree ['owner'] = $obj['USR_USERNAME'];
|
||||||
|
$tempTree ['owner_firstname'] = "";
|
||||||
|
$tempTree ['owner_lastname'] = "";
|
||||||
|
}
|
||||||
|
$tempTree ['deletelabel'] = $obj['DELETE_LABEL'];
|
||||||
|
|
||||||
|
if ((isset($obj['DOWNLOAD_LABEL'])) && ($obj['DOWNLOAD_LABEL']!="")) {
|
||||||
|
$labelgen=strtoupper(str_replace(".","",$obj['DOWNLOAD_LABEL']));
|
||||||
|
$tempTree ['downloadLabel'.$labelgen] = $obj['DOWNLOAD_LABEL'];
|
||||||
|
$tempTree ['downloadLink'.$labelgen] = $obj['DOWNLOAD_LINK'];
|
||||||
|
}
|
||||||
|
$tempTree ['downloadLabel'] = $obj['DOWNLOAD_LABEL'];
|
||||||
|
$tempTree ['downloadLink'] = $obj['DOWNLOAD_LINK'];
|
||||||
|
|
||||||
|
if ((isset($obj['DOWNLOAD_LABEL1'])) && ($obj['DOWNLOAD_LABEL1']!="")) {
|
||||||
|
$labelgen=strtoupper(str_replace(".","",$obj['DOWNLOAD_LABEL1']));
|
||||||
|
$tempTree ['downloadLabel'.$labelgen] = $obj['DOWNLOAD_LABEL1'];
|
||||||
|
$tempTree ['downloadLink'.$labelgen] = $obj['DOWNLOAD_LINK1'];
|
||||||
|
}
|
||||||
|
$tempTree ['downloadLabel1'] = $obj['DOWNLOAD_LABEL1'];
|
||||||
|
$tempTree ['downloadLink1'] = $obj['DOWNLOAD_LINK1'];
|
||||||
|
|
||||||
|
$tempTree ['appDocUidVersion'] = $obj['APP_DOC_UID_VERSION'];
|
||||||
|
|
||||||
|
$tempTree ['is_readable'] = true;
|
||||||
|
$tempTree ['is_file'] = true;
|
||||||
|
$tempTree["outDocGenerate"] = "";
|
||||||
|
|
||||||
|
if (isset($obj["OUT_DOC_GENERATE"])) {
|
||||||
|
switch ($obj["OUT_DOC_GENERATE"]) {
|
||||||
|
case "PDF":
|
||||||
|
case "DOC":
|
||||||
|
$mimeInformation = getMime($obj["APP_DOC_FILENAME"] . "." . strtolower($obj["OUT_DOC_GENERATE"]));
|
||||||
|
|
||||||
|
$tempTree["text"] = $obj["APP_DOC_FILENAME"] . "." . strtolower($obj["OUT_DOC_GENERATE"]);
|
||||||
|
$tempTree["name"] = $obj["APP_DOC_FILENAME"] . "." . strtolower($obj["OUT_DOC_GENERATE"]);
|
||||||
|
$tempTree["type"] = $mimeInformation["description"];
|
||||||
|
$tempTree["icon"] = $mimeInformation["icon"];
|
||||||
|
$tempTree["appDocFileName"] = $tempTree["name"];
|
||||||
|
|
||||||
|
$tempTree["downloadLabel"] = $tempTree["downloadLabel" . $obj["OUT_DOC_GENERATE"]];
|
||||||
|
$tempTree["downloadLink"] = $tempTree["downloadLink" . $obj["OUT_DOC_GENERATE"]];
|
||||||
|
|
||||||
|
$tempTree["id"] = $tempTree["id"] . "_" . $obj["OUT_DOC_GENERATE"];
|
||||||
|
|
||||||
|
$processListTree[] = $tempTree;
|
||||||
|
break;
|
||||||
|
case "BOTH":
|
||||||
|
$strExpander = null;
|
||||||
|
$mimeInformation = getMime($obj["APP_DOC_FILENAME"] . ".pdf");
|
||||||
|
$strExpander = $strExpander . "<a href=\"javascript:;\" onclick=\"openActionDialog(this, 'download', 'pdf'); return false;\" style=\"color: #000000; text-decoration: none;\"><img src=\"/images/documents/extension/pdf.png\" style=\"margin-left: 25px; border: 0;\" alt=\"\" /> <b>" . $obj["APP_DOC_FILENAME"] . ".pdf</b> (" . $mimeInformation["description"] . ")</a>";
|
||||||
|
$strExpander = $strExpander . "<br />";
|
||||||
|
$mimeInformation = getMime($obj["APP_DOC_FILENAME"] . ".doc");
|
||||||
|
$strExpander = $strExpander . "<a href=\"javascript:;\" onclick=\"openActionDialog(this, 'download', 'doc'); return false;\" style=\"color: #000000; text-decoration: none;\"><img src=\"/images/documents/extension/doc.png\" style=\"margin-left: 25px; border: 0;\" alt=\"\" /> <b>" . $obj["APP_DOC_FILENAME"] . ".doc</b> (" . $mimeInformation["description"] . ")</a>";
|
||||||
|
|
||||||
|
$tempTree["outDocGenerate"] = $strExpander;
|
||||||
|
|
||||||
|
$tempTree["text"] = $obj["APP_DOC_FILENAME"];
|
||||||
|
$tempTree["name"] = $obj["APP_DOC_FILENAME"];
|
||||||
|
$tempTree["type"] = "";
|
||||||
|
$tempTree["icon"] = "/images/documents/extension/document.png";
|
||||||
|
$tempTree["appDocFileName"] = $tempTree["name"];
|
||||||
|
|
||||||
|
//$tempTree["downloadLabel"] = $obj["DOWNLOAD_LABEL"];
|
||||||
|
//$tempTree["downloadLink"] = $obj["DOWNLOAD_LINK"];
|
||||||
|
|
||||||
|
$tempTree["id"] = $tempTree["id"] . "_" . $obj["OUT_DOC_GENERATE"];
|
||||||
|
|
||||||
|
$processListTree[] = $tempTree;
|
||||||
|
break;
|
||||||
|
//case "NOFILE":
|
||||||
|
// break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($obj["APP_DOC_TYPE"] == "OUTPUT" &&
|
||||||
|
$tempTree["type"] == G::LoadTranslation("MIME_DES_FILE") &&
|
||||||
|
preg_match("/^.+&ext=(.+)&.+$/", $tempTree["downloadLink"], $arrayMatch)
|
||||||
|
) {
|
||||||
|
$ext = $arrayMatch[1];
|
||||||
|
$mimeInformation = getMime($obj["APP_DOC_FILENAME"] . ".$ext");
|
||||||
|
|
||||||
|
$tempTree["text"] = $obj["APP_DOC_FILENAME"] . ".$ext";
|
||||||
|
$tempTree["name"] = $obj["APP_DOC_FILENAME"] . ".$ext";
|
||||||
|
$tempTree["type"] = $mimeInformation["description"];
|
||||||
|
$tempTree["icon"] = $mimeInformation["icon"];
|
||||||
|
}
|
||||||
|
|
||||||
|
$processListTree[] = $tempTree;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tempTree = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((isset($_POST['option'])) && ($_POST['option'] == "gridDocuments")) {
|
||||||
|
$processListTreeTemp["totalCount"] = $totalFolders + $totalDocuments;
|
||||||
|
$processListTreeTemp['msg']='correct reload';
|
||||||
|
$processListTreeTemp['items']=$processListTree;
|
||||||
|
$processListTree = $processListTreeTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo G::json_encode($processListTree);
|
||||||
|
}
|
||||||
|
|
||||||
function openPMFolder()
|
function openPMFolder()
|
||||||
{
|
{
|
||||||
$WIDTH_PANEL = 350;
|
$WIDTH_PANEL = 350;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ catch(z){
|
|||||||
}
|
}
|
||||||
|
|
||||||
itemSelected = "";
|
itemSelected = "";
|
||||||
|
lastDir = "";
|
||||||
var conn = new Ext.data.Connection();
|
var conn = new Ext.data.Connection();
|
||||||
|
|
||||||
streamFilefromPM=function(fileStream) {
|
streamFilefromPM=function(fileStream) {
|
||||||
@@ -221,6 +222,7 @@ function handleNodeClick( sm, node ) {
|
|||||||
// console.log("Node Clicked: "+node);
|
// console.log("Node Clicked: "+node);
|
||||||
itemSelected = node.id;
|
itemSelected = node.id;
|
||||||
chDir( node.id );
|
chDir( node.id );
|
||||||
|
itemSelected = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,6 +263,7 @@ function getURLParam( strParamName, myWindow){
|
|||||||
|
|
||||||
function openActionDialog(caller, action, dataAux)
|
function openActionDialog(caller, action, dataAux)
|
||||||
{
|
{
|
||||||
|
itemSelected = "openActionDialog";
|
||||||
// console.log("Dialog open: "+caller+" ->"+action);
|
// console.log("Dialog open: "+caller+" ->"+action);
|
||||||
var dialog;
|
var dialog;
|
||||||
var selectedRows = ext_itemgrid.getSelectionModel().getSelections();
|
var selectedRows = ext_itemgrid.getSelectionModel().getSelections();
|
||||||
@@ -486,7 +489,7 @@ function openActionDialog(caller, action, dataAux)
|
|||||||
* messageText, false, true ); }else{ alert("sadasd"); }
|
* messageText, false, true ); }else{ alert("sadasd"); }
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case 'rename':
|
case 'rename':node.select();
|
||||||
dirTreeEd.triggerEdit(Ext.getCmp('dirTreePanel').getSelectionModel().getSelectedNode());
|
dirTreeEd.triggerEdit(Ext.getCmp('dirTreePanel').getSelectionModel().getSelectedNode());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -741,8 +744,7 @@ function var_dump(obj) {
|
|||||||
}
|
}
|
||||||
}// end function var_dump
|
}// end function var_dump
|
||||||
|
|
||||||
var datastore;
|
var datastore = new Ext.data.Store({
|
||||||
datastore = new Ext.data.Store({
|
|
||||||
proxy : new Ext.data.HttpProxy({
|
proxy : new Ext.data.HttpProxy({
|
||||||
url : "../appFolder/appFolderAjax.php",
|
url : "../appFolder/appFolderAjax.php",
|
||||||
directory : "/",
|
directory : "/",
|
||||||
@@ -821,18 +823,34 @@ datastore = new Ext.data.Store({
|
|||||||
])),
|
])),
|
||||||
|
|
||||||
// turn on remote sorting
|
// turn on remote sorting
|
||||||
remoteSort : false
|
remoteSort : true
|
||||||
});
|
});
|
||||||
datastore.paramNames["dir"] = "direction";
|
//datastore.paramNames["dir"] = "direction";
|
||||||
datastore.paramNames["sort"] = "order";
|
//datastore.paramNames["sort"] = "order";
|
||||||
|
|
||||||
datastore.on("beforeload",
|
datastore.on("beforeload",
|
||||||
function(ds, options) {
|
function(ds, options) {
|
||||||
options.params.dir = options.params.dir ? options.params.dir : ds.directory;
|
|
||||||
options.params.node = options.params.dir ? options.params.dir : ds.directory;
|
options.params.dir = (itemSelected.length === 0) ? options.params.dir : ds.directory;
|
||||||
|
options.params.node = (itemSelected.length === 0) ? options.params.dir : ds.directory;
|
||||||
options.params.option = "gridDocuments";
|
options.params.option = "gridDocuments";
|
||||||
options.params.action = "expandNode";
|
options.params.sendWhat = datastore.sendWhat;
|
||||||
options.params.sendWhat = datastore.sendWhat;
|
if (options.params.dir == "ASC" || options.params.dir == "DESC") {
|
||||||
|
options.params.action = "sort";
|
||||||
|
options.params.node = ds.directory;
|
||||||
|
} else {
|
||||||
|
if (ds.sortInfo) {
|
||||||
|
options.params.sort = ds.sortInfo.field;
|
||||||
|
options.params.dir = ds.sortInfo.direction;
|
||||||
|
options.params.action = "sort";
|
||||||
|
options.params.node = ds.directory;
|
||||||
|
} else {
|
||||||
|
options.params.action = "expandNode";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ds.directory != "") {
|
||||||
|
lastDir = ds.directory;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
datastore.on("loadexception",
|
datastore.on("loadexception",
|
||||||
@@ -1209,6 +1227,7 @@ rowExpander, {
|
|||||||
header: _("ID_MODIFIED"),
|
header: _("ID_MODIFIED"),
|
||||||
dataIndex: "appDocCreateDate",
|
dataIndex: "appDocCreateDate",
|
||||||
width: 100,
|
width: 100,
|
||||||
|
sortable: true,
|
||||||
renderer: renderModifiedDate
|
renderer: renderModifiedDate
|
||||||
}, {
|
}, {
|
||||||
header: _("ID_OWNER"),
|
header: _("ID_OWNER"),
|
||||||
@@ -1338,6 +1357,7 @@ function handleRowClick(sm, rowIndex) {//alert(rowIndex);
|
|||||||
function loadDir() {
|
function loadDir() {
|
||||||
// console.info("loadDir");
|
// console.info("loadDir");
|
||||||
// console.trace();
|
// console.trace();
|
||||||
|
itemSelected = "loadDir";
|
||||||
datastore.load({
|
datastore.load({
|
||||||
params : {
|
params : {
|
||||||
start: 0,
|
start: 0,
|
||||||
@@ -1926,10 +1946,7 @@ var documentsTab = {
|
|||||||
|
|
||||||
var tsm = dirTree.getSelectionModel();
|
var tsm = dirTree.getSelectionModel();
|
||||||
// console.log("tried to gtet selection model");
|
// console.log("tried to gtet selection model");
|
||||||
tsm.on('selectionchange',
|
tsm.on('selectionchange', handleNodeClick);
|
||||||
handleNodeClick);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create the editor for the directory
|
// create the editor for the directory
|
||||||
// tree
|
// tree
|
||||||
@@ -1944,6 +1961,9 @@ var documentsTab = {
|
|||||||
|
|
||||||
// console.log("before the first chdir");
|
// console.log("before the first chdir");
|
||||||
// chDir('');
|
// chDir('');
|
||||||
|
if(itemSelected == "" || itemSelected == "loadDir" || itemSelected == "openActionDialog") {
|
||||||
|
itemSelected = lastDir;
|
||||||
|
}
|
||||||
chDir(itemSelected);
|
chDir(itemSelected);
|
||||||
// console.log("starting locatiobar first time");
|
// console.log("starting locatiobar first time");
|
||||||
Ext.getCmp("locationbarcmp").tree = Ext.getCmp("dirTreePanel");
|
Ext.getCmp("locationbarcmp").tree = Ext.getCmp("dirTreePanel");
|
||||||
@@ -1955,6 +1975,7 @@ var documentsTab = {
|
|||||||
var node = dirTree.getNodeById(itemSelected);
|
var node = dirTree.getNodeById(itemSelected);
|
||||||
node.select();
|
node.select();
|
||||||
datastore.directory = itemSelected;
|
datastore.directory = itemSelected;
|
||||||
|
itemSelected = "";
|
||||||
// console.log("location abr started first time");
|
// console.log("location abr started first time");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user