From f888f66bf5ea575a7d570986efcd845cd276a60a Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 28 Jun 2022 09:59:34 +0000 Subject: [PATCH] * Finish task#58578. --- module/execution/control.php | 6 ++++++ module/execution/css/create.css | 3 +++ module/execution/css/edit.css | 1 + module/execution/lang/de.php | 3 +++ module/execution/lang/en.php | 2 ++ module/execution/lang/fr.php | 3 +++ module/execution/lang/zh-cn.php | 2 ++ module/execution/model.php | 14 ++++++++------ module/execution/view/create.html.php | 4 ++-- module/execution/view/edit.html.php | 2 +- module/task/config.php | 2 +- module/webhook/css/bind.css | 1 + module/webhook/view/bind.html.php | 4 ++-- 13 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 module/webhook/css/bind.css diff --git a/module/execution/control.php b/module/execution/control.php index c73ae2f10a..29a025220e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1354,6 +1354,12 @@ class execution extends control include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; $lang->execution->common = $executionLang; } + elseif(!empty($project) and $project->model == 'waterfall') + { + global $lang; + $lang->executionCommon = $lang->execution->stage; + include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; + } $extra = str_replace(array(',', ' '), array('&', ''), $extra); parse_str($extra, $output); diff --git a/module/execution/css/create.css b/module/execution/css/create.css index 2d26e8f6b8..cb9f540c66 100644 --- a/module/execution/css/create.css +++ b/module/execution/css/create.css @@ -27,3 +27,6 @@ #mainContent .laneHeightBox .radio-inline+.radio-inline {margin-left: 20px;} #mainContent .laneHeightBox .tip {color: #999;} + +#dateRange {vertical-align: top; padding-top: 13px;} +#dateRangeOption {vertical-align: top; padding-top: 13px;} diff --git a/module/execution/css/edit.css b/module/execution/css/edit.css index 71c7410e28..ea0bd27693 100644 --- a/module/execution/css/edit.css +++ b/module/execution/css/edit.css @@ -7,3 +7,4 @@ #mainContent .laneHeightBox .radio-inline+.radio-inline, #mainContent .importBox .radio-inline+.radio-inline {margin-left: 20px;} #mainContent .laneHeightBox .tip {color: #999;} +#dateRange {vertical-align: top; padding-top: 13px;} diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index 9803ad8926..c39f1544ad 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -134,6 +134,7 @@ $lang->execution->sortColumn = 'Kanban Card Sorting'; $lang->execution->batchCreateStory = "Batch create {$lang->SRCommon}"; $lang->execution->batchCreateTask = 'Batch create task'; $lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}"; +$lang->execution->myTask = "My Task"; $lang->execution->list = "{$lang->executionCommon} List"; /* Fields of zt_team. */ @@ -379,6 +380,8 @@ $lang->execution->errorBegin = "The start time of {$lang->execu $lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; $lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s."; $lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project."; +$lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' "%s" should be ≥ the start date of project %s: %s.'; +$lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' "%s" should be ≤ the deadline of project %s: %s.'; $lang->execution->accessDenied = "Zugriff zu {$lang->executionCommon} verweigert!"; $lang->execution->tips = 'Hinweis'; $lang->execution->afterInfo = "{$lang->executionCommon} wurde erstellt. Als nächstes können Sie "; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 887e79c0e4..242f35f23b 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -380,6 +380,8 @@ $lang->execution->errorBegin = "The start time of {$lang->execu $lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; $lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s."; $lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project."; +$lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' "%s" should be ≥ the start date of project "%s": %s.'; +$lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' "%s" should be ≤ the deadline of project "%s": %s.'; $lang->execution->accessDenied = "Your access to {$lang->executionCommon} is denied!"; $lang->execution->tips = 'Note'; $lang->execution->afterInfo = "{$lang->executionCommon} is created. Next you can "; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 5f3a4d4149..2c882fcda4 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -134,6 +134,7 @@ $lang->execution->sortColumn = 'Kanban Card Sorting'; $lang->execution->batchCreateStory = "Batch create {$lang->SRCommon}"; $lang->execution->batchCreateTask = 'Batch create task'; $lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}"; +$lang->execution->myTask = "My Task"; $lang->execution->list = "{$lang->executionCommon} List"; /* Fields of zt_team. */ @@ -379,6 +380,8 @@ $lang->execution->errorBegin = "The start time of {$lang->execu $lang->execution->errorEnd = "The end time of {$lang->executionCommon} cannot be greater than the end time %s of the project."; $lang->execution->errorLetterProject = "The start time of stage cannot be less than the start time of the project %s."; $lang->execution->errorGreaterProject = "The end time of stage cannot be greater than the end time %s of the project."; +$lang->execution->errorCommonBegin = 'The start date of ' . $lang->executionCommon . ' "%s" should be ≥ the start date of project %s: %s.'; +$lang->execution->errorCommonEnd = 'The deadline of ' . $lang->executionCommon . ' "%s" should be ≤ the deadline of project %s: %s.'; $lang->execution->accessDenied = "Votre accès au {$lang->executionCommon} est refusé ! Désolé."; $lang->execution->tips = 'Note'; $lang->execution->afterInfo = "Le {$lang->executionCommon} a été créé avec succès ! Ensuite vous pouvez "; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 5f83ac38bd..b29446e64e 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -380,6 +380,8 @@ $lang->execution->errorBegin = "{$lang->executionCommon}的开 $lang->execution->errorEnd = "{$lang->executionCommon}的截止时间不能大于所属项目的结束时间%s。"; $lang->execution->errorLetterProject = "阶段的计划开始时间不能小于所属项目的计划开始时间%s。"; $lang->execution->errorGreaterProject = "阶段的计划完成时间不能大于所属项目的计划完成时间%s。"; +$lang->execution->errorCommonBegin = $lang->executionCommon . '“%s”开始日期应大于等于项目“%s”的开始日期:%s。'; +$lang->execution->errorCommonEnd = $lang->executionCommon . '“%s”截止日期应小于等于项目“%s”的截止日期:%s。'; $lang->execution->accessDenied = "您无权访问该{$lang->executionCommon}!"; $lang->execution->tips = '提示'; $lang->execution->afterInfo = "{$lang->executionCommon}添加成功,您现在可以进行以下操作:"; diff --git a/module/execution/model.php b/module/execution/model.php index d9ee0439e7..bcfe9f25f4 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -305,7 +305,7 @@ class executionModel extends model return false; } - if($this->config->systemMode == 'new') $this->checkBeginAndEndDate($_POST['project'], $_POST['begin'], $_POST['end']); + if($this->config->systemMode == 'new') $this->checkBeginAndEndDate($_POST['project'], $_POST['begin'], $_POST['end'], $_POST['name']); if(dao::isError()) return false; /* Determine whether to add a sprint or a stage according to the model of the execution. */ @@ -500,7 +500,7 @@ class executionModel extends model if(in_array($execution->status, array('closed', 'suspended'))) $this->computeBurn($executionID); - if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end); + if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end, $execution->name); if(dao::isError()) return false; /* Child stage inherits parent stage permissions. */ @@ -869,7 +869,7 @@ class executionModel extends model ->remove('comment') ->get(); - if($this->config->systemMode == 'new') $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end); + if($this->config->systemMode == 'new') $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end, $oldExecution->name); if(dao::isError()) return false; $execution = $this->loadModel('file')->processImgURL($execution, $this->config->execution->editor->putoff['id'], $this->post->uid); @@ -1114,17 +1114,19 @@ class executionModel extends model /** * Check begin and end date. * + * @param int $projectID * @param string $begin * @param string $end + * @param string $executionName * @access public * @return void */ - public function checkBeginAndEndDate($projectID, $begin, $end) + public function checkBeginAndEndDate($projectID, $begin, $end, $executionName) { $project = $this->loadModel('project')->getByID($projectID); - if($begin < $project->begin) dao::$errors['begin'] = sprintf($this->lang->execution->errorBegin, $project->begin); - if($end > $project->end) dao::$errors['end'] = sprintf($this->lang->execution->errorEnd, $project->end); + if($begin < $project->begin) dao::$errors['begin'] = sprintf($this->lang->execution->errorCommonBegin, $executionName, $project->name, $project->begin); + if($end > $project->end) dao::$errors['end'] = sprintf($this->lang->execution->errorCommonEnd, $executionName, $project->name, $project->end); } /* diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index bc1768c8a3..3a671c7a24 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -72,7 +72,7 @@