Skip to content
Snippets Groups Projects
Commit 63df1d7e authored by David Siegfried's avatar David Siegfried Committed by Elmar Ludwig
Browse files

use sorm-relations, refs #707

Merge request studip/studip!662
parent 9740e362
No related branches found
No related tags found
No related merge requests found
......@@ -1354,7 +1354,7 @@ class Course_TimesroomsController extends AuthenticatedController
/**
* Deletes a date.
*
* @param String $termin CourseDate of the date
* @param CourseDate $termin CourseDate of the date
* @param String $cancel_comment cancel mesessage (if non empty)
*
* @return CourseDate|CourseExDate deleted date
......@@ -1362,7 +1362,6 @@ class Course_TimesroomsController extends AuthenticatedController
private function deleteDate($termin, $cancel_comment)
{
$seminar_id = $termin->range_id;
$termin_id = $termin->id;
$termin_room = $termin->getRoomName();
$termin_date = $termin->getFullname();
$has_topics = $termin->topics->count();
......@@ -1378,12 +1377,6 @@ class Course_TimesroomsController extends AuthenticatedController
} else {
if ($termin->delete()) {
StudipLog::log("SEM_DELETE_SINGLEDATE", $termin->id, $seminar_id, 'appointment cancelled');
// delete attached resource request appointments if they exist
ResourceRequestAppointment::deleteBySQL(
"appointment_id = ?",
[$termin_id]
);
}
}
......
......@@ -100,6 +100,11 @@ class CourseDate extends SimpleORMap implements PrivacyObject
'assoc_foreign_key' => 'termin_id',
'on_delete' => 'delete',
];
$config['has_many']['resource_request_appointments'] = [
'class_name' => ResourceRequestAppointment::class,
'assoc_foreign_key' => 'appointment_id',
'on_delete' => 'delete',
];
$config['default_values']['date_typ'] = 1;
parent::configure($config);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment