B1 first commit, example
This commit is contained in:
8
admin/language/en-GB/com_depot.ini
Normal file
8
admin/language/en-GB/com_depot.ini
Normal file
@ -0,0 +1,8 @@
|
||||
; @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_XML_DESCRIPTION="Depot, the component warehouse"
|
11
admin/language/en-GB/com_depot.sys.ini
Normal file
11
admin/language/en-GB/com_depot.sys.ini
Normal file
@ -0,0 +1,11 @@
|
||||
; @package Depot.Language
|
||||
; @subpackage com_depot
|
||||
; @author Thomas Kuschel <thomas@kuschel.at>
|
||||
; @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
; @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
; @since 0.0.1
|
||||
;
|
||||
COM_DEPOT_MENU="Depot"
|
||||
COM_DEPOT_MENU_MANUFACTURERS="Manufacturers"
|
||||
COM_DEPOT_MENU_STOCKS="Stock locations"
|
||||
COM_DEPOT_XML_DESCRIPTION="Depot, the component warehouse"
|
39
admin/services/provider.php
Normal file
39
admin/services/provider.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.1
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
|
||||
use Joomla\CMS\Extension\ComponentInterface;
|
||||
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
|
||||
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use KW4NZ\Component\Depot\Administrator\Extension\DepotComponent;
|
||||
use Joomla\CMS\Extension\MVCComponent;
|
||||
|
||||
return new class implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->registerServiceProvider(new ComponentDispatcherFactory('\\KW4NZ\\Component\\Depot'));
|
||||
$container->registerServiceProvider(new MVCFactory('\\KW4NZ\\Component\\Depot'));
|
||||
|
||||
$container->set(
|
||||
ComponentInterface::class,
|
||||
function (Container $container)
|
||||
{
|
||||
$component = new DepotComponent($container->get(ComponentDispatcherFactoryInterface::class));
|
||||
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
|
||||
|
||||
return $component;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
49
admin/sql/install.mysql.utf8.sql
Normal file
49
admin/sql/install.mysql.utf8.sql
Normal file
@ -0,0 +1,49 @@
|
||||
-- @package Depot.SQL MariaDB
|
||||
-- @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
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot`;
|
||||
CREATE TABLE `#__depot`(
|
||||
`id` SERIAL,
|
||||
`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 '',
|
||||
`description` VARCHAR(4000) NOT NULL DEFAULT '',
|
||||
`quantity` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
`quantity_exp` INT(11) NOT NULL DEFAULT 0 COMMENT 'Exponent of the quantity (10^x of the number, usually 0 i.e. 10⁰)',
|
||||
`asset_id` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
|
||||
`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,
|
||||
`path` VARCHAR(400) NOT NULL DEFAULT '',
|
||||
`state` TINYINT(4) NOT NULL DEFAULT 0 COMMENT 'Published=1,Unpublished=0,Archived=2,Trashed=-2',
|
||||
`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,
|
||||
`stock_id` INT(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_state` (`state`),
|
||||
KEY `idx_stock_id` (`stock_id`),
|
||||
KEY `idx_manufacturer` (`manufacturer_id`),
|
||||
UNIQUE KEY `aliasindex` (`alias`,`manufacturer_id`,`stock_id`)
|
||||
) ENGINE=InnoDB
|
||||
AUTO_INCREMENT=0
|
||||
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO `#__depot` (`component_name`,`alias`,`description`,`quantity`,`created`,
|
||||
`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);
|
8
admin/sql/uninstall.mysql.utf8.sql
Normal file
8
admin/sql/uninstall.mysql.utf8.sql
Normal file
@ -0,0 +1,8 @@
|
||||
-- @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
|
||||
|
||||
DROP TABLE IF EXISTS `#__depot`;
|
20
admin/src/Controller/DisplayController.php
Normal file
20
admin/src/Controller/DisplayController.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
|
||||
class DisplayController extends BaseController
|
||||
{
|
||||
protected $default_view = 'parts';
|
||||
}
|
18
admin/src/Extension/DepotComponent.php
Normal file
18
admin/src/Extension/DepotComponent.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\Extension;
|
||||
|
||||
use Joomla\CMS\Extension\MVCComponent;
|
||||
|
||||
class DepotComponent extends MVCComponent
|
||||
{
|
||||
|
||||
}
|
23
admin/src/View/Parts/HtmlView.php
Normal file
23
admin/src/View/Parts/HtmlView.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.1
|
||||
*/
|
||||
|
||||
namespace KW4NZ\Component\Depot\Administrator\View\Parts;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
11
admin/tmpl/parts/default.php
Normal file
11
admin/tmpl/parts/default.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Depot.Administrator
|
||||
* @subpackage com_depot
|
||||
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||
* @since 0.0.1
|
||||
*/
|
||||
?>
|
||||
<h2>Welcome to my Depot Component!</h2>
|
Reference in New Issue
Block a user