mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 07:22:11 +00:00
fix checking for subfolder (Bug #194)
This commit is contained in:
parent
8d94f75cb1
commit
a4065698d6
|
@ -6,6 +6,7 @@
|
|||
- unset expiration date works again
|
||||
- complete revised italian translate (Thanks to Diego Fiorani)
|
||||
- preset expiration date for documents in settings
|
||||
- fix checking for subfolders when moving folder (Bug #194)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 4.3.13
|
||||
|
|
|
@ -159,18 +159,12 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
* @return boolean true if passes folder is a subfolder
|
||||
*/
|
||||
function isSubFolder($subfolder) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
$path = $this->getPath();
|
||||
$sfpath = $subfolder->getPath();
|
||||
/* It is a potential sub folder start with the path of the current folder.
|
||||
* If the path differs, it can't be a sub folder.
|
||||
*/
|
||||
for($i=0; $i < count($path); $i++) {
|
||||
if($path[$i] != $sfpath[$i])
|
||||
return false;
|
||||
$target_path = $subfolder->getPath();
|
||||
foreach($target_path as $next_folder) {
|
||||
// the target folder contains this instance in the parent path
|
||||
if($this->getID() == $next_folder->getID()) return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- add missing start transaction in SeedDMD_Core_Folder::remove()
|
||||
- SeedDMD_Core_Folder::isSubFolder() doesn't compare object instances anymore (Bug #194)
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
|
Loading…
Reference in New Issue
Block a user