Compare commits
No commits in common. "dev-1.0" and "b4_actions" have entirely different histories.
dev-1.0
...
b4_actions
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1 +0,0 @@
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
196
README.md
196
README.md
@ -17,7 +17,7 @@ developing our project. The first run with simply renaming entries from a
|
||||
copy of the component **com_banners** did not work as expected.
|
||||
So let us start at the very beginning:
|
||||
|
||||
## Adding basic files for component (b1_basic_backend)
|
||||
### Adding basic files for component (b1_basic_backend)
|
||||
|
||||
With the git branch **b1_basic_backend**
|
||||
Add the following basic six files:
|
||||
@ -124,7 +124,7 @@ the directory /admin/language/en-GB/ naming it
|
||||
|
||||
---
|
||||
|
||||
## Creating and managing Joomla database (b2_database)
|
||||
### Creating and managing Joomla database (b2_database)
|
||||
|
||||
With the new git branch **b2_database** we continue our workflow.
|
||||
|
||||
@ -295,7 +295,7 @@ Methods in the table objects are:
|
||||
|
||||
---
|
||||
|
||||
## Get a Form in Joomla component (b3_form)
|
||||
### Get a Form in Joomla component
|
||||
|
||||
The **Form** class of Joomla is used to create complex forms with flexible
|
||||
layouts and dynamic properties. First, the form fields are defined in the
|
||||
@ -440,7 +440,7 @@ just a line before `<folder>services</folder>` :
|
||||
|
||||
---
|
||||
|
||||
## Adding administrator's actions (Back-end) - Save and Cancel (b4_actions)
|
||||
### Adding administrator's actions (Back-end) - Save and Cancel
|
||||
In the form View, you can add action buttons like "Save" and "Cancel" to submit the form
|
||||
or cancel the editing respectively. These buttons are added to the toolbar.
|
||||
|
||||
@ -526,191 +526,3 @@ So, you either have data from the database, which you can get with `getItem()`,
|
||||
data from the session, which you can get with `getUserSate()`.
|
||||
|
||||
---
|
||||
## Automatic handling of fields (b5_field_manipulation)
|
||||
Values of some fields in the form can be automatically handled. There is no need to fill in
|
||||
the values while creating or editing a record.
|
||||
|
||||
For example, `alias` can be generated from the `title` (or here, from the component's name),
|
||||
dates can be set to the current date or to `null`, user id can be obtained from current
|
||||
logged in user. Further may you also need to check validity of some fields like "should not
|
||||
be empty", `alias` should be unique, etc.
|
||||
|
||||
The data submitted by the form needs to be modified before saving. This can be done at
|
||||
various places:
|
||||
|
||||
- in the **Model class** by oeverriding the `save()` method or `preparetable()` method.
|
||||
- in the **Table class** by overriding the `bind()`, `check()`, or `store()` methods.
|
||||
|
||||
#### 1. Model file
|
||||
**admin/src/Model/PartModel.php
|
||||
```php
|
||||
public function save($data)
|
||||
{
|
||||
/* Add code to modify data before saving */
|
||||
|
||||
return parent:save($data);
|
||||
}
|
||||
```
|
||||
It is better to perform automatic handling of fields in the Table class as the data can be
|
||||
saved not only from administration, but also from frontend, API or by any other means.
|
||||
|
||||
##### Example generating Alias
|
||||
Alias is generated from the `component_name` (or any other field) using **OutputFilter** class
|
||||
method.
|
||||
```php
|
||||
if (empty($data['alias']))
|
||||
{
|
||||
if (Factory::getConfig()->get('unicodeslugs') == 1) {
|
||||
$data['alias'] = OutputFilter::stringURLUnicodeSlug($data['component_name']);
|
||||
} else {
|
||||
$data['alias'] = OutputFilter::stringURLSafe($data['component_name']);
|
||||
}
|
||||
}
|
||||
```
|
||||
##### Ordering
|
||||
The ordering value is calculated by finding the maximum value in the column and then
|
||||
incrementing it.
|
||||
```php
|
||||
/* if it is 0 -> get the max + 1 value */
|
||||
if (!$data['ordering']) {
|
||||
$db = Factory::getDbo();
|
||||
// $query = $db->getQuery(true) // is deprecated,
|
||||
// using createQuery() instead:
|
||||
$query = $db->createQuery()
|
||||
->select('MAX(ordering)')
|
||||
->from('#__depot');
|
||||
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$data['ordering'] = $max + 1;
|
||||
}
|
||||
|
||||
```
|
||||
#### 2. bind()
|
||||
The `bind()` splits the article text or description into intro text and full text based on read
|
||||
more tag in the content. This method also converts fields data from arrays to JSON for
|
||||
saving into the database.
|
||||
|
||||
```php
|
||||
public function bind($array, $ignore = '')
|
||||
{
|
||||
if (isset($array['attribs']) && \is_array($array['attribs'])) {
|
||||
$registry = new Registry($array['attribs']);
|
||||
$array['attribs'] = (string) $registry;
|
||||
}
|
||||
|
||||
return parent::bind($array, $ignore);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
#### 3. check()
|
||||
The check() checks whether title of the article is not empty. This method also sets the alias,
|
||||
hits, publishing dates.
|
||||
```php
|
||||
public function check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->title) == '') {
|
||||
$this->setError('Title (title) is not set.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->alias) == '') {
|
||||
$this->alias = $this->title;
|
||||
}
|
||||
|
||||
$this->alias = ApplicationHelper::stringURLSave($this->alias, $this->language);
|
||||
|
||||
// Ensure any new items have compulsory fields set
|
||||
if (!$this->id) {
|
||||
// Hits must be zero on a new item
|
||||
$this-hits = 0;
|
||||
}
|
||||
|
||||
// Set publish_up to null if not set
|
||||
if (!$this->publish_up) {
|
||||
$this->publish_up = null;
|
||||
}
|
||||
|
||||
// Set publish_down to null if not set
|
||||
if (!$this->publish_down) {
|
||||
$this->publish_down = null;
|
||||
}
|
||||
|
||||
// Check the publish down date is not earlier than publish up.
|
||||
if (!is_null($this->publish_up) &&
|
||||
!is_null($this->publish_down) &&
|
||||
$this->publish_down < $this->publish_up) {
|
||||
// swap the dates
|
||||
$temp = $this->publish_up;
|
||||
$this->publish_up = $this->publish_down;
|
||||
$this->publish_down = $temp;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
#### 4. store()
|
||||
The `store()` sets created and modified dates, created by and modified by users, and also
|
||||
checks for unique alias.
|
||||
```php
|
||||
public function store($updateNulls = true)
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$date = Factory::getDate()->toSql();
|
||||
$user = Factory::getUser();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// Set modified_by to created_by user if not set
|
||||
if (empty($this->modified_by)) {
|
||||
$this->modified_by = $this->created_by;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify that the alias is unique
|
||||
$table = $app->bootComponent('com_depot')->getMVCFactory()
|
||||
->createTable('Part','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);
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
@ -1,51 +0,0 @@
|
||||
<?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_MANUFACTURERS_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_MANUFACTURERS_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="m.name_long ASC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="m.state ASC">JSTATUS_ASC</option>
|
||||
<option value="m.state DESC">JSTATUS_DESC</option>
|
||||
<option value="m.name_long ASC">COM_DEPOT_SORT_BY_MANUFACTURER_ASC</option>
|
||||
<option value="m.name_long DESC">COM_DEPOT_SORT_BY_MANUFACTURER_DESC</option>
|
||||
<option value="m.name_short ASC">COM_DEPOT_SORT_BY_ACRONYM_ASC</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 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>
|
@ -1,51 +0,0 @@
|
||||
<?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=""
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="p.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||
<option value="p.ordering DESC">JGRID_HEADING_ORDERING_DESC</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.description ASC">COM_DEPOT_SORT_BY_DESCRIPTION_ASC</option>
|
||||
<option value="p.description DESC">COM_DEPOT_SORT_BY_DESCRIPTION_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>
|
@ -1,55 +0,0 @@
|
||||
<?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_PARTS_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_PARTS_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="d.component_name ASC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="d.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||
<option value="d.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
|
||||
<option value="d.state ASC">JSTATUS_ASC</option>
|
||||
<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.description ASC">COM_DEPOT_SORT_BY_DESCRIPTION_ASC</option>
|
||||
<option value="d.description DESC">COM_DEPOT_SORT_BY_DESCRIPTION_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="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 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>
|
@ -1,53 +0,0 @@
|
||||
<?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_STOCKS_LABEL"
|
||||
description="COM_DEPOT_FILTER_SEARCH_STOCKS_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=""
|
||||
validate="options"
|
||||
>
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="s.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||
<option value="s.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
|
||||
<option value="s.state ASC">JSTATUS_ASC</option>
|
||||
<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="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 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>
|
||||
<field
|
||||
name="limit"
|
||||
type="limitbox"
|
||||
label="JGLOBAL_LIST_LIMIT"
|
||||
default="25"
|
||||
class="js-select-submit-on-change"
|
||||
/>
|
||||
</fields>
|
||||
</form>
|
@ -1,93 +0,0 @@
|
||||
<?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_short"
|
||||
type="text"
|
||||
label="COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_LABEL"
|
||||
description="COM_DEPOT_FIELD_MANUFACTURER_ACRONYM_DESC"
|
||||
required="true"
|
||||
autofocus="1"
|
||||
/>
|
||||
<field
|
||||
name="name_long"
|
||||
type="text"
|
||||
label="COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_LABEL"
|
||||
description="COM_DEPOT_FIELD_MANUFACTURER_LONG_NAME_DESC"
|
||||
required="true"
|
||||
/>
|
||||
<field
|
||||
name="alias"
|
||||
type="text"
|
||||
label="JFIELD_ALIAS_LABEL"
|
||||
description="JFIELD_ALIAS_DESC"
|
||||
hint="COM_DEPOT_FIELD_ALIAS_MANUFACTURER_PLACEHOLDER"
|
||||
size="40"
|
||||
/>
|
||||
<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"
|
||||
/>
|
||||
<field
|
||||
name="modified"
|
||||
type="calendar"
|
||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
readonly="true"
|
||||
filter="user_utc"
|
||||
/>
|
||||
<field
|
||||
name="modified_by"
|
||||
type="user"
|
||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
@ -1,90 +0,0 @@
|
||||
<?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"
|
||||
/>
|
||||
<field
|
||||
name="ordering"
|
||||
type="text"
|
||||
label="JFIELD_ORDERING_LABEL"
|
||||
class="readonly"
|
||||
default="0"
|
||||
readonly="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
@ -1,97 +1,12 @@
|
||||
<?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="component_name"
|
||||
type="text"
|
||||
label="COM_DEPOT_FIELD_COMPONENT_NAME_LABEL"
|
||||
description="COM_DEPOT_FIELD_COMPONENT_NAME_DESC"
|
||||
required="true"
|
||||
autofocus="1"
|
||||
/>
|
||||
<field
|
||||
name="quantity"
|
||||
type="number"
|
||||
label="COM_DEPOT_FIELD_QUANTITY_LABEL"
|
||||
description="COM_DEPOT_FIELD_QUANTITY_DESC"
|
||||
default="0"
|
||||
/>
|
||||
<field
|
||||
name="quantity_exp"
|
||||
type="number"
|
||||
label="COM_DEPOT_FIELD_QUANTITY_EXP_LABEL"
|
||||
description="COM_DEPOT_FIELD_QUANTITY_EXP_DESC"
|
||||
default="0"
|
||||
/>
|
||||
<field
|
||||
name="alias"
|
||||
type="text"
|
||||
label="JFIELD_ALIAS_LABEL"
|
||||
description="JFIELD_ALIAS_DESC"
|
||||
hint="COM_DEPOT_FIELD_ALIAS_PART_PLACEHOLDER"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="description"
|
||||
type="text"
|
||||
label="COM_DEPOT_FIELD_DESCRIPTION_LABEL"
|
||||
description="COM_DEPOT_FIELD_DESCRIPTION_DESC"
|
||||
/>
|
||||
<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"
|
||||
label="COM_DEPOT_FIELD_SELECT_MANUFACTURER"
|
||||
query="SELECT id, CONCAT(name_short,' (',name_long,')') AS title FROM #__depot_manufacturer ORDER BY title"
|
||||
key_field="id"
|
||||
value_field="title"
|
||||
required="true"
|
||||
>
|
||||
<option value="">COM_DEPOT_SELECT_YOUR_OPTION</option>
|
||||
</field>
|
||||
<field
|
||||
name="stock_id"
|
||||
type="sql"
|
||||
label="COM_DEPOT_FIELD_SELECT_STOCK"
|
||||
query="SELECT id, name FROM #__depot_stock ORDER BY name"
|
||||
key_field="id"
|
||||
value_field="name"
|
||||
required="true"
|
||||
>
|
||||
<option value="">COM_DEPOT_SELECT_YOUR_OPTION</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"
|
||||
@ -100,39 +15,4 @@
|
||||
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"
|
||||
/>
|
||||
<field
|
||||
name="modified"
|
||||
type="calendar"
|
||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
readonly="true"
|
||||
filter="user_utc"
|
||||
/>
|
||||
<field
|
||||
name="modified_by"
|
||||
type="user"
|
||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@ -1,107 +0,0 @@
|
||||
<?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_STOCK_NAME_LABEL"
|
||||
description="COM_DEPOT_FIELD_STOCK_NAME_DESC"
|
||||
required="true"
|
||||
autofocus="1"
|
||||
/>
|
||||
<field
|
||||
name="description"
|
||||
type="text"
|
||||
label="COM_DEPOT_FIELD_STOCK_DESCRIPTION_LABEL"
|
||||
description="COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC"
|
||||
required="true"
|
||||
/>
|
||||
<field
|
||||
name="owner_id"
|
||||
type="user"
|
||||
label="COM_DEPOT_FIELD_STOCK_OWNER_LABEL"
|
||||
description="COM_DEPOT_FIELD_STOCK_OWNER_DESC"
|
||||
/>
|
||||
<field
|
||||
name="alias"
|
||||
type="text"
|
||||
label="JFIELD_ALIAS_LABEL"
|
||||
description="JFIELD_ALIAS_DESC"
|
||||
hint="COM_DEPOT_FIELD_ALIAS_STOCK_PLACEHOLDER"
|
||||
size="40"
|
||||
/>
|
||||
<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"
|
||||
/>
|
||||
<field
|
||||
name="modified"
|
||||
type="calendar"
|
||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||
class="readonly"
|
||||
translateformat="true"
|
||||
showtime="true"
|
||||
readonly="true"
|
||||
filter="user_utc"
|
||||
/>
|
||||
<field
|
||||
name="modified_by"
|
||||
type="user"
|
||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||
class="readonly"
|
||||
readonly="true"
|
||||
/>
|
||||
<field
|
||||
name="ordering"
|
||||
type="text"
|
||||
label="JFIELD_ORDERING_LABEL"
|
||||
class="readonly"
|
||||
default="0"
|
||||
readonly="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
@ -1,109 +0,0 @@
|
||||
; @package Depot.Language German de-DE
|
||||
; @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_MANUFACTURER_PLACEHOLDER="Automatisch aus dem Herstellerkürzel generieren"
|
||||
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_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_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_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_DESCRIPTION_DESC="Geben Sie hier die exakte Position/Beschreibung ein"
|
||||
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_LABEL="Bauteilsuche"
|
||||
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_PACKAGE_DETAILS="Gehäusedetails"
|
||||
COM_DEPOT_LEGEND_PART_DETAILS="Bauteildetails"
|
||||
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_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_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_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_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_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_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_DESC="Menge absteigend"
|
||||
COM_DEPOT_SORT_BY_STOCK_NAME_ASC="Lagerort aufsteigend"
|
||||
COM_DEPOT_SORT_BY_STOCK_NAME_DESC="Lagerort absteigend"
|
||||
COM_DEPOT_STOCKS_N_ITEMS_DELETED_1="Ein Lagerort entfernt"
|
||||
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_PACKAGE="Gehäusedetails"
|
||||
COM_DEPOT_TAB_EDIT_PART="Bauteildetails"
|
||||
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_TABLE_HEAD_DESCRIPTION="Beschreibung"
|
||||
COM_DEPOT_TABLE_HEAD_ID="ID"
|
||||
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_NAME="Bauteilname"
|
||||
COM_DEPOT_TABLE_HEAD_OWNER="Besitzer"
|
||||
COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Gehausename"
|
||||
COM_DEPOT_TABLE_HEAD_QUANTITY="Menge"
|
||||
COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent"
|
||||
COM_DEPOT_TABLE_HEAD_STOCK="Lagerort"
|
||||
COM_DEPOT_XML_DESCRIPTION="Depot, das Bauteil-Warenhaus"
|
@ -1,12 +0,0 @@
|
||||
; @package Depot.Language German de-DE
|
||||
; @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"
|
@ -1,111 +1,10 @@
|
||||
; @package Depot.Language English en-GB (default)
|
||||
; @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_MANUFACTURER_PLACEHOLDER="Auto-generate from manufacturer acronym"
|
||||
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_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_DESCRIPTION_DESC="Enter here the description of the component"
|
||||
COM_DEPOT_FIELD_DESCRIPTION_LABEL="Description"
|
||||
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_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_DESC="Enter here the current number of components"
|
||||
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_LABEL="Quantity Exponent"
|
||||
COM_DEPOT_FIELD_SELECT_MANUFACTURER="Manufacturer"
|
||||
COM_DEPOT_FIELD_SELECT_PACKAGE="Package"
|
||||
COM_DEPOT_FIELD_SELECT_STOCK="Stock Location"
|
||||
COM_DEPOT_FIELD_STOCK_DESCRIPTION_DESC="Enter here the exact location/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_LABEL="Search a component"
|
||||
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_PACKAGE_DETAILS="Package Details"
|
||||
COM_DEPOT_LEGEND_PART_DETAILS="Component Details"
|
||||
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_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_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_MORE="%d components deleted"
|
||||
COM_DEPOT_N_ITEMS_PUBLISHED_1="One component published"
|
||||
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_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_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_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_DESC="Quantity descending"
|
||||
COM_DEPOT_SORT_BY_STOCK_NAME_ASC="Stock Location ascending"
|
||||
COM_DEPOT_SORT_BY_STOCK_NAME_DESC="Stock Location descending"
|
||||
COM_DEPOT_STOCKS_N_ITEMS_DELETED_1="One stock location deleted"
|
||||
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_PACKAGE="Package Details"
|
||||
COM_DEPOT_TAB_EDIT_PART="Component 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_TABLE_HEAD_DESCRIPTION="Description"
|
||||
COM_DEPOT_TABLE_HEAD_ID="ID"
|
||||
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_NAME="Component Name"
|
||||
COM_DEPOT_TABLE_HEAD_OWNER="Owner"
|
||||
COM_DEPOT_TABLE_HEAD_PACKAGE_NAME="Package Name"
|
||||
COM_DEPOT_TABLE_HEAD_QUANTITY="Quantity"
|
||||
COM_DEPOT_TABLE_HEAD_QUANTITY_EXP="Exponent"
|
||||
COM_DEPOT_TABLE_HEAD_STOCK="Stock Location"
|
||||
COM_DEPOT_XML_DESCRIPTION="Depot, the component warehouse"
|
||||
|
@ -1,4 +1,4 @@
|
||||
; @package Depot.Language English en-GB (default)
|
||||
; @package Depot.Language
|
||||
; @subpackage com_depot
|
||||
; @author Thomas Kuschel <thomas@kuschel.at>
|
||||
; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
@ -7,6 +7,5 @@
|
||||
;
|
||||
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"
|
||||
|
@ -17,7 +17,8 @@ use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use KW4NZ\Component\Depot\Administrator\Extension\DepotComponent;
|
||||
|
||||
return new class implements ServiceProviderInterface {
|
||||
return new class implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->registerServiceProvider(new ComponentDispatcherFactory('\\KW4NZ\\Component\\Depot'));
|
||||
@ -25,7 +26,8 @@ return new class implements ServiceProviderInterface {
|
||||
|
||||
$container->set(
|
||||
ComponentInterface::class,
|
||||
function (Container $container) {
|
||||
function (Container $container)
|
||||
{
|
||||
$component = new DepotComponent($container->get(ComponentDispatcherFactoryInterface::class));
|
||||
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
DROP TABLE IF EXISTS `#__depot`;
|
||||
CREATE TABLE `#__depot` (
|
||||
`id` SERIAL,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`component_name` VARCHAR(1024) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL
|
||||
COMMENT 'unique component name (ASCII characters only)',
|
||||
`alias` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
@ -29,13 +28,13 @@ CREATE TABLE `#__depot` (
|
||||
`access` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
`params` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`image` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`version` int unsigned NOT NULL DEFAULT 1,
|
||||
-- references to other tables:
|
||||
`category_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`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`),
|
||||
@ -47,136 +46,6 @@ 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`,`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),
|
||||
('R_120R','r_120r','resistor, metalic',46,'2023-11-15 23:40:00',3,1,1,2,11);
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot_manufacturer`;
|
||||
CREATE TABLE `#__depot_manufacturer` (
|
||||
`id` SERIAL,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`name_short` CHAR(25) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL
|
||||
COMMENT 'unique manufacturer name or abbriviation',
|
||||
`alias` VARCHAR(127) NOT NULL DEFAULT '',
|
||||
`name_long` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`url` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`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',
|
||||
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`modified_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`description` VARCHAR(4000) NOT NULL DEFAULT '',
|
||||
`state` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
`image` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`access` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_short` (`name_short`)
|
||||
) ENGINE=InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot_manufacturer` (`name_short`, `name_long`, `url`,
|
||||
`description`, `image`, `state`) VALUES
|
||||
('TSC','Taiwan Semiconductor','https://www.taiwansemi.com',
|
||||
'Diodes, ECAD Models, ICs, MOSFETs, Protection Devices, AEC-Q qualified','',1),
|
||||
('ST','STMicroelectronics','https://www.st.com',
|
||||
'Microprocessors, Audio ICs, OPamps, Diodes, Memories, MEMS, NFCs, Transistors, Wireless, Automotive electronics, etc.','',1);
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot_stock`;
|
||||
CREATE TABLE `#__depot_stock` (
|
||||
`id` SERIAL,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`name` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`alias` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`owner_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`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',
|
||||
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`modified_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`description` VARCHAR(4000) NOT NULL DEFAULT '',
|
||||
`params` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`location` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`latitude` DECIMAL(9,7) NOT NULL DEFAULT 48.31738798930856,
|
||||
`longitude` DECIMAL(10,7) NOT NULL DEFAULT 16.313504251028924,
|
||||
`state` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
`access` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `nameindex` (`name`,`owner_id`)
|
||||
)
|
||||
ENGINE=InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot_stock`(`name`, `location`, `description`, `state`, `access`) VALUES
|
||||
('Semiconductors workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 5x12 (60) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('Resistors workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 2x5x12 + 1x5x7+3 (158) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('Capacitors/Inductors workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 5x12 (60) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('Plugs/Sockets/other workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 5x12 (60) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('SMD cabinet', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'SMD cabinet, conductive, 6-times cabinet with inlays, 6 x 7*6 (252) round boxes, each ø 27 x 13 mm',1,0);
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot_package`;
|
||||
CREATE TABLE `#__depot_package` (
|
||||
`id` SERIAL,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`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_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',
|
||||
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`modified_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
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,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`title` VARCHAR(100) NOT NULL DEFAULT '',
|
||||
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);
|
||||
`ordering`,`state`,`manufacturer_id`) VALUES
|
||||
('1N5404','1n5404','diode, rectifier 3A',9,'2023-09-25 15:00:00',1,1,1),
|
||||
('1N4148','1n4148','diode, general purpose',1234,'2023-09-25 15:15:15',2,1,2);
|
||||
|
@ -6,7 +6,3 @@
|
||||
-- @since 0.0.2
|
||||
|
||||
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`;
|
||||
|
@ -1,35 +0,0 @@
|
||||
-- @package Depot.SQL MariaDB -- UPDATE to 0.0.5
|
||||
-- @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.5
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__depot_manufacturer` (
|
||||
`id` SERIAL,
|
||||
`name_short` CHAR(25) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL
|
||||
COMMENT 'unique manufacturer name or abbriviation',
|
||||
`name_long` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`url` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`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',
|
||||
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`modified_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`description` VARCHAR(4000) NOT NULL DEFAULT '',
|
||||
`state` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
`image` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`access` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_short` (`name_short`)
|
||||
) ENGINE=InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot_manufacturer` (`name_short`, `name_long`, `url`,
|
||||
`description`, `image`, `state`) VALUES
|
||||
('TSC','Taiwan Semiconductor','https://www.taiwansemi.com',
|
||||
'Diodes, ECAD Models, ICs, MOSFETs, Protection Devices, AEC-Q qualified','',1),
|
||||
('ST','STMicroelectronics','https://www.st.com',
|
||||
'Microprocessors, Audio ICs, OPamps, Diodes, Memories, MEMS, NFCs, Transistors, Wireless, Automotive electronics, etc.','',1);
|
@ -1,42 +0,0 @@
|
||||
-- @package Depot.SQL MariaDB -- UPDATE to 0.9.0
|
||||
-- @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.0
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__depot_stock` (
|
||||
`id` SERIAL,
|
||||
`name` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`alias` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`owner_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`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',
|
||||
`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`modified_by` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`description` VARCHAR(4000) NOT NULL DEFAULT '',
|
||||
`params` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`location` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||
`latitude` DECIMAL(9,7) NOT NULL DEFAULT 48.31738798930856,
|
||||
`longitude` DECIMAL(10,7) NOT NULL DEFAULT 16.313504251028924,
|
||||
`state` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
`access` TINYINT(4) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `nameindex` (`name`,`owner_id`)
|
||||
) ENGINE=InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot_stock` (`name`, `location`, `description`, `state`, `access`) VALUES
|
||||
('Semiconductors workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 5x12 (60) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('Resistors workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 2x5x12 + 1x5x7+3 (158) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('Capacitors/Inductors workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 5x12 (60) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('Plugs/Sockets/other workshop cabinet depot', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'MARS Svratka Workshop Depot 5x12 (60) compartments à 54 x 35 x 140 mm',1,0),
|
||||
('SMD cabinet', 'Tom''s office, Martinstr. 58a, 3400 Klosterneuburg',
|
||||
'SMD cabinet, conductive, 6-times cabinet with inlays, 6 x 7*6 (252) round boxes, each ø 27 x 13 mm',1,0);
|
@ -1,8 +0,0 @@
|
||||
-- @package Depot.SQL MariaDB -- UPDATE to 0.9.11
|
||||
-- @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
|
||||
ALTER TABLE `#__depot_package`
|
||||
ADD COLUMN `ordering` INT(11) NOT NULL DEFAULT 0 AFTER `modified_by`;
|
@ -1,9 +0,0 @@
|
||||
-- @package Depot.SQL MariaDB -- UPDATE to 0.9.12
|
||||
-- @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
|
||||
ALTER TABLE `#__depot_package`
|
||||
ADD COLUMN `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `checked_out_time`,
|
||||
ADD COLUMN `modified_by` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `modified`;
|
@ -1,19 +0,0 @@
|
||||
<?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.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ManufacturerController extends FormController
|
||||
{
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<?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
|
||||
{
|
||||
protected $text_prefix = 'COM_DEPOT_PACKAGE';
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.6
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class PartsController extends AdminController
|
||||
{
|
||||
public function getModel($name = 'Part', $prefix = 'Administrator', $config = ['ignore_request' => true])
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<?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.2
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class StockController extends FormController
|
||||
{
|
||||
protected $text_prefix = 'COM_DEPOT_STOCK';
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
<?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.1
|
||||
*/
|
||||
|
||||
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 ManufacturerModel extends AdminModel
|
||||
{
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
$form = $this->loadForm('com_depot.manufacturer', 'manufacturer', ['control' => 'jform', 'load_data' => $loadData]);
|
||||
|
||||
if (empty($form)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
protected function loadFormData()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->getUserState('com_depot.edit.manufacturer.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_short']);
|
||||
}
|
||||
$result = parent::save($data);
|
||||
// if ($result) {
|
||||
// $this->getTable('', 'Administrator')->rebuild(1);
|
||||
// }
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
<?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.3
|
||||
*/
|
||||
|
||||
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 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.
|
||||
*
|
||||
* @return \Joomla\Database\DatabaseQuery
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->createQuery();
|
||||
|
||||
|
||||
// $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('m.id'),
|
||||
$db->quoteName('m.name_short'),
|
||||
$db->quoteName('m.name_long'),
|
||||
$db->quoteName('m.alias'),
|
||||
$db->quoteName('m.description'),
|
||||
]
|
||||
)
|
||||
)
|
||||
->select(
|
||||
[
|
||||
$db->quoteName('u.name', 'creator'),
|
||||
]
|
||||
)
|
||||
->from($db->quoteName('#__depot_manufacturer', 'm'))
|
||||
->join('LEFT', $db->quoteName('#__users', 'u'), $db->quoteName('u.id') . ' = ' . $db->quoteName('m.checked_out'));
|
||||
|
||||
// filter: like / search
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search)) {
|
||||
$like = $db->quote('%' . $search . '%');
|
||||
$query->where('(' . $db->quoteName('m.name_long') . ' LIKE ' . $like . ' OR ' .
|
||||
$db->quoteName('m.name_short') . ' LIKE ' . $like . ')');
|
||||
}
|
||||
|
||||
// Filter by published state
|
||||
$published = (string) $this->getState('filter.published');
|
||||
if (is_numeric($published)) {
|
||||
$published = (int) $published;
|
||||
$query->where($db->quoteName('m.state') . ' = :published')
|
||||
->bind(':published', $published, ParameterType::INTEGER);
|
||||
} elseif ($published === '') {
|
||||
$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;
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = Factory::getDate();
|
||||
$user = $this->getCurrentUser();
|
||||
|
||||
if (empty($table->id)) {
|
||||
// Set the values
|
||||
$table->created = $date->toSql();
|
||||
$table->created_by = $user->id;
|
||||
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering)) {
|
||||
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->createQuery()
|
||||
->select('MAX(' . $db->quoteName('ordering') . ')')
|
||||
->from($db->quoteName('#__depot_package'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = ++$max;
|
||||
}
|
||||
} else {
|
||||
// Set the values
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,142 +0,0 @@
|
||||
<?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;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
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',
|
||||
'ordering',
|
||||
'p.ordering',
|
||||
'checked_out',
|
||||
'p.checked_out',
|
||||
];
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an SQL query to load the list data.
|
||||
*
|
||||
* @return \Joomla\Database\DatabaseQuery
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->createQuery();
|
||||
|
||||
|
||||
// $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'),
|
||||
$db->quoteName('p.ordering'),
|
||||
$db->quoteName('p.checked_out'),
|
||||
$db->quoteName('p.checked_out_time'),
|
||||
$db->quoteName('p.modified'),
|
||||
$db->quoteName('p.modified_by'),
|
||||
$db->quoteName('p.mounting_style_id'),
|
||||
]
|
||||
)
|
||||
)
|
||||
->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)');
|
||||
}
|
||||
|
||||
// add list ordering clause
|
||||
$query->order(
|
||||
$db->quoteName($db->escape($this->getState('list.ordering', 'p.ordering'))) . ' ' .
|
||||
$db->escape($this->getState('list.direction', 'ASC'))
|
||||
);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the Table object, always creating it.
|
||||
*
|
||||
* @param string $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return Table A Table object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'Package', $prefix = 'Administrator', $config = [])
|
||||
{
|
||||
return parent::getTable($type, $prefix, $config);
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\Application\ApplicationHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Model\AdminModel;
|
||||
|
||||
@ -40,25 +39,4 @@ class PartModel extends AdminModel
|
||||
|
||||
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['component_name']);
|
||||
}
|
||||
$result = parent::save($data);
|
||||
// if ($result) {
|
||||
// $this->getTable('', 'Administrator')->rebuild(1);
|
||||
// }
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
<?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.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\MVC\Model\ListModel;
|
||||
use Joomla\Database\ParameterType;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
class PartsModel extends ListModel
|
||||
{
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$config['filter_fields'] = [
|
||||
'id',
|
||||
'd.id',
|
||||
'state',
|
||||
'd.state',
|
||||
'component_name',
|
||||
'd.component_name',
|
||||
'alias',
|
||||
'd.alias',
|
||||
'quantity',
|
||||
'd.quantity',
|
||||
'ordering',
|
||||
'd.ordering',
|
||||
'description',
|
||||
'd.description',
|
||||
'published',
|
||||
'd.published',
|
||||
'package',
|
||||
'manufacturer',
|
||||
'stock_name',
|
||||
];
|
||||
parent::__construct($config);
|
||||
}
|
||||
/**
|
||||
* Build an SQL query to load the list data.
|
||||
*
|
||||
* @return \Joomla\Database\DatabaseQuery
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->createQuery();
|
||||
|
||||
|
||||
// $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('d.id'),
|
||||
$db->quoteName('d.state'),
|
||||
$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'),
|
||||
$db->quoteName('d.package_id'),
|
||||
$db->quoteName('d.checked_out'),
|
||||
$db->quoteName('d.checked_out_time'),
|
||||
]
|
||||
)
|
||||
)
|
||||
->select(
|
||||
[
|
||||
$db->quoteName('u.name', 'creator'),
|
||||
$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'),
|
||||
$db->quoteName('v.name', 'owner'),
|
||||
]
|
||||
)
|
||||
->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('#__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'))
|
||||
->join('LEFT', $db->quoteName('#__users', 'v'), $db->quoteName('v.id') . ' = ' . $db->quoteName('s.owner_id'));
|
||||
// filter: like / search
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search)) {
|
||||
$like = $db->quote('%' . $search . '%');
|
||||
$query->where($db->quoteName('d.component_name') . ' LIKE ' . $like);
|
||||
}
|
||||
|
||||
// Filter by published state
|
||||
$published = (string) $this->getState('filter.published');
|
||||
if (is_numeric($published)) {
|
||||
$published = (int) $published;
|
||||
$query->where($db->quoteName('d.state') . ' = :published')
|
||||
->bind(':published', $published, ParameterType::INTEGER);
|
||||
} elseif ($published === '') {
|
||||
$query->whereIn($db->quoteName('d.state'), [0, 1]);
|
||||
}
|
||||
|
||||
// add list ordering clause
|
||||
$query->order(
|
||||
$db->quoteName($db->escape($this->getState('list.ordering', 'd.ordering'))) . ' ' .
|
||||
$db->escape($this->getState('list.direction', 'ASC'))
|
||||
);
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
<?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.2
|
||||
*/
|
||||
|
||||
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 StockModel extends AdminModel
|
||||
{
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
$form = $this->loadForm('com_depot.stock', 'stock', ['control' => 'jform', 'load_data' => $loadData]);
|
||||
|
||||
if (empty($form)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
protected function loadFormData()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$data = $app->getUserState('com_depot.edit.stock.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['owner_id'] . '-' . $data['name']);
|
||||
}
|
||||
$result = parent::save($data);
|
||||
// if ($result) {
|
||||
// $this->getTable('', 'Administrator')->rebuild(1);
|
||||
// }
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
<?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.3
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Model;
|
||||
|
||||
use Joomla\CMS\MVC\Model\ListModel;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\Database\ParameterType;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
class StocksModel extends ListModel
|
||||
{
|
||||
public function __construct($config = [])
|
||||
{
|
||||
$config['filter_fields'] = [
|
||||
'id',
|
||||
's.id',
|
||||
'name',
|
||||
's.name',
|
||||
'alias',
|
||||
's.alias',
|
||||
'state',
|
||||
's.state',
|
||||
'published',
|
||||
's.published',
|
||||
'description',
|
||||
's.description',
|
||||
'ordering',
|
||||
's.ordering',
|
||||
'checked_out',
|
||||
's.checked_out',
|
||||
'owner',
|
||||
];
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an SQL query to load the list data.
|
||||
*
|
||||
* @return \Joomla\Database\DatabaseQuery
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->createQuery();
|
||||
|
||||
|
||||
// $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('s.id'),
|
||||
$db->quoteName('s.name'),
|
||||
$db->quoteName('s.alias'),
|
||||
$db->quoteName('s.description'),
|
||||
$db->quoteName('s.state'),
|
||||
$db->quoteName('s.ordering'),
|
||||
$db->quoteName('s.checked_out'),
|
||||
$db->quoteName('s.checked_out_time'),
|
||||
]
|
||||
)
|
||||
)
|
||||
->select(
|
||||
[
|
||||
$db->quoteName('u.name', 'creator'),
|
||||
$db->quoteName('o.name', 'owner'),
|
||||
$db->quoteName('o.username', 'owner_username'),
|
||||
]
|
||||
)
|
||||
->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', 'o'), $db->quoteName('o.id') . ' = ' . $db->quoteName('s.owner_id'));
|
||||
// filter: like / search
|
||||
$search = $this->getState('filter.search');
|
||||
if (!empty($search)) {
|
||||
$like = $db->quote('%' . $search . '%');
|
||||
$query->where('(' . $db->quoteName('s.name') . ' LIKE ' . $like . ' OR ' .
|
||||
$db->quoteName('s.description') . ' LIKE ' . $like . ')');
|
||||
}
|
||||
|
||||
// Filter by published state
|
||||
$published = (string) $this->getState('filter.published');
|
||||
if (is_numeric($published)) {
|
||||
$published = (int) $published;
|
||||
$query->where($db->quoteName('s.state') . ' = :published')
|
||||
->bind(':published', $published, ParameterType::INTEGER);
|
||||
} elseif ($published === '') {
|
||||
$query->where($db->quoteName('s.state') . ' IN (0, 1)');
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
$query->order(
|
||||
$db->quoteName($db->escape($this->getState('list.ordering', 's.ordering'))) . ' ' .
|
||||
$db->escape($this->getState('list.direction', 'ASC'))
|
||||
);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the Table object, always creating it.
|
||||
*
|
||||
* @param string $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return Table A Table object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'Stock', $prefix = 'Administrator', $config = [])
|
||||
{
|
||||
return parent::getTable($type, $prefix, $config);
|
||||
}
|
||||
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
<?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.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Table;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\Database\DatabaseDriver;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
class ManufacturerTable extends Table
|
||||
{
|
||||
function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__depot_manufacturer', '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('Manufacturer', '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);
|
||||
}
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
<?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 check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
} catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set created date if not set.
|
||||
if (!(int) $this->created) {
|
||||
$this->created = Factory::getDate()->toSql();
|
||||
}
|
||||
|
||||
// Set ordering
|
||||
if ($this->state < 0) {
|
||||
// Set ordering to 0 if state is archived or trashed
|
||||
$this->ordering = 0;
|
||||
} elseif (empty($this->ordering)) {
|
||||
// Set ordering to last if ordering was 0
|
||||
$this->ordering = self::getNextOrder($this->_db->quoteName('state') . ' >= 0');
|
||||
}
|
||||
|
||||
// Set modified to created if not set
|
||||
if (!$this->modified) {
|
||||
$this->modified = $this->created;
|
||||
}
|
||||
// Set modified_by to created_by if not set
|
||||
if (empty($this->modified_by)) {
|
||||
$this->modified_by = $this->created_by;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
if (!empty($this->alias)) {
|
||||
// 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);
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Table;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\Database\DatabaseDriver;
|
||||
|
||||
@ -21,90 +20,5 @@ class PartTable extends Table
|
||||
function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__depot', 'id', $db);
|
||||
|
||||
// add an alias for published:
|
||||
$this->setColumnAlias('published', 'state');
|
||||
}
|
||||
|
||||
public function check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
} catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set created date if not set.
|
||||
if (!(int) $this->created) {
|
||||
$this->created = Factory::getDate()->toSql();
|
||||
}
|
||||
|
||||
// Set ordering
|
||||
if ($this->state < 0) {
|
||||
// Set ordering to 0 if state is archived or trashed
|
||||
$this->ordering = 0;
|
||||
} elseif (empty($this->ordering)) {
|
||||
// Set ordering to last if ordering was 0
|
||||
$this->ordering = self::getNextOrder($this->_db->quoteName('state') . ' >= 0');
|
||||
}
|
||||
|
||||
// Set modified to created if not set
|
||||
if (!$this->modified) {
|
||||
$this->modified = $this->created;
|
||||
}
|
||||
// Set modified_by to created_by if not set
|
||||
if (empty($this->modified_by)) {
|
||||
$this->modified_by = $this->created_by;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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('Part', '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);
|
||||
}
|
||||
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
<?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.2
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Table;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Table\Table;
|
||||
use Joomla\Database\DatabaseDriver;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
class StockTable extends Table
|
||||
{
|
||||
function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__depot_stock', 'id', $db);
|
||||
|
||||
// add an alias for published:
|
||||
$this->setColumnAlias('published', 'state');
|
||||
}
|
||||
|
||||
public function check()
|
||||
{
|
||||
try {
|
||||
parent::check();
|
||||
} catch (\Exception $e) {
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set created date if not set.
|
||||
if (!(int) $this->created) {
|
||||
$this->created = Factory::getDate()->toSql();
|
||||
}
|
||||
|
||||
// Set ordering
|
||||
if ($this->state < 0) {
|
||||
// Set ordering to 0 if state is archived or trashed
|
||||
$this->ordering = 0;
|
||||
} elseif (empty($this->ordering)) {
|
||||
// Set ordering to last if ordering was 0
|
||||
$this->ordering = self::getNextOrder($this->_db->quoteName('state') . ' >= 0');
|
||||
}
|
||||
|
||||
// Set modified to created if not set
|
||||
if (!$this->modified) {
|
||||
$this->modified = $this->created;
|
||||
}
|
||||
|
||||
// Set modified_by to created_by if not set
|
||||
if (empty($this->modified_by)) {
|
||||
$this->modified_by = $this->created_by;
|
||||
}
|
||||
}
|
||||
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('Stock', '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);
|
||||
}
|
||||
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
<?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.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Manufacturer;
|
||||
|
||||
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('Manufacturer: Add');
|
||||
|
||||
ToolbarHelper::apply('manufacturer.apply');
|
||||
ToolbarHelper::save('manufacturer.save');
|
||||
ToolbarHelper::cancel('manufacturer.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
<?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.3
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Manufacturers;
|
||||
|
||||
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');
|
||||
$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'));
|
||||
// add pagination
|
||||
$this->pagination = $this->get('Pagination');
|
||||
// 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_MANUFACTURERS'));
|
||||
ToolbarHelper::addNew('manufacturer.add');
|
||||
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'manufacturers.delete');
|
||||
ToolbarHelper::publish('manufacturers.publish', 'JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::unpublish('manufacturers.unpublish', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
<?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;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
/** @var PackagesModel $model */
|
||||
$model = $this->getModel();
|
||||
$this->items = $model->getItems();
|
||||
$this->pagination = $model->getPagination();
|
||||
$this->state = $model->getState();
|
||||
$this->filterForm = $model->getFilterForm();
|
||||
$this->activeFilters = $model->getActiveFilters();
|
||||
|
||||
if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
|
||||
$this->setLayout('emptystate');
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
@ -10,43 +10,14 @@
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Parts;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Get model
|
||||
$model = $this->getModel();
|
||||
$this->items = $model->getItems();
|
||||
$this->pagination = $model->getPagination();
|
||||
$this->state = $model->getState();
|
||||
$this->filterForm = $model->getFilterForm();
|
||||
$this->activeFilters = $model->getActiveFilters();
|
||||
|
||||
if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
|
||||
$this->setLayout('emptystate');
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolbar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar(): void
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_DEPOT_MANAGER_PARTS'));
|
||||
ToolbarHelper::addNew('part.add');
|
||||
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'parts.delete');
|
||||
ToolbarHelper::publish('parts.publish', 'JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::unpublish('parts.unpublish', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?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.2
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Stock;
|
||||
|
||||
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('Stock: Add');
|
||||
ToolbarHelper::apply('stock.apply');
|
||||
ToolbarHelper::save('stock.save');
|
||||
ToolbarHelper::cancel('stock.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
<?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.3
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Stocks;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
/**@var StocksModel $model */
|
||||
$model = $this->getModel();
|
||||
|
||||
$this->items = $model->getItems();
|
||||
$this->pagination = $model->getPagination();
|
||||
$this->state = $model->getState();
|
||||
$this->filterForm = $model->getFilterForm();
|
||||
$this->activeFilters = $model->getActiveFilters();
|
||||
|
||||
if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
|
||||
$this->setLayout('emptystate');
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolbar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar()
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_DEPOT_MANAGER_STOCKS'));
|
||||
ToolbarHelper::addNew('stock.add');
|
||||
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'stocks.delete');
|
||||
ToolbarHelper::publish('stocks.publish', 'JTOOLBAR_PUBLISH', true);
|
||||
ToolbarHelper::unpublish('stocks.unpublish', 'JTOOLBAR_UNPUBLISH', true);
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.3
|
||||
*/
|
||||
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=manufactuerer&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_MANUFACTURER') :
|
||||
Text::_('COM_DEPOT_TAB_EDIT_MANUFACTURER')
|
||||
); ?>
|
||||
<fieldset id="fieldset-details" class="options-form">
|
||||
<legend>
|
||||
<?= Text::_('COM_DEPOT_LEGEND_MANUFACTURER_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="manufacturer.edit" />
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
@ -1,93 +0,0 @@
|
||||
<?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.3
|
||||
*/
|
||||
|
||||
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=manufacturers'); ?>" 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>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'JGRID_HEADING_ID',
|
||||
'm.id',
|
||||
$this->listDirn,
|
||||
$this->listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_MANUFACTURER_ACRONYM',
|
||||
'm.name_short',
|
||||
$this->listDirn,
|
||||
$this->listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_MANUFACTURER',
|
||||
'm.name_long',
|
||||
$this->listDirn,
|
||||
$this->listOrder
|
||||
); ?>
|
||||
</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=manufacturer.edit&id=' .
|
||||
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
|
||||
<?= $this->escape($item->name_short); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape($item->name_long); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this->pagination->getListFooter(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
@ -1,62 +0,0 @@
|
||||
<?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>
|
@ -1,164 +0,0 @@
|
||||
<?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\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('table.columns')
|
||||
->useScript('multiselect');
|
||||
|
||||
$user = $this->getCurrentUser();
|
||||
$userID = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$saveOrder = $listOrder == 'p.ordering';
|
||||
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = 'index.php?option=com_depot&task=packages.saveOrderAjax&tmpl=component';
|
||||
HTMLHelper::_('draggablelist.draggable');
|
||||
}
|
||||
?>
|
||||
<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" id="packageList">
|
||||
<caption class="visually-hidden">
|
||||
<?= Text::_('COM_DEPOT_PACKAGES_TABLE_CAPTION'); ?>,
|
||||
<span id="orderedBy">
|
||||
<?= Text::_('JGLOBAL_SORTED_BY'); ?>
|
||||
</span>,
|
||||
<span id="filteredBy">
|
||||
<?= Text::_('JGLOBAL_FILTERED_BY'); ?>
|
||||
</span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="w-1 text-center">
|
||||
<?= HTMLHelper::_('grid.checkall'); ?>
|
||||
</td>
|
||||
<th scope="col" class="w-1 text-center">
|
||||
<?= HTMLHelper::_('searchtools.sort', '', 'p.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-1 text-center">
|
||||
<?= HTMLHelper::_('searchtools.sort', 'JSTATUS', 'p.state', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_PACKAGE_NAME',
|
||||
'p.name',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_DESCRIPTION',
|
||||
'p.description',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_MOUNTING_STYLE',
|
||||
'p.mounting_style',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'JGRID_HEADING_ID',
|
||||
'p.id',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody <?php if ($saveOrder):
|
||||
?> class="js-draggable" data-url="<?= $saveOrderingUrl; ?>"
|
||||
data-direction="<?= strtolower($listDirn); ?>" data-nested="true" <?php
|
||||
endif; ?>>
|
||||
<?php foreach ($this->items as $i => $item):
|
||||
$ordering = ($listOrder == 'ordering');
|
||||
$canChange = true;
|
||||
?>
|
||||
<tr class="row<?= $i % 2; ?>" data-draggable-group="0" item-id="<?= $item->id; ?>">
|
||||
<th>
|
||||
<?= HTMLHelper::_('grid.id', $i, $item->id); ?>
|
||||
</th>
|
||||
<td class="text-center d-none d-md-table-cell">
|
||||
<?php
|
||||
$iconClass = '';
|
||||
|
||||
if (!$canChange) {
|
||||
$iconClass = ' inactive';
|
||||
} elseif (!$saveOrder) {
|
||||
$iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
|
||||
}
|
||||
?>
|
||||
<span class="sortable-handler <?= $iconClass ?>">
|
||||
<span class="icon-ellipsis-v" aria-hidden="true"></span>
|
||||
</span>
|
||||
<?php if ($saveOrder): ?>
|
||||
<input type="text" name="order[]" size="5" value="<?= $item->ordering; ?>"
|
||||
class="width-20 text-area-order hidden">
|
||||
<?php endif; ?>
|
||||
<div class="small">
|
||||
<?= $item->ordering; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?= HTMLHelper::_('jgrid.published', $item->state, $i, 'packages.', $canChange); ?>
|
||||
</td>
|
||||
<th>
|
||||
<a href="<?= Route::_('index.php?option=com_depot&task=package.edit&id=' .
|
||||
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
|
||||
<?= $this->escape($item->name); ?>
|
||||
</a>
|
||||
</th>
|
||||
<td>
|
||||
<?= $this->escape($item->description); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape($item->mounting_style); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $item->id ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this->pagination->getListFooter(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
@ -5,10 +5,9 @@
|
||||
* @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.2
|
||||
* @since 0.0.3
|
||||
*/
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
@ -19,40 +18,9 @@ $wa->useScript('form.validate')
|
||||
?>
|
||||
<form action="<?= Route::_('index.php?option=com_depot&view=part&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_PART') :
|
||||
Text::_('COM_DEPOT_TAB_EDIT_PART')
|
||||
); ?>
|
||||
<fieldset id="fieldset-details" class="options-form">
|
||||
<legend>
|
||||
<?= Text::_('COM_DEPOT_LEGEND_PART_DETAILS') ?>
|
||||
</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-9">
|
||||
<?= $this->form->renderFieldset('details'); ?>
|
||||
</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'); ?>
|
||||
<?= $this->form->renderField('component_name'); ?>
|
||||
<?= $this->form->renderField('id'); ?>
|
||||
|
||||
<input type="hidden" name="task" value="part.edit" />
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
|
@ -7,209 +7,7 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.1
|
||||
*/
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('table.columns')
|
||||
->useScript('multiselect');
|
||||
|
||||
$canChange = true;
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$saveOrder = $listOrder == 'd.ordering';
|
||||
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = 'index.php?option=com_depot&task=parts.saveOrderAjax&tmpl=component';
|
||||
HTMLHelper::_('draggablelist.draggable');
|
||||
}
|
||||
?>
|
||||
<form action="<?= Route::_('index.php?option=com_depot&view=parts'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<h2>Welcome to my Depot Component!</h2>
|
||||
|
||||
<?= 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" id="partList">
|
||||
<caption class="visually-hidden">
|
||||
<?= Text::_('COM_DEPOT_PARTS_TABLE_CAPTION'); ?>,
|
||||
<span id="orderedBy">
|
||||
<?= Text::_('JGLOBAL_SORTED_BY'); ?>
|
||||
</span>,
|
||||
<span id="filteredBy">
|
||||
<?= Text::_('JGLOBAL_FILTERED_BY'); ?>
|
||||
</span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="w-1 text-center">
|
||||
<?= HTMLHelper::_('grid.checkall'); ?>
|
||||
</td>
|
||||
<th scope="col" class="w-1 text-center">
|
||||
<?= HTMLHelper::_('searchtools.sort', '', 'd.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-1 text-center">
|
||||
<?= HTMLHelper::_('searchtools.sort', 'JSTATUS', 'd.state', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_NAME',
|
||||
'd.component_name',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_QUANTITY',
|
||||
'd.quantity',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= Text::_('COM_DEPOT_TABLE_HEAD_QUANTITY_EXP') ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_DESCRIPTION',
|
||||
'd.description',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_MANUFACTURER',
|
||||
'manufacturer',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_STOCK',
|
||||
'stock_name',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-1 text-center">
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'JGRID_HEADING_ID',
|
||||
'd.id',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody <?php if ($saveOrder): ?> class="js-draggable" data-url="<?= $saveOrderingUrl; ?>"
|
||||
data-direction="<?= strtolower($listDirn); ?>" data-nested="true" <?php endif; ?>>
|
||||
<?php foreach ($this->items as $i => $item):
|
||||
$ordering = ($listOrder == 'ordering');
|
||||
$canChange = true;
|
||||
?>
|
||||
<tr class="row<?= $i % 2; ?>" data-draggable-group="0" item-id="<?= $item->id; ?>">
|
||||
<th>
|
||||
<?= HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->component_name); ?>
|
||||
</th>
|
||||
<td class="text-center d-none d-md-table-cell">
|
||||
<?php
|
||||
$iconClass = '';
|
||||
|
||||
if (!$canChange) {
|
||||
$iconClass = ' inactive';
|
||||
} elseif (!$saveOrder) {
|
||||
$iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
|
||||
}
|
||||
?>
|
||||
<span class="sortable-handler <?= $iconClass ?>">
|
||||
<span class="icon-ellipsis-v" aria-hidden="true"></span>
|
||||
</span>
|
||||
<?php if ($saveOrder): ?>
|
||||
<input type="text" name="order[]" size="5" value="<?= $item->ordering; ?>"
|
||||
class="width-20 text-area-order hidden">
|
||||
<?php endif; ?>
|
||||
<div class="small">
|
||||
<?= $item->ordering; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<?= HTMLHelper::_('jgrid.published', $item->state, $i, 'parts.', $canChange); ?>
|
||||
</td>
|
||||
<th>
|
||||
<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>
|
||||
</th>
|
||||
<td>
|
||||
<?= $this->escape($item->quantity); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= "10^" . $item->quantity_exp; ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="break-word">
|
||||
<?= $this->escape($item->description); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= Route::_('index.php?option=com_depot&task=manufacturer.edit&id=' .
|
||||
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
|
||||
<?= $this->escape($item->manufacturer); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="break-word" href="<?= Route::_('index.php?option=com_depot&task=stock.edit&id=' .
|
||||
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
|
||||
<?= $this->escape($item->stock_name); ?>
|
||||
</a>
|
||||
<div class="small">
|
||||
<?= $this->escape($item->owner); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?= $item->id ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this->pagination->getListFooter(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
<p>Link: <a href="index.php?option=com_depot&view=part&layout=edit&id=1">Part</a></p>
|
@ -1,64 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.3
|
||||
*/
|
||||
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=stock&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_STOCK') :
|
||||
Text::_('COM_DEPOT_TAB_EDIT_STOCK')
|
||||
); ?>
|
||||
<fieldset id="fieldset-details" class="options-form">
|
||||
<legend>
|
||||
<?= Text::_('COM_DEPOT_LEGEND_STOCK_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="stock.edit" />
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
@ -1,151 +0,0 @@
|
||||
<?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.3
|
||||
*/
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('table.columns')
|
||||
->useScript('multiselect');
|
||||
|
||||
$user = $this->getCurrentUser();
|
||||
$userID = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$saveOrder = $listOrder == 's.ordering';
|
||||
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = 'index.php?option=com_depot&task=stocks.saveOrderAjax&tmpl=component';
|
||||
HTMLHelper::_('draggablelist.draggable');
|
||||
}
|
||||
?>
|
||||
<form action="<?= Route::_('index.php?option=com_depot&view=stocks'); ?>" 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" id="stockList">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<?= HTMLHelper::_('grid.checkall'); ?>
|
||||
</td>
|
||||
<th scope="col" class="w-1 text-center">
|
||||
<?= HTMLHelper::_('searchtools.sort', '', 's.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_STOCK',
|
||||
's.name',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_DESCRIPTION',
|
||||
's.description',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'COM_DEPOT_TABLE_HEAD_OWNER',
|
||||
'owner',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?= HTMLHelper::_(
|
||||
'searchtools.sort',
|
||||
'JGRID_HEADING_ID',
|
||||
's.id',
|
||||
$listDirn,
|
||||
$listOrder
|
||||
); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody <?php if ($saveOrder): ?> class="js-draggable" data-url="<?= $saveOrderingUrl; ?>"
|
||||
data-direction="<?= strtolower($listDirn); ?>" data-nested="true" <?php endif; ?> <?php foreach ($this->items as $i => $item):
|
||||
$ordering = ($listOrder == 'ordering');
|
||||
$canChange = true;
|
||||
?> <tr
|
||||
class="row<?= $i % 2; ?>" data-draggable-group="0" item-id="<?= $item->id; ?>">
|
||||
<th>
|
||||
<?= HTMLHelper::_('grid.id', $i, $item->id); ?>
|
||||
</th>
|
||||
<td class="text-center d-none d-md-table-cell">
|
||||
<?php
|
||||
$iconClass = '';
|
||||
|
||||
if (!$canChange) {
|
||||
$iconClass = ' inactive';
|
||||
} elseif (!$saveOrder) {
|
||||
$iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
|
||||
}
|
||||
?>
|
||||
<span class="sortable-handler <?= $iconClass ?>">
|
||||
<span class="icon-ellipsis-v" aria-hidden="true"></span>
|
||||
</span>
|
||||
<?php if ($saveOrder): ?>
|
||||
<input type="text" name="order[]" size="5" value="<?= $item->ordering; ?>"
|
||||
class="width-20 text-area-order hidden">
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<th>
|
||||
<a href="<?= Route::_('index.php?option=com_depot&task=stock.edit&id=' .
|
||||
(int) $item->id) ?>" title="<?= Text::_('JACTION_EDIT') ?>">
|
||||
<?= $this->escape($item->name); ?>
|
||||
</a>
|
||||
</th>
|
||||
<td>
|
||||
<?= $this->escape($item->description); ?>
|
||||
</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>
|
||||
<td>
|
||||
<?= $item->id ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this->pagination->getListFooter(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="boxchecked" value="0">
|
||||
<?= HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
37
depot.xml
37
depot.xml
@ -2,16 +2,14 @@
|
||||
<extension type="component" method="upgrade">
|
||||
<name>Depot</name>
|
||||
<author>KW4NZ</author>
|
||||
<creationDate>2024-08-31</creationDate>
|
||||
<creationDate>2023-10-06</creationDate>
|
||||
<copyright>(C) KW4NZ Thomas Kuschel</copyright>
|
||||
<license>GPL v2 +; see LICENSE.md</license>
|
||||
<authorEmail>thomas@kuschel.at</authorEmail>
|
||||
<authorUrl>https://kuschel.at</authorUrl>
|
||||
<version>0.9.23</version>
|
||||
<version>0.0.4</version>
|
||||
<description>COM_DEPOT_XML_DESCRIPTION</description>
|
||||
<namespace path="src/">KW4NZ\Component\Depot</namespace>
|
||||
<!-- Runs on install/uninstall/update since 2.5 -->
|
||||
<scriptfile>script.php</scriptfile>
|
||||
<install> <!-- Runs on install -->
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
|
||||
@ -27,17 +25,10 @@
|
||||
<schemapath type="mysql">sql/updates/mysql</schemapath>
|
||||
</schemas>
|
||||
</update>
|
||||
<files folder="site">
|
||||
<folder>src</folder>
|
||||
<folder>tmpl</folder>
|
||||
<!--
|
||||
<files folder="site/">
|
||||
<file>CODING_STANDARDS.md</file>
|
||||
<file>LICENSE.md</file>
|
||||
<file>README.md</file>
|
||||
|
||||
<folder>forms</folder>
|
||||
<folder>language</folder>
|
||||
-->
|
||||
</files>
|
||||
<administration>
|
||||
<!--
|
||||
@ -46,18 +37,22 @@
|
||||
-->
|
||||
<menu img="class:barcode">COM_DEPOT_MENU</menu>
|
||||
<submenu>
|
||||
<menu link="option=com_depot" view="parts" img="class:depot" alt="Depot/Parts">
|
||||
<menu
|
||||
link="option=com_depot"
|
||||
view="parts"
|
||||
img="class:depot"
|
||||
alt="Depot/Parts"
|
||||
>
|
||||
COM_DEPOT_MENU
|
||||
</menu>
|
||||
<menu link="option=com_depot&view=stocks" view="stocks" img="class:depot-stock" alt="Depot/Stocks">
|
||||
<menu
|
||||
link="option=com_depot"
|
||||
view="stocks"
|
||||
img="class:depot-stocks"
|
||||
alt="Depot/Stocks"
|
||||
>
|
||||
COM_DEPOT_MENU_STOCKS
|
||||
</menu>
|
||||
<menu link="option=com_depot&view=manufacturers" view="manufacturers" img="class:depot-manufacturer" alt="Depot/Manufacturers">
|
||||
COM_DEPOT_MENU_MANUFACTURERS
|
||||
</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>
|
||||
@ -69,8 +64,6 @@
|
||||
<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>
|
||||
|
76
script.php
76
script.php
@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Installation.Script
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2024 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.9.21
|
||||
*/
|
||||
\defined('_JEXEC') or die;
|
||||
/**
|
||||
* Script file of Depot component.
|
||||
*
|
||||
* The name of this class is dependent on the component being installed.
|
||||
* The class name should have the component's name, directly followed by
|
||||
* the text InstallerScript (ex:. com_depotInstallerScript).
|
||||
*
|
||||
* This class will be called by Joomla's installer, if specified in your component's
|
||||
* manifest file, and is used for custom automation actions in its installation process.
|
||||
*
|
||||
* In order to use this automation script, you should reference it in your component's
|
||||
* mainfest file as follows:
|
||||
* <scriptfile>script.php</scriptfile>
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Installer\InstallerAdapter;
|
||||
use Joomla\CMS\Installer\InstallerScriptInterface;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
return new class() implements InstallerScriptInterface {
|
||||
private string $minimumJoomla = '4.4.8'; // '5.1.4'
|
||||
private string $minimumPhp = '8.1.29';
|
||||
|
||||
public function install(InstallerAdapter $adapter): bool
|
||||
{
|
||||
echo "component install<br>";
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update(InstallerAdapter $adapter): bool
|
||||
{
|
||||
|
||||
echo "component update<br>";
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall(InstallerAdapter $adapter): bool
|
||||
{
|
||||
echo "component uninstall<br>";
|
||||
return true;
|
||||
}
|
||||
|
||||
public function preflight(string $type, InstallerAdapter $adapter): bool
|
||||
{
|
||||
echo "component preflight<br>";
|
||||
|
||||
if (version_compare(PHP_VERSION, $this->minimumPhp, '<')) {
|
||||
Factory::getApplication()->enqueueMessage(sprintf(Text::_('JLIB_INSTALLER_MINIMUM_PHP'), $this->minimumPhp), 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (version_compare(JVERSION, $this->minimumJoomla, '<')) {
|
||||
Factory::getApplication()->enqueueMessage(sprintf(Text::_('JLIB_INSTALLER_MINIMUM_JOOMLA'), $this->minimumJoomla), 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postflight(string $type, InstallerAdapter $adapter): bool
|
||||
{
|
||||
echo "component postflight<br>";
|
||||
return true;
|
||||
}
|
||||
};
|
@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Joomla installation at:
|
||||
JOOMLADIR="/srv/http/joomla5"
|
||||
|
||||
# this is a script file to generate a zip package from this source:
|
||||
cd "$(dirname "$0")"
|
||||
cd ..
|
||||
# now we are at the depot directory
|
||||
# if there is a file named depot.xml, we ask to increase the version with
|
||||
|
||||
read -p "Do you want to update/increase the patch (last) version number? (y/N)" -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[YyJj]$ ]]
|
||||
then
|
||||
echo "Updating the version"
|
||||
# patch=`xmllint -xpath 'string(//*[local-name()="version"])' depot.xml | rev | cut -f1 -d. | rev`
|
||||
# echo "$patch"
|
||||
# patch=$((patch+1))
|
||||
# echo "$patch"
|
||||
version=`xmllint -xpath 'string(//*[local-name()="version"])' depot.xml`
|
||||
major=`echo "$version" | cut -f1 -d.`
|
||||
minor=`echo "$version" | cut -f2 -d.`
|
||||
patch=`echo "$version" | cut -f3 -d.`
|
||||
echo "$version"
|
||||
patch=$((patch+1))
|
||||
minor=$((minor))
|
||||
newversion="$major.$minor.$patch"
|
||||
echo "$newversion"
|
||||
printf -v date '%(%Y-%m-%d)T\n' -1
|
||||
xmllint --shell depot.xml << EOF
|
||||
cd extension/version
|
||||
set $newversion
|
||||
cd /extension/creationDate
|
||||
set $date
|
||||
save
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "Keep the version"
|
||||
fi
|
||||
mkdir -p zip
|
||||
# Generate ZIP file without directories zip, script
|
||||
zip -q -r zip/depot.zip * -x .git/\* -x script/\* -x zip/\*
|
||||
|
||||
# Install this extension to the active Joomla installation per CLI
|
||||
|
||||
read -p "Do you want to install this to the Joomla installation at \"$JOOMLADIR\"? (Y/n)" -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Nn]$ ]]
|
||||
then
|
||||
echo "Extension was not installed"
|
||||
else
|
||||
# Find the CLI php procedure, file joomla.php in cli must exists.
|
||||
FILE="${JOOMLADIR}/cli/joomla.php"
|
||||
if [ -f "$FILE" ]
|
||||
then
|
||||
echo "$FILE exists."
|
||||
php $FILE --version
|
||||
php $FILE --help
|
||||
php $FILE list
|
||||
# sudo -g http php $FILE core:update:check
|
||||
php $FILE core:update:check
|
||||
pwd
|
||||
# sudo -u http php $FILE extension:install --path zip/depot.zip -v
|
||||
php $FILE extension:install --path zip/depot.zip -v
|
||||
php $FILE extension:list --type component
|
||||
else
|
||||
echo "$FILE does not exists."
|
||||
exit 9
|
||||
fi
|
||||
fi
|
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Site
|
||||
* @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.14
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Site\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
|
||||
class DisplayController extends BaseController
|
||||
{
|
||||
protected $default_view = 'part';
|
||||
|
||||
public function display($cacheable = false, $urlparams = [])
|
||||
{
|
||||
return parent::display($cacheable, $urlparams);
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Site
|
||||
* @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.14
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Site\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Model\ItemModel;
|
||||
|
||||
class PartModel extends ItemModel
|
||||
{
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
if ($pk == null) {
|
||||
$pk = Factory::getApplication()->input->getInt('id');
|
||||
}
|
||||
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->createQuery()
|
||||
->select('*')
|
||||
->from($db->quoteName('#__depot', 'd'))
|
||||
->where([
|
||||
$db->quoteName('d.id') . ' = ' . $db->quote($pk),
|
||||
$db->quoteName('d.state') . ' = 1',
|
||||
]);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$item = $db->loadObject();
|
||||
|
||||
return $item;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Site
|
||||
* @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.14
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Site\View\Part;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
protected $item;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->item = $this->get('Item');
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Site
|
||||
* @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.14
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
<h1>
|
||||
<?= $this->item->component_name; ?>
|
||||
</h1>
|
BIN
zip/depot.zip
(Stored with Git LFS)
BIN
zip/depot.zip
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in New Issue
Block a user