* code for task #5388.

This commit is contained in:
wangyidong
2019-04-25 08:20:49 +08:00
parent afb83acbb1
commit 1daead8b6c
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -304,12 +304,16 @@ class doc extends control
if(!$docResult or dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$docID = $docResult['id'];
$files = $docResult['files'];
$lib = $this->doc->getLibByID($this->post->lib);
if($docResult['status'] == 'exists')
{
$this->send(array('result' => 'fail', 'message' => sprintf($this->lang->duplicate, $this->lang->doc->common), 'locate' => $this->createLink('doc', 'view', "docID=$docID")));
}
$this->action->create('doc', $docID, 'Created');
$fileAction = '';
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
$this->action->create('doc', $docID, 'Created', $fileAction);
$vars = "libID=$libID&browseType=byModule&moduleID={$this->post->module}&orderBy=id_desc&from=$this->from";
$link = $this->createLink('doc', 'browse', $vars);
+1 -1
View File
@@ -629,7 +629,7 @@ class docModel extends model
$docContent->files = join(',', array_keys($files));
$this->dao->insert(TABLE_DOCCONTENT)->data($docContent)->exec();
$this->loadModel('score')->create('doc', 'create', $docID);
return array('status' => 'new', 'id' => $docID);
return array('status' => 'new', 'id' => $docID, 'files' => $files);
}
return false;
}