fix checking for subfolder (Bug #194)

This commit is contained in:
Uwe Steinmann 2015-01-29 18:15:04 +01:00
parent 8d94f75cb1
commit a4065698d6
3 changed files with 7 additions and 11 deletions

View File

@ -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

View File

@ -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;
} /* }}} */
/**

View File

@ -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="/">