Commit 4fd23929311c4e01bb2ab6507b13b78cd69dba01
1 parent
c9de71ee
Exists in
master
and in
3 other branches
Version: 2.5.0
!!! MAJ BD !!! Modification table documents (mise en place vue) Demande (en cours): https://projects.irap.omp.eu/issues/3716 https://projects.irap.omp.eu/issues/3762 Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99 ROADMAP: https://projects.irap.omp.eu/projects/labinvent/roadmap
Showing
16 changed files
with
194 additions
and
71 deletions
Show diff stats
README-LABINVENT.md
... | ... | @@ -50,14 +50,16 @@ Logiciel testé et validé sur les configurations suivantes : |
50 | 50 | |
51 | 51 | VERSION ACTUELLE |
52 | 52 | |
53 | -Date: 07/06/2016 (Version 2.4 finale) | |
54 | -Version: 2.4.2.25 | |
53 | +Date: 07/06/2016 | |
54 | +Version: 2.5.0 | |
55 | 55 | |
56 | -Implémentation des ACL (droits) - Version Final | |
56 | +!!! MAJ BD !!! | |
57 | +Modification table documents (mise en place vue) | |
57 | 58 | |
58 | -Demande (terminée): https://projects.irap.omp.eu/issues/3579 | |
59 | +Demande (en cours): https://projects.irap.omp.eu/issues/3716 | |
60 | + https://projects.irap.omp.eu/issues/3762 | |
59 | 61 | |
60 | -Version majeure en cours (2.4): https://projects.irap.omp.eu/versions/107 | |
62 | +Version majeure en cours (2.5): https://projects.irap.omp.eu/versions/99 | |
61 | 63 | |
62 | 64 | ROADMAP: https://projects.irap.omp.eu/projects/labinvent/roadmap |
63 | 65 | ... | ... |
database/labinvent_2.1_12-05-16.sql
... | ... | @@ -72,9 +72,10 @@ DROP TABLE IF EXISTS `documents`; |
72 | 72 | CREATE TABLE IF NOT EXISTS `documents` ( |
73 | 73 | `id` int(11) NOT NULL AUTO_INCREMENT, |
74 | 74 | `type_doc` varchar(20) DEFAULT NULL, |
75 | - `chemin` varchar(60) DEFAULT NULL, | |
76 | - `materiel_id` int(11) NOT NULL, | |
77 | - `suivi_id` int(11) NOT NULL, | |
75 | + `description` varchar(100) DEFAULT NULL, | |
76 | + `chemin` varchar(100) DEFAULT NULL, | |
77 | + `materiel_id` int(11) DEFAULT NULL, | |
78 | + `suivi_id` int(11) DEFAULT NULL, | |
78 | 79 | PRIMARY KEY (`id`), |
79 | 80 | KEY `fk_documents_materiel_id` (`materiel_id`), |
80 | 81 | KEY `fk_documents_suivi_id` (`suivi_id`) | ... | ... |
... | ... | @@ -0,0 +1,16 @@ |
1 | +DROP TABLE IF EXISTS `documents`; | |
2 | +CREATE TABLE IF NOT EXISTS `documents` ( | |
3 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
4 | + `type_doc` varchar(20) DEFAULT NULL, | |
5 | + `description` varchar(100) DEFAULT NULL, | |
6 | + `chemin` varchar(100) DEFAULT NULL, | |
7 | + `materiel_id` int(11) DEFAULT NULL, | |
8 | + `suivi_id` int(11) DEFAULT NULL, | |
9 | + PRIMARY KEY (`id`), | |
10 | + KEY `fk_documents_materiel_id` (`materiel_id`), | |
11 | + KEY `fk_documents_suivi_id` (`suivi_id`) | |
12 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; | |
13 | + | |
14 | +ALTER TABLE `documents` | |
15 | + ADD CONSTRAINT `fk_documents_materiel_id` FOREIGN KEY (`materiel_id`) REFERENCES `materiels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
16 | + ADD CONSTRAINT `fk_documents_suivi_id` FOREIGN KEY (`suivi_id`) REFERENCES `suivis` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | ... | ... |
database/update/update_Donnees_IAS_Labinvent2.sql
... | ... | @@ -120,8 +120,10 @@ CREATE TABLE IF NOT EXISTS `documents` ( |
120 | 120 | `id` int(11) NOT NULL AUTO_INCREMENT, |
121 | 121 | `type_doc` varchar(20) DEFAULT NULL, |
122 | 122 | `chemin` varchar(60) DEFAULT NULL, |
123 | - `materiel_id` int(11) NOT NULL, | |
124 | - `suivi_id` int(11) NOT NULL, | |
123 | + `description` varchar(100) DEFAULT NULL, | |
124 | + `chemin` varchar(100) DEFAULT NULL, | |
125 | + `materiel_id` int(11) DEFAULT NULL, | |
126 | + `suivi_id` int(11) DEFAULT NULL, | |
125 | 127 | PRIMARY KEY (`id`), |
126 | 128 | KEY `fk_documents_materiel_id` (`materiel_id`), |
127 | 129 | KEY `fk_documents_suivi_id` (`suivi_id`) | ... | ... |
database/update/update_Donnees_IRAP_Labinvent2.sql
... | ... | @@ -115,4 +115,21 @@ ALTER TABLE `suivis` DROP `type_intervention`; |
115 | 115 | |
116 | 116 | Alter table `suivis` Add `type_frequence` VARCHAR(30) DEFAULT NULL; |
117 | 117 | |
118 | +DROP TABLE IF EXISTS `documents`; | |
119 | +CREATE TABLE IF NOT EXISTS `documents` ( | |
120 | + `id` int(11) NOT NULL AUTO_INCREMENT, | |
121 | + `type_doc` varchar(20) DEFAULT NULL, | |
122 | + `description` varchar(100) DEFAULT NULL, | |
123 | + `chemin` varchar(100) DEFAULT NULL, | |
124 | + `materiel_id` int(11) DEFAULT NULL, | |
125 | + `suivi_id` int(11) DEFAULT NULL, | |
126 | + PRIMARY KEY (`id`), | |
127 | + KEY `fk_documents_materiel_id` (`materiel_id`), | |
128 | + KEY `fk_documents_suivi_id` (`suivi_id`) | |
129 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; | |
130 | + | |
131 | +ALTER TABLE `documents` | |
132 | + ADD CONSTRAINT `fk_documents_materiel_id` FOREIGN KEY (`materiel_id`) REFERENCES `materiels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |
133 | + ADD CONSTRAINT `fk_documents_suivi_id` FOREIGN KEY (`suivi_id`) REFERENCES `suivis` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |
134 | + | |
118 | 135 | COMMIT; | ... | ... |
src/Controller/AppController.php
... | ... | @@ -187,7 +187,7 @@ class AppController extends Controller |
187 | 187 | //$configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); |
188 | 188 | //$to = $configuration->emailGuest2; |
189 | 189 | |
190 | - $to = "labinvent2@gmail.co"; | |
190 | + $to = "labinvent2gmail.co"; | |
191 | 191 | |
192 | 192 | if (filter_var($to, FILTER_VALIDATE_EMAIL)) { |
193 | 193 | $email = new Email(); | ... | ... |
src/Controller/DocumentsController.php
... | ... | @@ -42,12 +42,11 @@ class DocumentsController extends AppController |
42 | 42 | */ |
43 | 43 | public function index() |
44 | 44 | { |
45 | - $this->paginate = [ | |
46 | - 'contain' => ['Materiels', 'Suivis'] | |
47 | - ]; | |
48 | 45 | $documents = $this->paginate($this->Documents); |
49 | 46 | |
50 | - $this->set(compact('documents')); | |
47 | + $materiel = $this->Documents->Materiels; | |
48 | + | |
49 | + $this->set(compact('documents', 'materiel')); | |
51 | 50 | $this->set('_serialize', ['documents']); |
52 | 51 | } |
53 | 52 | |
... | ... | @@ -60,10 +59,18 @@ class DocumentsController extends AppController |
60 | 59 | */ |
61 | 60 | public function view($id = null) |
62 | 61 | { |
63 | - $document = $this->Documents->get($id, [ | |
64 | - 'contain' => ['Materiels', 'Suivis'] | |
65 | - ]); | |
62 | + $document = $this->Documents->get($id); | |
66 | 63 | |
64 | + $materiel = $this->Documents->Materiels->find()->where(['id =' => $document->materiel_id])->first(); | |
65 | + | |
66 | + if($materiel != null) { | |
67 | + $this->set('materiel', $materiel); | |
68 | + } | |
69 | + else { | |
70 | + $suivi = $this->Documents->Suivis->find()->where(['id =' => $document->suivi_id])->first(); | |
71 | + $this->set('suivi', $suivi); | |
72 | + } | |
73 | + | |
67 | 74 | $this->set('document', $document); |
68 | 75 | $this->set('_serialize', ['document']); |
69 | 76 | } |
... | ... | @@ -85,9 +92,18 @@ class DocumentsController extends AppController |
85 | 92 | $this->Flash->error(__('Le fichier n\'a pas pu être ajouté.')); |
86 | 93 | } |
87 | 94 | } |
88 | - $materiels = $this->Documents->Materiels->find('list', ['limit' => 200]); | |
89 | - $suivis = $this->Documents->Suivis->find('list', ['limit' => 200]); | |
90 | - $this->set(compact('document', 'materiels', 'suivis')); | |
95 | + | |
96 | + if(isset($this->passedArgs[1]) && $this->passedArgs[1] == 'mat') { | |
97 | + $materiel = $this->Documents->Materiels->find('list', [ 'keyField' => 'id', 'valueField' => 'numero_laboratoire'])->where(['id =' => $this->passedArgs[0]]); | |
98 | + $this->set('materiel', $materiel); | |
99 | + } | |
100 | + else { | |
101 | + $suivi = $this->Documents->Suivis->find('list', [ 'keyField' => 'id', 'valueField' => 'id'])->where(['id =' => $this->passedArgs[0]]); | |
102 | + $this->set('suivi', $suivi); | |
103 | + } | |
104 | + | |
105 | + | |
106 | + $this->set(compact('document')); | |
91 | 107 | $this->set('_serialize', ['document']); |
92 | 108 | } |
93 | 109 | |
... | ... | @@ -112,9 +128,18 @@ class DocumentsController extends AppController |
112 | 128 | $this->Flash->error(__('Le fichier n\'a pas pu être édité.')); |
113 | 129 | } |
114 | 130 | } |
115 | - $materiels = $this->Documents->Materiels->find('list', ['limit' => 200]); | |
116 | - $suivis = $this->Documents->Suivis->find('list', ['limit' => 200]); | |
117 | - $this->set(compact('document', 'materiels', 'suivis')); | |
131 | + | |
132 | + $materiel = $this->Documents->Materiels->find('list', [ 'keyField' => 'id', 'valueField' => 'numero_laboratoire'])->where(['id =' => $document->materiel_id]); | |
133 | + if($materiel->count() > 0) { | |
134 | + $this->set('materiel', $materiel); | |
135 | + } | |
136 | + else { | |
137 | + $suivi = $this->Documents->Suivis->find('list', [ 'keyField' => 'id', 'valueField' => 'id'])->where(['id =' => $document->suivi_id]); | |
138 | + $this->set('suivi', $suivi); | |
139 | + } | |
140 | + | |
141 | + | |
142 | + $this->set(compact('document')); | |
118 | 143 | $this->set('_serialize', ['document']); |
119 | 144 | } |
120 | 145 | ... | ... |
src/Model/Entity/Document.php
... | ... | @@ -9,6 +9,7 @@ use Cake\ORM\Entity; |
9 | 9 | * @property int $id |
10 | 10 | * @property string $type_doc |
11 | 11 | * @property string $chemin |
12 | + * @property string $description | |
12 | 13 | * @property int $materiel_id |
13 | 14 | * @property \App\Model\Entity\Materiel $materiel |
14 | 15 | * @property int $suivi_id | ... | ... |
src/Model/Table/DocumentsTable.php
... | ... | @@ -57,6 +57,15 @@ class DocumentsTable extends AppTable |
57 | 57 | |
58 | 58 | $validator |
59 | 59 | ->allowEmpty('chemin'); |
60 | + | |
61 | + $validator | |
62 | + ->allowEmpty('description'); | |
63 | + | |
64 | + $validator | |
65 | + ->allowEmpty('materiel_id'); | |
66 | + | |
67 | + $validator | |
68 | + ->allowEmpty('suivi_id'); | |
60 | 69 | |
61 | 70 | return $validator; |
62 | 71 | } |
... | ... | @@ -67,11 +76,11 @@ class DocumentsTable extends AppTable |
67 | 76 | * |
68 | 77 | * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. |
69 | 78 | * @return \Cake\ORM\RulesChecker |
70 | - */ | |
79 | + * | |
71 | 80 | public function buildRules(RulesChecker $rules) |
72 | 81 | { |
73 | 82 | $rules->add($rules->existsIn(['materiel_id'], 'Materiels')); |
74 | 83 | $rules->add($rules->existsIn(['suivi_id'], 'Suivis')); |
75 | 84 | return $rules; |
76 | - } | |
85 | + }*/ | |
77 | 86 | } | ... | ... |
src/Template/Documents/add.ctp
1 | 1 | |
2 | -<div class="documents form large-9 medium-8 columns content"> | |
2 | +<div class="documents form"> | |
3 | 3 | <?= $this->Form->create($document) ?> |
4 | 4 | <fieldset> |
5 | - <legend><?= __('Add Document') ?></legend> | |
5 | + <h2><i class="icon-plus"></i> Lier un document</h2> | |
6 | 6 | <?php |
7 | + if(isset($materiel)) { | |
8 | + echo $this->Form->input('materiel_id', ['label' => 'N° materiel labo', 'options' => $materiel, 'default' => $this->passedArgs[0], 'readonly' => TRUE]); | |
9 | + } | |
10 | + else if(isset($suivi)) { | |
11 | + echo $this->Form->input('suivi_id', ['label' => 'N° suivi', 'options' => $suivi, 'default' => $this->passedArgs[0], 'readonly' => TRUE]); | |
12 | + } | |
13 | + | |
7 | 14 | echo $this->Form->input('type_doc'); |
15 | + echo $this->Form->input('description'); | |
8 | 16 | echo $this->Form->input('chemin'); |
9 | - echo $this->Form->input('materiel_id', ['options' => $materiels]); | |
10 | - echo $this->Form->input('suivi_id', ['options' => $suivis]); | |
17 | + | |
18 | + | |
11 | 19 | ?> |
12 | 20 | </fieldset> |
13 | - <?= $this->Form->button(__('Submit')) ?> | |
21 | + <?= $this->Form->submit(__('Valider')) ?> | |
14 | 22 | <?= $this->Form->end() ?> |
15 | 23 | </div> |
24 | + | |
25 | +<div class="actions"> | |
26 | + <?php | |
27 | + echo $this->element('menu'); | |
28 | + echo $this->element('menu_form', [ 'pluralHumanName' => 'Documents' ]); | |
29 | + ?> | |
30 | +</div> | ... | ... |
src/Template/Documents/edit.ctp
1 | 1 | |
2 | -<div class="documents form large-9 medium-8 columns content"> | |
2 | +<div class="documents form"> | |
3 | 3 | <?= $this->Form->create($document) ?> |
4 | 4 | <fieldset> |
5 | - <legend><?= __('Edit Document') ?></legend> | |
5 | + <h2><i class="icon-edit"></i> Editer document</h2> | |
6 | 6 | <?php |
7 | + if(isset($materiel)) { | |
8 | + echo $this->Form->input('materiel_id', ['label' => 'N° materiel labo', 'options' => $materiel, 'readonly' => TRUE]); | |
9 | + } | |
10 | + else if(isset($suivi)) { | |
11 | + echo $this->Form->input('suivi_id', ['label' => 'N° suivi', 'options' => $suivi, 'readonly' => TRUE]); | |
12 | + } | |
13 | + | |
7 | 14 | echo $this->Form->input('type_doc'); |
15 | + echo $this->Form->input('description'); | |
8 | 16 | echo $this->Form->input('chemin'); |
9 | - echo $this->Form->input('materiel_id', ['options' => $materiels]); | |
10 | - echo $this->Form->input('suivi_id', ['options' => $suivis]); | |
17 | + | |
11 | 18 | ?> |
12 | 19 | </fieldset> |
13 | - <?= $this->Form->button(__('Submit')) ?> | |
20 | + <?= $this->Form->submit(__('Valider')) ?> | |
14 | 21 | <?= $this->Form->end() ?> |
15 | 22 | </div> |
23 | + | |
24 | +<div class="actions"> | |
25 | + <?php | |
26 | + echo $this->element('menu'); | |
27 | + echo $this->element('menu_form', [ 'pluralHumanName' => 'Documents' ]); | |
28 | + ?> | |
29 | +</div> | |
16 | 30 | \ No newline at end of file | ... | ... |
src/Template/Documents/index.ctp
1 | 1 | |
2 | 2 | <div class="documents index"> |
3 | -<?php echo '<h2><i class="icon-list"></i> Liste des fichiers</h2>'; ?> | |
3 | +<?php echo '<h2><i class="icon-list"></i> Liste des documents</h2>'; ?> | |
4 | 4 | <table cellpadding="0" cellspacing="0"> |
5 | 5 | <thead> |
6 | 6 | <tr> |
7 | 7 | <th><?= $this->Paginator->sort('id', 'N°') ?></th> |
8 | - <th><?= $this->Paginator->sort('chemin', 'Chemin') ?></th> | |
9 | - <th><?= $this->Paginator->sort('type_doc', 'Type') ?></th> | |
10 | 8 | <th><?= $this->Paginator->sort('materiel_id', 'Materiel') ?></th> |
11 | 9 | <th><?= $this->Paginator->sort('suivi_id', 'Suivi') ?></th> |
12 | - <th><?= $this->Paginator->sort('materiel_id', 'Numéro Materiel (labo)') ?></th> | |
10 | + <th><?= $this->Paginator->sort('type_doc', 'Type') ?></th> | |
13 | 11 | <th class="actions"><?= __('') ?></th> |
14 | 12 | </tr> |
15 | 13 | </thead> |
16 | 14 | <tbody> |
17 | 15 | <?php foreach ($documents as $document): ?> |
18 | 16 | <tr> |
19 | - <td><?= 'Fichier '.$this->Number->format($document->id) ?></td> | |
20 | - <td><?= h($document->chemin) ?></td> | |
21 | - <td><?= h($document->type_doc) ?></td> | |
22 | - <td><?= $document->has('materiel') ? $this->Html->link($document->materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $document->materiel->id]) : '' ?></td> | |
23 | - <td><?= $document->has('suivi') ? $this->Html->link('Suivi '.$document->suivi->id, ['controller' => 'Suivis', 'action' => 'view', $document->suivi->id]) : '' ?></td> | |
24 | - <td><?= $document->has('materiel') ? $document->materiel->numero_laboratoire : '' ?></td> | |
17 | + <td><?= $this->Html->link('Fichier '.$this->Number->format($document->id), ['action' => 'view', $document->id]) ?></td> | |
18 | + | |
19 | + <?php if(!empty($document->materiel_id)) { ?> | |
20 | + <td><?= $this->Html->link($materiel->find()->where(['id =' => $document->materiel_id])->first()['designation'], ['controller' => 'Materiels', 'action' => 'view', $document->materiel_id]) ?></td> | |
21 | + <td></td> | |
22 | + <?php } else {?> | |
23 | + <td></td> | |
24 | + <td><?= $this->Html->link('Suivi '.$document->suivi_id, ['controller' => 'Suivis', 'action' => 'view', $document->suivi_id]) ?></td> | |
25 | + <?php } ?> | |
26 | + <td><?= h($document->type_doc) ?></td> | |
25 | 27 | |
26 | 28 | <td class="actions" style="padding: 6px 0;"> |
27 | 29 | <?= $this->Html->link(__('<i class="icon-eye-open"></i>'), ['action' => 'view', $document->id], ['title' => 'Visualiser', 'style' => 'margin: 0 2px', 'escape' => false ]) ?> |
... | ... | @@ -46,6 +48,6 @@ |
46 | 48 | <div class="actions"> |
47 | 49 | <?php echo $this->element('menu') ?> |
48 | 50 | <?php echo $this->element('menu_index', |
49 | - [ 'pluralHumanName' => 'Fichiers', | |
50 | - 'singularHumanName' => 'Fichier' ]) ?> | |
51 | + [ 'pluralHumanName' => 'Documents', | |
52 | + 'singularHumanName' => 'DOcument' ]) ?> | |
51 | 53 | </div> |
52 | 54 | \ No newline at end of file | ... | ... |
src/Template/Documents/view.ctp
1 | 1 | |
2 | 2 | |
3 | 3 | <div class="documents view"> |
4 | - <h2>Détail fichier</h2> | |
4 | + <h2>Détail document</h2> | |
5 | 5 | |
6 | 6 | <table style="margin-bottom: 30px;"> |
7 | 7 | <tr><th style="width: 250px;"></th><th></th></tr> |
8 | 8 | |
9 | 9 | <?php |
10 | 10 | |
11 | - echo $this->Html->link(__('<i class="icon-pencil"></i> Editer ce fichier'), | |
11 | + echo $this->Html->link(__('<i class="icon-pencil"></i> Editer ce document'), | |
12 | 12 | ['action' => 'edit', $document->id], |
13 | 13 | ['escape' => false,'onclick' => 'return true;'] |
14 | 14 | ); |
15 | - echo $this->Form->postLink(__('<i class="icon-trash"></i> Supprimer ce fichier'), | |
15 | + echo $this->Form->postLink(__('<i class="icon-trash"></i> Supprimer ce document'), | |
16 | 16 | ['action' => 'delete', $document->id], |
17 | 17 | ['style'=>'margin-left: 110px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $document->id)] |
18 | 18 | ); |
19 | 19 | |
20 | + if(isset($materiel)) { | |
21 | + $displayElement(__('Materiel'), $this->Html->link($materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $materiel->id])); | |
22 | + } | |
23 | + else if(isset($suivi)) { | |
24 | + $displayElement(__('Suivi'), $this->Html->link('Suivi '.$suivi->id, ['controller' => 'Suivis', 'action' => 'view', $suivi->id])); | |
25 | + } | |
26 | + | |
20 | 27 | $displayElement(__('N°'), 'Fichier '.$this->Number->format($document->id)); |
21 | - $displayElement(__('Chemin'), h($document->chemin)); | |
22 | 28 | $displayElement(__('Type'), h($document->type_doc)); |
23 | - $displayElement(__('Materiel'), $document->has('materiel') ? $this->Html->link($document->materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $document->materiel->id]) : ''); | |
24 | - $displayElement(__('Suivi'), 'Suivi '.$document->has('suivi') ? $this->Html->link('Suivi '.$document->suivi->id, ['controller' => 'Suivis', 'action' => 'view', $document->suivi->id]) : '' ); | |
25 | - $displayElement(__('Numéro interne (labo)'), $document->has('materiel') ? h($document->materiel->numero_laboratoire) : ''); | |
29 | + $displayElement(__('Description'), h($document->chemin)); | |
30 | + $displayElement(__('Chemin'), h($document->chemin)); | |
31 | + | |
26 | 32 | |
27 | 33 | |
28 | 34 | ?> |
... | ... | @@ -33,7 +39,7 @@ |
33 | 39 | <div class="actions"> |
34 | 40 | <?php echo $this->element('menu') ?> |
35 | 41 | <?php echo $this->element('menu_view', |
36 | - [ 'pluralHumanName' => 'Fichiers', | |
37 | - 'singularHumanName' => 'Fichier', | |
42 | + [ 'pluralHumanName' => 'Documents', | |
43 | + 'singularHumanName' => 'Document', | |
38 | 44 | 'lien' => $document->id ]) ?> |
39 | 45 | </div> |
40 | 46 | \ No newline at end of file | ... | ... |
src/Template/Materiels/view.ctp
... | ... | @@ -62,18 +62,18 @@ |
62 | 62 | ); // End link |
63 | 63 | |
64 | 64 | |
65 | - /*echo $this->Html->link('<i class="icon-file"></i> Lier un Doc.', | |
66 | - ['controller' => 'documents', | |
67 | - 'action' => 'add', | |
68 | - 'mat' => $materiel->id, | |
69 | - ], | |
70 | - ['title' => 'Attacher un Doc. à ce matériel', | |
71 | - 'style' => 'margin-right: 10px', | |
72 | - 'escape' => false | |
73 | - ] | |
74 | - );*/ | |
65 | + | |
75 | 66 | } |
76 | 67 | |
68 | + echo $this->Html->link('<i class="icon-file"></i> Lier un Doc.', | |
69 | + ['controller' => 'documents', | |
70 | + 'action' => 'add', | |
71 | + $materiel->id, 'mat'], | |
72 | + ['title' => 'Attacher un Doc. à ce matériel', | |
73 | + 'style' => 'margin-right: 10px', | |
74 | + 'escape' => false] | |
75 | + ); | |
76 | + | |
77 | 77 | if(in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) { |
78 | 78 | if (($materiel->status == 'VALIDATED') || ($materiel->status == 'CREATED')) { |
79 | 79 | echo $this->Html->link('<i class="icon-file"></i> Doc. admission', | ... | ... |
src/Template/Suivis/view.ctp
... | ... | @@ -13,10 +13,21 @@ |
13 | 13 | ); |
14 | 14 | echo $this->Form->postLink(__('<i class="icon-trash"></i> Supprimer ce suivi'), |
15 | 15 | ['action' => 'delete', $suivi->id], |
16 | - ['style'=>'margin-left: 140px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $suivi->id)] | |
16 | + ['style'=>'margin-left: 100px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $suivi->id)] | |
17 | + ); | |
18 | + | |
19 | + echo $this->Html->link('<i class="icon-file"></i> Lier un Doc.', | |
20 | + ['controller' => 'documents', | |
21 | + 'action' => 'add', | |
22 | + $suivi->id], | |
23 | + ['title' => 'Attacher un Doc. à ce suivi', | |
24 | + 'style' => 'margin-left: 100px', | |
25 | + 'escape' => false] | |
17 | 26 | ); |
18 | 27 | } |
19 | 28 | |
29 | + | |
30 | + | |
20 | 31 | $displayElement(__('Materiel'), $suivi->has('materiel') ? $this->Html->link($suivi->materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $suivi->materiel->id]) : ''); |
21 | 32 | $displayElement(__('Numéro interne (labo)'), $suivi->has('materiel') ? h($suivi->materiel->numero_laboratoire) : ''); |
22 | 33 | $displayElement(__('Date Intervention'), h($suivi->date_controle)); | ... | ... |
tests/Fixture/DocumentsFixture.php
... | ... | @@ -19,9 +19,10 @@ class DocumentsFixture extends TestFixture |
19 | 19 | public $fields = [ |
20 | 20 | 'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null], |
21 | 21 | 'type_doc' => ['type' => 'string', 'length' => 20, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null], |
22 | - 'chemin' => ['type' => 'string', 'length' => 60, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null], | |
23 | - 'materiel_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], | |
24 | - 'suivi_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], | |
22 | + 'description' => ['type' => 'string', 'length' => 100, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null], | |
23 | + 'chemin' => ['type' => 'string', 'length' => 100, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'fixed' => null], | |
24 | + 'materiel_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], | |
25 | + 'suivi_id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null, 'autoIncrement' => null], | |
25 | 26 | '_indexes' => [ |
26 | 27 | 'fk_documents_materiel_id' => ['type' => 'index', 'columns' => ['materiel_id'], 'length' => []], |
27 | 28 | 'fk_documents_suivi_id' => ['type' => 'index', 'columns' => ['suivi_id'], 'length' => []], |
... | ... | @@ -46,6 +47,7 @@ class DocumentsFixture extends TestFixture |
46 | 47 | public $records = [ |
47 | 48 | [ |
48 | 49 | 'id' => 1, |
50 | + 'description' => 'dsfdssdf', | |
49 | 51 | 'type_doc' => 'Lorem ipsum dolor ', |
50 | 52 | 'chemin' => 'Lorem ipsum dolor sit amet', |
51 | 53 | 'materiel_id' => 3, | ... | ... |