From 021be9362f6d59d93c08da9717cc78e86a5e0268 Mon Sep 17 00:00:00 2001 From: weimax <121642038@qq.com> Date: Mon, 31 Oct 2022 11:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=AD=E4=BB=A3=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=AD=E4=B8=8D=E8=83=BD=E4=BF=AE=E6=94=B9=E7=9A=84?= =?UTF-8?q?bug;=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9D=97=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ctrl/Agile.php | 25 ++++++++++++++++++++++ app/ctrl/issue/Main.php | 1 + app/event/Events.php | 2 +- app/view/twig/project/setting_module.twig | 26 ++--------------------- app/view/twig/project/setting_sprint.twig | 15 +++++++++++++ bin/config.toml | 2 +- bin/cron.json | 6 +++--- config.tpl.yml | 2 +- config.yml | 12 +++++------ public/dev/js/project/module.js | 2 +- public/dev/js/project/sprint.js | 17 +++++++++++++++ 11 files changed, 73 insertions(+), 37 deletions(-) diff --git a/app/ctrl/Agile.php b/app/ctrl/Agile.php index 68baace37..8ade4a51a 100644 --- a/app/ctrl/Agile.php +++ b/app/ctrl/Agile.php @@ -862,6 +862,31 @@ public function setSprintActive() } } + public function setSprintPause() + { + $sprintId = null; + if (isset($_POST['sprint_id'])) { + $sprintId = (int)$_POST['sprint_id']; + } + if (empty($sprintId)) { + $this->ajaxFailed('参数错误', '迭代id不能为空'); + } + $sprintModel = new SprintModel(); + $sprint = $sprintModel->getItemById($sprintId); + if (!isset($sprint['id'])) { + $this->ajaxFailed('参数错误', '迭代数据不存在'); + } + list($upRet, $msg) = $sprintModel->updateById($sprintId, ['active' => '0']); + if ($upRet) { + $event = new CommonPlacedEvent($this, $sprint); + $this->dispatcher->dispatch($event, Events::onSprintSetPause); + $this->ajaxSuccess('提示', '操作成功'); + } else { + $this->ajaxFailed('提示', 'server_error:' . $msg); + } + } + + /** * 将事项移动到待办事项 * @throws \Exception diff --git a/app/ctrl/issue/Main.php b/app/ctrl/issue/Main.php index f7ef9c0f9..be93f3723 100644 --- a/app/ctrl/issue/Main.php +++ b/app/ctrl/issue/Main.php @@ -1840,6 +1840,7 @@ public function update($params) $notifyFlag = NotifyLogic::NOTIFY_FLAG_ISSUE_UPDATE; $info['modifier'] = $uid; + $info['updated'] = time(); // 状态 如果是关闭状态则要检查权限 if (isset($info['status']) && $issue['status'] != $info['status']) { diff --git a/app/event/Events.php b/app/event/Events.php index 7fe7266b9..01eb71744 100644 --- a/app/event/Events.php +++ b/app/event/Events.php @@ -108,8 +108,8 @@ public function __construct() public const onSprintCreate = 'onSprintCreate'; public const onSprintUpdate = 'onSprintUpdate'; public const onSprintSetActive = 'onSprintSetActive'; + public const onSprintSetPause = 'onSprintSetPause'; public const onSprintDelete = 'onSprintDelete'; - /** * 版本事件 */ diff --git a/app/view/twig/project/setting_module.twig b/app/view/twig/project/setting_module.twig index 4443f9dfd..56a1309e4 100644 --- a/app/view/twig/project/setting_module.twig +++ b/app/view/twig/project/setting_module.twig @@ -171,7 +171,7 @@ - + @@ -249,29 +249,7 @@ }); - function remove(module_id) { - swal({ - title: "您确定删除吗?", - text: "你将无法恢复它", - html: true, - type: "warning", - showCancelButton: true, - confirmButtonColor: "#DD6B55", - confirmButtonText: "确 定", - cancelButtonText: "取 消!", - closeOnConfirm: false, - closeOnCancel: false - }, - function(isConfirm){ - if (isConfirm) { - window.$modules.delete(=project_id?>, module_id); - swal.close(); - }else{ - swal.close(); - } - } - ); - } + diff --git a/app/view/twig/project/setting_sprint.twig b/app/view/twig/project/setting_sprint.twig index 454bf65aa..c4d4356f9 100644 --- a/app/view/twig/project/setting_sprint.twig +++ b/app/view/twig/project/setting_sprint.twig @@ -139,6 +139,17 @@ +