This commit is contained in:
Dennis Eichhorn 2015-11-29 21:57:18 +01:00
commit 78a4a0ff7b
11 changed files with 607 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\Checklist\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,63 @@
[
{
"id": 1003601001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Checklist",
"uri": "/{/lang}/backend/checklist/list",
"target": "self",
"icon": null,
"order": 65,
"from": "Checklist",
"permission": null,
"parent": 1003301001,
"children": [
{
"id": 1003602001,
"pid": "485c01f6ec77f5370a8060bb44b8a13a985184b5",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/checklist/list",
"target": "self",
"icon": null,
"order": 1,
"from": "Checklists",
"permission": null,
"parent": 1003601001,
"children": []
},
{
"id": 1003603001,
"pid": "485c01f6ec77f5370a8060bb44b8a13a985184b5",
"type": 3,
"subtype": 5,
"name": "Templates",
"uri": "/{/lang}/backend/checklist/template/list",
"target": "self",
"icon": null,
"order": 5,
"from": "Checklist",
"permission": null,
"parent": 1003601001,
"children": []
},
{
"id": 1003604001,
"pid": "485c01f6ec77f5370a8060bb44b8a13a985184b5",
"type": 3,
"subtype": 5,
"name": "CreateTemplate",
"uri": "/{/lang}/backend/checklist/template/create",
"target": "self",
"icon": null,
"order": 15,
"from": "Checklist",
"permission": null,
"parent": 1003601001,
"children": []
}
]
}
]

48
Admin/Installer.php Normal file
View File

@ -0,0 +1,48 @@
<?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\Checklist\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\Pool;
use phpOMS\Module\InstallerAbstract;
/**
* Calendar install class.
*
* @category Modules
* @package Modules\Calendar
* @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;
}
}
}

171
Controller.php Normal file
View File

@ -0,0 +1,171 @@
<?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\Checklist;
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;
/**
* Calendar controller class.
*
* @category Modules
* @package Checklist
* @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 = 'Checklist';
/**
* 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/checklist/list.*$' => [['dest' => '\Modules\Checklist\Controller:viewChecklistList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/checklist/template/list.*$' => [['dest' => '\Modules\Checklist\Controller:viewChecklistTemplateList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/checklist/template/create.*$' => [['dest' => '\Modules\Checklist\Controller:viewChecklistTemplateCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/checklist/template/view.*$' => [['dest' => '\Modules\Checklist\Controller:viewChecklistTemplateView', '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 viewChecklistList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Checklist/Theme/backend/checklist-list');
$view->addData('nav', $this->createNavigation(1003601001, $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 viewChecklistTemplateList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Checklist/Theme/backend/checklist-template-list');
$view->addData('nav', $this->createNavigation(1003601001, $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 viewChecklistTemplateCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Checklist/Theme/backend/checklist-template-create');
$view->addData('nav', $this->createNavigation(1003601001, $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,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['Checklist']['Checklists']; ?></caption>
<thead>
<tr>
<td><?= $this->l11n->lang[0]['ID']; ?>
<td><?= $this->l11n->lang['Checklist']['Status']; ?>
<td class="wf-100"><?= $this->l11n->lang['Checklist']['Name']; ?>
<td><?= $this->l11n->lang['Checklist']['Creator']; ?>
<td><?= $this->l11n->lang['Checklist']['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,58 @@
<?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(); ?>
<section class="box w-33">
<h1><?= $this->l11n->lang['Checklist']['General']; ?></h1>
<div class="inner">
<form id="fChecklist">
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->l11n->lang['Checklist']['Name']; ?></label><td>
<tr><td><input type="text" id="iName" name="name" required><td>
<tr><td><label for="iDescription"><?= $this->l11n->lang['Checklist']['Description']; ?></label><td>
<tr><td><textarea id="iDescription" name="description"></textarea><td>
<tr><td><label for="iPermission"><?= $this->l11n->lang['Checklist']['Permissions']; ?></label><td>
<tr><td><span class="input"><button><i class="fa fa-book"></i></button><input type="text" id="iPermission" name="permission"></span><td><button><?= $this->l11n->lang[0]['Add']; ?></button>
<tr><td><label for="iFiles"><?= $this->l11n->lang['Checklist']['Files']; ?></label><td>
<tr><td><input id="iFiles" name="files" type="file" multiple><td>
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Create']; ?>"><td>
</table>
</form>
</div>
</section>
<section class="box w-33">
<h1><?= $this->l11n->lang['Checklist']['Tasks']; ?></h1>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td><label for="iETitle"><?= $this->l11n->lang['Checklist']['Title']; ?></label><td>
<tr><td><input type="text" id="iETitle" name="eTitle" required><td>
<tr><td><label for="iEDescription"><?= $this->l11n->lang['Checklist']['Description']; ?></label><td>
<tr><td><textarea id="iEDescription" name="eDescription"></textarea><td>
<tr><td><label for="iEPermission"><?= $this->l11n->lang['Checklist']['Permissions']; ?></label><td>
<tr><td><span class="input"><button><i class="fa fa-book"></i></button><input type="text" id="iEPermission" name="ePermission"></span><td><button><?= $this->l11n->lang[0]['Add']; ?></button>
<tr><td><label for="iEFiles"><?= $this->l11n->lang['Checklist']['Files']; ?></label><td>
<tr><td><input id="iEFiles" name="eFiles" type="file" multiple><td>
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Add']; ?>"><td>
</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['Checklist']['Templates']; ?></caption>
<thead>
<tr>
<td><?= $this->l11n->lang[0]['ID']; ?>
<td><?= $this->l11n->lang['Checklist']['Status']; ?>
<td class="wf-100"><?= $this->l11n->lang['Checklist']['Name']; ?>
<td><?= $this->l11n->lang['Checklist']['Creator']; ?>
<td><?= $this->l11n->lang['Checklist']['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['Navigation'] = [
];

View File

@ -0,0 +1,30 @@
<?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['Checklist'] = [
'Checklist' => 'Checklist',
'Checklists' => 'Checklists',
'Created' => 'Created',
'Creator' => 'Creator',
'Description' => 'Description',
'Files' => 'Files',
'General' => 'General',
'Name' => 'Name',
'Permissions' => 'Permissions',
'Status' => 'Status',
'Tasks' => 'Tasks',
'Templates' => 'Templates',
'Title' => 'Title',
];

View File

@ -0,0 +1,21 @@
<?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'] = [
'Checklist' => 'Checklist',
'Checklists' => 'Checklists',
'CreateCheclist' => 'CreateCheclist',
'Templates' => 'Templates',
];

51
info.json Normal file
View File

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