This commit is contained in:
Dennis Eichhorn 2015-11-29 21:57:18 +01:00
commit 7d58a2eff5
14 changed files with 780 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\EventManagement\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,48 @@
[
{
"id": 1004201001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "EventManagement",
"uri": "/{/lang}/backend/eventmanagement/list",
"target": "self",
"icon": null,
"order": 65,
"from": "EventManagement",
"permission": null,
"parent": 1003301001,
"children": [
{
"id": 1004202001,
"pid": "9a017c0aa5117ed6dd28736a6d6338e7c499e64f",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/eventmanagement/list",
"target": "self",
"icon": null,
"order": 1,
"from": "EventManagement",
"permission": null,
"parent": 1004201001,
"children": []
},
{
"id": 1004203001,
"pid": "9a017c0aa5117ed6dd28736a6d6338e7c499e64f",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "/{/lang}/backend/eventmanagement/create",
"target": "self",
"icon": null,
"order": 5,
"from": "EventManagement",
"permission": null,
"parent": 1004201001,
"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\EventManagement\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\Pool;
use phpOMS\Module\InstallerAbstract;
/**
* Event Management install class.
*
* @category Modules
* @package Modules\EventManagement
* @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;
}
}
}

169
Controller.php Normal file
View File

@ -0,0 +1,169 @@
<?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\EventManagement;
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;
/**
* Event Management controller class.
*
* @category Modules
* @package Modules\EventManagement
* @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 = 'EventManagement';
/**
* 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/eventmanagement/list.*$' => [['dest' => '\Modules\EventManagement\Controller:viewEventManagementList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/eventmanagement/create.*$' => [['dest' => '\Modules\EventManagement\Controller:viewEventManagementCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
'^.*/backend/eventmanagement/profile.*$' => [['dest' => '\Modules\EventManagement\Controller:viewEventManagementProfile', '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 viewEventManagementList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/EventManagement/Theme/backend/eventmanagement-list');
$view->addData('nav', $this->createNavigation(1004201001, $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 viewEventManagementCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/EventManagement/Theme/backend/eventmanagement-create');
$view->addData('nav', $this->createNavigation(1004201001, $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 viewEventManagementProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/EventManagement/Theme/backend/eventmanagement-profile');
$view->addData('nav', $this->createNavigation(1004201001, $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;
}
}

246
Models/Event.php Normal file
View File

@ -0,0 +1,246 @@
<?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\EventManagement;
use phpOMS\Pattern\Multition;
/**
* Event class.
*
* @category EventManager
* @package Framework
* @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 Event implements Multition
{
/**
* ID.
*
* @var \int
* @since 1.0.0
*/
private $id = null;
/**
* Name.
*
* @var \string
* @since 1.0.0
*/
private $name = '';
/**
* Description.
*
* @var \string
* @since 1.0.0
*/
private $description = null;
/**
* Created.
*
* @var datetime
* @since 1.0.0
*/
private $created = null;
/**
* Creator.
*
* @var \int
* @since 1.0.0
*/
private $creator = null;
/**
* Calendar.
*
* @var \Modules\Calender\Models\Calender
* @since 1.0.0
*/
private $calendar = null;
/**
* People/Users.
*
* @var array
* @since 1.0.0
*/
private $people = [];
private static $instances = [];
public function __construct($id)
{
}
public function getInstance($id)
{
if (!isset(self::$instances[$id])) {
self::$instances[$id] = new self($id);
}
return self::$instances[$id];
}
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
public function getDescription()
{
return $this->description;
}
public function setDescription($desc)
{
$this->descritpion = $desc;
}
public function getCreated()
{
return $this->created;
}
public function setCreated($created)
{
$this->created = $created;
}
public function getCreator()
{
return $this->creator;
}
public function setCreator($creator)
{
$this->creator = $creator;
}
public function getCalendar()
{
return $this->calender;
}
public function setCalender($calender)
{
$this->calender = $calender;
}
public function getPeople()
{
return $this->people;
}
public function setPeople($people)
{
$this->people = $people;
}
public function addPerson($person)
{
if (!isset($this->people[$person['id']])) {
$this->people[$person['id']] = $person;
}
}
public function removePerson($id)
{
if (isset($this->people[$id])) {
unset($this->people[$id]);
}
}
/**
* {@inheritdoc}
*/
public function delete()
{
}
/**
* {@inheritdoc}
*/
public function create()
{
}
/**
* {@inheritdoc}
*/
public function update()
{
}
/**
* {@inheritdoc}
*/
public function serialize()
{
}
/**
* {@inheritdoc}
*/
public function unserialize($data)
{
}
/**
* Init object by ID.
*
* This usually happens from DB or cache
*
* @param \int $id Object ID
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function init($id)
{
// TODO: Implement init() method.
}
/**
* Overwriting clone in order to maintain singleton pattern.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __clone()
{
// TODO: Implement __clone() method.
}
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Event Management #

View File

@ -0,0 +1,45 @@
<?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['EventManagement']['Event']; ?></h1>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td colspan="3"><label for="iName"><?= $this->l11n->lang['EventManagement']['Name']; ?></label>
<tr><td colspan="2"><input type="text" id="iName" name="name" placeholder="" required><td>
<tr><td colspan="3"><label for="iDescription"><?= $this->l11n->lang['EventManagement']['Description']; ?></label>
<tr><td colspan="2"><textarea id="iDescription" name="description"></textarea><td>
<tr><td colspan="3"><label for="iStatus"><?= $this->l11n->lang['EventManagement']['Status']; ?></label>
<tr><td colspan="2"><select id="iStatus" name="status">
<option value="">
</select><td>
<tr><td colspan="3"><label for="iFiles"><?= $this->l11n->lang['EventManagement']['Files']; ?></label>
<tr><td colspan="2"><input type="file" id="iFiles" name="file" multiple><td>
<tr><td><label for="iStart"><?= $this->l11n->lang['EventManagement']['Start'] ?><label><td><label for="iEnd"><?= $this->l11n->lang['EventManagement']['End'] ?><label><td>
<tr><td><input type="datetime-local" id="iStart" name="start" required><td><input type="datetime-local" id="iEnd" name="end" required><td>
<tr><td><label for="iResponsibility"><?= $this->l11n->lang['EventManagement']['Responsibility']; ?></label><td><label for="iUser"><?= $this->l11n->lang['EventManagement']['UserGroup']; ?></label><td>
<tr><td><select id="iStatus" name="status">
<option value="">
</select>
<td><span class="input"><button><i class="fa fa-book"></i></button><input type="text" id="iUser" name="user" placeholder=""></span><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,43 @@
<?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
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(20);
$footerView->setPage(1);
echo $this->getData('nav')->render(); ?>
<section class="box w-100">
<table class="table">
<caption><?= $this->l11n->lang['EventManagement']['Events'] ?></caption>
<thead>
<tr>
<td><?= $this->l11n->lang['EventManagement']['Status']; ?>
<td class="wf-100"><?= $this->l11n->lang['EventManagement']['Title']; ?>
<td><?= $this->l11n->lang['EventManagement']['Start']; ?>
<td><?= $this->l11n->lang['EventManagement']['End']; ?>
<tfoot>
<tr>
<td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0; foreach([] as $key => $value) : $count++; ?>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
<?php endif; ?>
</table>
</section>

View File

@ -0,0 +1,16 @@
<?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(); ?>

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,39 @@
<?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['EventManagement'] = [
'Account' => 'Account',
'Amount' => 'Amount',
'CoreData' => 'Core Data',
'Description' => 'Description',
'Elements' => 'Elements',
'End' => 'End',
'Event' => 'Event',
'Events' => 'Events',
'EventManagement' => 'Event Management',
'Files' => 'Files',
'Group' => 'Group',
'Info' => 'Info',
'People' => 'People',
'Manager' => 'Manager',
'Name' => 'Name',
'Permissions' => 'Permissions',
'Responsibility' => 'Responsibility',
'Start' => 'Start',
'Status' => 'Status',
'Title' => 'Title',
'User' => 'User',
'UserGroup' => 'User/Group',
];

View File

@ -0,0 +1,18 @@
<?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'] = [
'EventManagement' => 'Event Management',
];

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": 1004200000,
"internal": "EventManagement",
"external": "OMS Event Management"
},
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "Event Management module.",
"directory": "EventManagement",
"dependencies": {},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"9a017c0aa5117ed6dd28736a6d6338e7c499e64f"
],
"type": 4,
"for": "Content",
"from": "EventManagement",
"file": "EventManagement"
},
{
"pid": [
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
],
"type": 5,
"from": "EventManagement",
"for": "Navigation",
"file": "nav.backend"
},
{
"pid": [
"9a017c0aa5117ed6dd28736a6d6338e7c499e64f"
],
"type": 5,
"for": "Content",
"file": "backend",
"from": "EventManagement"
}
]
}