index.ctp
5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
<div class="materiels index">
<?php echo '<h2><i class="icon-list"></i> Liste des matériels ('.$nbMateriels.')</h2>'; ?>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th><?= $this->Paginator->sort('designation','Désignation') ?></th>
<th><?= $this->Paginator->sort('numero_laboratoire', 'N° interne (labo)') ?></th>
<th><?= $this->Paginator->sort('categorie_id', 'Catégorie') ?></th>
<th><?= $this->Paginator->sort('organisme_id', 'Org.') ?></th>
<th><?= $this->Paginator->sort('numero_inventaire_organisme', 'N° Invent. Org.') ?></th>
<th><?= $this->Paginator->sort('nom_responsable', 'Responsable') ?></th>
<th><?= $this->Paginator->sort('status', 'Statut') ?></th>
<th><?= $this->Paginator->sort('date_acquisition', 'Date Achat') ?></th>
<th><?= $this->Paginator->sort('etiquette', 'Et') ?></th>
<th class="actions"><?= __('') ?></th>
<th class="actions"><?= __('') ?></th>
<th class="actions"><?= __('') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($materiels as $materiel): ?>
<tr>
<td><?= $materiel->has('designation') ? $this->Html->link($materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $materiel->id]) : '' ?></td>
<td><?= h($materiel->numero_laboratoire) ?></td>
<td><?= $materiel->has('category') ? h($materiel->category->nom) : '' ?></td>
<td><?= $materiel->has('organisme') ? h($materiel->organisme->nom) : '' ?></td>
<td><?= h($materiel->numero_inventaire_organisme) ?></td>
<td><?= h($materiel->nom_responsable) ?></td>
<td><?= h($materiel->status) ?></td>
<td><?= h($materiel->date_acquisition) ?></td>
<td><?php if (h($materiel->etiquette) == '1') { echo 'Y'; } else { echo 'N'; } ?></td>
<td class="actions" style="padding: 6px 0;">
<?= $this->Html->link(__('<i class="icon-pencil"></i>'), ['action' => 'edit', $materiel->id], ['title' => 'Editer', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
</td>
<td class="actions" style="padding: 6px 0;">
<?php
if(h($materiel->status) == 'CREATED') {
echo $this->Form->postLink('<i class="icon-ok-sign"></i>',
['action' => 'statusValidated', $materiel->id],
['title' => 'Valider', 'style' => 'margin: 0 2px', 'escape' => false,
'confirm' => __('Êtes-vous sur de vouloir validé # {0}?', $materiel->designation)]);
}
else if (h($materiel->status) == 'VALIDATED' && h($materiel->nom_responsable) == $username) {
echo $this->Form->postLink('<i class="icon-inbox"></i>',
['action' => 'statusToBeArchived', $materiel->id],
['title' => 'Demander la sortie de l\'inventaire', 'style' => 'margin: 0 2px', 'escape' => false,
'confirm' => __('Êtes-vous sur de vouloir faire une demande d\'archive # {0}?', $materiel->designation)]);
}
else if (h($materiel->status) == 'VALIDATED'){
echo $this->Form->postLink('<i class="icon-inbox"></i>',
['action' => 'statusArchived', $materiel->id],
['title' => 'Sortir de l\'inventaire', 'style' => 'margin: 0 2px', 'escape' => false,
'confirm' => __('Êtes-vous sur de vouloir archivé # {0}?', $materiel->designation)]);
}
?>
</td>
<td class="actions" style="padding: 6px 0;">
<?php
if (h($materiel->status) == 'CREATED') {
echo $this->Form->postLink(__('<i class="icon-trash"></i>'), ['action' => 'delete', $materiel->id], ['title' => 'Supprimer', 'style' => 'margin: 0 2px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $materiel->designation)]);
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="paging" style="color: black;">
<?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?>
<?= $this->Paginator->first('<< ' . __(''), ['class' => 'prev']) ?>
<?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?>
<?= $this->Paginator->numbers(['separator' => '']) ?>
<?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?>
<?= $this->Paginator->last(__('') . ' >>', ['class' => 'next']) ?>
</div>
</div>
<div class="actions">
<?php echo $this->element('menu') ?>
<?php echo $this->element('menu_index',
[ 'pluralHumanName' => 'Matériels',
'singularHumanName' => 'Matériel' ]) ?>
</div>