@ -0,0 +1,59 @@ |
||||
Advanced subscription plugin for Chamilo LMS |
||||
======================================= |
||||
Plugin to manage the registration queue and communication to sessions |
||||
from an external website creating a queue to control session subscription |
||||
and sending emails to approve student subscription requests |
||||
|
||||
# Requirements |
||||
Chamilo LMS 1.10.0 or greater |
||||
|
||||
# Settings |
||||
|
||||
These settings have to be configured in the Configuration screen for the plugin |
||||
|
||||
Parameters | Description |
||||
------------- |------------- |
||||
Webservice url | Url to external website to get user profile (SOAP) |
||||
Induction requirement | Checkbox to enable induction as requirement |
||||
Courses count limit | Number of times a student is allowed at most to course by year |
||||
Yearly hours limit | Teaching hours a student is allowed at most to course by year |
||||
Yearly cost unit converter | The cost of a taxation unit value (TUV) |
||||
Yearly cost limit | Number of TUV student courses is allowed at most to cost by year |
||||
Year start date | Date (dd/mm) when the year limit is renewed |
||||
Minimum percentage profile | Minimum percentage required from external website profile |
||||
|
||||
# Hooks |
||||
|
||||
This plugin uses the following hooks (defined since Chamilo LMS 1.10.0): |
||||
|
||||
* HookAdminBlock |
||||
* HookWSRegistration |
||||
* HookNotificationContent |
||||
* HookNotificationTitle |
||||
|
||||
|
||||
# Web services |
||||
|
||||
This plugin also enables new webservices that can be used from registration.soap.php |
||||
|
||||
* HookAdvancedSubscription..WSSessionListInCategory |
||||
* HookAdvancedSubscription..WSSessionGetDetailsByUser |
||||
* HookAdvancedSubscription..WSListSessionsDetailsByCategory |
||||
|
||||
See `/plugin/advanced_subscription/src/HookAdvancedSubscription.php` to check Web services inputs and outputs |
||||
|
||||
# How does this plugin works? |
||||
|
||||
After install, fill the required parameters (described above) |
||||
Use web services to communicate course session inscription from external website |
||||
This allows students to search course sessions and subscribe if they match |
||||
the requirements. |
||||
|
||||
The normal process is: |
||||
* Student searches course session |
||||
* Student reads session info depending student data |
||||
* Student requests to be subscribed |
||||
* A confirmation email is sent to student |
||||
* An authorization email is sent to student's superior (STUDENT BOSS role) or admins (when there is no superior) who will accept or reject the student request |
||||
* When the superior accepts or rejects, an email will be sent to the student and superior (or admin), respectively |
||||
* To complete the subscription, the request must be validated and accepted by an admin |
@ -0,0 +1,281 @@ |
||||
<?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.advanced_subscription |
||||
*/ |
||||
|
||||
/** |
||||
* 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['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['action'] == 'subscribe'; |
||||
if ($verified) { |
||||
switch($data['action']) { |
||||
case 'check': // Check minimum requirements |
||||
try { |
||||
$res = AdvancedSubscriptionPlugin::create()->isAllowedToDoRequest($data['studentUserId'], $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['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['sessionId']); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$extraField = new ExtraField('session'); |
||||
// Get session fields |
||||
$fieldList = $extraField->get_all(array( |
||||
'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray |
||||
)); |
||||
// Index session fields |
||||
foreach ($fieldList as $field) { |
||||
$fields[$field['id']] = $field['field_variable']; |
||||
} |
||||
|
||||
$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 |
||||
if (isset($fields[$sessionFieldValue['field_id']])) { |
||||
$var = $fields[$sessionFieldValue['field_id']]; |
||||
$val = $sessionFieldValue['field_value']; |
||||
// Assign session field value to session |
||||
$sessionArray[$var] = $val; |
||||
} |
||||
} |
||||
// Get student data |
||||
$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['studentUserId']); |
||||
if (!empty($superiorId)) { |
||||
$superiorArray = api_get_user_info($superiorId); |
||||
} else { |
||||
$superiorArray = null; |
||||
} |
||||
// Get admin data |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
$isWesternNameOrder = api_is_western_name_order(); |
||||
foreach ($adminsArray as &$admin) { |
||||
$admin['complete_name'] = $isWesternNameOrder ? |
||||
$admin['firstname'] . ', ' . $admin['lastname'] : |
||||
$admin['lastname'] . ', ' . $admin['firstname'] |
||||
; |
||||
} |
||||
unset($admin); |
||||
// Set data |
||||
$data['action'] = '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, 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['sessionId']; |
||||
// Send mails |
||||
$result['mailIds'] = $plugin->sendMail($data, ADVANCED_SUBSCRIPTION_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['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED; |
||||
$data['student']['acceptUrl'] = $plugin->getQueueUrl($data); |
||||
// Get url to be rejected by boss |
||||
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED; |
||||
$data['student']['rejectUrl'] = $plugin->getQueueUrl($data); |
||||
// Send mails |
||||
$result['mailIds'] = $plugin->sendMail($data, ADVANCED_SUBSCRIPTION_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 new status is set |
||||
if (isset($data['newStatus'])) { |
||||
// Update queue status |
||||
$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['sessionId']); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$extraField = new ExtraField('session'); |
||||
// Get session fields |
||||
$fieldList = $extraField->get_all(array( |
||||
'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray |
||||
)); |
||||
// Index session fields |
||||
foreach ($fieldList as $field) { |
||||
$fields[$field['id']] = $field['field_variable']; |
||||
} |
||||
|
||||
$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 |
||||
if (isset($fields[$sessionFieldValue['field_id']])) { |
||||
$var = $fields[$sessionFieldValue['field_id']]; |
||||
$val = $sessionFieldValue['field_value']; |
||||
// Assign session field value to session |
||||
$sessionArray[$var] = $val; |
||||
} |
||||
} |
||||
// Prepare student data |
||||
$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['studentUserId']); |
||||
if (!empty($superiorId)) { |
||||
$superiorArray = api_get_user_info($superiorId); |
||||
} else { |
||||
$superiorArray = null; |
||||
} |
||||
// Prepare admin data |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
$isWesternNameOrder = api_is_western_name_order(); |
||||
foreach ($adminsArray as &$admin) { |
||||
$admin['complete_name'] = $isWesternNameOrder ? |
||||
$admin['firstname'] . ', ' . $admin['lastname'] : |
||||
$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) . '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['newStatus']) { |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED: |
||||
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE; |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED: |
||||
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE; |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED: |
||||
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE; |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED: |
||||
$data['action'] = ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE; |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
|
||||
// Student Session inscription |
||||
if ($data['newStatus'] == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) { |
||||
SessionManager::suscribe_users_to_session($data['sessionId'], array($data['studentUserId']), 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'] = 'This action does not exist!'; |
||||
} |
||||
} |
||||
|
||||
// Echo result as json |
||||
echo json_encode($result); |
@ -0,0 +1,26 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Config the plugin |
||||
* @author Daniel Alejandro Barreto Alva <daniel.barreto@beeznest.com> |
||||
* @package chamilo.plugin.advanced_subscription |
||||
*/ |
||||
|
||||
define('TABLE_ADVANCED_SUBSCRIPTION_QUEUE', 'plugin_advanced_subscription_queue'); |
||||
|
||||
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('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'; |
@ -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.advanced_subscription |
||||
*/ |
||||
|
||||
/** |
||||
* 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,134 @@ |
||||
<?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_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 %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."; |
||||
$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 training 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'; |
||||
|
||||
$strings['AcceptInfinitive'] = 'Accept'; |
||||
$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>'; |
||||
$strings['MailTitleAdminAcceptToStudent'] = 'Accepted: Your inscription to course %s was confirmed!'; |
||||
$strings['MailContentAdminAcceptToStudent'] = 'We are pleased to inform your course registration <strong>%s</strong> starting at <strong>%s</strong> was validated by administrators. We hope to keep all your encouragement and participate in another course or, on another occasion, this same course.'; |
||||
$strings['MailTitleAdminAcceptToSuperior'] = 'Information: Inscription validation for %s to course %s'; |
||||
$strings['MailContentAdminAcceptToSuperior'] = 'Inscription for student <strong>%s</strong> to course <strong>%s</strong> starting at <strong>%s</strong>, was pending status, has been validated a few minutes ago. We hope you help us to assure full availability for your collaborator during the course period.'; |
||||
|
||||
// Admin Reject |
||||
$strings['MailTitleAdminRejectToAdmin'] = 'Information: Has been received inscription refusal'; |
||||
$strings['MailContentAdminRejectToAdmin'] = 'We have received and registered your inscription refusal for student <strong>%s</strong> to course <strong>%s</strong>'; |
||||
$strings['MailTitleAdminRejectToStudent'] = 'Your inscription to course %s was refused'; |
||||
$strings['MailContentAdminRejectToStudent'] = 'We regret that your inscription to course <strong>%s</strong> starting at <strong>%s</strong> was rejected because of lack of vacancies. We hope to keep all your encouragement and participate in another course or, on another occasion, this same course.'; |
||||
$strings['MailTitleAdminRejectToSuperior'] = 'Information: Inscription refusal for student %s to course %s'; |
||||
$strings['MailContentAdminRejectToSuperior'] = 'The inscription for <strong>%s</strong> to course <strong>%s</strong>, it was accepted earlier, was rejected because of lack of vacancies. Our sincere apologies.'; |
||||
|
||||
// Superior Accept |
||||
$strings['MailTitleSuperiorAcceptToAdmin'] = 'Approval for %s to course %s '; |
||||
$strings['MailContentSuperiorAcceptToAdmin'] = 'The inscription for student <strong>%s</strong> to course <strong>%s</strong> has been accepted by superior. You can manage inscriptions <a href="%s"><strong>HERE</strong></a>'; |
||||
$strings['MailTitleSuperiorAcceptToSuperior'] = 'Confirmation: Has been received approval for %s'; |
||||
$strings['MailContentSuperiorAcceptToSuperior'] = 'We have received and registered your choice to accept inscription to course <strong>%s</strong> for your collaborator <strong>%s</strong>'; |
||||
$strings['MailContentSuperiorAcceptToSuperiorSecond'] = 'Now, the inscription is pending for availability of vacancies. We will keep you informed about status for this step'; |
||||
$strings['MailTitleSuperiorAcceptToStudent'] = 'Accepted: Your inscription to course %s has been approved by your superior'; |
||||
$strings['MailContentSuperiorAcceptToStudent'] = 'We are pleased to inform your inscription to course <strong>%s</strong> has been accepted by your superior. Now, your inscription is pending to availability of vacancies. We will notify you as soon as it is validated.'; |
||||
|
||||
// Superior Reject |
||||
$strings['MailTitleSuperiorRejectToStudent'] = 'Information: Your inscription to course %s has been refused'; |
||||
$strings['MailContentSuperiorRejectToStudent'] = 'We regret to inform your inscription to course <strong>%s</strong> was NOT accepted. We hope to keep all your encouragement and participate in another course or, on another occasion, this same course.'; |
||||
$strings['MailTitleSuperiorRejectToSuperior'] = 'Confirmation: Has been received inscription refusal for %s'; |
||||
$strings['MailContentSuperiorRejectToSuperior'] = 'We have received and registered your choice to reject inscription to course <strong>%s</strong> for your collaborator <strong>%s</strong>'; |
||||
|
||||
// Student Request |
||||
$strings['MailTitleStudentRequestToStudent'] = 'Information: Has been received inscription validation'; |
||||
$strings['MailContentStudentRequestToStudent'] = 'We have received and registered your inscripción request to course <strong>%s</strong> starting at <strong>%s</strong>'; |
||||
$strings['MailContentStudentRequestToStudentSecond'] = 'Your inscription is pending approval, first from your superior, then the availability of vacancies. An email has been sent to your superior for review and approval of your request.'; |
||||
$strings['MailTitleStudentRequestToSuperior'] = 'Course inscription request from your collaborator'; |
||||
$strings['MailContentStudentRequestToSuperior'] = 'We have received an inscription request for <strong>%s</strong> to course <strong>%s</strong>, starting at <strong>%s</strong>. Course details: <strong>%s</strong>.'; |
||||
$strings['MailContentStudentRequestToSuperiorSecond'] = 'Your are welcome to accept or reject this inscription, clicking the corresponding button.'; |
||||
|
||||
// Student Request No Boss |
||||
$strings['MailTitleStudentRequestNoSuperiorToStudent'] = 'Has been received your inscription request for %s'; |
||||
$strings['MailContentStudentRequestNoSuperiorToStudent'] = 'We have received and registered your inscription to course <strong>%s</strong> starting at <strong>%s</strong>.'; |
||||
$strings['MailContentStudentRequestNoSuperiorToStudentSecond'] = 'Your inscription is pending availability of vacancies. Soon you will get the result of your request approval.'; |
||||
$strings['MailTitleStudentRequestNoSuperiorToAdmin'] = 'Inscription request for %s to course %s'; |
||||
$strings['MailContentStudentRequestNoSuperiorToAdmin'] = 'The inscription for <strong>%s</strong> to course <strong>%s</strong> has been approved by default, missing superior. You can manage inscriptions <a href="%s"><strong>HERE</strong></a>'; |
||||
|
||||
// Reminders |
||||
$strings['MailTitleReminderAdmin'] = 'Inscription to %s are pending confirmation'; |
||||
$strings['MailContentReminderAdmin'] = 'The inscription below to course <strong>%s</strong> are pending validation to be accepted. Please, go to <a href="%s">Administration page</a> to validate them.'; |
||||
$strings['MailTitleReminderStudent'] = 'Information: Your request is pending approval to course %s'; |
||||
$strings['MailContentReminderStudent'] = 'This email is to confirm we have received and registered your inscription request to course <strong>%s</strong>, starting at <strong>%s</strong>.'; |
||||
$strings['MailContentReminderStudentSecond'] = 'Your inscription has not yet been approved by your superior, so we send him an reminder email.'; |
||||
$strings['MailTitleReminderSuperior'] = 'Course inscription request for your collaborators'; |
||||
$strings['MailContentReminderSuperior'] = '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['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.'; |
@ -0,0 +1,134 @@ |
||||
<?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['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 <strong>no</strong> 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"; |
||||
|
||||
$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'; |
||||
$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 de formació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'; |
||||
|
||||
$strings['AcceptInfinitive'] = 'Aceptar'; |
||||
$strings['RejectInfinitive'] = 'Rechazar'; |
||||
$strings['AreYouSureYouWantToAcceptSubscriptionOfX'] = '¿Está seguro que quiere aceptar la inscripción de %s?'; |
||||
$strings['AreYouSureYouWantToRejectSubscriptionOfX'] = '¿Está seguro que quiere rechazar la inscripción de %s?'; |
||||
|
||||
$strings['MailTitle'] = 'Solicitud recibida para el curso %s'; |
||||
$strings['MailDear'] = 'Estimado(a):'; |
||||
$strings['MailThankYou'] = 'Gracias.'; |
||||
$strings['MailThankYouCollaboration'] = 'Gracias por su colaboración.'; |
||||
|
||||
// Admin Accept |
||||
$strings['MailTitleAdminAcceptToAdmin'] = 'Información: Validación de inscripción recibida'; |
||||
$strings['MailContentAdminAcceptToAdmin'] = 'Hemos recibido y registrado su validación de la inscripción de <strong>%s</strong> al curso <strong>%s</strong>'; |
||||
$strings['MailTitleAdminAcceptToStudent'] = 'Aprobada: ¡Su inscripción al curso %s fue confirmada!'; |
||||
$strings['MailContentAdminAcceptToStudent'] = 'Nos complace informarle que su inscripción al curso <strong>%s</strong> iniciando el <strong>%s</strong> fue validada por los administradores. Esperamos mantenga todo su ánimo y participe en otro curso o, en otra oportunidad, a este mismo curso.'; |
||||
$strings['MailTitleAdminAcceptToSuperior'] = 'Información: Validación de inscripción de %s al curso %s'; |
||||
$strings['MailContentAdminAcceptToSuperior'] = 'La inscripción de <strong>%s</strong> al curso <strong>%s</strong> iniciando el <strong>%s</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.'; |
||||
|
||||
// Admin Reject |
||||
$strings['MailTitleAdminRejectToAdmin'] = 'Información: rechazo de inscripción recibido'; |
||||
$strings['MailContentAdminRejectToAdmin'] = 'Hemos recibido y registrado su rechazo de la inscripción de <strong>%s</strong> al curso <strong>%s</strong>'; |
||||
$strings['MailTitleAdminRejectToStudent'] = 'Rechazamos su inscripción al curso %s'; |
||||
$strings['MailContentAdminRejectToStudent'] = 'Lamentamos informarle que su inscripción al curso <strong>%s</strong> iniciando el <strong>%s</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.'; |
||||
$strings['MailTitleAdminRejectToSuperior'] = 'Información: Rechazo de inscripción de %s al curso %s'; |
||||
$strings['MailContentAdminRejectToSuperior'] = 'La inscripción de <strong>%s</strong> al curso <strong>%s</strong>, que había aprobado anteriormente, fue rechazada por falta de cupos. Les presentamos nuestras disculpas sinceras.'; |
||||
|
||||
// Superior Accept |
||||
$strings['MailTitleSuperiorAcceptToAdmin'] = 'Aprobación de %s al curso %s '; |
||||
$strings['MailContentSuperiorAcceptToAdmin'] = 'La inscripción del alumno <strong>%s</strong> al curso <strong>%s</strong> ha sido aprobada por su superior. Puede gestionar las inscripciones al curso <a href="%s"><strong>aquí</strong></a>'; |
||||
$strings['MailTitleSuperiorAcceptToSuperior'] = 'Confirmación: Aprobación recibida para %s'; |
||||
$strings['MailContentSuperiorAcceptToSuperior'] = 'Hemos recibido y registrado su decisión de aprobar el curso <strong>%s</strong> para su colaborador <strong>%s</strong>'; |
||||
$strings['MailContentSuperiorAcceptToSuperiorSecond'] = 'Ahora la inscripción al curso está pendiente de la disponibilidad de cupos. Le mantendremos informado sobre el resultado de esta etapa'; |
||||
$strings['MailTitleSuperiorAcceptToStudent'] = 'Aprobado: Su inscripción al curso %s ha sido aprobada por su superior '; |
||||
$strings['MailContentSuperiorAcceptToStudent'] = 'Nos complace informarle que su inscripción al curso <strong>%s</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.'; |
||||
|
||||
// Superior Reject |
||||
$strings['MailTitleSuperiorRejectToStudent'] = 'Información: Su inscripción al curso %s ha sido rechazada '; |
||||
$strings['MailContentSuperiorRejectToStudent'] = 'Lamentamos informarle que, en esta oportunidad, su inscripción al curso <strong>%s</strong> NO ha sido aprobada. Esperamos mantenga todo su ánimo y participe en otro curso o, en otra oportunidad, a este mismo curso.'; |
||||
$strings['MailTitleSuperiorRejectToSuperior'] = 'Confirmación: Desaprobación recibida para %s'; |
||||
$strings['MailContentSuperiorRejectToSuperior'] = 'Hemos recibido y registrado su decisión de desaprobar el curso <strong>%s</strong> para su colaborador <strong>%s</strong>'; |
||||
|
||||
// Student Request |
||||
$strings['MailTitleStudentRequestToStudent'] = 'Información: Validación de inscripción recibida'; |
||||
$strings['MailContentStudentRequestToStudent'] = 'Hemos recibido y registrado su solicitud de inscripción al curso <strong>%s</strong> para iniciarse el <strong>%s</strong>.'; |
||||
$strings['MailContentStudentRequestToStudentSecond'] = '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.'; |
||||
$strings['MailTitleStudentRequestToSuperior'] = 'Solicitud de consideración de curso para un colaborador'; |
||||
$strings['MailContentStudentRequestToSuperior'] = 'Hemos recibido una solicitud de inscripción de <strong>%s</strong> al curso <strong>%s</strong>, por iniciarse el <strong>%s</strong>. Detalles del curso: <strong>%s</strong>.'; |
||||
$strings['MailContentStudentRequestToSuperiorSecond'] = 'Le invitamos a aprobar o desaprobar esta inscripción, dando clic en el botón correspondiente a continuación.'; |
||||
|
||||
// Student Request No Boss |
||||
$strings['MailTitleStudentRequestNoSuperiorToStudent'] = 'Solicitud recibida para el curso %s'; |
||||
$strings['MailContentStudentRequestNoSuperiorToStudent'] = 'Hemos recibido y registrado su solicitud de inscripción al curso <strong>%s</strong> para iniciarse el <strong>%s</strong>.'; |
||||
$strings['MailContentStudentRequestNoSuperiorToStudentSecond'] = 'Su inscripción es pendiente de la disponibilidad de cupos. Pronto recibirá los resultados de su aprobación de su solicitud.'; |
||||
$strings['MailTitleStudentRequestNoSuperiorToAdmin'] = 'Solicitud de inscripción de %s para el curso %s'; |
||||
$strings['MailContentStudentRequestNoSuperiorToAdmin'] = 'La inscripción del alumno <strong>%s</strong> al curso <strong>%s</strong> ha sido aprobada por defecto, a falta de superior. Puede gestionar las inscripciones al curso <a href="%s"><strong>aquí</strong></a>'; |
||||
|
||||
// Reminders |
||||
$strings['MailTitleReminderAdmin'] = 'Inscripciones a %s pendiente de confirmación'; |
||||
$strings['MailContentReminderAdmin'] = 'Las inscripciones siguientes al curso <strong>%s</strong> están pendientes de validación para ser efectivas. Por favor, dirigese a la <a href="%s">página de administración</a> para validarlos.'; |
||||
$strings['MailTitleReminderStudent'] = 'Información: Solicitud pendiente de aprobación para el curso %s'; |
||||
$strings['MailContentReminderStudent'] = 'Este correo es para confirmar que hemos recibido y registrado su solicitud de inscripción al curso <strong>%s</strong>, por iniciarse el <strong>%s</strong>.'; |
||||
$strings['MailContentReminderStudentSecond'] = '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.'; |
||||
$strings['MailTitleReminderSuperior'] = 'Solicitud de consideración de curso para un colaborador'; |
||||
$strings['MailContentReminderSuperior'] = 'Le recordamos que hemos recibido las siguientes solicitudes de suscripción para el curso <strong>%s</strong> de parte de sus colaboradores. El curso se iniciará el <strong>%s</strong>. Detalles del curso: <strong>%s</strong>.'; |
||||
$strings['MailContentReminderSuperiorSecond'] = 'Le invitamos a aprobar o desaprobar las suscripciones, dando clic en el botón correspondiente a continuación para cada colaborador.'; |
||||
$strings['MailTitleReminderMaxSuperior'] = 'Recordatorio: Solicitud de consideración de curso para colaborador(es)'; |
||||
$strings['MailContentReminderMaxSuperior'] = 'Le recordamos que hemos recibido las siguientes solicitudes de suscripción al curso <strong>%s</strong> de parte de sus colaboradores. El curso se iniciará el <strong>%s</strong>. Detalles del curso: <strong>%s</strong>.'; |
||||
$strings['MailContentReminderMaxSuperiorSecond'] = '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>%s</strong> candidatos. Le invitamos a aprobar o desaprobar las suscripciones, dando clic en el botón correspondiente a continuación para cada colaborador.'; |
@ -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.advanced_subscription |
||||
*/ |
||||
/** |
||||
* Plugin details (must be present) |
||||
*/ |
||||
require_once __DIR__ . '/config.php'; |
||||
$plugin_info = AdvancedSubscriptionPlugin::create()->get_info(); |
@ -0,0 +1,99 @@ |
||||
<h1> |
||||
<a id="user-content-advanced-subscription-plugin-for-chamilo-lms" class="anchor" href="#advanced-subscription-plugin-for-chamilo-lms" aria-hidden="true"><span class="octicon octicon-link"></span></a>Advanced subscription plugin for Chamilo LMS</h1> |
||||
|
||||
<p>Plugin for managing the registration queue and communication to sessions |
||||
from an external website creating a queue to control session subscription |
||||
and sending emails to approve student subscription request</p> |
||||
|
||||
<h1> |
||||
<a id="user-content-requirements" class="anchor" href="#requirements" aria-hidden="true"><span class="octicon octicon-link"></span></a>Requirements</h1> |
||||
|
||||
<p>Chamilo LMS 1.10 or greater</p> |
||||
|
||||
<h1> |
||||
<a id="user-content-settings" class="anchor" href="#settings" aria-hidden="true"><span class="octicon octicon-link"></span></a>Settings</h1> |
||||
|
||||
<table> |
||||
<thead> |
||||
<tr> |
||||
<th>Parameters</th> |
||||
<th>Description</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr> |
||||
<td>Webservice url</td> |
||||
<td>Url to external website to get user profile (SOAP)</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Induction requirement</td> |
||||
<td>Checkbox to enable induction as requirement</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Courses count limit</td> |
||||
<td>Number of times a student is allowed at most to course by year</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Yearly hours limit</td> |
||||
<td>Teaching hours a student is allowed at most to course by year</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Yearly cost unit converter</td> |
||||
<td>The cost of a taxation unit value (TUV)</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Yearly cost limit</td> |
||||
<td>Number of TUV student courses is allowed at most to cost by year</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Year start date</td> |
||||
<td>Date (dd/mm) when the year limit is renewed</td> |
||||
</tr> |
||||
<tr> |
||||
<td>Minimum percentage profile</td> |
||||
<td>Minimum percentage required from external website profile</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
|
||||
<h1> |
||||
<a id="user-content-hooks" class="anchor" href="#hooks" aria-hidden="true"><span class="octicon octicon-link"></span></a>Hooks</h1> |
||||
|
||||
<p>This plugin use the next hooks:</p> |
||||
|
||||
<ul class="task-list"> |
||||
<li>HookAdminBlock</li> |
||||
<li>HookWSRegistration</li> |
||||
<li>HookNotificationContent</li> |
||||
<li>HookNotificationTitle</li> |
||||
</ul> |
||||
|
||||
<h1> |
||||
<a id="user-content-web-services" class="anchor" href="#web-services" aria-hidden="true"><span class="octicon octicon-link"></span></a>Web services</h1> |
||||
|
||||
<ul class="task-list"> |
||||
<li>HookAdvancedSubscription..WSSessionListInCategory</li> |
||||
<li>HookAdvancedSubscription..WSSessionGetDetailsByUser</li> |
||||
<li>HookAdvancedSubscription..WSListSessionsDetailsByCategory</li> |
||||
</ul> |
||||
|
||||
<p>See <code>/plugin/advanced_subscription/src/HookAdvancedSubscription.php</code> to check Web services inputs and outputs</p> |
||||
|
||||
<h1> |
||||
<a id="user-content-how-plugin-works" class="anchor" href="#how-plugin-works" aria-hidden="true"><span class="octicon octicon-link"></span></a>How plugin works?</h1> |
||||
|
||||
<p>After install plugin, fill the parameters needed (described above) |
||||
Use Web services to communicate course session inscription from external website |
||||
This allow to student to search course session and subscribe if is qualified |
||||
and allowed to subscribe. |
||||
The normal process is:</p> |
||||
|
||||
<ul class="task-list"> |
||||
<li>Student search course session</li> |
||||
<li>Student read session info depending student data</li> |
||||
<li>Student request a subscription</li> |
||||
<li>A confirmation email is send to student</li> |
||||
<li>An email is send to users (superior or admins) who will accept or reject student request</li> |
||||
<li>When the user aceept o reject, an email will be send to student, superior or admins respectively</li> |
||||
<li>To complete the subscription, the request must be validated and accepted by an admin</li> |
||||
</ul> |
@ -0,0 +1,940 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* 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 |
||||
*/ |
||||
|
||||
|
||||
class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface |
||||
{ |
||||
protected $strings; |
||||
/** |
||||
* Constructor |
||||
*/ |
||||
public function __construct() |
||||
{ |
||||
$parameters = array( |
||||
'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', |
||||
'secret_key' => 'text', |
||||
); |
||||
|
||||
parent::__construct('1.0', 'Imanol Losada, Daniel Barreto', $parameters); |
||||
} |
||||
|
||||
/** |
||||
* Instance the plugin |
||||
* @staticvar null $result |
||||
* @return AdvancedSubscriptionPlugin |
||||
*/ |
||||
public 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() |
||||
{ |
||||
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE); |
||||
|
||||
$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, " . |
||||
"status int UNSIGNED NOT NULL, " . |
||||
"last_message_id int UNSIGNED NOT NULL, " . |
||||
"created_at datetime NOT NULL, " . |
||||
"updated_at datetime NULL, " . |
||||
"PRIMARY KEY PK_advanced_subscription_queue (id), " . |
||||
"UNIQUE KEY UK_advanced_subscription_queue (user_id, session_id)); "; |
||||
Database::query($sql); |
||||
} |
||||
|
||||
/** |
||||
* Drop the database tables for the plugin |
||||
* @return void |
||||
*/ |
||||
private function uninstallDatabase() |
||||
{ |
||||
/* Drop plugin tables */ |
||||
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE); |
||||
|
||||
$sql = "DROP TABLE IF EXISTS $advancedSubscriptionQueueTable; "; |
||||
Database::query($sql); |
||||
|
||||
/* Delete settings */ |
||||
$settingsTable = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
||||
Database::query("DELETE FROM $settingsTable WHERE subkey = 'advanced_subscription'"); |
||||
} |
||||
|
||||
/** |
||||
* Return true if user is allowed 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 isAllowedToDoRequest($userId, $params = array()) |
||||
{ |
||||
if (isset($params['is_connected']) && isset($params['profile_completed'])) { |
||||
$isAllowed = null; |
||||
$plugin = self::create(); |
||||
$wsUrl = $plugin->get('ws_url'); |
||||
// @TODO: Get connection status from user by WS |
||||
$isConnected = $params['is_connected']; |
||||
if ($isConnected) { |
||||
$profileCompletedMin = (float) $plugin->get('min_profile_percentage'); |
||||
// @TODO: Get completed profile percentage by WS |
||||
$profileCompleted = (float) $params['profile_completed']; |
||||
if ($profileCompleted > $profileCompletedMin) { |
||||
$checkInduction = $plugin->get('check_induction'); |
||||
// @TODO: check if user have completed at least one induction session |
||||
$completedInduction = true; |
||||
if (!$checkInduction || $completedInduction) { |
||||
$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 = $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 = $plugin->get('courses_count_limit'); |
||||
// @TODO: Get Expended num from user |
||||
$expendedNum = 0; |
||||
if ($expendedNumMax >= $expendedNum) { |
||||
$isAllowed = 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 $isAllowed; |
||||
} 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) |
||||
{ |
||||
// Filter input variables |
||||
$userId = intval($userId); |
||||
$sessionId = intval($sessionId); |
||||
$now = api_get_utc_datetime(); |
||||
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE); |
||||
$attributes = array( |
||||
'session_id' => $sessionId, |
||||
'user_id' => $userId, |
||||
'status' => 0, |
||||
'created_at' => $now, |
||||
'updated_at' => null, |
||||
); |
||||
|
||||
$id = Database::insert($advancedSubscriptionQueueTable, $attributes); |
||||
|
||||
return $id; |
||||
} |
||||
|
||||
/** |
||||
* Register message with type and status |
||||
* @param $mailId |
||||
* @param $userId |
||||
* @param $sessionId |
||||
* @return bool|int |
||||
*/ |
||||
public function saveLastMessage($mailId, $userId, $sessionId) |
||||
{ |
||||
// Filter variables |
||||
$mailId = intval($mailId); |
||||
$userId = intval($userId); |
||||
$sessionId = intval($sessionId); |
||||
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_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 = null; |
||||
if (!empty($sessionId) && !empty($userId)) { |
||||
$plugin = self::create(); |
||||
try { |
||||
if ($plugin->isAllowedToDoRequest($userId, $params)) { |
||||
$result = (bool) $plugin->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) |
||||
{ |
||||
$mailId = MessageManager::send_message( |
||||
$receiverId, |
||||
$subject, |
||||
$content |
||||
); |
||||
|
||||
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 = 'is_open_session') |
||||
{ |
||||
$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) |
||||
{ |
||||
$newStatus = intval($newStatus); |
||||
if (isset($params['queue']['id'])) { |
||||
$where = array( |
||||
'id = ?' => intval($params['queue']['id']), |
||||
); |
||||
} elseif (isset($params['studentUserId']) && isset($params['sessionId'])) { |
||||
$where = array( |
||||
'user_id = ? AND session_id = ? AND status <> ? AND status <> ?' => array( |
||||
intval($params['studentUserId']), |
||||
intval($params['sessionId']), |
||||
$newStatus, |
||||
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED, |
||||
), |
||||
); |
||||
} |
||||
if (isset($where)) { |
||||
$res = (bool) Database::update( |
||||
Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_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) |
||||
{ |
||||
$template = new Template($this->get_lang('plugin_title')); |
||||
$template->assign('data', $data); |
||||
$templateParams = array( |
||||
'user', |
||||
'student', |
||||
'students', |
||||
'superior', |
||||
'admins', |
||||
'session', |
||||
'signature', |
||||
'admin_view_url', |
||||
'acceptUrl', |
||||
'rejectUrl' |
||||
); |
||||
foreach ($templateParams as $templateParam) { |
||||
$template->assign($templateParam, $data[$templateParam]); |
||||
} |
||||
$mailIds = array(); |
||||
switch ($actionType) { |
||||
case ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST: |
||||
// Mail to student |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailStudentRequest'), |
||||
$template->fetch('/advanced_subscription/views/student_notice_student.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailStudentRequest'), |
||||
$template->fetch('/advanced_subscription/views/student_notice_superior.tpl'), |
||||
$data['sessionId'], |
||||
true |
||||
); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailBossAccept'), |
||||
$template->fetch('/advanced_subscription/views/superior_accepted_notice_student.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailBossAccept'), |
||||
$template->fetch('/advanced_subscription/views/superior_accepted_notice_superior.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to admin |
||||
foreach ($data['admins'] as $adminId => $admin) { |
||||
$template->assign('admin', $admin); |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$adminId, |
||||
$this->get_lang('MailBossAccept'), |
||||
$template->fetch('/advanced_subscription/views/superior_accepted_notice_admin.tpl'), |
||||
$data['sessionId'], |
||||
true |
||||
); |
||||
} |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailBossReject'), |
||||
$template->fetch('/advanced_subscription/views/superior_rejected_notice_student.tpl'), |
||||
$data['sessionId'], |
||||
true |
||||
); |
||||
// Mail to superior |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailBossReject'), |
||||
$template->fetch('/advanced_subscription/views/superior_rejected_notice_superior.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_SELECT: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailStudentRequestSelect'), |
||||
$template->fetch('/advanced_subscription/views/student_notice_student.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailStudentRequestSelect'), |
||||
$template->fetch('/advanced_subscription/views/student_notice_superior.tpl'), |
||||
$data['sessionId'], |
||||
true |
||||
); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailAdminAccept'), |
||||
$template->fetch('/advanced_subscription/views/admin_accepted_notice_student.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to superior |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailAdminAccept'), |
||||
$template->fetch('/advanced_subscription/views/admin_accepted_notice_superior.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to admin |
||||
$adminId = $data['currentUserId']; |
||||
$template->assign('admin', $data['admins'][$adminId]); |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$adminId, |
||||
$this->get_lang('MailAdminAccept'), |
||||
$template->fetch('/advanced_subscription/views/admin_accepted_notice_admin.tpl'), |
||||
$data['sessionId'], |
||||
true |
||||
); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE: |
||||
// Mail to student |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailAdminReject'), |
||||
$template->fetch('/advanced_subscription/views/admin_rejected_notice_student.tpl'), |
||||
$data['sessionId'], |
||||
true |
||||
); |
||||
// Mail to superior |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['superior']['user_id'], |
||||
$this->get_lang('MailAdminReject'), |
||||
$template->fetch('/advanced_subscription/views/admin_rejected_notice_superior.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to admin |
||||
$adminId = $data['currentUserId']; |
||||
$template->assign('admin', $data['admins'][$adminId]); |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$adminId, |
||||
$this->get_lang('MailAdminReject'), |
||||
$template->fetch('/advanced_subscription/views/admin_rejected_notice_admin.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST_NO_BOSS: |
||||
// Mail to student |
||||
$mailIds['render'] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$data['student']['user_id'], |
||||
$this->get_lang('MailStudentRequestNoBoss'), |
||||
$template->fetch('/advanced_subscription/views/student_no_superior_notice_student.tpl'), |
||||
$data['sessionId'] |
||||
); |
||||
// Mail to admin |
||||
foreach ($data['admins'] as $adminId => $admin) { |
||||
$template->assign('admin', $admin); |
||||
$mailIds[] = $this->sendMailMessage( |
||||
$data['studentUserId'], |
||||
$adminId, |
||||
$this->get_lang('MailStudentRequestNoBoss'), |
||||
$template->fetch('/advanced_subscription/views/student_no_superior_notice_admin.tpl'), |
||||
$data['sessionId'], |
||||
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)) { |
||||
$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(*)', $advancedSubscriptionQueueTable, $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) |
||||
{ |
||||
$userId = intval($userId); |
||||
$sessionId = intval($sessionId); |
||||
if (!empty($userId) && !empty($sessionId)) { |
||||
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_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 ADVANCED_SUBSCRIPTION_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' => array($sessionId), |
||||
'status' => array(ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED), |
||||
) |
||||
); |
||||
if ($vacancy >= 0) { |
||||
|
||||
return $vacancy; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Return the session details data from a session ID (including the extra |
||||
* fields used for the advanced subscription mechanism) |
||||
* @param $sessionId |
||||
* @return bool|mixed |
||||
*/ |
||||
public function getSessionDetails($sessionId) |
||||
{ |
||||
if (!empty($sessionId)) { |
||||
// Assign variables |
||||
$fieldsArray = array('id', 'cost', 'place', 'allow_visitors', 'teaching_hours', 'brochure', 'banner'); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$extraField = new ExtraField('session'); |
||||
// Get session fields |
||||
$fieldList = $extraField->get_all(array( |
||||
'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray |
||||
)); |
||||
// Index session fields |
||||
$fields = array(); |
||||
foreach ($fieldList as $field) { |
||||
$fields[$field['id']] = $field['field_variable']; |
||||
} |
||||
|
||||
$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 |
||||
if (isset($fields[$sessionFieldValue['field_id']])) { |
||||
$var = $fields[$sessionFieldValue['field_id']]; |
||||
$val = $sessionFieldValue['field_value']; |
||||
// Assign session field value to session |
||||
$sessionArray[$var] = $val; |
||||
} |
||||
} |
||||
$sessionArray['description'] = SessionManager::getDescriptionFromSessionId($sessionId); |
||||
|
||||
return $sessionArray; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Get status message |
||||
* @param int $status |
||||
* @param bool $isAble |
||||
* @return string |
||||
*/ |
||||
public function getStatusMessage($status, $isAble = true) |
||||
{ |
||||
$message = ''; |
||||
switch ($status) |
||||
{ |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE: |
||||
if ($isAble) { |
||||
$message = $this->get_lang('AdvancedSubscriptionNoQueueIsAble'); |
||||
} else { |
||||
$message = $this->get_lang('AdvancedSubscriptionNoQueue'); |
||||
} |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueStart'); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueBossDisapproved'); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueBossApproved'); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED: |
||||
$message = $this->get_lang('AdvancedSubscriptionQueueAdminDisapproved'); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_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=' . intval($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) . '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); |
||||
return $url; |
||||
} |
||||
|
||||
/** |
||||
* Return the list of student, in queue used by admin view |
||||
* @param int $sessionId |
||||
* @return array |
||||
*/ |
||||
public function listAllStudentsInQueueBySession($sessionId) |
||||
{ |
||||
// Filter input variable |
||||
$sessionId = intval($sessionId); |
||||
// Assign variables |
||||
$fieldsArray = array( |
||||
'target', |
||||
'publication_end_date', |
||||
'mode', |
||||
'recommended_number_of_participants', |
||||
'vacancies' |
||||
); |
||||
$sessionArray = api_get_session_info($sessionId); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$extraField = new ExtraField('session'); |
||||
// Get session fields |
||||
$fieldList = $extraField->get_all(array( |
||||
'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray |
||||
)); |
||||
// Index session fields |
||||
$fields = array(); |
||||
foreach ($fieldList as $field) { |
||||
$fields[$field['id']] = $field['field_variable']; |
||||
} |
||||
|
||||
$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 |
||||
if (isset($fields[$sessionFieldValue['field_id']])) { |
||||
$var = $fields[$sessionFieldValue['field_id']]; |
||||
$val = $sessionFieldValue['field_value']; |
||||
// Assign session field value to session |
||||
$sessionArray[$var] = $val; |
||||
} |
||||
} |
||||
$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( |
||||
'where' => |
||||
array( |
||||
'q.session_id = ? AND q.status <> ? AND q.status <> ?' => array( |
||||
$sessionId, |
||||
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED, |
||||
ADVANCED_SUBSCRIPTION_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 ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE: |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START: |
||||
$student['validation'] = ''; |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED: |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED: |
||||
$student['validation'] = get_lang('No'); |
||||
break; |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED: |
||||
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED: |
||||
$student['validation'] = get_lang('Yes'); |
||||
break; |
||||
default: |
||||
error_log(__FILE__ . ' ' . __FUNCTION__ . ' Student status no detected'); |
||||
} |
||||
} |
||||
$return = array( |
||||
'session' => $sessionArray, |
||||
'students' => $students, |
||||
); |
||||
|
||||
return $return; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* List all session (id, name) for select input |
||||
* @param int $limit |
||||
* @return array |
||||
*/ |
||||
public function listAllSessions($limit = 100) |
||||
{ |
||||
$limit = intval($limit); |
||||
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION); |
||||
$columns = 'id, name'; |
||||
$conditions = array(); |
||||
if ($limit > 0) { |
||||
$conditions = array( |
||||
'order' => 'name', |
||||
'limit' => $limit, |
||||
); |
||||
} |
||||
|
||||
return Database::select($columns, $sessionTable, $conditions); |
||||
} |
||||
|
||||
/** |
||||
* 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['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); |
||||
} |
||||
|
||||
/** |
||||
* Verify hash from data |
||||
* @param string $data |
||||
* @param string $hash |
||||
* @return bool |
||||
*/ |
||||
public function checkHash($data, $hash) |
||||
{ |
||||
return $this->generateHash($data) == $hash; |
||||
} |
||||
|
||||
/** |
||||
* Copied and fixed from plugin.class.php |
||||
* Returns the "system" name of the plugin in lowercase letters |
||||
* @return string |
||||
*/ |
||||
public function get_name() |
||||
{ |
||||
return 'advanced_subscription'; |
||||
} |
||||
} |
@ -0,0 +1,673 @@ |
||||
<?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.advanced_subscription |
||||
*/ |
||||
|
||||
require_once __DIR__ . '/../config.php'; |
||||
|
||||
/** |
||||
* Class HookAdvancedSubscription extends the HookObserver to implements |
||||
* specific behaviour when the AdvancedSubscription plugin is enabled |
||||
*/ |
||||
class HookAdvancedSubscription extends HookObserver implements |
||||
HookAdminBlockObserverInterface, |
||||
HookWSRegistrationObserverInterface, |
||||
HookNotificationContentObserverInterface |
||||
{ |
||||
public $plugin; |
||||
|
||||
/** |
||||
* Constructor. Calls parent, mainly. |
||||
*/ |
||||
protected function __construct() |
||||
{ |
||||
$this->plugin = AdvancedSubscriptionPlugin::create(); |
||||
parent::__construct( |
||||
'plugin/advanced_subscription/src/HookAdvancedSubscription.class.php', |
||||
'advanced_subscription' |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* @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/advanced_subscription/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 mixed (int or false) |
||||
*/ |
||||
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( |
||||
// session.id |
||||
'id' => array('name' => 'id', 'type' => 'xsd:int'), |
||||
// session.name |
||||
'name' => array('name' => 'name', 'type' => 'xsd:string'), |
||||
// session.short_description |
||||
'short_description' => array('name' => 'short_description', 'type' => 'xsd:string'), |
||||
// session.mode |
||||
'mode' => array('name' => 'mode', 'type' => 'xsd:string'), |
||||
// 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.human_text_duration |
||||
'duration' => array('name' => 'duration', 'type' => 'xsd:string'), |
||||
// session.vacancies |
||||
'vacancies' => array('name' => 'vacancies', 'type' => 'xsd:string'), |
||||
// session.schedule |
||||
'schedule' => array('name' => 'schedule', 'type' => 'xsd:string'), |
||||
) |
||||
); |
||||
|
||||
//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.user_id |
||||
'user_id' => array('name' => 'user_id', 'type' => 'xsd:int'), |
||||
// session.id |
||||
'session_id' => array('name' => 'session_id', 'type' => 'xsd:int'), |
||||
// user.profile_completes |
||||
'profile_completed' => array('name' => 'profile_completed', 'type' => 'xsd:float'), |
||||
// user.is_connected |
||||
'is_connected' => array('name' => 'is_connected', 'type' => 'xsd:boolean'), |
||||
'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string'), |
||||
) |
||||
); |
||||
|
||||
// Output params for WSSessionGetDetailsByUser |
||||
$server->wsdl->addComplexType( |
||||
'advsubSessionDetail', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
// session.id |
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'), |
||||
// session.cost |
||||
'cost' => array('name' => 'cost', 'type' => 'xsd:float'), |
||||
// session.place |
||||
'place' => array('name' => 'place', 'type' => 'xsd:string'), |
||||
// session.allow_visitors |
||||
'allow_visitors' => array('name' => 'allow_visitors', 'type' => 'xsd:string'), |
||||
// session.duration |
||||
'duration' => array('name' => 'duration', 'type' => 'xsd:int'), |
||||
// session.brochure |
||||
'brochure' => array('name' => 'brochure', 'type' => 'xsd:string'), |
||||
// session.banner |
||||
'banner' => array('name' => 'banner', 'type' => 'xsd:string'), |
||||
// session.description |
||||
'description' => array('name' => 'description', 'type' => 'xsd:string'), |
||||
// status |
||||
'status' => array('name' => 'status', 'type' => 'xsd:string'), |
||||
// action_url |
||||
'action_url' => array('name' => 'action_url', 'type' => 'xsd:string'), |
||||
// message |
||||
'message' => array('name' => 'error_message', 'type' => 'xsd:string'), |
||||
) |
||||
); |
||||
|
||||
/** WSListSessionsDetailsByCategory **/ |
||||
|
||||
// Input params for WSListSessionsDetailsByCategory |
||||
$server->wsdl->addComplexType( |
||||
'listSessionsDetailsByCategory', |
||||
'complexType', |
||||
'struct', |
||||
'all', |
||||
'', |
||||
array( |
||||
// session_category.id |
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'), |
||||
// session_category.access_url_id |
||||
'access_url_id' => array('name' => 'access_url_id', 'type' => 'xsd:int'), |
||||
// session_category.name |
||||
'category_name' => array('name' => 'category_name', 'type' => 'xsd:string'), |
||||
// secret key |
||||
'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string'), |
||||
), |
||||
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 |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* @param $params |
||||
* @return null|soap_fault |
||||
*/ |
||||
public static function WSSessionListInCategory($params) |
||||
{ |
||||
global $debug; |
||||
|
||||
if ($debug) { |
||||
error_log('WSUserSubscribedInCourse'); |
||||
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 |
||||
$fields = array( |
||||
'short_description', |
||||
'mode', |
||||
'human_text_duration', |
||||
'vacancies', |
||||
'brochure', |
||||
'target', |
||||
'schedule' |
||||
); |
||||
$sessionList = SessionManager::getShortSessionListAndExtraByCategory( |
||||
$sessionCategoryId, |
||||
$params['target'], |
||||
$fields |
||||
); |
||||
|
||||
return $sessionList; |
||||
} |
||||
|
||||
/** |
||||
* @param $params |
||||
* @return null|soap_fault |
||||
*/ |
||||
public function WSSessionGetDetailsByUser($params) |
||||
{ |
||||
global $debug; |
||||
|
||||
if ($debug) { |
||||
error_log('WSUserSubscribedInCourse'); |
||||
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 |
||||
|
||||
$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'] = $this->plugin->getSessionUrl($sessionId); |
||||
} else { |
||||
try { |
||||
$isAble = $this->plugin->isAllowedToDoRequest($userId, $params); |
||||
$data['message'] = $this->plugin->getStatusMessage($status, $isAble); |
||||
} catch (\Exception $e) { |
||||
$data['message'] = $e->getMessage(); |
||||
} |
||||
$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 === ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE) { |
||||
// No in Queue, require queue subscription url action |
||||
$data['action_url'] = $this->plugin->getQueueUrl($params); |
||||
} elseif ($status === ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) { |
||||
// send url action |
||||
$data['action_url'] = $this->plugin->getSessionUrl($sessionId); |
||||
} else { |
||||
// In queue, output status message, no more info. |
||||
} |
||||
} else { |
||||
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'] = $this->plugin->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 $params 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=>'']) |
||||
*/ |
||||
public function WSListSessionsDetailsByCategory($params) |
||||
{ |
||||
global $debug; |
||||
|
||||
if ($debug) { |
||||
error_log('WSListSessionsDetailsByCategory'); |
||||
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); |
||||
} |
||||
|
||||
// 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; |
||||
} |
||||
|
||||
/** |
||||
* Return notification content when the hook has been triggered |
||||
* @param HookNotificationContentEventInterface $hook |
||||
* @return mixed (int or false) |
||||
*/ |
||||
public function hookNotificationContent(HookNotificationContentEventInterface $hook) |
||||
{ |
||||
$data = $hook->getEventData(); |
||||
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { |
||||
$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['advanced_subscription_pre_content']) && |
||||
!empty($data['advanced_subscription_pre_content']) |
||||
) { |
||||
$data['content'] = str_replace( |
||||
array( |
||||
'<br /><hr>', |
||||
'<br />', |
||||
'<br/>', |
||||
), |
||||
'', |
||||
$data['advanced_subscription_pre_content'] |
||||
); |
||||
} |
||||
|
||||
return $data; |
||||
} else { |
||||
// Hook type is not valid |
||||
// Nothing to do |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Return the notification data title if the hook was triggered |
||||
* @param HookNotificationTitleEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookNotificationTitle(HookNotificationTitleEventInterface $hook) |
||||
{ |
||||
$data = $hook->getEventData(); |
||||
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { |
||||
$data['advanced_subscription_pre_title'] = $data['title']; |
||||
|
||||
return $data; |
||||
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) { |
||||
if (isset($data['advanced_subscription_pre_title']) && |
||||
!empty($data['advanced_subscription_pre_title']) |
||||
) { |
||||
$data['title'] = $data['advanced_subscription_pre_title']; |
||||
} |
||||
|
||||
return $data; |
||||
} else { |
||||
// Hook type is not valid |
||||
// Nothing to do |
||||
} |
||||
return false; |
||||
} |
||||
} |
@ -0,0 +1,88 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
/** |
||||
* Index of the Advanced subscription plugin courses list |
||||
* @package chamilo.plugin.advanced_subscription |
||||
*/ |
||||
/** |
||||
* Init |
||||
*/ |
||||
require_once __DIR__ . '/../config.php'; |
||||
// protect |
||||
api_protect_admin_script(); |
||||
// start plugin |
||||
$plugin = AdvancedSubscriptionPlugin::create(); |
||||
// Session ID |
||||
$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($sessionId)) { |
||||
// Get student list in queue |
||||
$studentList = $plugin->listAllStudentsInQueueBySession($sessionId); |
||||
// Set selected to current session |
||||
$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($sessionId); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$extraField = new ExtraField('session'); |
||||
// Get session fields |
||||
$fieldList = $extraField->get_all(array( |
||||
'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray |
||||
)); |
||||
// Index session fields |
||||
foreach ($fieldList as $field) { |
||||
$fields[$field['id']] = $field['field_variable']; |
||||
} |
||||
|
||||
$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 |
||||
if (isset($fields[$sessionFieldValue['field_id']])) { |
||||
$var = $fields[$sessionFieldValue['field_id']]; |
||||
$val = $sessionFieldValue['field_value']; |
||||
// Assign session field value to session |
||||
$sessionArray[$var] = $val; |
||||
} |
||||
} |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
|
||||
$data['action'] = 'confirm'; |
||||
$data['sessionId'] = $sessionId; |
||||
$data['currentUserId'] = api_get_user_id(); |
||||
$isWesternNameOrder = api_is_western_name_order(); |
||||
|
||||
foreach ($studentList['students'] as &$student) { |
||||
$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['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED; |
||||
$student['rejectUrl'] = $plugin->getQueueUrl($data); |
||||
$student['complete_name'] = $isWesternNameOrder ? |
||||
$student['firstname'] . ', ' . $student['lastname'] : |
||||
$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', 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 |
||||
$tpl->assign('content', $content); |
||||
// Display |
||||
$tpl->display_one_col_template(); |
@ -0,0 +1,123 @@ |
||||
<?php |
||||
|
||||
require_once __DIR__ . '/../config.php'; |
||||
|
||||
// Protect test |
||||
api_protect_admin_script(); |
||||
|
||||
// exit; |
||||
$plugin = AdvancedSubscriptionPlugin::create(); |
||||
// Get validation hash |
||||
$hash = Security::remove_XSS($_REQUEST['v']); |
||||
// Get data from request (GET or POST) |
||||
$data['action'] = 'confirm'; |
||||
$data['currentUserId'] = 1; |
||||
$data['queueId'] = 0; |
||||
$data['is_connected'] = true; |
||||
$data['profile_completed'] = 90.0; |
||||
// Init result array |
||||
|
||||
$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['sessionId']); |
||||
$extraSession = new ExtraFieldValue('session'); |
||||
$extraField = new ExtraField('session'); |
||||
// Get session fields |
||||
$fieldList = $extraField->get_all(array( |
||||
'field_variable IN ( ?, ?, ?, ?, ?)' => $fieldsArray |
||||
)); |
||||
$fields = array(); |
||||
// Index session fields |
||||
foreach ($fieldList as $field) { |
||||
$fields[$field['id']] = $field['field_variable']; |
||||
} |
||||
|
||||
$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 |
||||
if (isset($fields[$sessionFieldValue['field_id']])) { |
||||
$var = $fields[$sessionFieldValue['field_id']]; |
||||
$val = $sessionFieldValue['field_value']; |
||||
// Assign session field value to session |
||||
$sessionArray[$var] = $val; |
||||
} |
||||
} |
||||
// Get student data |
||||
$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['studentUserId']); |
||||
if (!empty($superiorId)) { |
||||
$superiorArray = api_get_user_info($superiorId); |
||||
} else { |
||||
$superiorArray = api_get_user_info(3); |
||||
} |
||||
// Get admin data |
||||
$adminsArray = UserManager::get_all_administrators(); |
||||
$isWesternNameOrder = api_is_western_name_order(); |
||||
foreach ($adminsArray as &$admin) { |
||||
$admin['complete_name'] = $isWesternNameOrder ? |
||||
$admin['firstname'] . ', ' . $admin['lastname'] : |
||||
$admin['lastname'] . ', ' . $admin['firstname'] |
||||
; |
||||
} |
||||
unset($admin); |
||||
// Set data |
||||
$data['action'] = 'confirm'; |
||||
$data['student'] = $studentArray; |
||||
$data['superior'] = $superiorArray; |
||||
$data['admins'] = $adminsArray; |
||||
$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['sessionId']; |
||||
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED; |
||||
$data['student']['acceptUrl'] = $plugin->getQueueUrl($data); |
||||
$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); |
||||
$tplParams = array( |
||||
'user', |
||||
'student', |
||||
'students', |
||||
'superior', |
||||
'admins', |
||||
'admin', |
||||
'session', |
||||
'signature', |
||||
'admin_view_url', |
||||
'acceptUrl', |
||||
'rejectUrl' |
||||
); |
||||
foreach ($tplParams as $tplParam) { |
||||
$tpl->assign($tplParam, $data[$tplParam]); |
||||
} |
||||
|
||||
$dir = __DIR__ . '/../views/'; |
||||
$files = scandir($dir); |
||||
|
||||
echo '<br>', '<pre>' , print_r($files, 1) , '</pre>'; |
||||
|
||||
foreach ($files as $k =>&$file) { |
||||
if ( |
||||
is_file($dir . $file) && |
||||
strpos($file, '.tpl') && |
||||
$file != 'admin_view.tpl' |
||||
) { |
||||
echo '<pre>', $file, '</pre>'; |
||||
echo $tpl->fetch('/advanced_subscription/views/' . $file); |
||||
} else { |
||||
unset($files[$k]); |
||||
} |
||||
} |
||||
echo '<br>', '<pre>' , print_r($files, 1) , '</pre>'; |
@ -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.advanced_subscription |
||||
*/ |
||||
|
||||
/** |
||||
* 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,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleAdminAcceptToAdmin"| get_plugin_lang('AdvancedSubscriptionPlugin') }}</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>{{ "MailDear" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>{{ "MailContentAdminAcceptToAdmin" | get_plugin_lang('AdvancedSubscriptionPlugin') | format(student.complete_name_with_username, session.name) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle" | get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleAdminAcceptToStudent" | get_plugin_lang('AdvancedSubscriptionPlugin') | format(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> {{ "MailDear" | get_plugin_lang('AdvancedSubscriptionPlugin') }} </p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentAdminAcceptToStudent" | get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name, session.date_start) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleAdminAcceptToSuperior"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(student.complete_name, 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>{{ "MailDear"| get_plugin_lang('AdvancedSubscriptionPlugin') }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentAdminAcceptToSuperior"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(student.complete_name, session.name, session.date_start) }}</p> |
||||
<p>{{ "MailThankYou"| get_plugin_lang('AdvancedSubscriptionPlugin') }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleAdminRejectToAdmin" | get_plugin_lang('AdvancedSubscriptionPlugin') }}</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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>{{ "MailContentAdminRejectToAdmin"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(student.complete_name_with_username, session.name) }}</strong></p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleAdminRejectToStudent"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentAdminRejectToStudent"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name, session.date_start) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleAdminRejectToSuperior"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(student.complete_name, 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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentAdminRejectToSuperior"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(student.complete_name, session.name) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,139 @@ |
||||
<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> |
||||
<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="{{ _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> |
||||
<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-advanced-subscription btn-accept" |
||||
href="{{ student.acceptUrl }}" |
||||
> |
||||
{{ 'Accept' | get_plugin_lang('AdvancedSubscriptionPlugin') }} |
||||
</a> |
||||
<a |
||||
class="btn btn-danger btn-advanced-subscription btn-reject" |
||||
href="{{ student.rejectUrl }}" |
||||
> |
||||
{{ 'Reject' | get_plugin_lang('AdvancedSubscriptionPlugin') }} |
||||
</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="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="modalMailLabel">{{ "AdvancedSubscriptionAdminViewTitle" | get_plugin_lang('AdvancedSubscriptionPlugin')}}</h4> |
||||
</div> |
||||
<div class="modal-body"> |
||||
<iframe id="iframeAdvsub" frameBorder="0"> |
||||
</iframe> |
||||
</div> |
||||
<div class="modal-footer"> |
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cerrar</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<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_advanced_subscription_admin").submit(); |
||||
}); |
||||
$("a.btn-advanced-subscription").click(function(event){ |
||||
event.preventDefault(); |
||||
var confirmed = false; |
||||
var studentName = $(this).closest("tr").find(".name").html(); |
||||
if (studentName) { |
||||
; |
||||
} else { |
||||
studentName = ""; |
||||
} |
||||
var msgRe = /%s/; |
||||
if ($(this).hasClass('btn-accept')) { |
||||
var msg = "{{ 'AreYouSureYouWantToAcceptSubscriptionOfX' | get_plugin_lang('AdvancedSubscriptionPlugin') }}"; |
||||
var confirmed = confirm(msg.replace(msgRe, studentName)); |
||||
} else { |
||||
var msg = "{{ 'AreYouSureYouWantToRejectSubscriptionOfX' | get_plugin_lang('AdvancedSubscriptionPlugin') }}"; |
||||
var confirmed = confirm(msg.replace(msgRe, studentName)); |
||||
} |
||||
if (confirmed) { |
||||
var thisBlock = $(this).closest("tr"); |
||||
var advancedSubscriptionUrl = $(this).attr("href") |
||||
$("#iframeAdvsub").attr("src", advancedSubscriptionUrl) |
||||
$("#modalMail").modal("show"); |
||||
$.ajax({ |
||||
dataType: "json", |
||||
url: advancedSubscriptionUrl |
||||
}).done(function(result){ |
||||
if (result.error == true) { |
||||
thisBlock.slideUp(); |
||||
} else { |
||||
console.log(result); |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
@ -0,0 +1,63 @@ |
||||
.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 { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 270 B |
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 283 B |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleReminderAdmin" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>{{ "MailContentReminderAdmin" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, admin_view_url)}}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,76 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleReminderStudent"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentReminderStudent"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, session.date_start) }}</p> |
||||
<p>{{ "MailContentReminderStudentSecond"| get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ "MailThankYouCollaboration"| get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ signature }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleReminderSuperior" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentReminderSuperior" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, session.date_start, session.description) }}</p> |
||||
<p>{{ "MailContentReminderSuperiorSecond" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}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> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ signature }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/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>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleReminderMaxSuperior" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentReminderMaxSuperior" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, session.date_start, session.description) }}</p> |
||||
<p>{{ "MailContentReminderMaxSuperiorSecond" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.recommended_number_of_participants) }}</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 }}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> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleStudentRequestNoSuperiorToAdmin"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(student.complete_name, 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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>{{ "MailContentStudentRequestNoSuperiorToAdmin"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(complete_name_with_username, session.name, admin_view_url) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,76 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleStudentRequestNoSuperiorToStudent"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentStudentRequestNoSuperiorToStudent"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, session.date_start) }}</p> |
||||
<p>{{ "MailContentStudentRequestNoSuperiorToStudentSecond"| get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ signature }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleStudentRequestToStudent"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentStudentRequestToStudent"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, session.date_start) }}</p> |
||||
<p>{{ "MailContentStudentRequestToStudentSecond" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ signature }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,84 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleStudentRequestToSuperior" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentStudentRequestToSuperior" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(student.complete_name, session.name, session.date_start, session.description) }}</p> |
||||
<p>{{ "MailContentStudentRequestToSuperiorSecond" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}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> |
||||
<p>{{ signature }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleSuperiorAcceptToAdmin"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(student.complete_name, 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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ admin.complete_name }}</h2> |
||||
<p>{{ "MailContentSuperiorAcceptToAdmin"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(student.complete_name_with_username, session.name, admin_view_url) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,76 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleSuperiorAcceptToStudent" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentSuperiorAcceptToStudent" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name ) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,76 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleSuperiorAcceptToSuperior"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentSuperiorAcceptToSuperior"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, student.complete_name) }}</p> |
||||
<p>{{ "MailContentSuperiorAcceptToSuperiorSecond"| get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<p>{{ "MailThankYouCollaboration" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleSuperiorRejectToStudent" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ student.complete_name }}</h2> |
||||
<p>{{ "MailContentSuperiorRejectToStudent" | get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name) }}</p> |
||||
<p>{{ "MailThankYou" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |
@ -0,0 +1,75 @@ |
||||
<!doctype html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>{{ "MailTitle"| get_plugin_lang('AdvancedSubscriptionPlugin') | format(session.name) }}</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<table width="700" border="0" cellspacing="0" cellpadding="0"> |
||||
<tr> |
||||
<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 }}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"> </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"> </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;">{{ "MailTitleSuperiorRejectToSuperior"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(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>{{ "MailDear" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</p> |
||||
<h2>{{ superior.complete_name }}</h2> |
||||
<p>{{ "MailContentSuperiorRejectToSuperior"| get_plugin_lang("AdvancedSubscriptionPlugin") | format(session.name, student.complete_name) }}</p> |
||||
<p>{{ "MailThankYouCollaboration" | get_plugin_lang("AdvancedSubscriptionPlugin") }}</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 }}advanced_subscription/views/img/line.png" width="700" height="25" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="{{ _p.web_plugin }}advanced_subscription/views/img/footer.png" width="700" height="20" alt=""></td> |
||||
</tr> |
||||
<tr> |
||||
<td> </td> |
||||
</tr> |
||||
</table> |
||||
</body> |
||||
</html> |