commit 40961f36ec9bf608c683fef43950b6833ff093fe Author: Dennis Eichhorn Date: Sun Nov 29 21:57:18 2015 +0100 Init diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php new file mode 100644 index 0000000..f024f1f --- /dev/null +++ b/Admin/Install/Navigation.php @@ -0,0 +1,38 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Support\Admin\Install; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Admin/Install/nav.install.json b/Admin/Install/nav.install.json new file mode 100644 index 0000000..9647f3d --- /dev/null +++ b/Admin/Install/nav.install.json @@ -0,0 +1,82 @@ +[ + { + "id": 1002901001, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 0, + "name": "Support", + "uri": null, + "target": "self", + "icon": "fa fa-question-circle", + "order": 80, + "from": "Support", + "permission": null, + "parent": 1000201001, + "children": [ + { + "id": 1002901101, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 1, + "name": "Ticket", + "uri": "/{/lang}/backend/support/list", + "target": "self", + "icon": null, + "order": 80, + "from": "Support", + "permission": null, + "parent": 1002901001, + "children": [ + ] + }, + { + "id": 1002901201, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 1, + "name": "Settings", + "uri": "/{/lang}/backend/support/settings/dashboard", + "target": "self", + "icon": null, + "order": 80, + "from": "Support", + "permission": null, + "parent": 1002901001, + "children": [ + ] + }, + { + "id": 1002901301, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 1, + "name": "Analysis", + "uri": "/{/lang}/backend/support/analysis/dashboard", + "target": "self", + "icon": null, + "order": 80, + "from": "Support", + "permission": null, + "parent": 1002901001, + "children": [ + ] + } + ] + }, + { + "id": 1002902001, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 1, + "name": "Support", + "uri": "/{/lang}/backend/private/support/dashboard", + "target": "self", + "icon": null, + "order": 5, + "from": "Support", + "permission": null, + "parent": 1003401001, + "children": [ + ] + } +] diff --git a/Admin/Installer.php b/Admin/Installer.php new file mode 100644 index 0000000..3eabeb3 --- /dev/null +++ b/Admin/Installer.php @@ -0,0 +1,49 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Support\Admin; + +use phpOMS\DataStorage\Database\DatabaseType; +use phpOMS\DataStorage\Database\Pool; +use phpOMS\Module\InstallerAbstract; + +/** + * Support install class. + * + * @category Modules + * @package Modules\Support + * @author OMS Development Team + * @author Dennis Eichhorn + * @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; + } + } +} diff --git a/Controller.php b/Controller.php new file mode 100644 index 0000000..2f503f8 --- /dev/null +++ b/Controller.php @@ -0,0 +1,210 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Support; + +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; + +/** + * Support controller class. + * + * @category Modules + * @package Modules\Support + * @author OMS Development Team + * @author Dennis Eichhorn + * @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 = 'Support'; + + /** + * 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/support/list.*$' => [['dest' => '\Modules\Support\Controller:viewSupportList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/support/single.*$' => [['dest' => '\Modules\Support\Controller:viewSupportTicket', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/support/create.*$' => [['dest' => '\Modules\Support\Controller:viewSupportCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/support/analysis.*$' => [['dest' => '\Modules\Support\Controller:viewSupportAnalysis', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/support/settings.*$' => [['dest' => '\Modules\Support\Controller:viewSupportSettings', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/private/support/dashboard.*$' => [['dest' => '\Modules\Support\Controller:viewPrivateSupportDashboard', '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 + */ + public function viewSupportList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Support/Theme/backend/support-list'); + $view->addData('nav', $this->createNavigation(1002603001, $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 + */ + public function viewSupportCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Support/Theme/backend/support-create'); + $view->addData('nav', $this->createNavigation(1002603001, $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 + */ + public function viewSupportAnalysis(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Support/Theme/backend/support-analysis'); + $view->addData('nav', $this->createNavigation(1002603001, $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 + */ + public function viewSupportSettings(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Support/Theme/backend/support-settings'); + $view->addData('nav', $this->createNavigation(1002603001, $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 + */ + public function viewPrivateSupportDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/Support/Theme/backend/user-support-dashboard'); + $view->addData('nav', $this->createNavigation(1002603001, $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 + */ + 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; + } +} diff --git a/Models/Issue.php b/Models/Issue.php new file mode 100644 index 0000000..f1f3af7 --- /dev/null +++ b/Models/Issue.php @@ -0,0 +1,164 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Support; + +use phpOMS\Pattern\Multition; + +/** + * Issue class. + * + * @category Support + * @package Framework + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Issue implements Multition +{ + + /** + * Name. + * + * @var \string + * @since 1.0.0 + */ + private $name = ''; + + /** + * Description. + * + * @var \string + * @since 1.0.0 + */ + private $description = ''; + + /** + * Created. + * + * @var \DateTime + * @since 1.0.0 + */ + private $created = null; + + /** + * Creator. + * + * @var \int + * @since 1.0.0 + */ + private $creator = null; + + 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]; + } + + /** + * {@inheritdoc} + */ + public function init($id) + { + } + + /** + * {@inheritdoc} + */ + public function __clone() + { + } + + public function getId() + { + return $this->id; + } + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + } + + 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; + } + + /** + * {@inheritdoc} + */ + public function delete() + { + } + + /** + * {@inheritdoc} + */ + public function create() + { + } + + /** + * {@inheritdoc} + */ + public function update() + { + } + + /** + * {@inheritdoc} + */ + public function serialize() + { + } + + /** + * {@inheritdoc} + */ + public function unserialize($data) + { + } +} diff --git a/Models/Message.php b/Models/Message.php new file mode 100644 index 0000000..c248599 --- /dev/null +++ b/Models/Message.php @@ -0,0 +1,178 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Support; + +use phpOMS\Pattern\Multition; + +/** + * Issue class. + * + * @category Support + * @package Framework + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Message implements Multition +{ + + /** + * Name. + * + * @var \string + * @since 1.0.0 + */ + private $name = ''; + + /** + * Description. + * + * @var \string + * @since 1.0.0 + */ + private $description = ''; + + /** + * Created. + * + * @var \Datetime + * @since 1.0.0 + */ + private $created = null; + + /** + * Creator. + * + * @var \int + * @since 1.0.0 + */ + private $creator = null; + + 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 getCreated() + { + return $this->created; + } + + public function setCreated($created) + { + $this->created = $created; + } + + public function getCreator() + { + return $this->creator; + } + + public function setCreator($creator) + { + $this->creator = $creator; + } + + /** + * {@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 + */ + public function init($id) + { + // TODO: Implement init() method. + } + + /** + * Overwriting clone in order to maintain singleton pattern. + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function __clone() + { + // TODO: Implement __clone() method. + } +} diff --git a/Models/SupportStatus.php b/Models/SupportStatus.php new file mode 100644 index 0000000..84c01b3 --- /dev/null +++ b/Models/SupportStatus.php @@ -0,0 +1,44 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Support; + +use phpOMS\Datatypes\Enum; + +/** + * Support status enum. + * + * @category Support + * @package Framework + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +abstract class SupportStatus extends Enum +{ + const OPEN = 0; + + const REVIEW = 1; + + const LIVE = 2; + + const UNSOLVABLE = 3; + + const SOLVED = 4; + + const CLOSED = 5; +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a26fee --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Support # diff --git a/Theme/backend/support-list.tpl.php b/Theme/backend/support-list.tpl.php new file mode 100644 index 0000000..41ae9d1 --- /dev/null +++ b/Theme/backend/support-list.tpl.php @@ -0,0 +1,34 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+ + + + + +
l11n->lang['Support']['Tickets']; ?>
l11n->lang[0]['ID']; ?> + l11n->lang['Support']['Status']; ?> + l11n->lang['Support']['Priority']; ?> + l11n->lang['Support']['Title']; ?> + l11n->lang['Support']['Responsible']; ?> +
l11n->lang[0]['Empty']; ?> +
+
diff --git a/Theme/backend/user-support-dashboard.tpl.php b/Theme/backend/user-support-dashboard.tpl.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Theme/backend/user-support-dashboard.tpl.php @@ -0,0 +1 @@ + diff --git a/Theme/lang/backend.en.lang.php b/Theme/lang/backend.en.lang.php new file mode 100644 index 0000000..6acd5e9 --- /dev/null +++ b/Theme/lang/backend.en.lang.php @@ -0,0 +1,55 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +$MODLANG['Support'] = [ + 'Account' => 'Account', + 'All' => 'All', + 'AverageProcessTime' => 'Avg. Process Time', + 'AverageAmount' => 'Average Amount', + 'Created' => 'Created', + 'Creator' => 'Creator', + 'Day' => 'Day', + 'Due' => 'Due', + 'Forwarded' => 'Forwarded', + 'From' => 'From', + 'Group' => 'Group', + 'Interval' => 'Interval', + 'InTime' => 'In Time', + 'Message' => 'Message', + 'Media' => 'Media', + 'Month' => 'Month', + 'Name' => 'Name', + 'New' => 'New', + 'Open' => 'Open', + 'Person' => 'Person', + 'Priority' => 'Priority', + 'Received' => 'Received', + 'Receiver' => 'Receiver', + 'Redirected' => 'Redirected', + 'Responsible' => 'Responsible', + 'Select' => 'Select', + 'Settings' => 'Settings', + 'Size' => 'Size', + 'Statistics' => 'Statistics', + 'Status' => 'Status', + 'Support' => 'Support', + 'Tickets' => 'Tickets', + 'Title' => 'Title', + 'To' => 'To', + 'Today' => 'Today', + 'Type' => 'Type', + 'Week' => 'Week', + 'Year' => 'Year', +]; diff --git a/Theme/lang/nav.backend.en.lang.php b/Theme/lang/nav.backend.en.lang.php new file mode 100644 index 0000000..7932138 --- /dev/null +++ b/Theme/lang/nav.backend.en.lang.php @@ -0,0 +1,19 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +$MODLANG['Navigation'] = [ + 'Support' => 'Support', + 'Ticket' => 'Ticket', +]; diff --git a/img/module_teaser_small.png b/img/module_teaser_small.png new file mode 100644 index 0000000..f56e6ff Binary files /dev/null and b/img/module_teaser_small.png differ diff --git a/info.json b/info.json new file mode 100644 index 0000000..e7d9cf3 --- /dev/null +++ b/info.json @@ -0,0 +1,53 @@ +{ + "name": { + "id": 1002900000, + "internal": "Support", + "external": "OMS Support" + }, + "version": "1.0.0", + "requirements": { + "phpOMS": "1.0.0", + "phpOMS-db": "1.0.0" + }, + "creator": { + "name": "Orange Management", + "website": "www.spl1nes.com" + }, + "description": "Support module.", + "directory": "Support", + "dependencies": {}, + "providing": { + "Navigation": "*" + }, + "load": [ + { + "pid": [ + "165b4fe348524450aa8471c275ea8f685856e196", + "90604e24f45665d3036937960efcc695dfd6e149" + ], + "type": 4, + "for": 0, + "from": "Support", + "file": "Support" + }, + { + "pid": [ + "754a08ddf8bcb1cf22f310f09206dd783d42f7dd" + ], + "type": 5, + "from": "Support", + "for": "Navigation", + "file": "nav.backend" + }, + { + "pid": [ + "165b4fe348524450aa8471c275ea8f685856e196", + "90604e24f45665d3036937960efcc695dfd6e149" + ], + "type": 5, + "for": "Content", + "file": "backend", + "from": "Support" + } + ] +}