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(, 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 @@ +
+ +
+ + +
+
@@ -202,6 +213,10 @@ + {{else}} + + + {{/if_eq}} diff --git a/bin/config.toml b/bin/config.toml index ddef405d4..9919a9e2c 100644 --- a/bin/config.toml +++ b/bin/config.toml @@ -22,7 +22,7 @@ single_mode = true host = "localhost" port = "3306" user = "root" - password = "123456" + password = "" charset = "utf8mb4_unicode_ci" timeout = "10" max_open_conns = 2000 diff --git a/bin/cron.json b/bin/cron.json index 6c3486789..5492f29d7 100644 --- a/bin/cron.json +++ b/bin/cron.json @@ -3,21 +3,21 @@ "schedule": [ { "name": "ProjectStat", - "exe_bin": "C:/xampp7.4/php/php.exe", + "exe_bin": "C:/phpenv/php-7.4/php.exe", "exp": "0 */30 * * * ?", "file": "C:/www/masterlab/app/server/timer/project.php", "arg": "-f" }, { "name": "ProjectReport", - "exe_bin": "C:/xampp7.4/php/php.exe", + "exe_bin": "C:/phpenv/php-7.4/php.exe", "exp": "0 58 23 * * ?", "file": "C:/www/masterlab/app/server/timer/projectDayReport.php", "arg": "-f" }, { "name": "SprintReport", - "exe_bin": "C:/xampp7.4/php/php.exe", + "exe_bin": "C:/phpenv/php-7.4/php.exe", "exp": "0 59 23 * * ?", "file": "C:/www/masterlab/app/server/timer/sprintDayReport.php", "arg": "-f" diff --git a/config.tpl.yml b/config.tpl.yml index 064fb4adc..e382024bc 100644 --- a/config.tpl.yml +++ b/config.tpl.yml @@ -1,6 +1,6 @@ # Masterlab主配置文件 app_url: '' -version: '3.3.6' +version: '3.3.8' error_reporting: 'E_ERROR' xdebug: false trace: false diff --git a/config.yml b/config.yml index b814ade21..516939ec3 100644 --- a/config.yml +++ b/config.yml @@ -1,13 +1,13 @@ # Masterlab主配置文件 app_url: '' -version: '3.3.6' +version: '3.3.8' error_reporting: 'E_ERROR' xdebug: false trace: false write_request_log: false security_map: false date_default_timezone: 'Asia/Shanghai' -encrypy_key: '675IIn959a94Ng4o1875' +encrypy_key: 'F1xukcK3KjzejfQE8064' xhprof: enable: false @@ -35,7 +35,7 @@ database: host: 'localhost' port: '3306' user: 'root' - password: '123456' + password: '' db_name: 'masterlab_dev' charset: 'utf8' timeout: 10 @@ -64,19 +64,19 @@ socket: schedule: - name: 'ProjectStat' - exe_bin: 'C:/xampp7.4/php/php.exe' + exe_bin: 'C:/phpenv/php-7.4/php.exe' exp: '0 */30 * * * ?' file: 'C:/www/masterlab/app/server/timer/project.php' arg: '-f' - name: 'ProjectReport' - exe_bin: 'C:/xampp7.4/php/php.exe' + exe_bin: 'C:/phpenv/php-7.4/php.exe' exp: '0 58 23 * * ?' file: 'C:/www/masterlab/app/server/timer/projectDayReport.php' arg: '-f' - name: 'SprintReport' - exe_bin: 'C:/xampp7.4/php/php.exe' + exe_bin: 'C:/phpenv/php-7.4/php.exe' exp: '0 59 23 * * ?' file: 'C:/www/masterlab/app/server/timer/sprintDayReport.php' arg: '-f' \ No newline at end of file diff --git a/public/dev/js/project/module.js b/public/dev/js/project/module.js index 27cfaba7c..3dd2108ee 100644 --- a/public/dev/js/project/module.js +++ b/public/dev/js/project/module.js @@ -143,7 +143,7 @@ let Module = (function() { } $(".list_for_delete").click(function () { - Module.prototype.delete($(this).data("id")); + Module.prototype.delete(window.cur_project_id, $(this).data('module_id')); }); $(".project_module_edit_click").bind("click", function () { diff --git a/public/dev/js/project/sprint.js b/public/dev/js/project/sprint.js index 1ca97d5a6..516aec1a3 100644 --- a/public/dev/js/project/sprint.js +++ b/public/dev/js/project/sprint.js @@ -23,6 +23,17 @@ let Sprint = (function() { } }); }; + Sprint.prototype.pause = function(sprint_id) { + $.post("/agile/setSprintPause",{sprint_id:sprint_id},function(resp){ + if(resp.ret ==="200" ){ + notify_success(resp.msg, resp.data); + Sprint.prototype.fetchAll(); + } else { + notify_error(resp.msg, resp.data); + console.log(resp); + } + }); + }; Sprint.prototype.delete = function(sprint_id) { swal({ @@ -76,6 +87,9 @@ let Sprint = (function() { $('#edit_description').val(resp.data.description); $('#l_edit_status_'+resp.data.status).addClass('active'); $('#edit_status_'+resp.data.status).attr('checked',true); + $('#edit_status_'+resp.data.status).click(); + $('#edit_active_'+resp.data.active).attr('checked',true); + $('#edit_active_'+resp.data.active).click(); } else { notify_error(resp.msg, resp.data); } @@ -164,6 +178,9 @@ let Sprint = (function() { $(".list_for_set_active").click(function(){ Sprint.prototype.active( $(this).data("id")); }); + $(".list_for_set_pause").click(function(){ + Sprint.prototype.pause( $(this).data("id")); + }); $(".list_for_delete").click(function(){ Sprint.prototype.delete( $(this).data("id"));