ok for entry index in movement
This commit is contained in:
parent
5c85f04581
commit
e2bc0ea8f8
|
@ -7,4 +7,16 @@ use Garradin\Plugin\Materiels\Equipment;
|
||||||
|
|
||||||
class Movement
|
class Movement
|
||||||
{
|
{
|
||||||
|
public function listAllOneSide($side)
|
||||||
|
// return all entries if side is 0 or all outputs if side is 1 ordered by date
|
||||||
|
{
|
||||||
|
$mvts = DB::getInstance()->get("SELECT * FROM plugin_materiels_movement WHERE side = '{$side}' ORDER BY mvt_date DESC;");
|
||||||
|
// for each movements get the equipment's designation
|
||||||
|
$eqmt = new Equipment;
|
||||||
|
foreach ($mvts as $key => $value) {
|
||||||
|
$mvt_eqmt = $eqmt->get($value->equipment_id);
|
||||||
|
$mvts[$key]->equipment = $mvt_eqmt->designation;
|
||||||
|
}
|
||||||
|
return $mvts;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,17 @@
|
||||||
|
<!-- nav bar-->
|
||||||
{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="entrees"}
|
{include file="%s_nav.tpl"|args:$plugin_tpl current_nav="entrees"}
|
||||||
|
<!-- -->
|
||||||
|
<!-- add entry links -->
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Ajouter une entrée pour du </legend>
|
<legend>Ajouter une entrée pour du </legend>
|
||||||
{linkbutton shape="plus" label="Matériel répertorié" href="repertorie.php"}
|
{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 non répertorié" href="non_repertorie.php"}
|
||||||
{linkbutton shape="plus" label="Matériel en retour de location / prêt" href="retour.php"}
|
{linkbutton shape="plus" label="Matériel en retour de location / prêt" href="retour.php"}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<!-- -->
|
||||||
{if $entries}
|
<!-- entries table -->
|
||||||
<table class="list">
|
{include file="%smouvements/tableau_mouvements.tpl"|args:$plugin_tpl mvts=$mvts del_href="supprimer_entree.php?id=%d"}
|
||||||
<thead>
|
<!-- -->
|
||||||
<th><b>Date</b></th>
|
<!-- footer -->
|
||||||
<th><b>Type</b></th>
|
|
||||||
<th><b>Nombre</b></th>
|
|
||||||
<th><b>Matériel</b></th>
|
|
||||||
<th><b>Remarques</b></th>
|
|
||||||
<th></th>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{foreach from=$entries item="entry"}
|
|
||||||
<tr>
|
|
||||||
<td>{$entry.entry_date|date_format:'%d/%m/%y'}</td>
|
|
||||||
<td>{$entry.kind}</td>
|
|
||||||
<td>{$entry.equipment_number}</td>
|
|
||||||
<td>{$entry.equipment}</td>
|
|
||||||
<td>{$entry.additional_comment}</td>
|
|
||||||
<td class="actions">
|
|
||||||
{linkbutton shape="delete" label="Supprimer" href="supprimer_entree.php?id=%d"|args:$entry.id}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/foreach}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{include file="admin/_foot.tpl"}
|
{include file="admin/_foot.tpl"}
|
||||||
|
<!-- -->
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<!-- table of movements -->
|
||||||
|
{if $mvts}
|
||||||
|
<table class="list">
|
||||||
|
<thead>
|
||||||
|
<th><b>Date</b></th>
|
||||||
|
<th><b>Type</b></th>
|
||||||
|
<th><b>Nombre</b></th>
|
||||||
|
<th><b>Matériel</b></th>
|
||||||
|
<th><b>Remarques</b></th>
|
||||||
|
<th></th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{foreach from=$mvts item="mvt"}
|
||||||
|
<tr>
|
||||||
|
<td>{$mvt.mvt_date|date_format:'%d/%m/%y'}</td>
|
||||||
|
<td>{$mvt.kind}</td>
|
||||||
|
<td>{$mvt.equipment_number}</td>
|
||||||
|
<td>{$mvt.equipment}</td>
|
||||||
|
<td>{$mvt.additional_comment}</td>
|
||||||
|
<td class="actions">
|
||||||
|
{linkbutton shape="delete" label="Supprimer" href=$del_href|args:$mvt.id}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{/if}
|
||||||
|
<!-- -->
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
namespace Garradin;
|
namespace Garradin;
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../_inc.php';
|
||||||
|
|
||||||
use Garradin\Plugin\Materiels\Category;
|
use Garradin\Plugin\Materiels\Category;
|
||||||
|
|
||||||
$cat = new Category;
|
$cat = new Category;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace Garradin;
|
namespace Garradin;
|
||||||
|
|
||||||
require_once __DIR__ . '/../_inc.php';
|
|
||||||
require_once __DIR__ . '/_inc.php';
|
require_once __DIR__ . '/_inc.php';
|
||||||
|
|
||||||
use Garradin\Utils;
|
use Garradin\Utils;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace Garradin;
|
namespace Garradin;
|
||||||
|
|
||||||
require_once __DIR__ . '/../_inc.php';
|
|
||||||
require_once __DIR__ . '/_inc.php';
|
require_once __DIR__ . '/_inc.php';
|
||||||
|
|
||||||
use Garradin\Plugin\Materiels\Equipment;
|
use Garradin\Plugin\Materiels\Equipment;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace Garradin;
|
namespace Garradin;
|
||||||
|
|
||||||
require_once __DIR__ . '/../_inc.php';
|
|
||||||
require_once __DIR__ . '/_inc.php';
|
require_once __DIR__ . '/_inc.php';
|
||||||
|
|
||||||
use Garradin\Utils;
|
use Garradin\Utils;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace Garradin;
|
namespace Garradin;
|
||||||
|
|
||||||
require_once __DIR__ . '/../_inc.php';
|
|
||||||
require_once __DIR__ . '/_inc.php';
|
require_once __DIR__ . '/_inc.php';
|
||||||
|
|
||||||
use Garradin\Utils;
|
use Garradin\Utils;
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// create variable with Movement class
|
||||||
|
|
||||||
|
namespace Garradin;
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../_inc.php';
|
||||||
|
|
||||||
|
use Garradin\Plugin\Materiels\Movement;
|
||||||
|
|
||||||
|
$mvt = new Movement;
|
|
@ -2,21 +2,12 @@
|
||||||
|
|
||||||
namespace Garradin;
|
namespace Garradin;
|
||||||
|
|
||||||
use Garradin\Plugin\Materiels\Equipment;
|
require_once __DIR__ . '/../_inc.php';
|
||||||
use Garradin\Plugin\Materiels\Entry;
|
|
||||||
|
|
||||||
require_once __DIR__ . '/../../_inc.php';
|
// get the list of all entries and send it to template
|
||||||
|
|
||||||
$eqmt = new Equipment;
|
$mvts = $mvt->listAllOneSide(0);
|
||||||
$entry = new Entry;
|
|
||||||
|
|
||||||
$entries = $entry->listAll();
|
$tpl->assign(compact('mvts'));
|
||||||
|
|
||||||
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');
|
$tpl->display(PLUGIN_ROOT . '/templates/mouvements/entrees/index.tpl');
|
||||||
|
|
Loading…
Reference in New Issue