* refactory the logic: hasPriv then html::a instead common::printLink.
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
<div class='box-title'><?php echo $productName;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manage);?>
|
||||
</div>
|
||||
<div class='a-right'><?php common::printLink('tree', 'browse', "productID=$productID&view=bug", $lang->tree->manage);?></div>
|
||||
</div>
|
||||
</nobr>
|
||||
</td>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
echo '<span id="deactivated">'. html::a(inlink('browse', "type=deactivated"), $lang->extension->deactivated) . '</span>';
|
||||
echo '<span id="available">' . html::a(inlink('browse', "type=available"), $lang->extension->available ) . '</span>';
|
||||
echo '<span id="obtain"> ' . html::a(inlink('obtain'), $lang->extension->obtain) . '</span>';
|
||||
if(common::hasPriv('extension', 'upload')) echo '<span id="upload" >' . html::a(inlink('upload'), $lang->extension->upload, '', "class='iframe'") . '</span>';
|
||||
common::printLink('extension', 'upload', '', $lang->extension->upload, '', "class='iframe'");
|
||||
?>
|
||||
</div>
|
||||
<script>$('#<?php echo $tab;?>').addClass('active')</script>
|
||||
|
||||
@@ -33,7 +33,7 @@ function downloadFile(fileID)
|
||||
foreach($files as $file)
|
||||
{
|
||||
if(common::hasPriv('file', 'download')) echo html::a($this->createLink('file', 'download', "fileID=$file->id") . $sessionString, $file->title .'.' . $file->extension, '_blank', "onclick='return downloadFile($file->id)'");
|
||||
if(common::hasPriv('file', 'edit')) echo html::a($this->createLink('file', 'edit', "fileID=$file->id"), $lang->edit, '', "class='edit'");
|
||||
common::printLink('file', 'edit', "fileID=$file->id", $lang->edit, '', "class='edit'");
|
||||
if(common::hasPriv('file', 'delete')) echo html::commonButton(' x ', "onclick='deleteFile($file->id)'");
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of project module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package project
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<script src="<?php echo $jsRoot;?>misc/sorttable.js" type="text/javascript"></script>
|
||||
<script language='javascript'>
|
||||
function selectProject(projectID)
|
||||
{
|
||||
link = createLink('project', 'browse', 'projectID=' + projectID);
|
||||
location.href=link;
|
||||
}
|
||||
</script>
|
||||
<div class="yui-d0 yui-t3">
|
||||
<div class="yui-b">
|
||||
<table class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->selectProject;?>
|
||||
<?php echo html::select('projectID', $projects, $project->id, 'onchange="selectProject(this.value);" style="width:200px"');?>
|
||||
</caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->name;?></th>
|
||||
<td><?php echo $project->name;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->code;?></th>
|
||||
<td><?php echo $project->code;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->begin;?></th>
|
||||
<td><?php echo $project->begin;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->end;?></th>
|
||||
<td><?php echo $project->end;?></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->status;?></th>
|
||||
<td><?php echo $project->status;?></td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td colspan='2' class='a-right'>
|
||||
<?php
|
||||
if(common::hasPriv('project', 'edit')) echo html::a($this->createLink('project', 'edit', "projectID=$project->id"), $lang->project->edit);
|
||||
if(common::hasPriv('project', 'delete')) echo html::a($this->createLink('project', 'delete', "projectID=$project->id"), $lang->project->delete, 'hiddenwin');
|
||||
//echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=product"), $lang->tree->manage);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->products;?>
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php foreach($products as $productID => $productName) echo html::a($this->createLink('product', 'browse', "productID=$productID"), $productName) . '<br />';?>
|
||||
<div class='a-right'>
|
||||
<?php
|
||||
if(common::hasPriv('project', 'manageproducts')) echo html::a($this->createLink('project', 'manageproducts', "projectID=$project->id"), $lang->project->manageProducts);
|
||||
if(common::hasPriv('project', 'linkstory')) echo html::a($this->createLink('project', 'linkstory', "projectID=$project->id"), $lang->project->linkStory);
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->childProjects;?>
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php foreach($childProjects as $childProjectID => $childProjectName) echo html::a($this->createLink('project', 'browse', "projectID=$childProjectID"), $childProjectName) . '<br />';?>
|
||||
<div class='a-right'>
|
||||
<?php echo html::a($this->createLink('project', 'managechilds', "projectID=$project->id"), $lang->project->manageChilds) . '<br />';?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>-->
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->project->team . $lang->colon . $project->team; ?>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->team->account;?></th>
|
||||
<th><?php echo $lang->team->role;?></th>
|
||||
<th><?php echo $lang->team->joinDate;?></th>
|
||||
<th><?php echo $lang->team->workingHour;?></th>
|
||||
<?php if(common::hasPriv('project', 'unlinkmember')) echo "<th>$lang->actions</th>";?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($teamMembers as $member):?>
|
||||
<tr class='a-center'>
|
||||
<td>
|
||||
<?php
|
||||
if(common::hasPriv('user', 'view')) echo html::a($this->createLink('user', 'view', "account=$member->account"), $member->realname);
|
||||
else echo $member->realname;
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $member->role;?></td>
|
||||
<td><?php echo substr($member->joinDate, 2);?></td>
|
||||
<td><?php echo $member->workingHour;?></td>
|
||||
<?php if(common::hasPriv('project', 'unlinkmember')) echo "<td>" . html::a($this->createLink('project', 'unlinkmember', "projectID=$project->id&account=$member->account"), $lang->project->unlinkMember, 'hiddenwin') . '</td>';?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('project', 'managemembers')) echo html::a($this->createLink('project', 'managemembers', "projectID=$project->id"), $lang->project->manageMembers) . '<br />';?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<div id='tabbar' class='yui-d0'>
|
||||
<ul>
|
||||
<?php
|
||||
echo "<li><nobr>$project->name</nobr></li>";
|
||||
echo "<li id='tasktab'><nobr>" . html::a($this->createLink('project', 'browse', "projectID=$project->id&tabID=task"), $lang->project->tasks) . "</nobr></li>";
|
||||
echo "<li id='storytab'><nobr>" . html::a($this->createLink('project', 'browse', "projectID=$project->id&tabID=story"), $lang->project->stories) . "</nobr></li>";
|
||||
//echo "<li id='bugtab'><nobr>" . html::a($this->createLink('project', 'browse', "projectID=$project->id&tabID=bug"), $lang->project->bugs) . "</nobr></li>";
|
||||
//echo "<li id='burntab'><nobr>" . html::a($this->createLink('project', 'browse', "projectID=$project->id&tabID=burn"), $lang->project->burndown) . "</nobr></li>";
|
||||
echo <<<EOT
|
||||
<script language="Javascript">
|
||||
$("#{$tabID}tab").addClass('active');
|
||||
</script>
|
||||
EOT;
|
||||
?>
|
||||
</ul>
|
||||
<?php if($tabID == 'task' and common::hasPriv('task', 'create')) :?>
|
||||
<div><?php echo html::a($this->createLink('task', 'create', "project=$project->id"), $lang->task->create);?></div>
|
||||
<?php elseif($tabID == 'story' and common::hasPriv('project', 'linkstory')) :?>
|
||||
<div><?php echo html::a($this->createLink('project', 'linkstory', "project=$project->id"), $lang->project->linkStory);?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php include $tabID . '.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -90,7 +90,7 @@
|
||||
?>
|
||||
<tr id='<?php echo $task->id;?>' class='a-center child-of-node-<?php echo $groupKey;?>'>
|
||||
<td class='<?php echo $groupClass;?>'></td>
|
||||
<td class='a-left'> <?php echo $task->id . $lang->colon; if(common::hasPriv('task', 'view')) echo html::a($this->createLink('task', 'view', "task=$task->id"), $task->name); else echo $task->name;?></td>
|
||||
<td class='a-left'> <?php echo $task->id . $lang->colon; if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name;?></td>
|
||||
<td><span class='<?php echo 'pri' . $task->pri?>'><?php echo $task->pri;?></span></td>
|
||||
<td <?php echo $assignedToClass;?>><?php echo $task->assignedToRealName;?></td>
|
||||
<td><?php echo $users[$task->finishedBy];?></td>
|
||||
@@ -101,8 +101,8 @@
|
||||
<td class=<?php if(isset($task->delay)) echo 'delayed';?>><?php if(substr($task->deadline, 0, 4) > 0) echo $task->deadline;?></td>
|
||||
<td class=<?php echo $task->status;?> ><?php echo $lang->task->statusList[$task->status];?></td>
|
||||
<td>
|
||||
<?php if(common::hasPriv('task', 'edit')) echo html::a($this->createLink('task', 'edit', "taskid=$task->id"), $lang->edit);?>
|
||||
<?php if(common::hasPriv('task', 'delete')) echo html::a($this->createLink('task', 'delete', "projectID=$task->project&taskid=$task->id"), $lang->delete, 'hiddenwin');?>
|
||||
<?php common::printIcon('task', 'edit', "taskid=$task->id", '', 'list');?>
|
||||
<?php common::printIcon('task', 'delete', "projectID=$task->project&taskid=$task->id", '', 'list', '', 'hiddenwin');?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
||||
@@ -112,10 +112,10 @@ var browseType = '<?php echo $browseType;?>';
|
||||
<td><?php echo $task->left;?></td>
|
||||
<td class='a-left' title="<?php echo $task->storyTitle?>">
|
||||
<?php
|
||||
$story = '';
|
||||
if($task->storyID and common::hasPriv('story', 'view')) $story = html::a($this->createLink('story', 'view', "storyid=$task->storyID"), $task->storyTitle);
|
||||
if($task->storyID and !common::hasPriv('story', 'view')) $story = $task->storyTitle;
|
||||
echo $story;
|
||||
if($task->storyID)
|
||||
{
|
||||
if(!common::printLink('story', 'view', "storyid=$task->storyID", $task->storyTitle)) print $task->storyTitle;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class='a-right'>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<tr class='a-center'>
|
||||
<td>
|
||||
<?php
|
||||
common::hasPriv('user', 'view') ? print(html::a($this->createLink('user', 'view', "account=$member->account"), $member->realname)) : print($member->realname);
|
||||
if(!common::printLink('user', 'view', "account=$member->account", $member->realname)) print $member->realname;
|
||||
$memberHours = $member->days * $member->hours;
|
||||
$totalHours += $memberHours;
|
||||
?>
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The import view file of task module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package task
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table class='table-1 fixed tablesorter'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->task->id;?></th>
|
||||
<th><?php echo $lang->task->pri;?></th>
|
||||
<th><?php echo $lang->task->name;?></th>
|
||||
<th><?php echo $lang->task->assignedTo;?></th>
|
||||
<th><?php echo $lang->task->estimate;?></th>
|
||||
<th><?php echo $lang->task->consumed;?></th>
|
||||
<th><?php echo $lang->task->left;?></th>
|
||||
<th><?php echo $lang->task->type;?></th>
|
||||
<th><?php echo $lang->task->status;?></th>
|
||||
<th class='w-p30'><?php echo $lang->task->story;?></th>
|
||||
<th class='w-100px'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($tasks as $task):?>
|
||||
<?php $class = $task->assignedTo == $app->user->account ? 'style=color:red' : '';?>
|
||||
<tr class='a-center'>
|
||||
<td><?php if(common::hasPriv('task', 'view')) echo html::a($this->createLink('task', 'view', "task=$task->id"), sprintf('%03d', $task->id)); else printf('%03d', $task->id);?></td>
|
||||
<td><?php echo $task->pri;?></td>
|
||||
<td class='a-left nobr'><?php echo $task->name;?></td>
|
||||
<td <?php echo $class;?>><?php echo $task->assignedToRealName;?></td>
|
||||
<td><?php echo $task->estimate;?></td>
|
||||
<td><?php echo $task->consumed;?></td>
|
||||
<td><?php echo $task->left;?></td>
|
||||
<td><?php echo $lang->task->typeList[$task->type];?></td>
|
||||
<td class=<?php echo $task->status;?> ><?php echo $lang->task->statusList->{$task->status};?></td>
|
||||
<td class='a-left nobr'>
|
||||
<?php
|
||||
if($task->storyID)
|
||||
{
|
||||
if(common::hasPriv('story', 'view')) echo html::a($this->createLink('story', 'view', "storyid=$task->storyID"), $task->storyTitle);
|
||||
else echo $task->storyTitle;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user