Commit 56e093a6 authored by Thibaut Vallee's avatar Thibaut Vallee
Browse files

Migration Laminas

parent 7284df61
Pipeline #15235 passed with stage
in 14 seconds
......@@ -11,7 +11,7 @@ class MacroHydrator implements HydratorInterface {
* @param Macro $object
* @return array
*/
public function extract($object)
public function extract(object $object) : array
{
$data = [
'code' => $object->getCode(),
......
......@@ -11,7 +11,7 @@ class TemplateHydrator implements HydratorInterface {
* @param Template $object
* @return array
*/
public function extract($object)
public function extract($object) : array
{
$data = [
'code' => ($object)?$object->getCode():null,
......
......@@ -60,7 +60,6 @@ $canTemplate = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(Docume
</div>
<?php endif; ?>
<?php if ($canRendu) : ?>
<h2> Gestion des rendus </h2>
......
......@@ -37,7 +37,7 @@ $this->headTitle("Index des macros");
Générer le JSON des macros
</a>
<table class="table table-condensed table-hover">
<table id='macro-liste' class="table table-condensed table-hover">
<thead>
<tr>
<th> Code </th>
......@@ -74,7 +74,7 @@ $this->headTitle("Index des macros");
class="ajax-modal" data-event="modification" data-toggle="tooltip" data-html="true"
title="Suppression de la macro <span class='highlight macro'><?php echo $macro->getCode(); ?></span>"
>
<span class="icon detruire"></span></a>
<span class="icon detruire text-danger"></span></a>
<?php endif; ?>
</td>
</tr>
......@@ -89,5 +89,28 @@ $this->headTitle("Index des macros");
event.div.modal('hide');
window.location.reload();
});
if(jQuery().dataTable) {
$('#macro-liste').DataTable({
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tous"]],
"columnDefs": [
{targets: 3, orderable: false, searchable: false},
],
"language": {
'lengthMenu': "Afficher _MENU_ &eacute;l&eacute;ments",
"search": "Filtre de recherche : _INPUT_",
"loadingRecords": "Chargement en cours...",
'info': "<small class=\"text-highlight\">Affichage : <strong><i class=\"far fa-list-alt\"></i> _START_ - _END_ sur _TOTAL_</strong></small>",
'infoEmpty': "",
'infoFiltered': "<small class=\"text-highlight\">(_MAX_ &eacute;l&eacute;ments au total)</small>",
'emptyTable': "Aucune donnée disponible.",
'zeroRecords': "Aucun enregistrement trouvé.",
"paginate": {
"previous": "<i class=\"fas fa-chevron-left\"></i>",
"next": "<i class=\"fas fa-chevron-right\"></i>"
}
},
});
}
});
</script>
\ No newline at end of file
......@@ -10,20 +10,19 @@
<div class="panel panel-default">
<div class="panel-heading">
<span class="icon filtrer"></span> Filtre des macros
<h2>Filtrer les macros</h2>
</div>
<div class="panel-body">
<form method="get" id="filtre" action="<?php echo $this->url(); ?>">
<div class="row">
<!-- Variable -------------------------------------------------------- -->
<div class="col-md-3">
<div class="col-md-5">
<div class="form-group">
<label for="variable">Variable associée :</label>
<select id="variable" name="variable" class="selectpicker">
<option value=""> Tous les variables </option>
<?php foreach($variables as $variable) : ?>
<select id="variable" name="variable" class="form-control selectpicker">
<option value=""> Toutes les variables</option>
<?php foreach ($variables as $variable) : ?>
<option
value="<?php echo $variable; ?>"
value="<?php echo $variable; ?>"
<?php if ($variable == $params['variable']) echo " selected "; ?>
>
<?php echo $variable; ?>
......@@ -33,17 +32,16 @@
</div>
</div>
<!-- BOUTON -->
<div class="col-md-3">
<br/>
<div class="pull-right">
<button class="btn btn-primary" id="clear">
<span class="icon effacer"></span>
</button>
<button class="btn btn-primary" id="filter" style="width:20rem;">
<div class="col-md-7">
<div class="form-group">
<button class="btn btn-primary" id="filter">
<span class="icon filtrer"></span>
Filtrer
</button>
<button class="btn btn-primary" id="clear">
<span class="icon effacer"></span>
Effacer
</button>
</div>
</div>
</div>
......@@ -53,20 +51,27 @@
<script>
$("form#filtre").submit(function(e){
e.preventDefault();
});
$(function () {
if (jQuery().selectpicker) {
$('#variable').selectpicker('render');
}
$('button#clear').click(function() {
window.location.href = 'macro';
});
$("form#filtre").submit(function (e) {
e.preventDefault();
});
$('button#clear').click(function () {
window.location.href = 'macro';
});
$('button#filter').click(function() {
let variableId = $('select#variable option:selected').val();
console.log( "variable=" + variableId);
$('button#filter').click(function () {
let variableId = $('select#variable option:selected').val();
console.log("variable=" + variableId);
let query = "";
query += "&variable=" + variableId;
window.location.href = 'macro?'+ query;
let query = "";
query += "&variable=" + variableId;
window.location.href = 'macro?' + query;
});
});
</script>
\ No newline at end of file
......@@ -16,18 +16,17 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
<h1 class="page-header">
Index des rendus
<span class="badge"><?php echo count($rendus); ?> </span>
</h1>
<table class="table table-condensed table-hover">
<table id='rendu-liste' class="table table-condensed table-hover">
<thead>
<tr>
<th> Id </th>
<th> Template </th>
<th> Date de génération </th>
<th> Sujet </th>
<th> Action </th>
</tr>
<tr>
<th> Id</th>
<th> Template</th>
<th> Date de génération</th>
<th> Sujet</th>
<th> Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($rendus as $rendu) : ?>
......@@ -42,15 +41,15 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
<td>
<span title="<?php echo $rendu->getSujet(); ?>" data-toggle="tooltip" data-html="true">
<?php
$sujet = $rendu->getSujet();
if (strlen($sujet) > 50) $sujet = substr($rendu->getSujet(), 0, 46) . " ...";
echo $sujet;
$sujet = $rendu->getSujet();
if (strlen($sujet) > 50) $sujet = substr($rendu->getSujet(), 0, 46) . " ...";
echo $sujet;
?>
</span>
</td>
<td>
<?php if ($canVoir) : ?>
<?php /** @see \UnicaenRenderer\Controller\RenduController::afficherAction() */?>
<?php /** @see \UnicaenRenderer\Controller\RenduController::afficherAction() */ ?>
<a href="<?php echo $this->url('contenu/rendu/afficher', ['rendu' => $rendu->getId()], [], true); ?>"
title="Afficher le rendu" data-toggle="tooltip" data-html="true"
class="ajax-modal"
......@@ -58,12 +57,12 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
<span class="icon voir"></span></a>
<?php endif; ?>
<?php if ($canSupprimer) : ?>
<?php /** @see \UnicaenRenderer\Controller\RenduController::supprimerAction() */?>
<?php /** @see \UnicaenRenderer\Controller\RenduController::supprimerAction() */ ?>
<a href="<?php echo $this->url('contenu/rendu/supprimer', ['rendu' => $rendu->getId()], [], true); ?>"
title="Supprimer le rendu" data-toggle="tooltip" data-html="true"
class="ajax-modal" data-event="modification"
>
<span class="icon detruire"></span></a>
<span class="icon detruire text-danger"></span></a>
<?php endif; ?>
</td>
</tr>
......@@ -72,7 +71,30 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
</table>
<script>
$(function() {
$(function () {
if (jQuery().dataTable) {
$('#rendu-liste').DataTable({
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tous"]],
"columnDefs": [
{targets: 4, orderable: false, searchable: false},
],
"language": {
'lengthMenu': "Afficher _MENU_ &eacute;l&eacute;ments",
"search": "Filtre de recherche : _INPUT_",
"loadingRecords": "Chargement en cours...",
'info': "<small class=\"text-highlight\">Affichage : <strong><i class=\"far fa-list-alt\"></i> _START_ - _END_ sur _TOTAL_</strong></small>",
'infoEmpty': "",
'infoFiltered': "<small class=\"text-highlight\">(_MAX_ &eacute;l&eacute;ments au total)</small>",
'emptyTable': "Aucune donnée disponible.",
'zeroRecords': "Aucun enregistrement trouvé.",
"paginate": {
"previous": "<i class=\"fas fa-chevron-left\"></i>",
"next": "<i class=\"fas fa-chevron-right\"></i>"
}
},
});
}
$("body").on("modification", function (event) {
event.div.modal('hide');
window.location.reload();
......
......@@ -29,7 +29,7 @@ $this->headTitle("Index des templates");
</a>
<?php endif; ?>
<table class="table table-condensed table-hover">
<table id='template-liste' class="table table-condensed table-hover">
<thead>
<tr>
<th> Code </th>
......@@ -69,7 +69,7 @@ $this->headTitle("Index des templates");
<a href="<?php echo $this->url('contenu/template/detruire', ['template' => $template->getId()], [], true); ?>"
class="ajax-modal" data-event="modification"
>
<span class="icon detruire"></span></a>
<span class="icon detruire text-danger"></span></a>
<?php endif; ?>
</td>
</tr>
......@@ -79,6 +79,29 @@ $this->headTitle("Index des templates");
<script>
$(function() {
if(jQuery().dataTable) {
$('#template-liste').DataTable({
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Tous"]],
"columnDefs": [
{targets: 2, orderable: false, searchable: false},
],
"language": {
'lengthMenu': "Afficher _MENU_ &eacute;l&eacute;ments",
"search": "Filtre de recherche : _INPUT_",
"loadingRecords": "Chargement en cours...",
'info': "<small class=\"text-highlight\">Affichage : <strong><i class=\"far fa-list-alt\"></i> _START_ - _END_ sur _TOTAL_</strong></small>",
'infoEmpty': "",
'infoFiltered': "<small class=\"text-highlight\">(_MAX_ &eacute;l&eacute;ments au total)</small>",
'emptyTable': "Aucune donnée disponible.",
'zeroRecords': "Aucun enregistrement trouvé.",
"paginate": {
"previous": "<i class=\"fas fa-chevron-left\"></i>",
"next": "<i class=\"fas fa-chevron-right\"></i>"
}
},
});
}
$("body").on("modification", function (event) {
event.div.modal('hide');
window.location.reload();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment