diff --git a/Admin/Activate.php b/Admin/Activate.php index a9fed10..f4ddc92 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Calendar\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\ActivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Activate extends ActivateAbstract /** * {@inheritdoc} */ - public static function activate(Pool $dbPool, InfoManager $info) + public static function activate(DatabasePool $dbPool, InfoManager $info) { parent::activate($dbPool, $info); } diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index eb36027..10dddd5 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Calendar\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\DeactivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Deactivate extends DeactivateAbstract /** * {@inheritdoc} */ - public static function deactivate(Pool $dbPool, InfoManager $info) + public static function deactivate(DatabasePool $dbPool, InfoManager $info) { parent::deactivate($dbPool, $info); } diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 21b15a3..92a472a 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -14,7 +14,7 @@ * @link http://orange-management.com */ namespace Modules\Calendar\Admin\Install; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; /** * Navigation class. @@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool; */ class Navigation { - public static function install(Pool $dbPool) + public static function install(string $path, DatabasePool $dbPool) { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Admin/Installer.php b/Admin/Installer.php index ff31264..28e8571 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Calendar\Admin; use phpOMS\DataStorage\Database\DatabaseType; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InfoManager; use phpOMS\Module\InstallerAbstract; @@ -37,9 +37,9 @@ class Installer extends InstallerAbstract /** * {@inheritdoc} */ - public static function install(Pool $dbPool, InfoManager $info) + public static function install(string $path, DatabasePool $dbPool, InfoManager $info) { - parent::install($dbPool, $info); + parent::install($path, $dbPool, $info); switch ($dbPool->get('core')->getType()) { case DatabaseType::MYSQL: @@ -75,7 +75,7 @@ class Installer extends InstallerAbstract $dbPool->get('core')->con->prepare( 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'calendar_permission` - ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_permission_ibfk_2` FOREIGN KEY (`calendar_permission_calendar`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar` (`calendar_id`);' + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'calendar_permission_ibfk_1` FOREIGN KEY (`calendar_permission_calendar`) REFERENCES `' . $dbPool->get('core')->prefix . 'calendar` (`calendar_id`);' )->execute(); $dbPool->get('core')->con->prepare( @@ -93,10 +93,16 @@ class Installer extends InstallerAbstract `schedule_end` datetime DEFAULT NULL, `schedule_created_at` datetime NOT NULL, `schedule_created_by` int(11) NOT NULL, - PRIMARY KEY (`schedule_id`) + PRIMARY KEY (`schedule_id`), + KEY `schedule_created_by` (`schedule_created_by`) )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`);' + )->execute(); + $dbPool->get('core')->con->prepare( 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'calendar_event` ( `calendar_event_id` int(11) NOT NULL AUTO_INCREMENT, diff --git a/Admin/Uninstall.php b/Admin/Uninstall.php index 2f84f6b..7bacf36 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Calendar\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\DataStorage\Database\Schema\Builder; use phpOMS\Module\UninstallAbstract; @@ -37,7 +37,7 @@ class Uninstall extends UninstallAbstract /** * {@inheritdoc} */ - public static function uninstall(Pool $dbPool, InfoManager $info) + public static function uninstall(DatabasePool $dbPool, InfoManager $info) { parent::uninstall($dbPool, $info); diff --git a/Admin/Update.php b/Admin/Update.php index 7f4a6e2..ab7048d 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -16,7 +16,7 @@ namespace Modules\Calendar\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\UpdateAbstract; use phpOMS\System\File\Directory; @@ -37,7 +37,7 @@ class Update extends UpdateAbstract /** * {@inheritdoc} */ - public static function update(Pool $dbPool, array $info) + public static function update(DatabasePool $dbPool, array $info) { Directory::deletePath(__DIR__ . '/Update'); mkdir('Update'); diff --git a/Controller.php b/Controller.php index 514650b..0c35341 100644 --- a/Controller.php +++ b/Controller.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -47,7 +47,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_PATH = __DIR__; + /* public */ const MODULE_PATH = __DIR__; /** * Module version. @@ -55,7 +55,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_VERSION = '1.0.0'; + /* public */ const MODULE_VERSION = '1.0.0'; /** * Module name. @@ -63,7 +63,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_NAME = 'Calendar'; + /* public */ const MODULE_NAME = 'Calendar'; /** * Providing. diff --git a/Models/AcceptStatus.php b/Models/AcceptStatus.php index dc60415..d0cca10 100644 --- a/Models/AcceptStatus.php +++ b/Models/AcceptStatus.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,7 +30,7 @@ use phpOMS\Datatypes\Enum; */ abstract class AcceptStatus extends Enum { - const ACCEPTED = 0; + /* public */ const ACCEPTED = 0; - const DENIED = 1; + /* public */ const DENIED = 1; } diff --git a/Models/AvailableStatus.php b/Models/AvailableStatus.php index 1bd36ef..e6a753a 100644 --- a/Models/AvailableStatus.php +++ b/Models/AvailableStatus.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,9 +30,9 @@ use phpOMS\Datatypes\Enum; */ abstract class AvailableStatus extends Enum { - const AVAILABLE = 0; + /* public */ const AVAILABLE = 0; - const BUSY = 1; + /* public */ const BUSY = 1; - const AWAY = 2; + /* public */ const AWAY = 2; } diff --git a/Models/Calendar.php b/Models/Calendar.php index 2f7f0b0..57c30bb 100644 --- a/Models/Calendar.php +++ b/Models/Calendar.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/CalendarMapper.php b/Models/CalendarMapper.php index 4e8b5b5..dcb685f 100644 --- a/Models/CalendarMapper.php +++ b/Models/CalendarMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -34,9 +34,9 @@ use phpOMS\DataStorage\Database\RelationType; class CalendarMapper extends DataMapperAbstract { /** - * Class name for . + * Class name. * - * @var array + * @var string * @since 1.0.0 */ protected static $CLASS = __CLASS__; @@ -44,7 +44,7 @@ class CalendarMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ @@ -59,13 +59,12 @@ class CalendarMapper extends DataMapperAbstract /** * Has many relation. * - * @var array + * @var array * @since 1.0.0 */ protected static $hasMany = [ 'events' => [ 'mapper' => EventMapper::class, - 'relationmapper' => EventMapper::class, 'table' => 'calendar_event', 'dst' => 'calendar_event_calendar', 'src' => null, diff --git a/Models/Event.php b/Models/Event.php index 0b9699e..da69ceb 100644 --- a/Models/Event.php +++ b/Models/Event.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/EventMapper.php b/Models/EventMapper.php index dec12bb..4b63357 100644 --- a/Models/EventMapper.php +++ b/Models/EventMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -37,7 +37,7 @@ class EventMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ @@ -56,10 +56,10 @@ class EventMapper extends DataMapperAbstract /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ - protected static $hasOne = [ + protected static $ownsOne = [ 'schedule' => [ 'mapper' => ScheduleMapper::class, 'src' => 'calendar_event_schedule', diff --git a/Models/EventStatus.php b/Models/EventStatus.php index 399861a..772c65d 100644 --- a/Models/EventStatus.php +++ b/Models/EventStatus.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,5 +30,5 @@ use phpOMS\Datatypes\Enum; */ abstract class EventStatus extends Enum { - const ACTIVE = 1; + /* public */ const ACTIVE = 1; } diff --git a/Models/EventTemplate.php b/Models/EventTemplate.php index 81f073f..a3e7911 100644 --- a/Models/EventTemplate.php +++ b/Models/EventTemplate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/EventType.php b/Models/EventType.php index 5a9bc3d..ee70765 100644 --- a/Models/EventType.php +++ b/Models/EventType.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,7 +30,7 @@ use phpOMS\Datatypes\Enum; */ abstract class EventType extends Enum { - const TEMPLATE = 1; + /* public */ const TEMPLATE = 1; - const SINGLE = 2; + /* public */ const SINGLE = 2; } diff --git a/Models/FrequencyInterval.php b/Models/FrequencyInterval.php index d4ca6ea..95a0826 100644 --- a/Models/FrequencyInterval.php +++ b/Models/FrequencyInterval.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,14 +30,14 @@ use phpOMS\Datatypes\Enum; */ abstract class FrequencyInterval extends Enum { - const SUNDAY = 1; - const MONDAY = 2; - const TUESDAY = 4; - const WEDNESDAY = 8; - const THURSDAY = 16; - const FRIDAY = 32; - const SATURDAY = 64; - const DAY = 128; - const WEEKDAY = 256; - const WEEKENDDAY = 512; + /* public */ const SUNDAY = 1; + /* public */ const MONDAY = 2; + /* public */ const TUESDAY = 4; + /* public */ const WEDNESDAY = 8; + /* public */ const THURSDAY = 16; + /* public */ const FRIDAY = 32; + /* public */ const SATURDAY = 64; + /* public */ const DAY = 128; + /* public */ const WEEKDAY = 256; + /* public */ const WEEKENDDAY = 512; } diff --git a/Models/FrequencyRelative.php b/Models/FrequencyRelative.php index 9f6754f..a1a5bf1 100644 --- a/Models/FrequencyRelative.php +++ b/Models/FrequencyRelative.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,13 +30,13 @@ use phpOMS\Datatypes\Enum; */ abstract class FrequencyRelative extends Enum { - const FIRST = 1; + /* public */ const FIRST = 1; - const SECOND = 2; + /* public */ const SECOND = 2; - const THIRD = 4; + /* public */ const THIRD = 4; - const FOURTH = 8; + /* public */ const FOURTH = 8; - const LAST = 64; + /* public */ const LAST = 64; } diff --git a/Models/FrequencyType.php b/Models/FrequencyType.php index 11ca3c2..6cb1fc3 100644 --- a/Models/FrequencyType.php +++ b/Models/FrequencyType.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,13 +30,13 @@ use phpOMS\Datatypes\Enum; */ abstract class FrequencyType extends Enum { - const ONCE = 1; + /* public */ const ONCE = 1; - const DAILY = 2; + /* public */ const DAILY = 2; - const WEEKLY = 4; + /* public */ const WEEKLY = 4; - const MONTHLY = 8; + /* public */ const MONTHLY = 8; - const YEARLY = 16; + /* public */ const YEARLY = 16; } diff --git a/Models/IntervalType.php b/Models/IntervalType.php index 87c0459..6fa0930 100644 --- a/Models/IntervalType.php +++ b/Models/IntervalType.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,7 +30,7 @@ use phpOMS\Datatypes\Enum; */ abstract class IntervalType extends Enum { - const ABSOLUTE = 1; + /* public */ const ABSOLUTE = 1; - const RELATIVE = 2; + /* public */ const RELATIVE = 2; } diff --git a/Models/NullCalendar.php b/Models/NullCalendar.php index a659956..2904231 100644 --- a/Models/NullCalendar.php +++ b/Models/NullCalendar.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullEvent.php b/Models/NullEvent.php index e77a264..abc5248 100644 --- a/Models/NullEvent.php +++ b/Models/NullEvent.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullSchedule.php b/Models/NullSchedule.php new file mode 100644 index 0000000..3bf1d01 --- /dev/null +++ b/Models/NullSchedule.php @@ -0,0 +1,31 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Calendar\Models; + +/** + * Schedule class. + * + * @category Calendar + * @package Modules + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class NullSchedule extends Schedule +{ +} diff --git a/Models/Schedule.php b/Models/Schedule.php index 6c34965..67bc070 100644 --- a/Models/Schedule.php +++ b/Models/Schedule.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/ScheduleMapper.php b/Models/ScheduleMapper.php index 5fa5395..993178d 100644 --- a/Models/ScheduleMapper.php +++ b/Models/ScheduleMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -37,7 +37,7 @@ class ScheduleMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ diff --git a/Models/ScheduleStatus.php b/Models/ScheduleStatus.php index b90b5c8..9734714 100644 --- a/Models/ScheduleStatus.php +++ b/Models/ScheduleStatus.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD @@ -30,6 +30,6 @@ use phpOMS\Datatypes\Enum; */ abstract class ScheduleStatus extends Enum { - const ACTIVE = 1; - const INACTIVE = 1; + /* public */ const ACTIVE = 1; + /* public */ const INACTIVE = 1; } diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index b79eb56..17b9e61 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/api.en.lang.php b/Theme/Backend/Lang/api.en.lang.php index 4f9f946..afe845f 100644 --- a/Theme/Backend/Lang/api.en.lang.php +++ b/Theme/Backend/Lang/api.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index b8b2849..b69a962 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/calendar-dashboard.tpl.php b/Theme/Backend/calendar-dashboard.tpl.php index 2c21033..3f4ad3b 100644 --- a/Theme/Backend/calendar-dashboard.tpl.php +++ b/Theme/Backend/calendar-dashboard.tpl.php @@ -23,7 +23,7 @@ $calendar = $this->getData('calendar'); getDate()->getFirstDayOfMonth() <= $i*7+$j+1 && $calendar->getDate()->getDaysOfMonth() >= $i*7+$j+1) { echo ($i*7+$j+1) . ' ' . jddayofweek($j, 1); } else { - echo (($i*7+$j+1)-$calendar->getDate()->getDaysOfMonth()) . ' ' . jddayofweek($j, 1); + echo $current->createModify(0, 0, -2)->format('d') . ' ' . jddayofweek($j, 1); } ?>
    getData('calendar'); getDate()->getFirstDayOfMonth() <= $i*7+$j+1 && $calendar->getDate()->getDaysOfMonth() >= $i*7+$j+1) { echo ($i*7+$j+1) . ' ' . jddayofweek($j, 1); } else { - echo (($i*7+$j+1)-$calendar->getDate()->getDaysOfMonth()) . ' ' . jddayofweek($j, 1); + echo $current->createModify(0, 0, -2)->format('d') . ' ' . jddayofweek($j, 1); } ?>