Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	Draw/Controller.js
#	Draw/Models/DrawType.enum.js
#	Draw/Models/Editor.js
#	Media/Models/UploadFile.php
This commit is contained in:
Dennis Eichhorn 2017-01-26 16:42:29 +01:00
commit 286a9c24fe
34 changed files with 128 additions and 92 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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');

View File

@ -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.

View File

@ -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;
}

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -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<string, array>
* @var string
* @since 1.0.0
*/
protected static $CLASS = __CLASS__;
@ -44,7 +44,7 @@ class CalendarMapper extends DataMapperAbstract
/**
* Columns.
*
* @var array<string, array>
* @var array
* @since 1.0.0
*/
protected static $columns = [
@ -59,13 +59,12 @@ class CalendarMapper extends DataMapperAbstract
/**
* Has many relation.
*
* @var array<string, 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,

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -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<string, array>
* @var array
* @since 1.0.0
*/
protected static $columns = [
@ -56,10 +56,10 @@ class EventMapper extends DataMapperAbstract
/**
* Has one relation.
*
* @var array<string, array>
* @var array
* @since 1.0.0
*/
protected static $hasOne = [
protected static $ownsOne = [
'schedule' => [
'mapper' => ScheduleMapper::class,
'src' => 'calendar_event_schedule',

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

31
Models/NullSchedule.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @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\Calendar\Models;
/**
* Schedule class.
*
* @category Calendar
* @package Modules
* @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 NullSchedule extends Schedule
{
}

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -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<string, array>
* @var array
* @since 1.0.0
*/
protected static $columns = [

View File

@ -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;
}

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -23,7 +23,7 @@ $calendar = $this->getData('calendar');
<?php if($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);
} ?>
<ul>
<?php

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -2,7 +2,7 @@
/**
* Orange Management
*
* PHP Version 7.0
* PHP Version 7.1
*
* @category TBD
* @package TBD

View File

@ -23,7 +23,7 @@ $calendar = $this->getData('calendar');
<?php if($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);
} ?>
<ul>
<?php