ADD filtering and searching 0.9.7
This commit is contained in:
parent
372fdada98
commit
6d03c99a34
@ -5,8 +5,8 @@
|
||||
name="search"
|
||||
type="text"
|
||||
inputmode="search"
|
||||
label="COM_DEPOT_PARTS_FILTER_SEARCH_LABEL"
|
||||
description="COM_DEPOT_PARTS_FILTER_SEARCH_DESC"
|
||||
label="COM_DEPOT_FILTER_SEARCH_MANUFACTURERS_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_MANUFACTURERS_DESC"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
<field
|
||||
|
47
admin/forms/filter_packages.xml
Normal file
47
admin/forms/filter_packages.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form addfieldprefix="Joomla\Component\Depot\Administrator\Field">
|
||||
<fields name="filter">
|
||||
<field
|
||||
name="search"
|
||||
type="text"
|
||||
inputmode="search"
|
||||
label="COM_DEPOT_FILTER_SEARCH_PACKAGES_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_PACKAGES_DESC"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
<field
|
||||
name="published"
|
||||
type="status"
|
||||
label="JSTATUS"
|
||||
class="js-select-submit-on-change"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_PUBLISHED</option>
|
||||
</field>
|
||||
</fields>
|
||||
<fields name="list">
|
||||
<field
|
||||
name="fullordering"
|
||||
type="list"
|
||||
label="JGLOBAL_SORT_BY"
|
||||
statuses="*,0,1,2,-2"
|
||||
class="js-select-submit-on-change"
|
||||
default="p.name ASC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="p.state ASC">JSTATUS_ASC</option>
|
||||
<option value="p.state DESC">JSTATUS_DESC</option>
|
||||
<option value="p.name ASC">JGLOBAL_NAME_ASC</option>
|
||||
<option value="p.name DESC">JGLOBAL_NAME_DESC</option>
|
||||
<option value="p.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||
<option value="p.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||
</field>
|
||||
<field
|
||||
name="limit"
|
||||
type="limitbox"
|
||||
label="JGLOBAL_LIST_LIMIT"
|
||||
default="25"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
</fields>
|
||||
</form>
|
@ -5,8 +5,8 @@
|
||||
name="search"
|
||||
type="text"
|
||||
inputmode="search"
|
||||
label="COM_DEPOT_PARTS_FILTER_SEARCH_LABEL"
|
||||
description="COM_DEPOT_PARTS_FILTER_SEARCH_DESC"
|
||||
label="COM_DEPOT_FILTER_SEARCH_PARTS_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_PARTS_DESC"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
<field
|
||||
@ -62,8 +62,8 @@
|
||||
<option value="d.state DESC">JSTATUS_DESC</option>
|
||||
<option value="d.component_name ASC">JGLOBAL_NAME_ASC</option>
|
||||
<option value="d.component_name DESC">JGLOBAL_NAME_DESC</option>
|
||||
<option value="d.quantity ASC">COM_DEPOT_QUANTITY_ASC</option>
|
||||
<option value="d.quantity DESC">COM_DEPOT_QUANTITY_DESC</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.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||
<option value="d.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||
</field>
|
||||
|
@ -5,8 +5,8 @@
|
||||
name="search"
|
||||
type="text"
|
||||
inputmode="search"
|
||||
label="COM_DEPOT_PARTS_FILTER_SEARCH_LABEL"
|
||||
description="COM_DEPOT_PARTS_FILTER_SEARCH_DESC"
|
||||
label="COM_DEPOT_FILTER_SEARCH_STOCKS_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_STOCKS_DESC"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
<field
|
||||
@ -33,8 +33,8 @@
|
||||
<option value="s.state DESC">JSTATUS_DESC</option>
|
||||
<option value="s.name ASC">JGLOBAL_NAME_ASC</option>
|
||||
<option value="s.name DESC">JGLOBAL_NAME_DESC</option>
|
||||
<option value="s.description ASC">COM_DEPOT_DESCRIPTION_ASC</option>
|
||||
<option value="s.description DESC">COM_DEPOT_DESCRIPTION_DESC</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.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||
<option value="s.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||
</field>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<field
|
||||
name="created"
|
||||
type="calendar"
|
||||
label="COM_DEPOT_FIELD_CREATED_LABEL"
|
||||
label="JGLOBAL_FIELD_CREATED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
@ -68,14 +68,14 @@
|
||||
<field
|
||||
name="created_by"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_CREATED_BY_LABEL"
|
||||
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
<field
|
||||
name="modified"
|
||||
type="calendar"
|
||||
label="COM_DEPOT_FIELD_MODIFIED_LABEL"
|
||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
@ -85,7 +85,7 @@
|
||||
<field
|
||||
name="modified_by"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_MODIFIED_BY_LABEL"
|
||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
|
82
admin/forms/package.xml
Normal file
82
admin/forms/package.xml
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form>
|
||||
<fieldset
|
||||
name="details"
|
||||
label="COM_DEPOT_DETAILS"
|
||||
addruleprefix="KW4NZ\Component\Depot\Administrator\Rule"
|
||||
addfieldprefix="KW4NZ\Component\Depot\Administrator\Field"
|
||||
>
|
||||
<field
|
||||
name="name"
|
||||
type="text"
|
||||
label="COM_DEPOT_FIELD_PACKAGE_NAME_LABEL"
|
||||
description="COM_DEPOT_FIELD_PACKAGE_NAME_DESC"
|
||||
required="true"
|
||||
autofocus="1"
|
||||
/>
|
||||
<field
|
||||
name="alias"
|
||||
type="text"
|
||||
label="JFIELD_ALIAS_LABEL"
|
||||
description="JFIELD_ALIAS_DESC"
|
||||
hint="COM_DEPOT_FIELD_ALIAS_PACKAGE_PLACEHOLDER"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="mounting_style_id"
|
||||
type="list"
|
||||
label="COM_DEPOT_FIELD_PACKAGE_MOUNTING_STYLE_LABEL"
|
||||
default="0"
|
||||
>
|
||||
<option value="0">JOPTION_DO_NOT_USE</option>
|
||||
<option value="1">COM_DEPOT_LIST_MOUNTING_STYLE_SMD</option>
|
||||
<option value="2">COM_DEPOT_LIST_MOUNTING_STYLE_THD</option>
|
||||
<option value="3">COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT</option>
|
||||
<option value="4">COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT</option>
|
||||
<option value="5">COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT</option>
|
||||
</field>
|
||||
<field
|
||||
name="state"
|
||||
type="list"
|
||||
label="JSTATUS"
|
||||
class="form-select-color-state"
|
||||
default="1"
|
||||
validate="options"
|
||||
>
|
||||
<option value="1">JPUBLISHED</option>
|
||||
<option value="0">JUNPUBLISHED</option>
|
||||
<option value="2">JARCHIVED</option>
|
||||
<option value="-2">JTRASHED</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="statistics"
|
||||
label="COM_DEPOT_FIELD_STATISTICS"
|
||||
>
|
||||
<field
|
||||
name="id"
|
||||
type="text"
|
||||
label="JGLOBAL_FIELD_ID_LABEL"
|
||||
class="readonly"
|
||||
default="0"
|
||||
readonly="true"
|
||||
/>
|
||||
<field
|
||||
name="created"
|
||||
type="calendar"
|
||||
label="JGLOBAL_FIELD_CREATED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
readonly="true"
|
||||
filter="user_utc"
|
||||
/>
|
||||
<field
|
||||
name="created_by"
|
||||
type="user"
|
||||
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
@ -36,6 +36,16 @@
|
||||
hint="COM_DEPOT_FIELD_ALIAS_PART_PLACEHOLDER"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="package_id"
|
||||
type="sql"
|
||||
label="COM_DEPOT_FIELD_SELECT_PACKAGE"
|
||||
query="SELECT id, CONCAT(name,' (',description,')') AS package FROM #__depot_package ORDER BY package"
|
||||
key_field="id"
|
||||
value_field="package"
|
||||
>
|
||||
<option value="">COM_DEPOT_SELECT_YOUR_OPTION</option>
|
||||
</field>
|
||||
<field
|
||||
name="manufacturer_id"
|
||||
type="sql"
|
||||
@ -87,7 +97,7 @@
|
||||
<field
|
||||
name="created"
|
||||
type="calendar"
|
||||
label="COM_DEPOT_FIELD_CREATED_LABEL"
|
||||
label="JGLOBAL_FIELD_CREATED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
@ -97,14 +107,14 @@
|
||||
<field
|
||||
name="created_by"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_CREATED_BY_LABEL"
|
||||
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
<field
|
||||
name="modified"
|
||||
type="calendar"
|
||||
label="COM_DEPOT_FIELD_MODIFIED_LABEL"
|
||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
@ -114,7 +124,7 @@
|
||||
<field
|
||||
name="modified_by"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_MODIFIED_BY_LABEL"
|
||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<field
|
||||
name="created"
|
||||
type="calendar"
|
||||
label="COM_DEPOT_FIELD_CREATED_LABEL"
|
||||
label="JGLOBAL_FIELD_CREATED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
@ -68,14 +68,14 @@
|
||||
<field
|
||||
name="created_by"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_CREATED_BY_LABEL"
|
||||
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
<field
|
||||
name="modified"
|
||||
type="calendar"
|
||||
label="COM_DEPOT_FIELD_MODIFIED_LABEL"
|
||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
@ -85,7 +85,7 @@
|
||||
<field
|
||||
name="modified_by"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_MODIFIED_BY_LABEL"
|
||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
|
84
admin/language/de-DE/com_depot.ini
Normal file
84
admin/language/de-DE/com_depot.ini
Normal file
@ -0,0 +1,84 @@
|
||||
; @package Depot.Language
|
||||
; @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
|
||||
;
|
||||
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_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_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_LABEL="Herstellerkürzel"
|
||||
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_MODIFIED_LABEL="Modified"
|
||||
;COM_DEPOT_FIELD_MODIFIED_BY_LABEL="Modified by"
|
||||
COM_DEPOT_FIELD_PACKAGE_LABEL="Gehäuse"
|
||||
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_LABEL="Gehäusebezeichnung"
|
||||
COM_DEPOT_FIELD_QUANTITY_LABEL="Menge"
|
||||
COM_DEPOT_FIELD_QUANTITY_DESC="Geben Sie hier die tatsächliche Anzahl an Bauteilen ein"
|
||||
COM_DEPOT_FIELD_QUANTITY_EXP_LABEL="Mengenquotient"
|
||||
COM_DEPOT_FIELD_QUANTITY_EXP_DESC="Exponent (10^x der Anzahl, normalerweise 0, d.h. 10⁰)"
|
||||
COM_DEPOT_FIELD_SELECT_MANUFACTURER="Hersteller"
|
||||
COM_DEPOT_FIELD_SELECT_PACKAGE="Gehäuse"
|
||||
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_LABEL="Beschreibung"
|
||||
COM_DEPOT_FILTER_SEARCH_PARTS_DESC="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_LEGEND_MANUFACTURER_DETAILS="Herstellerdetails"
|
||||
COM_DEPOT_LEGEND_PACKAGE_DETAILS="Gehäusedetails"
|
||||
COM_DEPOT_LEGEND_PART_DETAILS="Bauteildetails"
|
||||
COM_DEPOT_LEGEND_STOCK_DETAILS="Lagerort-Details"
|
||||
COM_DEPOT_LEGEND_STATISTICS="Statistik"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT="Gehäuse-Montage"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT="Presspassung"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT="Schraubbefestigung"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_SMD="SMD (oberflächenmontiertes Bauteil)"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_THD="THD (bedrahtetes Bauteil)"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_UNKNOWN="Unbekannte Montageart"
|
||||
COM_DEPOT_MANAGER_MANUFACTURERS="Verwaltung Hersteller"
|
||||
COM_DEPOT_MANAGER_PACKAGES="Verwaltung Gehäuse"
|
||||
COM_DEPOT_MANAGER_PARTS="Verwaltung Bauteile"
|
||||
COM_DEPOT_MANAGER_STOCKS="Verwaltung Lagerorte"
|
||||
COM_DEPOT_N_ITEMS_DELETED_1="Ein Bauteil 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_MORE="%d Bauteile veröffentlicht"
|
||||
COM_DEPOT_N_ITEMS_UNPUBLISHED_1="Ein Bauteil versteckt"
|
||||
COM_DEPOT_N_ITEMS_UNPUBLISHED_MORE="%d Bauteile versteckt"
|
||||
COM_DEPOT_SELECT_YOUR_OPTION="Wählen Sie Ihre Option"
|
||||
COM_DEPOT_SORT_BY_DESCRIPTION_ASC="Beschreibung aufsteigend"
|
||||
COM_DEPOT_SORT_BY_DESCRIPTION_DESC="Beschreibung absteigend"
|
||||
COM_DEPOT_SORT_BY_QUANTITY_ASC="Menge aufsteigend"
|
||||
COM_DEPOT_SORT_BY_QUANTITY_DESC="Menge absteigend"
|
||||
COM_DEPOT_TAB_NEW_PART="Neues Bauteil"
|
||||
COM_DEPOT_TAB_NEW_MANUFACTURER="Neuer Hersteller"
|
||||
COM_DEPOT_TAB_EDIT_PART="Bauteildetails"
|
||||
COM_DEPOT_TAB_EDIT_PACKAGE="Gehäusedetails"
|
||||
COM_DEPOT_TAB_EDIT_MANUFACTURER="Herstellerdetails"
|
||||
COM_DEPOT_TAB_EDIT_STOCK="Lagerdetails"
|
||||
COM_DEPOT_TAB_STATISTICS="Statistik"
|
||||
COM_DEPOT_TABLE_HEAD_ID="ID"
|
||||
COM_DEPOT_TABLE_HEAD_NAME="Bauteilname"
|
||||
COM_DEPOT_TABLE_HEAD_MANUFACTURER="Hersteller"
|
||||
COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM="Kürzel"
|
||||
COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE="Montageart"
|
||||
COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Gehausename"
|
||||
COM_DEPOT_TABLE_HEAD_STOCK="Lagerort"
|
||||
COM_DEPOT_TABLE_HEAD_QUANTITY="Menge"
|
||||
COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent"
|
||||
COM_DEPOT_TABLE_HEAD_DESCRIPTION="Beschreibung"
|
||||
COM_DEPOT_XML_DESCRIPTION="Depot, das Bauteil-Warenhaus"
|
12
admin/language/de-DE/com_depot.sys.ini
Normal file
12
admin/language/de-DE/com_depot.sys.ini
Normal file
@ -0,0 +1,12 @@
|
||||
; @package Depot.Language
|
||||
; @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
|
||||
;
|
||||
COM_DEPOT_MENU="Depot"
|
||||
COM_DEPOT_MENU_MANUFACTURERS="Hersteller"
|
||||
COM_DEPOT_MENU_PACKAGES="Gehäuse"
|
||||
COM_DEPOT_MENU_STOCKS="Lagerorte"
|
||||
COM_DEPOT_XML_DESCRIPTION="Depot, das Bauteil-Warenhaus"
|
@ -5,34 +5,56 @@
|
||||
; @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
; @since 0.0.1
|
||||
;
|
||||
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_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_LABEL="Component Name"
|
||||
COM_DEPOT_FIELD_CREATED_LABEL="Created"
|
||||
COM_DEPOT_FIELD_CREATED_BY_LABEL="Created by"
|
||||
;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_LABEL="Manufacturer Acronym"
|
||||
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_MODIFIED_LABEL="Modified"
|
||||
COM_DEPOT_FIELD_MODIFIED_BY_LABEL="Modified by"
|
||||
;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_MOUNTING_STYLE_LABEL="Mounting Style"
|
||||
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_QUANTITY_LABEL="Quantity"
|
||||
COM_DEPOT_FIELD_QUANTITY_DESC="Enter here the current number of components"
|
||||
COM_DEPOT_FIELD_QUANTITY_EXP_LABEL="Quantity Exponent"
|
||||
COM_DEPOT_FIELD_QUANTITY_EXP_DESC="Exponent (10^x of the number, usually 0, i.e. 10⁰)"
|
||||
COM_DEPOT_FIELD_SELECT_MANUFACTURER="Manufacturer"
|
||||
COM_DEPOT_FIELD_SELECT_PACKAGE="Package"
|
||||
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_LABEL="Description"
|
||||
COM_DEPOT_FILTER_SEARCH_PARTS_DESC="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_LEGEND_MANUFACTURER_DETAILS="Manufacturer Details"
|
||||
COM_DEPOT_LEGEND_PACKAGE_DETAILS="Package Details"
|
||||
COM_DEPOT_LEGEND_PART_DETAILS="Component Details"
|
||||
COM_DEPOT_LEGEND_STOCK_DETAILS="Stock Location Details"
|
||||
COM_DEPOT_LEGEND_STATISTICS="Statistics"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_CHASSIS_MOUNT="Chassis Mount"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_PRESS_FIT="Press Fit"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_SCREW_MOUNT="Screw Mount"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_SMD="SMD/SMT (surface-mounted device)"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_THD="THD (through hole device)"
|
||||
COM_DEPOT_LIST_MOUNTING_STYLE_UNKNOWN="Unknown mounting style"
|
||||
COM_DEPOT_MANAGER_MANUFACTURERS="Manager Manufacturers"
|
||||
COM_DEPOT_MANAGER_PACKAGES="Manager Packages"
|
||||
COM_DEPOT_MANAGER_PARTS="Manager Components"
|
||||
COM_DEPOT_MANAGER_STOCKS="Manager Stock Locations"
|
||||
COM_DEPOT_N_ITEMS_DELETED_1="One component deleted"
|
||||
@ -42,9 +64,14 @@ COM_DEPOT_N_ITEMS_PUBLISHED_MORE="%d components published"
|
||||
COM_DEPOT_N_ITEMS_UNPUBLISHED_1="One component unpublished"
|
||||
COM_DEPOT_N_ITEMS_UNPUBLISHED_MORE="%d components unpublished"
|
||||
COM_DEPOT_SELECT_YOUR_OPTION="Select your option"
|
||||
COM_DEPOT_SORT_BY_DESCRIPTION_ASC="Description ascending"
|
||||
COM_DEPOT_SORT_BY_DESCRIPTION_DESC="Description descending"
|
||||
COM_DEPOT_SORT_BY_QUANTITY_ASC="Quantity ascending"
|
||||
COM_DEPOT_SORT_BY_QUANTITY_DESC="Quantity descending"
|
||||
COM_DEPOT_TAB_NEW_PART="New Component"
|
||||
COM_DEPOT_TAB_NEW_MANUFACTURER="New Manufacturer"
|
||||
COM_DEPOT_TAB_EDIT_PART="Component Details"
|
||||
COM_DEPOT_TAB_EDIT_PACKAGE="Package Details"
|
||||
COM_DEPOT_TAB_EDIT_MANUFACTURER="Manufacturer Details"
|
||||
COM_DEPOT_TAB_EDIT_STOCK="Stock Details"
|
||||
COM_DEPOT_TAB_STATISTICS="Statistics"
|
||||
@ -52,6 +79,8 @@ COM_DEPOT_TABLE_HEAD_ID="ID"
|
||||
COM_DEPOT_TABLE_HEAD_NAME="Component Name"
|
||||
COM_DEPOT_TABLE_HEAD_MANUFACTURER="Manufacturer"
|
||||
COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM="Acronym"
|
||||
COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE="Mounting Style"
|
||||
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_EXP="Exponent"
|
||||
|
@ -7,5 +7,6 @@
|
||||
;
|
||||
COM_DEPOT_MENU="Depot"
|
||||
COM_DEPOT_MENU_MANUFACTURERS="Manufacturers"
|
||||
COM_DEPOT_MENU_PACKAGES="Packages"
|
||||
COM_DEPOT_MENU_STOCKS="Stock locations"
|
||||
COM_DEPOT_XML_DESCRIPTION="Depot, the component warehouse"
|
||||
|
@ -35,6 +35,7 @@ CREATE TABLE `#__depot` (
|
||||
`datasheet_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`datasheet_alt` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`manufacturer_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`package_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`stock_id` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_state` (`state`),
|
||||
@ -46,9 +47,9 @@ CREATE TABLE `#__depot` (
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot` (`component_name`,`alias`,`description`,`quantity`,`created`,
|
||||
`ordering`,`state`,`manufacturer_id`,`stock_id`) VALUES
|
||||
('1N5404','1n5404','diode, rectifier 3A',9,'2023-09-25 15:00:00',1,1,1,1),
|
||||
('1N4148','1n4148','diode, general purpose',1234,'2023-09-25 15:15:15',2,1,2,1);
|
||||
`ordering`,`state`,`manufacturer_id`,`stock_id`,`package_id`) VALUES
|
||||
('1N5404','1n5404','diode, rectifier 3A',9,'2023-09-25 15:00:00',1,1,1,1,9),
|
||||
('1N4148','1n4148','diode, general purpose',1234,'2023-09-25 15:15:15',2,1,2,1,8);
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot_manufacturer`;
|
||||
CREATE TABLE `#__depot_manufacturer` (
|
||||
@ -123,28 +124,53 @@ DROP TABLE IF EXISTS `#__depot_package`;
|
||||
CREATE TABLE `#__depot_package` (
|
||||
`id` SERIAL,
|
||||
`name` VARCHAR(400) NOT NULL DEFAULT '',
|
||||
`description` VARCHAR(4000) NOT NULL DEFAULT '',
|
||||
`alias` VARCHAR(400) NOT NULL DEFAULT '',
|
||||
`image` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`state` TINYINT(4) NOT NULL DEFAULT 0
|
||||
COMMENT 'Published=1,Unpublished=0,Archived=2,Trashed=-2',
|
||||
`mounting_style` TINYINT(4) NOT NULL DEFAULT 0
|
||||
`mounting_style_id` TINYINT(4) NOT NULL DEFAULT 0
|
||||
COMMENT 'Unknown=0,Through_Hole=1,SMD/SMT=2',
|
||||
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`created_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`checked_out` INT(11) NOT NULL DEFAULT 0,
|
||||
`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot_package` (`name`,`state`,`mounting_style`) VALUES
|
||||
('R_0603_1608Metric',1,2),
|
||||
('R_0805_2012Metric',1,2),
|
||||
('DIL8',1,1),
|
||||
('DIL14',1,1),
|
||||
('DIL16',1,1),
|
||||
('DIL20',1,1),
|
||||
('DIL28_SMALL',1,1),
|
||||
('UFQFPN48',1,2),
|
||||
('R_TH_0207_6xø2.3mm_0.25W',1,1),
|
||||
('R_TH_0104_3.3xø1.8mm_0.125W',1,1),
|
||||
('R_TH_0309_9xø3.2mm_0.5W',1,1),
|
||||
('R_TH_0412_11.5xø4.5mm_1W',1,1),
|
||||
('R_TH_0516_15.5xø5mm_2W',1,1);
|
||||
INSERT INTO `#__depot_package` (`name`,`description`,`state`,`mounting_style_id`) VALUES
|
||||
('R_0603_1608Metric','1.6 x 0.8 mm',1,1),
|
||||
('R_0805_2012Metric','2.0 x 1.2 mm',1,1),
|
||||
('DIP8','dual inline package 8 pins',1,2),
|
||||
('DIP14','dual inline package 14 pins',1,2),
|
||||
('DIP16','dual inline package 16 pins',1,2),
|
||||
('DIP20','dual inline package 20 pins',1,2),
|
||||
('DIP28_SMALL','dual inline package 28 pins, small',1,2),
|
||||
('DO-35','DO-204-AH, SOD27, 3.05-5.08 x ø1.53-ø2.28 mm diode axial package',1,2),
|
||||
('DO-201AD','DO-27, 7.2-9.5 x ø4.8-ø5.3 mm diode axial package',1,2),
|
||||
('QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm','Ultra thin Fine pitch Quad Flat Package No-leads, 7 x 7 mm, 0.5 mm pitch, 48 pins',1,1),
|
||||
('R_TH_0207','axial 6xø2.3mm typ. 0.25W',1,2),
|
||||
('R_TH_0104','axial 3.3xø1.8mm typ 0.125W',1,2),
|
||||
('R_TH_0309','axial 9xø3.2mm typ. 0.5W',1,2),
|
||||
('R_TH_0412','axial 11.5xø4.5mm typ. 1W',1,2),
|
||||
('R_TH_0516','axial 15.5xø5mm typ. 2W',1,2);
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot_mounting_style`;
|
||||
CREATE TABLE `#__depot_mounting_style` (
|
||||
`id` SERIAL,
|
||||
`title` VARCHAR(100) NOT NULL DEFAULT '',
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot_mounting_style` (`id`,`title`,`ordering`) VALUES
|
||||
-- (0,'UNKNOWN',0),
|
||||
(1,'SMD',1),
|
||||
(2,'THD',2),
|
||||
(3,'CHASSIS_MOUNT',3),
|
||||
(4,'PRESS_FIT',4),
|
||||
(5,'SCREW_MOUNT',5);
|
||||
|
@ -9,3 +9,4 @@ DROP TABLE IF EXISTS `#__depot`;
|
||||
DROP TABLE IF EXISTS `#__depot_manufacturer`;
|
||||
DROP TABLE IF EXISTS `#__depot_stock`;
|
||||
DROP TABLE IF EXISTS `#__depot_package`;
|
||||
DROP TABLE IF EXISTS `#__depot_mounting_style`;
|
||||
|
19
admin/src/Controller/PackageController.php
Normal file
19
admin/src/Controller/PackageController.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class PackageController extends FormController
|
||||
{
|
||||
}
|
64
admin/src/Model/PackageModel.php
Normal file
64
admin/src/Model/PackageModel.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Model\AdminModel;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
class PackageModel extends AdminModel
|
||||
{
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
$form = $this->loadForm('com_depot.package', 'package', ['control' => 'jform', 'load_data' => $loadData]);
|
||||
|
||||
if (empty($form)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
protected function loadFormData()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->getUserState('com_depot.edit.package.data', []);
|
||||
|
||||
if (empty($data)) {
|
||||
$data = $this->getItem();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function save($data)
|
||||
{
|
||||
/* Add code to modify data before saving */
|
||||
|
||||
// if (Factory::getConfig()->get('unicodeslugs') == 1) {
|
||||
// $data['alias'] = OutputFilter::stringURLUnicodeSlug($data['component_name']);
|
||||
// } else {
|
||||
// $data['alias'] = OutputFilter::stringURLSafe($data['component_name']);
|
||||
// }
|
||||
|
||||
/* replaced by: */
|
||||
if (empty($data['alias'])) {
|
||||
$data['alias'] = ApplicationHelper::stringURLSafe($data['name']);
|
||||
}
|
||||
$result = parent::save($data);
|
||||
// if ($result) {
|
||||
// $this->getTable('', 'Administrator')->rebuild(1);
|
||||
// }
|
||||
return $result;
|
||||
}
|
||||
}
|
86
admin/src/Model/PackagesModel.php
Normal file
86
admin/src/Model/PackagesModel.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\MVC\Model\ListModel;
|
||||
// use Joomla\CMS\Table\Table;
|
||||
use Joomla\Database\ParameterType;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
class PackagesModel extends ListModel
|
||||
{
|
||||
/**
|
||||
* Build an SQL query to load the list data.
|
||||
*
|
||||
* @return \Joomla\Database\DatabaseQuery
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
|
||||
// $query->select('*')
|
||||
// ->from($db->quoteName('#__depot', 'd'));
|
||||
|
||||
// order by
|
||||
// $query->order('d.id ASC');
|
||||
// if (true) {
|
||||
// return $query;
|
||||
// }
|
||||
|
||||
// select the required fields from the table
|
||||
$query->select(
|
||||
$this->getState(
|
||||
'list.select',
|
||||
[
|
||||
$db->quoteName('p.id'),
|
||||
$db->quoteName('p.name'),
|
||||
$db->quoteName('p.alias'),
|
||||
$db->quoteName('p.description'),
|
||||
$db->quoteName('p.image'),
|
||||
$db->quoteName('p.state'),
|
||||
]
|
||||
)
|
||||
)
|
||||
->select(
|
||||
[
|
||||
$db->quoteName('u.name', 'creator'),
|
||||
$db->quoteName('ms.title', 'mounting_style'),
|
||||
]
|
||||
)
|
||||
->from($db->quoteName('#__depot_package', 'p'))
|
||||
->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('p.checked_out'))
|
||||
->join('LEFT', $db->quoteName('#__depot_mounting_style', 'ms'), $db->quoteName('ms.id') . ' = ' . $db->quoteName('p.mounting_style_id'));
|
||||
|
||||
// filter: like / search
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search)) {
|
||||
$like = $db->quote('%' . $search . '%');
|
||||
$query->where($db->quoteName('p.name') . ' LIKE ' . $like);
|
||||
}
|
||||
|
||||
// Filter by published state
|
||||
$published = (string) $this->getState('filter.published');
|
||||
if (is_numeric($published)) {
|
||||
$published = (int) $published;
|
||||
$query->where($db->quoteName('p.state') . ' = :published')
|
||||
->bind(':published', $published, ParameterType::INTEGER);
|
||||
} elseif ($published === '') {
|
||||
$query->where($db->quoteName('p.state') . ' IN (0, 1)');
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@ class PartsModel extends ListModel
|
||||
$db->quoteName('d.quantity'),
|
||||
$db->quoteName('d.quantity_exp'),
|
||||
$db->quoteName('d.ordering'),
|
||||
$db->quoteName('d.package_id'),
|
||||
]
|
||||
)
|
||||
)
|
||||
@ -61,13 +62,17 @@ class PartsModel extends ListModel
|
||||
$db->quoteName('m.name_short', 'manufacturer'),
|
||||
$db->quoteName('m.name_long', 'manufacturer_long'),
|
||||
$db->quoteName('s.name', 'stock_name'),
|
||||
$db->quoteName('p.name', 'package_name'),
|
||||
$db->quoteName('p.description', 'package_description'),
|
||||
$db->quoteName('ms.title', 'mounting_style'),
|
||||
]
|
||||
)
|
||||
->from($db->quoteName('#__depot', 'd'))
|
||||
->join('LEFT', $db->quoteName('#__depot_manufacturer', 'm'), $db->quoteName('m.id') . ' = ' . $db->quoteName('d.manufacturer_id'))
|
||||
->join('LEFT', $db->quoteName('#__depot_stock', 's'), $db->quoteName('s.id') . ' = ' . $db->quoteName('d.stock_id'))
|
||||
->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('d.checked_out'));
|
||||
|
||||
->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('#__depot_mounting_style', 'ms'), $db->quoteName('ms.id') . ' = ' . $db->quoteName('p.mounting_style_id'));
|
||||
// filter: like / search
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search)) {
|
||||
|
@ -70,5 +70,4 @@ class ManufacturerTable extends Table
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
|
||||
}
|
73
admin/src/Table/PackageTable.php
Normal file
73
admin/src/Table/PackageTable.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Table;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\Database\DatabaseDriver;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
class PackageTable extends Table
|
||||
{
|
||||
function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__depot_package', 'id', $db);
|
||||
|
||||
// add an alias for published:
|
||||
$this->setColumnAlias('published', 'state');
|
||||
}
|
||||
|
||||
public function store($updateNulls = true)
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$date = Factory::getDate()->toSql();
|
||||
// $user = Factory::getUser();
|
||||
// $user = $this->getCurrentUser();
|
||||
$user = $app->getIdentity();
|
||||
|
||||
if (!$this->created) {
|
||||
$this->created = $date;
|
||||
}
|
||||
|
||||
if (!$this->created_by) {
|
||||
$this->created_by = $user->get('id');
|
||||
}
|
||||
|
||||
if ($this->id) {
|
||||
// existing item
|
||||
$this->modified_by = $user->get('id');
|
||||
$this->modified = $date;
|
||||
} else {
|
||||
// set modified to created date if not set
|
||||
if (!$this->modified) {
|
||||
$this->modified = $this->created;
|
||||
}
|
||||
if (empty($this->modified_by)) {
|
||||
$this->modified_by = $this->created_by;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify that the alias is unique
|
||||
$table = $app->bootComponent('com_depot')->getMVCFactory()->createTable('Package', 'Administrator');
|
||||
if ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0)) {
|
||||
$this->setError('Alias is not unique.');
|
||||
|
||||
if ($table->state == -2) {
|
||||
$this->setError('Alias is not unique. The item is in Trash.');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::store($updateNulls);
|
||||
}
|
||||
}
|
75
admin/src/View/Package/HtmlView.php
Normal file
75
admin/src/View/Package/HtmlView.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Package;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
// use Joomla\CMS\MVC\View\GenericDataException;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* View to edit an article.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* The \JForm object
|
||||
*
|
||||
* @var \JForm
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
* The active item
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $item;
|
||||
|
||||
/**
|
||||
* Execute and display a template script.
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return mixed A string if successful, otherwise an Error object.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @since 1.6
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
|
||||
// if (count($errors = $this->get('Errors'))) {
|
||||
// throw new GenericDataException(implode("\n", $errors), 500);
|
||||
// }
|
||||
$this->addToolbar();
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar()
|
||||
{
|
||||
Factory::getApplication()->getInput()->set('hidemainmenu', true);
|
||||
|
||||
ToolbarHelper::title('Package: Add');
|
||||
|
||||
ToolbarHelper::apply('package.apply');
|
||||
ToolbarHelper::save('package.save');
|
||||
ToolbarHelper::cancel('package.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
51
admin/src/View/Packages/HtmlView.php
Normal file
51
admin/src/View/Packages/HtmlView.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Packages;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
// use Joomla\CMS\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
|
||||
// use Joomla\CMS\Language\Text;
|
||||
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Get application
|
||||
$app = Factory::getApplication();
|
||||
|
||||
$this->items = $this->get('Items');
|
||||
|
||||
// adding filters
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
// set the toolbar
|
||||
$this->addToolbar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar()
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_DEPOT_MANAGER_PACKAGES'));
|
||||
ToolbarHelper::addNew('package.add');
|
||||
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'packages.delete');
|
||||
ToolbarHelper::publish('packages.publish', 'JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::unpublish('packages.unpublish', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
}
|
62
admin/tmpl/package/edit.php
Normal file
62
admin/tmpl/package/edit.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?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.7
|
||||
*/
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('form.validate')
|
||||
->useScript('keepalive');
|
||||
|
||||
?>
|
||||
<form action="<?= Route::_('index.php?option=com_depot&view=package&layout=edit&id=' . (int) $this->item->id); ?>"
|
||||
method="post" name="adminForm" id="item-form" class="form-validate">
|
||||
<?= HtmlHelper::_('uitab.startTabSet', 'myTab', ['active' => 'details']); ?>
|
||||
<?= HTMLHelper::_(
|
||||
'uitab.addTab',
|
||||
'myTab',
|
||||
'details',
|
||||
empty($this->item->id) ? Text::_('COM_DEPOT_TAB_NEW_PACKAGE') :
|
||||
Text::_('COM_DEPOT_TAB_EDIT_PACKAGE')
|
||||
); ?>
|
||||
<fieldset id="fieldset-details" class="options-form">
|
||||
<legend>
|
||||
<?= Text::_('COM_DEPOT_LEGEND_PACKAGE_DETAILS') ?>
|
||||
</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-6">
|
||||
<?= $this->form->renderFieldset('details'); ?>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6">
|
||||
<?= $this->form->getInput('description'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?= HtmlHelper::_('uitab.endTab'); ?>
|
||||
|
||||
<?= HTMLHelper::_('uitab.addTab', 'myTab', 'statistics', Text::_('COM_DEPOT_TAB_STATISTICS')); ?>
|
||||
<fieldset class="options-form">
|
||||
<legend>
|
||||
<?= Text::_('COM_DEPOT_LEGEND_STATISTICS') ?>
|
||||
</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-9">
|
||||
<?= $this->form->renderFieldset('statistics'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?= HTMLHelper::_('uitab.endTab'); ?>
|
||||
|
||||
<?= HtmlHelper::_('uitab.endTabSet'); ?>
|
||||
|
||||
<input type="hidden" name="task" value="package.edit" />
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
81
admin/tmpl/packages/default.php
Normal file
81
admin/tmpl/packages/default.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?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.7
|
||||
*/
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
?>
|
||||
<form action="<?= Route::_('index.php?option=com_depot&view=packages'); ?>" method="post" name="adminForm"
|
||||
id="adminForm">
|
||||
|
||||
<?= LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
|
||||
|
||||
<?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>
|
||||
<?= Text::_('COM_DEPOT_TABLE_HEAD_ID') ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= Text::_('COM_DEPOT_TABLE_HEAD_PACKAGE_NAME') ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= Text::_('COM_DEPOT_TABLE_HEAD_DESCRIPTION') ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= Text::_('COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE') ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->items as $i => $item): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= HTMLHelper::_('grid.id', $i, $item->id); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $item->id ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= Route::_('index.php?option=com_depot&task=package.edit&id=' .
|
||||
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
|
||||
<?= $this->escape($item->name); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape($item->description); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape($item->mounting_style); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
@ -62,10 +62,24 @@ use Joomla\CMS\Layout\LayoutHelper;
|
||||
<?= $item->id ?>
|
||||
</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape($item->quantity); ?>
|
||||
|
12
depot.xml
12
depot.xml
@ -7,7 +7,7 @@
|
||||
<license>GPL v2 +; see LICENSE.md</license>
|
||||
<authorEmail>thomas@kuschel.at</authorEmail>
|
||||
<authorUrl>https://kuschel.at</authorUrl>
|
||||
<version>0.9.6</version>
|
||||
<version>0.9.7</version>
|
||||
<description>COM_DEPOT_XML_DESCRIPTION</description>
|
||||
<namespace path="src/">KW4NZ\Component\Depot</namespace>
|
||||
<install> <!-- Runs on install -->
|
||||
@ -61,6 +61,14 @@
|
||||
>
|
||||
COM_DEPOT_MENU_STOCKS
|
||||
</menu>
|
||||
<menu
|
||||
link="option=com_depot&view=packages"
|
||||
view="packages"
|
||||
img="class:depot-package"
|
||||
alt="Depot/Packages"
|
||||
>
|
||||
COM_DEPOT_MENU_PACKAGES
|
||||
</menu>
|
||||
</submenu>
|
||||
<files folder="admin">
|
||||
<folder>forms</folder>
|
||||
@ -72,6 +80,8 @@
|
||||
<languages folder="admin/language">
|
||||
<language tag="en-GB">en-GB/com_depot.ini</language>
|
||||
<language tag="en-GB">en-GB/com_depot.sys.ini</language>
|
||||
<language tag="de-DE">de-DE/com_depot.ini</language>
|
||||
<language tag="de-DE">de-DE/com_depot.sys.ini</language>
|
||||
</languages>
|
||||
</administration>
|
||||
</extension>
|
||||
|
Loading…
Reference in New Issue
Block a user