diff --git a/app/ctrl/Agile.php b/app/ctrl/Agile.php index 68baace3..8ade4a51 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 f7ef9c0f..be93f372 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 7fe7266b..01eb7174 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 4443f9df..56a1309e 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 454bf65a..c4d4356f 100644 --- a/app/view/twig/project/setting_sprint.twig +++ b/app/view/twig/project/setting_sprint.twig @@ -139,6 +139,17 @@ +