Rename variables, constants, plugin table, update mail header logo dir - refs BT#9092

1.10.x
Daniel Barreto 11 years ago
parent 54372874fb
commit bc8088f103
  1. 80
      plugin/advanced_subscription/ajax/advanced_subscription.ajax.php
  2. 31
      plugin/advanced_subscription/config.php
  3. 36
      plugin/advanced_subscription/lang/english.php
  4. 15
      plugin/advanced_subscription/lang/spanish.php
  5. 223
      plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php
  6. 91
      plugin/advanced_subscription/src/HookAdvancedSubscription.php
  7. 32
      plugin/advanced_subscription/src/admin_view.php
  8. BIN
      plugin/advanced_subscription/src/img/avatar.png
  9. 26
      plugin/advanced_subscription/test/mails.php
  10. 10
      plugin/advanced_subscription/views/admin_accepted_notice_admin.tpl
  11. 10
      plugin/advanced_subscription/views/admin_accepted_notice_student.tpl
  12. 10
      plugin/advanced_subscription/views/admin_accepted_notice_superior.tpl
  13. 10
      plugin/advanced_subscription/views/admin_rejected_notice_admin.tpl
  14. 10
      plugin/advanced_subscription/views/admin_rejected_notice_student.tpl
  15. 10
      plugin/advanced_subscription/views/admin_rejected_notice_superior.tpl
  16. 25
      plugin/advanced_subscription/views/admin_view.tpl
  17. BIN
      plugin/advanced_subscription/views/img/avatar.png
  18. 0
      plugin/advanced_subscription/views/img/icon-avatar.png
  19. BIN
      plugin/advanced_subscription/views/img/logo-minedu.png
  20. 10
      plugin/advanced_subscription/views/reminder_notice_admin.tpl
  21. 10
      plugin/advanced_subscription/views/reminder_notice_student.tpl
  22. 14
      plugin/advanced_subscription/views/reminder_notice_superior.tpl
  23. 14
      plugin/advanced_subscription/views/reminder_notice_superior_max.tpl
  24. 10
      plugin/advanced_subscription/views/student_no_superior_notice_admin.tpl
  25. 10
      plugin/advanced_subscription/views/student_no_superior_notice_student.tpl
  26. 10
      plugin/advanced_subscription/views/student_notice_student.tpl
  27. 14
      plugin/advanced_subscription/views/student_notice_superior.tpl
  28. 10
      plugin/advanced_subscription/views/superior_accepted_notice_admin.tpl
  29. 10
      plugin/advanced_subscription/views/superior_accepted_notice_student.tpl
  30. 10
      plugin/advanced_subscription/views/superior_accepted_notice_superior.tpl
  31. 10
      plugin/advanced_subscription/views/superior_rejected_notice_student.tpl
  32. 10
      plugin/advanced_subscription/views/superior_rejected_notice_superior.tpl

@ -15,23 +15,23 @@ $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['action'] = Security::remove_XSS($_REQUEST['a']);
$data['sessionId'] = intval($_REQUEST['s']);
$data['currentUserId'] = intval($_REQUEST['current_user_id']);
$data['studentUserId'] = intval($_REQUEST['u']);
$data['queueId'] = intval($_REQUEST['q']);
$data['newStatus'] = 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';
$verified = $plugin->checkHash($data, $hash) || $data['action'] == 'subscribe';
if ($verified) {
switch($data['a']) {
switch($data['action']) {
case 'check': // Check minimum requirements
try {
$res = AdvancedSubscriptionPlugin::create()->isAllowedToDoRequest($data['u'], $data);
$res = AdvancedSubscriptionPlugin::create()->isAllowedToDoRequest($data['studentUserId'], $data);
if ($res) {
$result['error'] = false;
$result['errorMessage'] = 'No error';
@ -46,14 +46,14 @@ if ($verified) {
break;
case 'subscribe': // Subscription
// Start subscription to queue
$res = AdvancedSubscriptionPlugin::create()->startSubscription($data['u'], $data['s'], $data);
$res = AdvancedSubscriptionPlugin::create()->startSubscription($data['studentUserId'], $data['sessionId'], $data);
// Check if queue subscription was successful
if ($res === true) {
// Prepare data
// Get session data
// Assign variables
$fieldsArray = array('description', 'target', 'mode', 'publication_end_date', 'recommended_number_of_participants');
$sessionArray = api_get_session_info($data['s']);
$sessionArray = api_get_session_info($data['sessionId']);
$extraSession = new ExtraFieldValue('session');
$extraField = new ExtraField('session');
// Get session fields
@ -65,7 +65,7 @@ if ($verified) {
$fields[$field['id']] = $field['field_variable'];
}
$mergedArray = array_merge(array($data['s']), array_keys($fields));
$mergedArray = array_merge(array($data['sessionId']), array_keys($fields));
$sessionFieldValueList = $extraSession->get_all(array('session_id = ? field_id IN ( ?, ?, ?, ?, ?, ?, ? )' => $mergedArray));
foreach ($sessionFieldValueList as $sessionFieldValue) {
// Check if session field value is set in session field list
@ -77,11 +77,11 @@ if ($verified) {
}
}
// Get student data
$studentArray = api_get_user_info($data['u']);
$studentArray = api_get_user_info($data['studentUserId']);
$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']);
$superiorId = UserManager::getStudentBoss($data['studentUserId']);
if (!empty($superiorId)) {
$superiorArray = api_get_user_info($superiorId);
} else {
@ -98,7 +98,7 @@ if ($verified) {
}
unset($admin);
// Set data
$data['a'] = 'confirm';
$data['action'] = 'confirm';
$data['student'] = $studentArray;
$data['superior'] = $superiorArray;
$data['admins'] = $adminsArray;
@ -109,13 +109,13 @@ if ($verified) {
if (empty($superiorId)) {
// Student boss does not exist
// Update status to accepted by boss
$res = $plugin->updateQueueStatus($data, ADV_SUB_QUEUE_STATUS_BOSS_APPROVED);
$res = $plugin->updateQueueStatus($data, ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED);
if (!empty($res)) {
// Prepare admin url
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) .
'advanced_subscription/src/admin_view.php?s=' . $data['s'];
'advanced_subscription/src/admin_view.php?s=' . $data['sessionId'];
// Send mails
$result['mailIds'] = $plugin->sendMail($data, ADV_SUB_ACTION_STUDENT_REQUEST_NO_BOSS);
$result['mailIds'] = $plugin->sendMail($data, ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST_NO_BOSS);
// Check if mails were sent
if (!empty($result['mailIds'])) {
$result['error'] = false;
@ -134,13 +134,13 @@ if ($verified) {
} else {
// Student boss does exist
// Get url to be accepted by boss
$data['e'] = ADV_SUB_QUEUE_STATUS_BOSS_APPROVED;
$data['newStatus'] = ADVANCED_SUBSCRIPTION_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['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED;
$data['student']['rejectUrl'] = $plugin->getQueueUrl($data);
// Send mails
$result['mailIds'] = $plugin->sendMail($data, ADV_SUB_ACTION_STUDENT_REQUEST);
$result['mailIds'] = $plugin->sendMail($data, ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST);
// Check if mails were sent
if (!empty($result['mailIds'])) {
$result['error'] = false;
@ -168,14 +168,14 @@ if ($verified) {
break;
case 'confirm':
// Check if new status is set
if (isset($data['e'])) {
if (isset($data['newStatus'])) {
// Update queue status
$res = $plugin->updateQueueStatus($data, $data['e']);
$res = $plugin->updateQueueStatus($data, $data['newStatus']);
if ($res === true) {
// Prepare data
// Prepare session data
$fieldsArray = array('description', 'target', 'mode', 'publication_end_date', 'recommended_number_of_participants');
$sessionArray = api_get_session_info($data['s']);
$sessionArray = api_get_session_info($data['sessionId']);
$extraSession = new ExtraFieldValue('session');
$extraField = new ExtraField('session');
// Get session fields
@ -187,7 +187,7 @@ if ($verified) {
$fields[$field['id']] = $field['field_variable'];
}
$mergedArray = array_merge(array($data['s']), array_keys($fields));
$mergedArray = array_merge(array($data['sessionId']), array_keys($fields));
$sessionFieldValueList = $extraSession->get_all(array('session_id = ? field_id IN ( ?, ?, ?, ?, ?, ?, ? )' => $mergedArray));
foreach ($sessionFieldValueList as $sessionFieldValue) {
// Check if session field value is set in session field list
@ -199,11 +199,11 @@ if ($verified) {
}
}
// Prepare student data
$studentArray = api_get_user_info($data['u']);
$studentArray = api_get_user_info($data['studentUserId']);
$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']);
$superiorId = UserManager::getStudentBoss($data['studentUserId']);
if (!empty($superiorId)) {
$superiorArray = api_get_user_info($superiorId);
} else {
@ -225,22 +225,22 @@ if ($verified) {
$data['admins'] = $adminsArray;
$data['session'] = $sessionArray;
$data['signature'] = api_get_setting('Institution');
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . 'advanced_subscription/src/admin_view.php?s=' . $data['s'];
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) . 'advanced_subscription/src/admin_view.php?s=' . $data['sessionId'];
// 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;
switch ($data['newStatus']) {
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED:
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE;
break;
case ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED:
$data['action'] = ADV_SUB_ACTION_SUPERIOR_DISAPPROVE;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED:
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE;
break;
case ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED:
$data['action'] = ADV_SUB_ACTION_ADMIN_APPROVE;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED:
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE;
break;
case ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED:
$data['action'] = ADV_SUB_ACTION_ADMIN_DISAPPROVE;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED:
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE;
break;
default:
break;
@ -248,8 +248,8 @@ if ($verified) {
}
// Student Session inscription
if ($data['e'] == ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED) {
SessionManager::suscribe_users_to_session($data['s'], array($data['u']), null, false);
if ($data['newStatus'] == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
SessionManager::suscribe_users_to_session($data['sessionId'], array($data['studentUserId']), null, false);
}
// Send mails
@ -273,7 +273,7 @@ if ($verified) {
}
break;
default:
$result['errorMessage'] = 'Action do not exist!';
$result['errorMessage'] = 'This action does not exist!';
}
}

@ -6,24 +6,21 @@
* @package chamilo.plugin.advanced_subscription
*/
define('TABLE_ADV_SUB_QUEUE', 'plugin_advsub_queue');
define('TABLE_ADVANCED_SUBSCRIPTION_QUEUE', 'plugin_advanced_subscription_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('ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST', 0);
define('ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE', 1);
define('ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE', 2);
define('ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_SELECT', 3);
define('ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE', 4);
define('ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE', 5);
define('ADVANCED_SUBSCRIPTION_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);
define('ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE', -1);
define('ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START', 0);
define('ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED', 1);
define('ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED', 2);
define('ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED', 3);
define('ADVANCED_SUBSCRIPTION_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) . 'advanced_subscription/src/AdvancedSubscriptionPlugin.php';
require_once api_get_path(PLUGIN_PATH) . 'advanced_subscription/src/HookAdvancedSubscription.php';

@ -4,23 +4,32 @@
$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['ws_url_help'] = 'La URL de la cual se solicitará información para el proceso de la inscripción avanzada';
$strings['check_induction'] = 'Activate induction course requirement';
$strings['check_induction_help'] = 'Check to require induction course';
$strings['yearly_cost_limit'] = 'Yearly limit TUV for courses (measured in Taxation units)';
$strings['yearly_cost_limit_help'] = "How much TUV the student courses should cost at most.";
$strings['yearly_hours_limit'] = 'Yearly limit teaching hours for courses';
$strings['yearly_hours_limit_help'] = "How many teching hours the student may learn by year.";
$strings['yearly_cost_unit_converter'] = 'Taxation unit value (TUV)';
$strings['yearly_cost_unit_converter_help'] = "The taxation unit value for current year in local currency";
$strings['courses_count_limit'] = 'Yearly limit times for courses';
$strings['courses_count_limit_help'] = "How many times a student can course, this does <strong>not</strong> include induction courses";
$strings['course_session_credit_year_start_date'] = 'Year start date';
$strings['course_session_credit_year_start_date_help'] = "a date (dd/mm)";
$strings['min_profile_percentage'] = "Minimum required of completed percentage profile";
$strings['min_profile_percentage_help'] = "Percentage number( > 0.00 y < 100.00)";
/* 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['AdvancedSubscriptionCostXLimitReached'] = "We are sorry, you have already reached yearly limit %s TUV cost for courses ";
$strings['AdvancedSubscriptionTimeXLimitReached'] = "We are sorry, you have already reached yearly limit %s hours for courses";
$strings['AdvancedSubscriptionCourseXLimitReached'] = "We are sorry, you have already reached yearly limit %s times for courses";
$strings['AdvancedSubscriptionNotMoreAble'] = "We are sorry, you no longer fulfills the initial conditions to subscribe this course";
$strings['AdvancedSubscriptionIncompleteParams'] = "The parameters are wrong or incomplete.";
$strings['AdvancedSubscriptionIsNotEnabled'] = "Advanced subscription is not enabled";
$strings['AdvancedSubscriptionNoQueue'] = "You are not subscribed for this course.";
$strings['AdvancedSubscriptionNoQueueIsAble'] = "You are not subscribed, but you are qualified for this course.";
@ -42,7 +51,7 @@ $strings['MailStudentRequestNoBoss'] = 'Student registration request without bos
// TPL langs
// Admin view
$strings['SelectASession'] = 'Select a session';
$strings['SelectASession'] = 'Select a training session';
$strings['SessionName'] = 'Session name';
$strings['Target'] = 'Target audience';
$strings['Vacancies'] = 'Vacancies';
@ -60,6 +69,11 @@ $strings['RejectInfinitive'] = 'Reject';
$strings['AreYouSureYouWantToAcceptSubscriptionOfX'] = 'Are you sure you want to accept the subscription of %s?';
$strings['AreYouSureYouWantToRejectSubscriptionOfX'] = 'Are you sure you want to reject the subscription of %s?';
$strings['MailTitle'] = 'Received request for course %s';
$strings['MailDear'] = 'Dear:';
$strings['MailThankYou'] = 'Thank you.';
$strings['MailThankYouCollaboration'] = 'Thank you for your help.';
// Admin Accept
$strings['MailTitleAdminAcceptToAdmin'] = 'Information: Has been received inscription validation';
$strings['MailContentAdminAcceptToAdmin'] = 'We have received and registered your inscription validation for student <strong>%s</strong> to course <strong>%s</strong>';
@ -117,4 +131,4 @@ $strings['MailContentReminderSuperior'] = 'We remind you, we have received inscr
$strings['MailContentReminderSuperiorSecond'] = 'We invite you to accept or reject inscription request, clicking corresponding button for each collaborator.';
$strings['MailTitleReminderMaxSuperior'] = 'Reminder: Course inscription request for your collaborators';
$strings['MailContentReminderMaxSuperior'] = 'We remind you, we have received inscription requests below to course <strong>%s</strong> for your collaborators. This course is starting at <strong>%s</strong>. Course details: <strong>%s</strong>.';
$strings['MailContentReminderMaxSuperiorSecond'] = 'This course have limited vacancies and has received a high inscription request rate, So we recommend all areas to accept at most <strong>%s</strong> candidates. We invite you to accept or reject inscription request, clicking corresponding button for each collaborator.';
$strings['MailContentReminderMaxSuperiorSecond'] = 'This course have limited vacancies and has received a high inscription request rate, So we recommend all areas to accept at most <strong>%s</strong> candidates. We invite you to accept or reject inscription request, clicking corresponding button for each collaborator.';

@ -7,8 +7,6 @@ $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';
@ -22,7 +20,6 @@ $strings['course_session_credit_year_start_date_help'] = "Fecha de inicio del a
$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";
@ -32,10 +29,16 @@ $strings['AdvancedSubscriptionTimeXLimitReached'] = "Lo sentimos, usted ya ha al
$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
$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'] = 'Solicitud de registro de estudiante';
@ -48,7 +51,7 @@ $strings['MailStudentRequestNoBoss'] = 'Solicitud de registro de estudiante sin
// TPL translations
// Admin view
$strings['SelectASession'] = 'Elija una sesión';
$strings['SelectASession'] = 'Elija una sesión de formación';
$strings['SessionName'] = 'Nombre de la sesión';
$strings['Target'] = 'Publico objetivo';
$strings['Vacancies'] = 'Vacantes';

@ -1,7 +1,6 @@
<?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.advanced_subscription
@ -17,7 +16,6 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
function __construct()
{
$parameters = array(
'tool_enable' => 'boolean',
'yearly_cost_limit' => 'text',
'yearly_hours_limit' => 'text',
'yearly_cost_unit_converter' => 'text',
@ -26,7 +24,6 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
'ws_url' => 'text',
'min_profile_percentage' => 'text',
'check_induction' => 'boolean',
'confirmation_message' => 'wysiwyg',
'secret_key' => 'text',
);
@ -71,9 +68,9 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
private function installDatabase()
{
$pAdvSubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$sql = "CREATE TABLE IF NOT EXISTS $pAdvSubQueueTable (" .
$sql = "CREATE TABLE IF NOT EXISTS $advancedSubscriptionQueueTable (" .
"id int UNSIGNED NOT NULL AUTO_INCREMENT, " .
"session_id int UNSIGNED NOT NULL, " .
"user_id int UNSIGNED NOT NULL, " .
@ -81,8 +78,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
"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)); ";
"PRIMARY KEY PK_advanced_subscription_queue (id), " .
"UNIQUE KEY UK_advanced_subscription_queue (user_id, session_id)); ";
Database::query($sql);
}
@ -93,14 +90,14 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
private function uninstallDatabase()
{
/* Drop plugin tables */
$pAdvSubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$sql = "DROP TABLE IF EXISTS $pAdvSubQueueTable; ";
$sql = "DROP TABLE IF EXISTS $advancedSubscriptionQueueTable; ";
Database::query($sql);
/* Delete settings */
$tSettings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
Database::query("DELETE FROM $tSettings WHERE subkey = 'advanced_subscription'");
$settingsTable = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
Database::query("DELETE FROM $settingsTable WHERE subkey = 'advanced_subscription'");
}
/**
@ -115,39 +112,39 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
public function isAllowedToDoRequest($userId, $params = array())
{
if (isset($params['is_connected']) && isset($params['profile_completed'])) {
$isAble = false;
$advSubPlugin = self::create();
$wsUrl = $advSubPlugin->get('ws_url');
$isAllowed = false;
$plugin = self::create();
$wsUrl = $plugin->get('ws_url');
// @TODO: Get connection status from user by WS
$isConnected = $params['is_connected'];
if ($isConnected) {
$profileCompletedMin = (float) $advSubPlugin->get('min_profile_percentage');
$profileCompletedMin = (float) $plugin->get('min_profile_percentage');
// @TODO: Get completed profile percentage by WS
$profileCompleted = (float) $params['profile_completed'];
if ($profileCompleted > $profileCompletedMin) {
$checkInduction = $advSubPlugin->get('check_induction');
$checkInduction = $plugin->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');
$uitMax = $plugin->get('yearly_cost_unit_converter');
$uitMax *= $plugin->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');
$expendedTimeMax = $plugin->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');
$expendedNumMax = $plugin->get('courses_count_limit');
// @TODO: Get Expended num from user
$expendedNum = 0;
if ($expendedNumMax >= $expendedNum) {
$isAble = true;
$isAllowed = true;
} else {
throw new \Exception($this->get_lang('AdvancedSubscriptionCourseXLimitReached'));
}
@ -167,7 +164,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
throw new \Exception($this->get_lang('AdvancedSubscriptionNotConnected'));
}
return $isAble;
return $isAllowed;
} else {
throw new \Exception($this->get_lang('AdvancedSubscriptionIncompleteParams'));
}
@ -186,7 +183,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$userId = intval($userId);
$sessionId = intval($sessionId);
$now = api_get_utc_datetime();
$pAdvSubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$attributes = array(
'session_id' => $sessionId,
'user_id' => $userId,
@ -195,7 +192,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
'updated_at' => null,
);
$id = Database::insert($pAdvSubQueueTable, $attributes);
$id = Database::insert($advancedSubscriptionQueueTable, $attributes);
return $id;
}
@ -213,7 +210,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$mailId = intval($mailId);
$userId = intval($userId);
$sessionId = intval($sessionId);
$queueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$attributes = array(
'last_message_id' => $mailId,
);
@ -325,19 +322,19 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$where = array(
'id = ?' => intval($params['queue']['id']),
);
} elseif(isset($params['u']) && isset($params['s'])) {
} elseif(isset($params['studentUserId']) && isset($params['sessionId'])) {
$where = array(
'user_id = ? AND session_id = ? AND status <> ? AND status <> ?' => array(
intval($params['u']),
intval($params['s']),
intval($params['studentUserId']),
intval($params['sessionId']),
$newStatus,
ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED,
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED,
),
);
}
if (isset($where)) {
$res = (bool) Database::update(
Database::get_main_table(TABLE_ADV_SUB_QUEUE),
Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE),
array(
'status' => $newStatus,
'updated_at' => api_get_utc_datetime(),
@ -378,169 +375,169 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
}
$mailIds = array();
switch ($actionType) {
case ADV_SUB_ACTION_STUDENT_REQUEST:
case ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST:
// Mail to student
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailStudentRequest'),
$tpl->fetch('/advanced_subscription/views/student_notice_student.tpl'),
$data['s']
$data['sessionId']
);
// Mail to superior
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['superior']['user_id'],
$this->get_lang('MailStudentRequest'),
$tpl->fetch('/advanced_subscription/views/student_notice_superior.tpl'),
$data['s'],
$data['sessionId'],
true
);
break;
case ADV_SUB_ACTION_SUPERIOR_APPROVE:
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE:
// Mail to student
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailBossAccept'),
$tpl->fetch('/advanced_subscription/views/superior_accepted_notice_student.tpl'),
$data['s']
$data['sessionId']
);
// Mail to superior
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['superior']['user_id'],
$this->get_lang('MailBossAccept'),
$tpl->fetch('/advanced_subscription/views/superior_accepted_notice_superior.tpl'),
$data['s']
$data['sessionId']
);
// Mail to admin
foreach ($data['admins'] as $adminId => $admin) {
$tpl->assign('admin', $admin);
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$adminId,
$this->get_lang('MailBossAccept'),
$tpl->fetch('/advanced_subscription/views/superior_accepted_notice_admin.tpl'),
$data['s'],
$data['sessionId'],
true
);
}
break;
case ADV_SUB_ACTION_SUPERIOR_DISAPPROVE:
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE:
// Mail to student
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailBossReject'),
$tpl->fetch('/advanced_subscription/views/superior_rejected_notice_student.tpl'),
$data['s'],
$data['sessionId'],
true
);
// Mail to superior
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['superior']['user_id'],
$this->get_lang('MailBossReject'),
$tpl->fetch('/advanced_subscription/views/superior_rejected_notice_superior.tpl'),
$data['s']
$data['sessionId']
);
break;
case ADV_SUB_ACTION_SUPERIOR_SELECT:
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_SELECT:
// Mail to student
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailStudentRequestSelect'),
$tpl->fetch('/advanced_subscription/views/student_notice_student.tpl'),
$data['s']
$data['sessionId']
);
// Mail to superior
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['superior']['user_id'],
$this->get_lang('MailStudentRequestSelect'),
$tpl->fetch('/advanced_subscription/views/student_notice_superior.tpl'),
$data['s'],
$data['sessionId'],
true
);
break;
case ADV_SUB_ACTION_ADMIN_APPROVE:
case ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE:
// Mail to student
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailAdminAccept'),
$tpl->fetch('/advanced_subscription/views/admin_accepted_notice_student.tpl'),
$data['s']
$data['sessionId']
);
// Mail to superior
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['superior']['user_id'],
$this->get_lang('MailAdminAccept'),
$tpl->fetch('/advanced_subscription/views/admin_accepted_notice_superior.tpl'),
$data['s']
$data['sessionId']
);
// Mail to admin
$adminId = $data['current_user_id'];
$adminId = $data['currentUserId'];
$tpl->assign('admin', $data['admins'][$adminId]);
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$adminId,
$this->get_lang('MailAdminAccept'),
$tpl->fetch('/advanced_subscription/views/admin_accepted_notice_admin.tpl'),
$data['s'],
$data['sessionId'],
true
);
break;
case ADV_SUB_ACTION_ADMIN_DISAPPROVE:
case ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE:
// Mail to student
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailAdminReject'),
$tpl->fetch('/advanced_subscription/views/admin_rejected_notice_student.tpl'),
$data['s'],
$data['sessionId'],
true
);
// Mail to superior
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['superior']['user_id'],
$this->get_lang('MailAdminReject'),
$tpl->fetch('/advanced_subscription/views/admin_rejected_notice_superior.tpl'),
$data['s']
$data['sessionId']
);
// Mail to admin
$adminId = $data['current_user_id'];
$adminId = $data['currentUserId'];
$tpl->assign('admin', $data['admins'][$adminId]);
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$adminId,
$this->get_lang('MailAdminReject'),
$tpl->fetch('/advanced_subscription/views/admin_rejected_notice_admin.tpl'),
$data['s']
$data['sessionId']
);
break;
case ADV_SUB_ACTION_STUDENT_REQUEST_NO_BOSS:
case ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST_NO_BOSS:
// Mail to student
$mailIds['render'] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$data['student']['user_id'],
$this->get_lang('MailStudentRequestNoBoss'),
$tpl->fetch('/advanced_subscription/views/student_no_superior_notice_student.tpl'),
$data['s']
$data['sessionId']
);
// Mail to admin
foreach ($data['admins'] as $adminId => $admin) {
$tpl->assign('admin', $admin);
$mailIds[] = $this->sendMailMessage(
$data['u'],
$data['studentUserId'],
$adminId,
$this->get_lang('MailStudentRequestNoBoss'),
$tpl->fetch('/advanced_subscription/views/student_no_superior_notice_admin.tpl'),
$data['s'],
$data['sessionId'],
true
);
}
@ -565,16 +562,22 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
$count = 0;
if (!empty($params) && is_array($params)) {
$advsubQueueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$where['1 = ? '] = 1;
if (isset($params['sessions']) && is_array($params['sessions'])) {
foreach ($params['sessions'] as &$sessionId) {
$sessionId = intval($sessionId);
}
$where['AND session_id IN ( ? ) '] = implode($params['sessions']);
}
if (isset($params['status']) && is_array($params['status'])) {
foreach ($params['status'] as &$status) {
$status = intval($status);
}
$where['AND status IN ( ? ) '] = implode($params['status']);
}
$where['where'] = $where;
$count = Database::select('COUNT(*)', $advsubQueueTable, $where);
$count = Database::select('COUNT(*)', $advancedSubscriptionQueueTable, $where);
$count = $count[0]['COUNT(*)'];
}
return $count;
@ -614,8 +617,10 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getQueueStatus($userId, $sessionId)
{
$userId = intval($userId);
$sessionId = intval($sessionId);
if (!empty($userId) && !empty($sessionId)) {
$queueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$row = Database::select(
'status',
$queueTable,
@ -631,7 +636,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
return $row[0]['status'];
} else {
return ADV_SUB_QUEUE_STATUS_NO_QUEUE;
return ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE;
}
}
@ -650,8 +655,12 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$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));
$vacancy -= $this->countQueueByParams(
array(
'sessions' => array($sessionId),
'status' => array(ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED),
)
);
if ($vacancy >= 0) {
return $vacancy;
@ -713,26 +722,26 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$message = '';
switch ($status)
{
case ADV_SUB_QUEUE_STATUS_NO_QUEUE:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE:
if ($isAble) {
$message = $this->get_lang('AdvancedSubscriptionNoQueueIsAble');
} else {
$message = $this->get_lang('AdvancedSubscriptionNoQueue');
}
break;
case ADV_SUB_QUEUE_STATUS_START:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START:
$message = $this->get_lang('AdvancedSubscriptionQueueStart');
break;
case ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED:
$message = $this->get_lang('AdvancedSubscriptionQueueBossDisapproved');
break;
case ADV_SUB_QUEUE_STATUS_BOSS_APPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED:
$message = $this->get_lang('AdvancedSubscriptionQueueBossApproved');
break;
case ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED:
$message = $this->get_lang('AdvancedSubscriptionQueueAdminDisapproved');
break;
case ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED:
$message = $this->get_lang('AdvancedSubscriptionQueueAdminApproved');
break;
default:
@ -761,13 +770,13 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getQueueUrl($params)
{
$url = api_get_path(WEB_PLUGIN_PATH) . 'advanced_subscription/ajax/advsub.ajax.php?' .
'a=' . Security::remove_XSS($params['a']) . '&' .
's=' . intval($params['s']) . '&' .
'current_user_id=' . intval($params['current_user_id']) . '&' .
'e=' . intval($params['e']) . '&' .
'u=' . intval($params['u']) . '&' .
'q=' . intval($params['q']) . '&' .
$url = api_get_path(WEB_PLUGIN_PATH) . 'advanced_subscription/ajax/advanced_subscription.ajax.php?' .
'a=' . Security::remove_XSS($params['action']) . '&' .
's=' . intval($params['sessionId']) . '&' .
'current_user_id=' . intval($params['currentUserId']) . '&' .
'e=' . intval($params['newStatus']) . '&' .
'u=' . intval($params['studentUserId']) . '&' .
'q=' . intval($params['queueId']) . '&' .
'is_connected=' . intval($params['is_connected']) . '&' .
'profile_completed=' . intval($params['profile_completed']) . '&' .
'v=' . $this->generateHash($params);
@ -808,7 +817,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$sessionArray[$var] = $val;
}
}
$queueTable = Database::get_main_table(TABLE_ADV_SUB_QUEUE);
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_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(
@ -816,8 +825,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
array(
'q.session_id = ? AND q.status <> ? AND q.status <> ?' => array(
$sessionId,
ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED,
ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED,
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED,
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED,
)
)
);
@ -826,16 +835,16 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
foreach ($students as &$student) {
$status = intval($student['status']);
switch($status) {
case ADV_SUB_QUEUE_STATUS_NO_QUEUE:
case ADV_SUB_QUEUE_STATUS_START:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START:
$student['validation'] = '';
break;
case ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED:
case ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED:
$student['validation'] = get_lang('No');
break;
case ADV_SUB_QUEUE_STATUS_BOSS_APPROVED:
case ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED:
$student['validation'] = get_lang('Yes');
break;
default:
@ -881,12 +890,12 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
$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['action'] = strval($data['action']);
$dataPrepared['sessionId'] = intval($data['sessionId']);
$dataPrepared['currentUserId'] = intval($data['currentUserId']);
$dataPrepared['studentUserId'] = intval($data['studentUserId']);
$dataPrepared['queueId'] = intval($data['queueId']);
$dataPrepared['newStatus'] = intval($data['newStatus']);
$dataPrepared = serialize($dataPrepared);
return sha1($dataPrepared . $key);
}

@ -13,9 +13,11 @@ class HookAdvancedSubscription extends HookObserver implements
HookWSRegistrationObserverInterface,
HookNotificationContentObserverInterface
{
public $plugin;
protected function __construct()
{
$this->plugin = AdvancedSubscriptionPlugin::create();
parent::__construct(
'plugin/advanced_subscription/src/HookAdvancedSubscription.class.php',
'advanced_subscription'
@ -423,47 +425,46 @@ class HookAdvancedSubscription extends HookObserver implements
$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);
$isOpen = $this->plugin->isSessionOpen($sessionId);
$status = $this->plugin->getQueueStatus($userId, $sessionId);
$vacancy = $this->plugin->getVacancy($sessionId);
$data = $this->plugin->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);
$data['action_url'] = $this->plugin->getSessionUrl($sessionId);
} else {
try {
$isAble = $advsubPlugin->isAllowedToDoRequest($userId, $params);
$data['message'] = $advsubPlugin->getStatusMessage($status, $isAble);
$isAble = $this->plugin->isAllowedToDoRequest($userId, $params);
$data['message'] = $this->plugin->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;
$params['action'] = 'subscribe';
$params['sessionId'] = intval($sessionId);
$params['currentUserId'] = 0; // No needed
$params['studentUserId'] = intval($userId);
$params['queueId'] = 0; // No needed
$params['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START;
if ($vacancy > 0) {
// Check conditions
if ($status === ADV_SUB_QUEUE_STATUS_NO_QUEUE) {
if ($status === ADVANCED_SUBSCRIPTION_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) {
$data['action_url'] = $this->plugin->getQueueUrl($params);
} elseif ($status === ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
// send url action
$data['action_url'] = $advsubPlugin->getSessionUrl($sessionId);
$data['action_url'] = $this->plugin->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);
if ($status === ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
$data['action_url'] = $this->plugin->getSessionUrl($sessionId);
} else {
// in Queue or not, cannot be subscribed to session
$data['action_url'] = $advsubPlugin->getQueueUrl($params);
$data['action_url'] = $this->plugin->getQueueUrl($params);
}
}
}
@ -527,18 +528,26 @@ class HookAdvancedSubscription extends HookObserver implements
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
// Get validated and waiting queue users count for each session
foreach ($sessionList as &$session) {
// Add validated and queue users count
$session['validated_user_num'] = $this->plugin->countQueueByParams(
array(
'sessions' => array($session['id']),
'status' => array(ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED)
)
);
$session['waiting_user_num'] = $this->plugin->countQueueByParams(
array(
'sessions' => array($session['id']),
'status' => array(
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START,
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED,
),
)
);
}
return $sessionList;
@ -552,15 +561,15 @@ class HookAdvancedSubscription extends HookObserver implements
{
$data = $hook->getEventData();
if ($data['type'] === HOOK_EVENT_TYPE_PRE) {
$data['advsub_pre_content'] = $data['content'];
$data['advanced_subscription_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'])
isset($data['advanced_subscription_pre_content']) &&
!empty($data['advanced_subscription_pre_content'])
) {
$data['content'] = str_replace(
array(
@ -569,7 +578,7 @@ class HookAdvancedSubscription extends HookObserver implements
'<br/>',
),
'',
$data['advsub_pre_content']
$data['advanced_subscription_pre_content']
);
}
@ -588,15 +597,15 @@ class HookAdvancedSubscription extends HookObserver implements
{
$data = $hook->getEventData();
if ($data['type'] === HOOK_EVENT_TYPE_PRE) {
$data['advsub_pre_title'] = $data['title'];
$data['advanced_subscription_pre_title'] = $data['title'];
return $data;
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) {
if (
isset($data['advsub_pre_title']) &&
!empty($data['advsub_pre_title'])
isset($data['advanced_subscription_pre_title']) &&
!empty($data['advanced_subscription_pre_title'])
) {
$data['title'] = $data['advsub_pre_title'];
$data['title'] = $data['advanced_subscription_pre_title'];
}
return $data;

@ -13,22 +13,22 @@ api_protect_admin_script();
// start plugin
$plugin = AdvancedSubscriptionPlugin::create();
// Session ID
$s = isset($_REQUEST['s']) ? intval($_REQUEST['s']) : null;
$sessionId = isset($_REQUEST['s']) ? intval($_REQUEST['s']) : null;
// Init template
$tpl = new Template($plugin->get_lang('plugin_title'));
// Get all sessions
$sessionList = $plugin->listAllSessions();
if (!empty($s)) {
if (!empty($sessionId)) {
// Get student list in queue
$studentList = $plugin->listAllStudentsInQueueBySession($s);
$studentList = $plugin->listAllStudentsInQueueBySession($sessionId);
// Set selected to current session
$sessionList[$s]['selected'] = 'selected="selected"';
$studentList['session']['id'] = $s;
$sessionList[$sessionId]['selected'] = 'selected="selected"';
$studentList['session']['id'] = $sessionId;
// Assign variables
$fieldsArray = array('description', 'target', 'mode', 'publication_end_date', 'recommended_number_of_participants');
$sessionArray = api_get_session_info($s);
$sessionArray = api_get_session_info($sessionId);
$extraSession = new ExtraFieldValue('session');
$extraField = new ExtraField('session');
// Get session fields
@ -40,7 +40,7 @@ if (!empty($s)) {
$fields[$field['id']] = $field['field_variable'];
}
$mergedArray = array_merge(array($s), array_keys($fields));
$mergedArray = array_merge(array($sessionId), array_keys($fields));
$sessionFieldValueList = $extraSession->get_all(array('session_id = ? field_id IN ( ?, ?, ?, ?, ?, ?, ? )' => $mergedArray));
foreach ($sessionFieldValueList as $sessionFieldValue) {
// Check if session field value is set in session field list
@ -53,17 +53,17 @@ if (!empty($s)) {
}
$adminsArray = UserManager::get_all_administrators();
$data['a'] = 'confirm';
$data['s'] = $s;
$data['current_user_id'] = api_get_user_id();
$data['action'] = 'confirm';
$data['sessionId'] = $sessionId;
$data['currentUserId'] = api_get_user_id();
$isWesternNameOrder = api_is_western_name_order();
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;
$data['studentUserId'] = intval($student['user_id']);
$data['queueId'] = intval($student['queue_id']);
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED;
$student['acceptUrl'] = $plugin->getQueueUrl($data);
$data['e'] = ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED;
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED;
$student['rejectUrl'] = $plugin->getQueueUrl($data);
$student['complete_name'] = $isWesternNameOrder ?
$student['firstname'] . ', ' . $student['lastname'] :
@ -78,8 +78,8 @@ if (!empty($s)) {
// Assign variables
$tpl->assign('sessionItems', $sessionList);
$tpl->assign('approveAdmin', ADV_SUB_QUEUE_STATUS_ADMIN_APPROVED);
$tpl->assign('disapproveAdmin', ADV_SUB_QUEUE_STATUS_ADMIN_DISAPPROVED);
$tpl->assign('approveAdmin', ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED);
$tpl->assign('disapproveAdmin', ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED);
// Get rendered template
$content = $tpl->fetch('/advanced_subscription/views/admin_view.tpl');
// Assign into content

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

@ -10,22 +10,22 @@ $plugin = AdvancedSubscriptionPlugin::create();
// Get validation hash
$hash = Security::remove_XSS($_REQUEST['v']);
// Get data from request (GET or POST)
$data['a'] = 'confirm';
$data['current_user_id'] = 1;
$data['q'] = 0;
$data['action'] = 'confirm';
$data['currentUserId'] = 1;
$data['queueId'] = 0;
$data['is_connected'] = true;
$data['profile_completed'] = 90.0;
// Init result array
$data['s'] = 1;
$data['u'] = 4;
$data['sessionId'] = 1;
$data['studentUserId'] = 4;
// Prepare data
// Get session data
// Assign variables
$fieldsArray = array('description', 'target', 'mode', 'publication_end_date', 'recommended_number_of_participants');
$sessionArray = api_get_session_info($data['s']);
$sessionArray = api_get_session_info($data['sessionId']);
$extraSession = new ExtraFieldValue('session');
$extraField = new ExtraField('session');
// Get session fields
@ -38,7 +38,7 @@ foreach ($fieldList as $field) {
$fields[$field['id']] = $field['field_variable'];
}
$mergedArray = array_merge(array($data['s']), array_keys($fields));
$mergedArray = array_merge(array($data['sessionId']), array_keys($fields));
$sessionFieldValueList = $extraSession->get_all(array('session_id = ? field_id IN ( ?, ?, ?, ?, ?, ?, ? )' => $mergedArray));
foreach ($sessionFieldValueList as $sessionFieldValue) {
// Check if session field value is set in session field list
@ -50,11 +50,11 @@ foreach ($sessionFieldValueList as $sessionFieldValue) {
}
}
// Get student data
$studentArray = api_get_user_info($data['u']);
$studentArray = api_get_user_info($data['studentUserId']);
$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']);
$superiorId = UserManager::getStudentBoss($data['studentUserId']);
if (!empty($superiorId)) {
$superiorArray = api_get_user_info($superiorId);
} else {
@ -71,7 +71,7 @@ foreach ($adminsArray as &$admin) {
}
unset($admin);
// Set data
$data['a'] = 'confirm';
$data['action'] = 'confirm';
$data['student'] = $studentArray;
$data['superior'] = $superiorArray;
$data['admins'] = $adminsArray;
@ -79,10 +79,10 @@ $data['admin'] = current($adminsArray);
$data['session'] = $sessionArray;
$data['signature'] = api_get_setting('Institution');
$data['admin_view_url'] = api_get_path(WEB_PLUGIN_PATH) .
'advanced_subscription/src/admin_view.php?s=' . $data['s'];
$data['e'] = ADV_SUB_QUEUE_STATUS_BOSS_APPROVED;
'advanced_subscription/src/admin_view.php?s=' . $data['sessionId'];
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED;
$data['student']['acceptUrl'] = $plugin->getQueueUrl($data);
$data['e'] = ADV_SUB_QUEUE_STATUS_BOSS_DISAPPROVED;
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED;
$data['student']['rejectUrl'] = $plugin->getQueueUrl($data);
$tpl = new Template($plugin->get_lang('plugin_title'));
$tpl->assign('data', $data);

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -1,4 +1,4 @@
<form id="form_advsub_admin" class="form-search" method="post" action="/plugin/advanced_subscription/src/admin_view.php" name="form_advsub_admin">
<form id="form_advanced_subscription_admin" class="form-search" method="post" action="/plugin/advanced_subscription/src/admin_view.php" name="form_advanced_subscription_admin">
<div class="row">
<div class="span6">
<p class="text-title-select">{{ 'SelectASession' | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p>
@ -36,7 +36,7 @@
<table id="student_table" class="table table-striped">
<tbody>
<tr>
<th style="width: 118px;"><img src="img/icon-avatar.png"/> </th>
<th style="width: 118px;"><img src="{{ _p.web_plugin }}advanced_subscription/views/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>
@ -51,13 +51,13 @@
<td>{{ student.validation }}</td>
<td>
<a
class="btn btn-success btn-advsub btn-accept"
class="btn btn-success btn-advanced-subscription btn-accept"
href="{{ student.acceptUrl }}"
>
{{ 'Accept' | get_plugin_lang('AdvancedSubscriptionPlugin') }}
</a>
<a
class="btn btn-danger btn-advsub btn-reject"
class="btn btn-danger btn-advanced-subscription btn-reject"
href="{{ student.rejectUrl }}"
>
{{ 'Reject' | get_plugin_lang('AdvancedSubscriptionPlugin') }}
@ -78,12 +78,12 @@
<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 fade" id="modalMail" tabindex="-1" role="dialog" aria-labelledby="modalMailLabel" 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>
<h4 class="modal-title" id="modalMailLabel">{{ "AdvancedSubscriptionAdminViewTitle" | get_plugin_lang('AdvancedSubscriptionPlugin')}}</h4>
</div>
<div class="modal-body">
<iframe id="iframeAdvsub" frameBorder="0">
@ -95,13 +95,13 @@
</div>
</div>
</div>
<link href="{{ _p.web_plugin }}advancedsubscription/views/css/style.css" rel="stylesheet" type="text/css">
<link href="{{ _p.web_plugin }}advanced_subscription/views/css/style.css" rel="stylesheet" type="text/css">
<script>
$(document).ready(function(){
$("#session-select").change(function () {
$("#form_advsub_admin").submit();
$("#form_advanced_subscription_admin").submit();
});
$("a.btn-advsub").click(function(event){
$("a.btn-advanced-subscription").click(function(event){
event.preventDefault();
var confirmed = false;
var studentName = $(this).closest("tr").find(".name").html();
@ -117,16 +117,15 @@
} else {
var msg = "{{ 'AreYouSureYouWantToRejectSubscriptionOfX' | get_plugin_lang('AdvancedSubscriptionPlugin') }}";
var confirmed = confirm(msg.replace(msgRe, studentName));
);
}
if (confirmed) {
var thisBlock = $(this).closest("tr");
var advsubUrl = $(this).attr("href")
$("#iframeAdvsub").attr("src", advsubUrl)
var advancedSubscriptionUrl = $(this).attr("href")
$("#iframeAdvsub").attr("src", advancedSubscriptionUrl)
$("#modalMail").modal("show");
$.ajax({
dataType: "json",
url: advsubUrl
url: advancedSubscriptionUrl
}).done(function(result){
if (result.error == true) {
thisBlock.slideUp();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -63,10 +63,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -56,8 +56,8 @@
<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>
<td valign="middle"><a href="{{ student.acceptUrl }}"><img src="{{ _p.web_plugin }}advanced_subscription/views/img/aprobar.png" width="90" height="25" alt=""></a></td>
<td valign="middle"><a href="{{ student.rejectUrl }}"><img src="{{ _p.web_plugin }}advanced_subscription/views/img/desaprobar.png" width="90" height="25" alt=""></a></td>
</tr>
{% endfor %}
</table>
@ -73,10 +73,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -57,8 +57,8 @@
<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>
<td valign="middle"><a href="{{ student.approveUrl }}"><img src="{{ _p.web_plugin }}advanced_subscription/views/img/aprobar.png" width="90" height="25" alt=""></a></td>
<td valign="middle"><a href="{{ student.rejectUrl }}"><img src="{{ _p.web_plugin }}advanced_subscription/views/img/desaprobar.png" width="90" height="25" alt=""></a></td>
</tr>
{% endfor %}
</table>
@ -74,10 +74,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -63,10 +63,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -55,8 +55,8 @@
<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>
<td width="90" valign="middle"><a href="{{ student.acceptUrl }}"><img src="{{ _p.web_plugin }}advanced_subscription/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 }}advanced_subscription/views/img/desaprobar.png" width="90" height="25" alt=""></a></td>
</tr>
</table>
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p>
@ -71,10 +71,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -63,10 +63,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -63,10 +63,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

@ -8,16 +8,16 @@
<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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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">&nbsp;</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="394"><img src="{{ _p.web_css }}{{ "stylesheets" | get_setting }}/images/header-logo.png" width="230" height="60" alt="Ministerio de Educación"></td>
<td width="50">&nbsp;</td>
</tr>
<tr>
@ -62,10 +62,10 @@
</table></td>
</tr>
<tr>
<td><img src="{{ _p.web_plugin }}advancedsubscription/views/img/line.png" width="700" height="25" alt=""></td>
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td>
</tr>
<tr>
<td>&nbsp;</td>

Loading…
Cancel
Save