* Modify the required item prompt language item.

This commit is contained in:
tianshujie98
2021-06-02 10:25:21 +08:00
parent 246f8c7232
commit 2dc084e911
3 changed files with 20 additions and 10 deletions
+18 -8
View File
@@ -567,6 +567,23 @@ class executionModel extends model
$oldExecutions = $this->getByIdList($this->post->executionIDList);
$nameList = array();
$codeList = array();
/* Replace required language. */
if($this->app->openApp == 'project')
{
$projectModel = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($this->session->project)->fetch('model');
if($projectModel == 'scrum')
{
$this->lang->project->name = $this->lang->execution->name;
$this->lang->project->code = $this->lang->execution->code;
}
else
{
$this->lang->project->name = str_replace($this->lang->project->common, $this->lang->project->stage, $this->lang->project->name);
$this->lang->project->code = str_replace($this->lang->project->common, $this->lang->project->stage, $this->lang->project->code);
}
}
foreach($data->executionIDList as $executionID)
{
$executionName = $data->names[$executionID];
@@ -602,13 +619,6 @@ class executionModel extends model
}
if(dao::isError()) die(js::error(dao::getError()));
/* Replace required language. */
if($this->app->openApp == 'project')
{
$this->lang->project->name = $this->lang->execution->name;
$this->lang->project->code = $this->lang->execution->code;
}
foreach($executions as $executionID => $execution)
{
$oldExecution = $oldExecutions[$executionID];
@@ -620,7 +630,7 @@ class executionModel extends model
->checkIF($execution->begin != '', 'begin', 'date')
->checkIF($execution->end != '', 'end', 'date')
->checkIF($execution->end != '', 'end', 'gt', $execution->begin)
->check('code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'")
->checkIF($execution->code != '', 'code', 'unique', "id NOT " . helper::dbIN($data->executionIDList) . " and deleted='0'")
->where('id')->eq($executionID)
->limit(1)
->exec();