Skip to content

Commit

Permalink
supression des listes des utilisateurs les missions archivees
Browse files Browse the repository at this point in the history
  • Loading branch information
willkoua committed Jun 14, 2016
1 parent e98c090 commit 42eb0ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Controller/ProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function ($o) {
'Users'
],

'conditions' => ['project_id' => $id],
'conditions' => ['project_id' => $id, 'archived' => false],
'fields' => [
'Missions.id', 'Missions.name', 'Missions.session',
'Missions.length', 'Users.firstName', 'Users.lastName',
Expand Down
37 changes: 18 additions & 19 deletions src/Template/Missions/view.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
$this->Html->addCrumb(__('Projects'), '/Projects');
$this->Html->addCrumb($mission->project->getName(), '/projects/view/' . $mission->project->id);
$this->Html->addCrumb($mission->getName());

echo $this->Html->getCrumbList(); ?>
</div>
</div>
Expand Down Expand Up @@ -79,27 +78,27 @@
</br>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h3 class="header-title"><?= __('Skills'); ?></h3>
<div>
<?= $Parsedown->text($mission->getCompetence()); ?>
</div>
<h3 class="header-title"><?= __('Skills'); ?></h3>
<div>
<?= $Parsedown->text($mission->getCompetence()); ?>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<?php if($user): ?>
<?php $pendingApplication = $user->pendingApplication($mission->id); ?>
<?php if ($pendingApplication != null): ?>
<a href="<?= $this->Url->build(['controller' => 'Applications', 'action' => 'editArchived', $pendingApplication->id]); ?>">
<h2 class="btn btn-danger pull-right"><?= __('I quit this mission!'); ?></h2></a>
<?php else: ?>
<a href="<?= $this->Url->build(['controller' => 'Missions', 'action' => 'apply', $mission->getId()]); ?>">
<h2 class="btn btn-danger pull-right"><?= __('I accept the mission!'); ?></h2></a>
<?php endif; ?>
<?php elseif(!$isMentor && $mission->getRemainingPlaces() > 0): ?>
<a href="<?= $this->Url->build(['controller' => 'Missions', 'action' => 'apply', $mission->getId()]); ?>">
<h2 class="btn btn-danger pull-right"><?= __('I accept the mission!'); ?></h2></a>
<?php endif; ?>
<?php if($user): ?>
<?php $pendingApplication = $user->pendingApplication($mission->id); ?>
<?php if ($pendingApplication != null): ?>
<a href="<?= $this->Url->build(['controller' => 'Applications', 'action' => 'editArchived', $pendingApplication->id]); ?>">
<h2 class="btn btn-danger pull-right"><?= __('I quit this mission!'); ?></h2></a>
<?php else: ?>
<a href="<?= $this->Url->build(['controller' => 'Missions', 'action' => 'apply', $mission->getId()]); ?>">
<h2 class="btn btn-danger pull-right"><?= __('I accept the mission!'); ?></h2></a>
<?php endif; ?>
<?php elseif(!$isMentor && $mission->getRemainingPlaces() > 0): ?>
<a href="<?= $this->Url->build(['controller' => 'Missions', 'action' => 'apply', $mission->getId()]); ?>">
<h2 class="btn btn-danger pull-right"><?= __('I accept the mission!'); ?></h2></a>
<?php endif; ?>
</div>
</div>
</div>
Expand Down Expand Up @@ -240,4 +239,4 @@ if ($user && $user->hasPermissionName(['edit_mission', 'edit_missions'])) {
} else {
echo $this->Html->script(['initial.min', 'missions/view.js'], ['block' => 'scriptBottom']);
}
?>
?>

0 comments on commit 42eb0ab

Please sign in to comment.