@@ -434,6 +434,8 @@ public function schedule_action($resource_id, $termin_id)
434
434
435
435
$ this ->schedule ($ resource_id , $ termin_id , $ this ->course_id );
436
436
437
+ $ this ->sendRecordingNotifications ($ this ->course_id );
438
+
437
439
$ this ->redirect ('course/scheduler?semester_filter= ' . Request::option ('semester_filter ' ));
438
440
}
439
441
@@ -630,6 +632,10 @@ public function bulkschedule_action()
630
632
}
631
633
}
632
634
635
+ if ($ action == 'create ' ) {
636
+ $ this ->sendRecordingNotifications ($ this ->course_id );
637
+ }
638
+
633
639
$ this ->redirect ('course/scheduler?semester_filter= ' . Request::option ('semester_filter ' ));
634
640
}
635
641
@@ -642,26 +648,6 @@ public function schedule($resource_id, $termin_id, $course_id)
642
648
$ scheduler_client = SchedulerClient::getInstance (OCConfig::getConfigIdForCourse ($ course_id ));
643
649
644
650
if ($ scheduler_client ->scheduleEventForSeminar ($ course_id , $ resource_id , $ termin_id )) {
645
- $ course = Course::find ($ course_id );
646
- $ members = $ course ->members ;
647
- $ users = [];
648
-
649
- foreach ($ members as $ member ) {
650
- $ users [] = $ member ->user_id ;
651
- }
652
-
653
- $ notification = sprintf (
654
- $ this ->_ ('Die Veranstaltung "%s" wird für Sie mit Bild und Ton automatisiert aufgezeichnet. ' ),
655
- htmlReady ($ course ->name )
656
- );
657
- PersonalNotifications::add (
658
- $ users ,
659
- $ this ->url_for ('course/index ' , ['cid ' => $ course_id ]),
660
- $ notification ,
661
- $ course_id ,
662
- Icon::create ($ this ->plugin ->getPluginUrl () . '/images/opencast-black.svg ' )
663
- );
664
-
665
651
StudipLog::log ('OC_SCHEDULE_EVENT ' , $ termin_id , $ course_id );
666
652
667
653
PageLayout::postSuccess (
@@ -710,6 +696,29 @@ public function updateschedule($resource_id, $termin_id, $course_id)
710
696
}
711
697
}
712
698
699
+ private function sendRecordingNotifications ($ course_id )
700
+ {
701
+ $ course = Course::find ($ course_id );
702
+ $ members = $ course ->members ;
703
+ $ users = [];
704
+
705
+ foreach ($ members as $ member ) {
706
+ $ users [] = $ member ->user_id ;
707
+ }
708
+
709
+ $ notification = sprintf (
710
+ $ this ->_ ('Die Veranstaltung "%s" wird für Sie mit Bild und Ton automatisiert aufgezeichnet. ' ),
711
+ htmlReady ($ course ->name )
712
+ );
713
+ PersonalNotifications::add (
714
+ $ users ,
715
+ $ this ->url_for ('course/index ' , ['cid ' => $ course_id ]),
716
+ $ notification ,
717
+ $ course_id ,
718
+ Icon::create ($ this ->plugin ->getPluginUrl () . '/images/opencast-black.svg ' )
719
+ );
720
+ }
721
+
713
722
public function unschedule ($ resource_id , $ termin_id , $ course_id )
714
723
{
715
724
$ scheduled = OCModel::checkScheduledRecording ($ course_id , $ resource_id , $ termin_id );
0 commit comments