* finish task #2003.
This commit is contained in:
@@ -249,7 +249,10 @@ class doc extends control
|
||||
$projectID = (int)$projectID;
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$docID = $this->doc->create();
|
||||
$docResult = $this->doc->create();
|
||||
$docID = $docResult['id'];
|
||||
|
||||
if($docResult['status'] == 'existed') die(js::locate($this->createLink('doc', 'view', "docID=$docID"), 'parent'));
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->action->create('doc', $docID, 'Created');
|
||||
|
||||
|
||||
@@ -189,6 +189,10 @@ class docModel extends model
|
||||
->remove('files, labels')
|
||||
->get();
|
||||
$condition = "lib = '$doc->lib' AND module = $doc->module";
|
||||
|
||||
$docID = $this->loadModel('common')->checkRepeat('doc', 'check', $doc->title, $condition);
|
||||
if($docID) return array('status' => 'existed', 'id' => $docID);
|
||||
|
||||
$this->dao->insert(TABLE_DOC)
|
||||
->data($doc)
|
||||
->autoCheck()
|
||||
|
||||
Reference in New Issue
Block a user