Skip to content

Commit

Permalink
Merge pull request #197 from gopeak/dev
Browse files Browse the repository at this point in the history
Merge from dev
  • Loading branch information
weichaoduo authored Mar 10, 2020
2 parents 5ef7096 + 5a90004 commit 1228322
Show file tree
Hide file tree
Showing 15 changed files with 386 additions and 205 deletions.
2 changes: 1 addition & 1 deletion app/classes/UserAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function login($user, $duration = 0, $absolute = true)
}

/**
* 字段登录操作
* 自动登录操作
* @param $user
*/
public function autoLogin($user)
Expand Down
2 changes: 1 addition & 1 deletion app/config/deploy/app.cfg.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
define('ATTACHMENT_URL', ROOT_URL . 'attachment/');

// 当前版本号
define('MASTERLAB_VERSION', '2.0.1');
define('MASTERLAB_VERSION', '2.0.2');

// 使用twig模板引擎
define('TPL_ENGINE', 'twig');
Expand Down
11 changes: 10 additions & 1 deletion app/ctrl/Agile.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,16 @@ public function joinBacklog()
$this->ajaxFailed('参数错误', '事项id不能为空');
}
$model = new IssueModel();
list($ret, $msg) = $model->updateById($issueId, ['sprint' => AgileLogic::BACKLOG_VALUE, 'backlog_weight' => 0]);
$updateArr = [];
$updateArr['sprint'] = AgileLogic::BACKLOG_VALUE;
$updateArr['backlog_weight'] = '0';
// 判断是否为已关闭事项
$issueStatus = $model->getOne('status',['id'=>$issueId]);
$statusClosedId = IssueStatusModel::getInstance()->getIdByKey('closed');
if($issueStatus==$statusClosedId){
$updateArr['status'] = IssueStatusModel::getInstance()->getIdByKey('open');
}
list($ret, $msg) = $model->updateById($issueId, $updateArr);
if ($ret) {
$this->ajaxSuccess('success');
} else {
Expand Down
13 changes: 7 additions & 6 deletions app/ctrl/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public function check_upgrade()
*/
public function run()
{
if (!$this->isAdmin) {
$this->showLine('权限不足,请联系管理员!');
die;
}

set_time_limit(0);
$curl = new \Curl\Curl();
$curl->setTimeout(10);
Expand Down Expand Up @@ -102,15 +107,11 @@ public function run()
$this->showLine('错误:PHP 扩展 zip 未安装!');
$checkOk = false;
}
if (!$this->isPathWritable($projectDir)) {
$this->showLine('错误:Masterlab项目目录 ' . $projectDir . ' 不可写!');
$checkOk = false;
}
if (!$this->isPathWritable($upgradePath)) {
$this->showLine('错误:' . $upgradePath . ' 目录权限不足,无法写入。');
$checkOk = false;
}
$appConfigPath = APP_PATH . '/config/'.APP_STATUS.'/app.cfg.php';
$appConfigPath = realpath(APP_PATH . 'config' . DS . APP_STATUS . DS . 'app.cfg.php');
if (!$this->isPathWritable($appConfigPath)) {
$this->showLine('错误:' . $appConfigPath . ' 文件权限不足,无法写入。');
$checkOk = false;
Expand Down Expand Up @@ -482,7 +483,7 @@ private function rmDirectory($path)
*/
private function writeVersionConfig($version)
{
$appFile = APP_PATH . '/config/'.APP_STATUS.'/app.cfg.php';
$appFile = APP_PATH . 'config' . DS . APP_STATUS . DS . 'app.cfg.php';
$appContent = file_get_contents($appFile);
$appContent = preg_replace('/define\s*\(\s*\'MASTERLAB_VERSION\'\s*,\s*\'([^\']*)\'\);/m', "define('MASTERLAB_VERSION', '" . $version . "');", $appContent);
$ret = file_put_contents($appFile, $appContent);
Expand Down
14 changes: 10 additions & 4 deletions app/public/dev/js/agile/backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@ var Backlog = (function () {

var id = ''
$(".classification-side").on('click', '.classification-item', function () {
/*
* 注释该代码,允许打开的迭代重复点击请求数据
if ($(this).hasClass('open')) return;
*/
var children = $(this).siblings()
Backlog.prototype.fetchSprintIssues($(this).data('id'));
$(this).addClass('open')
Expand All @@ -469,7 +472,9 @@ var Backlog = (function () {
.on('dragenter', function (event) {
event.preventDefault();
$(this).addClass("classification-out-line");
console.log('enter')
_sprint_id = $(this).data('id');
_target_type = $(this).data('type');
console.log("dragenter-_target_type----:"+_target_type);
})
.on('dragover', function (event) {
event.preventDefault();
Expand All @@ -485,16 +490,17 @@ var Backlog = (function () {
event.preventDefault();
console.log('dragleave')
console.log('sprint_id:' + $(this).data('id'));
_sprint_id = $(this).data('id');
_target_type = $(this).data('type');
//_sprint_id = $(this).data('id');
//_target_type = $(this).data('type');

$(this).removeClass("classification-out-line");

//$('.classification-item').removeClass("open");
})
.on('mouseleave', function (event) {
$(this).removeClass("classification-out-line");
})


var items = document.getElementsByClassName('classification-backlog-inner');

var getURLParameters = function (url) {
Expand Down
6 changes: 3 additions & 3 deletions app/public/dev/js/issue/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,16 +1028,16 @@ var IssueForm = (function () {
default_value = cur_date;
}
} else {
if (_is_create_sprint_issue && ui_type === "create") {
if (_is_create_sprint_issue && ui_type === "create" && !_is_created_backlog) {
var config_sprint = _issueConfig.sprint;
var active_sprint = config_sprint.filter(function (n) {
return n.active == 1;
})[0];
if (name === "start_date") {
if (name === "start_date" && !is_empty(active_sprint)) {
default_value = active_sprint.start_date;
}

if (name === "due_date") {
if (name === "due_date" && !is_empty(active_sprint)) {
default_value = active_sprint.end_date;
}
}
Expand Down
Loading

0 comments on commit 1228322

Please sign in to comment.