This commit is contained in:
Dennis Eichhorn 2015-11-29 21:57:18 +01:00
commit 9b0d1252c6
10 changed files with 691 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\SupplierManagement\Admin\Install;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Navigation
{
public static function install($dbPool)
{
$navData = json_decode(file_get_contents(__DIR__ . '/nav.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer';
$class::installExternal($dbPool, $navData);
}
}

View File

@ -0,0 +1,109 @@
[
{
"id": 1003202001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Suppliers",
"uri": "/{/lang}/backend/purchase/supplier/list",
"target": "self",
"icon": null,
"order": 1,
"from": 1003200000,
"permission": null,
"parent": 1002101001,
"children": [
{
"id": 1003202101,
"pid": "520f00a1a583e4936dc01665781e0dfafd699613",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/purchase/supplier/list",
"target": "self",
"icon": null,
"order": 1,
"from": 1003200000,
"permission": null,
"parent": 1003202001,
"children": [
{
"id": 1003203101,
"pid": "8cb9bb8ac30a3372db74b90f4c847bdb48da45ce",
"type": 3,
"subtype": 1,
"name": "Profile",
"uri": "/{/lang}/backend/purchase/supplier/profile",
"target": "self",
"icon": null,
"order": 1,
"from": 1003200000,
"permission": null,
"parent": 1003202101,
"children": []
},
{
"id": 1003203201,
"pid": "8cb9bb8ac30a3372db74b90f4c847bdb48da45ce",
"type": 3,
"subtype": 1,
"name": "Invoices",
"uri": "/{/lang}/backend/purchase/supplier/invoice/list",
"target": "self",
"icon": null,
"order": 1,
"from": 1003200000,
"permission": null,
"parent": 1003202101,
"children": []
},
{
"id": 1003203301,
"pid": "8cb9bb8ac30a3372db74b90f4c847bdb48da45ce",
"type": 3,
"subtype": 1,
"name": "Articles",
"uri": "/{/lang}/backend/purchase/supplier/article/list",
"target": "self",
"icon": null,
"order": 1,
"from": 1003200000,
"permission": null,
"parent": 1003202101,
"children": []
},
{
"id": 1003203401,
"pid": "8cb9bb8ac30a3372db74b90f4c847bdb48da45ce",
"type": 3,
"subtype": 1,
"name": "Analysis",
"uri": "/{/lang}/backend/purchase/supplier/analysis",
"target": "self",
"icon": null,
"order": 1,
"from": 1003200000,
"permission": null,
"parent": 1003202101,
"children": []
}
]
},
{
"id": 1003202201,
"pid": "520f00a1a583e4936dc01665781e0dfafd699613",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "/{/lang}/backend/purchase/supplier/create",
"target": "self",
"icon": null,
"order": 5,
"from": 1003200000,
"permission": null,
"parent": 1003202001,
"children": []
}
]
}
]

49
Admin/Installer.php Normal file
View File

@ -0,0 +1,49 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\SupplierManagement\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\Pool;
use phpOMS\Module\InstallerAbstract;
/**
* Purchase install class.
*
* @category Modules
* @package Modules\Purchase
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Installer extends InstallerAbstract
{
/**
* {@inheritdoc}
*/
public static function install(Pool $dbPool, array $info)
{
parent::install($dbPool, $info);
switch ($dbPool->get('core')->getType()) {
case DatabaseType::MYSQL:
break;
}
}
}

170
Controller.php Normal file
View File

@ -0,0 +1,170 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\SupplierManagement;
use Modules\Navigation\Models\Navigation;
use Modules\Navigation\Views\NavigationView;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\RequestDestination;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
use phpOMS\Views\View;
use phpOMS\Views\ViewLayout;
/**
* SupplierManagement controller class.
*
* @category Modules
* @package Modules\SupplierManagement
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module name.
*
* @var \string
* @since 1.0.0
*/
protected static $module = 'SupplierManagement';
/**
* Localization files.
*
* @var \string
* @since 1.0.0
*/
protected static $localization = [
RequestDestination::BACKEND => ['backend'],
];
/**
* Providing.
*
* @var \string
* @since 1.0.0
*/
protected static $providing = [
'Content',
];
/**
* Dependencies.
*
* @var \string
* @since 1.0.0
*/
protected static $dependencies = [];
/**
* Routing elements.
*
* @var array
* @since 1.0.0
*/
protected static $routes = [
'^.*/backend/purchase/supplier/list.*$' => [['dest' => '\Modules\SupplierManagement\Controller:viewSupplierManagementSupplierList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/purchase/supplier/create.*$' => [['dest' => '\Modules\SupplierManagement\Controller:viewSupplierManagementSupplierCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/purchase/supplier/profile.*$' => [['dest' => '\Modules\SupplierManagement\Controller:viewSupplierManagementSupplierProfile', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/purchase/supplier/analysis.*$' => [['dest' => '\Modules\SupplierManagement\Controller:viewSupplierManagementSupplierAnalysis', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
];
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewSupplierManagementSupplierList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/SupplierManagement/Theme/backend/supplier-list');
$view->addData('nav', $this->createNavigation(1003202001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewSupplierManagementSupplierCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/SupplierManagement/Theme/backend/supplier-create');
$view->addData('nav', $this->createNavigation(1003202001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewSupplierManagementSupplierProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/SupplierManagement/Theme/backend/supplier-profile');
$view->addData('nav', $this->createNavigation(1003202001, $request, $response));
return $view;
}
/**
* @param int $pageId Page/parent Id for navigation
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
*
* @return RenderableInterface
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
private function createNavigation(\int $pageId, RequestAbstract $request, ResponseAbstract $response)
{
$nav = Navigation::getInstance($request, $this->app->dbPool);
$navView = new NavigationView($this->app, $request, $response);
$navView->setTemplate('/Modules/Navigation/Theme/backend/mid');
$navView->setNav($nav->getNav());
$navView->setLanguage($request->getL11n()->language);
$navView->setParent($pageId);
return $navView;
}
}

View File

@ -0,0 +1,163 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
<div class="tabular-2">
<section class="box">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->l11n->lang['SupplierManagement']['Master'] ?></label></li>
<li><label for="c-tab-2"><?= $this->l11n->lang['SupplierManagement']['Contact'] ?></label></li>
<li><label for="c-tab-3"><?= $this->l11n->lang['SupplierManagement']['Addresses'] ?></label></li>
<li><label for="c-tab-4"><?= $this->l11n->lang['SupplierManagement']['PaymentTerm'] ?></label></li>
<li><label for="c-tab-5"><?= $this->l11n->lang['SupplierManagement']['Payment'] ?></label></li>
<li><label for="c-tab-6"><?= $this->l11n->lang['SupplierManagement']['Files'] ?></label></li>
</ul>
</section>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2" checked>
<div class="tab">
<section class="box w-33 floatLeft">
<h1><?= $this->l11n->lang['SupplierManagement']['Supplier'] ?></h1>
<div class="inner">
<form>
<table class="layout w-100">
<tr><td><label for="iId"><?= $this->l11n->lang[0]['ID']; ?></label>
<tr><td><span class="input"><button><i class="fa fa-book"></i></button><input type="number" id="iId" min="1" name="id" required></span>
<tr><td><label for="iName1"><?= $this->l11n->lang['SupplierManagement']['Name1']; ?></label>
<tr><td><input type="text" id="iName1" name="name1" placeholder="&#xf040;" required>
<tr><td><label for="iName2"><?= $this->l11n->lang['SupplierManagement']['Name2']; ?></label>
<tr><td><input type="text" id="iName2" name="name2" placeholder="&#xf040;">
<tr><td><label for="iName3"><?= $this->l11n->lang['SupplierManagement']['Name3']; ?></label>
<tr><td><input type="text" id="iName3" name="name3" placeholder="&#xf040;">
<tr><td colspan="2"><input type="submit" value="<?= $this->l11n->lang[0]['Create'] ?>">
</table>
</form>
</div>
</section>
</div>
<input type="radio" id="c-tab-2" name="tabular-2">
<div class="tab">
<section class="box w-33 floatLeft">
<h1><?= $this->l11n->lang['SupplierManagement']['Contact'] ?></h1>
<div class="inner">
<form>
<table class="layout w-100">
<tr><td><label for="iCType"><?= $this->l11n->lang['SupplierManagement']['Type']; ?></label>
<tr><td><select id="iCType" name="actype">
<option><?= $this->l11n->lang['SupplierManagement']['Email']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Fax']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Phone']; ?>
</select>
<tr><td><label for="iCStype"><?= $this->l11n->lang['SupplierManagement']['Subtype']; ?></label>
<tr><td><select id="iCStype" name="acstype">
<option><?= $this->l11n->lang['SupplierManagement']['Office']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Sales']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Purchase']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Accounting']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Support']; ?>
</select>
<tr><td><label for="iCInfo"><?= $this->l11n->lang['SupplierManagement']['Info']; ?></label>
<tr><td><input type="text" id="iCInfo" name="cinfo">
<tr><td><label for="iCData"><?= $this->l11n->lang['SupplierManagement']['Contact']; ?></label>
<tr><td><input type="text" id="iCData" name="cdata">
<tr><td colspan="2"><input type="submit" value="<?= $this->l11n->lang[0]['Add'] ?>">
</table>
</form>
</div>
</section>
</div>
<input type="radio" id="c-tab-3" name="tabular-2">
<div class="tab">
<section class="box w-33 floatLeft">
<h1><?= $this->l11n->lang['SupplierManagement']['Address'] ?></h1>
<div class="inner">
<form>
<table class="layout w-100">
<tr><td><label for="iAType"><?= $this->l11n->lang['SupplierManagement']['Type']; ?></label>
<tr><td><select id="iAType" name="atype">
<option><?= $this->l11n->lang['SupplierManagement']['Default']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Delivery']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Invoice']; ?>
</select>
<tr><td><label for="iAddress"><?= $this->l11n->lang['SupplierManagement']['Address']; ?></label>
<tr><td><input type="text" id="iAddress" name="address">
<tr><td><label for="iZip"><?= $this->l11n->lang['SupplierManagement']['Zip']; ?></label>
<tr><td><input type="text" id="iZip" name="zip">
<tr><td><label for="iCountry"><?= $this->l11n->lang['SupplierManagement']['Country']; ?></label>
<tr><td><input type="text" id="iCountry" name="country">
<tr><td><label for="iAInfo"><?= $this->l11n->lang['SupplierManagement']['Info']; ?></label>
<tr><td><input type="text" id="iAInfo" name="ainfo">
<tr><td><span class="check"><input type="checkbox" id="iDefault" name="default" checked><label for="iDefault"><?= $this->l11n->lang['SupplierManagement']['IsDefault']; ?></label></span>
<tr><td colspan="2"><input type="submit" value="<?= $this->l11n->lang[0]['Add'] ?>">
</table>
</form>
</div>
</section>
</div>
<input type="radio" id="c-tab-4" name="tabular-2">
<div class="tab">
<section class="box w-33 floatLeft">
<h1><?= $this->l11n->lang['SupplierManagement']['PaymentTerm'] ?></h1>
<div class="inner">
<form>
<table class="layout w-100">
<tr><td><label for="iSource"><?= $this->l11n->lang[0]['ID'] ?></label>
<tr><td><span class="input"><button><i class="fa fa-book"></i></button><input id="iSource" name="source" type="text" placeholder=""></span>
<tr><td><label for="iSegment"><?= $this->l11n->lang['SupplierManagement']['Segment'] ?></label>
<tr><td><input id="iSegment" name="segment" type="text" placeholder="">
<tr><td><label for="iProductgroup"><?= $this->l11n->lang['SupplierManagement']['Productgroup'] ?></label>
<tr><td><input id="iProductgroup" name="productgroup" type="text" placeholder="">
<tr><td><label for="iGroup"><?= $this->l11n->lang['SupplierManagement']['Group'] ?></label>
<tr><td><input id="iGroup" name="group" type="text" placeholder="">
<tr><td><label for="iArticlegroup"><?= $this->l11n->lang['SupplierManagement']['Articlegroup'] ?></label>
<tr><td><input id="iArticlegroup" name="articlegroup" type="text" placeholder="">
<tr><td><label for="iTerm"><?= $this->l11n->lang['SupplierManagement']['Type'] ?></label>
<tr><td><select id="iTerm" name="term" required>
<option>
</select>
<tr><td><span class="check"><input type="checkbox" id="iFreightage" name="freightage"><label for="iFreightage"><?= $this->l11n->lang['SupplierManagement']['Freightage'] ?></label></span>
<tr><td colspan="2"><input type="submit" value="<?= $this->l11n->lang[0]['Add'] ?>">
</table>
</form>
</div>
</section>
</div>
<input type="radio" id="c-tab-5" name="tabular-2">
<div class="tab">
<section class="box w-33 floatLeft">
<h1><?= $this->l11n->lang['SupplierManagement']['Payment'] ?></h1>
<div class="inner">
<form>
<table class="layout w-100">
<tr><td><label for="iACType"><?= $this->l11n->lang['SupplierManagement']['Type']; ?></label>
<tr><td><select id="iACType" name="actype">
<option><?= $this->l11n->lang['SupplierManagement']['Wire']; ?>
<option><?= $this->l11n->lang['SupplierManagement']['Creditcard']; ?>
</select>
<tr><td colspan="2"><input type="submit" value="<?= $this->l11n->lang[0]['Add'] ?>">
</table>
</form>
</div>
</section>
</div>
<input type="radio" id="c-tab-6" name="tabular-2">
<div class="tab">
</div>
</div>
</div>

View File

@ -0,0 +1,19 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>

View File

@ -0,0 +1,19 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>

View File

@ -0,0 +1,53 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG['SupplierManagement'] = [
'Accounting' => 'Accounting',
'Address' => 'Address',
'Addresses' => 'Addresses',
'Articlegroup' => 'Articlegroup',
'Contact' => 'Contact',
'Country' => 'Country',
'Creditcard' => 'Creditcard',
'Default' => 'Default',
'Delivery' => 'Delivery',
'Email' => 'Email',
'Fax' => 'Fax',
'Files' => 'Files',
'Freightage' => 'Freightage',
'Group' => 'Group',
'Info' => 'Info',
'Invoice' => 'Invoice',
'IsDefault' => 'Is default',
'Master' => 'Master',
'Name' => 'Name',
'Name1' => 'Name1',
'Name2' => 'Name2',
'Name3' => 'Name3',
'Office' => 'Office',
'PaymentTerm' => 'Payment Term',
'Payment' => 'Payment',
'Phone' => 'Phone',
'Productgroup' => 'Productgroup',
'Purchase' => 'Purchase',
'Sales' => 'Sales',
'Segment' => 'Segment',
'Subtype' => 'Subtype',
'Support' => 'Support',
'Supplier' => 'Supplier',
'Type' => 'Type',
'Wire' => 'Wire',
'Zip' => 'Zip',
];

View File

@ -0,0 +1,20 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
$MODLANG['Navigation'] = [
'Create' => 'Create',
'List' => 'List',
'Suppliers' => 'Suppliers',
];

51
info.json Normal file
View File

@ -0,0 +1,51 @@
{
"name": {
"id": 1003200000,
"internal": "SupplierManagement",
"external": "OMS Purchase"
},
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "Supplier management module.",
"directory": "SupplierManagement",
"dependencies": {},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"520f00a1a583e4936dc01665781e0dfafd699613"
],
"type": 4,
"for": 0,
"from": "SupplierManagement",
"file": "SupplierManagement"
},
{
"pid": [
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
],
"type": 5,
"from": "SupplierManagement",
"for": "Navigation",
"file": "nav.backend"
},
{
"pid": [
"520f00a1a583e4936dc01665781e0dfafd699613"
],
"type": 5,
"for": "Content",
"file": "backend",
"from": "SupplierManagement"
}
]
}