mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
0bd2e2d83d
|
@ -229,6 +229,9 @@
|
|||
- links are all created absolute based on _httpRoot instead of relative to
|
||||
the current page. This fixes a potential security hole cased by malformed
|
||||
links.
|
||||
- add chart with number of folders per document
|
||||
- add number of links, attachments, versions of a selected user in the user
|
||||
manager
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.22
|
||||
|
|
|
@ -4012,14 +4012,14 @@ class SeedDMS_Core_DMS {
|
|||
function getStatisticalData($type='') { /* {{{ */
|
||||
switch($type) {
|
||||
case 'docsperuser':
|
||||
$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`";
|
||||
$queryStr = "select ".$this->db->concat(array('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`";
|
||||
$queryStr = "select ".$this->db->concat(array('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;
|
||||
|
|
|
@ -358,6 +358,27 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
return str_replace('`', '"', $text);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return sql to concat strings or fields
|
||||
*
|
||||
* @param array $arr list of field names or strings
|
||||
* @return string concated string
|
||||
*/
|
||||
function concat($arr) { /* {{{ */
|
||||
switch($this->_driver) {
|
||||
case 'mysql':
|
||||
return 'concat('.implode(',', $arr).')';
|
||||
break;
|
||||
case 'pgsql':
|
||||
return implode(' || ', $arr);
|
||||
break;
|
||||
case 'sqlite':
|
||||
return implode(' || ', $arr);
|
||||
break;
|
||||
}
|
||||
return '';
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Execute SQL query and return result
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user