Minor - Plugins - Zoom - fix course add/delete recording to course

BT#17288
pull/3446/head
Julio Montoya 5 years ago
parent 30d31f7544
commit 2bc2fd7aab
  1. 8
      main/inc/lib/plugin.class.php
  2. 1
      plugin/zoom/Entity/Meeting.php
  3. 5
      plugin/zoom/Entity/MeetingActivity.php
  4. 4
      plugin/zoom/Entity/Recording.php
  5. 13
      plugin/zoom/lib/ZoomPlugin.php

@ -475,7 +475,7 @@ class Plugin
*
* @return bool|null False on error, null otherwise
*/
public function install_course_fields($courseId, $add_tool_link = true)
public function install_course_fields($courseId, $add_tool_link = true, $iconName = '')
{
$plugin_name = $this->get_name();
$t_course = Database::get_course_table(TABLE_COURSE_SETTING);
@ -552,7 +552,7 @@ class Plugin
}
// Add an icon in the table tool list
$this->createLinkToCourseTool($plugin_name, $courseId);
$this->createLinkToCourseTool($plugin_name, $courseId, $iconName);
}
/**
@ -606,14 +606,14 @@ class Plugin
*
* @param bool $add_tool_link Whether we want to add a plugin link on the course homepage
*/
public function install_course_fields_in_all_courses($add_tool_link = true)
public function install_course_fields_in_all_courses($add_tool_link = true, $iconName = '')
{
// Update existing courses to add plugin settings
$table = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id FROM $table ORDER BY id";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$this->install_course_fields($row['id'], $add_tool_link);
$this->install_course_fields($row['id'], $add_tool_link, $iconName);
}
}

@ -131,6 +131,7 @@ class Meeting
/**
* @var Recording[]|ArrayCollection
*
* @ORM\OneToMany(targetEntity="Recording", mappedBy="meeting", cascade={"persist"}, orphanRemoval=true)
*/
protected $recordings;

@ -26,6 +26,7 @@ class MeetingActivity
/**
* @var Meeting
*
* @ORM\ManyToOne(targetEntity="Meeting", inversedBy="activities")
* @ORM\JoinColumn(name="meeting_id")
*/
@ -33,6 +34,7 @@ class MeetingActivity
/**
* @var Meeting
*
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
@ -40,18 +42,21 @@ class MeetingActivity
/**
* @var string
*
* @ORM\Column(type="string", name="name", length=255, nullable=false)
*/
protected $name;
/**
* @var string
*
* @ORM\Column(type="string", name="type", length=255, nullable=false)
*/
protected $type;
/**
* @var string
*
* @ORM\Column(type="text", name="event", nullable=true)
*/
protected $event;

@ -40,6 +40,7 @@ class Recording
/**
* @var string
*
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue()
@ -48,12 +49,14 @@ class Recording
/**
* @var string
*
* @ORM\Column(type="string")
*/
protected $uuid;
/**
* @var Meeting
*
* @ORM\ManyToOne(targetEntity="Meeting", inversedBy="recordings")
* @ORM\JoinColumn(name="meeting_id")
*/
@ -61,6 +64,7 @@ class Recording
/**
* @var string
*
* @ORM\Column(type="text", name="recording_meeting_json", nullable=true)
*/
protected $recordingMeetingJson;

@ -123,7 +123,7 @@ class ZoomPlugin extends Plugin
$items[] = [
'class' => 'video-conference',
'icon' => Display::return_icon(
'zoom.png',
'bbb.png',
get_lang('VideoConference')
),
'link' => $link,
@ -450,10 +450,12 @@ class ZoomPlugin extends Plugin
if (!$meeting->getRecordings()->isEmpty()) {
$fileIdSelect = $form->addSelect('fileIds', get_lang('Files'));
$fileIdSelect->setMultiple(true);
foreach ($meeting->getRecordings() as &$recording) {
$recordingList = $meeting->getRecordings();
foreach ($recordingList as &$recording) {
// $recording->instanceDetails = $plugin->getPastMeetingInstanceDetails($instance->uuid);
$options = [];
foreach ($recording->getRecordingMeeting()->recording_files as $file) {
$recordings = $recording->getRecordingMeeting()->recording_files;
foreach ($recordings as $file) {
$options[] = [
'text' => sprintf(
'%s.%s (%s)',
@ -482,8 +484,9 @@ class ZoomPlugin extends Plugin
);
$form->addButtonUpdate($this->get_lang('DoIt'));
if ($form->validate()) {
foreach ($meeting->getRecordings() as $recording) {
foreach ($recording->files as $file) {
foreach ($recordingList as $recording) {
$recordings = $recording->getRecordingMeeting()->recording_files;
foreach ($recordings as $file) {
if (in_array($file->id, $form->getSubmitValue('fileIds'))) {
$name = sprintf(
$this->get_lang('XRecordingOfMeetingXFromXDurationXDotX'),

Loading…
Cancel
Save