Finish task #43916.
This commit is contained in:
@@ -365,10 +365,11 @@ class executionModel extends model
|
||||
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->batchcheck($this->config->execution->create->requiredFields, 'notempty')
|
||||
->checkIF(!empty($sprint->name), 'name', 'unique', "`type` in ('sprint','stage') and `parent` = $sprint->parent")
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage') and `parent` = $sprint->parent")
|
||||
->checkIF($sprint->begin != '', 'begin', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin)
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "type in ('sprint','stage')")
|
||||
->exec();
|
||||
|
||||
/* Add the creater to the team. */
|
||||
|
||||
@@ -542,8 +542,8 @@ class productModel extends model
|
||||
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
|
||||
->batchCheck($this->config->product->create->requiredFields, 'notempty')
|
||||
->checkIF(!empty($product->name), 'name', 'unique')
|
||||
->checkIF(!empty($product->code), 'code', 'unique')
|
||||
->checkIF(!empty($product->name), 'name', 'unique', "`program` = $product->program")
|
||||
->checkIF(!empty($product->code), 'code', 'unique', "`program` = $product->program")
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
|
||||
@@ -624,7 +624,7 @@ class programModel extends model
|
||||
->checkIF($program->begin != '', 'begin', 'date')
|
||||
->checkIF($program->end != '', 'end', 'date')
|
||||
->checkIF($program->end != '', 'end', 'gt', $program->begin)
|
||||
->checkIF(!empty($program->name), 'name', 'unique', "`type`='program'")
|
||||
->checkIF(!empty($program->name), 'name', 'unique', "`type`='program' and `parent` = $program->parent")
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
|
||||
@@ -811,9 +811,9 @@ class projectModel extends model
|
||||
$this->dao->insert(TABLE_PROJECT)->data($project)
|
||||
->autoCheck()
|
||||
->batchcheck($requiredFields, 'notempty')
|
||||
->checkIF(!empty($project->code), 'code', 'unique', "type='project'")
|
||||
->checkIF(!empty($project->name), 'name', 'unique', "`type`='project' and `parent` = $project->parent")
|
||||
->checkIF(!empty($project->code), 'code', 'unique', "`type`='project' and `parent` = $project->parent")
|
||||
->checkIF($project->end != '', 'end', 'gt', $project->begin)
|
||||
->check('name', 'unique', "type='project' AND deleted='0'")
|
||||
->exec();
|
||||
|
||||
/* Add the creater to the team. */
|
||||
|
||||
Reference in New Issue
Block a user