This commit is contained in:
sgm0422
2020-07-14 11:21:23 +08:00
20 changed files with 74 additions and 29 deletions
+1
View File
@@ -319,6 +319,7 @@ class control extends baseControl
foreach($fieldRules as $ruleID)
{
if(!isset($rules[$ruleID])) continue;
if(!is_string($_POST[$field->field])) continue;
$rule = $rules[$ruleID];
if($rule->type == 'system' and $rule->rule == 'notempty')
+7 -3
View File
@@ -400,10 +400,14 @@ class bug extends control
$stories = $this->story->getProductStoryPairs($productID, $branch);
}
$moduleID = $moduleID ? $moduleID : (int)$this->cookie->lastBugModule;
$moduleOwner = $this->bug->getModuleOwner($moduleID, $productID);
/* Set team members of the latest project as assignedTo list. */
$latestProject = $this->product->getLatestProject($productID);
$projectMembers = array();
if(!empty($latestProject)) $projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted');
if(!empty($latestProject)) $projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted', $moduleOwner);
if(empty($projectMembers)) $projectMembers = $this->view->users;
if($assignedTo and !isset($projectMembers[$assignedTo]))
{
@@ -1397,7 +1401,7 @@ class bug extends control
*/
public function ajaxLoadAssignedTo($projectID, $selectedUser = '')
{
$projectMembers = $this->loadModel('project')->getTeamMemberPairs($projectID);
$projectMembers = $this->loadModel('project')->getTeamMemberPairs($projectID, '', $selectedUser);
die(html::select('assignedTo', $projectMembers, $selectedUser, 'class="form-control"'));
}
@@ -1416,7 +1420,7 @@ class bug extends control
$latestProject = $this->product->getLatestProject($productID);
if(!empty($latestProject))
{
$projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted');
$projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted', $selectedUser);
}
else
{
+4 -3
View File
@@ -455,16 +455,17 @@ var oldAssignedTo = $("#assignedTo").find("option:selected").val();
* @access public
* @return void
*/
function loadAssignedTo(projectID)
function loadAssignedTo(projectID, selectedUser = '')
{
link = createLink('bug', 'ajaxLoadAssignedTo', 'projectID=' + projectID + '&selectedUser=' + $('#assignedTo').val());
selectedUser = selectedUser ? selectedUser : $('#assignedTo').val();
link = createLink('bug', 'ajaxLoadAssignedTo', 'projectID=' + projectID + '&selectedUser=' + selectedUser);
$.get(link, function(data)
{
var defaultOption = '<option title="' + oldAssignedToTitle + '" value="' + oldAssignedTo + '" selected="selected">' + oldAssignedToTitle + '</option>';
$('#assignedTo_chosen').remove();
$('#assignedTo').replaceWith(data);
var defaultAssignedTo = $('#assignedTo').val();
if(defaultAssignedTo !== oldAssignedTo) $('#assignedTo').append(defaultOption);
if(defaultAssignedTo !== oldAssignedTo && selectedUser == '') $('#assignedTo').append(defaultOption);
$('#assignedTo').chosen();
});
}
+19 -3
View File
@@ -26,10 +26,16 @@ function loadAllUsers()
* @access public
* @return void
*/
function loadProjectTeamMembers(productID)
function loadProjectTeamMembers(productID, selectedUser = '')
{
var link = createLink('bug', 'ajaxLoadProjectTeamMembers', 'productID=' + productID + '&selectedUser=' + $('#assignedTo').val());
$('#assignedToBox').load(link, function(){$('#assignedTo').chosen();});
selectedUser = selectedUser ? selectedUser : $('#assignedTo').val();
var link = createLink('bug', 'ajaxLoadProjectTeamMembers', 'productID=' + productID + '&selectedUser=' + selectedUser);
$.get(link, function(data)
{
$('#assignedTo_chosen').remove();
$('#assignedTo').replaceWith(data);
$('#assignedTo').chosen();
});
}
/**
@@ -56,9 +62,19 @@ function setAssignedTo(moduleID, productID)
{
if(typeof(productID) == 'undefined') productID = $('#product').val();
if(typeof(moduleID) == 'undefined') moduleID = $('#module').val();
var link = createLink('bug', 'ajaxGetModuleOwner', 'moduleID=' + moduleID + '&productID=' + productID);
$.get(link, function(owner)
{
var projectID = $('#project').val();
if(!projectID)
{
loadProjectTeamMembers(productID, owner);
}
else
{
loadAssignedTo(projectID, owner);
}
$('#assignedTo').val(owner);
$("#assignedTo").trigger("chosen:updated");
});
+3 -2
View File
@@ -686,9 +686,10 @@ class commonModel extends model
echo '</ul>';
return;
}
foreach($position as $key => $link)
if(is_array($position))
{
echo "<li class='active'>" . $link . '</li>';
foreach($position as $key => $link) echo "<li class='active'>" . $link . '</li>';
}
echo '</ul>';
}
-7
View File
@@ -4,13 +4,6 @@ include 'header.lite.html.php';
include 'chosen.html.php';
//include 'validation.html.php';
?>
<?php
/* Load hook files for current page. */
$extPath = $this->app->getModuleRoot() . '/common/ext/view/';
$extHookRule = $extPath . 'header.*.hook.php';
$extHookFiles = glob($extHookRule);
if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
?>
<?php if(empty($_GET['onlybody']) or $_GET['onlybody'] != 'yes'):?>
<?php $this->app->loadConfig('sso');?>
<?php if(!empty($config->sso->redirect)) js::set('ssoRedirect', $config->sso->redirect);?>
+7
View File
@@ -62,5 +62,12 @@ $onlybody = zget($_GET, 'onlybody', 'no');
<!--[if lt IE 10]>
<?php js::import($jsRoot . 'jquery/placeholder/min.js'); ?>
<![endif]-->
<?php
/* Load hook files for current page. */
$extPath = $this->app->getModuleRoot() . '/common/ext/view/';
$extHookRule = $extPath . 'header.*.hook.php';
$extHookFiles = glob($extHookRule);
if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
?>
</head>
<body>
+1
View File
@@ -62,3 +62,4 @@ $lang->file->dangerFile = " 您选择的文件存在安全风险,系统
$lang->file->errorSuffix = '压缩包格式错误,只能上传zip压缩包!';
$lang->file->errorExtract = '解压缩失败!可能文件已经损坏,或压缩包里含有非法上传文件。';
$lang->file->fileNotFound = '未找到该文件,可能物理文件已被删除!';
$lang->file->fileContentEmpty = '上传文件内容为空,请检查后重新上传。';
+10
View File
@@ -36,6 +36,8 @@ function checkDangerExtension(obj)
{
var fileName = $(obj).val();
var index = fileName.lastIndexOf(".");
var fileSize = $(obj)[0].files[0].size;
if(index >= 0)
{
extension = fileName.substr(index + 1);
@@ -43,6 +45,14 @@ function checkDangerExtension(obj)
{
alert(<?php echo json_encode($this->lang->file->dangerFile);?>);
$(obj).val('');
return false;
}
if(fileSize == 0)
{
alert(<?php echo json_encode($this->lang->file->fileContentEmpty);?>);
$(obj).val('');
return false;
}
}
}
+6 -1
View File
@@ -1726,10 +1726,11 @@ class projectModel extends model
*
* @param int $projectID
* @param string $params
* @param string $usersToAppended
* @access public
* @return array
*/
public function getTeamMemberPairs($projectID, $params = '')
public function getTeamMemberPairs($projectID, $params = '', $usersToAppended = '')
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getTeamMembersPairs();
$this->app->loadConfig('user');
@@ -1741,7 +1742,11 @@ class projectModel extends model
->andWhere('t2.deleted')->eq(0)
->fi()
->fetchPairs();
if($usersToAppended) $users += $this->dao->select('account, realname')->from(TABLE_USER)->where('account')->in($usersToAppended)->fetchPairs();
if(!$users) return array('' => '');
foreach($users as $account => $realName)
{
$firstLetter = ucfirst(substr($account, 0, 1)) . ':';
-5
View File
@@ -74,8 +74,6 @@
<table class="table no-margin table-grouped text-center">
<thead>
<tr>
<?php $hasGroupCol = (($type == 'story' and count($stories) > 0) or $type != 'story');?>
<?php if($hasGroupCol):?>
<th class="c-board c-side has-btn">
<div class="dropdown">
<?php $dropTitle = $type == 'story' ? $lang->project->orderList[$storyOrder] : $lang->task->$type;?>
@@ -91,7 +89,6 @@
</ul>
</div>
</th>
<?php endif;?>
<?php foreach($kanbanColumns as $col):?>
<th class='c-board s-<?php echo $col?>'><?php echo zget($statusList, $col);?></th>
<?php endforeach;?>
@@ -102,7 +99,6 @@
<?php foreach($kanbanGroup as $groupKey => $group):?>
<?php if(count(get_object_vars($group)) == 0) continue;?>
<tr data-id='<?php echo $rowIndex++?>'>
<?php if($hasGroupCol):?>
<td class='c-side text-left'>
<?php if($groupKey != 'nokey'):?>
<?php if($type == 'story'):?>
@@ -147,7 +143,6 @@
<?php endif;?>
<?php endif;?>
</td>
<?php endif;?>
<td class="c-boards no-padding text-left" colspan="<?php echo count($kanbanColumns);?>">
<div class="boards-wrapper">
<div class="boards">
+1
View File
@@ -1,3 +1,4 @@
.side-col .cell{padding:0px;}
.side-col #legendProjectAndTask .list-unstyled{padding:10px; border-top:0px; margin:0px;}
.col-4 .cell .tab-content .text-top{padding-top: 1px}
.main-actions .btn-toolbar .btn{padding-right: 6px; padding-left: 6px;}
+3 -3
View File
@@ -565,9 +565,9 @@ class storyModel extends model
foreach($this->post->stages as $branch => $stage)
{
$newStage = new stdclass();
$newStage->story = $storyID;
$newStage->branch = $branch;
$newStage->stage = $stage;
$newStage->story = $storyID;
$newStage->branch = $branch;
$newStage->stage = $stage;
if(isset($oldStages[$branch]))
{
$oldStage = $oldStages[$branch];
+2 -2
View File
@@ -66,12 +66,12 @@
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
<td class='c-actions'>
<?php
$vars = "story={$story->id}";
$vars = "storyID={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'fork');
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses');
common::printIcon('story', 'close', $vars, $story, 'list', 'off');
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
common::printIcon('story', 'createCase', "productID=$story->product&branch=0&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
?>
</td>
</tr>
+1
View File
@@ -43,6 +43,7 @@ $lang->tree->confirmRoot4Doc = "Any changes to the library will change the do
$lang->tree->successSave = 'Saved.';
$lang->tree->successFixed = 'Fixed.';
$lang->tree->repeatName = 'The name "%s" exists!';
$lang->tree->shouldNotBlank = 'Module name should not be blank!';
$lang->tree->module = 'Modul';
$lang->tree->name = 'Name';
+1
View File
@@ -43,6 +43,7 @@ $lang->tree->confirmRoot4Doc = "Any changes to the library will change the do
$lang->tree->successSave = 'Saved.';
$lang->tree->successFixed = 'Fixed.';
$lang->tree->repeatName = 'The name "%s" exists!';
$lang->tree->shouldNotBlank = 'Module name should not be blank!';
$lang->tree->module = 'Module';
$lang->tree->name = 'Name';
+1
View File
@@ -43,6 +43,7 @@ $lang->tree->confirmRoot4Doc = "Any changes to the library will change the do
$lang->tree->successSave = 'Sauvé.';
$lang->tree->successFixed = 'Corrigé.';
$lang->tree->repeatName = 'Le nom "%s" existe déjà !';
$lang->tree->shouldNotBlank = 'Module name should not be blank!';
$lang->tree->module = 'Module';
$lang->tree->name = 'Nom';
+1
View File
@@ -43,6 +43,7 @@ $lang->tree->confirmRoot4Doc = "Mọi sự thay đổi tới thư viện này
$lang->tree->successSave = 'Đã lưu.';
$lang->tree->successFixed = 'Đã sửa';
$lang->tree->repeatName = 'Tên "%s" đã tồn tại!';
$lang->tree->shouldNotBlank = 'Module name should not be blank!';
$lang->tree->module = 'Module';
$lang->tree->name = 'Tên';
+1
View File
@@ -43,6 +43,7 @@ $lang->tree->confirmRoot4Doc = "修改所属文档库,会同时修改该分
$lang->tree->successSave = '成功保存';
$lang->tree->successFixed = '成功修正数据!';
$lang->tree->repeatName = '模块名“%s”已经存在!';
$lang->tree->shouldNotBlank = '模块名不能为空格!';
$lang->tree->module = '模块';
$lang->tree->name = '模块名称';
+5
View File
@@ -1337,6 +1337,11 @@ class treeModel extends model
$childs = $data->modules;
$parentModuleID = $data->parentModuleID;
foreach($childs as $moduleID => $moduleName)
{
if(preg_match('/(^\s+$)/', $moduleName)) die(js::alert($this->lang->tree->shouldNotBlank));
}
$module = new stdClass();
$module->root = $rootID;
$module->type = $type;