view.ctp
3.27 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<div class="surCategories view">
<h2>Détail domaine</h2>
<table style="margin-bottom: 30px;">
<tr>
<th style="width: 250px;"></th>
<th></th>
</tr>
<?php
if (in_array($role, [
'Administration Plus',
'Super Administrateur'
])) {
echo $this->Html->link(__('<i class="icon-pencil"></i> Editer ce domaine'), [
'action' => 'edit',
$surCategory->id
], [
'style' => 'margin-right: 40px; display: inline-block',
'escape' => false,
'onclick' => 'return true;'
]);
}
if (in_array($role, [
'Super Administrateur'
])) {
echo $this->Form->postLink(__('<i class="icon-trash"></i> Supprimer ce domaine'), [
'action' => 'delete',
$surCategory->id
], [
'style' => 'display: inline-block',
'escape' => false,
'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $surCategory->id)
]);
}
$displayElement(__('Nom'), h($surCategory->nom));
?>
</table>
<h3 id="t_categs" class='toggle' style="cursor: pointer;">
<i class="icon-chevron-down" style="font-size: 14px;" id="i_categs"></i>
<span style="text-decoration: underline;">Catégories associées (<?= $categories->count() ?>)</span>
</h3>
<div id="categs" style="margin-bottom: 20px;">
<?php if (!empty($categories)) { ?>
<table>
<tr>
<th><?= __('Nom') ?></th>
<th style="width: 50px;"><?= __('Détail') ?></th>
</tr>
<?php foreach ($categories as $category): ?>
<tr>
<td><?= $this->Html->link(h($category->nom), ['controller' => 'Categories', 'action' => 'view', h($category->id)]); ?></td>
<td class="actions">
<?= $this->Html->link(__('<i class="icon-search"></i>'), ['controller' => 'Categories', 'action' => 'view', $category->id], ['escape' => false, 'style' => 'margin:0']) ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php }else { echo 'Aucune catégorie lié à ce domaine.'; } ?>
</div>
<h3 id="t_materiels" class='toggle' style="cursor: pointer;">
<i class="icon-chevron-down" style="font-size: 14px;" id="i_materiels"></i>
<span style="text-decoration: underline;">Materiels associés (<?= $materiels->count()?>)</span>
</h3>
<div id="materiels" style="margin-bottom: 20px;">
<?php if (!empty($materiels)) { ?>
<table>
<tr>
<th><?= __('Désignation') ?></th>
<th style="width: 50px;"><?= __('Détail') ?></th>
</tr>
<?php foreach ($materiels as $materiel): ?>
<tr>
<td><?= $this->Html->link(h($materiel->designation), ['controller' => 'Materiels', 'action' => 'view', h($materiel->id)]); ?></td>
<td class="actions">
<?= $this->Html->link(__('<i class="icon-search"></i>'), ['controller' => 'Materiels', 'action' => 'view', $materiel->id], ['escape' => false, 'style' => 'margin:0']) ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php }else { echo 'Aucun matériel lié à ce domaine.'; } ?>
</div>
</div>
<!--
<div class="actions">
<php echo $this->element('menu') ?>
<php
echo $this->element('menu_view', [
'pluralHumanName' => 'Domaines',
'singularHumanName' => 'Domaine',
'lien' => $surCategory->id
])?>
</div>
-->