parent
							
								
									b4ce57cb4d
								
							
						
					
					
						commit
						e435f5220d
					
				@ -0,0 +1,176 @@ | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
namespace Chamilo\PluginBundle\Zoom; | 
				
			||||
 | 
				
			||||
use Chamilo\CoreBundle\Entity\Course; | 
				
			||||
use Chamilo\CoreBundle\Entity\CourseRelUser; | 
				
			||||
use Chamilo\CoreBundle\Entity\Session; | 
				
			||||
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; | 
				
			||||
use Chamilo\CourseBundle\Entity\CGroupInfo; | 
				
			||||
use Chamilo\PluginBundle\Zoom\API\MeetingInfoGet; | 
				
			||||
use Chamilo\PluginBundle\Zoom\API\MeetingListItem; | 
				
			||||
use Chamilo\PluginBundle\Zoom\API\MeetingSettings; | 
				
			||||
use Chamilo\UserBundle\Entity\User; | 
				
			||||
use Database; | 
				
			||||
use DateInterval; | 
				
			||||
use DateTime; | 
				
			||||
use DateTimeZone; | 
				
			||||
use Doctrine\Common\Collections\ArrayCollection; | 
				
			||||
use Doctrine\ORM\Mapping as ORM; | 
				
			||||
use Exception; | 
				
			||||
 | 
				
			||||
/** | 
				
			||||
 * Class Meeting. | 
				
			||||
 * | 
				
			||||
 * @ORM\Entity() | 
				
			||||
 * @ORM\Table(name="plugin_zoom_meeting_activity") | 
				
			||||
 * @ORM\HasLifecycleCallbacks | 
				
			||||
 */ | 
				
			||||
class MeetingActivity | 
				
			||||
{ | 
				
			||||
    /** | 
				
			||||
     * @var int | 
				
			||||
     * @ORM\Column(type="integer") | 
				
			||||
     * @ORM\Id | 
				
			||||
     * @ORM\GeneratedValue() | 
				
			||||
     */ | 
				
			||||
    protected $id; | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @var Meeting | 
				
			||||
     * @ORM\ManyToOne(targetEntity="Meeting", inversedBy="activities") | 
				
			||||
     * @ORM\JoinColumn(name="meeting_id") | 
				
			||||
     */ | 
				
			||||
    protected $meeting; | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @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; | 
				
			||||
 | 
				
			||||
    public function __construct() | 
				
			||||
    { | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @return string | 
				
			||||
     */ | 
				
			||||
    public function __toString() | 
				
			||||
    { | 
				
			||||
        return sprintf('Activity %d', $this->id); | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @return int | 
				
			||||
     */ | 
				
			||||
    public function getId() | 
				
			||||
    { | 
				
			||||
        return $this->id; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @return Meeting | 
				
			||||
     */ | 
				
			||||
    public function getMeeting() | 
				
			||||
    { | 
				
			||||
        return $this->meeting; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @param Meeting $meeting | 
				
			||||
     * | 
				
			||||
     * @return MeetingActivity | 
				
			||||
     */ | 
				
			||||
    public function setMeeting($meeting) | 
				
			||||
    { | 
				
			||||
        $this->meeting = $meeting; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @return string | 
				
			||||
     */ | 
				
			||||
    public function getName() | 
				
			||||
    { | 
				
			||||
        return $this->name; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @param string $name | 
				
			||||
     * | 
				
			||||
     * @return MeetingActivity | 
				
			||||
     */ | 
				
			||||
    public function setName($name) | 
				
			||||
    { | 
				
			||||
        $this->name = $name; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @return string | 
				
			||||
     */ | 
				
			||||
    public function getType() | 
				
			||||
    { | 
				
			||||
        return $this->type; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @param string $type | 
				
			||||
     * | 
				
			||||
     * @return MeetingActivity | 
				
			||||
     */ | 
				
			||||
    public function setType($type) | 
				
			||||
    { | 
				
			||||
        $this->type = $type; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @return string | 
				
			||||
     */ | 
				
			||||
    public function getEvent() | 
				
			||||
    { | 
				
			||||
        return $this->event; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    public function getEventDecoded() | 
				
			||||
    { | 
				
			||||
        if (!empty($this->event)) { | 
				
			||||
            return json_decode($this->event); | 
				
			||||
        } | 
				
			||||
 | 
				
			||||
        return ''; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
    /** | 
				
			||||
     * @param string $event | 
				
			||||
     * | 
				
			||||
     * @return MeetingActivity | 
				
			||||
     */ | 
				
			||||
    public function setEvent($event) | 
				
			||||
    { | 
				
			||||
        $this->event = $event; | 
				
			||||
 | 
				
			||||
        return $this; | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
 | 
				
			||||
} | 
				
			||||
@ -0,0 +1,30 @@ | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
/* For license terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
use Chamilo\PluginBundle\Zoom\Meeting; | 
				
			||||
 | 
				
			||||
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables | 
				
			||||
 | 
				
			||||
require_once __DIR__.'/config.php'; | 
				
			||||
 | 
				
			||||
$plugin = ZoomPlugin::create(); | 
				
			||||
$tool_name = $plugin->get_lang('ZoomVideoConferences'); | 
				
			||||
$tpl = new Template($plugin->get_lang('ZoomVideoConferences')); | 
				
			||||
 | 
				
			||||
$meetingId = isset($_REQUEST['meetingId']) ? (int) $_REQUEST['meetingId'] : 0; | 
				
			||||
if (empty($meetingId)) { | 
				
			||||
    api_not_allowed(true); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$content = ''; | 
				
			||||
/** @var Meeting $meeting */ | 
				
			||||
$meeting = $plugin->getMeetingRepository()->findOneBy(['meetingId' => $meetingId]); | 
				
			||||
if (null === $meeting) { | 
				
			||||
    api_not_allowed(true); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$tpl->assign('actions', $plugin->getToolbar()); | 
				
			||||
$tpl->assign('meeting', $meeting); | 
				
			||||
$tpl->assign('content', $tpl->fetch('zoom/view/activity.tpl')); | 
				
			||||
$tpl->display_one_col_template(); | 
				
			||||
@ -1,30 +0,0 @@ | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
/* For license terms, see /license.txt */ | 
				
			||||
 | 
				
			||||
$course_plugin = 'zoom'; // needed in order to load the plugin lang variables | 
				
			||||
$cidReset = true; | 
				
			||||
 | 
				
			||||
require_once __DIR__.'/config.php'; | 
				
			||||
 | 
				
			||||
api_protect_admin_script(); | 
				
			||||
 | 
				
			||||
$plugin = ZoomPlugin::create(); | 
				
			||||
$tool_name = $plugin->get_lang('ZoomVideoConferences'); | 
				
			||||
$this_section = SECTION_PLATFORM_ADMIN; | 
				
			||||
 | 
				
			||||
$form = $plugin->getAdminSearchForm(); | 
				
			||||
$startDate = new DateTime($form->getSubmitValue('start')); | 
				
			||||
$endDate = new DateTime($form->getSubmitValue('end')); | 
				
			||||
 | 
				
			||||
$tpl = new Template($tool_name); | 
				
			||||
 | 
				
			||||
$tpl->assign('meetings', $plugin->getMeetingRepository()->periodMeetings($startDate, $endDate)); | 
				
			||||
if ('true' === $plugin->get('enableCloudRecording')) { | 
				
			||||
    $tpl->assign('recordings', $plugin->getRecordingRepository()->getPeriodRecordings($startDate, $endDate)); | 
				
			||||
} | 
				
			||||
$tpl->assign('actions', $plugin->getToolbar()); | 
				
			||||
$tpl->assign('search_form', $form->returnForm()); | 
				
			||||
$tpl->assign('type', 'admin'); | 
				
			||||
$tpl->assign('content', $tpl->fetch('zoom/view/list.tpl')); | 
				
			||||
$tpl->display_one_col_template(); | 
				
			||||
									
										
											File diff suppressed because it is too large
											Load Diff
										
									
								
							
						@ -0,0 +1,28 @@ | 
				
			||||
<h4> | 
				
			||||
    {{ meeting.typeName }} {{ meeting.meetingId }} | 
				
			||||
</h4> | 
				
			||||
 | 
				
			||||
<table class="table"> | 
				
			||||
    <thead> | 
				
			||||
    <tr> | 
				
			||||
        <th>{{ 'Name'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
        <th>{{ 'Type'|get_lang }}</th> | 
				
			||||
        <th>{{ 'Event'|get_lang }} </th> | 
				
			||||
    </tr> | 
				
			||||
    </thead> | 
				
			||||
    <tbody> | 
				
			||||
    {% for activity in meeting.activities %} | 
				
			||||
        <tr> | 
				
			||||
            <td> | 
				
			||||
                {{ activity.name }} | 
				
			||||
            </td> | 
				
			||||
            <td> | 
				
			||||
                {{ activity.type }} | 
				
			||||
            </td> | 
				
			||||
            <td> | 
				
			||||
                {{ activity.eventDecoded }} | 
				
			||||
            </td> | 
				
			||||
        </tr> | 
				
			||||
    {% endfor %} | 
				
			||||
    </tbody> | 
				
			||||
</table> | 
				
			||||
@ -1,62 +0,0 @@ | 
				
			||||
{% import "default/document/recycle.tpl" as macro %} | 
				
			||||
 | 
				
			||||
{{ schedule_form }} | 
				
			||||
{{ search_form }} | 
				
			||||
 | 
				
			||||
{% if meetings %} | 
				
			||||
    <h4>{{ 'MeetingsFound'|get_plugin_lang('ZoomPlugin') }}: </h4> | 
				
			||||
    <table class="table table-hover table-striped"> | 
				
			||||
        <thead> | 
				
			||||
            <tr> | 
				
			||||
                <th>{{ 'Topic'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
                <th>{{ 'StartTime'|get_lang }}</th> | 
				
			||||
                <th>{{ 'ForEveryone'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
{#                <th>{{ 'Course'|get_lang }}</th>#} | 
				
			||||
{#                <th>{{ 'Session'|get_lang }}</th>#} | 
				
			||||
                {% if allow_recording %} | 
				
			||||
                    <th>{{ 'Recordings'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
                {% endif %} | 
				
			||||
                <th></th> | 
				
			||||
            </tr> | 
				
			||||
        </thead> | 
				
			||||
            <tbody> | 
				
			||||
            {% for meeting in meetings %} | 
				
			||||
                <tr> | 
				
			||||
                    <td>{{ meeting.meetingInfoGet.topic }}</td> | 
				
			||||
                    <td>{{ meeting.formattedStartTime }}</td> | 
				
			||||
                    <td>{{ meeting.user ? 'No' : 'Yes' }}</td> | 
				
			||||
{#                    <td>{{ meeting.course ? meeting.course : '-' }}</td>#} | 
				
			||||
{#                    <td>{{ meeting.session ? meeting.session : '-' }}</td>#} | 
				
			||||
                    <td> | 
				
			||||
                    {% if allow_recording and meeting.recordings.count > 0 %} | 
				
			||||
                        {% for recording in meeting.recordings %} | 
				
			||||
                            <dl> | 
				
			||||
                                <dt> | 
				
			||||
                                    {{ recording.formattedStartTime }} ({{ recording.formattedDuration }}) | 
				
			||||
                                </dt> | 
				
			||||
                                <dd> | 
				
			||||
                                    <ul> | 
				
			||||
                                        {% for file in recording.recordingMeeting.recording_files %} | 
				
			||||
                                        <li> | 
				
			||||
                                                <a href="{{ file.play_url }}" target="_blank"> | 
				
			||||
                                                {{ file.recording_type }}.{{ file.file_type }} | 
				
			||||
                                                ({{ macro.bytesToSize(file.file_size) }}) | 
				
			||||
                                            </a> | 
				
			||||
                                        </li> | 
				
			||||
                                        {% endfor %} | 
				
			||||
                                    </ul> | 
				
			||||
                                </dd> | 
				
			||||
                            </dl> | 
				
			||||
                        {% endfor %} | 
				
			||||
                    {% endif %} | 
				
			||||
                    </td> | 
				
			||||
                    <td> | 
				
			||||
                        <a class="btn btn-primary" href="meeting.php?meetingId={{ meeting.meetingId }}"> | 
				
			||||
                            {{ 'Details'|get_lang }} | 
				
			||||
                        </a> | 
				
			||||
                    </td> | 
				
			||||
                </tr> | 
				
			||||
            {% endfor %} | 
				
			||||
        </tbody> | 
				
			||||
    </table> | 
				
			||||
{% endif %} | 
				
			||||
@ -0,0 +1,62 @@ | 
				
			||||
{% import "default/document/recycle.tpl" as macro %} | 
				
			||||
 | 
				
			||||
{{ schedule_form }} | 
				
			||||
{{ search_form }} | 
				
			||||
 | 
				
			||||
{% if meetings %} | 
				
			||||
    <h4>{{ 'MeetingsFound'|get_plugin_lang('ZoomPlugin') }}: </h4> | 
				
			||||
    <table class="table table-hover table-striped"> | 
				
			||||
        <thead> | 
				
			||||
            <tr> | 
				
			||||
                <th>{{ 'Topic'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
                <th>{{ 'StartTime'|get_lang }}</th> | 
				
			||||
                <th>{{ 'ForEveryone'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
{#                <th>{{ 'Course'|get_lang }}</th>#} | 
				
			||||
{#                <th>{{ 'Session'|get_lang }}</th>#} | 
				
			||||
                {% if allow_recording %} | 
				
			||||
                    <th>{{ 'Recordings'|get_plugin_lang('ZoomPlugin') }}</th> | 
				
			||||
                {% endif %} | 
				
			||||
                <th></th> | 
				
			||||
            </tr> | 
				
			||||
        </thead> | 
				
			||||
        <tbody> | 
				
			||||
        {% for meeting in meetings %} | 
				
			||||
            <tr> | 
				
			||||
                <td>{{ meeting.meetingInfoGet.topic }}</td> | 
				
			||||
                <td>{{ meeting.formattedStartTime }}</td> | 
				
			||||
                <td>{{ meeting.user ? 'No' : 'Yes' }}</td> | 
				
			||||
{#                    <td>{{ meeting.course ? meeting.course : '-' }}</td>#} | 
				
			||||
{#                    <td>{{ meeting.session ? meeting.session : '-' }}</td>#} | 
				
			||||
                <td> | 
				
			||||
                {% if allow_recording and meeting.recordings.count > 0 %} | 
				
			||||
                    {% for recording in meeting.recordings %} | 
				
			||||
                        <dl> | 
				
			||||
                            <dt> | 
				
			||||
                                {{ recording.formattedStartTime }} ({{ recording.formattedDuration }}) | 
				
			||||
                            </dt> | 
				
			||||
                            <dd> | 
				
			||||
                                <ul> | 
				
			||||
                                    {% for file in recording.recordingMeeting.recording_files %} | 
				
			||||
                                    <li> | 
				
			||||
                                            <a href="{{ file.play_url }}" target="_blank"> | 
				
			||||
                                            {{ file.recording_type }}.{{ file.file_type }} | 
				
			||||
                                            ({{ macro.bytesToSize(file.file_size) }}) | 
				
			||||
                                        </a> | 
				
			||||
                                    </li> | 
				
			||||
                                    {% endfor %} | 
				
			||||
                                </ul> | 
				
			||||
                            </dd> | 
				
			||||
                        </dl> | 
				
			||||
                    {% endfor %} | 
				
			||||
                {% endif %} | 
				
			||||
                </td> | 
				
			||||
                <td> | 
				
			||||
                    <a class="btn btn-primary" href="meeting.php?meetingId={{ meeting.meetingId }}"> | 
				
			||||
                        {{ 'Details'|get_lang }} | 
				
			||||
                    </a> | 
				
			||||
                </td> | 
				
			||||
            </tr> | 
				
			||||
        {% endfor %} | 
				
			||||
        </tbody> | 
				
			||||
    </table> | 
				
			||||
{% endif %} | 
				
			||||
					Loading…
					
					
				
		Reference in new issue