Merge branch 'advsub' of https://github.com/danbarretodev/chamilo-lms into danbarretodev-advsub
@ -0,0 +1,4 @@ |
||||
Advanced subscription plugin for Chamilo LMS |
||||
======================================= |
||||
@TODO:Edit README.md |
||||
|
||||
@ -0,0 +1,248 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Script to receipt request to subscribe and confirmation action to queue |
||||
* @author Daniel Alejandro Barreto Alva <daniel.barreto@beeznest.com> |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
|
||||
/** |
||||
* Init |
||||
*/ |
||||
require_once __DIR__ . '/../config.php'; |
||||
|
||||
$plugin = AdvancedSubscriptionPlugin::create(); |
||||
// Get validation hash |
||||
$hash = Security::remove_XSS($_REQUEST['v']); |
||||
// Get data from request (GET or POST) |
||||
$data['a'] = Security::remove_XSS($_REQUEST['a']); |
||||
$data['s'] = intval($_REQUEST['s']); |
||||
$data['current_user_id'] = intval($_REQUEST['current_user_id']); |
||||
$data['u'] = intval($_REQUEST['u']); |
||||
$data['q'] = intval($_REQUEST['q']); |
||||
$data['e'] = intval($_REQUEST['e']); |
||||
$data['is_connected'] = isset($_REQUEST['is_connected']) ? boolval($_REQUEST['is_connected']) : false; |
||||
$data['profile_completed'] = isset($_REQUEST['profile_completed']) ? floatval($_REQUEST['profile_completed']) : 0; |
||||
// Init result array |
||||
$result = array('error' => true, 'errorMessage' => get_lang('ThereWasAnError')); |
||||
// Check if data is valid or is for start subscription |
||||
$verified = $plugin->checkHash($data, $hash) || $data['a'] == 'subscribe'; |
||||
if ($verified) { |
||||
switch($data['a']) { |
||||
case 'check': // Check minimum requirements |
||||
try { |
||||
$res = AdvancedSubscriptionPlugin::create()->isAbleToRequest($data['u'], $data); |
||||
if ($res) { |
||||
$result['error'] = false; |
||||
$result['errorMessage'] = 'No error'; |
||||
$result['pass'] = true; |
||||
} else { |
||||
$result['errorMessage'] = 'User can not be subscribed'; |
||||
$result['pass'] = false; |
||||
} |
||||
} catch (\Exception $e) { |
||||
$result['errorMessage'] = $e->getMessage(); |
||||
} |
||||
break; |
||||
case 'subscribe': // Subscription |
||||
// Start subscription to queue |
||||
$res = AdvancedSubscriptionPlugin::create()->startSubscription($data['u'], $data['s'], $data); |
||||
// Check if queue subscription was successful |
||||
if ($res === true) { |
||||
// Prepare data |
||||
// Get session data |
||||
$sessionArray = api_get_session_info($data['s']); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'description'); |
||||
$sessionArray['description'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'target'); |
||||
$sessionArray['target'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'mode'); |
||||
$sessionArray['mode'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'publication_end_date'); |
||||
$sessionArray['publication_end_date'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'recommended_number_of_participants'); |
||||
$sessionArray['recommended_number_of_participants'] = $var['field_valiue']; |
||||
// Get student data |
||||
$studentArray = api_get_user_info($data['u']); |
||||
$studentArray['picture'] = UserManager::get_user_picture_path_by_id($studentArray['user_id'], 'web', false, true); |
||||
$studentArray['picture'] = UserManager::get_picture_user($studentArray['user_id'], $studentArray['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); |
||||
// Get superior data if exist |
||||
$superiorId = UserManager::getStudentBoss($data['u']); |
||||
if (!empty($superiorId)) { |
||||
$superiorArray = api_get_user_info($superiorId); |
||||
} else { |
||||
$superiorArray = null; |
||||
} |
||||
// Get admin data |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
foreach ($adminsArray as &$admin) { |
||||
$admin['complete_name'] = $admin['lastname'] . ', ' . $admin['firstname']; |
||||
} |
||||
unset($admin); |
||||
// Set data |
||||
$data['a'] = 'confirm'; |
||||
$data['student'] = $studentArray; |
||||
$data['superior'] = $superiorArray; |
||||
$data['admins'] = $adminsArray; |
||||
$data['session'] = $sessionArray; |
||||
$data['signature'] = api_get_setting('Institution'); |
||||
|
||||
// Check if student boss exists |
||||
if (empty($superiorId)) { |
||||
// Student boss does not exist |
||||
// Update status to accepted by boss |
||||
$res = $plugin->updateQueueStatus($data, ADV_SUB_QUEUE_STATUS_BOSS_APPROVED); |
||||
if (!empty($res)) { |
||||
// Prepare admin url |
||||
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . |
||||
'advancedsubscription/src/admin_view.php?s=' . $data['s']; |
||||
// Send mails |
||||
$result['mailIds'] = $plugin->sendMail($data, ADV_SUB_ACTION_STUDENT_REQUEST_NO_BOSS); |
||||
// Check if mails were sent |
||||
if (!empty($result['mailIds'])) { |
||||
$result['error'] = false; |
||||
$result['errorMessage'] = 'No error'; |
||||
$result['pass'] = true; |
||||
// Check if exist an email to render |
||||
if (isset($result['mailIds']['render'])) { |
||||
// Render mail |
||||
$message = MessageManager::get_message_by_id($result['mailIds']['render']); |
||||
$message = str_replace(array('<br /><hr>', '<br />', '<br/>'), '', $message['content']); |
||||
echo $message; |
||||
exit; |
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
// Student boss does exist |
||||
// Get url to be accepted by boss |
||||
$data['e'] = ADV_SUB_QUEUE_STATUS_BOSS_APPROVED; |
||||
$data['student']['acceptUrl'] = $plugin->getQueueUrl($data); |
||||
// Get url to be rejected by boss |
||||
$data['e'] = ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED; |
||||
$data['student']['rejectUrl'] = $plugin->getQueueUrl($data); |
||||
// Send mails |
||||
$result['mailIds'] = $plugin->sendMail($data, ADV_SUB_ACTION_STUDENT_REQUEST); |
||||
// Check if mails were sent |
||||
if (!empty($result['mailIds'])) { |
||||
$result['error'] = false; |
||||
$result['errorMessage'] = 'No error'; |
||||
$result['pass'] = true; |
||||
// Check if exist an email to render |
||||
if (isset($result['mailIds']['render'])) { |
||||
// Render mail |
||||
$message = MessageManager::get_message_by_id($result['mailIds']['render']); |
||||
$message = str_replace(array('<br /><hr>', '<br />', '<br/>'), '', $message['content']); |
||||
echo $message; |
||||
exit; |
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
if (is_string($res)) { |
||||
$result['errorMessage'] = $res; |
||||
} else { |
||||
$result['errorMessage'] = 'User can not be subscribed'; |
||||
} |
||||
$result['pass'] = false; |
||||
} |
||||
|
||||
break; |
||||
case 'confirm': |
||||
// Check if is set new status |
||||
if (isset($data['e'])) { |
||||
// Update queue status |
||||
$res = $plugin->updateQueueStatus($data, $data['e']); |
||||
if ($res === true) { |
||||
// Prepare data |
||||
// Prepare session data |
||||
$sessionArray = api_get_session_info($data['s']); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'description'); |
||||
$sessionArray['description'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'target'); |
||||
$sessionArray['target'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'mode'); |
||||
$sessionArray['mode'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'publication_end_date'); |
||||
$sessionArray['publication_end_date'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($data['s'], 'recommended_number_of_participants'); |
||||
$sessionArray['recommended_number_of_participants'] = $var['field_valiue']; |
||||
// Prepare student data |
||||
$studentArray = api_get_user_info($data['u']); |
||||
$studentArray['picture'] = UserManager::get_user_picture_path_by_id($studentArray['user_id'], 'web', false, true); |
||||
$studentArray['picture'] = UserManager::get_picture_user($studentArray['user_id'], $studentArray['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); |
||||
// Prepare superior data |
||||
$superiorId = UserManager::getStudentBoss($data['u']); |
||||
if (!empty($superiorId)) { |
||||
$superiorArray = api_get_user_info($superiorId); |
||||
} else { |
||||
$superiorArray = null; |
||||
} |
||||
// Prepare admin data |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
foreach ($adminsArray as &$admin) { |
||||
$admin['complete_name'] = $admin['lastname'] . ', ' . $admin['firstname']; |
||||
} |
||||
unset($admin); |
||||
// Set data |
||||
$data['student'] = $studentArray; |
||||
$data['superior'] = $superiorArray; |
||||
$data['admins'] = $adminsArray; |
||||
$data['session'] = $sessionArray; |
||||
$data['signature'] = api_get_setting('Institution'); |
||||
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . 'advancedsubscription/src/admin_view.php?s=' . $data['s']; |
||||
// Check if exist and action in data |
||||
if (empty($data['action'])) { |
||||
// set action in data by new status |
||||
switch ($data['e']) { |
||||
case ADV_SUB_QUEUE_STATUS_BOSS_APPROVED: |
||||
$data['action'] = ADV_SUB_ACTION_SUPERIOR_APPROVE; |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED: |
||||
$data['action'] = ADV_SUB_ACTION_SUPERIOR_DISAPPROVE; |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED: |
||||
$data['action'] = ADV_SUB_ACTION_ADMIN_APPROVE; |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED: |
||||
$data['action'] = ADV_SUB_ACTION_ADMIN_DISAPPROVE; |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
|
||||
// Student Session inscription |
||||
if ($data['e'] == ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED) { |
||||
SessionManager::suscribe_users_to_session($data['s'], array($data['u']), null, false); |
||||
} |
||||
|
||||
// Send mails |
||||
$result['mailIds'] = $plugin->sendMail($data, $data['action']); |
||||
// Check if mails were sent |
||||
if (!empty($result['mailIds'])) { |
||||
$result['error'] = false; |
||||
$result['errorMessage'] = 'User has been processed'; |
||||
// Check if exist mail to render |
||||
if (isset($result['mailIds']['render'])) { |
||||
// Render mail |
||||
$message = MessageManager::get_message_by_id($result['mailIds']['render']); |
||||
$message = str_replace(array('<br /><hr>', '<br />', '<br/>'), '', $message['content']); |
||||
echo $message; |
||||
exit; |
||||
} |
||||
} |
||||
} else { |
||||
$result['errorMessage'] = 'User queue can not be updated'; |
||||
} |
||||
} |
||||
break; |
||||
default: |
||||
$result['errorMessage'] = 'Action do not exist!'; |
||||
} |
||||
} |
||||
|
||||
// Echo result as json |
||||
echo json_encode($result); |
||||
@ -0,0 +1,29 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Config the plugin |
||||
* @author Daniel Alejandro Barreto Alva <daniel.barreto@beeznest.com> |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
|
||||
define('TABLE_ADV_SUB_QUEUE', 'plugin_advsub_queue'); |
||||
|
||||
define('ADV_SUB_ACTION_STUDENT_REQUEST', 0); |
||||
define('ADV_SUB_ACTION_SUPERIOR_APPROVE', 1); |
||||
define('ADV_SUB_ACTION_SUPERIOR_DISAPPROVE', 2); |
||||
define('ADV_SUB_ACTION_SUPERIOR_SELECT', 3); |
||||
define('ADV_SUB_ACTION_ADMIN_APPROVE', 4); |
||||
define('ADV_SUB_ACTION_ADMIN_DISAPPROVE', 5); |
||||
define('ADV_SUB_ACTION_STUDENT_REQUEST_NO_BOSS', 6); |
||||
|
||||
define('ADV_SUB_QUEUE_STATUS_NO_QUEUE', -1); |
||||
define('ADV_SUB_QUEUE_STATUS_START', 0); |
||||
define('ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED', 1); |
||||
define('ADV_SUB_QUEUE_STATUS_BOSS_APPROVED', 2); |
||||
define('ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED', 3); |
||||
define('ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED', 10); |
||||
|
||||
require_once __DIR__ . '/../../main/inc/global.inc.php'; |
||||
require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php'; |
||||
require_once api_get_path(PLUGIN_PATH) . 'advancedsubscription/src/AdvancedSubscriptionPlugin.php'; |
||||
require_once api_get_path(PLUGIN_PATH) . 'advancedsubscription/src/HookAdvancedSubscription.php'; |
||||
@ -0,0 +1 @@ |
||||
|
||||
@ -0,0 +1,17 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
/** |
||||
* This script is included by main/admin/settings.lib.php and generally |
||||
* includes things to execute in the main database (settings_current table) |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
|
||||
/** |
||||
* Initialization |
||||
*/ |
||||
|
||||
require_once dirname(__FILE__) . '/config.php'; |
||||
if (!api_is_platform_admin()) { |
||||
die ('You must have admin permissions to install plugins'); |
||||
} |
||||
AdvancedSubscriptionPlugin::create()->install(); |
||||
@ -0,0 +1,56 @@ |
||||
<?php |
||||
|
||||
/* Strings for settings */ |
||||
$strings['plugin_title'] = 'Advanced Subscription'; |
||||
$strings['plugin_comment'] = 'Plugin for managing the registration queue and communication to sessions from an external website'; |
||||
$strings['ws_url'] = 'Webservice url'; |
||||
$strings['ws_url'] = 'Webservice url'; |
||||
$strings['yearly_cost_unit_converter'] = 'Taxation unit (TU)'; |
||||
$strings['min_profile_percentage'] = 'Minimum required of completed percentage profile'; |
||||
$strings['yearly_cost_limit'] = 'Yearly limit TU for courses (measured in Taxation units)'; |
||||
$strings['yearly_hours_limit'] = 'Yearly limit hours for courses'; |
||||
$strings['courses_count_limit'] = 'Yearly limit times for courses'; |
||||
$strings['check_induction'] = 'Activate induction course requirement'; |
||||
$strings['course_session_credit_year_start_date'] = 'Year start date'; |
||||
|
||||
/* String for error message about requirements */ |
||||
$strings['AdvancedSubscriptionNotConnected'] = "You are not connected to platform. Please login first"; |
||||
$strings['AdvancedSubscriptionProfileIncomplete'] = "Your percentage completed profile require to exceed minimum percentage. Please complete percentage"; |
||||
$strings['AdvancedSubscriptionIncompleteInduction'] = "You have not yet completed induction course. Please complete it first"; |
||||
$strings['AdvancedSubscriptionCostXLimitReached'] = "We are sorry, you have already reached yearly limit mount for courses"; |
||||
$strings['AdvancedSubscriptionTimeXLimitReached'] = "We are sorry, you have already reached yearly limit hours for courses"; |
||||
$strings['AdvancedSubscriptionCourseXLimitReached'] = "We are sorry, you have already reached yearly limit times for courses"; |
||||
$strings['AdvancedSubscriptionNotMoreAble'] = "We are sorry, you no longer fulfills the initial conditions to subscribe this course"; |
||||
|
||||
$strings['AdvancedSubscriptionNoQueue'] = "You are not subscribed for this course."; |
||||
$strings['AdvancedSubscriptionNoQueueIsAble'] = "You are not subscribed, but you are qualified for this course."; |
||||
$strings['AdvancedSubscriptionQueueStart'] = "Your subscription request is pending for approval by your boss, please wait attentive."; |
||||
$strings['AdvancedSubscriptionQueueBossDisapproved'] = "We are sorry, your subscription was rejected by your boss."; |
||||
$strings['AdvancedSubscriptionQueueBossApproved'] = "Your subscription request has been accepted by your boss, now is pending for vacancies."; |
||||
$strings['AdvancedSubscriptionQueueAdminDisapproved'] = "We are sorry, your subscription was rejected by the administrator."; |
||||
$strings['AdvancedSubscriptionQueueAdminApproved'] = "Congratulation, your subscription request has been accepted by administrator"; |
||||
$strings['AdvancedSubscriptionQueueDefaultX'] = "There was an error, queue status %d is not defined by system."; |
||||
|
||||
// Mail translations |
||||
$strings['MailStudentRequest'] = 'Student registration request'; |
||||
$strings['MailBossAccept'] = 'Registration request accepted by boss'; |
||||
$strings['MailBossReject'] = 'Registration request rejected by boss'; |
||||
$strings['MailStudentRequestSelect'] = 'Student registration requests selection'; |
||||
$strings['MailAdminAccept'] = 'Registration request accepted by administrator'; |
||||
$strings['MailAdminReject'] = 'Registration request rejected by administrator'; |
||||
$strings['MailStudentRequestNoBoss'] = 'Student registration request without boss'; |
||||
|
||||
// TPL langs |
||||
// Admin view |
||||
$strings['SelectASession'] = 'Select a session'; |
||||
$strings['SessionName'] = 'Session name'; |
||||
$strings['Target'] = 'Target audience'; |
||||
$strings['Vacancies'] = 'Vacancies'; |
||||
$strings['RecommendedNumberOfParticipants'] = 'Recommended number of participants'; |
||||
$strings['PublicationEndDate'] = 'Publication end date'; |
||||
$strings['Mode'] = 'Mode'; |
||||
$strings['Postulant'] = 'Postulant'; |
||||
$strings['InscriptionDate'] = 'Inscription date'; |
||||
$strings['BossValidation'] = 'Boss validation'; |
||||
$strings['Decision'] = 'Decision'; |
||||
$strings['AdvancedSubscriptionAdminViewTitle'] = 'Subscription request confirmation result'; |
||||
@ -0,0 +1,62 @@ |
||||
<?php |
||||
|
||||
/* Strings for settings */ |
||||
$strings['plugin_title'] = 'Inscripción Avanzada'; |
||||
$strings['plugin_comment'] = 'Plugin que permite gestionar la inscripción en cola a sesiones con comunicación a a un portal externo'; |
||||
$strings['ws_url'] = 'URL del Webservice'; |
||||
$strings['ws_url_help'] = 'La URL de la cual se solicitará información para el proceso de la inscripción avanzada'; |
||||
$strings['check_induction'] = 'Activar requerimiento de curso inducción'; |
||||
$strings['check_induction_help'] = 'Escoja si se requiere que se complete los cursos de inducción'; |
||||
$strings['tool_enable'] = 'Inscripción avanzada activada'; |
||||
$strings['tool_enable_help'] = "Escoja si desea activar la inscripción avanzada."; |
||||
$strings['yearly_cost_limit'] = 'Límite de UITs'; |
||||
$strings['yearly_cost_limit_help'] = "El límite de UITs de cursos que se pueden llevar en un año calendario del año actual."; |
||||
$strings['yearly_hours_limit'] = 'Límite de horas lectivas'; |
||||
$strings['yearly_hours_limit_help'] = "El límite de horas lectivas de cursos que se pueden llevar en un año calendario del año actual."; |
||||
$strings['yearly_cost_unit_converter'] = 'Valor de un UIT'; |
||||
$strings['yearly_cost_unit_converter_help'] = "El valor en Soles de un UIT del año actual."; |
||||
$strings['courses_count_limit'] = 'Límite de sesiones'; |
||||
$strings['courses_count_limit_help'] = "El límite de cantidad de cursos (sesiones) que se pueden llevar en un año calendario del año actual y que <b>no</b> sean el curso de inducción"; |
||||
$strings['course_session_credit_year_start_date'] = 'Fecha de inicio'; |
||||
$strings['course_session_credit_year_start_date_help'] = "Fecha de inicio del año (día/mes)"; |
||||
$strings['min_profile_percentage'] = 'Porcentage de perfil completado mínimo requerido'; |
||||
$strings['min_profile_percentage_help'] = 'Número porcentage ( > 0.00 y < 100.00)'; |
||||
|
||||
|
||||
/* String for error message about requirements */ |
||||
$strings['AdvancedSubscriptionNotConnected'] = "Usted no está conectado en la plataforma. Por favor ingrese su usuario / constraseña para poder inscribirse"; |
||||
$strings['AdvancedSubscriptionProfileIncomplete'] = "Su perfil no es lo suficientemente completo para poder inscribirse al curso. Por favor complete su perfil"; |
||||
$strings['AdvancedSubscriptionIncompleteInduction'] = "Usted aún no ha completado el curso de inducción. Por favor complete el curso inducción"; |
||||
$strings['AdvancedSubscriptionCostXLimitReached'] = "Lo sentimos, usted ya ha alcanzado el límite anual de %s UIT para los cursos que ha seguido este año"; |
||||
$strings['AdvancedSubscriptionTimeXLimitReached'] = "Lo sentimos, usted ya ha alcanzado el límite anual de %s horas para los cursos que ha seguido este año"; |
||||
$strings['AdvancedSubscriptionCourseXLimitReached'] = "Lo sentimos, usted ya ha alcanzado el límite anual de %s cursos que ha seguido este año"; |
||||
$strings['AdvancedSubscriptionNotMoreAble'] = "Lo sentimos, usted ya no cumple con las condiciones iniciales para poder inscribirse al curso"; |
||||
$strings['AdvancedSubscriptionIncompleteParams'] = "Los parámetros enviados no están completos o no son los correctos."; |
||||
|
||||
$strings['AdvancedSubscriptionIsNotEnabled'] = "La inscripción avanzada no está activada"; |
||||
|
||||
//Needed in order to show the plugin title |
||||
|
||||
// Mail translations |
||||
$strings['MailStudentRequest'] = 'Solicitud de registro de estudiante'; |
||||
$strings['MailBossAccept'] = 'Solicitud de registro aceptada por superior'; |
||||
$strings['MailBossReject'] = 'Solicitud de registro rechazada por superior'; |
||||
$strings['MailStudentRequestSelect'] = 'Selección de solicitudes de registro de estudiante'; |
||||
$strings['MailAdminAccept'] = 'Solicitud de registro aceptada por administrador'; |
||||
$strings['MailAdminReject'] = 'Solicitud de registro rechazada por administrador'; |
||||
$strings['MailStudentRequestNoBoss'] = 'Solicitud de registro de estudiante sin superior'; |
||||
|
||||
// TPL translations |
||||
// Admin view |
||||
$strings['SelectASession'] = 'Elija una sesión'; |
||||
$strings['SessionName'] = 'Nombre de la sesión'; |
||||
$strings['Target'] = 'Publico objetivo'; |
||||
$strings['Vacancies'] = 'Vacantes'; |
||||
$strings['RecommendedNumberOfParticipants'] = 'Número recomendado de participantes'; |
||||
$strings['PublicationEndDate'] = 'Fecha fin de publicación'; |
||||
$strings['Mode'] = 'Modalidad'; |
||||
$strings['Postulant'] = 'Postulante'; |
||||
$strings['InscriptionDate'] = 'Fecha de inscripción'; |
||||
$strings['BossValidation'] = 'Validación del superior'; |
||||
$strings['Decision'] = 'Decisión'; |
||||
$strings['AdvancedSubscriptionAdminViewTitle'] = 'Resultado de confirmación de solicitud de inscripción'; |
||||
@ -0,0 +1 @@ |
||||
This plugin, as the rest of Chamilo, is released under the GNU/GPLv3 license. |
||||
@ -0,0 +1,12 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
/** |
||||
* This script is a configuration file for the date plugin. You can use it as a master for other platform plugins (course plugins are slightly different). |
||||
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins) |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
/** |
||||
* Plugin details (must be present) |
||||
*/ |
||||
require_once __DIR__ . '/config.php'; |
||||
$plugin_info = AdvancedSubscriptionPlugin::create()->get_info(); |
||||
@ -0,0 +1,3 @@ |
||||
Advanced subscription plugin<br/><br/> |
||||
@TODO: Complete readme.txt |
||||
This plugin enables Chamilo to extend its subscribe parameters. |
||||
@ -0,0 +1,872 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* @TODO: Improve description |
||||
* This class is used to add an advanced subscription allowing the admin to |
||||
* create user queues requesting a subscribe to a session |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
|
||||
|
||||
class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface |
||||
{ |
||||
/** |
||||
* Constructor |
||||
*/ |
||||
function __construct() |
||||
{ |
||||
$parameters = array( |
||||
'tool_enable' => 'boolean', |
||||
'yearly_cost_limit' => 'text', |
||||
'yearly_hours_limit' => 'text', |
||||
'yearly_cost_unit_converter' => 'text', |
||||
'courses_count_limit' => 'text', |
||||
'course_session_credit_year_start_date' => 'text', |
||||
'ws_url' => 'text', |
||||
'min_profile_percentage' => 'text', |
||||
'check_induction' => 'boolean', |
||||
'confirmation_message' => 'wysiwyg', |
||||
'secret_key' => 'text', |
||||
); |
||||
|
||||
parent::__construct('1.0', 'Imanol Losada, Daniel Barreto', $parameters); |
||||
} |
||||
|
||||
/** |
||||
* Instance the plugin |
||||
* @staticvar null $result |
||||
* @return AdvancedSubscriptionPlugin |
||||
*/ |
||||
static function create() |
||||
{ |
||||
static $result = null; |
||||
|
||||
return $result ? $result : $result = new self(); |
||||
} |
||||
|
||||
/** |
||||
* Install the plugin |
||||
* @return void |
||||
*/ |
||||
public function install() |
||||
{ |
||||
$this->installDatabase(); |
||||
$this->installHook(); |
||||
} |
||||
|
||||
/** |
||||
* Uninstall the plugin |
||||
* @return void |
||||
*/ |
||||
public function uninstall() |
||||
{ |
||||
$this->uninstallHook(); |
||||
$this->uninstallDatabase(); |
||||
} |
||||
|
||||
/** |
||||
* Create the database tables for the plugin |
||||
* @return void |
||||
*/ |
||||
private function installDatabase() |
||||
{ |
||||
$pAdvSubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS $pAdvSubQueueTable (" . |
||||
"id int UNSIGNED NOT NULL AUTO_INCREMENT, " . |
||||
"session_id int UNSIGNED NOT NULL, " . |
||||
"user_id int UNSIGNED NOT NULL, " . |
||||
"status int UNSIGNED NOT NULL, " . |
||||
"last_message_id int UNSIGNED NOT NULL, " . |
||||
"created_at datetime NOT NULL, " . |
||||
"updated_at datetime NULL, " . |
||||
"PRIMARY KEY PK_advsub_queue (id), " . |
||||
"UNIQUE KEY UK_advsub_queue (user_id, session_id)); "; |
||||
Database::query($sql); |
||||
} |
||||
|
||||
/** |
||||
* Drop the database tables for the plugin |
||||
* @return void |
||||
*/ |
||||
private function uninstallDatabase() |
||||
{ |
||||
/* Drop plugin tables */ |
||||
$pAdvSubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
|
||||
$sql = "DROP TABLE IF EXISTS $pAdvSubQueueTable; "; |
||||
Database::query($sql); |
||||
|
||||
/* Delete settings */ |
||||
$tSettings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
||||
Database::query("DELETE FROM $tSettings WHERE subkey = 'advancedsubscription'"); |
||||
} |
||||
|
||||
/** |
||||
* Return true if user is able to be added to queue for session subscription |
||||
* @param int $userId |
||||
* @param array $params MUST have keys: |
||||
* "is_connected" Indicate if the user is online on external web |
||||
* "profile_completed" Percentage of completed profile, given by WS |
||||
* @throws Exception |
||||
* @return bool |
||||
*/ |
||||
public function isAbleToRequest($userId, $params = array()) |
||||
{ |
||||
if (isset($params['is_connected']) && isset($params['profile_completed'])) { |
||||
$isAble = false; |
||||
$advSubPlugin = self::create(); |
||||
$wsUrl = $advSubPlugin->get('ws_url'); |
||||
// @TODO: Get connection status from user by WS |
||||
$isConnected = $params['is_connected']; |
||||
if ($isConnected) { |
||||
$profileCompletedMin = (float) $advSubPlugin->get('min_profile_percentage'); |
||||
// @TODO: Get completed profile percentage by WS |
||||
$profileCompleted = (float) $params['profile_completed']; |
||||
if ($profileCompleted > $profileCompletedMin) { |
||||
$checkInduction = $advSubPlugin->get('check_induction'); |
||||
// @TODO: check if user have completed at least one induction session |
||||
$completedInduction = true; |
||||
if (!$checkInduction || $completedInduction) { |
||||
$uitMax = $advSubPlugin->get('yearly_cost_unit_converter'); |
||||
$uitMax *= $advSubPlugin->get('yearly_cost_limit'); |
||||
// @TODO: Get UIT completed by user this year by WS |
||||
$uitUser = 0; |
||||
$extra = new ExtraFieldValue('session'); |
||||
$var = $extra->get_values_by_handler_and_field_variable($params['session_id'], 'cost'); |
||||
$uitUser += $var['field_value']; |
||||
if ($uitMax >= $uitUser) { |
||||
$expendedTimeMax = $advSubPlugin->get('yearly_hours_limit'); |
||||
// @TODO: Get Expended time from user data |
||||
$expendedTime = 0; |
||||
$var = $extra->get_values_by_handler_and_field_variable($params['session_id'], 'duration'); |
||||
$expendedTime += $var['field_value']; |
||||
if ($expendedTimeMax >= $expendedTime) { |
||||
$expendedNumMax = $advSubPlugin->get('courses_count_limit'); |
||||
// @TODO: Get Expended num from user |
||||
$expendedNum = 0; |
||||
if ($expendedNumMax >= $expendedNum) { |
||||
$isAble = true; |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionCourseXLimitReached')); |
||||
} |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionTimeXLimitReached')); |
||||
} |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionCostXLimitReached')); |
||||
} |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionIncompleteInduction')); |
||||
} |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionProfileIncomplete')); |
||||
} |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionNotConnected')); |
||||
} |
||||
|
||||
return $isAble; |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionIncompleteParams')); |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* Register a user into a queue for a session |
||||
* @param $userId |
||||
* @param $sessionId |
||||
* @return bool|int |
||||
*/ |
||||
public function addToQueue($userId, $sessionId) |
||||
{ |
||||
$now = api_get_utc_datetime(); |
||||
$pAdvSubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
$attributes = array( |
||||
'session_id' => $sessionId, |
||||
'user_id' => $userId, |
||||
'status' => 0, |
||||
'created_at' => $now, |
||||
'updated_at' => null, |
||||
); |
||||
|
||||
$id = Database::insert($pAdvSubQueueTable, $attributes); |
||||
|
||||
return $id; |
||||
} |
||||
|
||||
/** |
||||
* Register message with type and status |
||||
* @param $mailId |
||||
* @param $userId |
||||
* @param $sessionId |
||||
* @return bool|int |
||||
*/ |
||||
public function saveLastMessage($mailId, $userId, $sessionId) |
||||
{ |
||||
$queueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
$attributes = array( |
||||
'last_message_id' => $mailId, |
||||
); |
||||
|
||||
$num = Database::update( |
||||
$queueTable, |
||||
$attributes, |
||||
array('user_id = ? AND session_id = ?' => array($userId, $sessionId)) |
||||
); |
||||
|
||||
return $num; |
||||
} |
||||
|
||||
/** |
||||
* Check for requirements and register user into queue |
||||
* @param $userId |
||||
* @param $sessionId |
||||
* @param $params |
||||
* @return bool|string |
||||
*/ |
||||
public function startSubscription($userId, $sessionId, $params) |
||||
{ |
||||
$result = false; |
||||
if (!empty($sessionId) && !empty($userId)) { |
||||
$advSub = self::create(); |
||||
try { |
||||
if ($advSub->isAbleToRequest($userId, $params)) { |
||||
$result = (bool) $advSub->addToQueue($userId, $sessionId); |
||||
} else { |
||||
throw new \Exception($this->get_lang('AdvancedSubscriptionNotMoreAble')); |
||||
} |
||||
} catch (Exception $e) { |
||||
$result = $e->getMessage(); |
||||
} |
||||
} else { |
||||
$result = 'Params not found'; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Send message for the student subscription approval to a specific session |
||||
* @param int $studentId |
||||
* @param int $receiverId |
||||
* @param string $subject |
||||
* @param string $content |
||||
* @param int $sessionId |
||||
* @param bool $save |
||||
* @return bool|int |
||||
*/ |
||||
public function sendMailMessage($studentId, $receiverId, $subject, $content, $sessionId, $save = false) |
||||
{ |
||||
global $_configuration; // @TODO: Add $_configuration['no_reply_user_id'] to configuration file |
||||
|
||||
$mailId = MessageManager::send_message( |
||||
$receiverId, |
||||
$subject, |
||||
$content, |
||||
null, |
||||
null, |
||||
null, |
||||
null, |
||||
null, |
||||
null, |
||||
$_configuration['no_reply_user_id'] |
||||
); |
||||
|
||||
if ($save && !empty($mailId)) { |
||||
// Save as sent message |
||||
$this->saveLastMessage($mailId, $studentId, $sessionId); |
||||
} |
||||
return $mailId; |
||||
} |
||||
|
||||
/** |
||||
* Check if session is open for subscription |
||||
* @param $sessionId |
||||
* @param string $fieldVariable |
||||
* @return bool |
||||
*/ |
||||
public function isSessionOpen($sessionId, $fieldVariable = 'es_abierta') |
||||
{ |
||||
$sessionId = (int) $sessionId; |
||||
$fieldVariable = Database::escape_string($fieldVariable); |
||||
$isOpen = false; |
||||
if ($sessionId > 0 && !empty($fieldVariable)) { |
||||
$sfTable = Database::get_main_table(TABLE_MAIN_SESSION_FIELD); |
||||
$sfvTable = Database::get_main_table(TABLE_MAIN_SESSION_FIELD_VALUES); |
||||
$joinTable = $sfvTable . ' sfv INNER JOIN ' . $sfTable . ' sf ON sfv.field_id = sf.id '; |
||||
$row = Database::select( |
||||
'sfv.field_value as field_value', |
||||
$joinTable, |
||||
array( |
||||
'where' => array( |
||||
'sfv.session_id = ? AND sf.field_variable = ?' => array($sessionId, $fieldVariable), |
||||
) |
||||
) |
||||
); |
||||
if (isset($row[0]) && is_array($row[0])) { |
||||
$isOpen = (bool) $row[0]['field_value']; |
||||
} |
||||
} |
||||
|
||||
return $isOpen; |
||||
} |
||||
|
||||
/** |
||||
* Update the queue status for subscription approval rejected or accepted |
||||
* @param $params |
||||
* @param $newStatus |
||||
* @return bool |
||||
*/ |
||||
public function updateQueueStatus($params, $newStatus) |
||||
{ |
||||
if (isset($params['queue']['id'])) { |
||||
$where = array( |
||||
'id = ?' => $params['queue']['id'], |
||||
); |
||||
} elseif(isset($params['u']) && isset($params['s'])) { |
||||
$where = array( |
||||
'user_id = ? AND session_id = ? AND status <> ? AND status <> ?' => array( |
||||
$params['u'], |
||||
$params['s'], |
||||
$newStatus, |
||||
ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED, |
||||
), |
||||
); |
||||
} |
||||
if (isset($where)) { |
||||
$res = (bool) Database::update( |
||||
Database::get_main_table(TABLE_ADV_SUB_QUEUE), |
||||
array( |
||||
'status' => $newStatus, |
||||
'updated_at' => api_get_utc_datetime(), |
||||
), |
||||
$where |
||||
); |
||||
} else { |
||||
$res = false; |
||||
} |
||||
|
||||
return $res; |
||||
} |
||||
|
||||
/** |
||||
* Render and send mail by defined advanced subscription action |
||||
* @param $data |
||||
* @param $actionType |
||||
* @return array |
||||
*/ |
||||
public function sendMail($data, $actionType) |
||||
{ |
||||
$tpl = new Template($this->get_lang('plugin_title')); |
||||
$tpl->assign('data', $data); |
||||
$tplParams = array( |
||||
'user', |
||||
'student', |
||||
'students', |
||||
'superior', |
||||
'admins', |
||||
'session', |
||||
'signature', |
||||
'admin_view_url', |
||||
'acceptUrl', |
||||
'rejectUrl' |
||||
); |
||||
foreach ($tplParams as $tplParam) { |
||||
$tpl->assign($tplParam, $data[$tplParam]); |
||||
} |
||||
$mailIds = array(); |
||||
switch ($actionType) { |
||||
case ADV_SUB_ACTION_STUDENT_REQUEST: |
||||
// Mail to student |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailStudentRequest'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_received.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailStudentRequest'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_superior.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
break; |
||||
case ADV_SUB_ACTION_SUPERIOR_APPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailBossAccept'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_superior_approved.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailBossAccept'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_approve_confirmed.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to admin |
||||
foreach ($data['admins'] as $adminId => $admin) { |
||||
$tpl->assign('admin', $admin); |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$adminId, |
||||
$this->get_lang('MailBossAccept'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_approved_info_admin.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
} |
||||
break; |
||||
case ADV_SUB_ACTION_SUPERIOR_DISAPPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailBossReject'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_superior_disapproved.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
// Mail to superior |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailBossReject'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_disapprove_confirmed.tpl'), |
||||
$data['s'] |
||||
); |
||||
break; |
||||
case ADV_SUB_ACTION_SUPERIOR_SELECT: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailStudentRequestSelect'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_received.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailStudentRequestSelect'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_superior.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
break; |
||||
case ADV_SUB_ACTION_ADMIN_APPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailAdminAccept'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_approval_admin_accepted_notice_student.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailAdminAccept'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_approval_admin_accepted_notice_superior.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to admin |
||||
$adminId = $data['current_user_id']; |
||||
$tpl->assign('admin', $data['admins'][$adminId]); |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$adminId, |
||||
$this->get_lang('MailAdminAccept'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_approval_admin_accepted_notice_admin.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
break; |
||||
case ADV_SUB_ACTION_ADMIN_DISAPPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailAdminReject'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_approval_admin_rejected_notice_student.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
// Mail to superior |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailAdminReject'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_approval_admin_rejected_notice_superior.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to admin |
||||
$adminId = $data['current_user_id']; |
||||
$tpl->assign('admin', $data['admins'][$adminId]); |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$adminId, |
||||
$this->get_lang('MailAdminReject'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_approval_admin_rejected_notice_admin.tpl'), |
||||
$data['s'] |
||||
); |
||||
break; |
||||
case ADV_SUB_ACTION_STUDENT_REQUEST_NO_BOSS: |
||||
// Mail to student |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailStudentRequestNoBoss'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_received_no_boss.tpl'), |
||||
$data['s'] |
||||
); |
||||
// Mail to admin |
||||
foreach ($data['admins'] as $adminId => $admin) { |
||||
$tpl->assign('admin', $admin); |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['u'], |
||||
$adminId, |
||||
$this->get_lang('MailStudentRequestNoBoss'), |
||||
$tpl->fetch('/advancedsubscription/views/advsub_request_approved_info_admin.tpl'), |
||||
$data['s'], |
||||
true |
||||
); |
||||
} |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
|
||||
return $mailIds; |
||||
} |
||||
|
||||
/** |
||||
* Count the users in queue filtered by params (sessions, status) |
||||
* @param array $params Input array containing the set of |
||||
* session and status to count from queue |
||||
* e.g: |
||||
* array('sessions' => array(215, 218, 345, 502), |
||||
* 'status' => array(0, 1, 2)) |
||||
* @return int |
||||
*/ |
||||
public function countQueueByParams($params) |
||||
{ |
||||
$count = 0; |
||||
if (!empty($params) && is_array($params)) { |
||||
$advsubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
$where['1 = ? '] = 1; |
||||
if (isset($params['sessions']) && is_array($params['sessions'])) { |
||||
$where['AND session_id IN ( ? ) '] = implode($params['sessions']); |
||||
} |
||||
if (isset($params['status']) && is_array($params['status'])) { |
||||
$where['AND status IN ( ? ) '] = implode($params['status']); |
||||
} |
||||
$where['where'] = $where; |
||||
$count = Database::select('COUNT(*)', $advsubQueueTable, $where); |
||||
$count = $count[0]['COUNT(*)']; |
||||
} |
||||
return $count; |
||||
} |
||||
|
||||
/** |
||||
* This method will call the Hook management insertHook to add Hook observer from this plugin |
||||
* @return int |
||||
*/ |
||||
public function installHook() |
||||
{ |
||||
$hookObserver = HookAdvancedSubscription::create(); |
||||
HookAdminBlock::create()->attach($hookObserver); |
||||
HookWSRegistration::create()->attach($hookObserver); |
||||
HookNotificationContent::create()->attach($hookObserver); |
||||
HookNotificationTitle::create()->attach($hookObserver); |
||||
} |
||||
|
||||
/** |
||||
* This method will call the Hook management deleteHook to disable Hook observer from this plugin |
||||
* @return int |
||||
*/ |
||||
public function uninstallHook() |
||||
{ |
||||
$hookObserver = HookAdvancedSubscription::create(); |
||||
HookAdminBlock::create()->detach($hookObserver); |
||||
HookWSRegistration::create()->detach($hookObserver); |
||||
HookNotificationContent::create()->detach($hookObserver); |
||||
HookNotificationTitle::create()->detach($hookObserver); |
||||
} |
||||
|
||||
/** |
||||
* Return the status from user in queue to session subscription |
||||
* @param int $userId |
||||
* @param int $sessionId |
||||
* @return bool|int |
||||
*/ |
||||
public function getQueueStatus($userId, $sessionId) |
||||
{ |
||||
if (!empty($userId) && !empty($sessionId)) { |
||||
$queueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
$row = Database::select( |
||||
'status', |
||||
$queueTable, |
||||
array( |
||||
'where' => array( |
||||
'user_id = ? AND session_id = ?' => array($userId, $sessionId), |
||||
) |
||||
) |
||||
); |
||||
|
||||
if (count($row) == 1) { |
||||
|
||||
return $row[0]['status']; |
||||
} else { |
||||
|
||||
return ADV_SUB_QUEUE_STATUS_NO_QUEUE; |
||||
} |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Return the remaining vacancy |
||||
* @param $sessionId |
||||
* @return bool|int |
||||
*/ |
||||
public function getVacancy($sessionId) |
||||
{ |
||||
if (!empty($sessionId)) { |
||||
$extra = new ExtraFieldValue('session'); |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'vacancies'); |
||||
$vacancy = intval($var['field_value']); |
||||
if (!empty($vacancy)) { |
||||
$vacancy -= $this->countQueueByParams(array('sessions' => $sessionId, 'status' => ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED)); |
||||
|
||||
if ($vacancy >= 0) { |
||||
|
||||
return $vacancy; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Return the session details data from session extra field value |
||||
* @param $sessionId |
||||
* @return bool|mixed |
||||
*/ |
||||
public function getSessionDetails($sessionId) |
||||
{ |
||||
if (!empty($sessionId)) { |
||||
$extra = new ExtraFieldValue('session'); |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'id'); |
||||
$data['id'] = $var['field_value']; |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'cost'); |
||||
$data['cost'] = $var['field_value']; |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'place'); |
||||
$data['place'] = $var['field_value']; |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'allow_visitors'); |
||||
$data['allow_visitors'] = $var['field_value']; |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'horas_lectivas'); |
||||
$data['duration'] = $var['field_value']; |
||||
// Get brochure URL |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'brochure'); |
||||
$data['brochure'] = api_get_path(WEB_CODE_PATH) . $var['field_value']; |
||||
// Get banner URL |
||||
$var = $extra->get_values_by_handler_and_field_variable($sessionId, 'banner'); |
||||
$data['banner'] = api_get_path(WEB_CODE_PATH) . $var['field_value']; |
||||
$data['description'] = SessionManager::getDescriptionFromSessionId($sessionId); |
||||
|
||||
return $data; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Get status message |
||||
* @param int $status |
||||
* @param bool $isAble |
||||
* @return string |
||||
*/ |
||||
public function getStatusMessage($status, $isAble = true) |
||||
{ |
||||
$message = ''; |
||||
switch ($status) |
||||
{ |
||||
case ADV_SUB_QUEUE_STATUS_NO_QUEUE: |
||||
if ($isAble) { |
||||
$message = $this->get_lang('AdvancedSubscriptionNoQueueIsAble'); |
||||
} else { |
||||
$message = $this->get_lang('AdvancedSubscriptionNoQueue'); |
||||
} |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_START: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueStart'); |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueBossDisapproved'); |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_BOSS_APPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueBossApproved'); |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueAdminDisapproved'); |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueAdminApproved'); |
||||
break; |
||||
default: |
||||
$message = sprintf($this->get_lang('AdvancedSubscriptionQueueDefault'), $status); |
||||
|
||||
} |
||||
|
||||
return $message; |
||||
} |
||||
|
||||
/** |
||||
* Return the url to go to session |
||||
* @param $sessionId |
||||
* @return string |
||||
*/ |
||||
public function getSessionUrl($sessionId) |
||||
{ |
||||
$url = api_get_path(WEB_CODE_PATH) . 'session/?session_id=' . $sessionId; |
||||
return $url; |
||||
} |
||||
|
||||
/** |
||||
* Return the url to enter to subscription queue to session |
||||
* @param $params |
||||
* @return string |
||||
*/ |
||||
public function getQueueUrl($params) |
||||
{ |
||||
$url = api_get_path(WEB_PLUGIN_PATH) . 'advancedsubscription/ajax/advsub.ajax.php?' . |
||||
'a=' . $params['a'] . '&' . |
||||
's=' . $params['s'] . '&' . |
||||
'current_user_id=' . $params['current_user_id'] . '&' . |
||||
'e=' . $params['e'] . '&' . |
||||
'u=' . $params['u'] . '&' . |
||||
'q=' . $params['q'] . '&' . |
||||
'is_connected=' . $params['is_connected'] . '&' . |
||||
'profile_completed=' . $params['profile_completed'] . '&' . |
||||
'v=' . $this->generateHash($params); |
||||
return $url; |
||||
} |
||||
|
||||
/** |
||||
* Return the list of student, in queue used by admin view |
||||
* @param int $sessionId |
||||
* @return array |
||||
*/ |
||||
public function listAllStudentsInQueueBySession($sessionId) |
||||
{ |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$session = api_get_session_info($sessionId); |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($sessionId, 'target'); |
||||
$session['target'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($sessionId, 'publication_end_date'); |
||||
$session['publication_end_date'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($sessionId, 'mode'); |
||||
$session['mode'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($sessionId, 'recommended_number_of_participants'); |
||||
$session['recommended_number_of_participants'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($sessionId, 'vacancies'); |
||||
$session['vacancies'] = $var['field_value']; |
||||
$queueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE); |
||||
$userTable = Database::get_main_table(TABLE_MAIN_USER); |
||||
$userJoinTable = $queueTable . ' q INNER JOIN ' . $userTable . ' u ON q.user_id = u.user_id'; |
||||
$where = array( |
||||
'where' => |
||||
array( |
||||
'q.session_id = ? AND q.status <> ? AND q.status <> ?' => array( |
||||
$sessionId, |
||||
ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED, |
||||
ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED, |
||||
) |
||||
) |
||||
); |
||||
$select = 'u.user_id, u.firstname, u.lastname, q.created_at, q.updated_at, q.status, q.id as queue_id'; |
||||
$students = Database::select($select, $userJoinTable, $where); |
||||
foreach ($students as &$student) { |
||||
$status = intval($student['status']); |
||||
switch($status) { |
||||
case ADV_SUB_QUEUE_STATUS_NO_QUEUE: |
||||
case ADV_SUB_QUEUE_STATUS_START: |
||||
$student['validation'] = ''; |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED: |
||||
case ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED: |
||||
$student['validation'] = get_lang('No'); |
||||
break; |
||||
case ADV_SUB_QUEUE_STATUS_BOSS_APPROVED: |
||||
case ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED: |
||||
$student['validation'] = get_lang('Yes'); |
||||
break; |
||||
default: |
||||
error_log(__FILE__ . ' ' . __FUNCTION__ . ' Student status no detected'); |
||||
} |
||||
} |
||||
$return = array( |
||||
'session' => $session, |
||||
'students' => $students, |
||||
); |
||||
|
||||
return $return; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* List all session (id, name) for select input |
||||
* @return array |
||||
*/ |
||||
public function listAllSessions() |
||||
{ |
||||
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION); |
||||
$columns = 'id, name'; |
||||
return Database::select($columns, $sessionTable); |
||||
} |
||||
|
||||
/** |
||||
* Generate security hash to check data send by url params |
||||
* @param string $data |
||||
* @return string |
||||
*/ |
||||
public function generateHash($data) |
||||
{ |
||||
$key = sha1($this->get('secret_key')); |
||||
// Prepare array to have specific type variables |
||||
$dataPrepared['a'] = strval($data['a']); |
||||
$dataPrepared['s'] = intval($data['s']); |
||||
$dataPrepared['current_user_id'] = intval($data['current_user_id']); |
||||
$dataPrepared['u'] = intval($data['u']); |
||||
$dataPrepared['q'] = intval($data['q']); |
||||
$dataPrepared['e'] = intval($data['e']); |
||||
$dataPrepared = serialize($dataPrepared); |
||||
return sha1($dataPrepared . $key); |
||||
} |
||||
|
||||
/** |
||||
* Verify hash from data |
||||
* @param string $data |
||||
* @param string $hash |
||||
* @return bool |
||||
*/ |
||||
public function checkHash($data, $hash) |
||||
{ |
||||
return $this->generateHash($data) == $hash; |
||||
} |
||||
} |
||||
@ -0,0 +1,608 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Hook Observer for Advanced subscription plugin |
||||
* @author Daniel Alejandro Barreto Alva <daniel.barreto@beeznest.com> |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
|
||||
require_once __DIR__ . '/../config.php'; |
||||
|
||||
class HookAdvancedSubscription extends HookObserver implements |
||||
HookAdminBlockObserverInterface, |
||||
HookWSRegistrationObserverInterface, |
||||
HookNotificationContentObserverInterface |
||||
{ |
||||
|
||||
protected function __construct() |
||||
{ |
||||
parent::__construct( |
||||
'plugin/advancedsubscription/src/HookAdvancedSubscription.class.php', |
||||
'advancedsubscription' |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* @param HookAdminBlockEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookAdminBlock(HookAdminBlockEventInterface $hook) |
||||
{ |
||||
$data = $hook->getEventData(); |
||||
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { |
||||
// Nothing to do |
||||
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) { |
||||
|
||||
if (isset($data['blocks'])) { |
||||
$data['blocks']['sessions']['items'][] = array( |
||||
'url' => '../../plugin/advancedsubscription/src/admin_view.php', |
||||
'label' => get_plugin_lang('plugin_title', 'AdvancedSubscriptionPlugin'), |
||||
); |
||||
} |
||||
} else { |
||||
// Hook type is not valid |
||||
// Nothing to do |
||||
} |
||||
|
||||
return $data; |
||||
} |
||||
|
||||
/** |
||||
* Add Webservices to registration.soap.php |
||||
* @param HookWSRegistrationEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookWSRegistration(HookWSRegistrationEventInterface $hook) |
||||
{ |
||||
$data = $hook->getEventData(); |
||||
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { |
||||
|
||||
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) { |
||||
/** @var \nusoap_server $server */ |
||||
$server = &$data['server']; |
||||
|
||||
/** WSSessionListInCategory */ |
||||
|
||||
// Output params for sessionBriefList WSSessionListInCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionBrief', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
'id' => array('name' => 'id', 'type' => 'xsd:int'), // session.id |
||||
'name' => array('name' => 'name', 'type' => 'xsd:string'), // session.name |
||||
'short_description' => array('name' => 'short_description', 'type' => 'xsd:string'), // session.short_description |
||||
'mode' => array('name' => 'mode', 'type' => 'xsd:string'), // session.mode |
||||
'date_start' => array('name' => 'date_start', 'type' => 'xsd:string'), // session.date_start |
||||
'date_end' => array('name' => 'date_end', 'type' => 'xsd:string'), // session.date_end |
||||
'duration' => array('name' => 'duration', 'type' => 'xsd:string'), // session.duration |
||||
'vacancies' => array('name' => 'vacancies', 'type' => 'xsd:string'), // session.vacancies |
||||
'schedule' => array('name' => 'schedule', 'type' => 'xsd:string'), // session.schedule |
||||
) |
||||
); |
||||
|
||||
//Output params for WSSessionListInCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionBriefList', |
||||
'complexType', |
||||
'array', |
||||
'', |
||||
'SOAP-ENC:Array', |
||||
array(), |
||||
array( |
||||
array('ref'=>'SOAP-ENC:arrayType', |
||||
'wsdl:arrayType'=>'tns:sessionBrief[]') |
||||
), |
||||
'tns:sessionBrief' |
||||
); |
||||
|
||||
// Input params for WSSessionListInCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionCategoryInput', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'), // session_category.id |
||||
'name' => array('name' => 'name', 'type' => 'xsd:string'), // session_category.name |
||||
'target' => array('name' => 'target', 'type' => 'xsd:string'), // session.target |
||||
'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string') |
||||
) |
||||
); |
||||
|
||||
// Input params for WSSessionGetDetailsByUser |
||||
$server->wsdl->addComplexType( |
||||
'advsubSessionDetailInput', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
'user_id' => array('name' => 'user_id', 'type' => 'xsd:int'), // user.user_id |
||||
'session_id' => array('name' => 'session_id', 'type' => 'xsd:int'), // session.id |
||||
'profile_completed' => array('name' => 'profile_completed', 'type' => 'xsd:float'), // user.profile_completes |
||||
'is_connected' => array('name' => 'is_connected', 'type' => 'xsd:boolean'), // user.is_connected |
||||
'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string'), |
||||
) |
||||
); |
||||
|
||||
// Output params for WSSessionGetDetailsByUser |
||||
$server->wsdl->addComplexType( |
||||
'advsubSessionDetail', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'), // session.id |
||||
'cost' => array('name' => 'cost', 'type' => 'xsd:float'), // session.cost |
||||
'place' => array('name' => 'place', 'type' => 'xsd:string'), // session.place |
||||
'allow_visitors' => array('name' => 'allow_visitors', 'type' => 'xsd:string'), // session.allow_visitors |
||||
'duration' => array('name' => 'duration', 'type' => 'xsd:int'), // session.duration |
||||
'brochure' => array('name' => 'brochure', 'type' => 'xsd:string'), // session.brochure |
||||
'banner' => array('name' => 'banner', 'type' => 'xsd:string'), // session.banner |
||||
'description' => array('name' => 'description', 'type' => 'xsd:string'), // session.description |
||||
'status' => array('name' => 'status', 'type' => 'xsd:string'), // status |
||||
'action_url' => array('name' => 'action_url', 'type' => 'xsd:string'), // action_url |
||||
'message' => array('name' => 'error_message', 'type' => 'xsd:string'), // message |
||||
) |
||||
); |
||||
|
||||
/** WSListSessionsDetailsByCategory **/ |
||||
|
||||
// Input params for WSListSessionsDetailsByCategory |
||||
$server->wsdl->addComplexType( |
||||
'listSessionsDetailsByCategory', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'), // session_category.id |
||||
'category_name' => array('name' => 'category_name', 'type' => 'xsd:string'), // session_category.name |
||||
'access_url_id' => array('name' => 'access_url_id', 'type' => 'xsd:int'), // session_category.access_url_id |
||||
'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string') // secret key |
||||
), |
||||
array(), |
||||
'tns:listSessionsDetailsByCategory' |
||||
); |
||||
|
||||
// Output params for sessionDetailsCourseList WSListSessionsDetailsByCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionDetailsCourse', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
'course_id' => array('name' => 'course_id', 'type' => 'xsd:int'), // course.id |
||||
'course_code' => array('name' => 'course_code', 'type' => 'xsd:string'), // course.code |
||||
'course_title' => array('name' => 'course_title', 'type' => 'xsd:string'), // course.title |
||||
'coach_username' => array('name' => 'coach_username', 'type' => 'xsd:string'), // user.username |
||||
'coach_firstname' => array('name' => 'coach_firstname', 'type' => 'xsd:string'), // user.firstname |
||||
'coach_lastname' => array('name' => 'coach_lastname', 'type' => 'xsd:string'), // user.lastname |
||||
) |
||||
); |
||||
|
||||
|
||||
// Output array for sessionDetails WSListSessionsDetailsByCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionDetailsCourseList', |
||||
'complexType', |
||||
'array', |
||||
'', |
||||
'SOAP-ENC:Array', |
||||
array(), |
||||
array( |
||||
array( |
||||
'ref' => 'SOAP-ENC:arrayType', |
||||
'wsdl:arrayType' => 'tns:sessionDetailsCourse[]', |
||||
) |
||||
), |
||||
'tns:sessionDetailsCourse' |
||||
); |
||||
|
||||
// Output params for sessionDetailsList WSListSessionsDetailsByCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionDetails', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
// session.id |
||||
'id' => array( |
||||
'name' => 'id', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.id_coach |
||||
'coach_id' => array( |
||||
'name' => 'coach_id', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.name |
||||
'name' => array( |
||||
'name' => 'name', |
||||
'type' => 'xsd:string' |
||||
), |
||||
// session.nbr_courses |
||||
'courses_num' => array( |
||||
'name' => 'courses_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.nbr_users |
||||
'users_num' => array( |
||||
'name' => 'users_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.nbr_classes |
||||
'classes_num' => array( |
||||
'name' => 'classes_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.date_start |
||||
'date_start' => array( |
||||
'name' => 'date_start', |
||||
'type' => 'xsd:string' |
||||
), |
||||
// session.date_end |
||||
'date_end' => array( |
||||
'name' => 'date_end', |
||||
'type' => 'xsd:string' |
||||
), |
||||
// session.nb_days_access_before_beginning |
||||
'access_days_before_num' => array( |
||||
'name' => 'access_days_before_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.nb_days_access_after_end |
||||
'access_days_after_num' => array( |
||||
'name' => 'access_days_after_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.session_admin_id |
||||
'session_admin_id' => array( |
||||
'name' => 'session_admin_id', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.visibility |
||||
'visibility' => array( |
||||
'name' => 'visibility', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.session_category_id |
||||
'session_category_id' => array( |
||||
'name' => 'session_category_id', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.promotion_id |
||||
'promotion_id' => array( |
||||
'name' => 'promotion_id', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.number of registered users validated |
||||
'validated_user_num' => array( |
||||
'name' => 'validated_user_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// session.number of registered users from waiting queue |
||||
'waiting_user_num' => array( |
||||
'name' => 'waiting_user_num', |
||||
'type' => 'xsd:int' |
||||
), |
||||
// extra fields |
||||
// Array(field_name, field_value) |
||||
'extra' => array( |
||||
'name' => 'extra', |
||||
'type' => 'tns:extrasList' |
||||
), |
||||
// course and coaches data |
||||
// Array(course_id, course_code, course_title, coach_username, coach_firstname, coach_lastname) |
||||
'course' => array( |
||||
'name' => 'courses', |
||||
'type' => 'tns:sessionDetailsCourseList' |
||||
), |
||||
) |
||||
); |
||||
|
||||
// Output params for WSListSessionsDetailsByCategory |
||||
$server->wsdl->addComplexType( |
||||
'sessionDetailsList', |
||||
'complexType', |
||||
'array', |
||||
'', |
||||
'SOAP-ENC:Array', |
||||
array(), |
||||
array( |
||||
array( |
||||
'ref' => 'SOAP-ENC:arrayType', |
||||
'wsdl:arrayType' => 'tns:sessionDetails[]', |
||||
) |
||||
), |
||||
'tns:sessionDetails' |
||||
); |
||||
|
||||
// Register the method for WSSessionListInCategory |
||||
$server->register( |
||||
'HookAdvancedSubscription..WSSessionListInCategory', // method name |
||||
array('sessionCategoryInput' => 'tns:sessionCategoryInput'), // input parameters |
||||
array('return' => 'tns:sessionBriefList'), // output parameters |
||||
'urn:WSRegistration', // namespace |
||||
'urn:WSRegistration#WSSessionListInCategory', // soapaction |
||||
'rpc', // style |
||||
'encoded', // use |
||||
'This service checks if user assigned to course' // documentation |
||||
); |
||||
|
||||
// Register the method for WSSessionGetDetailsByUser |
||||
$server->register( |
||||
'HookAdvancedSubscription..WSSessionGetDetailsByUser', // method name |
||||
array('advsubSessionDetailInput' => 'tns:advsubSessionDetailInput'), // input parameters |
||||
array('return' => 'tns:advsubSessionDetail'), // output parameters |
||||
'urn:WSRegistration', // namespace |
||||
'urn:WSRegistration#WSSessionGetDetailsByUser', // soapaction |
||||
'rpc', // style |
||||
'encoded', // use |
||||
'This service return session details to specific user' // documentation |
||||
); |
||||
|
||||
// Register the method for WSListSessionsDetailsByCategory |
||||
$server->register( |
||||
'HookAdvancedSubscription..WSListSessionsDetailsByCategory', // method name |
||||
array('name' => 'tns:listSessionsDetailsByCategory'), // input parameters |
||||
array('return' => 'tns:sessionDetailsList'), // output parameters |
||||
'urn:WSRegistration', // namespace |
||||
'urn:WSRegistration#WSListSessionsDetailsByCategory', // soapaction |
||||
'rpc', // style |
||||
'encoded', // use |
||||
'This service returns a list of detailed sessions by a category' // documentation |
||||
); |
||||
|
||||
return $data; |
||||
} else { |
||||
// Nothing to do |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* @param $params |
||||
* @return null|soap_fault |
||||
*/ |
||||
public static function WSSessionListInCategory($params) |
||||
{ |
||||
global $debug; |
||||
|
||||
if ($debug) error_log('WSUserSubscribedInCourse'); |
||||
if ($debug) error_log('Params '. print_r($params, 1)); |
||||
if (!WSHelperVerifyKey($params)) { |
||||
|
||||
//return return_error(WS_ERROR_SECRET_KEY); |
||||
} |
||||
// Check if category ID is set |
||||
if (!empty($params['id']) && empty($params['name'])) { |
||||
$sessionCategoryId = $params['id']; |
||||
} elseif (!empty($params['name'])) { |
||||
// Check if category name is set |
||||
$sessionCategoryId = SessionManager::getSessionCategoryIdByName($params['name']); |
||||
if (is_array($sessionCategoryId)) { |
||||
$sessionCategoryId = current($sessionCategoryId); |
||||
} |
||||
} else { |
||||
// Return soap fault Not valid input params |
||||
|
||||
return return_error(WS_ERROR_INVALID_INPUT); |
||||
} |
||||
|
||||
// Get the session brief List by category |
||||
$sessionList = SessionManager::getSessionBriefListByCategory($sessionCategoryId, $params['target']); |
||||
|
||||
return $sessionList; |
||||
} |
||||
|
||||
/** |
||||
* @param $params |
||||
* @return null|soap_fault |
||||
*/ |
||||
public function WSSessionGetDetailsByUser($params) |
||||
{ |
||||
global $debug; |
||||
|
||||
if ($debug) error_log('WSUserSubscribedInCourse'); |
||||
if ($debug) error_log('Params '. print_r($params, 1)); |
||||
if (!WSHelperVerifyKey($params)) { |
||||
|
||||
return return_error(WS_ERROR_SECRET_KEY); |
||||
} |
||||
$result = return_error(WS_ERROR_NOT_FOUND_RESULT); |
||||
// Check params |
||||
if (is_array($params) && !empty($params['session_id']) && !empty($params['user_id'])) { |
||||
$userId = (int) $params['user_id']; |
||||
$sessionId = (int) $params['session_id']; |
||||
// Check if student is already subscribed |
||||
|
||||
$advsubPlugin = AdvancedSubscriptionPlugin::create(); |
||||
$isOpen = $advsubPlugin->isSessionOpen($sessionId); |
||||
$status = $advsubPlugin->getQueueStatus($userId, $sessionId); |
||||
$vacancy = $advsubPlugin->getVacancy($sessionId); |
||||
$data = $advsubPlugin->getSessionDetails($sessionId); |
||||
if (!empty($data) && is_array($data)) { |
||||
$data['status'] = $status; |
||||
// 5 Cases: |
||||
if ($isOpen) { |
||||
// Go to Course session |
||||
$data['action_url'] = $advsubPlugin->getSessionUrl($sessionId); |
||||
} else { |
||||
try { |
||||
$isAble = $advsubPlugin->isAbleToRequest($userId, $params); |
||||
$data['message'] = $advsubPlugin->getStatusMessage($status, $isAble); |
||||
} catch (\Exception $e) { |
||||
$data['message'] = $e->getMessage(); |
||||
} |
||||
$params['a'] = 'subscribe'; |
||||
$params['s'] = intval($sessionId); |
||||
$params['current_user_id'] = 0; // No needed |
||||
$params['u'] = intval($userId); |
||||
$params['q'] = 0; // No needed |
||||
$params['e'] = ADV_SUB_QUEUE_STATUS_START; |
||||
if ($vacancy > 0) { |
||||
// Check conditions |
||||
if ($status === ADV_SUB_QUEUE_STATUS_NO_QUEUE) { |
||||
// No in Queue, require queue subscription url action |
||||
$data['action_url'] = $advsubPlugin->getQueueUrl($params); |
||||
} elseif ($status === ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED) { |
||||
// send url action |
||||
$data['action_url'] = $advsubPlugin->getSessionUrl($sessionId); |
||||
} else { |
||||
// In queue, output status message, no more info. |
||||
} |
||||
} else { |
||||
if ($status === ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED) { |
||||
$data['action_url'] = $advsubPlugin->getSessionUrl($sessionId); |
||||
} else { |
||||
// in Queue or not, cannot be subscribed to session |
||||
$data['action_url'] = $advsubPlugin->getQueueUrl($params); |
||||
} |
||||
} |
||||
} |
||||
$result = $data; |
||||
} |
||||
} else { |
||||
// Return soap fault Not valid input params |
||||
$result = return_error(WS_ERROR_INVALID_INPUT); |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Get a list of sessions (id, coach_id, name, courses_num, users_num, classes_num, |
||||
* date_start, date_end, access_days_before_num, session_admin_id, visibility, |
||||
* session_category_id, promotion_id, |
||||
* validated_user_num, waiting_user_num, |
||||
* extra, course) the validated_usernum and waiting_user_num are |
||||
* used when have the plugin for advance incsription enables. |
||||
* The extra data (field_name, field_value) |
||||
* The course data (course_id, course_code, course_title, |
||||
* coach_username, coach_firstname, coach_lastname) |
||||
* @param array List of parameters (id, category_name, access_url_id, secret_key) |
||||
* @return array|soap_fault Sessions list (id=>[title=>'title',url='http://...',date_start=>'...',date_end=>'']) |
||||
*/ |
||||
function WSListSessionsDetailsByCategory($params) |
||||
{ |
||||
global $debug; |
||||
|
||||
if ($debug) error_log('WSListSessionsDetailsByCategory'); |
||||
if ($debug) error_log('Params '. print_r($params, 1)); |
||||
$secretKey = $params['secret_key']; |
||||
|
||||
// Check if secret key is valid |
||||
if(!WSHelperVerifyKey($secretKey)) { |
||||
|
||||
return return_error(WS_ERROR_SECRET_KEY); |
||||
} |
||||
|
||||
// Check if category ID is set |
||||
if (!empty($params['id']) && empty($params['category_name'])) { |
||||
$sessionCategoryId = $params['id']; |
||||
} elseif (!empty($params['category_name'])) { |
||||
// Check if category name is set |
||||
$sessionCategoryId = SessionManager::getSessionCategoryIdByName($params['category_name']); |
||||
if (is_array($sessionCategoryId)) { |
||||
$sessionCategoryId = current($sessionCategoryId); |
||||
} |
||||
} else { |
||||
// Return soap fault Not valid input params |
||||
|
||||
return return_error(WS_ERROR_INVALID_INPUT); |
||||
} |
||||
|
||||
// Get the session List by category |
||||
$sessionList = SessionManager::getSessionListAndExtraByCategoryId($sessionCategoryId); |
||||
|
||||
if (empty($sessionList)) { |
||||
// If not found any session, return error |
||||
|
||||
return return_error(WS_ERROR_NOT_FOUND_RESULT); |
||||
} |
||||
//@TODO: Not implemented yet, see BT#9092 |
||||
// Check if advanced inscription plugin is enabled |
||||
$isAdvancedInscriptionEnabled = false; |
||||
if ($isAdvancedInscriptionEnabled) { |
||||
// Get validated and waiting queue users count for each session |
||||
foreach ($sessionList as &$session) { |
||||
// Add validated and queue users count |
||||
$session['validated_user_num'] = 0; |
||||
$session['waiting_user_num'] = 0; |
||||
} |
||||
} else { |
||||
// Set -1 to validated and waiting queue users count |
||||
} |
||||
|
||||
return $sessionList; |
||||
} |
||||
|
||||
/** |
||||
* @param HookNotificationContentEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookNotificationContent(HookNotificationContentEventInterface $hook) |
||||
{ |
||||
$data = $hook->getEventData(); |
||||
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { |
||||
$data['advsub_pre_content'] = $data['content']; |
||||
|
||||
return $data; |
||||
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) { |
||||
if ( |
||||
isset($data['content']) && |
||||
!empty($data['content']) && |
||||
isset($data['advsub_pre_content']) && |
||||
!empty($data['advsub_pre_content']) |
||||
) { |
||||
$data['content'] = str_replace( |
||||
array( |
||||
'<br /><hr>', |
||||
'<br />', |
||||
'<br/>', |
||||
), |
||||
'', |
||||
$data['advsub_pre_content'] |
||||
); |
||||
} |
||||
|
||||
return $data; |
||||
} else { |
||||
// Hook type is not valid |
||||
// Nothing to do |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* @param HookNotificationTitleEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookNotificationTitle(HookNotificationTitleEventInterface $hook) |
||||
{ |
||||
$data = $hook->getEventData(); |
||||
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { |
||||
$data['advsub_pre_title'] = $data['title']; |
||||
|
||||
return $data; |
||||
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) { |
||||
if ( |
||||
isset($data['advsub_pre_title']) && |
||||
!empty($data['advsub_pre_title']) |
||||
) { |
||||
$data['title'] = $data['advsub_pre_title']; |
||||
} |
||||
|
||||
return $data; |
||||
} else { |
||||
// Hook type is not valid |
||||
// Nothing to do |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,74 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
/** |
||||
* Index of the Advanced subscription plugin courses list |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
/** |
||||
* Init |
||||
*/ |
||||
require_once __DIR__ . '/../config.php'; |
||||
// protect |
||||
api_protect_admin_script(); |
||||
// start plugin |
||||
$plugin = AdvancedSubscriptionPlugin::create(); |
||||
// Session ID |
||||
$s = isset($_REQUEST['s']) ? intval($_REQUEST['s']) : null; |
||||
|
||||
// Init template |
||||
$tpl = new Template('TESTING'); |
||||
// Get all sessions |
||||
$sessionList = $plugin->listAllSessions(); |
||||
|
||||
if (!empty($s)) { |
||||
// Get student list in queue |
||||
$studentList = $plugin->listAllStudentsInQueueBySession($s); |
||||
// Set selected to current session |
||||
$sessionList[$s]['selected'] = 'selected="selected"'; |
||||
$studentList['session']['id'] = $s; |
||||
// Assign variables |
||||
|
||||
// send mail to superior |
||||
$sessionArray = api_get_session_info($s); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($s, 'description'); |
||||
$sessionArray['description'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($s, 'target'); |
||||
$sessionArray['target'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($s, 'mode'); |
||||
$sessionArray['mode'] = $var['field_valiue']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($s, 'publication_end_date'); |
||||
$sessionArray['publication_end_date'] = $var['field_value']; |
||||
$var = $extraSession->get_values_by_handler_and_field_variable($s, 'recommended_number_of_participants'); |
||||
$sessionArray['recommended_number_of_participants'] = $var['field_valiue']; |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
|
||||
$data['a'] = 'confirm'; |
||||
$data['s'] = $s; |
||||
$data['current_user_id'] = api_get_user_id(); |
||||
|
||||
foreach ($studentList['students'] as &$student) { |
||||
$data['u'] = intval($student['user_id']); |
||||
$data['q'] = intval($student['queue_id']); |
||||
$data['e'] = ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED; |
||||
$student['acceptUrl'] = $plugin->getQueueUrl($data); |
||||
$data['e'] = ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED; |
||||
$student['rejectUrl'] = $plugin->getQueueUrl($data); |
||||
$student['complete_name'] = $student['lastname'] . ', ' . $student['firstname']; |
||||
$student['picture'] = UserManager::get_user_picture_path_by_id($student['user_id'], 'web', false, true); |
||||
$student['picture'] = UserManager::get_picture_user($student['user_id'], $student['picture']['file'], 22, USER_IMAGE_SIZE_MEDIUM); |
||||
} |
||||
$tpl->assign('session', $studentList['session']); |
||||
$tpl->assign('students', $studentList['students']); |
||||
} |
||||
|
||||
// Assign variables |
||||
$tpl->assign('sessionItems', $sessionList); |
||||
$tpl->assign('approveAdmin', ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED); |
||||
$tpl->assign('disapproveAdmin', ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED); |
||||
// Get rendered template |
||||
$content = $tpl->fetch('/advancedsubscription/views/admin_view.tpl'); |
||||
// Assign into content |
||||
$tpl->assign('content', $content); |
||||
// Display |
||||
$tpl->display_one_col_template(); |
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 493 B |
@ -0,0 +1,17 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
/** |
||||
* This script is included by main/admin/settings.lib.php when unselecting a plugin |
||||
* and is meant to remove things installed by the install.php script in both |
||||
* the global database and the courses tables |
||||
* @package chamilo.plugin.advancedsubscription |
||||
*/ |
||||
|
||||
/** |
||||
* Queries |
||||
*/ |
||||
require_once dirname(__FILE__) . '/config.php'; |
||||
if (!api_is_platform_admin()) { |
||||
die ('You must have admin permissions to uninstall plugins'); |
||||
} |
||||
AdvancedSubscriptionPlugin::create()->uninstall(); |
||||
@ -0,0 +1,204 @@ |
||||
<style type="text/css"> |
||||
.text-title-select{ |
||||
display: inline-block; |
||||
} |
||||
#session-select{ |
||||
display: inline-block; |
||||
} |
||||
.title-name-session{ |
||||
display: block; |
||||
padding-top: 10px; |
||||
padding-bottom: 10px; |
||||
font-weight: normal; |
||||
margin-top: 5px; |
||||
margin-bottom: 5px; |
||||
} |
||||
.badge-dis{ |
||||
background-color: #008080; |
||||
font-size: 20px; |
||||
} |
||||
.badge-recom{ |
||||
background-color:#88aa00 ; |
||||
font-size: 20px; |
||||
} |
||||
.separate-badge{ |
||||
margin-bottom: 20px; |
||||
margin-top: 20px; |
||||
} |
||||
.date, .mode{ |
||||
display: inline-block; |
||||
} |
||||
.img-circle{ |
||||
border-radius: 500px; |
||||
-moz-border-radius: 500px; |
||||
-webkit-border-radius: 500px; |
||||
} |
||||
#student_table.table td{ |
||||
vertical-align: middle; |
||||
text-align: center; |
||||
} |
||||
#student_table.table td.name{ |
||||
color: #084B8A; |
||||
text-align: left; |
||||
|
||||
} |
||||
#student_table.table th{ |
||||
font-size: 14px; |
||||
vertical-align: middle; |
||||
text-align: center; |
||||
} |
||||
#modalMail{ |
||||
width: 770px; |
||||
margin-top: -180px !important; |
||||
margin-left: -385px !important; |
||||
} |
||||
|
||||
#modalMail .modal-body { |
||||
height: 360px; |
||||
overflow: visible; |
||||
} |
||||
|
||||
#iframeAdvsub { |
||||
|
||||
} |
||||
</style> |
||||
|
||||
<form id="form_advsub_admin" class="form-search" method="post" action="/plugin/advancedsubscription/src/admin_view.php" name="form_advsub_admin"> |
||||
<div class="row"> |
||||
<div class="span6"> |
||||
<p class="text-title-select">Elige una sesión de formación</p> |
||||
<select id="session-select" name="s"> |
||||
<option value="0"> |
||||
{{ "SelectASession" | get_plugin_lang('AdvancedSubscriptionPlugin') }} |
||||
</option> |
||||
{% for sessionItem in sessionItems %} |
||||
<option value="{{ sessionItem.id }}" {{ sessionItem.selected }}> |
||||
{{ sessionItem.name }} |
||||
</option> |
||||
{% endfor %} |
||||
</select> |
||||
|
||||
<h4>{{ "SessionName" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</h4> |
||||
<h3 class="title-name-session">{{ session.name }}</h3> |
||||
<h4>{{ "Target" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</h4> |
||||
<p>{{ session.target }}</p> |
||||
|
||||
</div> |
||||
<div class="span6"> |
||||
<p class="separate-badge"> |
||||
<span class="badge badge-dis">{{ session.vacancies }}</span> |
||||
{{ "Vacancies" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p> |
||||
<p class="separate-badge"> |
||||
<span class="badge badge-recom">{{ session.recommended_number_of_participants }}</span> |
||||
{{ "RecommendedNumberOfParticipants" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p> |
||||
<h4>{{ "PublicationEndDate" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</h4> <p>{{ session.publication_end_date }}</p> |
||||
<h4>{{ "Mode" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</h4> <p>{{ session.mode }}</p> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="span12"> |
||||
<div class="student-list-table"> |
||||
<table id="student_table" class="table table-striped"> |
||||
<tbody> |
||||
<tr> |
||||
<th style="width: 118px;"><img src="img/icon-avatar.png"/> </th> |
||||
<th>{{ "Postulant" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</th> |
||||
<th>{{ "InscriptionDate" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</th> |
||||
<th>{{ "BossValidation" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</th> |
||||
<th>{{ "Decision" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</th> |
||||
</tr> |
||||
{% set row_class = "row_odd" %} |
||||
{% for student in students %} |
||||
<tr class="{{ row_class }}"> |
||||
<td style="width: 118px;"><img src="{{ student.picture.file }}" class="img-circle"> </td> |
||||
<td class="name">{{ student.complete_name }}</td> |
||||
<td>{{ student.created_at }}</td> |
||||
<td>{{ student.validation }}</td> |
||||
<td> |
||||
<a |
||||
class="btn btn-success btn-advsub btn-accept" |
||||
href="{{ student.acceptUrl }}" |
||||
> |
||||
Aceptar |
||||
</a> |
||||
<a |
||||
class="btn btn-danger btn-advsub btn-reject" |
||||
href="{{ student.rejectUrl }}" |
||||
> |
||||
Rechazar |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% if row_class == "row_even" %} |
||||
{% set row_class = "row_odd" %} |
||||
{% else %} |
||||
{% set row_class = "row_even" %} |
||||
{% endif %} |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<input name="f" value="social" type="hidden"> |
||||
</form> |
||||
<div class="modal fade" id="modalMail" tabindex="-1" role="dialog" aria-labelledby="privacidadLabel" aria-hidden="true"> |
||||
<div class="modal-dialog"> |
||||
<div class="modal-content"> |
||||
<div class="modal-header"> |
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
||||
<h4 class="modal-title" id="privacidadLabel">{{ "AdvancedSubscriptionAdminViewTitle" | get_plugin_lang('AdvancedSubscriptionPlugin')}}</h4> |
||||
</div> |
||||
<div class="modal-body"> |
||||
<iframe id="iframeAdvsub" style="width: 100%; height: 100%;" frameBorder="0"> |
||||
</iframe> |
||||
</div> |
||||
<div class="modal-footer"> |
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cerrar</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
$(document).ready(function(){ |
||||
$("#session-select").change(function () { |
||||
$("#form_advsub_admin").submit(); |
||||
}); |
||||
$("a.btn-advsub").click(function(event){ |
||||
event.preventDefault(); |
||||
var confirmed = false; |
||||
var studentName = $(this).closest("tr").find(".name").html(); |
||||
if (studentName) { |
||||
studentName = "de " + studentName + " ?"; |
||||
} else { |
||||
studentName = " ?" |
||||
} |
||||
if ($(this).hasClass('btn-accept')) { |
||||
var confirmed = confirm( |
||||
"¿Esta seguro de que desea aceptar la inscripción " + studentName |
||||
); |
||||
} else { |
||||
var confirmed = confirm( |
||||
"¿Esta seguro de que desea aceptar la inscripción " + studentName |
||||
); |
||||
} |
||||
if (confirmed) { |
||||
var thisBlock = $(this).closest("tr"); |
||||
var advsubUrl = $(this).attr("href") |
||||
$("#iframeAdvsub").attr("src", advsubUrl) |
||||
$("#modalMail").modal("show"); |
||||
$.ajax({ |
||||
dataType: "json", |
||||
url: advsubUrl |
||||
}).done(function(result){ |
||||
if (result.error == true) { |
||||
thisBlock.slideUp(); |
||||
} else { |
||||
console.log(result); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Información: Validación de inscripción recibida </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>Hemos recibido y registrado su validación de la inscripción de <strong>{{ student.complete_name_with_username }}</strong> al curso <strong>{{ session.name }}</strong></p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Aprobada: su inscripción al curso {{ session.name }} fue confirmada! </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Nos complace informarle que su inscripción al curso <strong>{{ session.name }}</strong> iniciando el <strong>{{ session.date_start }}</strong> fue validada por los administradores. Esperamos mantenga todo su ánimo y participe en otro curso o, en otra oportunidad, a este mismo curso.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Información: Validación de inscripción de {{ student.complete_name }} al curso {{ session.name }} </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>La inscripción de <strong>{{ student.complete_name }}</strong> al curso <strong>{{ session.name }}</strong> iniciando el <strong>{{ session.date_start }}</strong>, que estaba pendiente de validación por los organizadores del curso, fue validada hacen unos minutos. Esperamos nos ayude en asegurar la completa disponibilidad de su colaborador(a) para la duración completa del curso.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Información: rechazo de inscripción recibido </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>Hemos recibido y registrado su rechazo de la inscripción de <strong>{{ student.complete_name_with_username }}</strong> al curso <strong>{{ session.name }}</strong></p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Rechazamos su inscripción al curso {{ session.name }} </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Lamentamos informarle que su inscripción al curso <strong>{{ session.name }}</strong> iniciando el <strong>{{ session.name }}</strong> fue rechazada por falta de cupos. Esperamos mantenga todo su ánimo y participe en otro curso o, en otra oportunidad, a este mismo curso.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Información: Rechazo de inscripción de {{ student.complete_name }} al curso {{ session.name }} </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>La inscripción de <strong>{{ student.complete_name }}</strong> al curso <strong>{{ session.name }}</strong>, que había aprobado anteriormente, fue rechazada por falta de cupos. Les presentamos nuestras disculpas sinceras.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,87 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Confirmación: Aprobación recibida para {{ student.complete_name }} </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>Hemos recibido y registrado su decisión de aprobar el curso <strong>{{ session.name }}</strong> para su colaborador <strong>{{ student.complete_name }}</strong></p> |
||||
<p>Ahora la inscripción al curso está pendiente de la disponibilidad de cupos. Le mantendremos informado sobre el resultado de esta etapa</p> |
||||
<p>Gracias por su colaboración.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,95 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Aprobación de {{ student.complete_name }} al curso {{ session.name }} </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>La inscripción del alumno |
||||
<strong>{{ student.complete_name_with_username }}</strong> |
||||
al curso <strong>{{ session.name }}</strong> |
||||
ha sido aprobada por su superior. |
||||
Puede gestionar las inscripciones al curso |
||||
<a href="{{ admin_view_url }}"> |
||||
<strong>aquí</strong> |
||||
</a> |
||||
<strong></strong> |
||||
</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Inscripciones a {{ session.name }} pendiente de confirmación</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>Las inscripciones siguientes al curso {{ session.name }} están pendientes de validación para ser efectivas. Por favor, dirigese al la <a href="{{ admin_view_url }}">página de administración</a> para validarlos.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Confirmación: Desaprobación recibida para {{ student.complete_name }} </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>Hemos recibido y registrado su decisión de desaprobar el curso <strong>{{ session.name }}</strong> para su colaborador <strong>{{ student.complete_name }}</strong></p> |
||||
<p>Gracias por su colaboración</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,87 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Solicitud recibida para el curso {{ session.name }}</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Hemos recibido y registrado su solicitud de inscripción al curso <strong>{{ session.name }}</strong> para iniciarse el <strong>{{ session.date_start }}</strong>.</p> |
||||
<p>Su inscripción es pendiente primero de la aprobación de su superior, y luego de la disponibilidad de cupos. Un correo ha sido enviado a su superior para revisión y aprobación de su solicitud.</p> |
||||
<p>Gracias.</p> |
||||
<p><strong>Equipo Forge</strong></p></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,87 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Solicitud recibida para el curso {{ session.name }}</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Hemos recibido y registrado su solicitud de inscripción al curso <strong>{{ session.name }}</strong> para iniciarse el <strong>{{ session.date_start }}</strong>.</p> |
||||
<p>Su inscripción es pendiente de la disponibilidad de cupos. Pronto recibirá los resultados de su aprobación de su solicitud.</p> |
||||
<p>Gracias.</p> |
||||
<p><strong>Equipo Forge</strong></p></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,87 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Información: Solicitud pendiente de aprobación para el curso {{ session.name }}</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Este correo es para confirmar que hemos recibido y registrado su solicitud de inscripción al curso <strong>{{ session.name }}</strong>, por iniciarse el <strong>{{ session.date_start }}</strong>. </p> |
||||
<p>Su inscripción todavía no ha sido aprobada por su superior, por lo que hemos vuelto a enviarle un correo electrónico de recordatorio.</p> |
||||
<p>Gracias por su paciencia.</p> |
||||
<p><strong>Equipo Forge</strong></p></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,95 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Solicitud de consideración de curso para un colaborador</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>Hemos recibido una solicitud de inscripción de <strong>{{ student.complete_name }}</strong> al curso <strong>{{ session.name }}</strong>, por iniciarse el <strong>{{ session.date_start }}</strong>. Detalles del curso: <strong>{{ session.description }}</strong>. </p> |
||||
<p>Le invitamos a aprobar o desarprobar esta inscripción, dando clic en el botón correspondiente a continuación.</p> |
||||
<table width="100%" border="0" cellspacing="3" cellpadding="4" style="background:#EDE9EA"> |
||||
<tr> |
||||
<td width="58" valign="middle"><img src="{{ student.picture.file }}" width="50" height="50" alt=""></td> |
||||
<td width="211" valign="middle"><h4>{{ student.complete_name }}</h4></td> |
||||
<td width="90" valign="middle"><a href="{{ student.acceptUrl }}"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/aprobar.png" width="90" height="25" alt=""></a></td> |
||||
<td width="243" valign="middle"><a href="{{ student.rejectUrl }}"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/desaprobar.png" width="90" height="25" alt=""></a></td> |
||||
</tr> |
||||
</table> |
||||
<p>Gracias.</p> |
||||
<p><strong>Equipo Forge</strong></p></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Aprobado: Su inscripción al curso {{ session.name }} ha sido aprobada por su superior </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Nos complace informarle que su inscripción al curso <strong>{{ session.name }}</strong> ha sido aprobada por su superior. Su inscripción ahora solo se encuentra pendiente de disponibilidad de cupos. Le avisaremos tan pronto como se confirme este último paso.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,86 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Información: Su inscripción al curso {{ session.name }} ha sido rechazada </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>Lamentamos informarle que, en esta oportunidad, su inscripción al curso <strong>{{ session.name }}</strong> NO ha sido aprobada. Esperamos mantenga todo su ánimo y participe en otro curso o, en otra oportunidad, a este mismo curso.</p> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,97 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Solicitud de consideración de curso para un colaborador</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>Le recordamos que hemos recibido las siguientes solicitudes de suscripción<strong> </strong>al curso <strong>{{ session.name }}</strong> de parte de sus colaboradores. El curso se iniciará el <strong>{{ session.date_start }}</strong>. Detalles del curso: <strong>{{ session.description }}</strong>. </p> |
||||
<p>Le invitamos a aprobar o desarprobar las suscripciones, dando clic en el botón correspondiente a continuación para cada colaborador.</p> |
||||
<table width="100%" border="0" cellspacing="3" cellpadding="4" style="background:#EDE9EA"> |
||||
{% for student in students %} |
||||
<tr> |
||||
<td valign="middle"><img src="{{ student.picture.file }}" width="50" height="50" alt=""></td> |
||||
<td valign="middle"><h4>{{ student.complete_name }}</h4></td> |
||||
<td valign="middle"><a href="{{ student.acceptUrl }}"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/aprobar.png" width="90" height="25" alt=""></a></td> |
||||
<td valign="middle"><a href="{{ student.rejectUrl }}"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/desaprobar.png" width="90" height="25" alt=""></a></td> |
||||
</tr> |
||||
{% endfor %} |
||||
</table> |
||||
<p>Gracias.</p> |
||||
<p><strong>Equipo Forge</strong></p></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1,97 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Solicitud recibida para el curso {{ session.name }}</title> |
||||
<style type="text/css"> |
||||
.titulo { |
||||
color: #93c5cd; |
||||
font-family: "Times New Roman", Times, serif; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
border-bottom-width: 2px; |
||||
border-bottom-style: solid; |
||||
border-bottom-color: #93c5cd; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/header.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td width="394"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/logo-minedu.png" width="230" height="60" alt="Ministerio de Educación"></td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td style="color: #93c5cd; font-family: Times New Roman, Times, serif; font-size: 24px; font-weight: bold; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #93c5cd;">Recordatorio: Solicitud de consideración de curso para colaborador(es)</td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
<td> </td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td height="356"> </td> |
||||
<td valign="top"><p>Estimado:</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>Le recordamos que hemos recibido las siguientes solicitudes de suscripción<strong> </strong>al curso <strong>{{ session.name }}</strong> de parte de sus colaboradores. El curso se iniciará el <strong>{{ session.date_start }}</strong>. Detalles del curso: <strong>{{ session.description }}</strong>. </p> |
||||
<p>Este curso tiene una cantidad de cupos limitados y ha recibido una alta tasa de solicitudes de inscripción, por lo que recomendamos que cada área apruebe un máximo de <strong>{{ session.recommended_number_of_participants }}</strong> candidatos. Le invitamos a aprobar o desaprobar las suscripciones, dando clic en el botón correspondiente a continuación para cada colaborador.</p> |
||||
<table width="100%" border="0" cellspacing="3" cellpadding="4" style="background:#EDE9EA"> |
||||
{% for student in students %} |
||||
<tr> |
||||
<td valign="middle"><img src="{{ student.picture.file }}" width="50" height="50" alt=""></td> |
||||
<td valign="middle"><h4>{{ student.complete_name }}</h4></td> |
||||
<td valign="middle"><a href="{{ student.approveUrl }}"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/aprobar.png" width="90" height="25" alt=""></a></td> |
||||
<td valign="middle"><a href="{{ student.rejectUrl }}"><img src="{{ _p.web_plugin }}advancedsubscription/views/img/desaprobar.png" width="90" height="25" alt=""></a></td> |
||||
</tr> |
||||
{% endfor %} |
||||
</table> |
||||
<p>Gracias.</p> |
||||
<h3>{{ signature }}</h3></td> |
||||
<td> </td> |
||||
</tr> |
||||
<tr> |
||||
<td width="50"> </td> |
||||
<td> </td> |
||||
<td width="50"> </td> |
||||
</tr> |
||||
</table></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 270 B |
|
After Width: | Height: | Size: 267 B |
|
After Width: | Height: | Size: 283 B |
|
After Width: | Height: | Size: 8.2 KiB |