Commit 9bc35dd6 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

#16769

URL perso pour les guides vac et perm
parent b99bf77b
......@@ -5,6 +5,7 @@ namespace Application\Controller;
use Application\Acl\Role;
use Application\Provider\Privilege\Privileges;
use Application\Service\Traits\IntervenantServiceAwareTrait;
use Application\Service\Traits\ParametresServiceAwareTrait;
use UnicaenAuth\Service\Traits\UserContextServiceAwareTrait;
use Zend\View\Model\ViewModel;
......@@ -17,6 +18,7 @@ class IndexController extends AbstractController
use \Application\Service\Traits\AnneeServiceAwareTrait;
use IntervenantServiceAwareTrait;
use UserContextServiceAwareTrait;
use ParametresServiceAwareTrait;
......@@ -28,9 +30,15 @@ class IndexController extends AbstractController
{
$role = $this->getServiceContext()->getSelectedIdentityRole();
$documentation = [
'vacataires' => $this->getServiceParametres()->get('doc-intervenant-vacataires'),
'permanents' => $this->getServiceParametres()->get('doc-intervenant-permanents'),
];
$view = new ViewModel([
'annee' => $this->getServiceContext()->getAnnee(),
'context' => $this->getServiceContext(),
'annee' => $this->getServiceContext()->getAnnee(),
'documentation' => $documentation,
'context' => $this->getServiceContext(),
]);
if ($role && $this->isAllowed(Privileges::getResourceId(Privileges::INDICATEUR_VISUALISATION))) {
......@@ -54,7 +62,7 @@ class IndexController extends AbstractController
$role = $this->getServiceContext()->getSelectedIdentityRole();
if ($role instanceof Role && $role->getIntervenant()) {
$intervenant = $this->getServiceIntervenant()->getBySourceCode($role->getIntervenant()->getSourceCode());
if ($intervenant){
if ($intervenant) {
$this->getServiceUserContext()->setNextSelectedIdentityRole($intervenant->getStatut()->getRoleId());
}
}
......
......@@ -166,6 +166,22 @@ class ParametresForm extends AbstractForm
],
]);
$this->add([
'name' => 'doc-intervenant-vacataires',
'type' => 'Text',
'options' => [
'label' => 'Vacataires',
],
]);
$this->add([
'name' => 'doc-intervenant-permanents',
'type' => 'Text',
'options' => [
'label' => 'Permanents',
],
]);
$this->add([
'type' => 'Select',
'name' => 'oseuser',
......
<?php
/* @var $this Application\View\Renderer\PhpRenderer */
/* @var $context ContextService */
/* @var $documentation string[] */
use Application\Provider\Privilege\Privileges;
use Application\Service\ContextService;
......@@ -35,15 +35,17 @@ $onlyIntervenant = $intervenant && (null == $context->getSelectedIdentityRole()-
} else {
echo $this->tag('div')->html($this->feuillederoute($intervenant)->renderCurrentBtn());
/* Guide à télécharger... */
$guideType = $intervenant->getStatut()->estVacataire() ? 'guide_ose_vacataire' : 'guide_ose_permanent';
$guideUrl = $this->basePath() . '/doc/intervenant/' . $guideType . '.pdf';
echo $this->tag('div', ['class' => 'alert alert-info', 'style' => 'margin-top:1em', 'role' => 'alert'])->html(
'Un guide d\'utilisation de OSE vous est proposé. Vous pouvez le télécharger en suivant le lien ci-contre : '
. $this->tag('a', ['href' => $guideUrl])->html(
$this->tag('span', ['class' => 'glyphicon glyphicon-book'])->openClose() . ' Guide d\'utilisation'
)
);
$guideType = $intervenant->getStatut()->estVacataire() ? 'vacataires' : 'permanents';
if (! empty($documentation[$guideType])){
echo $this->tag('div', ['class' => 'alert alert-info', 'style' => 'margin-top:1em', 'role' => 'alert'])->html(
'Un guide d\'utilisation de OSE vous est proposé. Vous pouvez le télécharger en suivant le lien ci-contre : '
. $this->tag('a', ['target' => '__blank', 'href' => $documentation[$guideType]])->html(
$this->tag('span', ['class' => 'glyphicon glyphicon-book'])->openClose() . ' Guide d\'utilisation'
)
);
}
}
} elseif ($context->getStructure()) {
......
......@@ -141,6 +141,22 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Liens vers les documentations</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<?= $this->formControlGroup($form->get('doc-intervenant-vacataires')); ?>
</div>
<div class="col-md-6">
<?= $this->formControlGroup($form->get('doc-intervenant-permanents')); ?>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Etats de paiement et exports Winpaie</h3>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment