mirror of
https://github.com/Karaka-Management/oms-Calendar.git
synced 2026-02-05 11:18:41 +00:00
Fixing hasOne schedule bugs
This commit is contained in:
parent
a6ef9561af
commit
6179700b03
|
|
@ -90,8 +90,8 @@ class Installer extends InstallerAbstract
|
|||
`schedule_start` datetime NOT NULL,
|
||||
`schedule_duration` int(11) NOT NULL,
|
||||
`schedule_end` datetime DEFAULT NULL,
|
||||
`scheule_created_at` datetime NOT NULL,
|
||||
`scheule_created_by` int(11) NOT NULL,
|
||||
`schedule_created_at` datetime NOT NULL,
|
||||
`schedule_created_by` int(11) NOT NULL,
|
||||
PRIMARY KEY (`schedule_id`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
|
@ -102,6 +102,7 @@ class Installer extends InstallerAbstract
|
|||
`calendar_event_name` varchar(25) NOT NULL,
|
||||
`calendar_event_description` varchar(255) NOT NULL,
|
||||
`calendar_event_status` tinyint(1) NOT NULL,
|
||||
`calendar_event_type` tinyint(1) NOT NULL,
|
||||
`calendar_event_location` varchar(511) NOT NULL,
|
||||
`calendar_event_created_by` int(11) NOT NULL,
|
||||
`calendar_event_created_at` datetime NOT NULL,
|
||||
|
|
@ -109,6 +110,7 @@ class Installer extends InstallerAbstract
|
|||
`calendar_event_calendar` int(11) NOT NULL,
|
||||
PRIMARY KEY (`calendar_event_id`),
|
||||
KEY `calendar_event_created_by` (`calendar_event_created_by`),
|
||||
KEY `calendar_event_schedule` (`calendar_event_schedule`),
|
||||
KEY `calendar_event_calendar` (`calendar_event_calendar`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
|
@ -116,7 +118,7 @@ class Installer extends InstallerAbstract
|
|||
$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_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`);'
|
||||
)->execute();
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class Uninstall extends UninstallAbstract
|
|||
$query->prefix($dbPool->get('core')->getPrefix())->drop(
|
||||
'calendar_event_participant',
|
||||
'calendar_event',
|
||||
'schedule',
|
||||
'calendar_permission',
|
||||
'calendar'
|
||||
);
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ class ScheduleMapper extends DataMapperAbstract
|
|||
'schedule_start' => ['name' => 'schedule_start', 'type' => 'DateTime', 'internal' => 'start'],
|
||||
'schedule_duration' => ['name' => 'schedule_duration', 'type' => 'int', 'internal' => 'duration'],
|
||||
'schedule_end' => ['name' => 'schedule_end', 'type' => 'DateTime', 'internal' => 'end'],
|
||||
'scheule_created_at' => ['name' => 'scheule_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
'scheule_created_by' => ['name' => 'scheule_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
'schedule_created_at' => ['name' => 'schedule_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
'schedule_created_by' => ['name' => 'schedule_created_by', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -108,11 +108,11 @@ class ScheduleMapper extends DataMapperAbstract
|
|||
'account_permission_p'
|
||||
)
|
||||
->into('account_permission')
|
||||
->values($obj->getCreatedBy(), 'calendar', 'calendar', 1, $objId, 1, 1, 1, 1, 1);
|
||||
->values($obj->getCreatedBy(), 'schedule', 'schedule', 1, $objId, 1, 1, 1, 1, 1);
|
||||
|
||||
$this->db->con->prepare($query->toSql())->execute();
|
||||
} catch (\Exception $e) {
|
||||
var_dump($e);
|
||||
var_dump($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user