edit.ctp
1.94 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
<div class="documents form">
<?= $this->Form->create($document, ['type' => 'file']) ?>
<fieldset>
<?php
if (isset($photo)) {
echo '<h2><i class="icon-plus"></i> Editer une photo</h2>';
} else {
echo '<h2><i class="icon-plus"></i> Editer un document</h2>';
}
if (isset($materiel)) {
echo $this->Form->input('materiel_id', [
'label' => 'N° materiel labo',
'options' => $materiel,
'default' => $this->request->getAttribute('params')['pass'][0],
'readonly' => true
]);
} else if (isset($suivi)) {
echo $this->Form->input('suivi_id', [
'label' => 'N° suivi',
'options' => $suivi,
'default' => $this->request->getAttribute('params')['pass'][0],
'readonly' => true
]);
}
echo $this->Form->input('nom');
if (isset($photo)) {
echo $this->Form->hidden('type_document_id', [
'label' => 'Type',
'options' => $typesD
]);
} else {
echo $this->Form->input('type_document_id', [
'label' => 'Type',
'options' => $typesD
]);
}
echo $this->Form->input('description');
echo $this->Form->hidden('chemin_file', [
'label' => 'Fichier (' . substr($configuration->taille_max_doc / (1024 * 1024), 0, 4) . ' Mo max)',
'type' => 'file'
]);
echo $this->Form->hidden('edit', [
'default' => 1
]);
if (isset($photo)) {
echo $this->Form->hidden('photo', [
'default' => 1
]);
} else {
echo $this->Form->hidden('photo', [
'default' => 0
]);
}
?>
</fieldset>
<?= $this->Form->submit(__('Valider')) ?>
<?= $this->Form->end() ?>
</div>
<div class="actions">
<?php
echo $this->element('menu');
echo $this->element('menu_form', [
'pluralHumanName' => 'Documents'
]);
?>
</div>