Ordering and search, no pagination yet

This commit is contained in:
Thomas Kuschel 2023-10-31 23:25:42 +01:00
parent 6d03c99a34
commit 3f72ee89ca
30 changed files with 466 additions and 107 deletions

View File

@ -31,10 +31,12 @@
<option value="">JGLOBAL_SORT_BY</option> <option value="">JGLOBAL_SORT_BY</option>
<option value="m.state ASC">JSTATUS_ASC</option> <option value="m.state ASC">JSTATUS_ASC</option>
<option value="m.state DESC">JSTATUS_DESC</option> <option value="m.state DESC">JSTATUS_DESC</option>
<option value="m.name_long ASC">JGLOBAL_NAME_ASC</option> <option value="m.name_long ASC">COM_DEPOT_SORT_BY_MANUFACTURER_ASC</option>
<option value="m.name_long DESC">JGLOBAL_NAME_DESC</option> <option value="m.name_long DESC">COM_DEPOT_SORT_BY_MANUFACTURER_DESC</option>
<option value="m.name_short ASC">COM_DEPOT_ACRONYM_ASC</option> <option value="m.name_short ASC">COM_DEPOT_SORT_BY_ACRONYM_ASC</option>
<option value="m.name_short DESC">COM_DEPOT_ACRONYM_DESC</option> <option value="m.name_short DESC">COM_DEPOT_SORT_BY_ACRONYM_DESC</option>
<option value="m.description ASC">COM_DEPOT_SORT_BY_DESCRIPTION_ASC</option>
<option value="m.description DESC">COM_DEPOT_SORT_BY_DESCRIPTION_DESC</option>
<option value="m.id ASC">JGRID_HEADING_ID_ASC</option> <option value="m.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="m.id DESC">JGRID_HEADING_ID_DESC</option> <option value="m.id DESC">JGRID_HEADING_ID_DESC</option>
</field> </field>

View File

@ -17,34 +17,7 @@
> >
<option value="">JOPTION_SELECT_PUBLISHED</option> <option value="">JOPTION_SELECT_PUBLISHED</option>
</field> </field>
<field
name="manufacturer_id"
type="depotmanufacturer"
label="COM_DEPOT_HEADING_MANUFACTURER"
extension="com_depot"
class="js-select-submit-on-change"
>
<option value="">COM_DEPOT_SELECT_MANUFACTURER</option>
</field>
<field
name="stock_id"
type="depotstock"
label="COM_DEPOT_HEADING_STOCK"
extension="com_depot"
class="js-select-submit-on-change"
>
<option value="">COM_DEPOT_SELECT_STOCK</option>
</field>
</fields> </fields>
<!-- ('d.id'),
$db->quoteName('d.component_name'),
$db->quoteName('d.alias'),
$db->quoteName('d.description'),
$db->quoteName('d.quantity'),
$db->quoteName('d.quantity_exp'),
$db->quoteName('d.ordering'),
-->
<fields name="list"> <fields name="list">
<field <field
name="fullordering" name="fullordering"
@ -64,6 +37,8 @@
<option value="d.component_name DESC">JGLOBAL_NAME_DESC</option> <option value="d.component_name DESC">JGLOBAL_NAME_DESC</option>
<option value="d.quantity ASC">COM_DEPOT_SORT_BY_QUANTITY_ASC</option> <option value="d.quantity ASC">COM_DEPOT_SORT_BY_QUANTITY_ASC</option>
<option value="d.quantity DESC">COM_DEPOT_SORT_BY_QUANTITY_DESC</option> <option value="d.quantity DESC">COM_DEPOT_SORT_BY_QUANTITY_DESC</option>
<option value="manufacturer ASC">COM_DEPOT_SORT_BY_MANUFACTURER_ASC</option>
<option value="manufacturer DESC">COM_DEPOT_SORT_BY_MANUFACTURER_DESC</option>
<option value="d.id ASC">JGRID_HEADING_ID_ASC</option> <option value="d.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="d.id DESC">JGRID_HEADING_ID_DESC</option> <option value="d.id DESC">JGRID_HEADING_ID_DESC</option>
</field> </field>

View File

@ -33,6 +33,8 @@
<option value="s.state DESC">JSTATUS_DESC</option> <option value="s.state DESC">JSTATUS_DESC</option>
<option value="s.name ASC">JGLOBAL_NAME_ASC</option> <option value="s.name ASC">JGLOBAL_NAME_ASC</option>
<option value="s.name DESC">JGLOBAL_NAME_DESC</option> <option value="s.name DESC">JGLOBAL_NAME_DESC</option>
<option value="owner ASC">COM_DEPOT_SORT_BY_OWNER_ASC</option>
<option value="owner DESC">COM_DEPOT_SORT_BY_OWNER_DESC</option>
<option value="s.description ASC">COM_DEPOT_SORT_BY_DESCRIPTION_ASC</option> <option value="s.description ASC">COM_DEPOT_SORT_BY_DESCRIPTION_ASC</option>
<option value="s.description DESC">COM_DEPOT_SORT_BY_DESCRIPTION_DESC</option> <option value="s.description DESC">COM_DEPOT_SORT_BY_DESCRIPTION_DESC</option>
<option value="s.id ASC">JGRID_HEADING_ID_ASC</option> <option value="s.id ASC">JGRID_HEADING_ID_ASC</option>

View File

@ -21,6 +21,12 @@
description="COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC" description="COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC"
required="true" required="true"
/> />
<field
name="owner_id"
type="user"
label="COM_DEPOT_FIELD_STOCK_OWNER_LABEL"
description="COM_DEPOT_FIELD_STOCK_OWNER_DESC"
/>
<field <field
name="alias" name="alias"
type="text" type="text"

View File

@ -1,24 +1,20 @@
; @package Depot.Language ; @package Depot.Language German de-DE
; @subpackage com_depot ; @subpackage com_depot
; @author Thomas Kuschel <thomas@kuschel.at> ; @author Thomas Kuschel <thomas@kuschel.at>
; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at> ; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
; @license GNU General Public License version 2 or later; see LICENSE.md ; @license GNU General Public License version 2 or later; see LICENSE.md
; @since 0.0.1 ; @since 0.0.1
; ;
COM_DEPOT_FIELD_ALIAS_MANUFACTURER_PLACEHOLDER="Automatisch aus dem Herstellerkürzel generieren"
COM_DEPOT_FIELD_ALIAS_PACKAGE_PLACEHOLDER="Automatisch aus dem Gehäusenamen erzeugen" COM_DEPOT_FIELD_ALIAS_PACKAGE_PLACEHOLDER="Automatisch aus dem Gehäusenamen erzeugen"
COM_DEPOT_FIELD_ALIAS_PART_PLACEHOLDER="Automatisch aus dem Bauteilnamen erzeugen" COM_DEPOT_FIELD_ALIAS_PART_PLACEHOLDER="Automatisch aus dem Bauteilnamen erzeugen"
COM_DEPOT_FIELD_ALIAS_STOCK_PLACEHOLDER="Automatisch aus dem Lagernamen erzeugen" COM_DEPOT_FIELD_ALIAS_STOCK_PLACEHOLDER="Automatisch aus dem Lagernamen erzeugen"
COM_DEPOT_FIELD_ALIAS_MANUFACTURER_PLACEHOLDER="Automatisch aus dem Herstellerkürzel generieren"
COM_DEPOT_FIELD_COMPONENT_NAME_DESC="Der Bauteilname ist eindeutig. Bitte geben Sie keine Sonderzeichen oder Umlaute ein." COM_DEPOT_FIELD_COMPONENT_NAME_DESC="Der Bauteilname ist eindeutig. Bitte geben Sie keine Sonderzeichen oder Umlaute ein."
COM_DEPOT_FIELD_COMPONENT_NAME_LABEL="Bauteilname" COM_DEPOT_FIELD_COMPONENT_NAME_LABEL="Bauteilname"
;COM_DEPOT_FIELD_CREATED_LABEL="Erstellt"
;COM_DEPOT_FIELD_CREATED_BY_LABEL="Erstellt von"
COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_DESC="Geben Sie hier das Herstellerkürzel oder einen kurzen Namen ein" COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_DESC="Geben Sie hier das Herstellerkürzel oder einen kurzen Namen ein"
COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_LABEL="Herstellerkürzel" COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_LABEL="Herstellerkürzel"
COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_DESC="Geben Sie hier die vollständige Herstellerbezeichnung ein" COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_DESC="Geben Sie hier die vollständige Herstellerbezeichnung ein"
COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_LABEL="Hersteller (vollständige Bezeichnung)" COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_LABEL="Hersteller (vollständige Bezeichnung)"
;COM_DEPOT_FIELD_MODIFIED_LABEL="Modified"
;COM_DEPOT_FIELD_MODIFIED_BY_LABEL="Modified by"
COM_DEPOT_FIELD_PACKAGE_LABEL="Gehäuse" COM_DEPOT_FIELD_PACKAGE_LABEL="Gehäuse"
COM_DEPOT_FIELD_PACKAGE_MOUNTING_STYLE_LABEL="Montageart" COM_DEPOT_FIELD_PACKAGE_MOUNTING_STYLE_LABEL="Montageart"
COM_DEPOT_FIELD_PACKAGE_NAME_DESC="Geben Sie hier das Gehäuse des Bauteils ein" COM_DEPOT_FIELD_PACKAGE_NAME_DESC="Geben Sie hier das Gehäuse des Bauteils ein"
@ -30,19 +26,21 @@ COM_DEPOT_FIELD_QUANTITY_EXP_DESC="Exponent (10^x der Anzahl, normalerweise 0, d
COM_DEPOT_FIELD_SELECT_MANUFACTURER="Hersteller" COM_DEPOT_FIELD_SELECT_MANUFACTURER="Hersteller"
COM_DEPOT_FIELD_SELECT_PACKAGE="Gehäuse" COM_DEPOT_FIELD_SELECT_PACKAGE="Gehäuse"
COM_DEPOT_FIELD_SELECT_STOCK="Lagerort" COM_DEPOT_FIELD_SELECT_STOCK="Lagerort"
COM_DEPOT_FIELD_STOCK_NAME_DESC="Geben Sie hier den Lagerort (Kurzbezeichnung) ein"
COM_DEPOT_FIELD_STOCK_NAME_LABEL="Lagerort"
COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC="Geben Sie hier die exakte Position/Beschreibung ein" COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC="Geben Sie hier die exakte Position/Beschreibung ein"
COM_DEPOT_FIELD_STOCK_DESCRIPTION_LABEL="Beschreibung" COM_DEPOT_FIELD_STOCK_DESCRIPTION_LABEL="Beschreibung"
COM_DEPOT_FIELD_STOCK_NAME_DESC="Geben Sie hier den Lagerort (Kurzbezeichnung) ein"
COM_DEPOT_FIELD_STOCK_NAME_LABEL="Lagerort"
COM_DEPOT_FIELD_STOCK_OWNER_DESC="Geben Sie hier den Besitzer des Lagers ein"
COM_DEPOT_FIELD_STOCK_OWNER_LABEL="Besitzer"
COM_DEPOT_FILTER_SEARCH_PARTS_DESC="Bauteilsuche" COM_DEPOT_FILTER_SEARCH_PARTS_DESC="Bauteilsuche"
COM_DEPOT_FILTER_SEARCH_PARTS_LABEL="Bauteilsuche" COM_DEPOT_FILTER_SEARCH_PARTS_LABEL="Bauteilsuche"
COM_DEPOT_FILTER_SEARCH_STOCKS_LABEL="Lagerortsuche"
COM_DEPOT_FILTER_SEARCH_STOCKS_DESC="Suche des Lagerortes" COM_DEPOT_FILTER_SEARCH_STOCKS_DESC="Suche des Lagerortes"
COM_DEPOT_FILTER_SEARCH_STOCKS_LABEL="Lagerortsuche"
COM_DEPOT_LEGEND_MANUFACTURER_DETAILS="Herstellerdetails" COM_DEPOT_LEGEND_MANUFACTURER_DETAILS="Herstellerdetails"
COM_DEPOT_LEGEND_PACKAGE_DETAILS="Gehäusedetails" COM_DEPOT_LEGEND_PACKAGE_DETAILS="Gehäusedetails"
COM_DEPOT_LEGEND_PART_DETAILS="Bauteildetails" COM_DEPOT_LEGEND_PART_DETAILS="Bauteildetails"
COM_DEPOT_LEGEND_STOCK_DETAILS="Lagerort-Details"
COM_DEPOT_LEGEND_STATISTICS="Statistik" COM_DEPOT_LEGEND_STATISTICS="Statistik"
COM_DEPOT_LEGEND_STOCK_DETAILS="Lagerort-Details"
COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT="Gehäuse-Montage" COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT="Gehäuse-Montage"
COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT="Presspassung" COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT="Presspassung"
COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT="Schraubbefestigung" COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT="Schraubbefestigung"
@ -53,32 +51,59 @@ COM_DEPOT_MANAGER_MANUFACTURERS="Verwaltung Hersteller"
COM_DEPOT_MANAGER_PACKAGES="Verwaltung Gehäuse" COM_DEPOT_MANAGER_PACKAGES="Verwaltung Gehäuse"
COM_DEPOT_MANAGER_PARTS="Verwaltung Bauteile" COM_DEPOT_MANAGER_PARTS="Verwaltung Bauteile"
COM_DEPOT_MANAGER_STOCKS="Verwaltung Lagerorte" COM_DEPOT_MANAGER_STOCKS="Verwaltung Lagerorte"
COM_DEPOT_MANUFACTURERS_N_ITEMS_DELETED_1="Ein Hersteller entfernt"
COM_DEPOT_MANUFACTURERS_N_ITEMS_DELETED_MORE="%d Hersteller entfernt"
COM_DEPOT_MANUFACTURERS_N_ITEMS_PUBLISHED_1="Ein Hersteller veröffentlicht"
COM_DEPOT_MANUFACTURERS_N_ITEMS_PUBLISHED_MORE="%d Hersteller veröffentlicht"
COM_DEPOT_MANUFACTURERS_N_ITEMS_UNPUBLISHED_1="Ein Hersteller versteckt"
COM_DEPOT_MANUFACTURERS_N_ITEMS_UNPUBLISHED_MORE="%d Hersteller versteckt"
COM_DEPOT_N_ITEMS_DELETED_1="Ein Bauteil entfernt" COM_DEPOT_N_ITEMS_DELETED_1="Ein Bauteil entfernt"
COM_DEPOT_N_ITEMS_DELETED_MORE="%d Bauteile entfernt" COM_DEPOT_N_ITEMS_DELETED_MORE="%d Bauteile entfernt"
COM_DEPOT_N_ITEMS_PUBLISHED_1="Ein Bauteil veröffentlicht" COM_DEPOT_N_ITEMS_PUBLISHED_1="Ein Bauteil veröffentlicht"
COM_DEPOT_N_ITEMS_PUBLISHED_MORE="%d Bauteile veröffentlicht" COM_DEPOT_N_ITEMS_PUBLISHED_MORE="%d Bauteile veröffentlicht"
COM_DEPOT_N_ITEMS_UNPUBLISHED_1="Ein Bauteil versteckt" COM_DEPOT_N_ITEMS_UNPUBLISHED_1="Ein Bauteil versteckt"
COM_DEPOT_N_ITEMS_UNPUBLISHED_MORE="%d Bauteile versteckt" COM_DEPOT_N_ITEMS_UNPUBLISHED_MORE="%d Bauteile versteckt"
COM_DEPOT_PACKAGES_N_ITEMS_DELETED_1="Ein Gehäuse entfernt"
COM_DEPOT_PACKAGES_N_ITEMS_DELETED_MORE="%d Gehäuse entfernt"
COM_DEPOT_PACKAGES_N_ITEMS_PUBLISHED_1="Ein Gehäuse veröffentlicht"
COM_DEPOT_PACKAGES_N_ITEMS_PUBLISHED_MORE="%d Gehäuse veröffentlicht"
COM_DEPOT_PACKAGES_N_ITEMS_UNPUBLISHED_1="Ein Gehäuse versteckt"
COM_DEPOT_PACKAGES_N_ITEMS_UNPUBLISHED_MORE="%d Gehäuse versteckt"
COM_DEPOT_SELECT_YOUR_OPTION="Wählen Sie Ihre Option" COM_DEPOT_SELECT_YOUR_OPTION="Wählen Sie Ihre Option"
COM_DEPOT_SORT_BY_ACRONYM_ASC="Herstellerkürzel aufsteigend"
COM_DEPOT_SORT_BY_ACRONYM_DESC="Herstellerkürzel absteigend"
COM_DEPOT_SORT_BY_DESCRIPTION_ASC="Beschreibung aufsteigend" COM_DEPOT_SORT_BY_DESCRIPTION_ASC="Beschreibung aufsteigend"
COM_DEPOT_SORT_BY_DESCRIPTION_DESC="Beschreibung absteigend" COM_DEPOT_SORT_BY_DESCRIPTION_DESC="Beschreibung absteigend"
COM_DEPOT_SORT_BY_MANUFACTURER_ASC="Hersteller aufsteigend"
COM_DEPOT_SORT_BY_MANUFACTURER_DESC="Hersteller absteigend"
COM_DEPOT_SORT_BY_OWNER_ASC="Besitzer aufsteigend"
COM_DEPOT_SORT_BY_OWNER_DESC="Besitzer absteigend"
COM_DEPOT_SORT_BY_QUANTITY_ASC="Menge aufsteigend" COM_DEPOT_SORT_BY_QUANTITY_ASC="Menge aufsteigend"
COM_DEPOT_SORT_BY_QUANTITY_DESC="Menge absteigend" COM_DEPOT_SORT_BY_QUANTITY_DESC="Menge absteigend"
COM_DEPOT_TAB_NEW_PART="Neues Bauteil" COM_DEPOT_SORT_BY_STOCK_NAME_ASC="Lagerort aufsteigend"
COM_DEPOT_TAB_NEW_MANUFACTURER="Neuer Hersteller" COM_DEPOT_SORT_BY_STOCK_NAME_DESC="Lagerort absteigend"
COM_DEPOT_TAB_EDIT_PART="Bauteildetails" COM_DEPOT_STOCKS_N_ITEMS_DELETED_1="Ein Lagerort entfernt"
COM_DEPOT_TAB_EDIT_PACKAGE="Gehäusedetails" COM_DEPOT_STOCKS_N_ITEMS_DELETED_MORE="%d Lagerorte entfernt"
COM_DEPOT_STOCKS_N_ITEMS_PUBLISHED_1="Ein Lagerort veröffentlicht"
COM_DEPOT_STOCKS_N_ITEMS_PUBLISHED_MORE="%d Lagerorte veröffentlicht"
COM_DEPOT_STOCKS_N_ITEMS_UNPUBLISHED_1="Ein Lagerort versteckt"
COM_DEPOT_STOCKS_N_ITEMS_UNPUBLISHED_MORE="%d Lagerorte versteckt"
COM_DEPOT_TAB_EDIT_MANUFACTURER="Herstellerdetails" COM_DEPOT_TAB_EDIT_MANUFACTURER="Herstellerdetails"
COM_DEPOT_TAB_EDIT_PACKAGE="Gehäusedetails"
COM_DEPOT_TAB_EDIT_PART="Bauteildetails"
COM_DEPOT_TAB_EDIT_STOCK="Lagerdetails" COM_DEPOT_TAB_EDIT_STOCK="Lagerdetails"
COM_DEPOT_TAB_NEW_MANUFACTURER="Neuer Hersteller"
COM_DEPOT_TAB_NEW_PART="Neues Bauteil"
COM_DEPOT_TAB_STATISTICS="Statistik" COM_DEPOT_TAB_STATISTICS="Statistik"
COM_DEPOT_TABLE_HEAD_DESCRIPTION="Beschreibung"
COM_DEPOT_TABLE_HEAD_ID="ID" COM_DEPOT_TABLE_HEAD_ID="ID"
COM_DEPOT_TABLE_HEAD_NAME="Bauteilname"
COM_DEPOT_TABLE_HEAD_MANUFACTURER="Hersteller" COM_DEPOT_TABLE_HEAD_MANUFACTURER="Hersteller"
COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM="Kürzel" COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM="Kürzel"
COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE="Montageart" COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE="Montageart"
COM_DEPOT_TABLE_HEAD_NAME="Bauteilname"
COM_DEPOT_TABLE_HEAD_OWNER="Besitzer"
COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Gehausename" COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Gehausename"
COM_DEPOT_TABLE_HEAD_STOCK="Lagerort"
COM_DEPOT_TABLE_HEAD_QUANTITY="Menge" COM_DEPOT_TABLE_HEAD_QUANTITY="Menge"
COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent" COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent"
COM_DEPOT_TABLE_HEAD_DESCRIPTION="Beschreibung" COM_DEPOT_TABLE_HEAD_STOCK="Lagerort"
COM_DEPOT_XML_DESCRIPTION="Depot, das Bauteil-Warenhaus" COM_DEPOT_XML_DESCRIPTION="Depot, das Bauteil-Warenhaus"

View File

@ -1,4 +1,4 @@
; @package Depot.Language ; @package Depot.Language German de-DE
; @subpackage com_depot ; @subpackage com_depot
; @author Thomas Kuschel <thomas@kuschel.at> ; @author Thomas Kuschel <thomas@kuschel.at>
; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at> ; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>

View File

@ -1,52 +1,46 @@
; @package Depot.Language ; @package Depot.Language English en-GB (default)
; @subpackage com_depot ; @subpackage com_depot
; @author Thomas Kuschel <thomas@kuschel.at> ; @author Thomas Kuschel <thomas@kuschel.at>
; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at> ; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
; @license GNU General Public License version 2 or later; see LICENSE.md ; @license GNU General Public License version 2 or later; see LICENSE.md
; @since 0.0.1 ; @since 0.0.1
; ;
COM_DEPOT_FIELD_ALIAS_MANUFACTURER_PLACEHOLDER="Auto-generate from manufacturer acronym"
COM_DEPOT_FIELD_ALIAS_PACKAGE_PLACEHOLDER="Auto-generate from package name" COM_DEPOT_FIELD_ALIAS_PACKAGE_PLACEHOLDER="Auto-generate from package name"
COM_DEPOT_FIELD_ALIAS_PART_PLACEHOLDER="Auto-generate from component name" COM_DEPOT_FIELD_ALIAS_PART_PLACEHOLDER="Auto-generate from component name"
COM_DEPOT_FIELD_ALIAS_STOCK_PLACEHOLDER="Auto-generate from stock name" COM_DEPOT_FIELD_ALIAS_STOCK_PLACEHOLDER="Auto-generate from stock name"
COM_DEPOT_FIELD_ALIAS_MANUFACTURER_PLACEHOLDER="Auto-generate from manufacturer acronym"
COM_DEPOT_FIELD_COMPONENT_NAME_DESC="The name of the component is unique. Please do not enter special characters or umlauts." COM_DEPOT_FIELD_COMPONENT_NAME_DESC="The name of the component is unique. Please do not enter special characters or umlauts."
COM_DEPOT_FIELD_COMPONENT_NAME_LABEL="Component Name" COM_DEPOT_FIELD_COMPONENT_NAME_LABEL="Component Name"
;JGLOBAL_CREATED (should be replaced)
;COM_DEPOT_FIELD_CREATED_LABEL="Created"
;JGRID_FIELD_CREATED_BY (should be replaced)
;COM_DEPOT_FIELD_CREATED_BY_LABEL="Created by"
COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_DESC="Enter here the acronym of the manufacturer or short name" COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_DESC="Enter here the acronym of the manufacturer or short name"
COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_LABEL="Manufacturer Acronym" COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_LABEL="Manufacturer Acronym"
COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_DESC="Enter here the long name of the manufacturer" COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_DESC="Enter here the long name of the manufacturer"
COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_LABEL="Manufacturer (long name)" COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_LABEL="Manufacturer (long name)"
;JGLOBAL_FIELD_MODIFIED_LABEL
;COM_DEPOT_FIELD_MODIFIED_LABEL="Modified"
;JGLOBAL_FIELD_MODIFIED_BY_LABEL (should be replaced)
;COM_DEPOT_FIELD_MODIFIED_BY_LABEL="Modified by"
COM_DEPOT_FIELD_PACKAGE_LABEL="Package" COM_DEPOT_FIELD_PACKAGE_LABEL="Package"
COM_DEPOT_FIELD_PACKAGE_MOUNTING_STYLE_LABEL="Mounting Style" COM_DEPOT_FIELD_PACKAGE_MOUNTING_STYLE_LABEL="Mounting Style"
COM_DEPOT_FIELD_PACKAGE_NAME_DESC="Enter here the package name of the component" COM_DEPOT_FIELD_PACKAGE_NAME_DESC="Enter here the package name of the component"
COM_DEPOT_FIELD_PACKAGE_NAME_LABEL="Package Name" COM_DEPOT_FIELD_PACKAGE_NAME_LABEL="Package Name"
COM_DEPOT_FIELD_QUANTITY_LABEL="Quantity"
COM_DEPOT_FIELD_QUANTITY_DESC="Enter here the current number of components" COM_DEPOT_FIELD_QUANTITY_DESC="Enter here the current number of components"
COM_DEPOT_FIELD_QUANTITY_EXP_LABEL="Quantity Exponent" COM_DEPOT_FIELD_QUANTITY_LABEL="Quantity"
COM_DEPOT_FIELD_QUANTITY_EXP_DESC="Exponent (10^x of the number, usually 0, i.e. 10⁰)" COM_DEPOT_FIELD_QUANTITY_EXP_DESC="Exponent (10^x of the number, usually 0, i.e. 10⁰)"
COM_DEPOT_FIELD_QUANTITY_EXP_LABEL="Quantity Exponent"
COM_DEPOT_FIELD_SELECT_MANUFACTURER="Manufacturer" COM_DEPOT_FIELD_SELECT_MANUFACTURER="Manufacturer"
COM_DEPOT_FIELD_SELECT_PACKAGE="Package" COM_DEPOT_FIELD_SELECT_PACKAGE="Package"
COM_DEPOT_FIELD_SELECT_STOCK="Stock Location" COM_DEPOT_FIELD_SELECT_STOCK="Stock Location"
COM_DEPOT_FIELD_STOCK_NAME_DESC="Enter here the short stock location"
COM_DEPOT_FIELD_STOCK_NAME_LABEL="Stock Location"
COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC="Enter here the exact location/description" COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC="Enter here the exact location/description"
COM_DEPOT_FIELD_STOCK_DESCRIPTION_LABEL="Description" COM_DEPOT_FIELD_STOCK_DESCRIPTION_LABEL="Description"
COM_DEPOT_FIELD_STOCK_NAME_DESC="Enter here the short stock location"
COM_DEPOT_FIELD_STOCK_NAME_LABEL="Stock Location"
COM_DEPOT_FIELD_STOCK_OWNER_DESC="Enter here the owner of the stock"
COM_DEPOT_FIELD_STOCK_OWNER_LABEL="Owner"
COM_DEPOT_FILTER_SEARCH_PARTS_DESC="Search a Component" COM_DEPOT_FILTER_SEARCH_PARTS_DESC="Search a Component"
COM_DEPOT_FILTER_SEARCH_PARTS_LABEL="Search a component" COM_DEPOT_FILTER_SEARCH_PARTS_LABEL="Search a component"
COM_DEPOT_FILTER_SEARCH_STOCKS_LABEL="Search Stock Location"
COM_DEPOT_FILTER_SEARCH_STOCKS_DESC="Search in Stock Location" COM_DEPOT_FILTER_SEARCH_STOCKS_DESC="Search in Stock Location"
COM_DEPOT_FILTER_SEARCH_STOCKS_LABEL="Search Stock Location"
COM_DEPOT_LEGEND_MANUFACTURER_DETAILS="Manufacturer Details" COM_DEPOT_LEGEND_MANUFACTURER_DETAILS="Manufacturer Details"
COM_DEPOT_LEGEND_PACKAGE_DETAILS="Package Details" COM_DEPOT_LEGEND_PACKAGE_DETAILS="Package Details"
COM_DEPOT_LEGEND_PART_DETAILS="Component Details" COM_DEPOT_LEGEND_PART_DETAILS="Component Details"
COM_DEPOT_LEGEND_STOCK_DETAILS="Stock Location Details"
COM_DEPOT_LEGEND_STATISTICS="Statistics" COM_DEPOT_LEGEND_STATISTICS="Statistics"
COM_DEPOT_LEGEND_STOCK_DETAILS="Stock Location Details"
COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT="Chassis Mount" COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT="Chassis Mount"
COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT="Press Fit" COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT="Press Fit"
COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT="Screw Mount" COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT="Screw Mount"
@ -57,32 +51,59 @@ COM_DEPOT_MANAGER_MANUFACTURERS="Manager Manufacturers"
COM_DEPOT_MANAGER_PACKAGES="Manager Packages" COM_DEPOT_MANAGER_PACKAGES="Manager Packages"
COM_DEPOT_MANAGER_PARTS="Manager Components" COM_DEPOT_MANAGER_PARTS="Manager Components"
COM_DEPOT_MANAGER_STOCKS="Manager Stock Locations" COM_DEPOT_MANAGER_STOCKS="Manager Stock Locations"
COM_DEPOT_MANUFACTURERS_N_ITEMS_DELETED_1="One manufacturer deleted"
COM_DEPOT_MANUFACTURERS_N_ITEMS_DELETED_MORE="%d manufacturers deleted"
COM_DEPOT_MANUFACTURERS_N_ITEMS_PUBLISHED_1="One manufacturer published"
COM_DEPOT_MANUFACTURERS_N_ITEMS_PUBLISHED_MORE="%d manufacturers published"
COM_DEPOT_MANUFACTURERS_N_ITEMS_UNPUBLISHED_1="One manufacturer unpublished"
COM_DEPOT_MANUFACTURERS_N_ITEMS_UNPUBLISHED_MORE="%d manufacturers unpublished"
COM_DEPOT_N_ITEMS_DELETED_1="One component deleted" COM_DEPOT_N_ITEMS_DELETED_1="One component deleted"
COM_DEPOT_N_ITEMS_DELETED_MORE="%d components deleted" COM_DEPOT_N_ITEMS_DELETED_MORE="%d components deleted"
COM_DEPOT_N_ITEMS_PUBLISHED_1="One component published" COM_DEPOT_N_ITEMS_PUBLISHED_1="One component published"
COM_DEPOT_N_ITEMS_PUBLISHED_MORE="%d components published" COM_DEPOT_N_ITEMS_PUBLISHED_MORE="%d components published"
COM_DEPOT_N_ITEMS_UNPUBLISHED_1="One component unpublished" COM_DEPOT_N_ITEMS_UNPUBLISHED_1="One component unpublished"
COM_DEPOT_N_ITEMS_UNPUBLISHED_MORE="%d components unpublished" COM_DEPOT_N_ITEMS_UNPUBLISHED_MORE="%d components unpublished"
COM_DEPOT_PACKAGES_N_ITEMS_DELETED_1="One package deleted"
COM_DEPOT_PACKAGES_N_ITEMS_DELETED_MORE="%d packages deleted"
COM_DEPOT_PACKAGES_N_ITEMS_PUBLISHED_1="One package published"
COM_DEPOT_PACKAGES_N_ITEMS_PUBLISHED_MORE="%d packages published"
COM_DEPOT_PACKAGES_N_ITEMS_UNPUBLISHED_1="One package unpublished"
COM_DEPOT_PACKAGES_N_ITEMS_UNPUBLISHED_MORE="%d packages unpublished"
COM_DEPOT_SELECT_YOUR_OPTION="Select your option" COM_DEPOT_SELECT_YOUR_OPTION="Select your option"
COM_DEPOT_SORT_BY_ACRONYM_ASC="Acronym ascending"
COM_DEPOT_SORT_BY_ACRONYM_DESC="Acronym descending"
COM_DEPOT_SORT_BY_DESCRIPTION_ASC="Description ascending" COM_DEPOT_SORT_BY_DESCRIPTION_ASC="Description ascending"
COM_DEPOT_SORT_BY_DESCRIPTION_DESC="Description descending" COM_DEPOT_SORT_BY_DESCRIPTION_DESC="Description descending"
COM_DEPOT_SORT_BY_MANUFACTURER_ASC="Manufacturer ascending"
COM_DEPOT_SORT_BY_MANUFACTURER_DESC="Manufacturer descending"
COM_DEPOT_SORT_BY_OWNER_ASC="Owner ascending"
COM_DEPOT_SORT_BY_OWNER_DESC="Owner descending"
COM_DEPOT_SORT_BY_QUANTITY_ASC="Quantity ascending" COM_DEPOT_SORT_BY_QUANTITY_ASC="Quantity ascending"
COM_DEPOT_SORT_BY_QUANTITY_DESC="Quantity descending" COM_DEPOT_SORT_BY_QUANTITY_DESC="Quantity descending"
COM_DEPOT_TAB_NEW_PART="New Component" COM_DEPOT_SORT_BY_STOCK_NAME_ASC="Stock Location ascending"
COM_DEPOT_TAB_NEW_MANUFACTURER="New Manufacturer" COM_DEPOT_SORT_BY_STOCK_NAME_DESC="Stock Location descending"
COM_DEPOT_TAB_EDIT_PART="Component Details" COM_DEPOT_STOCKS_N_ITEMS_DELETED_1="One stock location deleted"
COM_DEPOT_TAB_EDIT_PACKAGE="Package Details" COM_DEPOT_STOCKS_N_ITEMS_DELETED_MORE="%d stock locations deleted"
COM_DEPOT_STOCKS_N_ITEMS_PUBLISHED_1="One stock location published"
COM_DEPOT_STOCKS_N_ITEMS_PUBLISHED_MORE="%d stock locations published"
COM_DEPOT_STOCKS_N_ITEMS_UNPUBLISHED_1="One stock location unpublished"
COM_DEPOT_STOCKS_N_ITEMS_UNPUBLISHED_MORE="%d stock locations unpublished"
COM_DEPOT_TAB_EDIT_MANUFACTURER="Manufacturer Details" COM_DEPOT_TAB_EDIT_MANUFACTURER="Manufacturer Details"
COM_DEPOT_TAB_EDIT_PACKAGE="Package Details"
COM_DEPOT_TAB_EDIT_PART="Component Details"
COM_DEPOT_TAB_EDIT_STOCK="Stock Details" COM_DEPOT_TAB_EDIT_STOCK="Stock Details"
COM_DEPOT_TAB_NEW_MANUFACTURER="New Manufacturer"
COM_DEPOT_TAB_NEW_PART="New Component"
COM_DEPOT_TAB_STATISTICS="Statistics" COM_DEPOT_TAB_STATISTICS="Statistics"
COM_DEPOT_TABLE_HEAD_DESCRIPTION="Description"
COM_DEPOT_TABLE_HEAD_ID="ID" COM_DEPOT_TABLE_HEAD_ID="ID"
COM_DEPOT_TABLE_HEAD_NAME="Component Name"
COM_DEPOT_TABLE_HEAD_MANUFACTURER="Manufacturer" COM_DEPOT_TABLE_HEAD_MANUFACTURER="Manufacturer"
COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM="Acronym" COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM="Acronym"
COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE="Mounting Style" COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE="Mounting Style"
COM_DEPOT_TABLE_HEAD_NAME="Component Name"
COM_DEPOT_TABLE_HEAD_OWNER="Owner"
COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Package Name" COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Package Name"
COM_DEPOT_TABLE_HEAD_STOCK="Stock Location"
COM_DEPOT_TABLE_HEAD_QUANTITY="Quantity" COM_DEPOT_TABLE_HEAD_QUANTITY="Quantity"
COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent" COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent"
COM_DEPOT_TABLE_HEAD_DESCRIPTION="Description" COM_DEPOT_TABLE_HEAD_STOCK="Stock Location"
COM_DEPOT_XML_DESCRIPTION="Depot, the component warehouse" COM_DEPOT_XML_DESCRIPTION="Depot, the component warehouse"

View File

@ -1,4 +1,4 @@
; @package Depot.Language ; @package Depot.Language English en-GB (default)
; @subpackage com_depot ; @subpackage com_depot
; @author Thomas Kuschel <thomas@kuschel.at> ; @author Thomas Kuschel <thomas@kuschel.at>
; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at> ; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>

View File

@ -87,7 +87,7 @@ CREATE TABLE `#__depot_stock` (
`id` SERIAL, `id` SERIAL,
`name` VARCHAR(1024) NOT NULL DEFAULT '', `name` VARCHAR(1024) NOT NULL DEFAULT '',
`alias` VARCHAR(1024) NOT NULL DEFAULT '', `alias` VARCHAR(1024) NOT NULL DEFAULT '',
`owner` INT(10) UNSIGNED NOT NULL DEFAULT 0, `owner_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_by` INT(10) UNSIGNED NOT NULL DEFAULT 0, `created_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`checked_out` INT(11) NOT NULL DEFAULT 0, `checked_out` INT(11) NOT NULL DEFAULT 0,
@ -102,7 +102,7 @@ CREATE TABLE `#__depot_stock` (
`state` TINYINT(4) NOT NULL DEFAULT 0, `state` TINYINT(4) NOT NULL DEFAULT 0,
`access` TINYINT(4) NOT NULL DEFAULT 0, `access` TINYINT(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `nameindex` (`name`,`owner`) UNIQUE KEY `nameindex` (`name`,`owner_id`)
) )
ENGINE=InnoDB ENGINE=InnoDB
AUTO_INCREMENT=0 AUTO_INCREMENT=0

View File

@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS `#__depot_stock` (
`id` SERIAL, `id` SERIAL,
`name` VARCHAR(1024) NOT NULL DEFAULT '', `name` VARCHAR(1024) NOT NULL DEFAULT '',
`alias` VARCHAR(1024) NOT NULL DEFAULT '', `alias` VARCHAR(1024) NOT NULL DEFAULT '',
`owner` INT(10) UNSIGNED NOT NULL DEFAULT 0, `owner_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_by` INT(10) UNSIGNED NOT NULL DEFAULT 0, `created_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`checked_out` INT(11) NOT NULL DEFAULT 0, `checked_out` INT(11) NOT NULL DEFAULT 0,
@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS `#__depot_stock` (
`state` TINYINT(4) NOT NULL DEFAULT 0, `state` TINYINT(4) NOT NULL DEFAULT 0,
`access` TINYINT(4) NOT NULL DEFAULT 0, `access` TINYINT(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `nameindex` (`name`,`owner`) UNIQUE KEY `nameindex` (`name`,`owner_id`)
) ENGINE=InnoDB ) ENGINE=InnoDB
AUTO_INCREMENT=0 AUTO_INCREMENT=0
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -0,0 +1,31 @@
<?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.9.9
*/
namespace KW4NZ\Component\Depot\Administrator\Controller;
use Joomla\CMS\MVC\Controller\AdminController;
defined('_JEXEC') or die;
class ManufacturersController extends AdminController
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 0.9.9
*/
protected $text_prefix = 'COM_DEPOT_MANUFACTURERS';
public function getModel($name = 'Manufacturer', $prefix = 'Administrator', $config = ['ignore_request' => true])
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -16,4 +16,5 @@ defined('_JEXEC') or die;
class PackageController extends FormController class PackageController extends FormController
{ {
protected $text_prefix = 'COM_DEPOT_PACKAGE';
} }

View File

@ -0,0 +1,31 @@
<?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.9.9
*/
namespace KW4NZ\Component\Depot\Administrator\Controller;
use Joomla\CMS\MVC\Controller\AdminController;
defined('_JEXEC') or die;
class PackagesController extends AdminController
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 0.9.9
*/
protected $text_prefix = 'COM_DEPOT_PACKAGES';
public function getModel($name = 'Package', $prefix = 'Administrator', $config = ['ignore_request' => true])
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -16,4 +16,5 @@ defined('_JEXEC') or die;
class StockController extends FormController class StockController extends FormController
{ {
protected $text_prefix = 'COM_DEPOT_STOCK';
} }

View File

@ -0,0 +1,31 @@
<?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.9.9
*/
namespace KW4NZ\Component\Depot\Administrator\Controller;
use Joomla\CMS\MVC\Controller\AdminController;
defined('_JEXEC') or die;
class StocksController extends AdminController
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 0.9.9
*/
protected $text_prefix = 'COM_DEPOT_STOCKS';
public function getModel($name = 'Stock', $prefix = 'Administrator', $config = ['ignore_request' => true])
{
return parent::getModel($name, $prefix, $config);
}
}

View File

@ -18,6 +18,30 @@ use Joomla\Database\ParameterType;
class ManufacturersModel extends ListModel class ManufacturersModel extends ListModel
{ {
public function __construct($config = [])
{
$config['filter_fields'] = [
'id',
'm.id',
'name_short',
'm.name_short',
'name_long',
'm.name_long',
'alias',
'm.alias',
'state',
'm.state',
'published',
'm.published',
'description',
'm.descrition',
'image',
'm.image',
];
parent::__construct($config);
}
/** /**
* Build an SQL query to load the list data. * Build an SQL query to load the list data.
* *
@ -79,6 +103,11 @@ class ManufacturersModel extends ListModel
$query->where($db->quoteName('m.state') . ' IN (0, 1)'); $query->where($db->quoteName('m.state') . ' IN (0, 1)');
} }
// add list ordering clause
$orderCol = $this->state->get('list.ordering', 'id');
$orderDirn = $this->state->get('list.direction', 'asc');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
return $query; return $query;
} }
} }

View File

@ -18,6 +18,28 @@ use Joomla\Database\ParameterType;
class PackagesModel extends ListModel class PackagesModel extends ListModel
{ {
public function __construct($config = [])
{
$config['filter_fields'] = [
'id',
'p.id',
'name',
'p.name',
'alias',
'p.alias',
'state',
'p.state',
'published',
'p.published',
'mounting_style_id',
'p.mounting_style_id',
'mounting_style',
'description',
'p.description',
];
parent::__construct($config);
}
/** /**
* Build an SQL query to load the list data. * Build an SQL query to load the list data.
* *
@ -81,6 +103,11 @@ class PackagesModel extends ListModel
$query->where($db->quoteName('p.state') . ' IN (0, 1)'); $query->where($db->quoteName('p.state') . ' IN (0, 1)');
} }
// add list ordering clause
$orderCol = $this->state->get('list.ordering', 'id');
$orderDirn = $this->state->get('list.direction', 'asc');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
return $query; return $query;
} }
} }

View File

@ -18,6 +18,25 @@ use Joomla\Database\ParameterType;
class PartsModel extends ListModel class PartsModel extends ListModel
{ {
public function __construct($config = [])
{
$config['filter_fields'] = [
'id',
'd.id',
'component_name',
'd.component_name',
'alias',
'd.alias',
'quantity',
'd.quantity',
'published',
'd.published',
'package',
'manufacturer',
'stock_name',
];
parent::__construct($config);
}
/** /**
* Build an SQL query to load the list data. * Build an SQL query to load the list data.
* *
@ -65,6 +84,7 @@ class PartsModel extends ListModel
$db->quoteName('p.name', 'package_name'), $db->quoteName('p.name', 'package_name'),
$db->quoteName('p.description', 'package_description'), $db->quoteName('p.description', 'package_description'),
$db->quoteName('ms.title', 'mounting_style'), $db->quoteName('ms.title', 'mounting_style'),
$db->quoteName('v.name', 'owner'),
] ]
) )
->from($db->quoteName('#__depot', 'd')) ->from($db->quoteName('#__depot', 'd'))
@ -72,7 +92,8 @@ class PartsModel extends ListModel
->join('LEFT', $db->quoteName('#__depot_stock', 's'), $db->quoteName('s.id') . ' = ' . $db->quoteName('d.stock_id')) ->join('LEFT', $db->quoteName('#__depot_stock', 's'), $db->quoteName('s.id') . ' = ' . $db->quoteName('d.stock_id'))
->join('LEFT', $db->quoteName('#__depot_package', 'p'), $db->quoteName('p.id') . ' = ' . $db->quoteName('d.package_id')) ->join('LEFT', $db->quoteName('#__depot_package', 'p'), $db->quoteName('p.id') . ' = ' . $db->quoteName('d.package_id'))
->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('d.checked_out')) ->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('d.checked_out'))
->join('LEFT', $db->quoteName('#__depot_mounting_style', 'ms'), $db->quoteName('ms.id') . ' = ' . $db->quoteName('p.mounting_style_id')); ->join('LEFT', $db->quoteName('#__depot_mounting_style', 'ms'), $db->quoteName('ms.id') . ' = ' . $db->quoteName('p.mounting_style_id'))
->join('LEFT', $db->quoteName('#__users', 'v'), $db->quoteName('v.id') . ' = ' . $db->quoteName('s.owner_id'));
// filter: like / search // filter: like / search
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) { if (!empty($search)) {
@ -86,10 +107,14 @@ class PartsModel extends ListModel
$query->where($db->quoteName('d.state') . ' = :published') $query->where($db->quoteName('d.state') . ' = :published')
->bind(':published', $published, ParameterType::INTEGER); ->bind(':published', $published, ParameterType::INTEGER);
} elseif ($published === '') { } elseif ($published === '') {
//$query->where($db->quoteName('d.state') . ' IN (0, 1)');
$query->whereIn($db->quoteName('d.state'), [0, 1]); $query->whereIn($db->quoteName('d.state'), [0, 1]);
} }
// add list ordering clause
$orderCol = $this->state->get('list.ordering', 'id');
$orderDirn = $this->state->get('list.direction', 'desc');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
return $query; return $query;
} }
} }

View File

@ -53,7 +53,7 @@ class StockModel extends AdminModel
/* replaced by: */ /* replaced by: */
if (empty($data['alias'])) { if (empty($data['alias'])) {
$data['alias'] = ApplicationHelper::stringURLSafe($data['name_short']); $data['alias'] = ApplicationHelper::stringURLSafe($data['owner_id'] . '-' . $data['name']);
} }
$result = parent::save($data); $result = parent::save($data);
// if ($result) { // if ($result) {

View File

@ -18,6 +18,23 @@ use Joomla\Database\ParameterType;
class StocksModel extends ListModel class StocksModel extends ListModel
{ {
public function __construct($config = [])
{
$config['filter_fields'] = [
'id',
's.id',
's.name',
'name',
'alias',
's.alias',
's.description',
'description',
'published',
'd.published',
'owner',
];
parent::__construct($config);
}
/** /**
* Build an SQL query to load the list data. * Build an SQL query to load the list data.
* *
@ -55,10 +72,13 @@ class StocksModel extends ListModel
->select( ->select(
[ [
$db->quoteName('u.name', 'creator'), $db->quoteName('u.name', 'creator'),
$db->quoteName('o.name', 'owner'),
$db->quoteName('o.username', 'owner_username'),
] ]
) )
->from($db->quoteName('#__depot_stock', 's')) ->from($db->quoteName('#__depot_stock', 's'))
->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('s.checked_out')); ->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('s.checked_out'))
->join('LEFT', $db->quoteName('#__users', 'o'), $db->quoteName('o.id') . ' = ' . $db->quoteName('s.owner_id'));
// filter: like / search // filter: like / search
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) { if (!empty($search)) {
@ -77,6 +97,11 @@ class StocksModel extends ListModel
$query->where($db->quoteName('s.state') . ' IN (0, 1)'); $query->where($db->quoteName('s.state') . ' IN (0, 1)');
} }
// add list ordering clause
$orderCol = $this->state->get('list.ordering', 'id');
$orderDirn = $this->state->get('list.direction', 'asc');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
return $query; return $query;
} }
} }

View File

@ -29,6 +29,10 @@ class HtmlView extends BaseHtmlView
$app = Factory::getApplication(); $app = Factory::getApplication();
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->state = $this->get('State');
// list order
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
// adding filters // adding filters
$this->filterForm = $this->get('FilterForm'); $this->filterForm = $this->get('FilterForm');

View File

@ -29,6 +29,10 @@ class HtmlView extends BaseHtmlView
$app = Factory::getApplication(); $app = Factory::getApplication();
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->state = $this->get('State');
// list order
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
// adding filters // adding filters
$this->filterForm = $this->get('FilterForm'); $this->filterForm = $this->get('FilterForm');

View File

@ -29,6 +29,10 @@ class HtmlView extends BaseHtmlView
$app = Factory::getApplication(); $app = Factory::getApplication();
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->state = $this->get('State');
// list order
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
// adding filters // adding filters
$this->filterForm = $this->get('FilterForm'); $this->filterForm = $this->get('FilterForm');

View File

@ -29,7 +29,10 @@ class HtmlView extends BaseHtmlView
$app = Factory::getApplication(); $app = Factory::getApplication();
$this->items = $this->get('Items'); $this->items = $this->get('Items');
$this->state = $this->get('State');
// list order
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
// adding filters // adding filters
$this->filterForm = $this->get('FilterForm'); $this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters'); $this->activeFilters = $this->get('ActiveFilters');

View File

@ -34,13 +34,31 @@ use Joomla\CMS\Layout\LayoutHelper;
<?= HTMLHelper::_('grid.checkall'); ?> <?= HTMLHelper::_('grid.checkall'); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_ID') ?> <?= HTMLHelper::_(
'searchtools.sort',
'JGRID_HEADING_ID',
'm.id',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM',
'm.name_short',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_MANUFACTURER') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_MANUFACTURER',
'm.name_long',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
</tr> </tr>
</thead> </thead>

View File

@ -34,16 +34,40 @@ use Joomla\CMS\Layout\LayoutHelper;
<?= HTMLHelper::_('grid.checkall'); ?> <?= HTMLHelper::_('grid.checkall'); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_ID') ?> <?= HTMLHelper::_(
'searchtools.sort',
'JGRID_HEADING_ID',
'p.id',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_PACKAGE_NAME') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_PACKAGE_NAME',
'p.name',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_DESCRIPTION') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_DESCRIPTION',
'p.description',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE',
'p.mounting_style',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
</tr> </tr>
</thead> </thead>

View File

@ -33,22 +33,52 @@ use Joomla\CMS\Layout\LayoutHelper;
<?= HTMLHelper::_('grid.checkall'); ?> <?= HTMLHelper::_('grid.checkall'); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_ID') ?> <?= HTMLHelper::_(
'searchtools.sort',
'JGRID_HEADING_ID',
'd.id',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_NAME') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_NAME',
'd.component_name',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_QUANTITY') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_QUANTITY',
'd.quantity',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_QUANTITY_EXP') ?> <?= Text::_('COM_DEPOT_TABLE_HEAD_QUANTITY_EXP') ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_MANUFACTURER') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_MANUFACTURER',
'manufacturer',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_STOCK') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_STOCK',
'stock_name',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -94,10 +124,15 @@ use Joomla\CMS\Layout\LayoutHelper;
</a> </a>
</td> </td>
<td> <td>
<a href="<?= Route::_('index.php?option=com_depot&task=stock.edit&id=' .
<a class="break-word" href="<?= Route::_('index.php?option=com_depot&task=stock.edit&id=' .
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>"> (int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
<?= $this->escape($item->stock_name); ?> <?= $this->escape($item->stock_name); ?>
</a> </a>
<div class="small">
<?= $this->escape($item->owner); ?>
</div>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -35,9 +35,11 @@ $wa->useScript('form.validate')
<div class="col-12 col-lg-6"> <div class="col-12 col-lg-6">
<?= $this->form->renderFieldset('details'); ?> <?= $this->form->renderFieldset('details'); ?>
</div> </div>
<!--
<div class="col-12 col-lg-6"> <div class="col-12 col-lg-6">
<?= $this->form->getInput('description'); ?> <?= $this->form->getInput('description'); ?>
</div> </div>
-->
</div> </div>
</fieldset> </fieldset>
<?= HtmlHelper::_('uitab.endTab'); ?> <?= HtmlHelper::_('uitab.endTab'); ?>

View File

@ -33,14 +33,35 @@ use Joomla\CMS\Layout\LayoutHelper;
<?= HTMLHelper::_('grid.checkall'); ?> <?= HTMLHelper::_('grid.checkall'); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_ID') ?> <?= HTMLHelper::_(
'searchtools.sort',
'JGRID_HEADING_ID',
's.id',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_STOCK') ?> <?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_STOCK',
's.name',
$this->listDirn,
$this->listOrder
); ?>
</th> </th>
<th> <th>
<?= Text::_('COM_DEPOT_TABLE_HEAD_DESCRIPTION') ?> <?= Text::_('COM_DEPOT_TABLE_HEAD_DESCRIPTION') ?>
</th> </th>
<th>
<?= HTMLHelper::_(
'searchtools.sort',
'COM_DEPOT_TABLE_HEAD_OWNER',
'owner',
$this->listDirn,
$this->listOrder
); ?>
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -61,6 +82,18 @@ use Joomla\CMS\Layout\LayoutHelper;
<td> <td>
<?= $this->escape($item->description); ?> <?= $this->escape($item->description); ?>
</td> </td>
<td>
<div class="word-break">
<?php if (!empty($item->owner)): ?>
<?= $item->owner; ?>
<div class="small">
<?= Text::_('JGLOBAL_USERNAME') . ': ' . $item->owner_username; ?>
</div>
<?php else: ?>
<?= Text::_('JGLOBAL_AUTH_USER_NOT_FOUND'); ?>
<?php endif; ?>
</div>
</td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>

View File

@ -2,12 +2,12 @@
<extension type="component" method="upgrade"> <extension type="component" method="upgrade">
<name>Depot</name> <name>Depot</name>
<author>KW4NZ</author> <author>KW4NZ</author>
<creationDate>2023-10-24</creationDate> <creationDate>2023-10-30</creationDate>
<copyright>(C) KW4NZ Thomas Kuschel</copyright> <copyright>(C) KW4NZ Thomas Kuschel</copyright>
<license>GPL v2 +; see LICENSE.md</license> <license>GPL v2 +; see LICENSE.md</license>
<authorEmail>thomas@kuschel.at</authorEmail> <authorEmail>thomas@kuschel.at</authorEmail>
<authorUrl>https://kuschel.at</authorUrl> <authorUrl>https://kuschel.at</authorUrl>
<version>0.9.7</version> <version>0.9.9</version>
<description>COM_DEPOT_XML_DESCRIPTION</description> <description>COM_DEPOT_XML_DESCRIPTION</description>
<namespace path="src/">KW4NZ\Component\Depot</namespace> <namespace path="src/">KW4NZ\Component\Depot</namespace>
<install> <!-- Runs on install --> <install> <!-- Runs on install -->
@ -45,14 +45,6 @@
> >
COM_DEPOT_MENU COM_DEPOT_MENU
</menu> </menu>
<menu
link="option=com_depot&amp;view=manufacturers"
view="manufacturers"
img="class:depot-manufacturer"
alt="Depot/Manufacturers"
>
COM_DEPOT_MENU_MANUFACTURERS
</menu>
<menu <menu
link="option=com_depot&amp;view=stocks" link="option=com_depot&amp;view=stocks"
view="stocks" view="stocks"
@ -61,6 +53,14 @@
> >
COM_DEPOT_MENU_STOCKS COM_DEPOT_MENU_STOCKS
</menu> </menu>
<menu
link="option=com_depot&amp;view=manufacturers"
view="manufacturers"
img="class:depot-manufacturer"
alt="Depot/Manufacturers"
>
COM_DEPOT_MENU_MANUFACTURERS
</menu>
<menu <menu
link="option=com_depot&amp;view=packages" link="option=com_depot&amp;view=packages"
view="packages" view="packages"