From 02489e4550cb08dd2518e6286c830a8f8ae7b8b8 Mon Sep 17 00:00:00 2001 From: JBthePenguin Date: Wed, 1 Sep 2021 10:19:37 +0200 Subject: [PATCH] ok for output index in movement --- src/templates/mouvements/sorties/index.tpl | 38 +++++----------------- src/www/admin/mouvements/sorties/index.php | 17 +++------- 2 files changed, 13 insertions(+), 42 deletions(-) diff --git a/src/templates/mouvements/sorties/index.tpl b/src/templates/mouvements/sorties/index.tpl index 52854eb..83f43b5 100644 --- a/src/templates/mouvements/sorties/index.tpl +++ b/src/templates/mouvements/sorties/index.tpl @@ -1,36 +1,16 @@ + {include file="%s_nav.tpl"|args:$plugin_tpl current_nav="sorties"} - + +
Ajouter une sortie pour du {linkbutton shape="plus" label="Matériel en stock disponible" href="stock_disponible.php"} {linkbutton shape="plus" label="Matériel emprunté" href="emprunte.php"}
- -{if $outputs} - - - - - - - - - - - {foreach from=$outputs item="output"} - - - - - - - - - {/foreach} - -
DateTypeNombreMatérielRemarques
{$output.output_date|date_format:'%d/%m/%y'}{$output.kind}{$output.equipment_number}{$output.equipment}{$output.additional_comment} - {linkbutton shape="delete" label="Supprimer" href="supprimer_sortie.php?id=%d"|args:$output.id} -
-{/if} - + + +{include file="%smouvements/tableau_mouvements.tpl"|args:$plugin_tpl mvts=$mvts del_href="supprimer_sortie.php?id=%d"} + + {include file="admin/_foot.tpl"} + diff --git a/src/www/admin/mouvements/sorties/index.php b/src/www/admin/mouvements/sorties/index.php index 1b7eede..711e022 100644 --- a/src/www/admin/mouvements/sorties/index.php +++ b/src/www/admin/mouvements/sorties/index.php @@ -2,21 +2,12 @@ namespace Garradin; -use Garradin\Plugin\Materiels\Equipment; -use Garradin\Plugin\Materiels\Output; +require_once __DIR__ . '/../_inc.php'; -require_once __DIR__ . '/../../_inc.php'; +// get the list of all outputs and send it to template -$eqmt = new Equipment; -$output = new Output; +$mvts = $mvt->listAllOneSide(1); -$outputs = $output->listAll(); - -foreach ($outputs as $key => $value) { - $output_eqmt = $eqmt->get($value->equipment_id); - $outputs[$key]->equipment = $output_eqmt->designation; -} - -$tpl->assign(compact('outputs')); +$tpl->assign(compact('mvts')); $tpl->display(PLUGIN_ROOT . '/templates/mouvements/sorties/index.tpl');