* Finish task #42146.

This commit is contained in:
tianshujie
2021-09-02 14:33:50 +08:00
parent 17dba195ef
commit 8088a0c285
8 changed files with 34 additions and 11 deletions
+9 -3
View File
@@ -354,6 +354,11 @@ class executionModel extends model
$this->lang->project->name = $this->lang->execution->name;
$this->lang->project->code = $this->lang->execution->code;
}
else
{
$this->lang->project->name = $this->lang->execution->execName;
$this->lang->project->code = $this->lang->execution->execCode;
}
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
->autoCheck($skipFields = 'begin,end')
@@ -361,7 +366,7 @@ class executionModel extends model
->checkIF($sprint->begin != '', 'begin', 'date')
->checkIF($sprint->end != '', 'end', 'date')
->checkIF($sprint->end != '', 'end', 'ge', $sprint->begin)
->checkIF(!empty($sprint->code), 'code', 'unique')
->checkIF(!empty($sprint->code), 'code', 'unique', "type in ('sprint','stage')")
->exec();
/* Add the creater to the team. */
@@ -499,6 +504,7 @@ class executionModel extends model
foreach(explode(',', $this->config->execution->edit->requiredFields) as $field)
{
if(isset($this->lang->execution->$field)) $this->lang->project->$field = $this->lang->execution->$field;
if($oldExecution->type == 'stage' and $field == 'name') $this->lang->project->name = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->project->name);
}
/* Update data. */
@@ -508,7 +514,7 @@ class executionModel extends model
->checkIF($execution->begin != '', 'begin', 'date')
->checkIF($execution->end != '', 'end', 'date')
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
->check('code', 'unique', "id != $executionID and code != '' and deleted = '0'")
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')")
->where('id')->eq($executionID)
->limit(1)
->exec();
@@ -639,7 +645,7 @@ class executionModel extends model
->checkIF($execution->begin != '', 'begin', 'date')
->checkIF($execution->end != '', 'end', 'date')
->checkIF($execution->end != '', 'end', 'gt', $execution->begin)
->checkIF($execution->code != '', 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'")
->checkIF(!empty($execution->code), 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and type in ('sprint','stage')")
->where('id')->eq($executionID)
->limit(1)
->exec();
+2 -2
View File
@@ -85,8 +85,8 @@ $config->product->search['params']['lastEditedDate'] = array('operator' => '=',
$config->product->create = new stdclass();
$config->product->edit = new stdclass();
$config->product->create->requiredFields = 'name';
$config->product->edit->requiredFields = 'name';
$config->product->create->requiredFields = 'name,code';
$config->product->edit->requiredFields = 'name,code';
$config->product->editor = new stdclass();
$config->product->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
+2 -2
View File
@@ -555,7 +555,7 @@ class productModel extends model
$this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck()
->batchCheck($this->config->product->create->requiredFields, 'notempty')
->checkIF(!empty($product->name), 'name', 'unique')
->checkIF(!empty($product->name), 'code', 'unique')
->checkIF(!empty($product->code), 'code', 'unique')
->exec();
if(!dao::isError())
@@ -625,8 +625,8 @@ class productModel extends model
$product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid);
$this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck()
->batchCheck($this->config->product->edit->requiredFields, 'notempty')
->checkIF(!empty($product->code), 'code', 'unique', "id != $productID")
->check('name', 'unique', "id != $productID and deleted = '0'")
->check('code', 'unique', "id != $productID and deleted = '0'")
->where('id')->eq($productID)
->exec();
+4
View File
@@ -52,6 +52,10 @@
<th><?php echo $lang->product->name;?></th>
<td><?php echo html::input('name', '', "class='form-control input-product-title' required");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->product->code;?></th>
<td><?php echo html::input('code', '', "class='form-control' required");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->product->PO;?></th>
<td><?php echo html::select('PO', $poUsers, $this->app->user->account, "class='form-control chosen'");?></td><td></td>
+4
View File
@@ -48,6 +48,10 @@
<th class='w-140px'><?php echo $lang->product->name;?></th>
<td class='w-p40-f'><?php echo html::input('name', $product->name, "class='form-control' required");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->product->code;?></th>
<td><?php echo html::input('code', $product->code, "class='form-control' required");?></td><td></td>
</tr>
<tr>
<th><?php echo $lang->product->PO;?></th>
<td><?php echo html::select('PO', $poUsers, $product->PO, "class='form-control chosen'");?></td><td></td>
+2
View File
@@ -802,6 +802,7 @@ class projectModel extends model
$this->dao->insert(TABLE_PROJECT)->data($project)
->autoCheck()
->batchcheck($requiredFields, 'notempty')
->checkIF(!empty($project->code), 'code', 'unique', "type='project'")
->check('name', 'unique', "type='project' AND deleted='0'")
->exec();
@@ -993,6 +994,7 @@ class projectModel extends model
->checkIF($project->begin != '', 'begin', 'date')
->checkIF($project->end != '', 'end', 'date')
->checkIF($project->end != '', 'end', 'gt', $project->begin)
->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and type='project'")
->check('name', 'unique', "id != $projectID AND type='project' AND deleted='0'")
->where('id')->eq($projectID)
->exec();
+5 -1
View File
@@ -41,7 +41,11 @@
</tr>
<tr>
<th><?php echo $lang->project->name;?></th>
<td class="col-main"><?php echo html::input('name', $name, "class='form-control' required");?></td><td></td><td></td>
<td class="col-main"><?php echo html::input('name', $name, "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->project->code;?></th>
<td><?php echo html::input('code', '', "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->project->PM;?></th>
+6 -3
View File
@@ -42,12 +42,15 @@
}
?>
<td><?php echo html::select('parent', $programList, $project->parent, "class='form-control chosen' $attr");?></td>
<td></td>
<td></td>
<td colspan='2'></td>
</tr>
<tr>
<th><?php echo $lang->project->name;?></th>
<td class="col-main"><?php echo html::input('name', $project->name, "class='form-control' required");?></td><td></td><td></td>
<td class="col-main"><?php echo html::input('name', $project->name, "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->project->code;?></th>
<td><?php echo html::input('code', $project->code, "class='form-control' required");?></td>
</tr>
<tr>
<th><?php echo $lang->project->PM;?></th>