* Adjust code.
This commit is contained in:
@@ -1702,7 +1702,7 @@ EOD;
|
||||
|
||||
/* If is the program admin, have all program privs. */
|
||||
$inProject = isset($lang->navGroup->$module) && $lang->navGroup->$module == 'project';
|
||||
if($inProject && strpos(",{$app->user->rights['projects']},", ",{$app->session->PRJ},") !== false) return true;
|
||||
if($inProject && $app->session->PRJ && strpos(",{$app->user->rights['projects']},", ",{$app->session->PRJ},") !== false) return true;
|
||||
|
||||
/* If not super admin, check the rights. */
|
||||
$rights = $app->user->rights['rights'];
|
||||
|
||||
@@ -932,7 +932,7 @@ class programModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the program to which the project belongs.
|
||||
* Get the top program which the project belongs to.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
@@ -941,19 +941,14 @@ class programModel extends model
|
||||
public function getTopProgramID($projectID)
|
||||
{
|
||||
if(empty($projectID)) return 0;
|
||||
$program = $this->getPGMByID($projectID);
|
||||
$project = $this->getPRJByID($projectID);
|
||||
|
||||
if($project->parent == 0) return 0;
|
||||
|
||||
$programID = 0;
|
||||
if($program->parent > 0)
|
||||
{
|
||||
$path = explode(',', $program->path);
|
||||
$path = array_filter($path);
|
||||
$programID = current($path);
|
||||
}
|
||||
elseif($program->parent == 0)
|
||||
{
|
||||
$programID = $program->id;
|
||||
}
|
||||
$path = explode(',', $project->path);
|
||||
$path = array_filter($path);
|
||||
$programID = current($path);
|
||||
|
||||
return $programID;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<?php foreach($lang->program->PGMFeatureBar as $key => $label):?>
|
||||
<?php $active = $status == $key ? 'btn-active-text' : '';?>
|
||||
<?php $label = "<span class='text'>$label</span>";?>
|
||||
<?php if($status == $key) $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";?>
|
||||
<?php echo html::a(inlink('pgmbrowse', "status=$key&orderBy=$orderBy"), $label, '', "class='btn btn-link $active'");?>
|
||||
<?php endforeach;?>
|
||||
<?php echo html::checkbox('showClosed', array('1' => $lang->program->PGMShowClosed), '', $this->cookie->showClosed ? 'checked=checked' : '');?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php $canOrder = (common::hasPriv('program', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
|
||||
<form class='main-table' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false'>
|
||||
<table class='table has-sort-head table-fixed table-nested' id='programList'>
|
||||
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<?php $vars = "status=$status&orderBy=%s";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='table-nest-title'>
|
||||
@@ -25,8 +25,7 @@
|
||||
if($program->type == 'program')
|
||||
{
|
||||
$trAttrs .= " data-nested='true'";
|
||||
if($program->parent == '0') $trClass .= ' is-top-level table-nest-child-hide';
|
||||
else $trClass .= ' table-nest-hide';
|
||||
$trClass .= $program->parent == '0' ? ' is-top-level table-nest-child-hide' : ' table-nest-hide';
|
||||
}
|
||||
|
||||
if($program->parent and isset($programs[$program->parent]))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<table class='table table-form'>
|
||||
<caption class='strong'><?php echo $lang->upgrade->program;?></caption>
|
||||
<?php if($programs):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->upgrade->existPGM;?></th>
|
||||
<td>
|
||||
@@ -14,6 +15,8 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($projects):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->upgrade->existPRJ;?></th>
|
||||
<td>
|
||||
@@ -28,6 +31,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='pgmParams'>
|
||||
<th class='w-90px'><?php echo $lang->program->PGMName;?></th>
|
||||
<td class='required'><?php echo html::input("PGMName", isset($programName) ? $programName : '', "class='form-control'");?></td>
|
||||
|
||||
Reference in New Issue
Block a user