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

This commit is contained in:
Uwe Steinmann 2022-11-14 08:21:01 +01:00
commit fbbc79815d
3 changed files with 40 additions and 0 deletions

View File

@ -4021,6 +4021,41 @@ class SeedDMS_Core_DMS {
} /* }}} */
/**
* Returns folders which contain documents with none unique sequence number
*
* This method is for finding folders with documents not having a
* unique sequence number. Those documents cannot propperly be sorted
* by sequence and changing their position is impossible if more than
* two documents with the same sequence number exists, e.g.
* doc 1: 3
* doc 2: 5
* doc 3: 5
* doc 4: 5
* doc 5: 7
* If document 4 was to be moved between doc 1 and 2 it get sequence
* number 4 ((5+3)/2).
* But if document 4 was to be moved between doc 2 and 3 it will again
* have sequence number 5.
*
* @return array|bool
*/
function getDuplicateSequenceNo() { /* {{{ */
$queryStr = "SELECT DISTINCT `folder` FROM (SELECT `folder`, `sequence`, count(*) c FROM `tblDocuments` GROUP BY `folder`, `sequence` HAVING c > 1) a";
$resArr = $this->db->getResultArray($queryStr);
if ($resArr === false)
return false;
$folders = array();
foreach($resArr as $row) {
$folder = $this->getFolder($row['folder']);
if($folder)
$folders[] = $folder;
}
return $folders;
} /* }}} */
/**
* Returns a list of reviews, approvals, receipts, revisions which are not
* linked to a user, group anymore

View File

@ -2028,6 +2028,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- SeedDMS_Core_DMS::createPasswordRequest() creates a cryptographically secure hash
- fix sql error when deleting a folder attribute
- add SeedDMS_Core_Attribute::getParsedValue() and use it in SeedDMS_Core_Object::getAttributeValue()
- add SeedDMS_Core_DMS::getDuplicateSequenceNo()
</notes>
</release>
<release>

View File

@ -98,6 +98,10 @@ if(!isset($_GET['action']) || $_GET['action'] == 'listDuplicateContent')
$duplicateversions = $dms->getDuplicateDocumentContent();
else
$duplicateversions = null;
if(!isset($_GET['action']) || $_GET['action'] == 'listDuplicateSequence')
$duplicatesequences = $dms->getDuplicateSequenceNo();
else
$duplicatesequences = null;
$processwithoutusergroup = array();
foreach(array('review', 'approval', 'receipt', 'revision') as $process) {
foreach(array('user', 'group') as $ug) {