Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-12-18 10:44:33 +01:00
commit f80cb6c24f
27 changed files with 85 additions and 795 deletions

View File

@ -3626,12 +3626,15 @@ class SeedDMS_Core_DMS {
/** @var SeedDMS_Core_Document[] $versions */
$versions = array();
foreach($resArr as $row) {
/** @var SeedDMS_Core_Document $document */
$document = new $this->classnames['document']($row['document'], '', '', '', '', '', '', '', '', '', '', '');
$document->setDMS($this);
$document = $this->getDocument($row['document']);
/* getting the document can fail if it is outside the root folder
* and checkWithinRootDir is enabled.
*/
if($document) {
$version = new $this->classnames['documentcontent']($row['id'], $document, $row['version'], $row['comment'], $row['date'], $row['createdBy'], $row['dir'], $row['orgFileName'], $row['fileType'], $row['mimeType'], $row['fileSize'], $row['checksum'], $row['fileSize'], $row['checksum']);
$versions[] = $version;
}
}
return $versions;
} /* }}} */
@ -3653,12 +3656,15 @@ class SeedDMS_Core_DMS {
/** @var SeedDMS_Core_Document[] $versions */
$versions = array();
foreach($resArr as $row) {
/** @var SeedDMS_Core_Document $document */
$document = new $this->classnames['document']($row['document'], '', '', '', '', '', '', '', '', '', '', '');
$document->setDMS($this);
$document = $this->getDocument($row['document']);
/* getting the document can fail if it is outside the root folder
* and checkWithinRootDir is enabled.
*/
if($document) {
$version = new $this->classnames['documentcontent']($row['id'], $document, $row['version'], $row['comment'], $row['date'], $row['createdBy'], $row['dir'], $row['orgFileName'], $row['fileType'], $row['mimeType'], $row['fileSize'], $row['checksum']);
$versions[] = $version;
}
}
return $versions;
} /* }}} */
@ -3721,6 +3727,10 @@ class SeedDMS_Core_DMS {
$versions = array();
foreach($resArr as $row) {
$document = $this->getDocument($row['document']);
/* getting the document can fail if it is outside the root folder
* and checkWithinRootDir is enabled.
*/
if($document) {
$version = new $this->classnames['documentcontent']($row['id'], $document, $row['version'], $row['comment'], $row['date'], $row['createdBy'], $row['dir'], $row['orgFileName'], $row['fileType'], $row['mimeType'], $row['fileSize'], $row['checksum']);
if(!isset($versions[$row['dupid']])) {
$versions[$row['id']]['content'] = $version;
@ -3728,6 +3738,7 @@ class SeedDMS_Core_DMS {
} else
$versions[$row['dupid']]['duplicates'][] = $version;
}
}
return $versions;
} /* }}} */

View File

@ -886,7 +886,8 @@ class SeedDMS_Core_User { /* {{{ */
$db = $this->_dms->getDB();
$homefolder = intval($homefolder);
$queryStr = "UPDATE `tblUsers` SET `homefolder` = " . ($homefolder ? $homefolder : NULL) . " WHERE `id` = " . $this->_id;
$queryStr = "UPDATE `tblUsers` SET `homefolder` = " . ($homefolder ? $homefolder : 'NULL') . " WHERE `id` = " . $this->_id;
echo $queryStr;
if (!$db->getResult($queryStr))
return false;

View File

@ -1858,6 +1858,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- pass attribute value to callback 'onAttributeValidate'
- new paramter 'new' of methode SeedDMЅ_Core_AttributeDefinition::validate()
- check if folder/document is below rootDir can be turned on (default off)
- SeedDMS_Core_User::setHomeFolder() can be used to unset the home folder
</notes>
</release>
<release>

View File

@ -103,6 +103,10 @@ $theme = $resArr["theme"];
$lang = $resArr["language"];
$dms->setUser($user);
if($settings->_useHomeAsRootFolder && !$user->isAdmin() && $user->getHomeFolder()) {
$dms->checkWithinRootDir = true;
$dms->setRootFolderID($user->getHomeFolder());
}
$role = $user->getRole();
$dms->noReadForStatus = $role->getNoAccess();

View File

@ -36,6 +36,8 @@ class Settings { /* {{{ */
var $_guestID = 2;
// ID of root-folder
var $_rootFolderID = 1;
// use home folder as root-folder
var $_useHomeAsRootFolder = false;
// If you want anybody to login as guest, set the following line to true
var $_enableGuestLogin = false;
// If you even want guest to be logged in automatically, set the following to true
@ -715,6 +717,7 @@ class Settings { /* {{{ */
$tab = $node[0]->attributes();
$this->_siteDefaultPage = strval($tab["siteDefaultPage"]);
$this->_rootFolderID = intval($tab["rootFolderID"]);
$this->_useHomeAsRootFolder = Settings::boolval($tab["useHomeAsRootFolder"]);
$this->_titleDisplayHack = Settings::boolval($tab["titleDisplayHack"]);
$this->_showMissingTranslations = Settings::boolval($tab["showMissingTranslations"]);
}
@ -1074,6 +1077,7 @@ class Settings { /* {{{ */
$node = $this->getXMLNode($xml, '/configuration/advanced', 'display');
$this->setXMLAttributValue($node, "siteDefaultPage", $this->_siteDefaultPage);
$this->setXMLAttributValue($node, "rootFolderID", $this->_rootFolderID);
$this->setXMLAttributValue($node, "useHomeAsRootFolder", $this->_useHomeAsRootFolder);
$this->setXMLAttributValue($node, "titleDisplayHack", $this->_titleDisplayHack);
$this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations);

View File

@ -61,6 +61,10 @@ if (isset($_COOKIE["mydms_session"])) {
}
}
$dms->setUser($user);
if($settings->_useHomeAsRootFolder && !$user->isAdmin() && $user->getHomeFolder()) {
$dms->checkWithinRootDir = true;
$dms->setRootFolderID($user->getHomeFolder());
}
$role = $user->getRole();
$dms->noReadForStatus = $role->getNoAccess();
@ -131,7 +135,7 @@ switch($command) {
$query = $_GET['query'];
$status = isset($_GET['status']) ? (is_array($_GET['status']) ? $_GET['status'] : array($_GET['status'])) : array();
$hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=null, $owner=null, $status, $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x1, $expirationstartdate=array(), $expirationenddate=array());
$hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status, $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x1, $expirationstartdate=array(), $expirationenddate=array());
if($hits) {
$result = array();
foreach($hits['docs'] as $hit) {
@ -152,7 +156,7 @@ switch($command) {
if($user) {
$query = $_GET['query'];
$hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=null, $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array());
$hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array());
if($hits) {
$result = array();
foreach($hits['folders'] as $hit) {
@ -168,9 +172,10 @@ switch($command) {
case 'subtree': /* {{{ */
if($user) {
if(empty($_GET['node']))
$nodeid = $settings->_rootFolderID;
$folder = $dms->getHomeFolder();
else
$nodeid = (int) $_GET['node'];
$folder = $dms->getFolder((int) $_GET['node']);
if (!is_object($folder)) return '';
if(empty($_GET['showdocs']))
$showdocs = false;
else
@ -180,9 +185,6 @@ switch($command) {
else
$orderby = $_GET['orderby'];
$folder = $dms->getFolder($nodeid);
if (!is_object($folder)) return '';
$subfolders = $folder->getSubFolders($orderby);
$subfolders = SeedDMS_Core_DMS::filterAccess($subfolders, $user, M_READ);
$tree = array();

View File

@ -30,6 +30,4 @@ $session->resetSu();
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_switched_back_user')));
add_log_line("");
header("Location: ../".(isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php?folderid=".$settings->_rootFolderID));
?>
header("Location: ".$settings->_httpRoot.(isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php"));

View File

@ -1,241 +0,0 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010-2016 Uwe Steinmann
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.Utils.php");
include("../inc/inc.Language.php");
include("../inc/inc.Init.php");
include("../inc/inc.Extension.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
function getTime() {
if (function_exists('microtime')) {
$tm = microtime();
$tm = explode(' ', $tm);
return (float) sprintf('%f', $tm[1] + $tm[0]);
}
return time();
}
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
$folderid=$settings->_rootFolderID;
} else {
$folderid = $_GET["folderid"];
}
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {
UI::exitError(getMLText("search_results"),getMLText("invalid_folder_id"));
}
// Create the keyword search string. This search spans up to three columns
// in the database: keywords, name and comment.
if (isset($_GET["query"]) && is_string($_GET["query"])) {
$query = $_GET["query"];
}
else {
$query = "";
}
// category
$categories = array();
if(isset($_GET['categoryids']) && $_GET['categoryids']) {
foreach($_GET['categoryids'] as $catid) {
if($catid > 0) {
$category = $dms->getDocumentCategory($catid);
$categories[] = $category->getName();
}
}
}
//
// Get the page number to display. If the result set contains more than
// 25 entries, it is displayed across multiple pages.
//
// This requires that a page number variable be used to track which page the
// user is interested in, and an extra clause on the select statement.
//
// Default page to display is always one.
$pageNumber=1;
if (isset($_GET["pg"])) {
if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) {
$pageNumber = (integer)$_GET["pg"];
}
else if (!strcasecmp($_GET["pg"], "all")) {
$pageNumber = "all";
}
}
// --------------- Suche starten --------------------------------------------
// Check to see if the search has been restricted to a particular
// document owner.
$owner = null;
if (isset($_GET["ownerid"]) && is_numeric($_GET["ownerid"]) && $_GET["ownerid"]!=-1) {
$owner = $dms->getUser($_GET["ownerid"]);
if (!is_object($owner)) {
UI::exitError(getMLText("search_results"),getMLText("unknown_owner"));
}
}
$pageNumber=1;
if (isset($_GET["pg"])) {
if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) {
$pageNumber = (integer)$_GET["pg"];
}
else if (!strcasecmp($_GET["pg"], "all")) {
$pageNumber = "all";
}
}
$startTime = getTime();
if($settings->_enableFullSearch) {
if(!empty($settings->_luceneClassDir))
require_once($settings->_luceneClassDir.'/Lucene.php');
else
require_once('SeedDMS/Lucene.php');
}
Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8');
$index = Zend_Search_Lucene::open($settings->_luceneDir);
$lucenesearch = new SeedDMS_Lucene_Search($index);
$hits = $lucenesearch->search($query, $owner ? $owner->getLogin() : '', '', $categories);
$totalDocs = count($hits);
$limit = 20;
$resArr = array();
if($pageNumber != 'all' && count($hits) > $limit) {
$resArr['totalPages'] = (int) (count($hits) / $limit);
if ((count($hits)%$limit) > 0)
$resArr['totalPages']++;
$hits = array_slice($hits, ($pageNumber-1)*$limit, $limit);
} else {
$resArr['totalPages'] = 1;
}
$resArr['docs'] = array();
if($hits) {
foreach($hits as $hit) {
if($tmp = $dms->getDocument($hit['document_id'])) {
$resArr['docs'][] = $tmp;
}
}
}
$searchTime = getTime() - $startTime;
$searchTime = round($searchTime, 2);
// -------------- Output results --------------------------------------------
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'searchhits'=>$resArr['docs'], 'totalpages'=>$resArr['totalPages'], 'totaldocs'=>$totalDocs, 'pagenumber'=>$pageNumber, 'searchtime'=>$searchTime, 'urlparams'=>$_GET));
if($view) {
$view->show();
exit;
}
UI::htmlStartPage(getMLText("search_results"));
UI::globalNavigation($folder);
UI::pageNavigation(getFolderPathHTML($folder, true), "", $folder);
UI::contentHeading(getMLText("search_results"));
UI::contentContainerStart();
?>
<table width="100%" style="border-collapse: collapse;">
<tr>
<td align="left" style="padding:0; margin:0;">
<?php
$numResults = count($resArr['docs']);
if ($numResults == 0) {
printMLText("search_no_results");
}
else {
printMLText("search_report_fulltext", array("doccount" => $totalDocs));
}
?>
</td>
<td align="right"><?php printMLText("search_time", array("time" => $searchTime));?></td>
</tr>
</table>
<?php
if ($numResults == 0) {
UI::contentContainerEnd();
UI::htmlEndPage();
exit;
}
UI::pageList($pageNumber, $resArr['totalPages'], "../op/op.SearchFulltext.php", $_GET);
print "<table class=\"folderView\">";
print "<thead>\n<tr>\n";
//print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n";
print "<th>".getMLText("comment")."</th>\n";
//print "<th>".getMLText("reviewers")."</th>\n";
//print "<th>".getMLText("approvers")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
$resultsFilteredByAccess = false;
foreach ($resArr['docs'] as $document) {
if ($document->getAccessMode($user) < M_READ) {
$resultsFilteredByAccess = true;
}
else {
$lc = $document->getLatestContent();
print "<tr>";
$docName = htmlspecialchars($document->getName());
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
$folder = $document->getFolder();
$path = $folder->getPath();
for ($i = 1; $i < count($path); $i++) {
print htmlspecialchars($path[$i]->getName())."/";
}
print $docName;
print "</a></td>";
$owner = $document->getOwner();
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
$display_status=$lc->getStatus();
print "<td>".getOverallStatusText($display_status["status"]). "</td>";
print "<td class=\"center\">".$lc->getVersion()."</td>";
$comment = htmlspecialchars($document->getComment());
if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "...";
print "<td>".$comment."</td>";
print "</tr>\n";
}
}
if ($resultsFilteredByAccess) {
print "<tr><td colspan=\"7\">". getMLText("search_results_access_filtered") . "</td></tr>";
}
print "</tbody></table>\n";
UI::pageList($pageNumber, $resArr['totalPages'], "../op/op.Search.php", $_GET);
UI::contentContainerEnd();
UI::htmlEndPage();
?>

View File

@ -184,6 +184,7 @@ if ($action == "saveSettings")
// SETTINGS -ADVANCED - DISPLAY
$settings->_siteDefaultPage = $_POST["siteDefaultPage"];
$settings->_rootFolderID = intval($_POST["rootFolderID"]);
$settings->_useHomeAsRootFolder = getBoolValue("useHomeAsRootFolder");
$settings->_titleDisplayHack = getBoolValue("titleDisplayHack");
$settings->_showMissingTranslations = getBoolValue("showMissingTranslations");

View File

@ -35,8 +35,6 @@ if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
$type = 'docsperuser';
if(!empty($_GET['type'])) {
$type = $_GET['type'];
@ -52,7 +50,6 @@ if($data = $dms->getStatisticalData($type)) {
}
if($view) {
$view->setParam('rootfolder', $rootfolder);
$view->setParam('type', $type);
$view->setParam('data', $data);
$view->setParam('accessobject', $accessop);

View File

@ -31,12 +31,11 @@ require_once("inc/inc.Authentication.php");
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
$node = $dms->getRootFolder();
} else {
$nodeid = intval($_GET["node"]);
$node = $dms->getFolder(intval($_GET["node"]));
}
$node = $dms->getFolder($nodeid);
if (!is_object($node)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}

View File

@ -30,12 +30,11 @@ require_once("inc/inc.Authentication.php");
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
$node = $dms->getRootFolder();
} else {
$nodeid = intval($_GET["node"]);
$node = $dms->getFolder(intval($_GET["node"]));
}
$node = $dms->getFolder($nodeid);
if (!is_object($node)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}

View File

@ -72,7 +72,7 @@ if(isset($_GET['setfiletype']) && $_GET['setfiletype'] == 1) {
$setfiletype = 0;
}
$folder = $dms->getFolder($settings->_rootFolderID);
$folder = $dms->getRootFolder(); //getFolder($settings->_rootFolderID);
$unlinkedversions = $dms->getUnlinkedDocumentContent();
if(!isset($_GET['action']) || $_GET['action'] == 'listUnlinkedFolders')
$unlinkedfolders = $dms->checkFolders();
@ -160,7 +160,7 @@ foreach($tmprevs as $rev) {
}
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
$rootfolder = $dms->getRootFolder(); //getFolder($settings->_rootFolderID);
function repair_tree($dms, $user, $folder, $path=':') { /* {{{ */
$objects = array();

View File

@ -47,15 +47,6 @@ if (isset($_GET["navBar"])) {
} else {
$folderid = $_GET["folderid"];
}
/*
if(strlen($_GET["query"])==0) {
header("Location: ../out/out.SearchForm.php?folderid=".$folderid);
} else {
if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) {
header("Location: ../op/op.SearchFulltext.php?folderid=".$folderid."&query=".$_GET["query"]);
}
}
*/
}
$accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings);

View File

@ -1,59 +0,0 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
// Copyright (C) 2010-2016 Uwe Steinmann
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
if(!isset($settings))
require_once("../inc/inc.Settings.php");
require_once("inc/inc.LogInit.php");
require_once("inc/inc.Utils.php");
require_once("inc/inc.Language.php");
require_once("inc/inc.Init.php");
require_once("inc/inc.Extension.php");
require_once("inc/inc.DBInit.php");
require_once("inc/inc.ClassUI.php");
require_once("inc/inc.Authentication.php");
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
$folderid=$settings->_rootFolderID;
$folder = $dms->getFolder($folderid);
}
else {
$folderid = $_GET["folderid"];
$folder = $dms->getFolder($folderid);
}
if (!is_object($folder)) {
UI::exitError(getMLText("search"),getMLText("invalid_folder_id"));
}
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent/*, SeedDMS_Core_AttributeDefinition::objtype_all*/));
$allCats = $dms->getDocumentCategories();
$allUsers = $dms->getAllUsers($settings->_sortUsersInList);
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
if($view) {
$view->setParam('folder', $folder);
$view->setParam('attrdefs', $attrdefs);
$view->setParam('allcategories', $allCats);
$view->setParam('allusers', $allUsers);
$view->setParam('enablefullsearch', $settings->_enableFullSearch);
$view($_GET);
exit;
}

View File

@ -34,7 +34,8 @@ $accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
//$rootfolder = $dms->getFolder($settings->_rootFolderID);
$rootfolder = $dms->getRootFolder();
if($view) {
$view->setParam('rootfolder', $rootfolder);

View File

@ -35,7 +35,6 @@ $accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
$rootfolder = $dms->getFolder($settings->_rootFolderID);
if(isset($_GET['skip']))
$skip = $_GET['skip'];

View File

@ -35,25 +35,23 @@ $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
$folderid = $settings->_rootFolderID;
$folder = $dms->getRootFolder();
}
else {
$folderid = intval($_GET["folderid"]);
$folder = $dms->getFolder(intval($_GET["folderid"]));
}
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
$node = $dms->getRootFolder();
} else {
$nodeid = intval($_GET["node"]);
$node = $dms->getFolder(intval($_GET["node"]));
}
$node = $dms->getFolder($nodeid);
if (!is_object($node)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))), getMLText("invalid_folder_id"));
}

View File

@ -294,7 +294,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo "<div class=\"navbar navbar-inverse navbar-fixed-top\">\n";
echo " <div class=\"navbar-inner\">\n";
echo " <div class=\"container-fluid\">\n";
echo " <a class=\"brand\" href=\"../out/out.ViewFolder.php?folderid=".$this->params['rootfolderid']."\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</a>\n";
echo " <a class=\"brand\" href=\"../out/out.ViewFolder.php\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</a>\n";
echo " </div>\n";
echo " </div>\n";
echo "</div>\n";
@ -381,7 +381,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo " <a class=\"btn btn-navbar\" data-toggle=\"collapse\" data-target=\".nav-col1\">\n";
echo " <span class=\"fa fa-bars\"></span>\n";
echo " </a>\n";
echo " <a class=\"brand\" href=\"../out/out.ViewFolder.php?folderid=".$this->params['rootfolderid']."\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</a>\n";
echo " <a class=\"brand\" href=\"../out/out.ViewFolder.php?folderid=".$this->params['dms']->getRootFolder()->getId()."\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</a>\n";
if(isset($this->params['session']) && isset($this->params['user']) && $this->params['user']) {
echo " <div class=\"nav-collapse nav-col1\">\n";
echo " <ul id=\"main-menu-admin\" class=\"nav pull-right\">\n";
@ -1468,7 +1468,7 @@ $(document).ready(function() {
$formname = "docid";
$formid = md5($formname.$form);
if(!$folder)
$folderid = $this->params['rootfolderid'];
$folderid = $this->params['dms']->getRootFolder()->getId();
else
$folderid = $folder->getID();
$content = '';
@ -1748,8 +1748,7 @@ $(document).ready(function() {
break;
case SeedDMS_Core_AttributeDefinition::type_date:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
if(!$dateformat)
$dateformat = getConvertDateFormat();
$dateformat = getConvertDateFormat($this->params['settings']->_dateformat);
$content .= '<span class="input-append date datepicker" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'">
<input id="'.$fieldname.'_'.$attrdef->getId().'" class="span9" size="16" name="'.$fieldname.'['.$attrdef->getId().']" type="text" value="'.($objvalue ? $objvalue : '').'">
<span class="add-on"><i class="fa fa-calendar"></i></span>
@ -2083,8 +2082,7 @@ $(document).ready(function() {
} /* }}} */
$orderdir = (isset($orderby[1]) ? ($orderby[1] == 'd' ? 'desc' : 'asc') : 'asc');
if($folderid) {
$folder = $this->params['dms']->getFolder($folderid);
if($folderid && ($folder = $this->params['dms']->getFolder($folderid))) {
if(!$partialtree) {
$path = $folder->getPath();
/* Get the first folder (root folder) of path */
@ -2116,8 +2114,10 @@ $(document).ready(function() {
}
} else {
$root = $this->params['dms']->getFolder($this->params['rootfolderid']);
if($root = $this->params['dms']->getFolder($this->params['rootfolderid']))
$tree = array(array('label'=>$root->getName(), 'id'=>$root->getID(), 'load_on_demand'=>false, 'is_folder'=>true));
else
$tree = array();
}
?>
var data = <?php echo json_encode($tree); ?>;

View File

@ -191,7 +191,6 @@ $(document).ready( function() {
function show() { /* {{{ */
$this->dms = $this->params['dms'];
$user = $this->params['user'];
$rootfolder = $this->params['rootfolder'];
$data = $this->params['data'];
$type = $this->params['type'];

View File

@ -46,6 +46,7 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style {
$partialtree = $this->params['partialtree'];
header('Content-Type: application/javascript');
if($folder)
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form, 0, $orderby, $partialtree);
} /* }}} */
@ -60,8 +61,10 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style {
// $this->htmlStartPage(getMLText("choose_target_document"));
// $this->contentContainerStart();
// $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form);
if($folder) {
$this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form, 0, $orderby);
echo '<script src="../out/out.DocumentChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
}
// $this->contentContainerEnd();
// $this->htmlEndPage(true);
} /* }}} */

View File

@ -40,13 +40,14 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
} /* }}} */
function js() { /* {{{ */
$dms = $this->params['dms'];
$rootfolderid = $this->params['rootfolderid'];
$form = $this->params['form'];
$mode = $this->params['mode'];
$orderby = $this->params['orderby'];
header('Content-Type: application/javascript');
$this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form, 0, $orderby);
$this->printNewTreeNavigationJs($dms->getRootFolder()->getId()/*$rootfolderid*/, $mode, 0, $form, 0, $orderby);
} /* }}} */
function show() { /* {{{ */
@ -59,7 +60,7 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style {
$rootfolderid = $this->params['rootfolderid'];
// $this->htmlStartPage(getMLText("choose_target_folder"));
$this->printNewTreeNavigationHtml($rootfolderid, $mode, 0, $form, 0, $orderby);
$this->printNewTreeNavigationHtml($dms->getRootFolder()->getId()/*$rootfolderid*/, $mode, 0, $form, 0, $orderby);
echo '<script src="../out/out.FolderChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
// $this->htmlEndPage(true);
} /* }}} */

View File

@ -128,9 +128,9 @@ $(document).ready( function() {
$i++;
}
}
echo "<tr><td>".getMLText('pending_reviews')."</td><td>".$i."</td></tr>";
}
if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') {
echo "<tr><td>".getMLText('pending_reviews')."</td><td>".$i."</td></tr>";
$approvalstatus = $selgroup->getApprovalStatus();
$i = 0;
foreach($approvalstatus as $rv) {

View File

@ -1,292 +0,0 @@
<?php
/**
* Implementation of SearchForm view
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Include parent class
*/
require_once("class.Bootstrap.php");
/**
* Class which outputs the html page for SearchForm view
*
* @category DMS
* @package SeedDMS
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_View_SearchForm extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
?>
function checkForm()
{
msg = new Array()
if (document.form1.query.value == "")
{
if (!document.form1.creationdate.checked && !document.form1.lastupdate.checked &&
!document.form1.pendingReview.checked && !document.form1.pendingApproval.checked)
msg.push("<?php printMLText("js_no_query");?>");
}
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
$(document).ready(function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
ev.preventDefault();
});
});
<?php
// $this->printFolderChooserJs("form1");
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$attrdefs = $this->params['attrdefs'];
$allCats = $this->params['allcategories'];
$allUsers = $this->params['allusers'];
$enablefullsearch = $this->params['enablefullsearch'];
$workflowmode = $this->params['workflowmode'];
$this->htmlStartPage(getMLText("search"));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation(getMLText("search"), "");
?>
<ul class="nav nav-tabs" id="searchtab">
<li class="active"><a data-target="#database" data-toggle="tab"><?php printMLText('databasesearch'); ?></a></li>
<li><a data-target="#full" data-toggle="tab"><?php printMLText('fullsearch'); ?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="database">
<?php
$this->contentContainerStart();
?>
<form action="../op/op.Search.php" id="form1" name="form1">
<table class="table-condensed">
<tr>
<td><?php printMLText("search_query");?>:</td>
<td>
<input type="text" name="query">
<select name="mode">
<option value="1" selected><?php printMLText("search_mode_and");?>
<option value="0"><?php printMLText("search_mode_or");?>
</select>
</td>
</tr>
<tr>
<td><?php printMLText("search_in");?>:</td>
<td>
<label class="checkbox" for="keywords"><input type="checkbox" id="keywords" name="searchin[]" value="1"><?php printMLText("keywords");?> (<?php printMLText('documents_only'); ?>)</label>
<label class="checkbox" for="searchName"><input type="checkbox" name="searchin[]" id="searchName" value="2"><?php printMLText("name");?></label>
<label class="checkbox" for="comment"><input type="checkbox" name="searchin[]" id="comment" value="3"><?php printMLText("comment");?></label>
<label class="checkbox" for="attributes"><input type="checkbox" name="searchin[]" id="attributes" value="4"><?php printMLText("attributes");?></label>
</td>
</tr>
<?php
if($attrdefs) {
foreach($attrdefs as $attrdef) {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php $this->printAttributeEditField($attrdef, '') ?></td>
</tr>
<?php
}
}
?>
<tr>
<td><?php printMLText("category");?>:<br />(<?php printMLText('documents_only'); ?>)</td>
<td>
<select name="categoryids[]" multiple>
<option value="-1"><?php printMLText("all_categories");?>
<?php
foreach ($allCats as $catObj) {
print "<option value=\"".$catObj->getID()."\">" . htmlspecialchars($catObj->getName()) . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><?php printMLText("status");?>:<br />(<?php printMLText('documents_only'); ?>)</td>
<td>
<?php if($workflowmode == 'traditional') { ?>
<label class="checkbox" for='pendingReview'><input type="checkbox" id="pendingReview" name="pendingReview" value="1"><?php printOverallStatusText(S_DRAFT_REV);?></label>
<label class="checkbox" for='pendingApproval'><input type="checkbox" id="pendingApproval" name="pendingApproval" value="1"><?php printOverallStatusText(S_DRAFT_APP);?></label>
<?php } else { ?>
<label class="checkbox" for='inWorkflow'><input type="checkbox" id="inWorkflow" name="inWorkflow" value="1"><?php printOverallStatusText(S_IN_WORKFLOW);?></label>
<?php } ?>
<label class="checkbox" for='released'><input type="checkbox" id="released" name="released" value="1"><?php printOverallStatusText(S_RELEASED);?></label>
<label class="checkbox" for='rejected'><input type="checkbox" id="rejected" name="rejected" value="1"><?php printOverallStatusText(S_REJECTED);?></label>
<label class="checkbox" for='inrevision'><input type="checkbox" id="inrevision" name="inrevision" value="1"><?php printOverallStatusText(S_IN_REVISION);?></label>
<label class="checkbox" for='obsolete'><input type="checkbox" id="obsolete" name="obsolete" value="1"><?php printOverallStatusText(S_OBSOLETE);?></label>
<label class="checkbox" for='expired'><input type="checkbox" id="expired" name="expired" value="1"><?php printOverallStatusText(S_EXPIRED);?></label>
</td>
</tr>
<tr>
<td><?php printMLText("owner");?>:</td>
<td>
<select name="ownerid">
<option value="-1"><?php printMLText("all_users");?>
<?php
foreach ($allUsers as $userObj) {
if ($userObj->isGuest())
continue;
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><?php printMLText("under_folder")?>:</td>
<td><?php $this->printFolderChooserHtml("form1", M_READ, -1, $folder);?></td>
</tr>
<tr>
<td><?php printMLText("creation_date");?>:</td>
<td>
<label class="checkbox inline">
<input type="checkbox" name="creationdate" value="true" /><?php printMLText("between");?><br>
</label>
<span class="input-append date" id="createstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="createstart" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="fa fa-calendar"></i></span>
</span>&nbsp;
<?php printMLText("and"); ?>
<span class="input-append date" id="createenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="createend" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="fa fa-calendar"></i></span>
</span>
</td>
</tr>
<tr>
<td><?php printMLText("expires");?>:<br />(<?php printMLText('documents_only'); ?>)</td>
<td>
<label class="checkbox inline">
<input type="checkbox" name="expirationdate" value="true" /><?php printMLText("between");?><br>
</label>
<span class="input-append date" id="expirationstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expirationstart" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="fa fa-calendar"></i></span>
</span>&nbsp;
<?php printMLText("and"); ?>
<span class="input-append date" id="expirationenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
<input class="span3" size="16" name="expirationend" type="text" value="<?php echo date('Y-m-d'); ?>">
<span class="add-on"><i class="fa fa-calendar"></i></span>
</span>
</td>
</tr>
<tr>
<td></td><td><button type="submit" class="btn"><i class="fa fa-search"> <?php printMLText("search"); ?></button></td>
</tr>
</table>
</form>
<?php
$this->contentContainerEnd();
?>
</div>
<?php
if($enablefullsearch) {
?>
<div class="tab-pane" id="full">
<?php
$this->contentContainerStart();
?>
<form action="../op/op.SearchFulltext.php" id="form2" name="form2">
<table class="table-condensed">
<tr>
<td><?php printMLText("search_query");?>:</td>
<td>
<input type="text" name="query">
<!--
<select name="mode">
<option value="1" selected><?php printMLText("search_mode_and");?>
<option value="0"><?php printMLText("search_mode_or");?>
</select>
-->
</td>
</tr>
<tr>
<td><?php printMLText("category_filter");?>:</td>
<td>
<select name="categoryids[]" multiple>
<!--
<option value="-1"><?php printMLText("all_categories");?>
-->
<?php
$allCats = $dms->getDocumentCategories();
foreach ($allCats as $catObj) {
print "<option value=\"".$catObj->getID()."\">" . htmlspecialchars($catObj->getName()) . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><?php printMLText("owner");?>:</td>
<td>
<select name="ownerid">
<option value="-1"><?php printMLText("all_users");?>
<?php
foreach ($allUsers as $userObj) {
if ($userObj->isGuest())
continue;
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td></td><td><button type="submit" class="btn"><i class="fa fa-search"> <?php printMLText("search"); ?></button></td>
</tr>
</table>
</form>
<?php
$this->contentContainerEnd();
}
?>
</div>
</div>
<?php
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */
}
?>

View File

@ -1,130 +0,0 @@
<?php
/**
* Implementation of Search result view
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Include parent class
*/
require_once("class.Bootstrap.php");
/**
* Class which outputs the html page for Search result view
*
* @category DMS
* @package SeedDMS
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010-2012 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_View_SearchFulltext extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$entries = $this->params['searchhits'];
$totalpages = $this->params['totalpages'];
$totaldocs = $this->params['totaldocs'];
$pageNumber = $this->params['pagenumber'];
$urlparams = $this->params['urlparams'];
$searchTime = $this->params['searchtime'];
$this->htmlStartPage(getMLText("search_results"));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation(getMLText("search_results"), "");
?>
<div class="alert">
<?php
$numResults = $totaldocs;
if ($numResults == 0) {
printMLText("search_no_results");
}
else {
printMLText("search_report_fulltext", array("doccount" => $totaldocs));
}
echo ". ";
printMLText("search_time", array("time" => $searchTime));
?>
</div>
<?php
$this->pageList($pageNumber, $totalpages, "../op/op.SearchFulltext.php", $_GET);
$this->contentContainerStart();
if ($numResults == 0) {
$this->contentContainerEnd();
$this->contentEnd();
$this->htmlEndPage();
exit;
}
print "<table class=\"table\">";
print "<thead>\n<tr>\n";
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n";
print "<th>".getMLText("comment")."</th>\n";
//print "<th>".getMLText("reviewers")."</th>\n";
//print "<th>".getMLText("approvers")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
$resultsFilteredByAccess = false;
foreach ($entries as $document) {
if ($document->getAccessMode($user) < M_READ) {
$resultsFilteredByAccess = true;
}
else {
$lc = $document->getLatestContent();
print "<tr>";
print "<td><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$lc->getVersion()."\"><img class=\"mimeicon\" src=\"".$this->getMimeIcon($lc->getFileType())."\" title=\"".htmlspecialchars($lc->getMimeType())."\"></a></td>";
$docName = htmlspecialchars($document->getName());
print "<td><a class=\"standardText\" href=\"../out/out.ViewDocument.php?documentid=".$document->getID()."\">/";
$folder = $document->getFolder();
$path = $folder->getPath();
for ($i = 1; $i < count($path); $i++) {
print htmlspecialchars($path[$i]->getName())."/";
}
print $docName;
print "</a></td>";
$owner = $document->getOwner();
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
$display_status=$lc->getStatus();
print "<td>".getOverallStatusText($display_status["status"]). "</td>";
print "<td class=\"center\">".$lc->getVersion()."</td>";
$comment = htmlspecialchars($document->getComment());
if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "...";
print "<td>".$comment."</td>";
print "</tr>\n";
}
}
if ($resultsFilteredByAccess) {
print "<tr><td colspan=\"7\">". getMLText("search_results_access_filtered") . "</td></tr>";
}
print "</tbody></table>\n";
$this->contentContainerEnd();
$this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $_GET);
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */
}
?>

View File

@ -446,6 +446,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigHeadline('settings_Display'); ?>
<?php $this->showConfigText('settings_siteDefaultPage', 'siteDefaultPage'); ?>
<?php $this->showConfigText('settings_rootFolderID', 'rootFolderID'); ?>
<?php $this->showConfigCheckbox('settings_useHomeAsRootFolder', 'useHomeAsRootFolder'); ?>
<?php $this->showConfigCheckbox('settings_titleDisplayHack', 'titleDisplayHack'); ?>
<?php $this->showConfigCheckbox('settings_showMissingTranslations', 'showMissingTranslations'); ?>

View File

@ -121,9 +121,10 @@ $(document).ready( function() {
if($workflowmode == "traditional") {
$resArr = $dms->getDocumentList('ReviewByMe', $seluser);
if($resArr) {
$tasks['review'] = array();
foreach ($resArr as $res) {
$document = $dms->getDocument($res["id"]);
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
if($document && $document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
$tasks['review'][] = array('id'=>$res['id'], 'name'=>$res['name']);
}
}
@ -133,9 +134,10 @@ $(document).ready( function() {
if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') {
$resArr = $dms->getDocumentList('ApproveByMe', $seluser);
if($resArr) {
$tasks['approval'] = array();
foreach ($resArr as $res) {
$document = $dms->getDocument($res["id"]);
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
if($document && $document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
$tasks['approval'][] = array('id'=>$res['id'], 'name'=>$res['name']);
}
}