materiels_list_data_row.ctp 2.28 KB
<?php

// Variables passées à cet élément
$materiel = $materiel;
$color = $color;
$date_color = $date_color;
$METRO = $METRO;
// ...

?>

<td class="smallText"><?= $materiel->has('designation') ? 
    $this->Html->link(
      $materiel->designation, 
      ['controller' => 'Materiels', 'action' => 'view', $materiel->id],[$color]
    ) 
    : '' ?>
</td>

<td class="smallText"><?= h($materiel->numero_laboratoire) ?></td>
<td class="smallText"><?= h($materiel->numero_inventaire_organisme) ?></td>

<td class="smallText" style="color: red"><strong><?= ($materiel->hors_service) ? 'HS' : '' ?></strong></td>

<td class="smallText"><?= h($materiel->numero_commande) ?></td>

<!-- 
<td class="smallText"><= h($materiel->nom_responsable) ?></td>
 -->
<td class="smallText"><?= h($materiel->nom_user) ?></td>

<!-- 
<td class="smallText"><= $materiel->has('gestionnaire') ? h($materiel->gestionnaire->nom) : '' ?></td>
 -->
<td class="smallText"><?= $materiel->has('user') ? h($materiel->user->nom) : '' ?></td>

<td class="smallText"><?= $materiel->has('category') ? h($materiel->category->nom) : '' ?></td>
  
<?php
// (4) COLONNE MATERIEL STATUS : C/V/TBA/A
switch (h($materiel->status)) {
    case 'CREATED':
        $statut = 'C';
        break;
    case 'VALIDATED':
        $statut = 'V';
        break;
    case 'TOBEARCHIVED':
        $statut = 'T';
        break;
    case 'ARCHIVED':
        $statut = 'A';
        break;
    default:
        $statut = '';
        break;
}
?>
<td class="smallText" <?=$color?>><?=$statut?></td>
	
<td class="smallText" <?=$date_color?>><?= h($materiel->date_acquisition) ?></td>

<td class="smallText"><?= h($materiel->prix_ht.'€') ?></td>

<td class="smallText"><?= $materiel->has('fournisseur') ? h($materiel->fournisseur->nom) : '' ?></td>

<?php 
$lieu = $materiel->has('site') ? h($materiel->site->nom) : '';
if ($materiel->lieu_detail) {
    if ($materiel->has('site')) $lieu .= '-';
	$lieu .= $materiel->lieu_detail;
}
?>
<td class="smallText"><?=$lieu?></td>

<!-- 
<td class="smallText"><= $materiel->has('organisme') ? h($materiel->organisme->nom) : '' ?></td>
<td class="smallText"><= h($materiel->etiquette)=='1' ? 'O':'N' ?></td>
 -->

<!--
// (6) COLONNE METRO o/n 
-->
<?php if ($METRO)
echo '<td class="smallText">'. (h($materiel->metrologie)=='1' ? 'Y':'N').'</td>';
?>