Blame view

src/Template/Documents/index.ctp 3.71 KB
64fba1a2   Alexandre   Base du projet : ...
1

4260780b   Alexandre   Migration vue, co...
2
<div class="documents index">
4fd23929   Alexandre   Version: 2.5.0
3
<?php echo '<h2><i class="icon-list"></i> Liste des documents</h2>'; ?>
6c4edfa3   Alexandre   First Commit LabI...
4
5
6
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
9b4da83b   Alexandre   Version: 2.5.0.0
7
                <th><?= $this->Paginator->sort('nom', 'Nom') ?></th>
4260780b   Alexandre   Migration vue, co...
8
9
                <th><?= $this->Paginator->sort('materiel_id', 'Materiel') ?></th>
                <th><?= $this->Paginator->sort('suivi_id', 'Suivi') ?></th>
9b4da83b   Alexandre   Version: 2.5.0.0
10
11
                <th><?= $this->Paginator->sort('type_document_id', 'Type') ?></th>
                <th><?= $this->Paginator->sort('type_doc', 'Extension fichier') ?></th>
4dae83a2   Alexandre   Version: 2.5.1.0
12
                <th><?= $this->Paginator->sort('photo', 'Photo') ?></th>
4260780b   Alexandre   Migration vue, co...
13
                <th class="actions"><?= __('') ?></th>
6c4edfa3   Alexandre   First Commit LabI...
14
15
16
            </tr>
        </thead>
        <tbody>
4dae83a2   Alexandre   Version: 2.5.1.0
17
18
19
20
21
22
23
            <?php foreach ($documents as $document):
            if($document->photo) {
            	$p = 'Oui';
            } else {
            	$p = '';
            }
            ?>
6c4edfa3   Alexandre   First Commit LabI...
24
            <tr>
9b4da83b   Alexandre   Version: 2.5.0.0
25
                <td class="smallText"><?= $this->Html->link($document->nom, ['action' => 'view', $document->id]) ?></td>
4fd23929   Alexandre   Version: 2.5.0
26
27
                
                <?php if(!empty($document->materiel_id)) { ?>           
9b4da83b   Alexandre   Version: 2.5.0.0
28
29
                	<td class="smallText"><?= $this->Html->link($materiel->find()->where(['id =' => $document->materiel_id])->first()['designation'], ['controller' => 'Materiels', 'action' => 'view', $document->materiel_id]) ?></td>
                	<td class="smallText"></td>
4fd23929   Alexandre   Version: 2.5.0
30
                <?php } else {?>
9b4da83b   Alexandre   Version: 2.5.0.0
31
32
                	<td class="smallText"></td>
                	<td class="smallText"><?= $this->Html->link('Suivi '.$document->suivi_id, ['controller' => 'Suivis', 'action' => 'view', $document->suivi_id]) ?></td>
4fd23929   Alexandre   Version: 2.5.0
33
				<?php }  ?>
9b4da83b   Alexandre   Version: 2.5.0.0
34
35
36

				<td class="smallText"><?= $document->has('type_document') ? h($document->type_document->nom) : '' ?></td>
				<td class="smallText"><?= h($document->type_doc) ?></td>
4dae83a2   Alexandre   Version: 2.5.1.0
37
				<td class="smallText"><?= $p ?></td>
4260780b   Alexandre   Migration vue, co...
38
39
40

                <td class="actions" style="padding: 6px 0;">
                    <?= $this->Html->link(__('<i class="icon-eye-open"></i>'), ['action' => 'view', $document->id], ['title' => 'Visualiser', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
4dae83a2   Alexandre   Version: 2.5.1.0
41
42
43
44
45
46
47
                    <?php 
                    if($document->photo) {
                    	echo $this->Form->postLink(__('<i class="icon-download"></i>'), '/webroot/img/photos/'.$document->id.'.'.$document->type_doc, ['title' => 'Télécharger', 'style' => 'margin: 0 2px', 'escape' => false ]);
                    }else {
                    	echo $this->Form->postLink(__('<i class="icon-download"></i>'), '/webroot/files/'.$document->id.'.'.$document->type_doc, ['title' => 'Télécharger', 'style' => 'margin: 0 2px', 'escape' => false ]);
                    }
                    ?>
f4e6dc02   Alexandre   Version: 2.5.2.0
48
49
                    <?= $this->Html->link(__('<i class="icon-edit"></i>'), ['action' => 'edit', $document->id], ['title' => 'Editer', 'style' => 'margin: 0 2px', 'escape' => false]) ?>
                
4260780b   Alexandre   Migration vue, co...
50
                    <?= $this->Form->postLink(__('<i class="icon-trash"></i>'), ['action' => 'delete', $document->id], ['title' => 'Supprimer', 'style' => 'margin: 0 2px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $document->id)]) ?>
6c4edfa3   Alexandre   First Commit LabI...
51
52
                </td>
            </tr>
4dae83a2   Alexandre   Version: 2.5.1.0
53
            <?php  endforeach; ?>
6c4edfa3   Alexandre   First Commit LabI...
54
55
        </tbody>
    </table>
4260780b   Alexandre   Migration vue, co...
56
57
58
59
60
61
62

    <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p>
      	
   	<div class="paging">
            <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?>
            <?= $this->Paginator->numbers(['separator' => '']) ?>
            <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?>
6c4edfa3   Alexandre   First Commit LabI...
63
    </div>
4260780b   Alexandre   Migration vue, co...
64

6c4edfa3   Alexandre   First Commit LabI...
65
</div>
4260780b   Alexandre   Migration vue, co...
66
67
68

    	<div class="actions">
			<?php echo $this->element('menu') ?>
4260780b   Alexandre   Migration vue, co...
69
		</div>