This commit is contained in:
zhujinyong
2022-03-15 12:24:24 +08:00
41 changed files with 716 additions and 128 deletions
+6 -6
View File
@@ -28,22 +28,22 @@ ALTER TABLE `zt_user` ADD `visions` varchar(20) NOT NULL DEFAULT 'rnd,lite' AFTE
UPDATE `zt_user` SET `visions`='rnd,lite';
INSERT INTO `zt_group` (`vision`, `name`, `role`, `desc`) VALUES
('lite', '管理员', 'liteUser', '迅捷版用户分组');
('lite', '管理员', 'liteAdmin', '迅捷版用户分组');
INSERT INTO `zt_group` (`vision`, `name`, `role`, `desc`) VALUES
('lite', '项目管理', 'liteUser', '迅捷版用户分组');
('lite', '项目管理', 'liteProject', '迅捷版用户分组');
INSERT INTO `zt_group` (`vision`, `name`, `role`, `desc`) VALUES
('lite', '团队成员', 'liteUser', '迅捷版用户分组');
('lite', '团队成员', 'liteTeam', '迅捷版用户分组');
REPLACE INTO `zt_grouppriv`(`module`, `method`,`group`)
SELECT `module`, `method`,(SELECT `id` FROM zt_group WHERE `name` = '管理员' and `vision` = 'lite') from `zt_grouppriv` where `group` = 1;
SELECT `module`, `method`,(SELECT `id` FROM zt_group WHERE `role` = 'liteAdmin' and `vision` = 'lite') from `zt_grouppriv` where `group` = 1;
REPLACE INTO `zt_grouppriv`(`module`, `method`,`group`)
SELECT `module`, `method`,(SELECT `id` FROM zt_group WHERE `name` = '项目管理' and `vision` = 'lite') from `zt_grouppriv` where `group` = 4;
SELECT `module`, `method`,(SELECT `id` FROM zt_group WHERE `role` = 'liteProject' and `vision` = 'lite') from `zt_grouppriv` where `group` = 4;
REPLACE INTO `zt_grouppriv`(`module`, `method`,`group`)
SELECT `module`, `method`,(SELECT `id` FROM zt_group WHERE `name` = '团队成员' and `vision` = 'lite') from `zt_grouppriv` where `group` = 9;
SELECT `module`, `method`,(SELECT `id` FROM zt_group WHERE `role` = 'liteTeam' and `vision` = 'lite') from `zt_grouppriv` where `group` = 9;
ALTER TABLE `zt_productplan` ADD `closedReason` varchar(20) NOT NULL AFTER `order`;
@@ -0,0 +1,9 @@
<?php if(common::checkNotCN()):?>
<script>
$(function()
{
$('#searchForm .form-group #account').closest('.input-group').find('.input-group-addon').css('padding', '5px 32px');
$('#searchForm .form-group #date').closest('.input-group').find('.input-group-addon').css('padding', '5px 32px');
})
</script>
<?php endif;?>
@@ -0,0 +1,211 @@
<?php
/**
* The personal view file of attend module of Ranzhi.
*
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author liyuchun <liyuchun@cnezsoft.com>
* @package attend
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
<style>
#menuActions{float:right !important; margin-top: -60px !important;}
.input-group-required > .required::after, .required-wrapper.required::after {top:12px !important;}
.modal-body .table {margin-bottom:0px !important;}
</style>
<div id='featurebar'>
<ul class='nav'>
<?php
$methodName = strtolower($this->app->getMethodName());
foreach($lang->attend->featurebar as $key => $menu)
{
if(is_string($menu)) $link = $menu;
if(is_array($menu)) $link = $menu['link'];
list($name, $currentModule, $currentMethod, $params) = explode('|', $link);
$class = strtolower($key) == $methodName ? "class='active'" : '';
if(isset($menu['alias'])) $class = strpos(strtolower($menu['alias']), strtolower($key)) !== false ? "class='active'" : $class;
if(common::hasPriv($currentModule, $currentMethod)) echo "<li id='$key' $class>" . html::a($this->createLink($currentModule, $currentMethod, $params), $name) . '</li>';
}
?>
</ul>
</div>
<div class='with-side'>
<div class='side'>
<div class='panel panel-sm'>
<div class='panel-body'>
<ul class='tree' data-ride='tree' data-collapsed='true'>
<?php foreach($yearList as $year):?>
<li class='<?php echo $year == $currentYear ? 'active' : ''?>'>
<?php extCommonModel::printLink('attend', 'personal', "date=$year", $year);?>
<ul>
<?php foreach($monthList[$year] as $month):?>
<li class='<?php echo ($year == $currentYear and $month == $currentMonth) ? 'active' : ''?>'>
<?php extCommonModel::printLink('attend', 'personal', "date=$year$month", $year . $month);?>
</li>
<?php endforeach;?>
</ul>
</li>
<?php endforeach;?>
</ul>
</div>
</div>
</div>
<div class='main'>
<div class='row'>
<?php
$weekIndex = 0;
if($this->config->attend->workingDays > 7)
{
$startDate = strtotime("$currentYear-$currentMonth-01");
$startDate = date('w', $startDate) == 0 ? $startDate : strtotime("last Sunday", $startDate);
$endDate = strtotime("next month -1 day $currentYear-$currentMonth-01");
$endDate = date('w', $endDate) == 6 ? $endDate : strtotime("next Saturday", $endDate);
$firstDayIndex = 0;
$lastDayIndex = 6;
}
else
{
$startDate = strtotime("$currentYear-$currentMonth-01");
$startDate = date('w', $startDate) == 1 ? $startDate : strtotime("last Monday", $startDate);
$endDate = strtotime("next month -1 day $currentYear-$currentMonth-01");
$endDate = date('w', $endDate) == 0 ? $endDate : strtotime("next Sunday", $endDate);
$firstDayIndex = 1;
$lastDayIndex = 0;
}
?>
<?php while($startDate <= $endDate):?>
<?php $dayIndex = date('w', $startDate);?>
<?php if($dayIndex == $firstDayIndex):?>
<div class='col-xs-4'>
<div class='panel'>
<div class='panel-body no-padding'>
<table class="table table-data text-center table-fixed">
<thead>
<tr class='text-center'>
<th class='w-80px'><?php echo $lang->attend->weeks[$weekIndex];?></th>
<th class='w-40px'><?php echo $lang->attend->dayName;?></th>
<th title='<?php echo $lang->attend->signIn;?>'><?php echo $lang->attend->signIn;?></th>
<th title='<?php echo $lang->attend->signOut;?>'><?php echo $lang->attend->signOut;?></th>
<th class='w-100px'><?php echo $lang->actions . '/' . $lang->attend->status;?></th>
</tr>
</thead>
<?php endif;?>
<?php $currentDate = date('Y-m-d', $startDate);?>
<?php if(isset($attends[$currentDate])):?>
<?php $attend = $attends[$currentDate];?>
<?php $status = $attend->status;?>
<?php $reason = $attend->reason;?>
<?php $date = date('Ymd', $startDate);?>
<?php $reviewStatus = isset($attend->reviewStatus) ? $attend->reviewStatus : '';?>
<tr class="text-middle attend-<?php echo $status?> <?php echo (date('m', $startDate) == $currentMonth) ? '' : 'otherMonth'?>" title='<?php echo $lang->attend->statusList[$status]?>'>
<td><?php echo formatTime($currentDate, DT_DATE1);?></td>
<td><?php echo $lang->datepicker->abbrDayNames[$dayIndex]?></td>
<td class='attend-signin'>
<?php $signIn = substr($attend->signIn, 0, 5);?>
<?php if(strpos(',late,absent,rest,leave,lieu,', ",$status,") !== false) $signIn = $lang->attend->statusList[$status];?>
<?php if($status == 'both') $signIn = $lang->attend->statusList['late'];?>
<?php echo $signIn;?>
</td>
<td class='attend-signout'>
<?php $signOut = substr($attend->signOut, 0, 5);?>
<?php if(strpos(',early,absent,rest,leave,lieu,', ",$status,") !== false) $signOut = $lang->attend->statusList[$status];?>
<?php if($status == 'both') $signOut = $lang->attend->statusList['early'];?>
<?php echo $signOut;?>
</td>
<td class='attend-actions'>
<?php
$edit = $reviewStatus == 'wait' ? $lang->attend->edited : $lang->attend->edit;
$leave = $reason == 'leave' ? $lang->attend->leaved : $lang->attend->leave;
$makeup = $reason == 'makeup' ? $lang->attend->makeuped : $lang->attend->makeup;
$overtime = $reason == 'overtime' ? $lang->attend->overtimed : $lang->attend->overtime;
$lieu = $reason == 'lieu' ? $lang->attend->lieud : $lang->attend->lieu;
$trip = $reason == 'trip' ? $lang->attend->triped : $lang->attend->trip;
$egress = $reason == 'egress' ? $lang->attend->egress : $lang->attend->egress;
?>
<?php if($attend->hoursList):?>
<?php
$index = 1;
$statusLabel = '';
foreach($attend->hoursList as $status => $hours)
{
if($index > 1) $statusLabel .= '<br/>';
$statusLabel .= $lang->attend->statusList[$status] . $hours . 'h';
$index++;
}
?>
<div class='dropdown text-left'>
<a href='javascript:;' data-toggle='dropdown'>
<span class='attend-<?php echo $status;?>'><?php echo $statusLabel;?></span>
<span class='caret'></span>
</a>
<ul role='menu' class='dropdown-menu'>
<li><?php echo baseHTML::a($this->createLink('attend', 'edit', "date=" . $date), $edit, "data-toggle='modal' data-width='500px'") . "</li>";?>
</ul>
</div>
<?php elseif($status == 'leave'):?>
<span class='attend-<?php echo $status;?>'>
<?php extCommonModel::printLink('leave', 'create', "date=" . $date, $leave, "data-toggle='modal' data-width='700px'");?>
</span>
<?php elseif($status == 'lieu'):?>
<span class='attend-<?php echo $status;?>'>
<?php extCommonModel::printLink('lieu', 'create', "date=" . $date, $lieu, "data-toggle='modal' data-width='700px'");?>
</span>
<?php elseif(strpos(',rest,normal,', ",$status,") === false):?>
<?php if($reviewStatus == 'wait' or strpos(',late,early,both,', ",$status,") !== false):?>
<?php echo baseHTML::a($this->createLink('attend', 'edit', "date=" . $date), $edit, "data-toggle='modal' data-width='500px'");?>
<?php else:?>
<div class='dropdown'>
<a href='javascript:;' data-toggle='dropdown'><?php echo $lang->actions;?><span class='caret'></span></a>
<ul role='menu' class='dropdown-menu'>
<?php if($reason == '' or $reason == 'normal') extCommonModel::printLink('attend', 'edit', "date=" . $date, $edit, "data-toggle='modal' data-width='500px'", '', '', 'li');?>
<?php if($reason == '' or $reason == 'leave') extCommonModel::printLink('leave', 'create', "date=" . $date, $leave, "data-toggle='modal' data-width='700px'", '', '', 'li');?>
<?php if($reason == '' or $reason == 'makeup') extCommonModel::printLink('makeup', 'create', "date=" . $date, $makeup, "data-toggle='modal' data-width='700px'", '', '', 'li');?>
<?php if($reason == '' or $reason == 'overtime') extCommonModel::printLink('overtime', 'create', "date=" . $date, $overtime, "data-toggle='modal' data-width='700px'", '', '', 'li');?>
<?php if($reason == '' or $reason == 'lieu') extCommonModel::printLink('lieu', 'create', "date=" . $date, $lieu, "data-toggle='modal' data-width='700px'", '', '', 'li');?>
<?php if($reason == '' or $reason == 'trip') extCommonModel::printLink('trip', 'create', "date=" . $date, $trip, "data-toggle='modal' data-width='700px'", '', '', 'li');?>
<?php if($reason == '' or $reason == 'egress') extCommonModel::printLink('egress', 'create', "date=" . $date, $egress, "data-toggle='modal' data-width='700px'", '', '', 'li');?>
</ul>
</div>
<?php endif;?>
<?php elseif($status == 'rest'):?>
<span class='attend-<?php echo $status;?>'>
<?php extCommonModel::printLink('overtime', 'create', "date=" . $date, $lang->attend->overtime, "data-toggle='modal' data-width='700px'");?>
</span>
<?php elseif($status == 'normal'):?>
<span class='attend-<?php echo $status;?>'><?php echo $lang->attend->statusList[$status];?></span>
<?php endif;?>
</td>
</tr>
<?php else:?>
<tr class="<?php echo (date('m', $startDate) == $currentMonth) ? '' : 'otherMonth'?>">
<td><?php echo formatTime($currentDate, DT_DATE1);?></td>
<td><?php echo $lang->datepicker->abbrDayNames[$dayIndex]?></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php endif;?>
<?php if($dayIndex == $lastDayIndex):?>
</table>
</div>
</div>
<?php $weekIndex += 1;?>
</div>
<?php endif;?>
<?php $startDate = strtotime('+1 day', $startDate);?>
<?php endwhile;?>
</div>
</div>
</div>
<script>
$(function()
{
$('.side .has-active-item').addClass('open');
})
</script>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
@@ -0,0 +1,6 @@
<script>
$(function()
{
$('#featurebar #settings').addClass('active');
})
</script>
@@ -0,0 +1,7 @@
<script>
$(function()
{
$('#featurebar #settings').addClass('active');
$('a.setDept').attr('href', createLink('dept', 'browse'));
})
</script>
@@ -0,0 +1,6 @@
<script>
$(function()
{
$('#ajaxForm .table #signInClient').closest('tr').hide();
})
</script>
@@ -58,6 +58,7 @@ $lang->my->menu->index = array('link' => "$lang->dashboard|my|index");
$lang->my->menu->calendar = array('link' => "$lang->calendar|my|calendar|", 'subModule' => 'todo', 'alias' => 'todo');
$lang->my->menu->task = array('link' => "{$lang->task->common}|my|contribute|mode=task&type=assignedTo", 'subModule' => 'task');
$lang->my->menu->contacts = array('link' => "$lang->contact|my|managecontacts|");
if($config->systemScore) $lang->my->menu->score = array('link' => "{$lang->score->shortCommon}|my|score|", 'subModule' => 'score');
global $config;
if($config->edition != 'open') $lang->my->menu->effort = array('link' => 'Effort|effort|calendar|', 'exclude' => 'my-todo');
@@ -58,6 +58,7 @@ $lang->my->menu->index = array('link' => "$lang->dashboard|my|index");
$lang->my->menu->calendar = array('link' => "$lang->calendar|my|calendar|", 'subModule' => 'todo', 'alias' => 'todo');
$lang->my->menu->task = array('link' => "{$lang->task->common}|my|contribute|mode=task&type=assignedTo", 'subModule' => 'task');
$lang->my->menu->contacts = array('link' => "$lang->contact|my|managecontacts|");
if($config->systemScore) $lang->my->menu->score = array('link' => "{$lang->score->shortCommon}|my|score|", 'subModule' => 'score');
global $config;
if($config->edition != 'open') $lang->my->menu->effort = array('link' => '日志|effort|calendar|', 'exclude' => 'my-todo');
@@ -7,6 +7,7 @@ $lang->execution->createKanban = '创建看板';
$lang->execution->noExecution = "暂时没有看板。";
$lang->execution->importTask = '转入任务';
$lang->execution->batchCreateTask = '批量创建任务';
$lang->execution->linkStory = "创建{$lang->SRCommon}";
$lang->execution->kanbanGroup['default'] = '默认方式';
$lang->execution->kanbanGroup['story'] = '目标';
@@ -0,0 +1,7 @@
<?php js::set('type', $type)?>
<script>
$(function()
{
$('#<?php echo $type?>').addClass('active');
})
</script>
@@ -0,0 +1,7 @@
<?php js::set('type', $type)?>
<script>
$(function()
{
$('#<?php echo $type?>').addClass('active');
})
</script>
@@ -0,0 +1,7 @@
<?php js::set('type', $type)?>
<script>
$(function()
{
$('#<?php echo $type?>').addClass('active');
})
</script>
@@ -0,0 +1,7 @@
<?php js::set('type', $type)?>
<script>
$(function()
{
$('#<?php echo $type?>').addClass('active');
})
</script>
@@ -376,29 +376,6 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
echo "<li $class>" . html::a('javascript:;', $lang->story->review, '', $class) . '</li>';
}
if($storyType == 'story')
{
if($canBatchChangeStage)
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->story->stageAB, '', "id='stageItem'");
echo "<ul class='dropdown-menu'>";
foreach($lang->story->stageList as $key => $stage)
{
if(empty($key)) continue;
if(strpos('tested|verified|released|closed', $key) === false) continue;
$actionLink = $this->createLink('story', 'batchChangeStage', "stage=$key");
echo "<li>" . html::a('#', $stage, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin', '#productStoryForm')\"") . "</li>";
}
echo '</ul></li>';
}
else
{
$class= "class='disabled'";
echo "<li $class>" . html::a('javascript:;', $lang->story->stageAB, '', $class) . '</li>';
}
}
?>
</ul>
</div>
@@ -462,9 +439,6 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
</div>
<?php endif;?>
<?php if($canBatchImportToLib):?>
<?php echo html::a('#batchImportToLib', $lang->story->importToLib, '', 'class="btn" data-toggle="modal" id="importToLib"');?>
<?php endif;?>
</div>
<div class="table-statistic"><?php echo $summary;?></div>
<?php $pager->show('right', 'pagerjs');?>
+4 -1
View File
@@ -15,6 +15,9 @@
<?php include $this->app->getModuleRoot() . '/common/view/sortable.html.php';?>
<?php js::set('toTaskList', !empty($task->id));?>
<?php js::set('blockID', $blockID);?>
<?php js::set('vision', $this->config->vision);?>
<?php js::set('projectID', $projectID);?>
<?php js::set('productID', $productID);?>
<?php if(!empty($storyID)):?>
<style> .title-group.required > .required:after {right: 110px;}</style>
<?php endif;?>
@@ -95,7 +98,7 @@
<tr>
<th><?php echo $lang->task->story;?></th>
<td colspan='3'>
<span id='storyBox' class="<?php if(!empty($stories)) echo 'hidden';?> "><?php printf($lang->task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '_blank', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?></span>
<span id='storyBox' class="<?php if(!empty($stories)) echo 'hidden';?> "><?php printf($lang->task->noticeLinkStory, html::a($this->createLink('story', 'create', "productID=$productID&branch=0&moduleID=0&storyID=0&projectID=$projectID&bugID=0&planID=0&todoID=0&extra=&type=story"), $lang->execution->linkStory, '_blank', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?></span>
<div class='input-group <?php if(empty($stories)) echo "hidden";?>'>
<?php echo html::select('story', array($task->story => empty($stories) ? '': $stories[$task->story]), $task->story, "class='form-control chosen' onchange='setStoryRelated();'");?>
<span class='input-group-btn' id='preview'><a href='#' class='btn iframe'><?php echo $lang->preview;?></a></span>
+5
View File
@@ -3,3 +3,8 @@ $lang->todo->typeList['task'] = 'Task';
unset($lang->todo->typeList['bug']);
unset($lang->todo->typeList['testtask']);
unset($lang->todo->typeList['review']);
unset($lang->todo->typeList['issue']);
unset($lang->todo->typeList['risk']);
unset($lang->todo->typeList['opportunity']);
unset($lang->todo->typeList['meeting']);
@@ -3,3 +3,8 @@ $lang->todo->typeList['task'] = '任务';
unset($lang->todo->typeList['bug']);
unset($lang->todo->typeList['testtask']);
unset($lang->todo->typeList['review']);
unset($lang->todo->typeList['issue']);
unset($lang->todo->typeList['risk']);
unset($lang->todo->typeList['opportunity']);
unset($lang->todo->typeList['meeting']);
@@ -11,7 +11,7 @@
#cards .panel-heading {padding: 12px 24px 10px 16px;}
#cards .panel-body {padding: 0 16px 16px;}
#cards .panel-actions {padding: 7px 0; z-index: 0}
#cards .project-type-label {padding: 1px 2px;}
#cards .project-type-label {padding: 2px 2px; margin-bottom: 3px;}
#cards .project-name {font-size: 16px; font-weight: normal; display: inline-block; max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
#cards .project-infos {font-size: 12px; padding: 0 15px;}
#cards .project-infos > span {display: inline-block; line-height: 12px;}
@@ -44,11 +44,10 @@
<div class='col'>
<div class='panel-content'>
<div class='panel-heading not-move-handler'>
<?php if($project->model === 'waterfall'): ?>
<span class='project-type-label label label-warning label-outline'><?php echo $lang->project->waterfall; ?></span>
<?php else: ?>
<span class='project-type-label label label-info label-outline'><?php echo $lang->project->scrum; ?></span>
<?php endif; ?>
<?php if($config->systemMode == 'new'):?>
<?php $projectLabel = $project->model == 'waterfall' ? 'label-warning' : 'label-info';?>
<span class="project-type-label label <?php echo $projectLabel;?> label-outline"><?php echo $lang->project->{$project->model};?></span>
<?php endif;?>
<strong class='project-name' title='<?php echo $project->name;?>'> <?php echo html::a($viewLink, $project->name);?> </strong>
<nav class='panel-actions nav nav-default'>
<li class='dropdown'>
@@ -98,8 +97,8 @@
<?php else: ?>
<?php $project = empty($project->executions ) ? '' : end($project->executions);?>
<div class='project-detail project-iteration'>
<p class='text-muted'><?php echo $lang->project->lastIteration; ?></p>
<?php if($project):?>
<p class='text-muted'><?php echo $project->type == 'kanban' ? $lang->project->lastKanban : $lang->project->lastIteration;?></p>
<div class='row'>
<div class='col-xs-5 execution-name' title="<?php echo $project->name;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID={$project->id}"), $project->name);?></div>
<div class='col-xs-7'>
+1 -1
View File
@@ -204,7 +204,7 @@ class company extends control
$pager = new pager($recTotal, $recPerPage = 50, $pageID = 1);
/* Append id for secend sort. */
$order = $direction == 'next' ? 'date_desc' : 'date_asc';
$orderBy = $direction == 'next' ? 'date_desc' : 'date_asc';
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
$date = empty($date) ? '' : date('Y-m-d', $date);
+1 -1
View File
@@ -306,7 +306,7 @@ class group extends control
$this->view->position = $position;
$this->view->allUsers = $allUsers;
$this->view->group = $group;
$this->view->programs = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('type')->eq('project')->andWhere('deleted')->eq(0)->fetchPairs();
$this->view->programs = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('type')->eq('project')->andWhere('vision')->eq($this->config->vision)->andWhere('deleted')->eq(0)->fetchPairs();
$this->view->deptTree = $this->loadModel('dept')->getTreeMenu($rooteDeptID = 0, array('deptModel', 'createManageProjectAdminLink'), $groupID);
$this->view->groupUsers = $groupUsers;
$this->view->userPrograms = $userPrograms;
+2
View File
@@ -785,6 +785,7 @@ $lang->resource->execution->addWhitelist = 'addWhitelist';
$lang->resource->execution->unbindWhitelist = 'unbindWhitelist';
$lang->resource->execution->storyEstimate = 'storyEstimate';
$lang->resource->execution->executionkanban = 'kanbanAction';
$lang->resource->execution->kanban = 'RDKanban';
//if($config->systemMode == 'classic') $lang->resource->project->list = 'list';
//$lang->execution->methodOrder[0] = 'index';
@@ -840,6 +841,7 @@ $lang->execution->methodOrder[250] = 'addWhitelist';
$lang->execution->methodOrder[255] = 'unbindWhitelist';
$lang->execution->methodOrder[260] = 'storyEstimate';
$lang->execution->methodOrder[265] = 'executionkanban';
$lang->execution->methodOrder[270] = 'kanban';
/* Task. */
$lang->resource->task = new stdclass();
+5 -5
View File
@@ -13,7 +13,7 @@ class holidayModel extends model
{
/**
* Get holiday by id.
*
*
* @param int $id
* @access public
* @return object
@@ -66,8 +66,8 @@ class holidayModel extends model
{
$holiday = fixer::input('post')->get();
$holiday->year = substr($holiday->begin, 0, 4);
if(helper::isZeroDate($holiday->year)) return dao::$errors['begin'][] = sprintf($this->lang->error->date, $this->lang->holiday->begin);
if(helper::isZeroDate($holiday->end)) return dao::$errors['end'][] = sprintf($this->lang->error->date, $this->lang->holiday->end);
if($holiday->year and helper::isZeroDate($holiday->year)) return dao::$errors['begin'][] = sprintf($this->lang->error->date, $this->lang->holiday->begin);
if($holiday->end and helper::isZeroDate($holiday->end)) return dao::$errors['end'][] = sprintf($this->lang->error->date, $this->lang->holiday->end);
$this->dao->insert(TABLE_HOLIDAY)->data($holiday)
->autoCheck()
@@ -302,7 +302,7 @@ class holidayModel extends model
/**
* Update project plan duration.
*
*
* @param string $beginDate
* @param string $endDate
* @access public
@@ -407,4 +407,4 @@ class holidayModel extends model
$this->dao->update(TABLE_TASK)->set('realDuration')->eq($realDuration)->where('id')->eq($task->id)->exec();
}
}
}
}
+1
View File
@@ -264,6 +264,7 @@ $lang->project->nextStep = 'Next step';
$lang->project->hoursUnit = '%s hours';
$lang->project->membersUnit = '%s men';
$lang->project->lastIteration = "Recent {$lang->executionCommon}";
$lang->project->lastKanban = 'Recent Kanban';
$lang->project->ongoingStage = 'Ongoing stage';
$lang->project->scrum = 'Scrum';
$lang->project->waterfall = 'Waterfall';
+1
View File
@@ -264,6 +264,7 @@ $lang->project->nextStep = '下一步';
$lang->project->hoursUnit = '%s 工时';
$lang->project->membersUnit = '%s人';
$lang->project->lastIteration = "近期{$lang->executionCommon}";
$lang->project->lastKanban = '近期看板';
$lang->project->ongoingStage = '进行中的阶段';
$lang->project->scrum = 'Scrum';
$lang->project->waterfall = '瀑布';
+2 -1
View File
@@ -261,7 +261,8 @@ class task extends control
$this->view->members = $members;
$this->view->blockID = $blockID;
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->projectID = $projectID;
$this->view->productID = $this->loadModel('product')->getProductIDByProject($projectID);;
$this->display();
}
+7
View File
@@ -275,6 +275,13 @@ function setStories(moduleID, executionID)
{
$('#storyBox').removeClass('hidden');
$('#story').parent().addClass('hidden');
/* change link when lite */
if(vision == 'lite')
{
config.onlybody = 'no';
$('#storyBox > a:first').attr('href', createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=' + moduleID + '&storyID=0&projectID=' + projectID + '&bugID=0&planID=0&todoID=0&extra=&type=story') + '#_single');
}
}
});
}
+2 -2
View File
@@ -61,8 +61,8 @@
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->task->report->$chartType->item;?></th>
<th class='w-50px text-right'><?php echo $lang->task->report->value;?></th>
<th class='w-50px'><?php echo $lang->report->percent;?></th>
<th class='w-60px text-right'><?php echo $lang->task->report->value;?></th>
<th class='w-60px'><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<tbody>
+24
View File
@@ -489,5 +489,29 @@ class Project
$projects = $this->project->getWorkhour($projectID);
}
public function getInfoList($status)
{
$projects = $this->project->getInfoList($status);
return $projects;
}
public function getStatData($projectID)
{
$projects = $this->project->getStatData($projectID);
return $projects;
}
public function getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all')
{
$projects = $this->project->getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all');
return $projects;
}
}
?>
+84 -3
View File
@@ -603,8 +603,15 @@ class taskTest
else
{
$object = $this->objectModel->getById($taskID);
if(!empty($object) and $object->parent > 0) $parentObject = $this->objectModel->getById($object->parent);
return isset($parentObject) ? $parentObject : $object;
if(empty($object)) return 0;
if($object->parent > 0) $object = $this->objectModel->getById($object->parent);
$estStartedDiff = date_diff(date_create($object->estStarted), date_create(helper::now()));
$deadlineDiff = date_diff(date_create($object->deadline), date_create(helper::now()));
return array('estStartedDiff' => $estStartedDiff->d, 'deadlineDiff' => $deadlineDiff->d);
}
}
@@ -692,8 +699,35 @@ class taskTest
}
}
public function processData4ReportTest($tasks, $children, $field)
public function processData4ReportTest($children, $field)
{
global $tester;
$tasks = $tester->dao->select('*')->from(TABLE_TASK)->where('`execution`')->eq('101')->andWhere('deleted')->eq(0)->fetchAll('id');
$parents = array();
foreach($tasks as $task)
{
if($task->parent > 0) $parents[$task->parent] = $task->parent;
}
$parents = $tester->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
foreach($tasks as $task)
{
if($task->parent > 0)
{
if(isset($tasks[$task->parent]))
{
$tasks[$task->parent]->children[$task->id] = $task;
}
else
{
$parent = $parents[$task->parent];
$task->parentName = $parent->name;
}
}
$task->date = '0000-00-00';
}
$children = $children ? $tasks[601]->children + $tasks[602]->children + $tasks[603]->children : array();
$object = $this->objectModel->processData4Report($tasks, $children, $field);
$object['void'] = isset($object['']) ? $object[''] : 'void';
@@ -895,4 +929,51 @@ class taskTest
return $object;
}
}
public function updateParentStatusTest($taskID, $parentID = 0, $createAction = true)
{
$object = $this->objectModel->updateParentStatus($taskID, $parentID, $createAction);
if(!$object) $object = $this->objectModel->getByID($taskID);
if(dao::isError())
{
return dao::getError();
}
else
{
return $object;
}
}
public function isClickableTest($task, $action)
{
$object = $this->objectModel->isClickable($task, $action);
if(dao::isError())
{
return dao::getError();
}
else
{
return $object ? 1 : 2;
}
}
public function addTaskEstimateTest($data)
{
$data->date = date("Y-m-d");
$this->objectModel->addTaskEstimate($data);
global $tester;
$objectID = $tester->dao->lastInsertID();
$object = $this->objectModel->getEstimateById($objectID);
if(dao::isError())
{
return dao::getError();
}
else
{
return $object;
}
}
}
+15 -4
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
/**
@@ -8,11 +9,21 @@ title=测试 projectModel::getInfoList;
cid=1
pid=1
查询正在进行的项目 >> 0
查询等待状态的项目 >> 项目1
查询暂停状态的项目 >> 0
查询关闭状态的项目 >> 0
查询所有状态的项目 >> 项目1
*/
$project = $tester->loadModel('project');
$project = new Project('admin');
$undoneProject = $project->getInfoList('wait');
var_dump($undoneProject);
$t_status = array('doing', 'wait', 'suspended', 'closed', 'all');
//var_dump($project->getInfoList('all'));die;
r($project->getInfoList($t_status[0])) && p() && e('0'); //查询正在进行的项目
r($project->getInfoList($t_status[1])) && p('11:name') && e('项目1'); //查询等待状态的项目
r($project->getInfoList($t_status[2])) && p() && e('0'); //查询暂停状态的项目
r($project->getInfoList($t_status[3])) && p() && e('0'); //查询关闭状态的项目
r($project->getInfoList($t_status[4])) && p('11:name') && e('项目1'); //查询所有状态的项目
+10 -2
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
/**
@@ -8,7 +9,14 @@ title=测试 projectModel::checkHasContent;
cid=1
pid=1
*/
$project = new Project('admin');
*/
$project = $tester->loadModel('project');
//var_dump($project->getStatData(13));die;
r($project->getStatData(13)) && p('bugCount') && e(3); //统计id=13的项目bug数量
r($project->getStatData(13)) && p('taskCount') && e(13); //任务数量
r($project->getStatData(13)) && p('waitCount') && e(2); //暂停数量
r($project->getStatData(13)) && p('doingCount') && e(2); //进行的数量
r($project->getStatData(13)) && p('finishedCount') && e(0); //完成的数量
+2 -2
View File
@@ -18,5 +18,5 @@ $project = new Project('admin');
$getNu = array(11, array('admin', 'pm92'), 11, array('admin'), true);
r($project->getTeamMembers($getNu[0], $getNu[1])) && p() && e('0'); //获取id为11的项目团队成员个数
r($project->getTeamMembers($getNu[2], $getNu[3], $getNu[4])) && p() && e('1'); //获取id为11的项目团队成员个数,开启新手引导
r($project->getTeamMembers($getNu[0], $getNu[1])) && p() && e('2'); //获取id为11的项目团队成员个数
r($project->getTeamMembers($getNu[2], $getNu[3], $getNu[4])) && p() && e('1'); //获取id为11的项目团队成员个数,开启新手引导
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
/**
@@ -8,7 +9,8 @@ title=测试 projectModel::getTotalStoriesByProject;
cid=1
pid=1
*/
$project = $tester->loadModel('project');
$project = new Project('admin');
var_dump($project->getTotalStoriesByProject());die;
+1 -1
View File
@@ -26,4 +26,4 @@ r($task->activateTest($taskIDList[1])) && p('0:field,old,new') && e('status,done
r($task->activateTest($taskIDList[2])) && p('0:field,old,new') && e('status,pause,doing'); //pause状态任务激活
r($task->activateTest($taskIDList[3])) && p('0:field,old,new') && e('status,cancel,doing'); //cancel状态任务激活
r($task->activateTest($taskIDList[4])) && p('0:field,old,new') && e('status,closed,doing'); //closed状态任务激活
system("./ztest init");
system("./ztest init");
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/task.class.php';
su('admin');
/**
title=taskModel->addTaskEstimate();
cid=1
pid=1
插入task为1 left为0 consumed为3的任务 >> 601,1,0,3
插入task为601 left为0 consumed为3的任务 >> 602,601,0,3
插入task为601 left为1 consumed为4的任务 >> 603,602,1,4
插入task为904 left为3 consumed为6的任务 >> 604,904,3,6
插入task为907 left为6 consumed为9的任务 >> 605,907,6,9
*/
$record1 = new stdclass();
$record1->account = 'po82';
$record1->task = 1;
$record1->left = 0;
$record1->consumed = 3;
$record2 = new stdclass();
$record2->account = 'po82';
$record2->task = 601;
$record2->left = 0;
$record2->consumed = 3;
$record3 = new stdclass();
$record3->account = 'po82';
$record3->task = 602;
$record3->left = 1;
$record3->consumed = 4;
$record4 = new stdclass();
$record4->account = 'po82';
$record4->task = 904;
$record4->left = 3;
$record4->consumed = 6;
$record5 = new stdclass();
$record5->account = 'po82';
$record5->task = 907;
$record5->left = 6;
$record5->consumed = 9;
$task = new taskTest();
r($task->addTaskEstimateTest($record1)) && p('id,task,left,consumed') && e("601,1,0,3"); // 插入task为1 left为0 consumed为3的任务
r($task->addTaskEstimateTest($record2)) && p('id,task,left,consumed') && e("602,601,0,3"); // 插入task为601 left为0 consumed为3的任务
r($task->addTaskEstimateTest($record3)) && p('id,task,left,consumed') && e("603,602,1,4"); // 插入task为601 left为1 consumed为4的任务
r($task->addTaskEstimateTest($record4)) && p('id,task,left,consumed') && e("604,904,3,6"); // 插入task为904 left为3 consumed为6的任务
r($task->addTaskEstimateTest($record5)) && p('id,task,left,consumed') && e("605,907,6,9"); // 插入task为907 left为6 consumed为9的任务
system("./ztest init");
+3 -3
View File
@@ -10,7 +10,7 @@ title=taskModel->assign();
cid=1
pid=1
wite状态任务指派 >> assignedTo,po82,user92
wait状态任务指派 >> assignedTo,po82,user92
doing状态任务指派 >> assignedTo,,user93
done状态任务指派 >> assignedTo,,user94
pause状态任务指派 >> assignedTo,,user95
@@ -21,7 +21,7 @@ closed状态任务指派 >> assignedTo,,user97
$taskIDlist = array('1','2','3','4','5','6');
$waitTask = array('assignedTo' => 'user92','status' => 'wait');
$waitTask = array('assignedTo' => 'user92','status' => 'wait', 'left' => '1');
$doingTask = array('assignedTo' => 'user93','status' => 'doing');
$doneTask = array('assignedTo' => 'user94','status' => 'done');
$pauseTask = array('assignedTo' => 'user95','status' => 'pause');
@@ -29,7 +29,7 @@ $cancelTask = array('assignedTo' => 'user96','status' => 'cancel');
$closedTask = array('assignedTo' => 'user97','status' => 'closed');
$task = new taskTest();
r($task->assignTest($taskIDlist[0],$waitTask)) && p('0:field,old,new') && e('assignedTo,po82,user92'); // wite状态任务指派
r($task->assignTest($taskIDlist[0],$waitTask)) && p('0:field,old,new') && e('assignedTo,po82,user92'); // wait状态任务指派
r($task->assignTest($taskIDlist[1],$doingTask)) && p('0:field,old,new') && e('assignedTo,,user93'); // doing状态任务指派
r($task->assignTest($taskIDlist[2],$doneTask)) && p('0:field,old,new') && e('assignedTo,,user94'); // done状态任务指派
r($task->assignTest($taskIDlist[3],$pauseTask)) && p('0:field,old,new') && e('assignedTo,,user95'); // pause状态任务指派
+5 -5
View File
@@ -10,8 +10,8 @@ title=taskModel->computeBeginAndEnd();
cid=1
pid=1
根据taskID计算没有父计划的开始结束时间 >> 1,2022-03-14,0000-00-00 00:00:00,2022-03-21
根据taskID计算有父计划的父开始结束时间 >> 601,,0000-00-00 00:00:00,2022-03-07
根据taskID计算没有父计划的开始结束时间 >> 0,6
根据taskID计算有父计划的父开始结束时间 >> 0,7
根据不存在的taskID计划开始结束时间 >> 0
*/
@@ -19,7 +19,7 @@ pid=1
$taskIDList = array('1', '901', '100001');
$task = new taskTest();
r($task->computeBeginAndEndTest($taskIDList[0])) && p('id,estStarted,realStarted,deadline') && e('1,2022-03-14,0000-00-00 00:00:00,2022-03-21'); //根据taskID计算没有父计划的开始结束时间
r($task->computeBeginAndEndTest($taskIDList[1])) && p('id,estStarted,realStarted,deadline') && e('601,,0000-00-00 00:00:00,2022-03-07'); //根据taskID计算有父计划的父开始结束时间
r($task->computeBeginAndEndTest($taskIDList[2])) && p('id,estStarted,realStarted,deadline') && e('0'); //根据不存在的taskID计算开始结束时间
r($task->computeBeginAndEndTest($taskIDList[0])) && p('estStartedDiff,deadlineDiff') && e('0,6'); //根据taskID计算没有父计划的开始结束时间
r($task->computeBeginAndEndTest($taskIDList[1])) && p('estStartedDiff,deadlineDiff') && e('0,7'); //根据taskID计算有父计划的父开始结束时间
r($task->computeBeginAndEndTest($taskIDList[2])) && p('estStartedDiff,deadlineDiff') && e('0'); //根据不存在的taskID计算开始结束时间
system("./ztest init");
+123
View File
@@ -0,0 +1,123 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/task.class.php';
su('admin');
/**
title=taskModel->isClickable();
cid=1
pid=1
计算任务为父任务 状态为wait 能否进行start操作 >> 1
计算任务为父任务 状态为doing 能否进行finished操作 >> 1
计算任务为父任务 状态为done 能否进行pause操作 >> 2
计算任务为父任务 状态为pause 能否进行assignto操作 >> 1
计算任务为父任务 状态为closed 能否进行close操作 >> 2
计算任务为父任务 状态为cancel 能否进行batchcreate操作 >> 1
计算任务为普通任务 状态为wait 能否进行recordestimate操作 >> 2
计算任务为普通任务 状态为doing 能否进行delete操作 >> 2
计算任务为普通任务 状态为done 能否进行start操作 >> 2
计算任务为普通任务 状态为pause 能否进行finished操作 >> 1
计算任务为普通任务 状态为closed 能否进行restart操作 >> 2
计算任务为普通任务 状态为cancel 能否进行pause操作 >> 2
计算任务为子任务 状态为wait 能否进行assignto操作 >> 1
计算任务为子任务 状态为doing 能否进行close操作 >> 2
计算任务为子任务 状态为done 能否进行batchcreate操作 >> 2
计算任务为子任务 状态为pause 能否进行recordestimate操作 >> 1
计算任务为子任务 状态为closed 能否进行delete操作 >> 1
计算任务为子任务 状态为cancel 能否进行start操作 >> 2
*/
$task1 = new stdclass();
$task1->parent = 0;
$task1->status = 'wait';
$task2 = new stdclass();
$task2->parent = 0;
$task2->status = 'doing';
$task3 = new stdclass();
$task3->parent = 0;
$task3->status = 'done';
$task4 = new stdclass();
$task4->parent = 0;
$task4->status = 'pause';
$task5 = new stdclass();
$task5->parent = 0;
$task5->status = 'closed';
$task6 = new stdclass();
$task6->parent = 0;
$task6->status = 'cancel';
$task7 = new stdclass();
$task7->parent = -1;
$task7->status = 'wait';
$task8 = new stdclass();
$task8->parent = -1;
$task8->status = 'doing';
$task9 = new stdclass();
$task9->parent = -1;
$task9->status = 'done';
$task10 = new stdclass();
$task10->parent = -1;
$task10->status = 'pause';
$task11 = new stdclass();
$task11->parent = -1;
$task11->status = 'closed';
$task12 = new stdclass();
$task12->parent = -1;
$task12->status = 'cancel';
$task13 = new stdclass();
$task13->parent = 1;
$task13->status = 'wait';
$task14 = new stdclass();
$task14->parent = 1;
$task14->status = 'doing';
$task15 = new stdclass();
$task15->parent = 1;
$task15->status = 'done';
$task16 = new stdclass();
$task16->parent = 1;
$task16->status = 'pause';
$task17 = new stdclass();
$task17->parent = 1;
$task17->status = 'closed';
$task18 = new stdclass();
$task18->parent = 1;
$task18->status = 'cancel';
$task = new taskTest();
r($task->isClickableTest($task1, 'start')) && p('1') && e("1"); //计算任务为父任务 状态为wait 能否进行start操作
r($task->isClickableTest($task2, 'finished')) && p('1') && e("1"); //计算任务为父任务 状态为doing 能否进行finished操作
r($task->isClickableTest($task3, 'pause')) && p('2') && e("2"); //计算任务为父任务 状态为done 能否进行pause操作
r($task->isClickableTest($task4, 'assignto')) && p('1') && e("1"); //计算任务为父任务 状态为pause 能否进行assignto操作
r($task->isClickableTest($task5, 'close')) && p('2') && e("2"); //计算任务为父任务 状态为closed 能否进行close操作
r($task->isClickableTest($task6, 'batchcreate')) && p('1') && e("1"); //计算任务为父任务 状态为cancel 能否进行batchcreate操作
r($task->isClickableTest($task7, 'recordestimate')) && p('2') && e("2"); //计算任务为普通任务 状态为wait 能否进行recordestimate操作
r($task->isClickableTest($task8, 'delete')) && p('2') && e("2"); //计算任务为普通任务 状态为doing 能否进行delete操作
r($task->isClickableTest($task9, 'start')) && p('2') && e("2"); //计算任务为普通任务 状态为done 能否进行start操作
r($task->isClickableTest($task10, 'finished')) && p('1') && e("1"); //计算任务为普通任务 状态为pause 能否进行finished操作
r($task->isClickableTest($task11, 'restart')) && p('2') && e("2"); //计算任务为普通任务 状态为closed 能否进行restart操作
r($task->isClickableTest($task12, 'pause')) && p('2') && e("2"); //计算任务为普通任务 状态为cancel 能否进行pause操作
r($task->isClickableTest($task13, 'assignto')) && p('1') && e("1"); //计算任务为子任务 状态为wait 能否进行assignto操作
r($task->isClickableTest($task14, 'close')) && p('2') && e("2"); //计算任务为子任务 状态为doing 能否进行close操作
r($task->isClickableTest($task15, 'batchcreate')) && p('2') && e("2"); //计算任务为子任务 状态为done 能否进行batchcreate操作
r($task->isClickableTest($task16, 'recordestimate')) && p('1') && e("1"); //计算任务为子任务 状态为pause 能否进行recordestimate操作
r($task->isClickableTest($task17, 'delete')) && p('1') && e("1"); //计算任务为子任务 状态为closed 能否进行delete操作
r($task->isClickableTest($task18, 'start')) && p('2') && e("2"); //计算任务为子任务 状态为cancel 能否进行start操作
+21 -47
View File
@@ -34,53 +34,27 @@ pid=1
*/
$now = helper::now();
$tasks = $dao->select('*')->from(TABLE_TASK)->where('`execution`')->eq('101')->andWhere('deleted')->eq(0)->fetchAll('id');
$parents = array();
foreach($tasks as $task)
{
if($task->parent > 0) $parents[$task->parent] = $task->parent;
}
$parents = $dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id');
foreach($tasks as $task)
{
if($task->parent > 0)
{
if(isset($tasks[$task->parent]))
{
$tasks[$task->parent]->children[$task->id] = $task;
}
else
{
$parent = $parents[$task->parent];
$task->parentName = $parent->name;
}
}
$task->date = '0000-00-00';
}
$children = $tasks[601]->children + $tasks[602]->children + $tasks[603]->children;
$task = new taskTest();
r($task->processData4ReportTest($tasks, '', "execution")) && p('101:name,value') && e('101,14'); //计算executionID为101的执行下按迭代任务数统计的图表数据 101
r($task->processData4ReportTest($tasks, '', 'module')) && p('27:name,value') && e('27,1'); //计算executionID为101的执行下按模块任务统计的图表数据 27
r($task->processData4ReportTest($tasks, '', 'module')) && p('21:name,value') && e('21,12'); //计算executionID为101的执行下按模块任务统计的图表数据 21
r($task->processData4ReportTest($tasks, '', 'assignedTo')) && p('po82:name,value') && e('po82,1'); //计算executionID为101的执行下按指派给统计的图表数据
r($task->processData4ReportTest($tasks, '', 'type')) && p('ui:name,value') && e('ui,1'); //计算executionID为101的执行下按任务类型统计的图表数据 ui
r($task->processData4ReportTest($tasks, '', 'type')) && p('test:name,value') && e('test,2'); //计算executionID为101的执行下按任务类型统计的图表数据 test
r($task->processData4ReportTest($tasks, '', 'pri')) && p('1:name,value') && e('1,5'); //计算executionID为101的执行下按优先级统计的图表数据 1
r($task->processData4ReportTest($tasks, '', 'pri')) && p('2:name,value') && e('2,4'); //计算executionID为101的执行下按优先级统计的图表数据 2
r($task->processData4ReportTest($tasks, '', 'deadline')) && p('0:value') && e("2"); //计算executionID为101的执行下按任务状态统计的图表数据 -8day
r($task->processData4ReportTest($tasks, '', 'deadline')) && p('1:value') && e("1"); //计算executionID为101的执行下按任务状态统计的图表数据 -15day
r($task->processData4ReportTest($tasks, '', 'estimate')) && p('0:name,value') && e('0,3'); //计算executionID为101的执行下按截止时间统计的图表数据 0
r($task->processData4ReportTest($tasks, '', 'estimate')) && p('5:name,value') && e('5,1'); //计算executionID为101的执行下按截止时间统计的图表数据 5
r($task->processData4ReportTest($tasks, $children, 'left')) && p('0:name,value') && e('0,2'); //计算executionID为101的执行下按预计时间统计的图表数据 0
r($task->processData4ReportTest($tasks, $children, 'left')) && p('6:name,value') && e('6,1'); //计算executionID为101的执行下按预计时间统计的图表数据 6
r($task->processData4ReportTest($tasks, $children, 'consumed')) && p('3:name,value') && e('3,2'); //计算executionID为101的执行下按剩余时间统计的图表数据 3
r($task->processData4ReportTest($tasks, $children, 'consumed')) && p('7:name,value') && e('7,1'); //计算executionID为101的执行下按剩余时间统计的图表数据 7
r($task->processData4ReportTest($tasks, $children, 'finishedBy')) && p('void:name,value') && e(',11'); //计算executionID为101的执行下按消耗时间统计的图表数据
r($task->processData4ReportTest($tasks, '', 'closedReason')) && p('void:name,value') && e(',14'); //计算executionID为101的执行下按由谁完成统计的图表数据
r($task->processData4ReportTest($tasks, '', 'date')) && p('void') && e('void'); //计算executionID为101的执行下按关闭原因统计的图表数据
r($task->processData4ReportTest($tasks, '', 'status')) && p('wait:name,value') && e('wait,4'); //计算executionID为101的执行下按每天完成统计的图表数据 wait
r($task->processData4ReportTest($tasks, '', 'status')) && p('done:name,value') && e('done,3'); //计算executionID为101的执行下按每天完成统计的图表数据 done
r($task->processData4ReportTest('', "execution")) && p('101:name,value') && e('101,14'); //计算executionID为101的执行下按迭代任务数统计的图表数据 101
r($task->processData4ReportTest('', 'module')) && p('27:name,value') && e('27,1'); //计算executionID为101的执行下按模块任务统计的图表数据 27
r($task->processData4ReportTest('', 'module')) && p('21:name,value') && e('21,12'); //计算executionID为101的执行下按模块任务统计的图表数据 21
r($task->processData4ReportTest('', 'assignedTo')) && p('po82:name,value') && e('po82,1'); //计算executionID为101的执行下按指派给统计的图表数据
r($task->processData4ReportTest('', 'type')) && p('ui:name,value') && e('ui,1'); //计算executionID为101的执行下按任务类型统计的图表数据 ui
r($task->processData4ReportTest('', 'type')) && p('test:name,value') && e('test,2'); //计算executionID为101的执行下按任务类型统计的图表数据 test
r($task->processData4ReportTest('', 'pri')) && p('1:name,value') && e('1,5'); //计算executionID为101的执行下按优先级统计的图表数据 1
r($task->processData4ReportTest('', 'pri')) && p('2:name,value') && e('2,4'); //计算executionID为101的执行下按优先级统计的图表数据 2
r($task->processData4ReportTest('', 'deadline')) && p('0:value') && e("2"); //计算executionID为101的执行下按任务状态统计的图表数据 -8day
r($task->processData4ReportTest('', 'deadline')) && p('1:value') && e("1"); //计算executionID为101的执行下按任务状态统计的图表数据 -15day
r($task->processData4ReportTest('', 'estimate')) && p('0:name,value') && e('0,3'); //计算executionID为101的执行下按截止时间统计的图表数据 0
r($task->processData4ReportTest('', 'estimate')) && p('5:name,value') && e('5,1'); //计算executionID为101的执行下按截止时间统计的图表数据 5
r($task->processData4ReportTest('1', 'left')) && p('0:name,value') && e('0,2'); //计算executionID为101的执行下按预计时间统计的图表数据 0
r($task->processData4ReportTest('1', 'left')) && p('6:name,value') && e('6,1'); //计算executionID为101的执行下按预计时间统计的图表数据 6
r($task->processData4ReportTest('1', 'consumed')) && p('3:name,value') && e('3,2'); //计算executionID为101的执行下按剩余时间统计的图表数据 3
r($task->processData4ReportTest('1', 'consumed')) && p('7:name,value') && e('7,1'); //计算executionID为101的执行下按剩余时间统计的图表数据 7
r($task->processData4ReportTest('1', 'finishedBy')) && p('void:name,value') && e(',11'); //计算executionID为101的执行下按消耗时间统计的图表数据
r($task->processData4ReportTest('', 'closedReason')) && p('void:name,value') && e(',14'); //计算executionID为101的执行下按由谁完成统计的图表数据
r($task->processData4ReportTest('', 'date')) && p('void') && e('void'); //计算executionID为101的执行下按关闭原因统计的图表数据
r($task->processData4ReportTest('', 'status')) && p('wait:name,value') && e('wait,4'); //计算executionID为101的执行下按每天完成统计的图表数据 wait
r($task->processData4ReportTest('', 'status')) && p('done:name,value') && e('done,3'); //计算executionID为101的执行下按每天完成统计的图表数据 done
+7 -8
View File
@@ -18,29 +18,29 @@ pid=1
测试修改任务状态 >> status,cancel,doing
测试修改任务优先级 >> pri,2,1
测试修改任务所属执行 >> execution,107,101
测试修改任务预计开始时间 >> estStarted,2022-03-14,2022-02-27
测试修改任务截止时间 >> deadline,2022-03-13,2022-03-29
测试修改任务截止时间 >> deadline,2022-03-29
测试修改任务关闭原因 >> 『关闭原因』必须为空。
*/
$estStarted = '2022-02-27';
$deadline = '2022-03-29';
$taskIDList = array('1','2','3','4','5','6','7','8','9');
$changename = array('name' => '任务名修改','estStarted' => $estStarted,'deadline' => $deadline);
$changename = array('name' => '任务名修改','deadline' => $deadline);
$changemodule = array('module' => '25');
$changeassign = array('assignedTo' => 'user94');
$changetype = array('type' => 'devel');
$changestatus = array('status' => 'doing');
$changepri = array('pri' => '1');
$changeexecution = array('execution' => '101');
$changeestStarted = array('estStarted' => $estStarted);
$changedeadline = array('deadline' => $deadline);
$ckclosedReason = array('closedReason' => '关闭原因');
$today = helper::today();
$oldDeadline = $dao->select("date_sub('$today', interval 1 day) as date")->fetch()->date;
$task = new taskTest();
r($task->updateObject($taskIDList[0], $changename)) && p('2:field,old,new') && e('name,开发任务11,任务名修改'); // 测试修改任务名称
r($task->updateObject($taskIDList[0], $changename)) && p('1:field,old,new') && e('name,开发任务11,任务名修改'); // 测试修改任务名称
r($task->updateObject($taskIDList[0], $changename)) && p() && e('没有数据更新'); // 测试无修改
r($task->updateObject($taskIDList[1], $changemodule)) && p('0:field,old,new') && e('module,24,25'); // 测试修改任务模块
r($task->updateObject($taskIDList[2], $changeassign)) && p('1:field,old,new') && e('assignedTo,,user94'); // 测试修改任务指派人
@@ -48,8 +48,7 @@ r($task->updateObject($taskIDList[3], $changetype)) && p('0:field,old,new'
r($task->updateObject($taskIDList[4], $changestatus)) && p('0:field,old,new') && e('status,cancel,doing'); // 测试修改任务状态
r($task->updateObject($taskIDList[5], $changepri)) && p('0:field,old,new') && e('pri,2,1'); // 测试修改任务优先级
r($task->updateObject($taskIDList[6], $changeexecution)) && p('0:field,old,new') && e('execution,107,101'); // 测试修改任务所属执行
r($task->updateObject($taskIDList[7], $changeestStarted)) && p('0:field,old,new') && e('estStarted,2022-03-14,2022-02-27'); // 测试修改任务预计开始时间
r($task->updateObject($taskIDList[8], $changedeadline)) && p('0:field,old,new') && e('deadline,2022-03-13,2022-03-29'); // 测试修改任务截止时间
r($task->updateObject($taskIDList[8], $changedeadline)) && p('0:field,new') && e("deadline,2022-03-29"); // 测试修改任务截止时间
r($task->updateObject($taskIDList[0], $ckclosedReason)) && p('closedReason:0') && e(' 『关闭原因』必须为空。'); // 测试修改任务关闭原因
system("./ztest init");
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/task.class.php';
su('admin');
/**
title=taskModel->updateParentStatus();
cid=1
pid=1
更新任务ID为1 创建动态的任务的父任务 >> 1
更新任务ID为601 创建动态的任务的父任务 >> 1
更新任务ID为601 父ID为601 创建动态的任务的父任务 >> doing,更多任务1
更新任务ID为901 创建动态的任务的父任务 >> wait,子任务1
更新任务ID为901 父ID为601 创建动态的任务的父任务 >> wait,子任务1
更新任务ID为901 父ID为601 不创建动态的任务的父任务 >> wait,子任务1
更新任务ID为901 父ID为902 创建动态的任务的父任务 >> 1
更新任务ID为不存在的100001 父ID为601 创建动态的任务的父任务 >> 0
更新任务ID为不存在的100001 父ID为601 不创建动态的任务的父任 >> 0
更新任务ID为不存在的100001 父ID为902 创建动态的任务的父任务 >> 1
*/
$taskIDList = array('1', '601', '901', '100001');
$parentIDList = array('601', '902');
$task = new taskTest();
r($task->updateParentStatusTest($taskIDList[0])) && p('status,name') && e('1'); //更新任务ID为1 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[1])) && p('status,name') && e('1'); //更新任务ID为601 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[1], $parentIDList[0])) && p('status,name') && e('doing,更多任务1'); //更新任务ID为601 父ID为601 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[2])) && p('status,name') && e('wait,子任务1'); //更新任务ID为901 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[2], $parentIDList[0])) && p('status,name') && e('wait,子任务1'); //更新任务ID为901 父ID为601 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[2], $parentIDList[0], false)) && p('status,name') && e('wait,子任务1'); //更新任务ID为901 父ID为601 不创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[2], $parentIDList[1])) && p('status,name') && e('1'); //更新任务ID为901 父ID为902 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[3], $parentIDList[0])) && p('status,name') && e('0'); //更新任务ID为不存在的100001 父ID为601 创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[3], $parentIDList[0], false)) && p('status,name') && e('0'); //更新任务ID为不存在的100001 父ID为601 不创建动态的任务的父任务
r($task->updateParentStatusTest($taskIDList[3], $parentIDList[1])) && p('status,name') && e('1'); //更新任务ID为不存在的100001 父ID为902 创建动态的任务的父任务
system("./ztest init");