Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2016-11-14 14:12:13 +08:00
8 changed files with 55 additions and 67 deletions
+1 -1
View File
@@ -1589,7 +1589,7 @@ class project extends control
$currentMembers = $this->project->getTeamMembers($projectID);
$members2Import = $this->project->getMembers2Import($team2Import, array_keys($currentMembers));
$teams2Import = $this->project->getTeams2Import($this->app->user->account, $projectID);
$teams2Import = array($this->lang->project->copyTeam) + $teams2Import;
$teams2Import = array('' => '') + $teams2Import;
/* Set menu. */
$this->project->setMenu($this->projects, $project->id);
+1
View File
@@ -19,6 +19,7 @@
#titlebar > .heading {float: left; padding-right: 10px!important}
#titlebar > .heading > .icon {display: inline;}
#deptSelector {float: left; min-width: 220px; position: relative; top: -7px}
#copyTeam {float: left; min-width: 220px; position: relative; top: -7px; padding-left:5px}
.outer .main .table tr > td:first-child {padding-left: 10px;}
.outer .main .table tr > td:last-child {padding-right: 10px;}
+7 -18
View File
@@ -1,15 +1,3 @@
/**
* Import a team.
*
* @access public
* @return void
*/
function importTeam(val)
{
if(val == undefined) val = $('#teams2Import').val();
location.href = createLink('project', 'manageMembers', 'project=' + projectID + '&teamImport=' + val);
}
/**
* Set role when select an account.
*
@@ -25,12 +13,6 @@ function setRole(account, roleID)
roleOBJ.val(role) // set the role.
}
$(function()
{
$('#itBtn').click(function(){$('#importTeamModal').modal('show')});
$('#importTeams a').click(function(){importTeam($(this).data('id')); $('#importTeamModal').modal('hide')});
});
function addItem()
{
var item = $('#addItem').html().replace(/%i%/g, i);
@@ -52,3 +34,10 @@ function setDeptUsers(obj)
link = createLink('project', 'manageMembers', 'projectID=' + projectID + '&team2Import=' + team2Import + '&dept=' + dept);//Create manageMembers link.
location.href=link;
}
function choseTeam2Copy(obj)
{
team = $(obj).val();
link = createLink('project', 'manageMembers', 'projectID=' + projectID + '&team2Import=' + team);
location.href=link;
}
+2 -2
View File
@@ -181,12 +181,12 @@ $lang->project->batchWBS = "批量分解";
$lang->project->howToUpdateBurn = "<a href='http://api.zentao.net/goto.php?item=burndown&lang=zh-cn' target='_blank' title='如何更新燃尽图?' class='btn btn-sm'>帮助</a>";
$lang->project->whyNoStories = "看起来没有需求可以关联。请检查下{$lang->projectCommon}关联的{$lang->productCommon}中有没有需求,而且要确保它们已经审核通过。";
$lang->project->doneProjects = '已结束';
$lang->project->selectDept = '请选择部门';
$lang->project->selectDept = '选择一个部门的成员';
$lang->project->copyTeam = '复制团队';
$lang->project->copyFromTeam = "复制自{$lang->projectCommon}团队: <strong>%s</strong>";
$lang->project->noMatched = "找不到包含'%s'的$lang->projectCommon";
$lang->project->copyTitle = "请选择一个{$lang->projectCommon}来复制";
$lang->project->copyTeamTitle = "请选择一个{$lang->projectCommon}团队来复制";
$lang->project->copyTeamTitle = "选择一个{$lang->projectCommon}团队来复制";
$lang->project->copyNoProject = "没有可用的{$lang->projectCommon}来复制";
$lang->project->copyFromProject = "复制自{$lang->projectCommon} <strong>%s</strong>";
$lang->project->cancelCopy = '取消复制';
+3 -33
View File
@@ -20,9 +20,9 @@
<i class='icon icon-angle-right text-muted'></i>
</div>
<div id='deptSelector'><?php echo html::select('dept', $depts, $dept, "class='form-control chosen' onchange='setDeptUsers(this)' data-placeholder='{$lang->project->selectDept}'");?></div>
<div class='actions'>
<button class='btn' id='itBtn'><?php echo html::icon($lang->icons['copy']) . ' ' . $lang->project->copyTeam;?></button>
</div>
<?php if(count($teams2Import) != 1):?>
<div id='copyTeam'><?php echo html::select('project', $teams2Import, $team2Import, "class='form-control chosen' onchange='choseTeam2Copy(this)' data-placeholder='{$lang->project->copyTeamTitle}'");?></div>
<?php endif;?>
</div>
<div class='main'>
<form class='form-condensed' method='post' id='teamForm'>
@@ -128,34 +128,4 @@
</tr>
</table>
</div>
<div class='modal fade' id='importTeamModal'>
<div class='modal-dialog mw-700px'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>&times;</button>
<h4 class='modal-title' id='myModalLabel'><?php echo $lang->project->copyTeamTitle;?></h4>
</div>
<div class='modal-body'>
<?php if(count($teams2Import) == 1):?>
<div class='alert alert-warning'>
<i class='icon-info-sign'></i>
<div class='content'>
<p><?php echo $lang->project->copyNoProject;?></p>
</div>
</div>
<?php else:?>
<div id='importTeams' class='row'>
<?php foreach ($teams2Import as $id => $name):?>
<?php if(empty($id)):?>
<?php if($team2Import != 0):?>
<div class='col-md-4 col-sm-6'><a href='javascript:;' data-id='' class='cancel'><?php echo html::icon($lang->icons['cancel']) . ' ' . $lang->project->cancelCopy;?></a></div>
<?php endif;?>
<?php else: ?>
<div class='col-md-4 col-sm-6'><a href='javascript:;' data-id='<?php echo $id;?>' class='nobr <?php echo ($team2Import == $id) ? ' active' : '';?>'><?php echo html::icon($lang->icons['team'], 'text-muted') . ' ' . $name;?></a></div>
<?php endif; ?>
<?php endforeach;?>
</div>
<?php endif;?>
</div>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
+2 -1
View File
@@ -914,7 +914,8 @@ class story extends control
public function tasks($storyID, $projectID = 0)
{
$this->loadModel('task');
$this->view->tasks = $this->task->getStoryTaskPairs($storyID, $projectID);
$this->view->tasks = $this->task->getStoryTasks($storyID, $projectID);
$this->view->users = $this->user->getPairs('noletter');
$this->display();
}
+36 -9
View File
@@ -1,11 +1,38 @@
<?php include '../../common/view/header.lite.html.php';?>
<table class='table'>
<caption><?php echo $lang->story->tasks;?></caption>
<?php
foreach($tasks as $task)
{
echo "<tr><td>$task</td></tr>";
}
?>
</table>
<div id='titlebar'>
<div class='heading'>
<span><?php echo html::icon($lang->icons['report']);?></span>
<small class='text-muted'> <?php echo $lang->story->tasks;?></small>
</div>
</div>
<div>
<form class='form-condensed' target='hiddenwin'>
<table class='table'>
<thead>
<tr class='text-center'>
<th class='w-p30'> <?php echo $lang->task->name;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-user'> <?php echo $lang->task->assignedToAB;?></th>
<th class='w-40px'> <?php echo $lang->task->estimate;?></th>
<th class='w-40px'> <?php echo $lang->task->consumed;?></th>
<th class='w-40px'> <?php echo $lang->task->left;?></th>
</tr>
</thead>
<tbody>
<?php foreach($tasks as $key => $task):?>
<tr class='text-center'>
<td class='text-left' title="<?php echo $task->name?>"><?php echo $task->name;?></td>
<td><span class='<?php echo 'pri' . zget($lang->task->priList, $task->pri, $task->pri)?>'><?php echo zget($lang->task->priList, $task->pri, $task->pri);?></span></td>
<td><?php echo $lang->task->statusList[$task->status];?></td>
<td><?php echo zget($users, $task->assignedTo, $task->assignedTo);?></td>
<td><?php echo $task->estimate;?></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+3 -3
View File
@@ -977,14 +977,14 @@ class taskModel extends model
* @access public
* @return array
*/
public function getStoryTaskPairs($storyID, $projectID = 0)
public function getStoryTasks($storyID, $projectID = 0)
{
return $this->dao->select('id, name')
return $this->dao->select('id, name, assignedTo, status, estimate, consumed, `left`')
->from(TABLE_TASK)
->where('story')->eq((int)$storyID)
->andWhere('deleted')->eq(0)
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
->fetchPairs();
->fetchAll('id');
}
/**