Commit 9478e9827b2b1fd0b274c235a9c548b5d4534801
1 parent
ed12d115
Exists in
master
and in
3 other branches
refactorisation du code de pagination dans
Template/Element/pagination.ctp (plutot que de le dupliquer 50 fois !!!)
Showing
22 changed files
with
72 additions
and
153 deletions
Show diff stats
README-LABINVENT.md
... | ... | @@ -54,9 +54,9 @@ Logiciel testé et validé sur les configurations suivantes : |
54 | 54 | VERSION ACTUELLE |
55 | 55 | |
56 | 56 | Date: 05/07/2017 |
57 | -Version: 2.7.0.1 | |
58 | - -> Passage de Cakephp3.2 à 3.4, Phpunit 5 à 6, et compatibilité avec Php5.6 et 7 | |
59 | - (petit bugfix) | |
57 | +Version: 2.7.1 | |
58 | + - Petite amélioration script install | |
59 | + - bugfix pagination de toutes les listes index (maintenant, elles sont comme materiels/index) | |
60 | 60 | |
61 | 61 | Version majeure en cours (2.7): https://projects.irap.omp.eu/versions/162 |
62 | 62 | ... | ... |
src/Template/Categories/index.ctp
... | ... | @@ -32,16 +32,10 @@ |
32 | 32 | <?php endforeach; ?> |
33 | 33 | </tbody> |
34 | 34 | </table> |
35 | - | |
36 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
37 | - | |
38 | - <div class="paging" style="color: black;"> | |
39 | - <?= $this->Paginator->first('<< ' . __(''), ['class' => 'prev']) ?> | |
40 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
41 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
42 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
43 | - <?= $this->Paginator->last(__('') . ' >>', ['class' => 'next']) ?> | |
44 | - </div> | |
35 | + | |
36 | + <?php echo $this->element('pagination_with_first_and_last'); ?> | |
37 | + | |
38 | + | |
45 | 39 | </div> |
46 | 40 | |
47 | 41 | <div class="actions"> | ... | ... |
src/Template/Documents/index.ctp
... | ... | @@ -56,14 +56,8 @@ |
56 | 56 | </tbody> |
57 | 57 | </table> |
58 | 58 | |
59 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
60 | - | |
61 | - <div class="paging"> | |
62 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
63 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
64 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
65 | - </div> | |
66 | - | |
59 | + <?php echo $this->element('pagination'); ?> | |
60 | + | |
67 | 61 | </div> |
68 | 62 | |
69 | 63 | <div class="actions"> | ... | ... |
... | ... | @@ -0,0 +1,17 @@ |
1 | + <!-- La façon cakephp 3.4 avec cake.css --> | |
2 | + <div class="paginator"> | |
3 | + <ul class="pagination"> | |
4 | + <p> | |
5 | + <!-- La façon inventirap.css | |
6 | + <div class="paging" style="color: black;"> | |
7 | + <div class="paging"> | |
8 | + --> | |
9 | + <?php | |
10 | + echo $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']); | |
11 | + echo $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']); | |
12 | + echo $this->Paginator->numbers(['separator' => '']); | |
13 | + echo $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']); | |
14 | + ?> | |
15 | + </p> | |
16 | + </ul> | |
17 | + </div> | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | + <!-- La façon cakephp 3.4 avec cake.css --> | |
2 | + <div class="paginator"> | |
3 | + <ul class="pagination"> | |
4 | + <p> | |
5 | + <!-- La façon inventirap.css | |
6 | + <div class="paging" style="color: black;"> | |
7 | + <div class="paging"> | |
8 | + --> | |
9 | + <?php | |
10 | + echo $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']); | |
11 | + echo $this->Paginator->first('<< ' . __(''), ['class' => 'prev']); | |
12 | + echo $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']); | |
13 | + echo $this->Paginator->numbers(['separator' => '']); | |
14 | + echo $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']); | |
15 | + echo $this->Paginator->last(__('') . ' >>', ['class' => 'next']); | |
16 | + ?> | |
17 | + </p> | |
18 | + </ul> | |
19 | + </div> | ... | ... |
src/Template/Emprunts/index.ctp
... | ... | @@ -43,13 +43,8 @@ |
43 | 43 | </tbody> |
44 | 44 | </table> |
45 | 45 | |
46 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
46 | + <?php echo $this->element('pagination'); ?> | |
47 | 47 | |
48 | - <div class="paging"> | |
49 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
50 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
51 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
52 | - </div> | |
53 | 48 | </div> |
54 | 49 | |
55 | 50 | <div class="actions"> | ... | ... |
src/Template/Fichemetrologiques/index.ctp
... | ... | @@ -24,13 +24,7 @@ |
24 | 24 | </tbody> |
25 | 25 | </table> |
26 | 26 | |
27 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
28 | - | |
29 | - <div class="paging"> | |
30 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
31 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
32 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
33 | - </div> | |
27 | + <?php echo $this->element('pagination'); ?> | |
34 | 28 | |
35 | 29 | </div> |
36 | 30 | ... | ... |
src/Template/Formules/index.ctp
... | ... | @@ -34,13 +34,7 @@ |
34 | 34 | </tbody> |
35 | 35 | </table> |
36 | 36 | |
37 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
38 | - | |
39 | - <div class="paging"> | |
40 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
41 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
42 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
43 | - </div> | |
37 | + <?php echo $this->element('pagination'); ?> | |
44 | 38 | |
45 | 39 | </div> |
46 | 40 | ... | ... |
src/Template/Fournisseurs/index.ctp
... | ... | @@ -34,14 +34,8 @@ |
34 | 34 | </tbody> |
35 | 35 | </table> |
36 | 36 | |
37 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
38 | - | |
39 | - <div class="paging"> | |
40 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
41 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
42 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
43 | - </div> | |
44 | - | |
37 | + <?php echo $this->element('pagination'); ?> | |
38 | + | |
45 | 39 | </div> |
46 | 40 | |
47 | 41 | <div class="actions"> | ... | ... |
src/Template/GroupesMetiers/index.ctp
... | ... | @@ -37,14 +37,8 @@ |
37 | 37 | </tbody> |
38 | 38 | </table> |
39 | 39 | |
40 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
41 | - | |
42 | - <div class="paging"> | |
43 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
44 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
45 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
46 | - </div> | |
47 | - | |
40 | + <?php echo $this->element('pagination'); ?> | |
41 | + | |
48 | 42 | </div> |
49 | 43 | |
50 | 44 | <div class="actions"> | ... | ... |
src/Template/GroupesThematiques/index.ctp
... | ... | @@ -33,14 +33,8 @@ |
33 | 33 | </tbody> |
34 | 34 | </table> |
35 | 35 | |
36 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
37 | - | |
38 | - <div class="paging"> | |
39 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
40 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
41 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
42 | - </div> | |
43 | - | |
36 | + <?php echo $this->element('pagination'); ?> | |
37 | + | |
44 | 38 | </div> |
45 | 39 | |
46 | 40 | ... | ... |
src/Template/Layout/default.ctp
... | ... | @@ -103,7 +103,7 @@ $cakeDescription = 'Labinvent 2'; |
103 | 103 | </i></td> |
104 | 104 | <td id="version"> |
105 | 105 | <!-- VERSION M.m.f.b (version (M)ajeure, version (m)ineure, numero de nouvelle (f)onctionnalite, numero de (b)ugfix) --> |
106 | - <font color="black">VERSION 2.7.0.1 (05/07/2017)</font> | |
106 | + <font color="black">VERSION 2.7.1 (05/07/2017)</font> | |
107 | 107 | <br/> |
108 | 108 | <font color="black"><a href="<?php |
109 | 109 | ... | ... |
src/Template/Materiels/index.ctp
... | ... | @@ -282,22 +282,7 @@ if ($nbMateriels > 0) { |
282 | 282 | |
283 | 283 | ?> |
284 | 284 | |
285 | - <!-- La façon cakephp 3.4 avec cake.css --> | |
286 | - <div class="paginator"> | |
287 | - <ul class="pagination"> | |
288 | - <p> | |
289 | - <!-- La façon inventirap.css | |
290 | - <div class="paging" style="color: black;"> | |
291 | - --> | |
292 | - <?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?> | |
293 | - <?= $this->Paginator->first('<< ' . __(''), ['class' => 'prev']) ?> | |
294 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
295 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
296 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
297 | - <?= $this->Paginator->last(__('') . ' >>', ['class' => 'next']) ?> | |
298 | - </p> | |
299 | - </ul> | |
300 | - </div> | |
285 | + <?php echo $this->element('pagination_with_first_and_last'); ?> | |
301 | 286 | |
302 | 287 | <?= $this->Form->end()?> |
303 | 288 | <?php | ... | ... |
src/Template/Organismes/index.ctp
... | ... | @@ -31,14 +31,8 @@ |
31 | 31 | </tbody> |
32 | 32 | </table> |
33 | 33 | |
34 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
35 | - | |
36 | - <div class="paging"> | |
37 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
38 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
39 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
40 | - </div> | |
41 | - | |
34 | + <?php echo $this->element('pagination'); ?> | |
35 | + | |
42 | 36 | </div> |
43 | 37 | |
44 | 38 | <div class="actions"> | ... | ... |
src/Template/Sites/index.ctp
... | ... | @@ -37,14 +37,8 @@ |
37 | 37 | </tbody> |
38 | 38 | </table> |
39 | 39 | |
40 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
41 | - | |
42 | - <div class="paging"> | |
43 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
44 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
45 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
46 | - </div> | |
47 | - | |
40 | + <?php echo $this->element('pagination'); ?> | |
41 | + | |
48 | 42 | </div> |
49 | 43 | |
50 | 44 | <div class="actions"> | ... | ... |
src/Template/SousCategories/index.ctp
... | ... | @@ -32,16 +32,8 @@ |
32 | 32 | </tbody> |
33 | 33 | </table> |
34 | 34 | |
35 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
35 | + <?php echo $this->element('pagination'); ?> | |
36 | 36 | |
37 | - <div class="paging" style="color: black;"> | |
38 | - <?= $this->Paginator->first('<< ' . __(''), ['class' => 'prev']) ?> | |
39 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
40 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
41 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
42 | - <?= $this->Paginator->last(__('') . ' >>', ['class' => 'next']) ?> | |
43 | - </div> | |
44 | - | |
45 | 37 | </div> |
46 | 38 | |
47 | 39 | <div class="actions"> | ... | ... |
src/Template/Suivis/index.ctp
... | ... | @@ -51,13 +51,8 @@ |
51 | 51 | </tbody> |
52 | 52 | </table> |
53 | 53 | |
54 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
54 | + <?php echo $this->element('pagination'); ?> | |
55 | 55 | |
56 | - <div class="paging"> | |
57 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
58 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
59 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
60 | - </div> | |
61 | 56 | |
62 | 57 | </div> |
63 | 58 | ... | ... |
src/Template/SurCategories/index.ctp
... | ... | @@ -28,14 +28,8 @@ |
28 | 28 | </tbody> |
29 | 29 | </table> |
30 | 30 | |
31 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
32 | - | |
33 | - <div class="paging"> | |
34 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
35 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
36 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
37 | - </div> | |
38 | - | |
31 | + <?php echo $this->element('pagination'); ?> | |
32 | + | |
39 | 33 | </div> |
40 | 34 | |
41 | 35 | ... | ... |
src/Template/TypeDocuments/index.ctp
... | ... | @@ -38,14 +38,8 @@ |
38 | 38 | </tbody> |
39 | 39 | </table> |
40 | 40 | |
41 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
42 | - | |
43 | - <div class="paging"> | |
44 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
45 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
46 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
47 | - </div> | |
48 | - | |
41 | + <?php echo $this->element('pagination'); ?> | |
42 | + | |
49 | 43 | </div> |
50 | 44 | |
51 | 45 | ... | ... |
src/Template/TypeSuivis/index.ctp
... | ... | @@ -29,14 +29,8 @@ |
29 | 29 | </tbody> |
30 | 30 | </table> |
31 | 31 | |
32 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
33 | - | |
34 | - <div class="paging"> | |
35 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
36 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
37 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
38 | - </div> | |
39 | - | |
32 | + <?php echo $this->element('pagination'); ?> | |
33 | + | |
40 | 34 | </div> |
41 | 35 | |
42 | 36 | ... | ... |
src/Template/Unites/index.ctp
... | ... | @@ -37,14 +37,8 @@ |
37 | 37 | </tbody> |
38 | 38 | </table> |
39 | 39 | |
40 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
41 | - | |
42 | - <div class="paging"> | |
43 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
44 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
45 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
46 | - </div> | |
47 | - | |
40 | + <?php echo $this->element('pagination'); ?> | |
41 | + | |
48 | 42 | </div> |
49 | 43 | |
50 | 44 | <div class="actions"> | ... | ... |
src/Template/Users/index.ctp
... | ... | @@ -33,14 +33,8 @@ |
33 | 33 | </tbody> |
34 | 34 | </table> |
35 | 35 | |
36 | - <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p> | |
37 | - | |
38 | - <div class="paging"> | |
39 | - <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?> | |
40 | - <?= $this->Paginator->numbers(['separator' => '']) ?> | |
41 | - <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?> | |
42 | - </div> | |
43 | - | |
36 | + <?php echo $this->element('pagination'); ?> | |
37 | + | |
44 | 38 | </div> |
45 | 39 | |
46 | 40 | <div class="actions"> | ... | ... |