Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
index.phtml 3.48 KiB
<?php
/**
* @var $this \Application\View\Renderer\PhpRenderer
* @var $motifModificationServices \Application\Entity\Db\MotifModificationService[]
*/
use Application\Provider\Privilege\Privileges;
function affBooleen($flg)
{
// affiche booléen avec des glypheIcon
return ($flg ? '<span class="glyphicon glyphicon-ok text-success"></span>' : '<span class="glyphicon glyphicon-remove text-danger refuse"></span>');
}
$this->headTitle()->append("Motifs de modification de service dû");
$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::MOTIFS_MODIFICATION_SERVICE_DU_EDITION));
?>
<h1 class="page-header">Motifs de modification de service dû</h1>
<table class="table table-bordered table-sort">
<thead>
<th style="word-wrap: break-word ; ">Code</th>
<th style="word-wrap: break-word ; ">Libelle</th>
<th style="word-wrap: break-word ; ">Multiplicateur</th>
<th style="word-wrap: break-word ; ">Décharge</th>
<?php if ($canEdit) echo '<th>Actions</th>' ?>
</thead>
<tbody>
<?php foreach ($motifModificationServices as $fr): ?>
<tr>
<td style="word-wrap: break-word ; "><?= $fr->getCode() ?></td>
<td style="word-wrap: break-word ; "><?= $fr->getLibelle() ?></td>
<td style="word-wrap: break-word ; "><?= $fr->getMultiplicateur() ?></td>
<td style="word-wrap: break-word ; "><?= affBooleen($fr->getDecharge()) ?></td>
<?php if ($canEdit) { ?>
<td style="text-align:center;width:1px;white-space: nowrap">
<a class="ajax-modal" data-event="motif-modification-service-saisie"
href="<?= $this->url('motif-modification-service/saisie', ['motif-modification-service' => $fr->getId()]) ?>"
title="Modifier le Motif de Modificationde Service dû">
<span class="glyphicon glyphicon-edit"></span></a>
<a class="pop-ajax"
href="<?= $this->url('motif-modification-service/delete', ['motif-modification-service' => $fr->getId()]) ?>"
title="Supprimer le Motif de Modificationde Service dû"
data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette suppression ?</p>"
data-confirm="true"
data-confirm-button="Oui"
data-cancel-button="Non"
data-submit-reload="true"
>
<span class="glyphicon glyphicon-remove"></span>
</a>
</td>
<?php } ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($canEdit): ?>
<a class="btn btn-primary ajax-modal" data-event="motif-modification-service-saisie"
href="<?= $this->url('motif-modification-service/saisie') ?>"
title="Ajouter un motif de modification du service dû">
<span class="glyphicon glyphicon-edit"></span>
Ajouter un motif de modification du service dû</a>
<script type="text/javascript">
$(function () {
$("body").on("motif-modification-service-saisie", function (event, data) {
window.location.reload();
});
});
</script>
<?php endif ?>