* fix bug #34761.
This commit is contained in:
@@ -1948,10 +1948,7 @@ class actionModel extends model
|
||||
if($case->scene)
|
||||
{
|
||||
$scene = $this->dao->select('*')->from(VIEW_SCENECASE)->where('id')->eq($case->scene)->fetch();
|
||||
if($scene->deleted)
|
||||
{
|
||||
return print(js::error($this->lang->action->refusecase));
|
||||
}
|
||||
if($scene->deleted) return print(js::error($this->lang->action->refusecase));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1965,6 +1962,12 @@ class actionModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if($action->objectType == 'doc')
|
||||
{
|
||||
$docContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($action->objectID)->orderBy('version desc')->limit(1)->fetch();
|
||||
if($docContent->files) $this->dao->update(TABLE_FILE)->set('deleted')->eq('0')->where('id')->in($docContent->files)->exec();
|
||||
}
|
||||
|
||||
/* Update deleted field in object table. */
|
||||
$table = $this->config->objectTables[$action->objectType];
|
||||
$this->dao->update($table)->set('deleted')->eq(0)->where('id')->eq($action->objectID)->exec();
|
||||
|
||||
+2
-11
@@ -603,7 +603,7 @@ class doc extends control
|
||||
}
|
||||
elseif($objectType == 'mine')
|
||||
{
|
||||
$this->lang->doc->aclList = $this->lang->doclib->mySpaceAclList['private'];
|
||||
$this->lang->doc->aclList = $this->lang->doclib->mySpaceAclList;
|
||||
}
|
||||
$moduleOptionMenu = $this->doc->getLibsOptionMenu($libs);
|
||||
|
||||
@@ -650,16 +650,7 @@ class doc extends control
|
||||
$this->doc->delete(TABLE_DOC, $docID);
|
||||
|
||||
/* Delete doc files. */
|
||||
$this->loadModel('file');
|
||||
foreach($doc->files as $fileID => $file)
|
||||
{
|
||||
$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);
|
||||
|
||||
$fileRecord = $this->dao->select('id')->from(TABLE_FILE)->where('pathname')->eq($file->pathname)->fetch();
|
||||
if(empty($fileRecord)) $this->file->unlinkFile($file);
|
||||
}
|
||||
if($doc->files) $this->dao->update(TABLE_FILE)->set('deleted')->eq('1')->where('id')->in(array_keys($doc->files))->exec();
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
|
||||
Reference in New Issue
Block a user