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(, 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 @@ +
+ +
+ + +
+
@@ -202,6 +213,10 @@ + {{else}} + + + {{/if_eq}} diff --git a/bin/config.toml b/bin/config.toml index ddef405d..9919a9e2 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 6c348678..5492f29d 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 064fb4ad..e382024b 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 b814ade2..516939ec 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 27cfaba7..3dd2108e 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 1ca97d5a..516aec1a 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"));