depot/admin/tmpl/parts/default.php

147 lines
3.9 KiB
PHP
Raw Normal View History

2023-10-03 03:56:38 +02:00
<?php
/**
* @package Depot.Administrator
* @subpackage com_depot
* @author Thomas Kuschel <thomas@kuschel.at>
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
* @license GNU General Public License version 2 or later; see LICENSE.md
* @since 0.0.1
*/
2023-10-15 23:23:02 +02:00
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Layout\LayoutHelper;
2023-10-15 23:23:02 +02:00
2023-10-03 03:56:38 +02:00
?>
2023-10-06 04:47:51 +02:00
2023-10-15 23:23:02 +02:00
<form action="<?= Route::_('index.php?option=com_depot&view=parts'); ?>" method="post" name="adminForm" id="adminForm">
<?= LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
2023-10-15 23:23:02 +02:00
<?php if (empty($this->items)): ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true">
</span>
<?= Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else: ?>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>
<?= HTMLHelper::_('grid.checkall'); ?>
</th>
<th>
2023-10-31 23:25:42 +01:00
<?= HTMLHelper::_(
'searchtools.sort',
'JGRID_HEADING_ID',
'd.id',
$this->listDirn,
$this->listOrder
); ?>
2023-10-15 23:23:02 +02:00
</th>
<th>
2023-10-31 23:25:42 +01:00
<?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_NAME',
'd.component_name',
$this->listDirn,
$this->listOrder
); ?>
2023-10-15 23:23:02 +02:00
</th>
<th>
2023-10-31 23:25:42 +01:00
<?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_QUANTITY',
'd.quantity',
$this->listDirn,
$this->listOrder
); ?>
</th>
<th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_QUANTITY_EXP') ?>
</th>
<th>
2023-10-31 23:25:42 +01:00
<?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_MANUFACTURER',
'manufacturer',
$this->listDirn,
$this->listOrder
); ?>
</th>
<th>
2023-10-31 23:25:42 +01:00
<?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_STOCK',
'stock_name',
$this->listDirn,
$this->listOrder
); ?>
</th>
2023-10-15 23:23:02 +02:00
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $item): ?>
<tr>
<td>
<?= HTMLHelper::_('grid.id', $i, $item->id); ?>
</td>
<td>
<?= $item->id ?>
</td>
<td>
2023-10-29 21:48:49 +01:00
<div class="break-word">
<a href="<?= Route::_('index.php?option=com_depot&task=part.edit&id=' .
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
<?= $this->escape($item->component_name); ?>
</a>
</div>
<div class="small break-word" role="button" title="<?= $item->package_description ?>">
<?= $item->package_name; ?>
<?php if (!empty($item->mounting_style)): ?>
<div class="small break-word">
<?= Text::_('COM_DEPOT_FIELD_PACKAGE_MOUNTING_STYLE_LABEL') . ': '; ?>
<?= Text::alt(
'COM_DEPOT_LIST_MOUNTING_STYLE_' . $item->mounting_style,
Text::_('COM_DEPOT_LIST_MOUNTING_STYLE_UNKNOWN')
); ?>
</div>
<?php endif; ?>
</div>
2023-10-15 23:23:02 +02:00
</td>
<td>
<?= $this->escape($item->quantity); ?>
</td>
<td>
<?= "10^" . $item->quantity_exp; ?>
</td>
<td>
<a href="<?= Route::_('index.php?option=com_depot&task=manufacturer.edit&id=' .
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
<?= $this->escape($item->manufacturer); ?>
</a>
</td>
<td>
2023-10-31 23:25:42 +01:00
<a class="break-word" href="<?= Route::_('index.php?option=com_depot&task=stock.edit&id=' .
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
<?= $this->escape($item->stock_name); ?>
</a>
2023-10-31 23:25:42 +01:00
<div class="small">
<?= $this->escape($item->owner); ?>
</div>
</td>
2023-10-15 23:23:02 +02:00
</tr>
<?php endforeach; ?>
</tbody>
</table>
2023-11-01 08:06:41 +01:00
<?php echo $this->pagination->getListFooter(); ?>
2023-10-15 23:23:02 +02:00
<?php endif; ?>
2023-10-15 16:17:17 +02:00
2023-10-15 23:23:02 +02:00
<input type="hidden" name="task" value="">
<input type="hidden" name="boxchecked" value="0">
<?= HTMLHelper::_('form.token'); ?>
</form>