Skip to content

Commit

Permalink
Merge pull request #443 from gopeak/dev
Browse files Browse the repository at this point in the history
修复迭代进行中不能修改的bug;修复模块不能删除的bug
  • Loading branch information
weichaoduo authored Oct 31, 2022
2 parents e062115 + 021be93 commit 06fc141
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 37 deletions.
25 changes: 25 additions & 0 deletions app/ctrl/Agile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/ctrl/issue/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down
2 changes: 1 addition & 1 deletion app/event/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
* 版本事件
*/
Expand Down
26 changes: 2 additions & 24 deletions app/view/twig/project/setting_module.twig
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
<a class="btn btn-transparent btn-action project_module_edit_click" title="编辑模块" data-container="body" href="#modal-edit-module-href" data-toggle="modal" data-module_id="{{id}}">
<i class="fa fa-pencil-square-o"></i>
</a>
<a class="btn btn-transparent btn-action remove-row" title="删除模块" id="mod_remove" onclick="remove({{id}})" href="javascript:void(0)">
<a class="btn btn-transparent btn-action list_for_delete" title="删除模块" data-module_id="{{id}}" href="javascript:void(0)">
<i class="fa fa-trash-o"></i>
</a>
</div>
Expand Down Expand Up @@ -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();
}
}
);
}
</script>

Expand Down
15 changes: 15 additions & 0 deletions app/view/twig/project/setting_sprint.twig
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@
</label>
</div>
</div>
<div class="form-group">
<label class="control-label" for="edit_active">是否进行中</label>
<div class="col-sm-10">
<label class="radio-inline">
<input type="radio" value="1" id="edit_active_1" name="params[active]">是
</label>
<label class="radio-inline">
<input type="radio" value="0" id="edit_active_0" name="params[active]">否
</label>
</div>
</div>
<div class="form-group">
<label class="control-label" for="edit_start_date">开始日期</label>
<div class="col-sm-10">
Expand Down Expand Up @@ -202,6 +213,10 @@
<a class="btn btn-transparent list_for_set_active" title="设置为进行中" data-id="{{id}}" href="javascript:void(0);">
<i class="fa fa-play-circle"></i>
</a>
{{else}}
<a class="btn btn-transparent list_for_set_pause" title="设置为非进行(停止)" data-id="{{id}}" href="javascript:void(0);">
<i class="fa fa-pause-circle"></i>
</a>
{{/if_eq}}
<a class="btn btn-transparent btn-action list_for_edit" title="编辑迭代" href="javascript:void(0);" data-id="{{id}}">
<i class="fa fa-pencil-square-o"></i>
Expand Down
2 changes: 1 addition & 1 deletion bin/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bin/cron.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion config.tpl.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Masterlab主配置文件
app_url: ''
version: '3.3.6'
version: '3.3.8'
error_reporting: 'E_ERROR'
xdebug: false
trace: false
Expand Down
12 changes: 6 additions & 6 deletions config.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -35,7 +35,7 @@ database:
host: 'localhost'
port: '3306'
user: 'root'
password: '123456'
password: ''
db_name: 'masterlab_dev'
charset: 'utf8'
timeout: 10
Expand Down Expand Up @@ -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'
2 changes: 1 addition & 1 deletion public/dev/js/project/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
17 changes: 17 additions & 0 deletions public/dev/js/project/sprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit 06fc141

Please sign in to comment.