Minor - Plugin: zoom fix entities, fix recording links BT#17288

pull/3425/head
Julio Montoya 5 years ago
parent 3b3da50442
commit d79a8c403d
  1. 5
      plugin/zoom/Entity/MeetingEntity.php
  2. 5
      plugin/zoom/Entity/RecordingEntity.php
  3. 22
      plugin/zoom/lib/ZoomPlugin.php
  4. 2
      plugin/zoom/meetings.php
  5. 9
      plugin/zoom/view/list.tpl
  6. 10
      plugin/zoom/view/meeting.tpl

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

@ -54,10 +54,7 @@ class RecordingEntity
/**
* @var MeetingEntity
* @ORM\ManyToOne(
* targetEntity="MeetingEntity",
* inversedBy="recordings",
* )
* @ORM\ManyToOne(targetEntity="MeetingEntity", inversedBy="recordings")
* @ORM\JoinColumn(name="meeting_id")
*/
protected $meeting;

@ -290,29 +290,31 @@ class ZoomPlugin extends Plugin
/**
* Generates a meeting edit form and updates the meeting on validation.
*
* @param MeetingEntity $meetingEntity the meeting
* @param MeetingEntity $meeting the meeting
*
* @throws Exception
*
* @return FormValidator
*/
public function getEditMeetingForm($meetingEntity)
public function getEditMeetingForm($meeting)
{
$meetingInfoGet = $meetingEntity->getMeetingInfoGet();
$meetingInfoGet = $meeting->getMeetingInfoGet();
$form = new FormValidator('edit', 'post', $_SERVER['REQUEST_URI']);
$form->addHeader($this->get_lang('UpdateMeeting'));
$form->addText('topic', $this->get_lang('Topic'));
if ($meetingEntity->requiresDateAndDuration()) {
if ($meeting->requiresDateAndDuration()) {
$startTimeDatePicker = $form->addDateTimePicker('startTime', get_lang('StartTime'));
$form->setRequired($startTimeDatePicker);
$durationNumeric = $form->addNumeric('duration', $this->get_lang('DurationInMinutes'));
$form->setRequired($durationNumeric);
}
$form->addTextarea('agenda', get_lang('Agenda'), ['maxlength' => 2000]);
$form->addLabel(get_lang('Password'), $meeting->getMeetingInfoGet()->password);
// $form->addText('password', get_lang('Password'), false, ['maxlength' => '10']);
$form->addButtonUpdate(get_lang('Update'));
if ($form->validate()) {
if ($meetingEntity->requiresDateAndDuration()) {
if ($meeting->requiresDateAndDuration()) {
$meetingInfoGet->start_time = (new DateTime($form->getSubmitValue('startTime')))->format(
DateTimeInterface::ISO8601
);
@ -323,8 +325,8 @@ class ZoomPlugin extends Plugin
$meetingInfoGet->agenda = $form->getSubmitValue('agenda');
try {
$meetingInfoGet->update();
$meetingEntity->setMeetingInfoGet($meetingInfoGet);
Database::getManager()->persist($meetingEntity);
$meeting->setMeetingInfoGet($meetingInfoGet);
Database::getManager()->persist($meeting);
Database::getManager()->flush();
Display::addFlash(
Display::return_message($this->get_lang('MeetingUpdated'), 'confirm')
@ -340,8 +342,8 @@ class ZoomPlugin extends Plugin
'topic' => $meetingInfoGet->topic,
'agenda' => $meetingInfoGet->agenda,
];
if ($meetingEntity->requiresDateAndDuration()) {
$defaults['startTime'] = $meetingEntity->startDateTime->format('Y-m-d H:i');
if ($meeting->requiresDateAndDuration()) {
$defaults['startTime'] = $meeting->startDateTime->format('Y-m-d H:i');
$defaults['duration'] = $meetingInfoGet->duration;
}
$form->setDefaults($defaults);
@ -718,7 +720,7 @@ class ZoomPlugin extends Plugin
$form->getSubmitValue('duration'),
$form->getSubmitValue('topic'),
$form->getSubmitValue('agenda'),
''
api_get_unique_id()
);
Display::addFlash(

@ -16,9 +16,7 @@ $user = api_get_user_entity(api_get_user_id());
$form = $plugin->getAdminSearchForm();
$startDate = new DateTime($form->getElement('start')->getValue());
$endDate = new DateTime($form->getElement('end')->getValue());
$scheduleForm = $plugin->getScheduleMeetingForm($user);
$tpl = new Template();
$tpl->assign('meetings', $plugin->getMeetingRepository()->periodUserMeetings($startDate, $endDate, $user));
if ('true' === $plugin->get('enableCloudRecording')) {

@ -1,3 +1,6 @@
{% import "default/document/recycle.tpl" as macro %}
{{ schedule_form }}
{{ search_form }}
@ -39,8 +42,10 @@
<ul>
{% for file in recording.recordingMeeting.recording_files %}
<li>
{{ file.recording_type }}.{{ file.file_type }}
({{ file.file_size }})
<a href="{{ file.play_url }}" target="_blank">
{{ file.recording_type }}.{{ file.file_type }}
({{ macro.bytesToSize(file.file_size) }})
</a>
</li>
{% endfor %}
</ul>

@ -19,11 +19,11 @@
{% endif %}
{% if currentUserJoinURL %}
<p>
<a href="{{ currentUserJoinURL }}" target="_blank">
{{ 'JoinMeetingAsMyself'|get_plugin_lang('ZoomPlugin') }}
</a>
</p>
{#<p>#}
{# <a href="{{ currentUserJoinURL }}" target="_blank">#}
{# {{ 'JoinMeeting'|get_plugin_lang('ZoomPlugin') }}#}
{# </a>#}
{#</p>#}
{% endif %}
{% if meeting.meetingInfoGet.settings.approval_type == 2 %}

Loading…
Cancel
Save