* Task Bug

This commit is contained in:
滔哥
2017-10-23 16:50:48 +08:00
parent cd23a2dd23
commit 492bf6e956
10 changed files with 83 additions and 65 deletions
+19 -2
View File
@@ -36,6 +36,23 @@ ALTER TABLE `zt_team` ADD `left` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0'
ALTER TABLE `zt_team` ADD `order` TINYINT(3) NOT NULL DEFAULT '0' AFTER `left`;
ALTER TABLE `zt_team` CHANGE `days` `days` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `zt_team` DROP PRIMARY KEY;
ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`);
ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`);
ALTER TABLE `zt_user` ADD `score` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `deleted`;
ALTER TABLE `zt_user` ADD `score_level` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `score`;
CREATE TABLE `zt_score` (
`id` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
`userID` int(11) NOT NULL DEFAULT '0',
`account` varchar(30) NOT NULL,
`model` varchar(30) NOT NULL,
`method` varchar(30) NOT NULL,
`score` decimal(12,1) NOT NULL DEFAULT '0.0',
`type` enum('repeat','one') NOT NULL DEFAULT 'repeat',
`time` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `account` (`account`),
KEY `model` (`model`),
KEY `method` (`method`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+8 -2
View File
@@ -16,9 +16,15 @@ class score extends control
* @access public
* @return mixed
*/
public function browse()
public function browse($recTotal = 0, $recPerPage = 100)
{
$this->view->title = $this->lang->score->common;
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage);
$scores = $this->score->getScores($pager);
$this->view->title = $this->lang->score->common;
$this->view->pager = $pager;
$this->view->scores = $scores;
$this->display();
}
}
+13 -1
View File
@@ -2,4 +2,16 @@
$lang->score->common = '积分';
$lang->score->record = '积分记录';
$lang->score->reset = '重置积分';
$lang->score->reset = '重置积分';
$lang->score->id = '编号';
$lang->score->userID = '用户ID';
$lang->score->account = '用户';
$lang->score->model = '模块';
$lang->score->method = '方式';
$lang->score->type = '类型';
$lang->score->score = '分值';
$lang->score->time = '时间';
$lang->score->methods['login'] = '登录';
$lang->score->methods['admin'] = '';
$lang->score->methods['tutorial'] = '新手教程';
+4
View File
@@ -10,5 +10,9 @@
*/
class scoreModel extends model
{
public function getScores($pager)
{
}
}
+10 -40
View File
@@ -18,57 +18,27 @@
</div>
</div>
<table class='table tablesorter'>
<?php $vars = "type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr class='colhead'>
<th class='w-90px'><?php common::printOrderLink('objectType', $orderBy, $vars, $lang->action->objectType);?></th>
<th class='w-id'> <?php common::printOrderLink('objectID', $orderBy, $vars, $lang->idAB);?></th>
<th><?php echo $lang->action->objectName;?></th>
<th class='w-100px'><?php common::printOrderLink('actor', $orderBy, $vars, $lang->action->actor);?></th>
<th class='w-150px'><?php common::printOrderLink('date', $orderBy, $vars, $lang->action->date);?></th>
<th class='w-100px'><?php echo $lang->actions;?></th>
<th><?php echo $lang->score->id;?></th>
<th><?php echo $lang->score->account;?></th>
<th><?php echo $lang->score->model;?></th>
<th><?php echo $lang->score->method;?></th>
<th><?php echo $lang->score->type;?></th>
<th><?php echo $lang->score->score;?></th>
<th><?php echo $lang->score->time;?></th>
</tr>
</thead>
<tbody>
<?php foreach($trashes as $action):?>
<?php $module = $action->objectType == 'case' ? 'testcase' : $action->objectType;?>
<?php if(!empty($scores))foreach($scores as $score):?>
<tr class='text-center'>
<td><?php echo zget($lang->action->objectTypes, $action->objectType, '');?></td>
<td><?php echo $action->objectID;?></td>
<td class='text-left'>
<?php
$methodName = $module == 'caselib' ? 'libview' : 'view';
$params = $action->objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}";
if($module == 'doclib')
{
echo $action->objectName;
}
else
{
echo html::a($this->createLink($module, $methodName, $params), $action->objectName);
}
?>
</td>
<td><?php echo $users[$action->actor];?></td>
<td><?php echo $action->date;?></td>
<td>
<?php
common::printLink('action', 'undelete', "actionid=$action->id", $lang->action->undelete, 'hiddenwin');
if($type == 'all') common::printLink('action', 'hideOne', "actionid=$action->id", $lang->action->hideOne, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='6'>
<?php if($trashes and $type == 'all'):?>
<div class='table-actions clearfix'>
<?php echo html::linkButton($lang->action->hideAll, inlink('hideAll'), 'hiddenwin');?>
<div class='text'><?php echo $lang->action->trashTips;?></div>
</div>
<?php endif;?>
<td colspan='7'>
<?php $pager->show();?>
</td>
</tr>
+1
View File
@@ -14,3 +14,4 @@
#taskPlanCol, #mailCol {width: 50%}
#planAndMailCell.has-mail-col #taskPlanCol {padding-right: 5px;}
#planAndMailCell.has-mail-col #taskPlanCol + #mailCol {padding-left: 5px;}
.input-group-addon input[type='checkBox']{}
+8
View File
@@ -153,3 +153,11 @@ $(function()
if(storyID != 0) setStoryRelated(0);
})
// if(projectType == 'ops')
// {
// $("#tableBody th").eq(2).addClass('hidden');
// $("#tableBody tr").each(function() {
// $(this).find('td').eq(2).addClass('hidden');
// });
// }
+8 -2
View File
@@ -20,11 +20,16 @@ function copyStoryTitle()
/* Set the assignedTos field. */
function setOwners(result)
{
$("#multipleBox").removeAttr("checked");
$('.team-group').addClass('hidden');
$('#assignedTo, #assignedTo_chosen').removeClass('hidden');
if(result == 'affair')
{
$('#assignedTo').attr('multiple', 'multiple');
$('#assignedTo').chosen('destroy');
$('#assignedTo').chosen(defaultChosenOptions);
$('.affair').hide();
$('.team-group').addClass('hidden');
$('#selectAllUser').removeClass('hidden');
}
else if($('#assignedTo').attr('multiple') == 'multiple')
@@ -32,6 +37,7 @@ function setOwners(result)
$('#assignedTo').removeAttr('multiple');
$('#assignedTo').chosen('destroy');
$('#assignedTo').chosen(defaultChosenOptions);
$('.affair').show();
$('#selectAllUser').addClass('hidden');
}
}
@@ -219,8 +225,8 @@ $('[name^=multiple]').change(function()
$('#estimate').attr('readonly', false);
}
});
$(".btn[data-toggle='modalTeam']").click(function()
$(".team-group[data-toggle='modalTeam']").css('cursor', 'pointer');
$(".team-group[data-toggle='modalTeam']").click(function()
{
$('#modalTeam').modal('show');
adjustSortBtn();
+6 -4
View File
@@ -34,12 +34,12 @@ $hiddenStory = ((isonlybody() and $storyID) || $this->config->global->flow == 'o
if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
?>
<form class='form-condensed' method='post' target='hiddenwin'>
<table class='table table-form table-fixed with-border'>
<table class='table table-form table-fixed with-border' id="tableBody">
<thead>
<tr class='text-center'>
<th class='w-30px'><?php echo $lang->idAB;?></th>
<th class='w-150px<?php echo zget($visibleFields, 'module', ' hidden')?>'><?php echo $lang->task->module?></th>
<th class='w-200px<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>'><?php echo $lang->task->story;?></th>
<?php if($project->type != 'ops'):?><th class='w-200px<?php echo zget($visibleFields, 'story', ' hidden'); echo $hiddenStory;?>'><?php echo $lang->task->story;?></th><?php endif;?>
<th><?php echo $lang->task->name;?> <span class='required'></span></th>
<th class='w-80px'><?php echo $lang->typeAB;?> <span class='required'></span></th>
<th class='w-150px<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>'><?php echo $lang->task->assignedTo;?></th>
@@ -56,6 +56,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
$lang->task->typeList['ditto'] = $lang->task->ditto;
$members['ditto'] = $lang->task->ditto;
$modules['ditto'] = $lang->task->ditto;
if($project->type == 'ops') $colspan = $colspan-1;
?>
<?php for($i = 0; $i < $config->task->batchCreate; $i++):?>
<?php
@@ -75,7 +76,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
<tr>
<td class='text-center'><?php echo $i+1;?><?php echo html::hidden("parent[]",$parent);?></td>
<td <?php echo zget($visibleFields, 'module', "class='hidden'")?> style='overflow:visible'><?php echo html::select("module[$i]", $modules, $module, "class='form-control chosen' onchange='setStories(this.value, $project->id, $i)'")?></td>
<td <?php echo zget($visibleFields, 'story', "class='hidden'"); echo $hiddenStory;?> style='overflow: visible'>
<?php if($project->type != 'ops'):?><td <?php echo zget($visibleFields, 'story', "class='hidden'"); echo $hiddenStory;?> style='overflow: visible'>
<div class='input-group'>
<?php echo html::select("story[$i]", $stories, $currentStory, "class='form-control chosen' onchange='setStoryRelated($i)'");?>
<span class='input-group-btn'>
@@ -83,7 +84,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
<?php echo html::hidden("storyEstimate$i") . html::hidden("storyDesc$i") . html::hidden("storyPri$i");?>
</span>
</div>
</td>
</td><?php endif;?>
<td style='overflow:visible'>
<div class='input-group'>
<?php echo html::hidden("color[$i]", '', "data-provide='colorpicker' data-wrapper='input-group-btn fix-border-right' data-pull-menu-right='false' data-btn-tip='{$lang->task->colorTag}' data-update-text='#name\\[{$i}\\]'");?>
@@ -131,6 +132,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
</tr>
</tbody>
</table>
<?php js::set('projectType', $project->type);?>
<?php js::set('storyTasks', $storyTasks);?>
<?php js::set('mainField', 'name');?>
<?php js::set('ditto', $lang->task->ditto);?>
+6 -14
View File
@@ -39,25 +39,17 @@
<tr>
<th><?php echo $lang->task->assignedTo;?></th>
<td>
<div class='row-table'>
<div class='col-table'>
<?php echo html::select('assignedTo[]', $members, $task->assignedTo, "class='form-control chosen'");?>
</div>
<div class="input-group" id="dataPlanGroup">
<?php echo html::select('assignedTo[]', $members, $task->assignedTo, "class='form-control chosen'");?>
<?php if($project->type == 'ops') :?>
<div class='col-table'>
<?php echo html::input('teamMember', '', "class='form-control team-group hidden' readonly='readonly'");?>
</div>
<div class='col-table btn team-group hidden' data-toggle='modalTeam'><?php echo $lang->task->team;?></div>
<div class='col-table btn w-70px'>
<label class='checkbox-inline'><input type='checkBox' name='multiple' value='1'/><?php echo $lang->task->multipleAB;?></label>
</div>
<?php echo html::input('teamMember', '', "class='form-control team-group fix-border hidden' readonly='readonly'");?>
<span class="input-group-addon team-group hidden" data-toggle='modalTeam'><?php echo $lang->task->team;?></span>
<label class='input-group-addon affair'><input type='checkBox' name='multiple' id="multipleBox" value='1'/><?php echo $lang->task->multipleAB;?></label>
<?php endif;?>
</div>
</td>
<td>
<?php if($project->type != 'ops') :?>
<button type='button' class='btn btn-link<?php echo $task->type == 'affair' ? '' : ' hidden'?>' id='selectAllUser'><?php echo $lang->task->selectAllUser ?></button>
<?php endif;?>
<button type='button' class='btn btn-link<?php echo $task->type == 'affair' ? '' : ' hidden'?>' id='selectAllUser'><?php echo $lang->task->selectAllUser ?></button>
</td>
</tr>
<?php if(strpos(",$showFields,", ',story,') !== false and $this->config->global->flow != 'onlyTask'):?>