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

This commit is contained in:
Uwe Steinmann 2021-07-09 14:53:16 +02:00
commit e2960219c8
5 changed files with 136 additions and 5 deletions

View File

@ -4012,7 +4012,14 @@ class SeedDMS_Core_DMS {
function getStatisticalData($type='') { /* {{{ */
switch($type) {
case 'docsperuser':
$queryStr = "select b.`fullName` as `key`, count(`owner`) as total from `tblDocuments` a left join `tblUsers` b on a.`owner`=b.`id` group by `owner`, b.`fullName`";
$queryStr = "select concat(b.`fullName`, ' (', b.`login`, ')') as `key`, count(`owner`) as total from `tblDocuments` a left join `tblUsers` b on a.`owner`=b.`id` group by `owner`, b.`fullName`";
$resArr = $this->db->getResultArray($queryStr);
if (!$resArr)
return false;
return $resArr;
case 'foldersperuser':
$queryStr = "select concat(b.`fullName`, ' (', b.`login`, ')') as `key`, count(`owner`) as total from `tblFolders` a left join `tblUsers` b on a.`owner`=b.`id` group by `owner`, b.`fullName`";
$resArr = $this->db->getResultArray($queryStr);
if (!$resArr)
return false;

View File

@ -1585,6 +1585,106 @@ class SeedDMS_Core_User { /* {{{ */
$documents[] = $document;
}
return $documents;
}
/**
* Returns all document links of a given user
* @return SeedDMS_Core_DocumentLink[]|bool list of document links
*/
function getDocumentLinks() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM `tblDocumentLinks` ".
"WHERE `userID` = " . $this->_id;
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$links = array();
$classname = 'SeedDMS_Core_DocumentLink';
foreach ($resArr as $row) {
$document = $this->_dms->getDocument($row["document"]);
$target = $this->_dms->getDocument($row["target"]);
/** @var SeedDMS_Core_Document $document */
$link = new $classname((int) $row["id"], $document, $target, $row["userID"], $row["public"]);
$links[] = $link;
}
return $links;
} /* }}} */
/**
* Returns all document files of a given user
* @return SeedDMS_Core_DocumentFile[]|bool list of document files
*/
function getDocumentFiles() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM `tblDocumentFiles` ".
"WHERE `userID` = " . $this->_id;
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$files = array();
$classname = 'SeedDMS_Core_DocumentFile';
foreach ($resArr as $row) {
$document = $this->_dms->getDocument($row["document"]);
/** @var SeedDMS_Core_DocumentFile $file */
$file = new $classname((int) $row["id"], $document, $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"],$row["version"],$row["public"]);
$files[] = $file;
}
return $files;
} /* }}} */
/**
* Returns all document contents of a given user
* @return SeedDMS_Core_DocumentContent[]|bool list of document contents
*/
function getDocumentContents() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM `tblDocumentContent` WHERE `createdBy` = " . $this->_id;
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$contents = array();
$classname = $this->_dms->getClassname('documentcontent');
foreach ($resArr as $row) {
$document = $this->_dms->getDocument($row["document"]);
/** @var SeedDMS_Core_DocumentContent $content */
$content = new $classname((int) $row["id"], $this, $row["version"], $row["comment"], $row["date"], $row["createdBy"], $row["dir"], $row["orgFileName"], $row["fileType"], $row["mimeType"], $row['fileSize'], $row['checksum']);
$contents[] = $content;
}
return $contents;
} /* }}} */
/**
* Returns all folders of a given user
* @return SeedDMS_Core_Folder[]|bool list of folders
*/
function getFolders() { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM `tblFolders` ".
"WHERE `owner` = " . $this->_id . " ORDER BY `sequence`";
$resArr = $db->getResultArray($queryStr);
if (is_bool($resArr) && !$resArr)
return false;
$folders = array();
$classname = $this->_dms->getClassname('folder');
foreach ($resArr as $row) {
/** @var SeedDMS_Core_Folder $folder */
$folder = new $classname((int) $row["id"], $row["name"], $row['parent'], $row["comment"], $row["date"], $row["owner"], $row["inheritAccess"], $row["defaultAccess"], $row["sequence"]);
$folder->setDMS($this->_dms);
$folders[] = $folder;
}
return $folders;
} /* }}} */
/**

View File

@ -24,9 +24,19 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
- removeFromProcesses() documents in comment of log when a user was replaced
- move SeedDMS_Core_Document::checkForDueRevisionWorkflow() into SeedDMS_Core_DocumentContent
and add a wrapper method in SeedDMЅ_Core_Document
- SeedDMS_Core_DMS::getTimeline() uses status log instead of document content
- add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers()
- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog()
- better handling of document with an empty workflow state
- fix checking of email addresses by using filter_var instead of regex
- add new method SeedDMS_Core_Document::hasCategory()
- add new method SeedDMS_Core_DocumentContent::removeReview()
- add new method SeedDMS_Core_DocumentContent::removeApproval()
- add new method SeedDMS_Core_User::getFolders()
- add new method SeedDMS_Core_User::getDocumentContents()
- add new method SeedDMS_Core_User::getDocumentFiles()
- add new method SeedDMS_Core_User::getDocumentLinks()
- add new type 'foldersperuser' to method SeedDMS_Core_DMS::getStatisticalData()
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">
@ -1909,6 +1919,11 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- add new method SeedDMS_Core_Document::hasCategory()
- add new method SeedDMS_Core_DocumentContent::removeReview()
- add new method SeedDMS_Core_DocumentContent::removeApproval()
- add new method SeedDMS_Core_User::getFolders()
- add new method SeedDMS_Core_User::getDocumentContents()
- add new method SeedDMS_Core_User::getDocumentFiles()
- add new method SeedDMS_Core_User::getDocumentLinks()
- add new type 'foldersperuser' to method SeedDMS_Core_DMS::getStatisticalData()
</notes>
</release>
<release>

View File

@ -208,7 +208,7 @@ $(document).ready( function() {
$this->columnStart(3);
$this->contentHeading(getMLText("chart_selection"));
$this->contentContainerStart();
foreach(array('docsperuser', 'sizeperuser', 'docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) {
foreach(array('docsperuser', 'foldersperuser', 'sizeperuser', 'docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) {
echo "<div><a href=\"?type=".$atype."\">".getMLText('chart_'.$atype.'_title')."</a></div>\n";
}
$this->contentContainerEnd();
@ -235,6 +235,7 @@ $(document).ready( function() {
switch($type) {
case 'docspermonth':
case 'docsperuser':
case 'foldersperuser':
case 'docspermimetype':
case 'docspercategory':
case 'docsperstatus':

View File

@ -116,8 +116,16 @@ $(document).ready( function() {
echo "</td></tr>\n";
$documents = $seluser->getDocuments();
echo "<tr><td>".getMLText('documents')."</td><td>".count($documents)."</td></tr>\n";
$contents = $seluser->getDocumentContents();
echo "<tr><td>".getMLText('document_versions')."</td><td>".count($contents)."</td></tr>\n";
$documents = $seluser->getDocumentsLocked();
echo "<tr><td>".getMLText('documents_locked')."</td><td>".count($documents)."</td></tr>\n";
$links = $seluser->getDocumentLinks();
echo "<tr><td>".getMLText('document_links')."</td><td>".count($links)."</td></tr>\n";
$files = $seluser->getDocumentFiles();
echo "<tr><td>".getMLText('document_files')."</td><td>".count($files)."</td></tr>\n";
$folders = $seluser->getFolders();
echo "<tr><td>".getMLText('folders')."</td><td>".count($folders)."</td></tr>\n";
$categories = $seluser->getKeywordCategories();
echo "<tr><td>".getMLText('personal_default_keywords')."</td><td>".count($categories)."</td></tr>\n";
$dnot = $seluser->getNotifications(T_DOCUMENT);