* Fix code style.
This commit is contained in:
@@ -51,18 +51,14 @@ class program extends control
|
||||
|
||||
if($programType === 'bygrid')
|
||||
{
|
||||
$projectList = $this->project->getProjectStats($status == 'byproduct' ? 'all' : $status, 0, 0, 30, $orderBy, $pager, 'program');
|
||||
foreach($projectList as $projectID => $project)
|
||||
{
|
||||
$project->teamCount = count($this->project->getTeamMembers($project->id));
|
||||
}
|
||||
$programs = $this->program->getProgramStats('all', 20, $orderBy, $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
$projectList = $this->program->getList($status, $orderBy, $pager);
|
||||
$programs = $this->program->getList($status, $orderBy, $pager);
|
||||
}
|
||||
|
||||
$this->view->projectList = $projectList;
|
||||
$this->view->programs = $programs;
|
||||
$this->view->status = $status;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
@@ -13,16 +13,16 @@
|
||||
#cards .panel-actions .dropdown-menu > li > a {padding-left: 5px; text-align: left;}
|
||||
#cards .panel-actions .dropdown-menu > li > a > i {opacity: .5; display: inline-block; margin-right: 4px; width: 18px; text-align: center;}
|
||||
#cards .panel-actions .dropdown-menu > li > a:hover > i {opacity: 1;}
|
||||
#cards .project-type-label {padding: 1px 2px;}
|
||||
#cards .project-name {font-size: 16px; font-weight: normal; display: inline-block; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
|
||||
#cards .project-infos {font-size: 12px;}
|
||||
#cards .project-infos > span {display: inline-block; line-height: 12px;}
|
||||
#cards .project-infos > span > .icon {font-size: 12px; display: inline-block; position: relative; top: -1px}
|
||||
#cards .project-infos > span + span {margin-left: 15px;}
|
||||
#cards .project-detail {position: absolute; bottom: 16px; left: 16px; right: 16px; font-size: 12px;}
|
||||
#cards .project-detail > p {margin-bottom: 8px;}
|
||||
#cards .project-detail .progress {height: 4px;}
|
||||
#cards .project-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
|
||||
#cards .program-type-label {padding: 1px 2px;}
|
||||
#cards .program-name {font-size: 16px; font-weight: normal; display: inline-block; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
|
||||
#cards .program-infos {font-size: 12px;}
|
||||
#cards .program-infos > span {display: inline-block; line-height: 12px;}
|
||||
#cards .program-infos > span > .icon {font-size: 12px; display: inline-block; position: relative; top: -1px}
|
||||
#cards .program-infos > span + span {margin-left: 15px;}
|
||||
#cards .program-detail {position: absolute; bottom: 16px; left: 16px; right: 16px; font-size: 12px;}
|
||||
#cards .program-detail > p {margin-bottom: 8px;}
|
||||
#cards .program-detail .progress {height: 4px;}
|
||||
#cards .program-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
|
||||
#cards .pager {margin: 0; float: right;}
|
||||
#cards .pager .btn{border: none}
|
||||
|
||||
|
||||
@@ -55,6 +55,52 @@ class programModel extends model
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get program stats.
|
||||
*
|
||||
* @param string $status
|
||||
* @param int $itemCounts
|
||||
* @param string $orderBy
|
||||
* @param int $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProgramStats($status = 'undone', $itemCounts = 30, $orderBy = 'order_desc', $pager = null)
|
||||
{
|
||||
/* Init vars. */
|
||||
$this->loadModel('project');
|
||||
$programs = $this->getList($status, $orderBy, $pager);
|
||||
if(empty($programs)) return array();
|
||||
|
||||
$programIdList = array_keys($programs);
|
||||
$programs = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('id')->in($programIdList)
|
||||
->orderBy($orderBy)
|
||||
->limit($itemCounts)
|
||||
->fetchAll('id');
|
||||
|
||||
$teams = $this->dao->select('root, count(*) as count')->from(TABLE_TEAM)
|
||||
->where('root')->in($programIdList)
|
||||
->groupBy('root')
|
||||
->fetchAll('root');
|
||||
|
||||
$estimates = $this->dao->select('program, sum(estimate) as estimate')->from(TABLE_TASK)
|
||||
->where('program')->in($programIdList)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('parent')->lt(1)
|
||||
->groupBy('program')
|
||||
->fetchAll('program');
|
||||
|
||||
foreach($programs as $programID => $program)
|
||||
{
|
||||
$program->projects = $this->project->getProjectStats($status, 0, 0, $itemCounts, 'id_desc', $pager, $programID);
|
||||
$program->teamCount = isset($teams[$programID]) ? $teams[$programID]->count : 0;
|
||||
$program->estimate = isset($estimates[$programID]) ? $estimates[$programID]->estimate : 0;
|
||||
}
|
||||
|
||||
return $programs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show accessDenied response.
|
||||
*
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<?php if(empty($projectList)):?>
|
||||
<?php if(empty($programs)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->program->noProgram;?></span> <?php common::printLink('program', 'createguide', '', "<i class='icon icon-plus'></i> " . $lang->program->create, '', "class='btn btn-info' data-toggle=modal");?></p>
|
||||
</div>
|
||||
|
||||
@@ -1,45 +1,47 @@
|
||||
<style>#mainMenu{padding-left: 10px; padding-right: 10px;}</style>
|
||||
<div class='row cell' id='cards'>
|
||||
<?php foreach ($projectList as $projectID => $project):?>
|
||||
<div class='col' data-id='<?php echo $projectID?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('program', 'index', "projectID=$project->id");?>'>
|
||||
<?php foreach ($programs as $programID => $program):?>
|
||||
<div class='col' data-id='<?php echo $programID?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('program', 'index', "programID=$program->id");?>'>
|
||||
<div class='panel-heading'>
|
||||
<strong class='project-name' title='<?php echo $project->name;?>'><?php echo $project->name;?></strong>
|
||||
<?php if($project->template === 'cmmi'): ?>
|
||||
<span class='project-type-label label label-warning label-outline'><?php echo $lang->program->cmmi; ?></span>
|
||||
<strong class='program-name' title='<?php echo $program->name;?>'><?php echo $program->name;?></strong>
|
||||
<?php if($program->template === 'cmmi'): ?>
|
||||
<span class='program-type-label label label-warning label-outline'><?php echo $lang->program->cmmi; ?></span>
|
||||
<?php else: ?>
|
||||
<span class='project-type-label label label-info label-outline'><?php echo $lang->program->scrum; ?></span>
|
||||
<span class='program-type-label label label-info label-outline'><?php echo $lang->program->scrum; ?></span>
|
||||
<?php endif; ?>
|
||||
<nav class='panel-actions nav nav-default'>
|
||||
<li class='dropdown'>
|
||||
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<li><?php common::printIcon('program', 'group', "projectID=$project->id", $project, 'button', 'group');?></li>
|
||||
<li><?php common::printIcon('program', 'manageMembers', "projectID=$project->id", $project, 'button', 'persons');?></li>
|
||||
<li><?php common::printicon('program', 'activate', "projectid=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i> " . $lang->edit, '', "");?></li>
|
||||
<li><?php common::printIcon('program', 'start', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'suspend', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("project", "delete", "projectID=$project->id"), "<i class='icon-trash'></i> " . $lang->delete, 'hiddenwin', "");?></li>
|
||||
<li><?php common::printIcon('program', 'group', "programID=$program->id", $program, 'button', 'group');?></li>
|
||||
<li><?php common::printIcon('program', 'manageMembers', "programID=$program->id", $program, 'button', 'persons');?></li>
|
||||
<li><?php common::printicon('program', 'activate', "programid=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "programID=$program->id"), "<i class='icon-edit'></i> " . $lang->edit, '', "");?></li>
|
||||
<li><?php common::printIcon('program', 'start', "programID=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'suspend', "programID=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'close', "programID=$program->id", $program, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("program", "delete", "programID=$program->id"), "<i class='icon-trash'></i> " . $lang->delete, 'hiddenwin', "");?></li>
|
||||
</ul>
|
||||
</li>
|
||||
</nav>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<div class='project-infos'>
|
||||
<span><i class='icon icon-group'></i> <?php printf($lang->program->membersUnit, $project->teamCount); ?></span>
|
||||
<span><i class='icon icon-clock'></i> <?php printf($lang->program->hoursUnit, $project->hours->totalEstimate); ?></span>
|
||||
<span><i class='icon icon-cost'></i> <?php echo $project->budget . '' . zget($lang->program->unitList, $project->budgetUnit);?></span>
|
||||
<div class='program-infos'>
|
||||
<span><i class='icon icon-group'></i> <?php printf($lang->program->membersUnit, $program->teamCount); ?></span>
|
||||
<span><i class='icon icon-clock'></i> <?php printf($lang->program->hoursUnit, $program->estimate); ?></span>
|
||||
<span><i class='icon icon-cost'></i> <?php echo $program->budget . '' . zget($lang->program->unitList, $program->budgetUnit);?></span>
|
||||
</div>
|
||||
<?php //if($project->template === 'cmmi'): ?>
|
||||
<div class='project-detail project-stages'>
|
||||
<!--p class='text-muted'><?php echo $lang->program->ongoingStage; ?></p-->
|
||||
<div class='label label-outline'><?php echo zget($lang->project->statusList, $project->status);?></div>
|
||||
<?php if($program->template === 'cmmi'): ?>
|
||||
<div class='program-detail program-stages'>
|
||||
<p class='text-muted'><?php echo $lang->program->ongoingStage; ?></p>
|
||||
<div class='label label-outline'><?php echo zget($lang->project->statusList, $program->status);?></div>
|
||||
</div>
|
||||
<?php //else: ?>
|
||||
<!--div class='project-detail project-iteration'>
|
||||
<?php else: ?>
|
||||
<?php $project = $program->projects ? current($program->projects) : '';?>
|
||||
<div class='program-detail program-iteration'>
|
||||
<p class='text-muted'><?php echo $lang->program->lastIteration; ?></p>
|
||||
<?php if($project):?>
|
||||
<div class='row'>
|
||||
<div class='col-xs-5'><?php echo $project->name; ?></div>
|
||||
<div class='col-xs-7'>
|
||||
@@ -50,8 +52,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div -->
|
||||
<?php //endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
|
||||
<?php $canOrder = (common::hasPriv('program', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
|
||||
<form class='main-table' id='programForm' method='post' data-ride='table'>
|
||||
<table class='table has-sort-head table-fixed' id='programList'>
|
||||
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
@@ -21,30 +21,30 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='sortable' id='programTableList'>
|
||||
<?php foreach($projectList as $project):?>
|
||||
<tr data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
|
||||
<?php foreach($programs as $program):?>
|
||||
<tr data-id='<?php echo $program->id ?>' data-order='<?php echo $program->order ?>'>
|
||||
<td class='c-id'>
|
||||
<?php printf('%03d', $project->id);?>
|
||||
<?php printf('%03d', $program->id);?>
|
||||
</td>
|
||||
<td class='text-left'><?php echo $project->code;?></td>
|
||||
<td class='text-left pgm-title' title='<?php echo $project->name?>'>
|
||||
<?php echo html::a(inlink('index', "programID=$project->id"), $project->name);?>
|
||||
<td class='text-left'><?php echo $program->code;?></td>
|
||||
<td class='text-left pgm-title' title='<?php echo $program->name?>'>
|
||||
<?php echo html::a(inlink('index', "programID=$program->id"), $program->name);?>
|
||||
</td>
|
||||
<td class='c-status'><span class="status-project status-<?php echo $project->status?>"><?php echo zget($lang->project->statusList, $project->status, '');?></span></td>
|
||||
<td class='text-center'><?php echo $project->begin;?></td>
|
||||
<td class='text-center'><?php echo $project->end;?></td>
|
||||
<td class='text-left'><?php echo $project->budget . ' ' . zget($lang->program->unitList, $project->budgetUnit);?></td>
|
||||
<td><?php echo zget($users, $project->PM);?></td>
|
||||
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
|
||||
<td class='text-center'><?php echo $program->begin;?></td>
|
||||
<td class='text-center'><?php echo $program->end;?></td>
|
||||
<td class='text-left'><?php echo $program->budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?></td>
|
||||
<td><?php echo zget($users, $program->PM);?></td>
|
||||
<td class='text-center c-actions'>
|
||||
<?php common::printIcon('program', 'group', "projectID=$project->id", $project, 'list', 'group');?>
|
||||
<?php common::printIcon('program', 'manageMembers', "projectID=$project->id", $project, 'list', 'persons');?>
|
||||
<?php common::printIcon('program', 'start', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'activate', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'suspend', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
|
||||
<?php common::printIcon('program', 'create', "template=&projectID=$project->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->children);?>
|
||||
<?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("program", "delete", "projectID=$project->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
|
||||
<?php common::printIcon('program', 'group', "programID=$program->id", $program, 'list', 'group');?>
|
||||
<?php common::printIcon('program', 'manageMembers', "programID=$program->id", $program, 'list', 'persons');?>
|
||||
<?php common::printIcon('program', 'start', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'activate', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'suspend', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'close', "programID=$program->id", $program, 'list', '', '', 'iframe', true);?>
|
||||
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
|
||||
<?php common::printIcon('program', 'create', "template=&programID=$program->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->children);?>
|
||||
<?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("program", "delete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
|
||||
</td>
|
||||
<?php if($canOrder):?>
|
||||
<td class='sort-handler'><i class="icon icon-move"></i></td>
|
||||
|
||||
Reference in New Issue
Block a user