This commit is contained in:
Dennis Eichhorn 2015-11-29 21:57:18 +01:00
commit 694aee1200
12 changed files with 531 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\ResearchDevelopment\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,64 @@
[
{
"id": 1002201001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 0,
"name": "RnD",
"uri": null,
"target": null,
"icon": "fa fa-flask",
"order": 110,
"from": 1002200000,
"permission": null,
"parent": 1000201001,
"children": [
{
"id": 1002202001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Projects",
"uri": "/{/lang}/backend/rnd/list",
"target": "self",
"icon": null,
"order": 1,
"from": 1002200000,
"permission": null,
"parent": 1002201001,
"children": [
{
"id": 1002202101,
"pid": "f37d0b45c43b1ee70d7b26791640cda9402d203e",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/rnd/list",
"target": "self",
"icon": null,
"order": 1,
"from": 1002200000,
"permission": null,
"parent": 1002202001,
"children": []
},
{
"id": 1002202201,
"pid": "f37d0b45c43b1ee70d7b26791640cda9402d203e",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "/{/lang}/backend/rnd/create",
"target": "self",
"icon": null,
"order": 5,
"from": 1002200000,
"permission": null,
"parent": 1002202001,
"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\ResearchDevelopment\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\Pool;
use phpOMS\Module\InstallerAbstract;
/**
* Navigation class.
*
* @category Modules
* @package Modules\ResearchDevelopment
* @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;
}
}
}

149
Controller.php Normal file
View File

@ -0,0 +1,149 @@
<?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\ResearchDevelopment;
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;
/**
* Research & Development controller class.
*
* @category Modules
* @package Modules\ResearchDevelopment
* @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 = 'ResearchDevelopment';
/**
* 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/rnd/list.*$' => [['dest' => '\Modules\ResearchDevelopment\Controller:viewProjectList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/rnd/create.*$' => [['dest' => '\Modules\ResearchDevelopment\Controller:viewProjectCreate', '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 viewProjectList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/ResearchDevelopment/Theme/backend/rnd-list');
$view->addData('nav', $this->createNavigation(1002202001, $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 viewProjectCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/ResearchDevelopment/Theme/backend/rnd-create');
$view->addData('nav', $this->createNavigation(1002202001, $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;
}
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Research & Development #

View File

@ -0,0 +1,51 @@
<?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
*/
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<h1><?= $this->l11n->lang['ResearchDevelopment']['Project']; ?></h1>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td colspan="3"><label for="iName"><?= $this->l11n->lang['ResearchDevelopment']['Name']; ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder=""><td>
<tr><td colspan="3"><label for="iDescription"><?= $this->l11n->lang['ResearchDevelopment']['Description']; ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="description"></textarea><td>
<tr><td colspan="3"><label for="iStatus"><?= $this->l11n->lang['ResearchDevelopment']['Status']; ?></label>
<tr><td colspan="2"><select id="iStatus" name="status">
<option value="<?= \Modules\ProjectManagement\Models\ProjectStatus::ACTIVE ?>"><?= $this->l11n->lang['ResearchDevelopment']['Active']; ?>
<option value="<?= \Modules\ProjectManagement\Models\ProjectStatus::INACTIVE ?>"><?= $this->l11n->lang['ResearchDevelopment']['Inactive']; ?>
<option value="<?= \Modules\ProjectManagement\Models\ProjectStatus::FINISHED ?>"><?= $this->l11n->lang['ResearchDevelopment']['Finished']; ?>
<option value="<?= \Modules\ProjectManagement\Models\ProjectStatus::CANCELED ?>"><?= $this->l11n->lang['ResearchDevelopment']['Canceled']; ?>
<option value="<?= \Modules\ProjectManagement\Models\ProjectStatus::HOLD ?>"><?= $this->l11n->lang['ResearchDevelopment']['Hold']; ?>
</select><td>
<tr><td colspan="3"><label for="iFiles"><?= $this->l11n->lang['ResearchDevelopment']['Files']; ?></label>
<tr><td colspan="2"><input type="file" id="iFiles" name="file" multiple><td>
<tr><td colspan="3"><label for="iBudget"><?= $this->l11n->lang['ResearchDevelopment']['Budget']; ?></label>
<tr><td colspan="2"><input type="text" id="iBudget" name="budget" placeholder=""><td>
<tr><td><label for="iDue"><?= $this->l11n->lang['ResearchDevelopment']['Start']; ?></label><td><label for="iDue"><?= $this->l11n->lang['ResearchDevelopment']['Due']; ?></label><td>
<tr><td><input type="datetime-local" id="iDue" name="due"><td><input type="datetime-local" id="iDue" name="due"><td>
<tr><td><label for="iResponsibility"><?= $this->l11n->lang['ResearchDevelopment']['Responsibility']; ?></label><td><label for="iUser"><?= $this->l11n->lang['ResearchDevelopment']['UserGroup']; ?></label><td>
<tr><td><select id="iStatus" name="status">
<option value="<?= \Modules\ProjectManagement\Models\ProjectResponsibility::MANAGER ?>"><?= $this->l11n->lang['ResearchDevelopment']['Manager']; ?>
<option value="<?= \Modules\ProjectManagement\Models\ProjectResponsibility::OTHER ?>"><?= $this->l11n->lang['ResearchDevelopment']['Other']; ?>
</select>
<td><input type="text" id="iUser" name="user" placeholder=""><td><button><?= $this->l11n->lang[0]['Add']; ?></button>
<tr><td colspan="3"><input type="submit" value="<?= $this->l11n->lang[0]['Create']; ?>">
</table>
</form>
</div>
</section>

View File

@ -0,0 +1,55 @@
<?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
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<section class="box w-100">
<table class="table">
<caption><?= $this->l11n->lang['ResearchDevelopment']['Projects']; ?></caption>
<thead>
<tr>
<td><?= $this->l11n->lang[0]['ID']; ?>
<td><?= $this->l11n->lang['ResearchDevelopment']['Status']; ?>
<td class="wf-100"><?= $this->l11n->lang['ResearchDevelopment']['Name']; ?>
<td><?= $this->l11n->lang['ResearchDevelopment']['Creator']; ?>
<td><?= $this->l11n->lang['ResearchDevelopment']['Created']; ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/checklist/single?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getParent(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getUnit(); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr>
<td colspan="5" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
<?php endif; ?>
</table>
</section>

View File

@ -0,0 +1,17 @@
<?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[1] = [
];

View File

@ -0,0 +1,37 @@
<?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['ResearchDevelopment'] = [
'Active' => 'Active',
'Budget' => 'Budget',
'Canceled' => 'Canceled',
'Created' => 'Created',
'Creator' => 'Creator',
'Description' => 'Description',
'Due' => 'Due',
'Files' => 'Files',
'Finished' => 'Finished',
'Hold' => 'Hold',
'Inactive' => 'Inactive',
'Manager' => 'Manager',
'Name' => 'Name',
'Other' => 'Other',
'Project' => 'Project',
'Projects' => 'Projects',
'Responsibility' => 'Responsibility',
'Start' => 'Start',
'Status' => 'Status',
'UserGroup' => 'User/Group',
];

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
*/
$MODLANG['Navigation'] = [
'Projects' => 'Projects',
'RnD' => 'R&D',
];

BIN
img/module_teaser_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

51
info.json Normal file
View File

@ -0,0 +1,51 @@
{
"name": {
"id": 1002200000,
"internal": "ResearchDevelopment",
"external": "OMS Research & Development"
},
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "Research & Development module.",
"directory": "ResearchDevelopment",
"dependencies": {},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"f37d0b45c43b1ee70d7b26791640cda9402d203e"
],
"type": 4,
"for": 0,
"from": "ResearchDevelopment",
"file": "ResearchDevelopment"
},
{
"pid": [
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
],
"type": 5,
"from": "ResearchDevelopment",
"for": "Navigation",
"file": "nav.backend"
},
{
"pid": [
"f37d0b45c43b1ee70d7b26791640cda9402d203e"
],
"type": 5,
"for": "Content",
"file": "backend",
"from": "ResearchDevelopment"
}
]
}