Commit b9143fb998407bb7261c5342c9e008d18ed990e0
1 parent
1df4580d
Exists in
master
and in
3 other branches
Ajout page pdo_error.ctp (a adapter) qui est affiché lors d'une
exception PDO + Bugfixes
Showing
2 changed files
with
49 additions
and
0 deletions
Show diff stats
src/Template/Element/menu_view.ctp
... | ... | @@ -43,6 +43,7 @@ |
43 | 43 | <!-- DELETE action --> |
44 | 44 | <li> |
45 | 45 | <?php |
46 | + if(!isset($materiel)) { | |
46 | 47 | $action = ''; |
47 | 48 | if(strstr($t, 'catégorie')) |
48 | 49 | $action = ' Supprimer cette'; |
... | ... | @@ -54,6 +55,15 @@ |
54 | 55 | echo $this->Form->postLink('<i class="icon-trash"></i>' . $action . ' ' . $t, |
55 | 56 | ['action' => 'delete', $lien], |
56 | 57 | ['escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer '.$lien.' ?')]); |
58 | + }else { | |
59 | + if($materiel->status == 'CREATED') { | |
60 | + $action = ' Supprimer ce'; | |
61 | + echo $this->Form->postLink('<i class="icon-trash"></i>' . $action . ' ' . $t, | |
62 | + ['action' => 'delete', $lien], | |
63 | + ['escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer '.$lien.' ?')]); | |
64 | + } | |
65 | + } | |
66 | + | |
57 | 67 | |
58 | 68 | ?> |
59 | 69 | </li> | ... | ... |
... | ... | @@ -0,0 +1,39 @@ |
1 | + | |
2 | +<div class="error_pdo view"> | |
3 | +<h2>PDO Exception</h2> | |
4 | + | |
5 | +<?php if (!empty($error->errorInfo[0])) : ?> | |
6 | + <p class="notice"> | |
7 | + <strong>Code erreur : </strong> | |
8 | + <?= h($error->errorInfo[0]) ?> | |
9 | + </p> | |
10 | +<?php endif; ?> | |
11 | + | |
12 | +<?php if (!empty($error->errorInfo[1])) : ?> | |
13 | + <p class="notice"> | |
14 | + <strong>Code ? : </strong> | |
15 | + <?= h($error->errorInfo[1]) ?> | |
16 | + </p> | |
17 | +<?php endif; ?> | |
18 | + | |
19 | +<?php if (!empty($error->errorInfo[2])) : ?> | |
20 | + <p class="notice"> | |
21 | + <strong>Type erreur : </strong> | |
22 | + <?= h($error->errorInfo[2]) ?> | |
23 | + </p> | |
24 | +<?php endif; ?> | |
25 | + | |
26 | +<?php if (!empty($error->queryString)) : ?> | |
27 | + <p class="notice"> | |
28 | + <strong>Requête SQL : </strong> | |
29 | + <?= h($error->queryString) ?> | |
30 | + </p> | |
31 | +<?php endif; ?> | |
32 | + | |
33 | + | |
34 | + | |
35 | +</div> | |
36 | + | |
37 | +<div class="actions"> | |
38 | + <?php echo $this->element('menu') ?> | |
39 | +</div> | |
0 | 40 | \ No newline at end of file | ... | ... |