* adjust project task.

This commit is contained in:
zhujinyong
2013-01-21 08:11:03 +00:00
parent d6ecb98406
commit 890e80a8a0
5 changed files with 23 additions and 37 deletions

View File

@@ -139,11 +139,7 @@ class project extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
$tasks = array();
if($status == 'byModule')
{
$tasks = $this->loadModel('task')->getTasksByModule($projectID, $this->tree->getAllChildID($moduleID), $orderBy, $pager);
}
elseif($browseType != "bysearch")
if($browseType != "bysearch")
{
$status = $status == 'byProject' ? 'all' : $status;
$tasks = $this->loadModel('task')->getProjectTasks($projectID, $status, $orderBy, $pager);

View File

@@ -1,23 +1,5 @@
/* Browse by module. */
function browseByModule()
{
$('#querybox').addClass('hidden');
$('#featurebar .active').removeClass('active');
$('#bymoduleTab').addClass('active');
}
$(function()
{
$('#' + browseType + 'Tab').addClass('active');
if(browseType == 'bysearch') ajaxGetSearchForm();
$('.iframe').colorbox({width:900, height:400, iframe:true});
});
/* Browse by project. */
function browseByProject()
{
$('#querybox').addClass('hidden');
$('#byProjectTab').addClass('active');
$('#featurebar .active').removeClass('active');
}

View File

@@ -70,6 +70,15 @@ class projectModel extends model
{
/* Check the privilege. */
$project = $this->getById($projectID);
/* Unset story, bug, build and testtask if type is ops. */
if($project->type == 'ops')
{
unset($this->lang->project->menu->story);
unset($this->lang->project->menu->bug);
unset($this->lang->project->menu->build);
unset($this->lang->project->menu->testtask);
}
if($projects and !isset($projects[$projectID]) and !$this->checkPriv($project))
{
echo(js::alert($this->lang->project->accessDenied));

View File

@@ -21,14 +21,12 @@ var browseType = '<?php echo $browseType;?>';
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'></div>
<table class='cont-lt1'>
<tr valign='top'>
<?php if($browseType =='byproject'):?>
<?php if($project->type !='sprint'):?>
<td class='side'>
<div class='box-title'><?php echo $lang->project->projectTasks;?></div>
<div class='box-content'><?php echo $projectTree;?></div>
</td>
<td class='divider'></td>
<?php endif?>
<?php if($browseType =='bymodule'):?>
<td class='side'>
<div class='box-title'><?php echo $project->name;?></div>
<div class='box-content'>
@@ -42,7 +40,7 @@ var browseType = '<?php echo $browseType;?>';
</div>
</td>
<td class='divider'></td>
<?php endif;?>
<?php endif?>
<td>
<form method='post' action='<?php echo $this->createLink('task', 'batchEdit', "projectID=$project->id&from=projectTask&orderBy=$orderBy");?>'>
<table class='table-1 fixed colored tablesorter datatable'>
@@ -69,7 +67,7 @@ var browseType = '<?php echo $browseType;?>';
<th class='w-35px'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->task->estimateAB);?></th>
<th class='w-40px'> <?php common::printOrderLink('consumed', $orderBy, $vars, $lang->task->consumedAB);?></th>
<th class='w-40px'> <?php common::printOrderLink('left', $orderBy, $vars, $lang->task->leftAB);?></th>
<th><?php common::printOrderLink('story', $orderBy, $vars, $lang->task->story);?></th>
<?php if($project->type == 'sprint') print '<th>' and common::printOrderLink('story', $orderBy, $vars, $lang->task->story) and print '</th>';?>
<th class='w-140px {sorter:false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
@@ -110,14 +108,17 @@ var browseType = '<?php echo $browseType;?>';
<td><?php echo $task->estimate;?></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
<td class='a-left' title="<?php echo $task->storyTitle?>">
<?php
<?php
if($project->type == 'sprint')
{
echo '<td class="a-left" title="' . $task->storyTitle . '"';
if($task->storyID)
{
if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle;
}
?>
</td>
echo '</td>';
}
?>
<td class='a-right'>
<?php
common::printIcon('task', 'record', "taskID=$task->id", $task, 'list', '', '', 'iframe', true);
@@ -137,7 +138,7 @@ var browseType = '<?php echo $browseType;?>';
</tbody>
<tfoot>
<tr>
<?php $columns = $this->cookie->windowWidth > $this->config->wideSize ? 14 : 12;?>
<?php $columns = ($this->cookie->windowWidth > $this->config->wideSize ? 14 : 12) - ($project->type == 'sprint' ? 0 : 1);?>
<td colspan='<?php echo $columns;?>'>
<div class='f-left'>
<?php

View File

@@ -1,8 +1,8 @@
<div id='featurebar'>
<div class='f-left'>
<?php
echo "<span id='allTab'>" ; common::printLink('project', 'task', "project=$projectID&type=all", $lang->project->allTasks); echo '</span>' ;
echo "<span id='burnTab'>" ; common::printLink('project', 'burn', "project=$projectID", $lang->project->burn); echo '</span>' ;
echo "<span id='allTab'>"; common::printLink('project', 'task', "project=$projectID&type=all", $lang->project->allTasks); echo '</span>' ;
if($project->type == 'sprint') print "<span id='burnTab'>" and common::printLink('project', 'burn', "project=$projectID", $lang->project->burn); print '</span>' ;
echo "<span id='assignedtomeTab'>"; common::printLink('project', 'task', "project=$projectID&type=assignedtome", $lang->project->assignedToMe); echo '</span>' ;
echo "<span id='statusTab'>";
@@ -13,8 +13,6 @@
echo html::select('groupBy', $lang->project->groups, isset($groupBy) ? $groupBy : '', "onchange='switchGroup($projectID, this.value)'");
echo "</span>";
echo "<span id='byprojectTab' onclick='browseByProject()'>"; common::printLink('project', 'task',"project=$projectID&type=byProject", $lang->project->projectTasks); echo '</span>';
echo "<span id='bymoduleTab' onclick='browseByModule()'>"; common::printLink('project', 'task',"project=$projectID&type=byModule", $lang->project->moduleTask); echo '</span>';
echo "<span id='bysearchTab'><a href='#'><span class='icon-search'></span>{$lang->project->byQuery}</a></span> ";
?>
</div>