index.phtml 7.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
/**
 * @var $this                 \Application\View\Renderer\PhpRenderer
 * @var $groupeTypeFormations \Application\Entity\Db\GroupeTypeFormation[]
 */

/* @var $groupeTypeFormations              \Application\Entity\Db\groupeTypeFormation[]
 * @var $typeFormations          \Application\Entity\Db\typeFormation[]
 */

use Application\Provider\Privilege\Privileges;

$this->headTitle()->append("Formations classées par type");

15
$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::ODF_GRANDS_TYPES_DIPLOME_EDITION));
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166

?>
<h1 class="page-header">Groupe de Types de Formations</h1>

<?php foreach ($groupeTypeFormations

as $fr) {
$noActions = true;
foreach ($typeFormations as $tf) {
    if ($tf->getGroupe()->getId() == $fr->getId()) {
        if ($fr->getSource()->getLibelle() == 'OSE') $noActions = false;
    }
}
$nbCol = 6; ?>

<div class="panel panel-default">
    <div class="panel-heading">
        <div class="panel-title"><?= $fr->getLibelleLong() ?>
            <span style="position:absolute; left: 400px"><?= $fr->getLibelleCourt() ?></span>
            <?php if (($canEdit) && ($fr->getSource()->getLibelle() == 'OSE')) { ?>
                <span style="position:absolute; right:50px; ">
                <a class="ajax-modal" data-event="groupe-type-formation-saisie"
                   href="<?= $this->url('groupe-type-formation/saisie', ['groupe-type-formation' => $fr->getId()]) ?>"
                   title="Modifier la Groupe de Type de Formation">
                    <span class="glyphicon glyphicon-edit"></span></a>
                <a class="pop-ajax"
                   href="<?= $this->url('groupe-type-formation/delete', ['groupe-type-formation' => $fr->getId()]) ?>"
                   title="Supprimer la GroupeTypeFormation"
                   data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette suppression ?</p>"
                   data-confirm="true"
                   data-confirm-button="Oui"
                   data-cancel-button="Non"
                   data-submit-reload="true"
                >
                    <span class="glyphicon glyphicon-remove"></span>
                </a>
                </span>
            <?php } ?>
        </div>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-3">
    <div class="panel-body">
        <div class="row">
            <div class="col-md-3">
                Source:
            </div>
            <div class="col-md-1"><?= $fr->getSource() ?>
            </div>
        </div>
            <div class="row">
                <div class="col-md-3">
                    Ordre:
                </div>
                <div class="col-md-1"><?= $fr->getOrdre() ?>
                </div>
            </div>
                <div class="row">
                    <div class="col-md-3">
                        Niveau:
                    </div>
                    <div class="col-md-1"><?= $fr->getPertinenceNiveau() ?>
                    </div>
                </div>
            </div>
        </div>
            <div class="col-md-9">
            <h3 style="margin-top:0.3em; margin-bottom:-0.2em;">Types de formations dans le groupe</h3><br/>
            <table class="table table-bordered table-condensed table-extra-condensed table-sort">
                <thead>
                <th>Libelle court</th>
                <th>Libelle</th>
                <th>Source</th>
                <th>Source code</th>
                <th>Service</th>
                <?php if (($canEdit) && (!$noActions)) echo '<th>Actions</th>' ?>
                </thead>
                <tbody>
                <?php foreach ($typeFormations

                               as $tf) {
                    if ($tf->getGroupe()->getId() == $fr->getId()) { ?>
                        <tr>
                        <td>
                            <?= $tf->getLibelleCourt() ?>
                        </td>
                        <td>
                            <?= $tf->getLibelleLong() ?>
                        </td>
                        <td>
                            <?= $tf->getSource() ?>
                        </td>
                        <td>
                            <?= $tf->getSourceCode() ?>
                        </td>
                        <td>
                            <?php echo($tf->isServiceStatutaire() ? "Statutaire" : "non statutaire") ?>
                        </td>
                        <?php if (($canEdit) && ($tf->getSource()->getLibelle() == 'OSE')) { ?>
                            <td style="text-align:center;width:1px;white-space: nowrap">
                                <a class="ajax-modal" data-event="groupe-type-formation-saisie"
                                   href="<?= $this->url('groupe-type-formation/type-formation-saisie', ['groupe-type-formation' => $fr->getId(), 'type-formation' => $tf->getId()]) ?>"
                                   title="Modifier le Type de Formation">
                                    <span class="glyphicon glyphicon-edit"></span></a>
                                <a class="pop-ajax"
                                   href="<?= $this->url('groupe-type-formation/type-formation-delete', ['type-formation' => $tf->getId()]) ?>"
                                   title="Supprimer le Type de Formation"
                                   data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette suppression ?</p>"
                                   data-confirm="true"
                                   data-confirm-button="Oui"
                                   data-cancel-button="Non"
                                   data-submit-reload="true"
                                >
                                    <span class="glyphicon glyphicon-remove"></span>
                                </a>
                            </td>
                            </tr>
                        <?php } elseif (!$noActions) echo '<td></td>' ?>
                    <?php } ?>
                <?php } ?>
                </tbody>
            </table>
            <?php if (($canEdit) && ($fr->getSource()->getLibelle() == 'OSE')): ?>
                <a class="btn btn-xs btn-primary ajax-modal" style="margin-top:0.5em; "
                   data-event="groupe-type-formation-saisie"
                   href="<?= $this->url('groupe-type-formation/type-formation-saisie', ['groupe-type-formation' => $fr->getId()]) ?>"
                   title="Ajouter un type de formation">
                    <span class="glyphicon glyphicon-edit"></span>
                    Ajouter un type de formation</a>
            <?php endif ?>
            </div>
        </div>
    </div>
        </div>
        <?php } ?>
        <?php if ($canEdit): ?>
            <a class="btn btn-primary ajax-modal" data-event="groupe-type-formation-saisie"
               href="<?= $this->url('groupe-type-formation/saisie') ?>"
               title="Ajouter un type de formation">
                <span class="glyphicon glyphicon-edit"></span>
                Ajouter un groupe de type de formation</a>

            <script type="text/javascript">
                $(function () {
                    $("body").on("groupe-type-formation-saisie", function (event, data) {
                        window.location.reload();
                    });
                });
            </script>
        <?php endif ?>