* Fix Bug #1518.
This commit is contained in:
@@ -306,7 +306,9 @@ class file extends control
|
||||
$file = $this->file->getById($fileID);
|
||||
$this->dao->delete()->from(TABLE_FILE)->where('id')->eq($fileID)->exec();
|
||||
$this->loadModel('action')->create($file->objectType, $file->objectID, 'deletedFile', '', $extra=$file->title);
|
||||
@unlink($file->realPath);
|
||||
/* Fix Bug #1518. */
|
||||
$fileRecord = $this->dao->select('id')->from(TABLE_FILE)->where('pathname')->eq($file->pathname)->fetch();
|
||||
if(empty($fileRecord)) @unlink($file->realPath);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1221,6 +1221,17 @@ class testcaseModel extends model
|
||||
$this->dao->insert(TABLE_CASESTEP)->data($step)->exec();
|
||||
}
|
||||
}
|
||||
/* Fix bug #1518. */
|
||||
$oldFile = $this->dao->select('*')->from(TABLE_FILE)->where('objectID')->eq($case->fromCaseID)->fetchAll();
|
||||
foreach($oldFile as $fileID => $File)
|
||||
{
|
||||
$File->objectID = $caseID;
|
||||
$File->addedBy = $this->app->user->account;
|
||||
$File->addedDate = helper::today();
|
||||
$File->downloads = 0;
|
||||
unset($File->id);
|
||||
$this->dao->insert(TABLE_FILE)->data($File)->exec();
|
||||
}
|
||||
$this->loadModel('action')->create('case', $caseID, 'fromlib', '', $case->lib);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user