Merge branch 'sprint/master_fixbug' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/master_fixbug

This commit is contained in:
tanghucheng
2022-03-30 17:07:50 +08:00
48 changed files with 824 additions and 130 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class bugCloseEntry extends Entry
*/
public function post($bugID)
{
$story = $this->loadModel('bug')->getByID($bugID);
$bug = $this->loadModel('bug')->getByID($bugID);
$fields = 'comment';
$this->batchSetPost($fields);
+3
View File
@@ -51,6 +51,9 @@ class productEntry extends Entry
$product->modules = $data->data->tree;
}
break;
case 'execution':
$product->execution = $this->loadModel('product')->getExecutionPairsByProduct($productID);
break;
case 'moduleoptionmenu':
$product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'bug', 0, 'all');
break;
+1 -1
View File
@@ -95,7 +95,7 @@ class storyEntry extends Entry
$oldStory = $this->loadModel('story')->getByID($storyID);
/* Set $_POST variables. */
$fields = 'title,product,reviewer,type,plan,module,source,sourceNote,category,pri,estimate,mailto,keywords,uid';
$fields = 'title,product,reviewer,type,plan,module,source,sourceNote,category,pri,estimate,mailto,keywords,uid,stage,notifyEmail';
$this->batchSetPost($fields, $oldStory);
$this->setPost('parent', 0);
+2 -2
View File
@@ -172,7 +172,7 @@ class router extends baseRouter
$mode = 'new';
$score = '0';
$projectKey = empty($this->config->isINT) ? ITERATION_KEY : SPRINT_KEY;
$projectKey = ITERATION_KEY;
foreach($commonSettings as $setting)
{
@@ -183,7 +183,7 @@ class router extends baseRouter
if($setting->key == 'mode' and $setting->section == 'global') $mode = $setting->value;
if($setting->key == 'scoreStatus' and $setting->section == 'global') $score = $setting->value;
}
/* Lite Version is compatible with classic modes */
if($config->vision == 'lite') $mode = 'new';
+4
View File
@@ -0,0 +1,4 @@
$(document).ready(function()
{
limitIframeLevel();
});
+2
View File
@@ -32,6 +32,8 @@ class build extends control
if(empty($executionID)) dao::$errors['execution'] = $this->lang->build->emptyExecution;
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(defined('TUTORIAL')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); // Fix bug #21095.
$buildID = $this->build->create($executionID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('build', $buildID, 'opened');
+1 -1
View File
@@ -2257,7 +2257,7 @@ EOD;
$module = $this->app->getModuleName();
$method = $this->app->getMethodName();
if($module == 'index' || $module == 'tutorial' || $module == 'install' || $module == 'upgrade' || ($module == 'user' && ($method == 'login' || $method == 'deny' || $method == 'logout')) || ($module == 'my' && $method == 'changepassword') || ($module == 'file' && $method == 'read') || ($module == 'file' && $method == 'download')) return;
if($module == 'index' || $module == 'tutorial' || $module == 'install' || $module == 'upgrade' || ($module == 'user' && ($method == 'login' || $method == 'deny' || $method == 'logout')) || ($module == 'my' && $method == 'changepassword') || ($module == 'file' && $method == 'read') || ($module == 'file' && $method == 'download') || ($module == 'file' && $method == 'uploadimages')) return;
$url = helper::safe64Encode($_SERVER['REQUEST_URI']);
$redirectUrl = helper::createLink('index', 'index', "open=$url");
+4 -2
View File
@@ -220,11 +220,13 @@ function renderExecutionItem(item, $item)
var $title = $item.find('.title');
if(!$title.length)
{
if(window.userPrivs.project)
if((item.type == 'kanban' && window.userPrivs.kanban) || (item.type != 'kanban' && window.userPrivs.execution))
{
var method = item.type == 'kanban' ? 'kanban' : 'task';
$item.addClass('link-block');
$title = $('<a class="title" />')
.attr('href', $.createLink('execution', 'task', 'executionID=' + item._id));
.attr('href', $.createLink('execution', method, 'executionID=' + item._id));
}
else
{
+18 -1
View File
@@ -2070,7 +2070,7 @@ class execution extends control
$userList = array();
$users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$avatarPairs = $this->user->getAvatarPairs();
$avatarPairs = $this->user->getAvatarPairs('all');
foreach($avatarPairs as $account => $avatar)
{
if(!isset($users[$account])) continue;
@@ -3420,7 +3420,24 @@ class execution extends control
unset($fields[$key]);
}
$project = $this->project->getByID($projectID);
$executionStats = $this->project->getStats($projectID, $status == 'byproduct' ? 'all' : $status, $productID, 0, 30, 'id_asc');
if(isset($project->model) and $project->model == 'waterfall')
{
$stageList = array();
foreach($executionStats as $stage)
{
$stageList[] = $stage;
foreach($stage->children as $child)
{
$child->name = $stage->name . '/' . $child->name;
$stageList[] = $child;
}
}
$executionStats = $stageList;
}
$users = $this->loadModel('user')->getPairs('noletter');
foreach($executionStats as $i => $execution)
{
-1
View File
@@ -68,7 +68,6 @@
.kanban-col[data-type=ADD] {display: none;}
.kanban-col[data-type=EMPTY] {display: none;}
.kanban-col {padding-right: 0px !important;}
.kanban-item:hover .title {padding-right: 10px;}
.gray .actions {display:none;}
.c-type {width: 150px !important; overflow: unset;}
+39 -48
View File
@@ -185,6 +185,8 @@ function changeKanbanScaleSize(newScaleSize)
kanban.setOptions({cardsPerRow: newScaleSize, cardHeight: getCardHeight()});
}
if(laneCount == 1) resetRegionHeight('open');
return newScaleSize;
}
@@ -1034,6 +1036,7 @@ function updateKanban(kanbanData, regionID = 0)
});
}
}, 200);
resetRegionHeight('open');
}
/**
@@ -1462,6 +1465,12 @@ $(function()
}, 10000);
}
if(groupBy != 'default')
{
$('.region').css('padding-bottom', '10px');
$('.region').css('border', '0px');
}
resetRegionHeight('open');
});
@@ -1484,54 +1493,36 @@ function calcColHeight(col, lane, colCards, colHeight, kanban)
* @access public
* @return void
*/
function resetRegionHeight(fold)
{
var regionCount = 0;
if($.isEmptyObject(regions)) return false;
for(var i in regions)
{
regionCount += 1;
if(regionCount > 1) return false;
}
function resetRegionHeight(fold)
{
var laneCount = 0;
$('.kanban-lane').each(function()
{
laneCount ++;
if(laneCount > 1) return;
});
var regionID = Object.keys(regions)[0];
var region = regions[regionID].groups;
var groupCount = 0;
if(laneCount > 1) return;
if($.isEmptyObject(region)) return false;
for(var j in region)
{
groupCount += 1;
if(groupCount > 1) return false;
}
var regionHeaderHeight = $('.region-header').outerHeight();
if(fold == 'open')
{
var windowHeight = $(window).height();
var headerHeight = $('#mainHeader').outerHeight();
var mainPadding = $('#main').css('padding-top');
var menuHeight = $('#mainMenu').height();
var panelBorder = $('.panel').css('border-top-width');
var bodyPadding = $('.panel-body').css('padding-top');
var regionBorder = $('.region').css('border-top-width');
var regionPadding = $('.kanban').css('padding-bottom');
var columnHeight = $('.kanban-header').outerHeight();
var height = windowHeight - (parseInt(mainPadding) * 2) - menuHeight - (parseInt(bodyPadding) * 2) - headerHeight - (parseInt(panelBorder) * 2) - (parseInt(regionBorder) * 2);
var group = region[0];
var laneCount = 0;
if($.isEmptyObject(group.lanes)) return false;
for(var h in group.lanes)
{
laneCount += 1;
if(laneCount > 1) return false;
}
var regionHeaderHeight = $('.region-header').outerHeight();
if(fold == 'open')
{
var windowHeight = $(window).height();
var headerHeight = $('#mainHeader').outerHeight();
var mainPadding = $('#main').css('padding-top');
var panelBorder = $('.panel').css('border-top-width');
var bodyPadding = $('.panel-body').css('padding-top');
var height = windowHeight - (parseInt(mainPadding) * 2) - (parseInt(bodyPadding) * 2) - headerHeight - (parseInt(panelBorder) * 2);
var regionPadding = $('.kanban').css('padding-bottom');
var columnHeight = $('.kanban-header').outerHeight();
$('.region').css('height', height);
$('.kanban-lane').css('height', height - regionHeaderHeight - parseInt(regionPadding) - columnHeight);
}
else
{
$('.region').css('height', regionHeaderHeight);
}
}
if(groupBy == 'default') $('.region').css('height', height);
$('.kanban-lane').css('height', height - regionHeaderHeight - parseInt(regionPadding) - columnHeight);
}
else
{
$('.region').css('height', regionHeaderHeight);
}
}
+32
View File
@@ -361,6 +361,7 @@ function updateKanban(kanbanID, data)
if(!$kanban.length) return;
$kanban.data('zui.kanban').render(data);
resetKanbanHeight();
}
/**
@@ -985,6 +986,7 @@ function changeKanbanScaleSize(newScaleSize)
kanban.setOptions({cardsPerRow: newScaleSize, cardHeight: getCardHeight()});
});
resetKanbanHeight();
return newScaleSize;
}
@@ -1159,6 +1161,7 @@ $(function()
}
});
}, 10000);
resetKanbanHeight();
});
$('#type').change(function()
@@ -1206,3 +1209,32 @@ $('.panel-body').scroll(function()
{
$.zui.ContextMenu.hide();
});
/**
* Reset kanban height according to window height.
*
* @access public
* @return void
*/
function resetKanbanHeight()
{
var laneCount = 0;
$('.kanban-lane').each(function()
{
laneCount ++;
if(laneCount > 1) return;
});
if(laneCount > 1) return;
var windowHeight = $(window).height();
var headerHeight = $('#mainHeader').outerHeight();
var mainPadding = $('#main').css('padding-top');
var menuHeight = $('#mainMenu').height();
var panelBorder = $('.panel').css('border-top-width');
var bodyPadding = $('.panel-body').css('padding-top');
var columnHeight = $('.kanban-header').outerHeight();
var height = windowHeight - headerHeight - (parseInt(mainPadding) * 2) - menuHeight - (parseInt(panelBorder) * 2) - (parseInt(bodyPadding) * 2) - columnHeight;
$('.kanban-lane').css('height', height -2);
}
+2 -2
View File
@@ -117,8 +117,8 @@ $lang->execution->estimate = 'estimate';
$lang->execution->consumed = 'consumed';
$lang->execution->left = 'Left';
if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "select Project/{$lang->execution->common} to copy its members";
if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "select Project/{$lang->executionCommon} to copy its members";
if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "copy Project/{$lang->execution->common} team members";
if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "copy Project/{$lang->executionCommon} team members";
$lang->execution->start = 'Start';
$lang->execution->activate = 'Activate';
+6 -4
View File
@@ -1262,7 +1262,7 @@ class executionModel extends model
* @access public
* @return array
*/
public function getByProject($projectID, $status = 'all', $limit = 0, $pairs = false)
public function getByProject($projectID, $status = 'all', $limit = 0, $pairs = false, $devel = false)
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getExecutionPairs();
@@ -1276,6 +1276,7 @@ class executionModel extends model
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
->beginIF($status == 'undone')->andWhere('status')->notIN('done,closed')->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->beginIF($devel === true)->andWhere('attribute')->in('dev,qa,release')->fi()
->orderBy($orderBy)
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
@@ -2080,9 +2081,8 @@ class executionModel extends model
$showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
$modules = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : '');
$execution = $this->getByID($executionID);
$requiredFields = ',' . $this->config->task->create->requiredFields . ',';
if($execution->type == 'ops') $requiredFields = str_replace(',story,', ',', $requiredFields);
$execution = $this->getByID($executionID);
$requiredFields = str_replace(',story,', ',', ',' . $this->config->task->create->requiredFields . ',');
$requiredFields = trim($requiredFields, ',');
$bugToTasks = fixer::input('post')->get();
@@ -2103,6 +2103,7 @@ class executionModel extends model
$task->name = $bug->title;
$task->type = 'devel';
$task->pri = $bugToTasks->pri[$key];
$task->estStarted = $bugToTasks->estStarted[$key];
$task->deadline = $bugToTasks->deadline[$key];
$task->estimate = $bugToTasks->estimate[$key];
$task->consumed = 0;
@@ -2112,6 +2113,7 @@ class executionModel extends model
$task->openedBy = $this->app->user->account;
if($task->estimate !== '') $task->left = $task->estimate;
if(strpos($requiredFields, 'estStarted') !== false and helper::isZeroDate($task->estStarted)) $task->estStarted = '';
if(strpos($requiredFields, 'deadline') !== false and helper::isZeroDate($task->deadline)) $task->deadline = '';
if(!empty($bugToTasks->assignedTo[$key]))
{
@@ -23,9 +23,9 @@
</div>
<?php
$userPrivs = array();
$userPrivs['project'] = common::hasPriv('project', 'index');
$userPrivs['execution'] = common::hasPriv('execution', 'task');
js::set('userPrivs', $userPrivs);
$userPrivs['kanban'] = common::hasPriv('execution', 'kanban');
js::set('userPrivs', $userPrivs);
js::set('kanbanGroup', $kanbanGroup);
js::set('kanbanColumns', $lang->execution->kanbanColType);
js::set('statusColorList', $lang->execution->statusColorList);
+5 -3
View File
@@ -39,10 +39,11 @@
<th class='c-pri' title=<?php echo $lang->execution->pri;?>><?php echo $lang->priAB;?></th>
<th><?php echo $lang->bug->title;?></th>
<th class='c-status'><?php echo $lang->bug->statusAB;?></th>
<th class='c-pri-box <?php echo in_array('pri', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->pri;?></th>
<th class='c-pri-box <?php echo in_array('pri', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->pri;?></th>
<th class='c-assigned-box <?php echo in_array('assignedTo', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->assignedTo;?></th>
<th class='c-estimate-box <?php echo in_array('estimate', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->estimate;?></th>
<th class='c-date-box <?php echo in_array('deadline', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->deadline;?></th>
<th class='c-estimate-box <?php echo in_array('estimate', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->estimate;?></th>
<th class='c-date-box <?php echo in_array('estStarted', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->estStarted;?></th>
<th class='c-date-box <?php echo in_array('deadline', $requiredFields) ? 'required' : ''?>'><?php echo $lang->task->deadline;?></th>
</tr>
</thead>
<tbody>
@@ -62,6 +63,7 @@
<td class='bug-pri'><?php echo html::select("pri[$bug->id]", $lang->task->priList, zget($lang->task->priList, $bug->pri ? $bug->pri : 3, 3), "class='form-control chosen'");?></td>
<td style='overflow:visible'><?php echo html::select("assignedTo[$bug->id]", $users, zget($users, $bug->assignedTo, '', $bug->assignedTo), "class='form-control chosen'");?></td>
<td><?php echo html::input("estimate[$bug->id]", '', 'size=4 class="form-control"');?></td>
<td><?php echo html::input("estStarted[$bug->id]", '0000-00-00', 'size=4 class="form-control form-date"');?></td>
<?php $deadline = ($bug->deadline > helper::today() and $bug->deadline > $execution->begin) ? $bug->deadline : '0000-00-00';?>
<td><?php echo html::input("deadline[$bug->id]", $deadline, 'size=4 class="form-control form-date"');?></td>
</tr>
+2 -2
View File
@@ -1,14 +1,14 @@
<?php include '../../common/view/header.html.php';?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php
<?php
common::printLink('extension', 'browse', "type=installed", "<span class='text'>{$lang->extension->installed}</span>" , '', "class='btn btn-link' id='installed'");
common::printLink('extension', 'browse', "type=deactivated", "<span class='text'>{$lang->extension->deactivated}</span>", '', "class='btn btn-link' id='deactivated'");
common::printLink('extension', 'browse', "type=available", "<span class='text'>{$lang->extension->available}</span>" , '', "class='btn btn-link' id='available'");
common::printLink('extension', 'upload', '', "<span class='text'>{$lang->extension->upload}</span>", '', "class='iframe btn btn-link'");
?>
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('extension', 'upload', '', '<i class="icon-cog"></i> ' . $lang->extension->upload, '', "class='iframe btn btn-link'");?>
<?php common::printLink('extension', 'obtain', '', '<i class="icon-download-alt"></i> ' . $lang->extension->obtain, '', "class='btn btn-primary'");?>
</div>
</div>
+9
View File
@@ -550,10 +550,19 @@ class gitlab extends control
*/
public function browseUser($gitlabID, $orderBy = 'id_desc')
{
$isAdmin = true;
if(!$this->app->user->admin)
{
$userID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
$user = $this->gitlab->apiGetSingleUser($gitlabID, $userID);
if(!$user->is_admin) $isAdmin = false;
}
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseUser;
$this->view->gitlabID = $gitlabID;
$this->view->gitlabUserList = $this->gitlab->apiGetUsers($gitlabID, false, $orderBy);
$this->view->orderBy = $orderBy;
$this->view->isAdmin = $isAdmin;
$this->display();
}
+1 -1
View File
@@ -55,7 +55,7 @@
<td class='c-actions text-left'>
<?php
common::printLink('gitlab', 'editUser', "gitlabID=$gitlabID&userID=$gitlabUser->id", "<i class='icon icon-edit'></i> ", '', "title='{$lang->gitlab->user->edit}' class='btn btn-primary'");
if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'deleteUser', "gitlabID=$gitlabID&userID=$gitlabUser->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->deleteUser}' class='btn'");
if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'deleteUser', "gitlabID=$gitlabID&userID=$gitlabUser->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->deleteUser}' class='btn'" . ($isAdmin ? '' : ' disabled'));
?>
</td>
</tr>
+2 -1
View File
@@ -1,2 +1,3 @@
.group-item {display: block; width: 100px; float: left; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.table th {vertical-align: top;}
.main-table tbody>tr>td {border-bottom: 0px;}
+1 -1
View File
@@ -58,7 +58,7 @@
<?php endforeach;?>
</td>
</tr>
<?php if($config->systemMode == 'new'):?>
<?php if($config->systemMode == 'new' and !empty($outsideUsers)):?>
<tr>
<th class='w-140px'>
<div class="checkbox-primary checkbox-inline checkbox-right check-all">
+10 -10
View File
@@ -87,12 +87,12 @@
<td class="c-pri"><span class='label-pri <?php echo 'label-pri-' . $task->pri;?>' title='<?php echo zget($lang->task->priList, $task->pri);?>'><?php echo zget($lang->task->priList, $task->pri);?></span></td>
<td class='c-name <?php if(!empty($task->children)) echo 'has-child';?>' title='<?php echo $task->name?>'>
<?php if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';?>
<?php
<?php
if($task->parent > 0)
{
echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ' . html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->parentName . ' / '. $task->name, '', "title='{$task->parentName} / {$task->name}'");
}
else
else
{
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color'");
}
@@ -201,18 +201,18 @@
if($child->needConfirm)
{
$this->lang->task->confirmStoryChange = $this->lang->confirm;
common::printIcon('task', 'confirmStoryChange', "taskid=$child->id", '', 'list', '', 'hiddenwin', '', '', '', '', $child->project);
common::printIcon('task', 'confirmStoryChange', "taskid=$child->id", '', 'list', '', 'hiddenwin');
}
else
{
if($child->status != 'pause') common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project);
if($child->status == 'pause') common::printIcon('task', 'restart', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project);
common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project);
common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project);
if($child->status != 'pause') common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
if($child->status == 'pause') common::printIcon('task', 'restart', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true);
common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true, '', '', $child->project);
common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', '', '', '', '', $child->project);
common::printIcon('task', 'batchCreate', "executionID=$child->execution&storyID=$child->story&moduleID=$child->module&taskID=$child->id&iframe=true", $child, 'list', 'split', '', 'iframe', true, '', $this->lang->task->children, $child->project);
common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true);
common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, "data-width='95%'");
common::printIcon('task', 'batchCreate', "executionID=$child->execution&storyID=$child->story&moduleID=$child->module&taskID=$child->id&iframe=true", $child, 'list', 'split', '', 'iframe', true, '', $this->lang->task->children);
}
}
?>
+1 -1
View File
@@ -1,6 +1,6 @@
$(function()
{
if(programID || systemMode == 'classic') $('#line_chosen').addClass('hidden');
if(manageLinePriv && (programID || systemMode == 'classic')) $('#line_chosen').addClass('hidden');
$('#lineName').css('border-left-color', '');
})
/**
+1 -2
View File
@@ -401,8 +401,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink', '', '#productStoryForm')\"" : '';
echo "<li $class>" . html::a('#', $lang->close, '', $misc) . "</li>";
$class = $canBatchUnlink ? '' : "class='disabled'";
echo "<li $class>" . html::a('#', $lang->story->unlink, '', "id='batchUnlinkStory'") . "</li>";
if($canBatchUnlink) echo "<li $class>" . html::a('#', $lang->story->unlink, '', "id='batchUnlinkStory'") . "</li>";
if($canBatchReview)
{
+2 -1
View File
@@ -15,6 +15,7 @@
<?php js::set('noProject', false);?>
<?php js::set('programID', $programID);?>
<?php js::set('systemMode', $this->config->systemMode);?>
<?php js::set('manageLinePriv', common::hasPriv('product', 'manageLine'));?>
<div id="mainContent" class="main-content">
<div class="center-block">
<div class="main-header">
@@ -31,7 +32,7 @@
<?php endif;?>
<tr>
<th class='w-140px'><?php echo $lang->product->line;?></th>
<?php if($config->systemMode == 'classic' or $programID):?>
<?php if(common::hasPriv('product', 'manageLine') and ($config->systemMode == 'classic' or $programID)):?>
<td>
<div class='input-group'>
<?php echo html::select("line", $lines, '', "class='form-control hidden line-exist chosen'");?>
+22 -3
View File
@@ -260,14 +260,14 @@ class project extends control
$this->view->kanbanList = $kanbanList;
$this->view->browseType = $browseType;
$this->view->memberGroup = $this->execution->getMembersByIdList(array_keys($kanbanList));
$this->view->usersAvatar = $this->loadModel('user')->getAvatarPairs();
$this->view->usersAvatar = $this->loadModel('user')->getAvatarPairs('all');
$this->view->executionActions = $executionActions;
}
$this->view->title = $this->lang->project->common . $this->lang->colon . $this->lang->project->index;
$this->view->position[] = $this->lang->project->index;
$this->view->project = $project;
$this->view->userIdPairs = $this->loadModel('user')->getPairs('nodeleted|showid');
$this->view->userIdPairs = $this->loadModel('user')->getPairs('nodeleted|showid|all');
$this->display();
}
@@ -1128,7 +1128,8 @@ class project extends control
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$actionURL = $this->createLink('project', 'build', "projectID=$projectID&type=bysearch&queryID=myQueryID");
$executions = $this->loadModel('execution')->getByProject($projectID, 'all', '', true);
$devel = $project->model == 'waterfall' ? true : false;
$executions = $this->loadModel('execution')->getByProject($projectID, 'all', '', true, $devel);
$this->config->build->search['fields']['execution'] = $this->project->lang->executionCommon;
$this->config->build->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions);
@@ -1411,13 +1412,31 @@ class project extends control
}
$group = $this->group->getById($groupID);
$project = $this->project->getByID($group->project);
$groupUsers = $this->group->getUserPairs($groupID);
$allUsers = $this->loadModel('dept')->getDeptUserPairs($deptID);
$otherUsers = array_diff_assoc($allUsers, $groupUsers);
if($project->acl != 'open')
{
$canViewMembers = $this->dao->select('account')->from(TABLE_USERVIEW)->where("CONCAT(',', projects, ',')")->like("%,$group->project,%")->fetchPairs();
foreach($otherUsers as $account => $otherUser)
{
if(!isset($canViewMembers[$account])) unset($otherUsers[$account]);
}
}
if($this->config->systemMode == 'new')
{
$outsideUsers = $this->loadModel('user')->getPairs('outside|noclosed|noletter|noempty');
if($project->acl != 'open')
{
foreach($outsideUsers as $account => $outsideUser)
{
if(!isset($canViewMembers[$account])) unset($outsideUsers[$account]);
}
}
$this->view->outsideUsers = array_diff_assoc($outsideUsers, $groupUsers);
}
+1 -1
View File
@@ -93,7 +93,7 @@
<?php if($count > 2) break;?>
<?php $count ++;?>
<div title="<?php echo $member->realname;?>">
<?php echo html::smallAvatar(array('avatar' => $usersAvatar[$member->account], 'account' => $member->account, 'name' => $member->realname), 'avatar-circle avatar-' . zget($userIdPairs, $member->account)); ?>
<?php echo html::smallAvatar(array('avatar' => zget($usersAvatar, $member->account, ''), 'account' => $member->account, 'name' => $member->realname), 'avatar-circle avatar-' . zget($userIdPairs, $member->account, '')); ?>
</div>
<?php endforeach;?>
<?php if(count($members) > 4):?>
+1
View File
@@ -15,5 +15,6 @@ function addItem(obj)
function deleteItem(obj)
{
if($('#teamForm .table tbody').children().length < 2) return false;
$(obj).closest('tr').remove();
}
+4
View File
@@ -5,3 +5,7 @@ function assign(taskID, assignedTo)
$('.assign').load(createLink('user', 'ajaxGetUser', 'taskID=' + taskID + '&assignedTo=' + assignedTo));
}
$(document).ready(function()
{
limitIframeLevel();
});
+3 -1
View File
@@ -1,4 +1,4 @@
$(document).ready(function()
$(document).ready(function()
{
if(config.onlybody != 'yes')$(".runCase").modalTrigger({width:'90%', type:'iframe', afterHide:function(){parent.location.href=parent.location.href;}});
if(config.onlybody != 'yes')$(".results").modalTrigger({width:'90%', type:'iframe'});
@@ -21,4 +21,6 @@ $(document).ready(function()
setTimeout($.resetToolbarPosition, 50);
});
limitIframeLevel();
})
+1 -1
View File
@@ -77,7 +77,7 @@
<tr>
<th class='c-id'>
<?php if($cases):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<div class="checkbox-primary check-all tablesorter-noSort" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php endif;?>
+1 -1
View File
@@ -26,7 +26,7 @@ $name = $lang->tree->name;
if($viewType == 'line') $name = $lang->tree->line;
if($viewType == 'api') $name = $lang->tree->dir;
if($viewType == 'doc') $name = $lang->doc->catalogName;
if($viewType == 'feedback' or $viewType == 'trainskill' or $viewType == 'trainpost') $name = $lang->tree->dir;
if($viewType == 'feedback' or $viewType == 'trainskill' or $viewType == 'trainpost') $name = $lang->tree->cate;
$childTitle = $lang->tree->child;
if(strpos($viewType, 'feedback') !== false) $childTitle = $lang->tree->subCategory;
+2
View File
@@ -76,3 +76,5 @@
#taskModal.show-all > .finish {display: none;}
#taskModal .btn-outline {background-color: transparent; border: 1px solid #fff; color: #fff}
#taskModal .btn-outline:hover {background-color: #fff; color: #43a047}
.icon-close:before {color: #fff;}
+1
View File
@@ -169,6 +169,7 @@ $(function()
}
if($(ele).hasClass('create-bug-btn') || $(ele).hasClass('create-story-btn')) container = '#mainMenu'; // Fix bug #21092.
if(!container && $(ele).hasClass('form-control')) container = '.table-form'; // Fix bug #21093
$e.closest('body').find('.tooltip-tutorial').tooltip('destroy');
var offset = $e.offset();
+2 -1
View File
@@ -40,7 +40,8 @@ class userModel extends model
public function getList($params = 'nodeleted')
{
return $this->dao->select('*')->from(TABLE_USER)
->where('type')->eq('inside')
->where(true)
->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq('inside')->fi()
->beginIF(strpos($params, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi()
->orderBy('account')
->fetchAll();
+108 -17
View File
@@ -43,13 +43,38 @@ class kanbanTest
return $object;
}
public function createRegionTest($kanban, $region = null, $copyRegionID = 0, $from = 'kanban')
/**
* Test create a region.
*
* @param object $kanban
* @param object $region
* @param int $copyRegionID
* @access public
* @return object
*/
public function createRegionTest($kanban, $region = null, $copyRegionID = 0)
{
$objects = $this->objectModel->createRegion($kanban, $region = null, $copyRegionID = 0, $from = 'kanban');
if(!is_null($region))
{
if(empty($copyRegionID))
{
foreach($region as $key => $value) $_POST[$key] = $value;
$region = null;
}
$objectID = $this->objectModel->createRegion($kanban, $region, $copyRegionID);
}
else
{
$objectID = $this->objectModel->createDefaultRegion($kanban);
}
unset($_POST);
if(dao::isError()) return dao::getError();
return $objects;
$object = $this->objectModel->getRegionByID($objectID);
return $object;
}
/**
@@ -406,13 +431,25 @@ class kanbanTest
return $objects;
}
public function createSpaceTest()
/**
* Test create a space.
*
* @param array $param
* @access public
* @return object
*/
public function createSpaceTest($param)
{
$objects = $this->objectModel->createSpace();
foreach($param as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->createSpace();
unset($_POST);
if(dao::isError()) return dao::getError();
return $objects;
$object = $this->objectModel->getSpaceByID($objectID);
return $object;
}
public function updateSpaceTest($spaceID, $type = '')
@@ -442,13 +479,30 @@ class kanbanTest
return $objects;
}
public function createLaneTest($kanbanID, $regionID, $lane = null)
/**
* Test create a lane.
*
* @param object $object
* @param int $kanbanID
* @param int $regionID
* @access public
* @return object
*/
public function createLaneTest($object, $kanbanID, $regionID)
{
$objects = $this->objectModel->createLane($kanbanID, $regionID, $lane = null);
$lane = isset($object->id) ? $this->objectModel->getLaneByID($object->id) : null;
unset($object->id);
unset($lane->id);
foreach($object as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->createLane($kanbanID, $regionID, $lane);
unset($_POST);
if(dao::isError()) return dao::getError();
return $objects;
$object = $this->objectModel->getLaneByID($objectID);
return $object;
}
/**
@@ -563,38 +617,75 @@ class kanbanTest
public function createRDKanbanTest($execution)
{
$objects = $this->objectModel->createRDKanban($execution);
$this->objectModel->createRDKanban($execution);
if(dao::isError()) return dao::getError();
return $objects;
global $tester;
$regions = $tester->dao->select('*')->from(TABLE_KANBANREGION)->where('`kanban`')->eq($execution->id)->fetchAll('id');
$lanes = $tester->dao->select('*')->from(TABLE_KANBANLANE)->where('`execution`')->eq($execution->id)->andWhere('`type`')->ne('common')->fetchAll('id');
$regionIDList = implode($regions, ',');
$columns = $tester->dao->select('*')->from(TABLE_KANBANCOLUMN)->where('`region`')->in($regionIDList)->fetchAll('id');
return count($regions) . ',' . count($lanes) . ',' . count($columns);
}
/**
* Test create default RD region.
*
* @param object $execution
* @access public
* @return object
*/
public function createRDRegionTest($execution)
{
$objects = $this->objectModel->createRDRegion($execution);
$objectID = $this->objectModel->createRDRegion($execution);
if(dao::isError()) return dao::getError();
return $objects;
$object = $this->objectModel->getRegionByID($objectID);
return $object;
}
/**
*
* Test create default RD lanes.
*
* @param int $executionID
* @param int $regionID
* @access public
* @return int
*/
public function createRDLaneTest($executionID, $regionID)
{
$objects = $this->objectModel->createRDLane($executionID, $regionID);
$this->objectModel->createRDLane($executionID, $regionID);
if(dao::isError()) return dao::getError();
return $objects;
global $tester;
$objects = $tester->dao->select('*')->from(TABLE_KANBANLANE)->where('`region`')->eq($regionID)->andWhere('`execution`')->eq($executionID)->fetchAll();
return count($objects);
}
/**
* Test create default RD columns.
*
* @param int $regionID
* @param int $groupID
* @param int $laneID
* @param string $laneType
* @param int $executionID
* @access public
* @return int
*/
public function createRDColumnTest($regionID, $groupID, $laneID, $laneType, $executionID)
{
$objects = $this->objectModel->createRDColumn($regionID, $groupID, $laneID, $laneType, $executionID);
$this->objectModel->createRDColumn($regionID, $groupID, $laneID, $laneType, $executionID);
if(dao::isError()) return dao::getError();
return $objects;
global $tester;
$objects = $tester->dao->select('*')->from(TABLE_KANBANCOLUMN)->where('`region`')->eq($regionID)->andWhere('`group`')->eq($groupID)->fetchAll();
return count($objects);
}
public function updateRegionTest($regionID)
+146
View File
@@ -0,0 +1,146 @@
title: table zt_case
desc: "测试用例"
author: automated export
version: "1.0"
fields:
- field: id
note: "ID"
range: 401-10000
- field: product
note: "产品ID"
range: 0
- field: branch
note: "分支ID"
range: 0
- field: execution
note: "执行ID"
range: 0
- field: lib
note: "所属库"
range: 201
- field: module
note: "所属模块"
range: 0
- field: path
note: ""
range: "0"
- field: story
note: "相关需求"
range: ""
- field: storyVersion
note: "需求版本"
range: "1"
- field: title
note: "用例标题"
range: "1-10000"
prefix: "用例库用例"
- field: precondition
note: "前置条件"
range: "1-10000"
prefix: "这是前置条件"
- field: keywords
note: "关键词"
range: "1-10000"
prefix: "这是关键词"
- field: pri
note: "优先级"
range: 1-4
- field: type
note: "用例类型"
range: feature,performance,config,install,security,interface,other
- field: auto
note: "是否是自动化测试用例"
range: "no"
- field: frame
note: "自动化测试框架"
range: ""
- field: stage
note: "适用阶段"
range: unittest,feature,intergrate,system,smoke,bvt
- field: howRun
note: "测试方式"
range: ""
- field: scriptedBy
note: "脚本由谁创建"
range: ""
- field: scriptedDate
note: "脚本创建日期"
from: common.date.v1.yaml
use: dateB
- field: scriptStatus
note: "脚本状态"
range: ""
- field: scriptLocation
note: "脚本地址"
range: ""
- field: status
note: "用例状态"
range: wait,normal,blocked,investigate
- field: subStatus
note: "子状态"
range: ""
- field: color
note: "标题颜色"
from: common.color.v1.yaml
use: color
- field: frequency
note: "使用频率"
range: 1-3
- field: order
note: "排序"
range: 1-500:5
- field: openedBy
note: "由谁创建"
range: 1-100
prefix: "test"
- field: openedDate
note: "创建日期"
range: "-:600"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: reviewedBy
note: "由谁评审"
range: admin
- field: reviewedDate
note: "评审时间"
range: "-:300"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: lastEditedBy
note: "最后修改者"
range: admin
- field: lastEditedDate
note: "修改日期"
range: "-:300"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: version
note: "用例版本"
range: "1"
- field: linkCase
note: "相关用例"
range: 0
- field: fromBug
note: "来源Bug"
range: 0
- field: fromCaseID
note: ""
range: 0
- field: fromCaseVersion
note: ""
range: 1
- field: deleted
note: "是否删除"
range: 0
- field: lastRunner
note: "执行人"
range: 1-100
prefix: "test"
- field: lastRunDate
note: "执行时间"
range: "-:500"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: lastRunResult
note: "结果"
range: ""
+44
View File
@@ -0,0 +1,44 @@
title: table zt_storyestimate
desc: "需求描述"
author: automated export
version: "1.0"
fields:
- field: story
note: "需求ID"
range: 2-1000:2
prefix: ""
postfix: ""
loop: 0
format: ""
- field: round
note: "轮次"
range: 1
prefix: ""
postfix: ""
loop: 0
format: ""
- field: estimate
note: "估计"
range: 92-100
prefix: "user"
postfix: ""
loop: 0
format: ""
- field: average
note: "平均值"
range: 1.5
prefix: ""
postfix: ""
loop: 0
format: ""
- field: openedBy
note: "验收标准"
range: admin
prefix: ""
postfix: ""
loop: 0
format: ""
- field: openedDate
range: "(M)-(w)"
type: timestamp
format: "YYYY-MM-DD"
+20 -18
View File
@@ -17,24 +17,26 @@ $builder->project = array('rows' => 90, 'extends' => array('project', 'proj
$builder->projectalone = array('rows' => 20, 'extends' => array('project', 'projectalone'));
$builder->sprint = array('rows' => 600, 'extends' => array('project', 'execution'));
$builder->story = array('rows' => 400, 'extends' => array('story'));
$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory'));
$builder->storyreview = array('rows' => 100, 'extends' => array('storyreview'));
$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule'));
$builder->storyplan = array('rows' => 400, 'extends' => array('planstory'));
$builder->storystage = array('rows' => 450, 'extends' => array('storystage'));
$builder->storyspec = array('rows' => 570, 'extends' => array('storyspec'));
$builder->relation = array('rows' => 12, 'extends' => array('relation'));
$builder->task = array('rows' => 600, 'extends' => array('task','task'));
$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask'));
$builder->taskspec = array('rows' => 600, 'extends' => array('taskspec'));
$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule'));
$builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate'));
$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson'));
$builder->case = array('rows' => 400, 'extends' => array('case'));
$builder->casestep = array('rows' => 400, 'extends' => array('casestep'));
$builder->bug = array('rows' => 300, 'extends' => array('bug'));
$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
$builder->story = array('rows' => 400, 'extends' => array('story'));
$builder->childstory = array('rows' => 50, 'extends' => array('story','childstory'));
$builder->storyreview = array('rows' => 100, 'extends' => array('storyreview'));
$builder->storymodule = array('rows' => 800, 'extends' => array('module','storymodule'));
$builder->storyplan = array('rows' => 400, 'extends' => array('planstory'));
$builder->storystage = array('rows' => 450, 'extends' => array('storystage'));
$builder->storyspec = array('rows' => 570, 'extends' => array('storyspec'));
$builder->storyestimate = array('rows' => 6, 'extends' => array('storyestimate'));
$builder->relation = array('rows' => 12, 'extends' => array('relation'));
$builder->task = array('rows' => 600, 'extends' => array('task','task'));
$builder->taskmore = array('rows' => 300, 'extends' => array('task','moretask'));
$builder->taskspec = array('rows' => 600, 'extends' => array('taskspec'));
$builder->taskmodule = array('rows' => 1800, 'extends' => array('module','taskmodule'));
$builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate'));
$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson'));
$builder->case = array('rows' => 400, 'extends' => array('case'));
$builder->libcase = array('rows' => 10, 'extends' => array('case','libcase'));
$builder->casestep = array('rows' => 400, 'extends' => array('casestep'));
$builder->bug = array('rows' => 300, 'extends' => array('bug'));
$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
$builder->testtask = array('rows' => 10, 'extends' => array('testtask'));
$builder->testresult = array('rows' => 40, 'extends' => array('testresult'));
+13
View File
@@ -161,6 +161,13 @@ class Processor
$this->dao->update(TABLE_STORY)->set('`status`')->eq('draft')->where('id')->ge('300')->andwhere('id')->le('400')->exec();
$this->dao->update(TABLE_STORY)->set('`closedBy`')->eq('')->set('`closedReason`')->eq('')->where('status')->ne('closed')->exec();
$this->dao->update(TABLE_STORY)->set('`plan`')->eq('0')->where('id')->gt('300')->andwhere('id')->lt('321')->exec();
$accounts = array('user92' => 'po82', 'user93' => 'po83', 'user94' => 'po84', 'user95' => 'po85', 'user96' => 'po86', 'user97' => 'po82');
foreach($accounts as $key => $value)
{
$this->dao->update(TABLE_STORYESTIMATE)->set('`estimate`')->eq("{\"$value\":{\"account\":\"$value\",\"estimate\":1},\"$key\":{\"account\":\"$key\",\"estimate\":2}")->where('estimate')->eq($key)->exec();
}
}
/**
@@ -404,5 +411,11 @@ class Processor
$this->dao->update(TABLE_KANBANCELL)->data($value)->where('id')->eq($id)->exec();
}
$this->dao->query("update zt_kanbancell set `cards` = '' where id > 400");
$this->dao->query("update zt_kanbancell set `cards` = ',244,' where id = 401");
$this->dao->query("update zt_kanbancell set `cards` = ',181,182,183,' where id = 412");
$this->dao->query("update zt_kanbancell set `cards` = ',61,' where id = 421");
$this->dao->query("update zt_kanbancell set `cards` = ',246,' where id = 428");
$this->dao->query("update zt_kanbancell set `cards` = ',184,185,186,' where id = 439");
$this->dao->query("update zt_kanbancell set `cards` = ',62,' where id = 448");
}
}
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createLane();
cid=1
pid=1
*/
$kanbanID = 1;
$regionID = 1;
$lane1 = new stdclass();
$lane1->name = '测试创建与其他泳道使用相同看板列的泳道';
$lane1->mode = 'sameAsOther';
$lane1->otherLane = '1';
$lane1->color = '#7ec5ff';
$lane2 = new stdclass();
$lane2->name = '测试创建使用独立看板列的泳道';
$lane2->mode = 'independent';
$lane2->color = '#229f24';
$lane3 = new stdclass();
$lane3->name = '';
$lane3->mode = 'independent';
$lane3->color = '#229f24';
$lane4 = new stdclass();
$lane4->id = 1;
$lane5 = new stdclass();
$lane5->id = 2;
$kanban = new kanbanTest();
r($kanban->createLaneTest($lane1, $kanbanID, $regionID)) && p('name,region,group') && e('测试创建与其他泳道使用相同看板列的泳道,1,1'); //测试创建与其他泳道使用相同看板列的泳道
r($kanban->createLaneTest($lane2, $kanbanID, $regionID)) && p('name,region,group') && e('测试创建使用独立看板列的泳道,1,641'); //测试创建使用独立看板列的泳道
r($kanban->createLaneTest($lane3, $kanbanID, $regionID)) && p('name:0') && e('『泳道名称』不能为空。'); //测试创建不填写名称的泳道
r($kanban->createLaneTest($lane4, $kanbanID, $regionID)) && p('name,region,group') && e('默认泳道,1,1'); //测试创建复用泳道1信息的泳道
r($kanban->createLaneTest($lane5, $kanbanID, $regionID)) && p('name,region,group') && e('默认泳道,2,2'); //测试创建复用泳道2信息的泳道
system("./ztest init");
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createRDColumn();
cid=1
pid=1
*/
$regionIDList = array('101', '102');
$groupIDList = array('101', '102', '103', '104', '105', '106');
$laneIDList = array('101', '102', '103', '104', '105', '106');
$laneTypeList = array('story', 'bug', 'task');
$executionIDList = array('161', '162');
$kanban = new kanbanTest();
r($kanban->createRDColumnTest($regionIDList[0], $groupIDList[0], $laneIDList[0], $laneTypeList[0], $executionIDList[0])) && p() && e('22'); // 测试创建执行161 区域101 泳道组101 泳道101 story执行看板的泳道列
r($kanban->createRDColumnTest($regionIDList[0], $groupIDList[1], $laneIDList[1], $laneTypeList[1], $executionIDList[0])) && p() && e('18'); // 测试创建执行161 区域101 泳道组102 泳道102 bug执行看板的泳道列
r($kanban->createRDColumnTest($regionIDList[0], $groupIDList[2], $laneIDList[2], $laneTypeList[2], $executionIDList[0])) && p() && e('14'); // 测试创建执行161 区域101 泳道组103 泳道103 task执行看板的泳道列
r($kanban->createRDColumnTest($regionIDList[1], $groupIDList[3], $laneIDList[3], $laneTypeList[0], $executionIDList[1])) && p() && e('22'); // 测试创建执行162 区域102 泳道组104 泳道104 story执行看板的泳道列
r($kanban->createRDColumnTest($regionIDList[1], $groupIDList[4], $laneIDList[4], $laneTypeList[1], $executionIDList[1])) && p() && e('18'); // 测试创建执行162 区域102 泳道组105 泳道105 bug执行看板的泳道列
r($kanban->createRDColumnTest($regionIDList[1], $groupIDList[5], $laneIDList[5], $laneTypeList[2], $executionIDList[1])) && p() && e('14'); // 测试创建执行162 区域102 泳道组106 泳道106 task执行看板的泳道列
system("./ztest init");
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createRDKanban();
cid=1
pid=1
*/
$execution1 = new stdclass();
$execution1->id = '100001';
$execution2 = new stdclass();
$execution2->id = '100002';
$execution3 = new stdclass();
$execution3->id = '100003';
$execution4 = new stdclass();
$execution4->id = '100004';
$execution5 = new stdclass();
$execution5->id = '100005';
$kanban = new kanbanTest();
r($kanban->createRDKanbanTest($execution1)) && p() && e('1,3,0'); // 测试创建执行10001的执行看板
r($kanban->createRDKanbanTest($execution2)) && p() && e('1,3,0'); // 测试创建执行10002的执行看板
r($kanban->createRDKanbanTest($execution3)) && p() && e('1,3,0'); // 测试创建执行10003的执行看板
r($kanban->createRDKanbanTest($execution4)) && p() && e('1,3,0'); // 测试创建执行10004的执行看板
r($kanban->createRDKanbanTest($execution5)) && p() && e('1,3,0'); // 测试创建执行10005的执行看板
system("./ztest init");
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createRDLane();
cid=1
pid=1
*/
$executionIDList = array('161', '162', '163', '164', '165');
$regionIDList = array('101', '102', '103', '104', '105');
$kanban = new kanbanTest();
r($kanban->createRDLaneTest($executionIDList[0], $regionIDList[0])) && p() && e('6'); // 测试创建执行101的执行看板的泳道
r($kanban->createRDLaneTest($executionIDList[1], $regionIDList[1])) && p() && e('6'); // 测试创建执行102的执行看板的泳道
r($kanban->createRDLaneTest($executionIDList[2], $regionIDList[2])) && p() && e('6'); // 测试创建执行103的执行看板的泳道
r($kanban->createRDLaneTest($executionIDList[3], $regionIDList[3])) && p() && e('6'); // 测试创建执行104的执行看板的泳道
r($kanban->createRDLaneTest($executionIDList[4], $regionIDList[4])) && p() && e('6'); // 测试创建执行105的执行看板的泳道
system("./ztest init");
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createRDRegion();
cid=1
pid=1
*/
$execution1 = new stdclass();
$execution1->id = '100001';
$execution2 = new stdclass();
$execution2->id = '100002';
$execution3 = new stdclass();
$execution3->id = '100003';
$execution4 = new stdclass();
$execution4->id = '100004';
$execution5 = new stdclass();
$execution5->id = '100005';
$kanban = new kanbanTest();
r($kanban->createRDRegionTest($execution1)) && p('name,kanban') && e('默认区域,100001'); // 测试创建执行10001的执行看板区域
r($kanban->createRDRegionTest($execution2)) && p('name,kanban') && e('默认区域,100002'); // 测试创建执行10002的执行看板区域
r($kanban->createRDRegionTest($execution3)) && p('name,kanban') && e('默认区域,100003'); // 测试创建执行10003的执行看板区域
r($kanban->createRDRegionTest($execution4)) && p('name,kanban') && e('默认区域,100004'); // 测试创建执行10004的执行看板区域
r($kanban->createRDRegionTest($execution5)) && p('name,kanban') && e('默认区域,100005'); // 测试创建执行10005的执行看板区域
system("./ztest init");
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createRegion();
cid=1
pid=1
*/
$kanban1 = new stdclass();
$kanban1->id = '100001';
$kanban1->space = '1';
$copyRegionID = 1;
$region1 = new stdclass;
$region1->name = '新增的区域1';
$region1->space = 1;
$region2 = new stdclass;
$region2->name = '新增的区域2';
$region2->space = 1;
$region3 = new stdclass;
$region3->name = '新增的区域3';
$region3->space = 1;
$region4 = new stdclass;
$region4->name = '新增的区域4';
$region4->space = 1;
$region5 = new stdclass;
$region5->name = '';
$region5->space = 1;
$kanban = new kanbanTest();
r($kanban->createRegionTest($kanban1)) && p('name,space,kanban') && e('默认区域,1,100001'); // 创建默认区域
r($kanban->createRegionTest($kanban1, $region1)) && p('name,space,kanban') && e('新增的区域1,1,100001'); // 创建自定义区域1
r($kanban->createRegionTest($kanban1, $region2, $copyRegionID)) && p('name,space,kanban') && e('新增的区域2,1,0'); // 创建复制样式区域2
r($kanban->createRegionTest($kanban1, $region3)) && p('name,space,kanban') && e('新增的区域3,1,100001'); // 创建自定义区域3
r($kanban->createRegionTest($kanban1, $region4, $copyRegionID)) && p('name,space,kanban') && e('新增的区域4,1,0'); // 创建复制样式区域4
r($kanban->createRegionTest($kanban1, $region5)) && p('name:0') && e('『区域名称』不能为空。'); // 创建没有名称的区域
r($kanban->createRegionTest($kanban1, $region1)) && p('name:0') && e('『区域名称』已经有『新增的区域1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 创建重名自定义区域1
system("./ztest init");
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/kanban.class.php';
su('admin');
/**
title=测试 kanbanModel->createSpace();
cid=1
pid=1
*/
$space1 = new stdclass();
$space1->type = 'private';
$space1->name = '测试创建私人空间';
$space1->owner = '';
$space1->contactListMenu = '';
$space1->desc = '私人空间的描述';
$space1->whitelist = array('po15');
$space2 = new stdclass();
$space2->type = 'cooperation';
$space2->name = '测试创建协作空间';
$space2->owner = 'po16';
$space2->contactListMenu = '';
$space2->desc = '协作空间的描述';
$space2->team = array('po15');
$space3 = new stdclass();
$space3->type = 'public';
$space3->name = '测试创建公共空间';
$space3->owner = 'user1';
$space3->contactListMenu = '';
$space3->desc = '公共空间的描述';
$space3->team = array('user2', 'user3');
$space4 = new stdclass();
$space4->type = 'public';
$space4->name = '';
$space4->owner = 'user1';
$space4->contactListMenu = '';
$space4->desc = '不填写名字的公共空间描述';
$space4->team = array('user2', 'user3');
$space5 = new stdclass();
$space5->type = 'public';
$space5->name = '不填写负责人的公共空间';
$space5->owner = '';
$space5->contactListMenu = '';
$space5->desc = '不填写负责人的公共空间描述';
$space5->team = array('user2', 'user3');
$kanban = new kanbanTest();
r($kanban->createSpaceTest($space1)) && p('name,type,desc,owner,team,whitelist') && e('测试创建私人空间,private,私人空间的描述,admin,,admin,po15'); // 创建私人空间
r($kanban->createSpaceTest($space2)) && p('name,type,desc,owner,team,whitelist') && e('测试创建协作空间,cooperation,协作空间的描述,po16,po15,admin,po16,'); // 创建协作空间
r($kanban->createSpaceTest($space3)) && p('name,type,desc,owner,team,whitelist') && e('测试创建公共空间,public,公共空间的描述,user1,user2,user3,admin,user1,'); // 创建公共空间
r($kanban->createSpaceTest($space4)) && p('name:0') && e('『空间名称』不能为空。'); // 创建不填写名称的空间
r($kanban->createSpaceTest($space5)) && p('owner:0') && e('『负责人』不能为空。'); // 创建不填写负责人的空间
+18
View File
@@ -848,6 +848,24 @@ function scrollToSelected(id)
}
}
/**
* Limit iframe levels up to 3.
*
* @access public
* @return void
*/
function limitIframeLevel()
{
/* Fix bug #15325. */
if(window.parent != window.top)
{
$('body').find('a.iframe').each(function()
{
$(this).replaceWith($(this).clone().removeClass('iframe'));
});
}
}
/* Ping the server every some minutes to keep the session. */
needPing = true;