mirror of
https://github.com/Karaka-Management/oms-Calendar.git
synced 2026-02-08 20:48:40 +00:00
Merge branch 'develop' of https://github.com/Orange-Management/Modules into develop
This commit is contained in:
commit
30c9aabb20
|
|
@ -1,7 +1,7 @@
|
|||
[
|
||||
{
|
||||
"id": 1000901001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"pid": "/backend",
|
||||
"type": 1,
|
||||
"subtype": 1,
|
||||
"name": "Calendar",
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
{
|
||||
"id": 1000901002,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"pid": "/backend",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Calendar",
|
||||
|
|
|
|||
|
|
@ -38,27 +38,20 @@ class Installer extends InstallerAbstract
|
|||
{
|
||||
parent::install(__DIR__ . '/..', $dbPool, $info);
|
||||
|
||||
switch ($dbPool->get('core')->getType()) {
|
||||
switch ($dbPool->get()->getType()) {
|
||||
case DatabaseType::MYSQL:
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'calendar` (
|
||||
$dbPool->get()->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'calendar` (
|
||||
`calendar_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`calendar_name` varchar(255) NOT NULL,
|
||||
`calendar_description` varchar(255) NOT NULL,
|
||||
`calendar_created_by` int(11) NOT NULL,
|
||||
`calendar_created_at` datetime NOT NULL,
|
||||
PRIMARY KEY (`calendar_id`),
|
||||
KEY `calendar_created_by` (`calendar_created_by`)
|
||||
PRIMARY KEY (`calendar_id`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'calendar`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_ibfk_1` FOREIGN KEY (`calendar_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'calendar_permission` (
|
||||
$dbPool->get()->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'calendar_permission` (
|
||||
`calendar_permission_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`calendar_permission_type` tinyint(1) NOT NULL,
|
||||
`calendar_permission_ref` int(11) NOT NULL,
|
||||
|
|
@ -69,13 +62,13 @@ class Installer extends InstallerAbstract
|
|||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'calendar_permission`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_permission_ibfk_1` FOREIGN KEY (`calendar_permission_calendar`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar` (`calendar_id`);'
|
||||
$dbPool->get()->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get()->prefix . 'calendar_permission`
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_permission_ibfk_1` FOREIGN KEY (`calendar_permission_calendar`) REFERENCES `' . $dbPool->get()->prefix . 'calendar` (`calendar_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'schedule` (
|
||||
$dbPool->get()->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'schedule` (
|
||||
`schedule_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`schedule_uid` varchar(255) NOT NULL,
|
||||
`schedule_status` tinyint(1) NOT NULL,
|
||||
|
|
@ -94,13 +87,13 @@ class Installer extends InstallerAbstract
|
|||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'schedule`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'schedule_ibfk_1` FOREIGN KEY (`schedule_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
||||
$dbPool->get()->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get()->prefix . 'schedule`
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'schedule_ibfk_1` FOREIGN KEY (`schedule_created_by`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'calendar_event` (
|
||||
$dbPool->get()->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'calendar_event` (
|
||||
`calendar_event_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`calendar_event_name` varchar(25) NOT NULL,
|
||||
`calendar_event_description` varchar(255) NOT NULL,
|
||||
|
|
@ -118,15 +111,15 @@ class Installer extends InstallerAbstract
|
|||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'calendar_event`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_event_ibfk_1` FOREIGN KEY (`calendar_event_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_event_ibfk_2` FOREIGN KEY (`calendar_event_schedule`) REFERENCES `' . $dbPool->get('core')->prefix . 'schedule` (`schedule_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_event_ibfk_3` FOREIGN KEY (`calendar_event_calendar`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar` (`calendar_id`);'
|
||||
$dbPool->get()->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get()->prefix . 'calendar_event`
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_event_ibfk_1` FOREIGN KEY (`calendar_event_created_by`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_event_ibfk_2` FOREIGN KEY (`calendar_event_schedule`) REFERENCES `' . $dbPool->get()->prefix . 'schedule` (`schedule_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_event_ibfk_3` FOREIGN KEY (`calendar_event_calendar`) REFERENCES `' . $dbPool->get()->prefix . 'calendar` (`calendar_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'calendar_event_participant` (
|
||||
$dbPool->get()->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'calendar_event_participant` (
|
||||
`calendar_event_participant_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`calendar_event_participant_event` int(11) NOT NULL,
|
||||
`calendar_event_participant_person` int(11) NOT NULL,
|
||||
|
|
@ -137,10 +130,10 @@ class Installer extends InstallerAbstract
|
|||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'calendar_event_participant`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_event_participant_ibfk_1` FOREIGN KEY (`calendar_event_participant_event`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar_event` (`calendar_event_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_event_participant_ibfk_2` FOREIGN KEY (`calendar_event_participant_person`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
|
||||
$dbPool->get()->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get()->prefix . 'calendar_event_participant`
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_event_participant_ibfk_1` FOREIGN KEY (`calendar_event_participant_event`) REFERENCES `' . $dbPool->get()->prefix . 'calendar_event` (`calendar_event_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get()->prefix . 'calendar_event_participant_ibfk_2` FOREIGN KEY (`calendar_event_participant_person`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);'
|
||||
)->execute();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Uninstall extends UninstallAbstract
|
|||
|
||||
$query = new Builder($dbPool->get());
|
||||
|
||||
$query->prefix($dbPool->get('core')->getPrefix())->drop(
|
||||
$query->prefix($dbPool->get()->getPrefix())->drop(
|
||||
'calendar_event_participant',
|
||||
'calendar_event',
|
||||
'schedule',
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@ declare(strict_types=1);
|
|||
namespace Modules\Calendar;
|
||||
|
||||
use Modules\Calendar\Models\CalendarMapper;
|
||||
use Modules\Calendar\Models\PermissionState;
|
||||
use Modules\Navigation\Models\Navigation;
|
||||
use Modules\Navigation\Views\NavigationView;
|
||||
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Stdlib\Base\SmartDateTime;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
|
|
@ -24,8 +26,9 @@ use phpOMS\Message\ResponseAbstract;
|
|||
use phpOMS\Module\ModuleAbstract;
|
||||
use phpOMS\Module\WebInterface;
|
||||
use phpOMS\Views\View;
|
||||
use phpOMS\Views\ViewLayout;
|
||||
use phpOMS\Asset\AssetType;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Message\Http\RequestStatusCode;
|
||||
|
||||
/**
|
||||
* Calendar controller class.
|
||||
|
|
@ -63,6 +66,14 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
*/
|
||||
/* public */ const MODULE_NAME = 'Calendar';
|
||||
|
||||
/**
|
||||
* Module id.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
/* public */ const MODULE_ID = 1000900000;
|
||||
|
||||
/**
|
||||
* Providing.
|
||||
*
|
||||
|
|
@ -88,14 +99,23 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
* @return \Serializable
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewCalendarDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
|
||||
if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_ID, PermissionState::DASHBOARD)
|
||||
) {
|
||||
$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
return $view;
|
||||
}
|
||||
|
||||
/** @var Head $head */
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head->addAsset(AssetType::CSS, $request->getUri()->getBase() . 'Modules/Calendar/Theme/Backend/css/styles.css');
|
||||
|
||||
$view = new View($this->app, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Calendar/Theme/Backend/calendar-dashboard');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001201001, $request, $response));
|
||||
|
||||
|
|
@ -117,6 +137,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
* @return \Serializable
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
{
|
||||
|
|
@ -127,9 +148,13 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Calendar/Theme/Backend/dashboard-calendar');
|
||||
|
||||
$calendarView = new \Modules\Calendar\Theme\Backend\Components\Calendar\BaseView($this->app, $request, $response);
|
||||
$calendarView->setTemplate('/Modules/Calendar/Theme/Backend/Components/Calendar/mini');
|
||||
$view->addData('calendar', $calendarView);
|
||||
|
||||
$calendar = CalendarMapper::get(1);
|
||||
$calendar->setDate(new SmartDateTime($request->getData('date') ?? 'now'));
|
||||
$view->addData('calendar', $calendar);
|
||||
$view->addData('cal', $calendar);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,14 +60,6 @@ class Calendar
|
|||
*/
|
||||
private $createdAt = null;
|
||||
|
||||
/**
|
||||
* Created by.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $createdBy = 0;
|
||||
|
||||
/**
|
||||
* Current date of the calendar.
|
||||
*
|
||||
|
|
@ -223,26 +215,6 @@ class Calendar
|
|||
$this->createdAt = $createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCreatedBy() : int
|
||||
{
|
||||
return $this->createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $createdBy Creator
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setCreatedBy(int $createdBy)
|
||||
{
|
||||
$this->createdBy = $createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current date
|
||||
*
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ class CalendarMapper extends DataMapperAbstract
|
|||
'calendar_name' => ['name' => 'calendar_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'calendar_password' => ['name' => 'calendar_password', 'type' => 'string', 'internal' => 'password'],
|
||||
'calendar_description' => ['name' => 'calendar_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'calendar_created_by' => ['name' => 'calendar_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'calendar_created_at' => ['name' => 'calendar_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
||||
|
|
@ -111,25 +110,6 @@ class CalendarMapper extends DataMapperAbstract
|
|||
if($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
|
||||
$query = new Builder(self::$db);
|
||||
$query->prefix(self::$db->getPrefix())
|
||||
->insert(
|
||||
'account_permission_account',
|
||||
'account_permission_from',
|
||||
'account_permission_for',
|
||||
'account_permission_id1',
|
||||
'account_permission_id2',
|
||||
'account_permission_r',
|
||||
'account_permission_w',
|
||||
'account_permission_m',
|
||||
'account_permission_d',
|
||||
'account_permission_p'
|
||||
)
|
||||
->into('account_permission')
|
||||
->values($obj->getCreatedBy(), 'calendar', 'calendar', 1, $objId, 1, 1, 1, 1, 1);
|
||||
|
||||
self::$db->con->prepare($query->toSql())->execute();
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,26 +105,6 @@ class EventMapper extends DataMapperAbstract
|
|||
if($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
|
||||
$query = new Builder(self::$db);
|
||||
|
||||
$query->prefix(self::$db->getPrefix())
|
||||
->insert(
|
||||
'account_permission_account',
|
||||
'account_permission_from',
|
||||
'account_permission_for',
|
||||
'account_permission_id1',
|
||||
'account_permission_id2',
|
||||
'account_permission_r',
|
||||
'account_permission_w',
|
||||
'account_permission_m',
|
||||
'account_permission_d',
|
||||
'account_permission_p'
|
||||
)
|
||||
->into('account_permission')
|
||||
->values($obj->getCreatedBy(), 'calendar_event', 'calendar_event', 1, $objId, 1, 1, 1, 1, 1);
|
||||
|
||||
self::$db->con->prepare($query->toSql())->execute();
|
||||
} catch (\Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
|
||||
|
|
|
|||
34
Models/PermissionState.php
Normal file
34
Models/PermissionState.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Calendar\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Permision state enum.
|
||||
*
|
||||
* @category Tasks
|
||||
* @package Modules
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class PermissionState extends Enum
|
||||
{
|
||||
/* public */ const DASHBOARD = 1;
|
||||
/* public */ const EVENT = 2;
|
||||
/* public */ const CALENDAR = 3;
|
||||
}
|
||||
|
|
@ -95,25 +95,6 @@ class ScheduleMapper extends DataMapperAbstract
|
|||
if($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
|
||||
$query = new Builder(self::$db);
|
||||
$query->prefix(self::$db->getPrefix())
|
||||
->insert(
|
||||
'account_permission_account',
|
||||
'account_permission_from',
|
||||
'account_permission_for',
|
||||
'account_permission_id1',
|
||||
'account_permission_id2',
|
||||
'account_permission_r',
|
||||
'account_permission_w',
|
||||
'account_permission_m',
|
||||
'account_permission_d',
|
||||
'account_permission_p'
|
||||
)
|
||||
->into('account_permission')
|
||||
->values($obj->getCreatedBy(), 'schedule', 'schedule', 1, $objId, 1, 1, 1, 1, 1);
|
||||
|
||||
self::$db->con->prepare($query->toSql())->execute();
|
||||
} catch (\Exception $e) {
|
||||
var_dump($e->getMessage());
|
||||
|
||||
|
|
|
|||
38
Theme/Backend/Components/Calendar/BaseView.php
Normal file
38
Theme/Backend/Components/Calendar/BaseView.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Calendar\Theme\Backend\Components\Calendar;
|
||||
|
||||
use phpOMS\Views\View;
|
||||
use phpOMS\ApplicationAbstract;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
|
||||
class BaseView extends View
|
||||
{
|
||||
protected $calendar = [];
|
||||
|
||||
public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response)
|
||||
{
|
||||
parent::__construct($app, $request, $response);
|
||||
$this->setTemplate('/Modules/Calendar/Theme/Backend/Components/Calendar/mini');
|
||||
}
|
||||
|
||||
public function render(...$data) : string
|
||||
{
|
||||
$this->calendar = $data[0];
|
||||
return parent::render();
|
||||
}
|
||||
}
|
||||
36
Theme/Backend/Components/Calendar/mini.tpl.php
Normal file
36
Theme/Backend/Components/Calendar/mini.tpl.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<div id="calendar" class="m-calendar m-calendar-mini" data-action='[
|
||||
{
|
||||
"listener": "click", "selector": "#calendar span.tag", "action": [
|
||||
{"key": 1, "type": "dom.popup", "tpl": "calendar-event-popup-tpl", "aniIn": "fadeIn"}
|
||||
]
|
||||
}
|
||||
]'>
|
||||
<div class="box wf-100">
|
||||
<ul class="weekdays green">
|
||||
<li><?= $this->getHtml('Sunday', 'Calendar'); ?>
|
||||
<li><?= $this->getHtml('Monday', 'Calendar'); ?>
|
||||
<li><?= $this->getHtml('Tuesday', 'Calendar'); ?>
|
||||
<li><?= $this->getHtml('Wednesday', 'Calendar'); ?>
|
||||
<li><?= $this->getHtml('Thursday', 'Calendar'); ?>
|
||||
<li><?= $this->getHtml('Friday', 'Calendar'); ?>
|
||||
<li><?= $this->getHtml('Saturday', 'Calendar'); ?>
|
||||
</ul>
|
||||
<?php $current = $this->calendar->getDate()->getMonthCalendar(0); $isActiveMonth = false;
|
||||
for($i = 0; $i < 6; $i++) : ?>
|
||||
<ul class="days">
|
||||
<?php for($j = 0; $j < 7; $j++) :
|
||||
$isActiveMonth = ((int) $current[$i*7+$j]->format('d') === 1) ? !$isActiveMonth : $isActiveMonth;
|
||||
?>
|
||||
<?php if($isActiveMonth) :?>
|
||||
<li class="day<?= $this->calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
|
||||
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
|
||||
<?php else: ?>
|
||||
<li class="day other-month<?= $this->calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
|
||||
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endfor;?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -5,8 +5,8 @@ $calendar = $this->getData('calendar');
|
|||
<div class="col-xs-12 col-md-9">
|
||||
<div class="box wf-100">
|
||||
<ul class="btns floatLeft">
|
||||
<li><a href="<?= htmlspecialchars(\phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/calendar/dashboard?date=' . $calendar->getDate()->createModify(0, -1, 0)->format('Y-m-d')), ENT_COMPAT, 'utf-8'); ?>"><i class="fa fa-arrow-left"></i></a>
|
||||
<li><a href="<?= htmlspecialchars(\phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/calendar/dashboard?date=' . $calendar->getDate()->createModify(0, 1, 0)->format('Y-m-d')), ENT_COMPAT, 'utf-8'); ?>"><i class="fa fa-arrow-right"></i></a>
|
||||
<li><a href="<?= $this->printHtml(\phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/calendar/dashboard?date=' . $calendar->getDate()->createModify(0, -1, 0)->format('Y-m-d'))); ?>"><i class="fa fa-arrow-left"></i></a>
|
||||
<li><a href="<?= $this->printHtml(\phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/calendar/dashboard?date=' . $calendar->getDate()->createModify(0, 1, 0)->format('Y-m-d'))); ?>"><i class="fa fa-arrow-right"></i></a>
|
||||
</ul>
|
||||
<ul class="btns floatRight">
|
||||
<li><a href=""><?= $this->getHtml('Day'); ?></a>
|
||||
|
|
@ -48,8 +48,8 @@ $calendar = $this->getData('calendar');
|
|||
<?php
|
||||
$events = $calendar->getEventByDate($current[$i*7+$j]);
|
||||
foreach($events as $event) : ?>
|
||||
<div id="event-tag-<?= htmlspecialchars($event->getId(), ENT_COMPAT, 'utf-8'); ?>" class="event">
|
||||
<div class="event-desc"><?= htmlspecialchars($event->getName(), ENT_COMPAT, 'utf-8'); ?></div>
|
||||
<div id="event-tag-<?= $this->printHtml($event->getId()); ?>" class="event">
|
||||
<div class="event-desc"><?= $this->printHtml($event->getName()); ?></div>
|
||||
<div class="event-time">2:00pm to 5:00pm</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -1,37 +1,17 @@
|
|||
<?php
|
||||
$calendar = $this->getData('calendar');
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
?>
|
||||
<div id="calendar" class="m-calendar m-calendar-mini col-xs-12 col-md-6" draggable="true" data-action='[
|
||||
{
|
||||
"listener": "click", "selector": "#calendar span.tag", "action": [
|
||||
{"key": 1, "type": "dom.popup", "tpl": "calendar-event-popup-tpl", "aniIn": "fadeIn"}
|
||||
]
|
||||
}
|
||||
]'>
|
||||
<ul class="weekdays green">
|
||||
<li><?= $this->getHtml('Sunday'); ?>
|
||||
<li><?= $this->getHtml('Monday'); ?>
|
||||
<li><?= $this->getHtml('Tuesday'); ?>
|
||||
<li><?= $this->getHtml('Wednesday'); ?>
|
||||
<li><?= $this->getHtml('Thursday'); ?>
|
||||
<li><?= $this->getHtml('Friday'); ?>
|
||||
<li><?= $this->getHtml('Saturday'); ?>
|
||||
</ul>
|
||||
<?php $current = $calendar->getDate()->getMonthCalendar(0); $isActiveMonth = false;
|
||||
for($i = 0; $i < 6; $i++) : ?>
|
||||
<ul class="days">
|
||||
<?php for($j = 0; $j < 7; $j++) :
|
||||
$isActiveMonth = ((int) $current[$i*7+$j]->format('d') === 1) ? !$isActiveMonth : $isActiveMonth;
|
||||
?>
|
||||
<?php if($isActiveMonth) :?>
|
||||
<li class="day<?= $calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
|
||||
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
|
||||
<?php else: ?>
|
||||
<li class="day other-month<?= $calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
|
||||
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endfor;?>
|
||||
<div id="calendar" class="ol-xs-12 col-md-6" draggable="true">
|
||||
<?= $this->getData('calendar')->render($this->getData('cal')); ?>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user