Show only accessible projects in header selection

This commit is contained in:
Eike Foken
2011-09-16 15:16:03 +02:00
parent 1fcd8794be
commit 875f2f754b

View File

@@ -51,7 +51,12 @@
<option disabled="disabled" selected="selected"><strong><?=_('Select a project');?></strong></option> <option disabled="disabled" selected="selected"><strong><?=_('Select a project');?></strong></option>
<?php <?php
endif; endif;
foreach ($this->project->getAll() as $project): if ($this->access->isAdmin()) {
$theProjects = $this->project->getAll();
} else {
$theProjects = $this->project->getAccessible();
}
foreach ($theProjects as $project):
?> ?>
<option title="<?=$project['name']?>" value="<?=site_url('projects/detail/' . $project['id']) . '?active_project=' . $project['id'];?>"<?=($active_project['id'] == $project['id']) ? ' selected' : '';?>><?=$project['mediumname'];?></option> <option title="<?=$project['name']?>" value="<?=site_url('projects/detail/' . $project['id']) . '?active_project=' . $project['id'];?>"<?=($active_project['id'] == $project['id']) ? ' selected' : '';?>><?=$project['mediumname'];?></option>
<?php <?php