diff --git a/plugin/googlemeet/lang/spanish.php b/plugin/googlemeet/lang/spanish.php index 437f0bb621..3f0c0bae12 100644 --- a/plugin/googlemeet/lang/spanish.php +++ b/plugin/googlemeet/lang/spanish.php @@ -8,7 +8,7 @@ $strings['tool_title_help'] = 'Puede cambiar el nombre de la herramienta Google $strings['google_meet_enabled'] = 'Activar Herramienta Google Meet'; $strings['google_meet_enabled_help'] = 'Escoga si desea activar el plugin en su plataforma Chamilo, esta acción activara una herramienta extra en las herramienta del curso.'; $strings['CourseDoesNotHaveAssociatedAccountMeet'] = 'Este curso no tiene configurado una reunión Google Meet.'; -$strings['ManageMeetAccounts'] = 'Programar una reunión Google Meet'; +$strings['ManageMeetAccounts'] = 'Agregar una reunión Google Meet'; $strings['AssociateZoomAccount'] = 'Asociar una sala Zoom'; $strings['RemoveAndChangeRoomMeet'] = 'Modificar reunión programada'; $strings['AddMeet'] = 'Registrar reunión Google Meet'; @@ -16,5 +16,6 @@ $strings['MeetName'] = 'Nombre de la reunión'; $strings['MeetNameHelp'] = 'Asigna un nombre para la reunión. Ejemplo: Sala 1'; $strings['InstantMeetURL'] = "URL del Meet"; $strings['InstantMeetURLHelp'] = "Es la URL para iniciar una reunión instantánea conn Google Meet"; +$strings['AccessMeeting'] = "Accede a la reunión"; diff --git a/plugin/googlemeet/meet.php b/plugin/googlemeet/meets.php similarity index 91% rename from plugin/googlemeet/meet.php rename to plugin/googlemeet/meets.php index eb2b8ccb93..241fe64cd9 100644 --- a/plugin/googlemeet/meet.php +++ b/plugin/googlemeet/meets.php @@ -76,7 +76,10 @@ if ($enable) { if ($form->validate()) { $values = $form->exportValues(); $res = $plugin->saveMeet($values); - + if ($res) { + $url = api_get_path(WEB_PLUGIN_PATH).'googlemeet/start.php?'.api_get_cidreq(); + header('Location: '.$url); + } } } catch (HTML_QuickForm_Error $e) { echo $e; @@ -107,6 +110,6 @@ if ($isAdmin || $isTeacher) { } $tpl->assign('message', $message); -$content = $tpl->fetch('googlemeet/view/meet.tpl'); +$content = $tpl->fetch('googlemeet/view/meets.tpl'); $tpl->assign('content', $content); $tpl->display_one_col_template(); \ No newline at end of file diff --git a/plugin/googlemeet/resources/css/style.css b/plugin/googlemeet/resources/css/style.css index 16e02a8288..99233508b1 100644 --- a/plugin/googlemeet/resources/css/style.css +++ b/plugin/googlemeet/resources/css/style.css @@ -9,4 +9,88 @@ .tools{ margin-bottom: 2rem; margin-top: 1rem; +} +.card{ + position: relative; + display: flex; + flex-direction: column; + min-width: 0; + word-wrap: break-word; + border: 1px solid rgba(0,0,0,.05); + border-radius: .375rem; + background-color: #fff; + background-clip: border-box; +} +.card-meet{ + margin-bottom: 30px; + border: 0; + box-shadow: 0 0 2rem 0 rgba(136,152,170,.15); +} +.card-meet .card-body { + padding: 1rem 1.5rem; +} +.row-meet { + display: flex; + flex-wrap: wrap; +} +.row-meet .col { + max-width: 100%; + flex-basis: 0; + flex-grow: 1; +} +.row-meet .col-auto { + width: auto; + max-width: 100%; + flex: 0 0 auto; +} +.description{ + padding-left: 1rem; + padding-right: 1rem; +} +.description .title{ + font-size: 1.45rem; + font-weight: 600!important; + color: #32325d; +} +.rounded-circle { + border-radius: 50%!important; +} +.shadow { + box-shadow: 0 0 2rem 0 rgba(136,152,170,.15)!important; +} +.icon { + width: 4rem; + height: 4rem; +} +.icon-shape { + display: inline-flex; + padding: 12px; + text-align: center; + border-radius: 50%; + align-items: center; + justify-content: center; +} +.bg-gradient-green { + background: linear-gradient(87deg,#2dce89 0,#2dcecc 100%)!important; +} +.text-white { + color: #fff!important; +} +.btn-meet{ + color: #fff; + border-color: #5e72e4; + background-color: #5e72e4; + box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); +} +.btn-meet:hover { + color: #fff; + border-color: #5e72e4; + background-color: #5e72e4; +} +.btn:hover { + transform: translateY(-1px); + box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08); +} +.float-right { + float: right; } \ No newline at end of file diff --git a/plugin/googlemeet/src/googlemeet_plugin.class.php b/plugin/googlemeet/src/googlemeet_plugin.class.php index fbb5ce984f..24c7f9ba35 100644 --- a/plugin/googlemeet/src/googlemeet_plugin.class.php +++ b/plugin/googlemeet/src/googlemeet_plugin.class.php @@ -142,14 +142,17 @@ class GoogleMeetPlugin extends Plugin } $table = Database::get_main_table(self::TABLE_MEET_LIST); + $idCourse = api_get_course_int_id(); + $idUser = api_get_user_id(); + $params = [ 'meet_name' => $values['meet_name'], 'meet_url' => $values['meet_url'], 'type_meet' => $values['type_meet'], - 'user_id' => api_get_user_id(), - 'cd_id' => $values['cd_id'], - 'start_time' => $values['start_time'], - 'end_time' => $values['end_time'], + 'user_id' => $idUser, + 'cd_id' => $idCourse, + 'start_time' => null, + 'end_time' => null, 'session_id' => null, 'activate' => 1, ]; @@ -161,4 +164,64 @@ class GoogleMeetPlugin extends Plugin } } + public function listMeets($idCourse){ + + $list = []; + $tableMeetList = Database::get_main_table(self::TABLE_MEET_LIST); + + $sql = "SELECT * FROM $tableMeetList WHERE cd_id = $idCourse AND activate = 1"; + + $result = Database::query($sql); + + if (Database::num_rows($result) > 0) { + while ($row = Database::fetch_array($result)) { + + $action = Display::url( + Display::return_icon( + 'edit.png', + get_lang('Edit'), + [], + ICON_SIZE_SMALL + ), + 'meets.php?action=edit&id_room='.$row['id'] + ); + + $action.= Display::url( + Display::return_icon( + 'delete.png', + get_lang('Delete'), + [], + ICON_SIZE_SMALL + ), + 'meets.php?action=delete&id_room='.$row['id'], + [ + 'onclick' => 'javascript:if(!confirm('."'". + addslashes(api_htmlentities(get_lang("ConfirmYourChoice"))) + ."'".')) return false;', + ] + ); + $active = Display::return_icon('accept.png', null, [], ICON_SIZE_TINY); + if (intval($row['activate']) != 1) { + $active = Display::return_icon('error.png', null, [], ICON_SIZE_TINY); + } + + $list[] = [ + 'id' => $row['id'], + 'meet_name' => $row['meet_name'], + 'meet_url' => $row['meet_url'], + 'type_meet' => $row['type_meet'], + 'user_id' => $row['user_id'], + 'cd_id' => $row['cd_id'], + 'start_time' => $row['start_time'], + 'end_time' => $row['end_time'], + 'session_id' => $row['session_id'], + 'activate' => $active, + 'actions' => $action, + ]; + + } + } + return $list; + } + } \ No newline at end of file diff --git a/plugin/googlemeet/start.php b/plugin/googlemeet/start.php index 649c392d06..11e969cc3b 100644 --- a/plugin/googlemeet/start.php +++ b/plugin/googlemeet/start.php @@ -26,18 +26,19 @@ $isStudent = api_is_student(); $action = isset($_GET['action']) ? $_GET['action'] : null; $enable = $plugin->get('google_meet_enabled') == 'true'; -$urlAddMeet = api_get_path(WEB_PLUGIN_PATH).'googlemeet/meet.php?action=add&'.api_get_cidreq(); +$urlAddMeet = api_get_path(WEB_PLUGIN_PATH).'googlemeet/meets.php?action=add&'.api_get_cidreq(); if ($enable) { if ($isAdmin || $isTeacher || $isStudent) { - + $meets = $plugin->listMeets($courseInfo['real_id']); } } $tpl->assign('url_add_room', $urlAddMeet); +$tpl->assign('meets', $meets); $tpl->assign('is_admin', $isAdmin); $tpl->assign('is_student', $isStudent); $tpl->assign('is_teacher', $isTeacher); diff --git a/plugin/googlemeet/view/meets.tpl b/plugin/googlemeet/view/meets.tpl new file mode 100644 index 0000000000..19be89fa6f --- /dev/null +++ b/plugin/googlemeet/view/meets.tpl @@ -0,0 +1,25 @@ +