mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-11 03:23:17 +00:00
add SeedDMS_Core_DMS::getDuplicateSequenceNo()
This commit is contained in:
parent
b587a4f2a1
commit
9c715a7071
|
@ -3194,6 +3194,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 which are not linked
|
* Returns a list of reviews, approvals which are not linked
|
||||||
* to a user, group anymore
|
* to a user, group anymore
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
- SeedDMS_Core_DMS::createPasswordRequest() creates a cryptographically secure hash
|
- SeedDMS_Core_DMS::createPasswordRequest() creates a cryptographically secure hash
|
||||||
- fix sql error when deleting a folder attribute
|
- fix sql error when deleting a folder attribute
|
||||||
- add SeedDMS_Core_Attribute::getParsedValue() and use it in SeedDMS_Core_Object::getAttributeValue()
|
- add SeedDMS_Core_Attribute::getParsedValue() and use it in SeedDMS_Core_Object::getAttributeValue()
|
||||||
|
- add SeedDMS_Core_DMS::getDuplicateSequenceNo()
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user