Skip to content
Snippets Groups Projects
Commit 791d29f5 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Annotation des headTitle et des @see

parent 8ef660e7
Branches
Tags
No related merge requests found
Showing
with 43 additions and 93 deletions
......@@ -2,11 +2,9 @@
namespace Formation\Controller;
use Application\Form\ModifierLibelle\ModifierLibelleFormAwareTrait;
use Application\Service\ParcoursDeFormation\ParcoursDeFormationServiceAwareTrait;
use Formation\Entity\Db\Formation;
use Formation\Form\Formation\FormationFormAwareTrait;
use Formation\Form\FormationGroupe\FormationGroupeFormAwareTrait;
use Formation\Service\Formation\FormationServiceAwareTrait;
use Formation\Service\FormationGroupe\FormationGroupeServiceAwareTrait;
use Formation\Service\FormationTheme\FormationThemeServiceAwareTrait;
......@@ -22,14 +20,13 @@ class FormationController extends AbstractActionController
use ParcoursDeFormationServiceAwareTrait;
use FormationFormAwareTrait;
use FormationGroupeFormAwareTrait;
use ModifierLibelleFormAwareTrait;
public function indexAction()
{
$formations = $this->getFormationService()->getFormations('libelle');
$groupes = $this->getFormationGroupeService()->getFormationsGroupes();
$themes = $this->getFormationThemeService()->getFormationsThemes();
return new ViewModel([
'formations' => $formations,
'groupes' => $groupes,
......
......@@ -2,9 +2,7 @@
namespace Formation\Controller;
use Application\Form\ModifierLibelle\ModifierLibelleForm;
use Formation\Form\Formation\FormationForm;
use Formation\Form\FormationGroupe\FormationGroupeForm;
use Formation\Service\Formation\FormationService;
use Formation\Service\FormationGroupe\FormationGroupeService;
use Formation\Service\FormationTheme\FormationThemeService;
......@@ -26,12 +24,8 @@ class FormationControllerFactory
/**
* @var FormationForm $formationForm
* @var FormationGroupeForm $formationGroupeForm
* @var ModifierLibelleForm $modifierLibelleForm
*/
$formationForm = $container->get('FormElementManager')->get(FormationForm::class);
$formationGroupeForm = $container->get('FormElementManager')->get(FormationGroupeForm::class);
$modifierLibelleForm = $container->get('FormElementManager')->get(ModifierLibelleForm::class);
/** @var FormationController $controller */
$controller = new FormationController();
......@@ -39,8 +33,6 @@ class FormationControllerFactory
$controller->setFormationGroupeService($formationGroupeService);
$controller->setFormationThemeService($formationThemeService);
$controller->setFormationForm($formationForm);
$controller->setFormationGroupeForm($formationGroupeForm);
$controller->setModifierLibelleForm($modifierLibelleForm);
return $controller;
}
......
......@@ -7,7 +7,6 @@
* @var FormationGroupe $groupe
*/
use Application\Controller\FormationController;
use Formation\Entity\Db\FormationGroupe;
?>
......
......@@ -33,13 +33,15 @@ $this->headTitle("Présences pour la formation : " . $instance->getInstanceCode(
<h2> Instance de la formation </h2>
</div>
<div class="pull-right">
<a href="<?php echo $this->url('formation-instance/afficher', ['formation-instance' => $instance->getId()], [], true); ?>"
<a <?php /** @see FormationInstanceController::afficherAction() */?>
href="<?php echo $this->url('formation-instance/afficher', ['formation-instance' => $instance->getId()], [], true); ?>"
class="btn btn-info action">
<span class="icon retour"></span>
Retour à l'instance de la formation
</a>
<br/>
<a href="<?php echo $this->url('formation/editer', ['formation' => $instance->getFormation()->getId()], [], true); ?>"
<a <?php /** @see FormationController::editerAction() */?>
href="<?php echo $this->url('formation/editer', ['formation' => $instance->getFormation()->getId()], [], true); ?>"
class="btn btn-info action">
<span class="icon retour-double"></span>
Retour à la formation associée
......@@ -155,7 +157,7 @@ $this->headTitle("Présences pour la formation : " . $instance->getInstanceCode(
// console.log('inscrit: ' + inscrit);
// console.log('journee: ' + journee);
<?php /** @see \Formation\Controller\FormationInstancePresenceController::togglePresenceAction() */ ?>
<?php /** @see FormationInstancePresenceController::togglePresenceAction() */ ?>
let url = "../toggle-presence/" + journee + "/" + inscrit;
$.ajax({
type: "POST",
......@@ -183,7 +185,7 @@ $this->headTitle("Présences pour la formation : " . $instance->getInstanceCode(
console.log('mode: ' + mode);
console.log('inscrit: ' + inscrit);
<?php /** @see \Formation\Controller\FormationInstancePresenceController::togglePresencesAction() */ ?>
<?php /** @see FormationInstancePresenceController::togglePresencesAction() */ ?>
let url = "../toggle-presences/" + mode + "/" + inscrit;
$.ajax({
type: "POST",
......
......@@ -13,6 +13,7 @@ use Formation\Provider\Privilege\FormationinstancejourneePrivileges;
use Formation\Provider\Privilege\FormationinstancepresencePrivileges;
/**
* @see FormationInstanceController::afficherAction()
* @var FormationInstance $instance
*/
......@@ -55,13 +56,15 @@ $canPresenceModifier = $this->isAllowed(FormationinstancepresencePrivileges::
<h2> Formation </h2>
</div>
<div class="pull-right">
<a href="<?php echo $this->url('formation/editer', ['formation' => $instance->getFormation()->getId()], [], true); ?>"
<a <?php /** @see FormationController::editerAction() */ ?>
href="<?php echo $this->url('formation/editer', ['formation' => $instance->getFormation()->getId()], [], true); ?>"
class="btn btn-info action">
<span class="icon retour"></span>
Retour à la formation associée
</a>
<br/>
<a href="<?php echo $this->url('formation', [], [], true); ?>"
<a <?php /** @see FormationController::indexAction() */ ?>
href="<?php echo $this->url('formation', [], [], true); ?>"
class="btn btn-info action">
<span class="icon retour-double"></span>
Retour à l'index des formations
......@@ -187,14 +190,14 @@ $canPresenceModifier = $this->isAllowed(FormationinstancepresencePrivileges::
</div>
<div class="pull-right">
<?php if ($canJourneeModifier): ?>
<?php /** @see \Formation\Controller\FormationInstanceJourneeController::ajouterJourneeAction() */?>
<?php /** @see FormationInstanceJourneeController::ajouterJourneeAction() */?>
<a href="<?php echo $this->url('formation-instance/ajouter-journee', ['formation-instance' => $instance->getId()], [], true); ?>"
class="btn btn-primary action ajax-modal" data-event="modification">
<span class="icon ajouter"></span>
Ajouter une journée de formation
</a>
<br/>
<?php /** @see \Formation\Controller\FormationInstanceDocumentController::exportTousEmargementsAction() */?>
<?php /** @see FormationInstanceDocumentController::exportTousEmargementsAction() */?>
<a href="<?php echo $this->url('formation-instance/export-tous-emargements', ['formation-instance' => $instance->getId()], [], true); ?>"
class="btn btn-primary action" target="_blank">
<span class="icon pdf"></span>
......
......@@ -37,7 +37,7 @@ $droits = [
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist">
<li role="formation">
<li>
<a href="#formation" aria-controls="formation" role="tab" data-toggle="tabz">
Formations &nbsp;
<span class="badge">
......@@ -45,7 +45,7 @@ $droits = [
</span>
</a>
</li>
<li role="groupe">
<li>
<a href="#groupe" aria-controls="groupe" role="tab" data-toggle="tabz">
Groupes &nbsp;
<span class="badge">
......@@ -53,7 +53,7 @@ $droits = [
</span>
</a>
</li>
<li role="theme">
<li>
<a href="#theme" aria-controls="theme" role="tab" data-toggle="tabz">
Thèmes &nbsp;
<span class="badge">
......@@ -90,8 +90,7 @@ $droits = [
$('a[aria-controls=' + name + ']').tab('show');
$('.nav-tabs a').click(function (e) {
// No e.preventDefault() here
$('.nav-tabs a').click(function () {
$(this).tab('show');
});
......
......@@ -6,6 +6,7 @@ use Formation\Provider\Privilege\FormationinstancePrivileges;
use Formation\Provider\Privilege\FormationPrivileges;
/**
* @see FormationController::editerAction()
* @var Formation $formation
* @var string $mode
*/
......@@ -18,10 +19,12 @@ $canSupprimerInstance = $this->isAllowed(FormationinstancePrivileges::getR
/** @var FormationInstance[] $instances */
$instances = $formation->getInstances();
$this->headTitle("Formation " . $formation->getId() . " - " . $formation->getLibelle());
?>
<h1 class="page-header">
Formation #<?php echo $formation->getId(); ?>
Formation <?php echo $formation->getId(); ?> - <?php echo $formation->getLibelle(); ?>
</h1>
<div class="main">
......@@ -61,7 +64,7 @@ $instances = $formation->getInstances();
</a>
<?php endif; ?>
<br/>
<?php /** @see \Application\Controller\FormationController::indexAction() */ ?>
<?php /** @see FormationController::indexAction() */ ?>
<a href="<?php echo $this->url('formation', [], ['fragment' => "formation"], true); ?>"
class="btn btn-info action">
<span class="icon retour"></span>
......
......@@ -32,7 +32,7 @@ usort($formations, function(Formation $a, Formation $b) {
<a
<?php /** @see FormationController::ajouterThemeAction() */ ?>
<?php /** @see FormationController::ajouterAction() */ ?>
href="<?php echo $this->url('formation/ajouter', [], [], true); ?>"
class="btn btn-primary action ajax-modal"
data-event="modification">
......@@ -99,14 +99,14 @@ usort($formations, function(Formation $a, Formation $b) {
<script>
$(document).ready(function() {
var groupColumn = 1;
var table = $('#formations').DataTable({
let groupColumn = 1;
$('#formations').DataTable({
"sorting" : false,
"columnDefs": [
{ "visible": false, "targets": groupColumn }
],
// "order": [[ groupColumn, 'asc' ]],
"drawCallback": function ( settings ) {
"drawCallback": function () {
let api = this.api();
let rows = api.rows( {page:'current'} ).nodes();
let last = null;
......@@ -122,29 +122,10 @@ usort($formations, function(Formation $a, Formation $b) {
} );
}
} );
// Order by the grouping
// $('#example tbody').on( 'click', 'tr.group', function () {
// var currentOrder = table.order()[0];
// if ( currentOrder[0] === groupColumn && currentOrder[1] === 'asc' ) {
// table.order( [ groupColumn, 'desc' ] ).draw();
// }
// else {
// table.order( [ groupColumn, 'asc' ] ).draw();
// }
// } );
} );
</script>
<style>
table#formations thead .sorting::after {
visibility: hidden;
}
table.dataTable thead .sorting {
cursor: default;
}
table#formations thead tr th {
height: 5rem;
}
......
......@@ -38,28 +38,6 @@ use Formation\Entity\Db\FormationGroupe;
<br/>
<div class="alert alert-info">
<small>
<ol>
<li>
Les groupes de formation permettent de rassembler les formations par ensemble notamment dans :
<ul>
<li> les parcours de formation des catégories; </li>
<li> les parcours de formation des métiers. </li>
</ul>
</li>
<li> Il est possible de modifier l'ordre d'affichage des groupes :
<ul>
<li> en éditant directement le groupe;</li>
<li> en effectant un drag &amp; drop.</li>
</ul>
</li>
</ol>
</small>
</div>
<br/>
<table class="datatable table table-condensed" id="groupes">
<thead>
<tr>
......@@ -133,8 +111,6 @@ use Formation\Entity\Db\FormationGroupe;
<script>
$(function() {
//let mode = <?php //echo "'".$mode."'"; ?>//;
// console.log(mode);
//if (<?php //echo "'".$mode."'"; ?>// === 'modifier-activite') {
$('table#groupes tbody').sortable({
update: function( event, ui ) {
......@@ -143,10 +119,8 @@ use Formation\Entity\Db\FormationGroupe;
if (ordre !== "") ordre += "_";
ordre += $(this)[0].id ;
});
// console.log(ordre);
<?php /** @see FormationGroupeController::updateOrdreGroupeAction() */ ?>
let url = '../formation-groupe/update-ordre-groupe/' + ordre;
// // console.log(url);
$.ajax({
type: "POST",
url: url,
......@@ -155,7 +129,7 @@ use Formation\Entity\Db\FormationGroupe;
$( "table#groupes tbody" ).sortable( "option", "disabled", true );
},
success:
function (retour) {
function () {
$( "table#groupes tbody" ).sortable( "option", "disabled", false );
}
});
......
......@@ -61,7 +61,7 @@ $canDetruire = $droits['detruire'];
</td>
<td>
<?php if ($canAfficher) : ?>
<a <?php /** @see FormationController::afficherThemeAction() */ ?>
<a <?php /** @see FormationThemeController::afficherThemeAction() */ ?>
href="<?php echo $this->url('formation-theme/afficher', ['formation-theme' => $theme->getId()], [], true); ?>"
class="ajax-modal">
<span class="icon voir" title="Afficher le thème"></span></a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment