From 4bb7e7d3b9f3707c8488a0bca593da9b114224c2 Mon Sep 17 00:00:00 2001 From: JBthePenguin Date: Tue, 31 Aug 2021 16:51:45 +0200 Subject: [PATCH] begin to add movements to clean entry and output --- src/lib/Movement.php | 10 ++++++ src/schema.sql | 2 +- src/templates/_nav.tpl | 6 ++-- src/templates/entrees/ajouter_entree.tpl | 4 +-- src/templates/entrees/index.tpl | 4 +-- src/templates/entrees/supprimer_entree.tpl | 4 +-- src/templates/mouvements/entrees/index.tpl | 37 ++++++++++++++++++++++ src/templates/mouvements/sorties/index.tpl | 36 +++++++++++++++++++++ src/templates/sorties/ajouter_sortie.tpl | 4 +-- src/templates/sorties/index.tpl | 4 +-- src/templates/sorties/supprimer_sortie.tpl | 4 +-- src/www/admin/mouvements/entrees/index.php | 22 +++++++++++++ src/www/admin/mouvements/sorties/index.php | 22 +++++++++++++ 13 files changed, 138 insertions(+), 21 deletions(-) create mode 100644 src/lib/Movement.php create mode 100644 src/templates/mouvements/entrees/index.tpl create mode 100644 src/templates/mouvements/sorties/index.tpl create mode 100644 src/www/admin/mouvements/entrees/index.php create mode 100644 src/www/admin/mouvements/sorties/index.php diff --git a/src/lib/Movement.php b/src/lib/Movement.php new file mode 100644 index 0000000..e29d710 --- /dev/null +++ b/src/lib/Movement.php @@ -0,0 +1,10 @@ +
  • Inventaire
  • Catégories
  • -
  • Entrées
  • -
  • Sorties
  • +
  • Entrées (old)
  • +
  • Sorties (old)
  • +
  • Entrées
  • +
  • Sorties
  • diff --git a/src/templates/entrees/ajouter_entree.tpl b/src/templates/entrees/ajouter_entree.tpl index 7d2513f..be3c43a 100644 --- a/src/templates/entrees/ajouter_entree.tpl +++ b/src/templates/entrees/ajouter_entree.tpl @@ -1,6 +1,4 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees"} +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="entrees_old"}
    diff --git a/src/templates/entrees/index.tpl b/src/templates/entrees/index.tpl index 04eec52..1d1be21 100644 --- a/src/templates/entrees/index.tpl +++ b/src/templates/entrees/index.tpl @@ -1,6 +1,4 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees"} +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="entrees_old"}
    Ajouter une entrée pour du diff --git a/src/templates/entrees/supprimer_entree.tpl b/src/templates/entrees/supprimer_entree.tpl index 8a660b2..f3f83d4 100644 --- a/src/templates/entrees/supprimer_entree.tpl +++ b/src/templates/entrees/supprimer_entree.tpl @@ -1,6 +1,4 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees"} +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="entrees_old"} {include file="%scommon/delete_form.tpl"|args:$plugin_tpl legend="Supprimer cette entrée de matériels ?" diff --git a/src/templates/mouvements/entrees/index.tpl b/src/templates/mouvements/entrees/index.tpl new file mode 100644 index 0000000..6caf332 --- /dev/null +++ b/src/templates/mouvements/entrees/index.tpl @@ -0,0 +1,37 @@ +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="entrees"} + +
    + Ajouter une entrée pour du + {linkbutton shape="plus" label="Matériel répertorié" href="repertorie.php"} + {linkbutton shape="plus" label="Matériel non répertorié" href="non_repertorie.php"} + {linkbutton shape="plus" label="Matériel en retour de location / prêt" href="retour.php"} +
    + +{if $entries} + + + + + + + + + + + {foreach from=$entries item="entry"} + + + + + + + + + {/foreach} + +
    DateTypeNombreMatérielRemarques
    {$entry.entry_date|date_format:'%d/%m/%y'}{$entry.kind}{$entry.equipment_number}{$entry.equipment}{$entry.additional_comment} + {linkbutton shape="delete" label="Supprimer" href="supprimer_entree.php?id=%d"|args:$entry.id} +
    +{/if} + +{include file="admin/_foot.tpl"} diff --git a/src/templates/mouvements/sorties/index.tpl b/src/templates/mouvements/sorties/index.tpl new file mode 100644 index 0000000..52854eb --- /dev/null +++ b/src/templates/mouvements/sorties/index.tpl @@ -0,0 +1,36 @@ +{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="admin/_foot.tpl"} diff --git a/src/templates/sorties/ajouter_sortie.tpl b/src/templates/sorties/ajouter_sortie.tpl index a1cd178..45b9d0d 100644 --- a/src/templates/sorties/ajouter_sortie.tpl +++ b/src/templates/sorties/ajouter_sortie.tpl @@ -1,6 +1,4 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="sorties"} +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="sorties_old"}
    diff --git a/src/templates/sorties/index.tpl b/src/templates/sorties/index.tpl index e924a95..94b61b9 100644 --- a/src/templates/sorties/index.tpl +++ b/src/templates/sorties/index.tpl @@ -1,6 +1,4 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="sorties"} +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="sorties_old"}
    Ajouter une sortie pour du diff --git a/src/templates/sorties/supprimer_sortie.tpl b/src/templates/sorties/supprimer_sortie.tpl index 86ab081..4944a03 100644 --- a/src/templates/sorties/supprimer_sortie.tpl +++ b/src/templates/sorties/supprimer_sortie.tpl @@ -1,6 +1,4 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="sorties"} +{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="sorties_old"} {include file="%scommon/delete_form.tpl"|args:$plugin_tpl legend="Supprimer cette sortie de matériels ?" diff --git a/src/www/admin/mouvements/entrees/index.php b/src/www/admin/mouvements/entrees/index.php new file mode 100644 index 0000000..94125e2 --- /dev/null +++ b/src/www/admin/mouvements/entrees/index.php @@ -0,0 +1,22 @@ +listAll(); + +foreach ($entries as $key => $value) { + $entry_eqmt = $eqmt->get($value->equipment_id); + $entries[$key]->equipment = $entry_eqmt->designation; +} + +$tpl->assign(compact('entries')); + +$tpl->display(PLUGIN_ROOT . '/templates/mouvements/entrees/index.tpl'); diff --git a/src/www/admin/mouvements/sorties/index.php b/src/www/admin/mouvements/sorties/index.php new file mode 100644 index 0000000..1b7eede --- /dev/null +++ b/src/www/admin/mouvements/sorties/index.php @@ -0,0 +1,22 @@ +listAll(); + +foreach ($outputs as $key => $value) { + $output_eqmt = $eqmt->get($value->equipment_id); + $outputs[$key]->equipment = $output_eqmt->designation; +} + +$tpl->assign(compact('outputs')); + +$tpl->display(PLUGIN_ROOT . '/templates/mouvements/sorties/index.tpl');