ok for available equiment output tpl, next add validate form in php file

This commit is contained in:
JBthePenguin 2021-06-09 17:58:48 +02:00
parent 08e2af1f1d
commit d58ae812b5
8 changed files with 121 additions and 30 deletions

View file

@ -0,0 +1,35 @@
<?php
namespace Garradin;
use Garradin\Plugin\Materiels\Output;
use Garradin\Plugin\Materiels\Equipment;
use Garradin\Utils;
require_once __DIR__ . '/../_inc.php';
$output = new Output;
$eqmt = new Equipment;
$eqmts_by_cat = $eqmt->GetAvailableListByCategory();
$csrf_key = 'add_output';
$kinds = $output->listKinds();
$selected_kind = $kinds[0];
$date = new \DateTime;
$date->setTimestamp(time());
$default_date = $date;
$default_comment = "";
$cancel_link = PLUGIN_URL . 'sorties/index.php';
$legend_part = "en stock disponible";
$tpl_materiel_name = "stock_disponible";
$tpl->assign(compact(
'csrf_key', 'cancel_link', 'legend_part', 'tpl_materiel_name',
'kinds', 'selected_kind', 'default_date', 'default_comment',
'eqmts_by_cat'));
$tpl->display(PLUGIN_ROOT . '/templates/sorties/ajouter_sortie.tpl');