Minor - format php public/plugin

pull/3064/head
Julio 6 years ago
parent 996feff3ed
commit e39837419c
  1. 2
      .php_cs.dist
  2. 38
      public/plugin/advanced_subscription/ajax/advanced_subscription.ajax.php
  3. 3
      public/plugin/advanced_subscription/config.php
  4. 8
      public/plugin/advanced_subscription/cron/notify_by_mail.php
  5. 3
      public/plugin/advanced_subscription/install.php
  6. 60
      public/plugin/advanced_subscription/lang/english.php
  7. 20
      public/plugin/advanced_subscription/lang/french.php
  8. 56
      public/plugin/advanced_subscription/lang/spanish.php
  9. 3
      public/plugin/advanced_subscription/plugin.php
  10. 180
      public/plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php
  11. 34
      public/plugin/advanced_subscription/src/HookAdvancedSubscription.php
  12. 11
      public/plugin/advanced_subscription/src/admin_view.php
  13. 3
      public/plugin/advanced_subscription/src/open_session.php
  14. 5
      public/plugin/advanced_subscription/src/render_mail.php
  15. 3
      public/plugin/advanced_subscription/src/scripts/insert_session_fields.php
  16. 3
      public/plugin/advanced_subscription/src/scripts/insert_sessions_categories.php
  17. 19
      public/plugin/advanced_subscription/src/terms_and_conditions.php
  18. 5
      public/plugin/advanced_subscription/test/mails.php
  19. 7
      public/plugin/advanced_subscription/test/terms_to_pdf.php
  20. 13
      public/plugin/advanced_subscription/test/ws_session_user.php
  21. 3
      public/plugin/advanced_subscription/uninstall.php
  22. 5
      public/plugin/azure_active_directory/index.php
  23. 1
      public/plugin/azure_active_directory/install.php
  24. 3
      public/plugin/azure_active_directory/lang/english.php
  25. 3
      public/plugin/azure_active_directory/login.php
  26. 3
      public/plugin/azure_active_directory/plugin.php
  27. 9
      public/plugin/azure_active_directory/src/AzureActiveDirectory.php
  28. 3
      public/plugin/azure_active_directory/src/callback.php
  29. 8
      public/plugin/bbb/admin.php
  30. 7
      public/plugin/bbb/ajax.php
  31. 1
      public/plugin/bbb/config.php
  32. 4
      public/plugin/bbb/course_index.php
  33. 1
      public/plugin/bbb/cron.php
  34. 2
      public/plugin/bbb/install.php
  35. 43
      public/plugin/bbb/lang/english.php
  36. 37
      public/plugin/bbb/lang/french.php
  37. 45
      public/plugin/bbb/lang/german.php
  38. 45
      public/plugin/bbb/lang/spanish.php
  39. 16
      public/plugin/bbb/lib/VM.php
  40. 471
      public/plugin/bbb/lib/bbb.lib.php
  41. 29
      public/plugin/bbb/lib/bbb_api.php
  42. 43
      public/plugin/bbb/lib/bbb_plugin.class.php
  43. 5
      public/plugin/bbb/lib/vm/AbstractVM.php
  44. 23
      public/plugin/bbb/lib/vm/AmazonVM.php
  45. 41
      public/plugin/bbb/lib/vm/DigitalOceanVM.php
  46. 24
      public/plugin/bbb/lib/vm/VMInterface.php
  47. 29
      public/plugin/bbb/listing.php
  48. 1
      public/plugin/bbb/plugin.php
  49. 5
      public/plugin/bbb/start.php
  50. 3
      public/plugin/bbb/uninstall.php
  51. 4
      public/plugin/before_login/index.php
  52. 3
      public/plugin/before_login/plugin.php
  53. 1
      public/plugin/buycourses/admin.php
  54. 1
      public/plugin/buycourses/config.php
  55. 5
      public/plugin/buycourses/database.php
  56. 1
      public/plugin/buycourses/index.php
  57. 3
      public/plugin/buycourses/install.php
  58. 187
      public/plugin/buycourses/lang/brazilian.php
  59. 267
      public/plugin/buycourses/lang/dutch.php
  60. 363
      public/plugin/buycourses/lang/english.php
  61. 241
      public/plugin/buycourses/lang/french.php
  62. 407
      public/plugin/buycourses/lang/spanish.php
  63. 3
      public/plugin/buycourses/plugin.php
  64. 150
      public/plugin/buycourses/src/buy_course_plugin.class.php
  65. 194
      public/plugin/buycourses/src/buycourses.ajax.php
  66. 33
      public/plugin/buycourses/src/configure_course.php
  67. 7
      public/plugin/buycourses/src/course_catalog.php
  68. 9
      public/plugin/buycourses/src/course_panel.php
  69. 3
      public/plugin/buycourses/src/error.php
  70. 31
      public/plugin/buycourses/src/expresscheckout.php
  71. 5
      public/plugin/buycourses/src/index.buycourses.php
  72. 15
      public/plugin/buycourses/src/invoice.php
  73. 11
      public/plugin/buycourses/src/list.php
  74. 9
      public/plugin/buycourses/src/list_service.php
  75. 11
      public/plugin/buycourses/src/list_session.php
  76. 55
      public/plugin/buycourses/src/panel.ajax.php
  77. 9
      public/plugin/buycourses/src/paymentsetup.php
  78. 6
      public/plugin/buycourses/src/payout_panel.php
  79. 8
      public/plugin/buycourses/src/payout_report.php
  80. 5
      public/plugin/buycourses/src/paypal_payout.php
  81. 156
      public/plugin/buycourses/src/paypalfunctions.php
  82. 27
      public/plugin/buycourses/src/process.php
  83. 21
      public/plugin/buycourses/src/process_confirm.php
  84. 23
      public/plugin/buycourses/src/sales_report.php
  85. 6
      public/plugin/buycourses/src/service_catalog.php
  86. 5
      public/plugin/buycourses/src/service_error.php
  87. 7
      public/plugin/buycourses/src/service_information.php
  88. 8
      public/plugin/buycourses/src/service_panel.php
  89. 31
      public/plugin/buycourses/src/service_process.php
  90. 14
      public/plugin/buycourses/src/service_process_confirm.php
  91. 11
      public/plugin/buycourses/src/service_sales_report.php
  92. 36
      public/plugin/buycourses/src/service_success.php
  93. 7
      public/plugin/buycourses/src/services_add.php
  94. 11
      public/plugin/buycourses/src/services_edit.php
  95. 7
      public/plugin/buycourses/src/session_catalog.php
  96. 9
      public/plugin/buycourses/src/session_panel.php
  97. 35
      public/plugin/buycourses/src/success.php
  98. 3
      public/plugin/buycourses/uninstall.php
  99. 3
      public/plugin/buycourses/update.php
  100. 11
      public/plugin/card_game/card_game.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -4,7 +4,7 @@ $header = '/* For licensing terms, see /license.txt */';
$rules = [
'@Symfony' => true,
//'@Symfony:risky' => true,
'@Symfony:risky' => true,
'array_syntax' => [
'syntax' => 'short',
],

@ -1,11 +1,10 @@
<?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.
@ -17,22 +16,22 @@ $plugin = AdvancedSubscriptionPlugin::create();
$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['sessionId'] = (int) ($_REQUEST['s']);
$data['currentUserId'] = (int) ($_REQUEST['current_user_id']);
$data['studentUserId'] = (int) ($_REQUEST['u']);
$data['queueId'] = (int) ($_REQUEST['q']);
$data['newStatus'] = (int) ($_REQUEST['e']);
// Student always is connected
// $data['is_connected'] = isset($_REQUEST['is_connected']) ? boolval($_REQUEST['is_connected']) : false;
$data['is_connected'] = true;
$data['profile_completed'] = isset($_REQUEST['profile_completed']) ? floatval($_REQUEST['profile_completed']) : 0;
$data['accept_terms'] = isset($_REQUEST['accept_terms']) ? intval($_REQUEST['accept_terms']) : 0;
$data['courseId'] = isset($_REQUEST['c']) ? intval($_REQUEST['c']) : 0;
$data['profile_completed'] = isset($_REQUEST['profile_completed']) ? (float) ($_REQUEST['profile_completed']) : 0;
$data['accept_terms'] = isset($_REQUEST['accept_terms']) ? (int) ($_REQUEST['accept_terms']) : 0;
$data['courseId'] = isset($_REQUEST['c']) ? (int) ($_REQUEST['c']) : 0;
// Init result array
$result = ['error' => true, 'errorMessage' => get_lang('There was an error.')];
$showJSON = true;
// Check if data is valid or is for start subscription
$verified = $plugin->checkHash($data, $hash) || $data['action'] == 'subscribe';
$verified = $plugin->checkHash($data, $hash) || 'subscribe' == $data['action'];
if ($verified) {
switch ($data['action']) {
case 'check': // Check minimum requirements
@ -49,6 +48,7 @@ if ($verified) {
} catch (\Exception $e) {
$result['errorMessage'] = $e->getMessage();
}
break;
case 'subscribe': // Subscription
// Start subscription to queue
@ -58,7 +58,7 @@ if ($verified) {
$data
);
// Check if queue subscription was successful
if ($res === true) {
if (true === $res) {
$legalEnabled = api_get_plugin_setting('courselegal', 'tool_enable');
if ($legalEnabled) {
// Save terms confirmation
@ -188,7 +188,7 @@ if ($verified) {
}
} else {
$lastMessageId = $plugin->getLastMessageId($data['studentUserId'], $data['sessionId']);
if ($lastMessageId !== false) {
if (false !== $lastMessageId) {
// Render mail
$url = $plugin->getRenderMailUrl(['queueId' => $lastMessageId]);
header('Location: '.$url);
@ -210,7 +210,7 @@ if ($verified) {
case 'confirm':
// Check if new status is set
if (isset($data['newStatus'])) {
if ($data['newStatus'] === ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
if (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED === $data['newStatus']) {
try {
$isAllowToDoRequest = $plugin->isAllowedToDoRequest($data['studentUserId'], $data);
} catch (Exception $ex) {
@ -221,13 +221,14 @@ if ($verified) {
);
$messageTemplate->display_no_layout_template();
$showJSON = false;
break;
}
}
// Update queue status
$res = $plugin->updateQueueStatus($data, $data['newStatus']);
if ($res === true) {
if (true === $res) {
// Prepare data
// Prepare session data
$fieldsArray = [
@ -295,15 +296,19 @@ if ($verified) {
switch ($data['newStatus']) {
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED:
$data['mailAction'] = ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE;
break;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_DISAPPROVED:
$data['mailAction'] = ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE;
break;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED:
$data['mailAction'] = ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE;
break;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED:
$data['mailAction'] = ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE;
break;
default:
break;
@ -311,7 +316,7 @@ if ($verified) {
}
// Student Session inscription
if ($data['newStatus'] == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
if (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED == $data['newStatus']) {
SessionManager::subscribeUsersToSession(
$data['sessionId'],
[$data['studentUserId']],
@ -338,6 +343,7 @@ if ($verified) {
$result['errorMessage'] = 'User queue can not be updated';
}
}
break;
default:
$result['errorMessage'] = 'This action does not exist!';

@ -1,11 +1,10 @@
<?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');

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* This script generates four session categories.
*
* @package chamilo.plugin.advanced_subscription
*/
/**
@ -54,6 +53,7 @@ foreach ($queueList as $queueItem) {
$data['session'] = api_get_session_info($queueItem['session_id']);
$data['student'] = api_get_user_info($queueItem['student_id']);
$plugin->sendMail($data, ADVANCED_SUBSCRIPTION_ACTION_REMINDER_STUDENT);
break;
default:
break;
@ -99,7 +99,7 @@ foreach ($queueBySuperior as $sessionId => $superiorStudents) {
// Check if superior has at least one student
if (count($students) > 0) {
foreach ($students as $studentId => $studentInfo) {
if ($studentInfo['status'] == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START) {
if (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START == $studentInfo['status']) {
$data['students'][$studentId] = api_get_user_info($studentId);
$dataUrl['studentUserId'] = $studentId;
$dataUrl['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED;
@ -136,7 +136,7 @@ foreach ($admins as &$admin) {
unset($admin);
$queueByAdmin = [];
foreach ($queueList as $queueItem) {
if ($queueItem['status'] == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED) {
if (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED == $queueItem['status']) {
$queueByAdmin[$queueItem['session_id']]['students'][$queueItem['student_id']]['user_id'] = $queueItem['student_id'];
}
}

@ -1,10 +1,9 @@
<?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
*/
/**

@ -8,39 +8,39 @@ $strings['ws_url_help'] = 'The URL from which ingormation will be requested for
$strings['check_induction'] = 'Enable induction course requirement';
$strings['check_induction_help'] = 'Check to make induction course mandatory';
$strings['yearly_cost_limit'] = 'Yearly TUV limit for courses (measured in Taxation units)';
$strings['yearly_cost_limit_help'] = "How much TUVs the student courses should cost at most.";
$strings['yearly_cost_limit_help'] = 'How much TUVs the student courses should cost at most.';
$strings['yearly_hours_limit'] = 'Yearly teaching hours limit for courses';
$strings['yearly_hours_limit_help'] = "How many teaching hours the student may follow by year.";
$strings['yearly_hours_limit_help'] = 'How many teaching hours the student may follow by year.';
$strings['yearly_cost_unit_converter'] = 'Taxation unit value (TUV)';
$strings['yearly_cost_unit_converter_help'] = "The taxation unit value for the current year, in local currency";
$strings['yearly_cost_unit_converter_help'] = 'The taxation unit value for the current year, in local currency';
$strings['courses_count_limit'] = 'Yearly courses limit';
$strings['courses_count_limit_help'] = "How many times a student can take courses. This value does <strong>not</strong> include induction courses";
$strings['courses_count_limit_help'] = 'How many times a student can take courses. This value 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)";
$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)';
$strings['secret_key'] = 'Secret key';
$strings['terms_and_conditions'] = 'Terms and conditions';
/* String for error message about requirements */
$strings['AdvancedSubscriptionNotConnected'] = "You are not connected to platform. Please login first";
$strings['AdvancedSubscriptionProfileIncomplete'] = "You must complete at least <strong>%d percent</strong> of your profile. You have only completed <strong>%d percent</strong> at this point";
$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'] = "Congratulations!, your subscription request has been accepted by administrator.";
$strings['AdvancedSubscriptionQueueDefaultX'] = "There was an error, queue status %d is not defined by system.";
$strings['AdvancedSubscriptionNotConnected'] = 'You are not connected to platform. Please login first';
$strings['AdvancedSubscriptionProfileIncomplete'] = 'You must complete at least <strong>%d percent</strong> of your profile. You have only completed <strong>%d percent</strong> at this point';
$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'] = 'Congratulations!, 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';
@ -55,11 +55,11 @@ $strings['MailRemindSuperior'] = 'Subscription request are pending your approval
$strings['MailRemindAdmin'] = 'Course subscription are pending your approval';
// TPL langs
$strings['SessionXWithoutVacancies'] = "The course \"%s\" has no vacancies.";
$strings['SuccessSubscriptionToSessionX'] = "<h4>¡Congratulations!</h4>Your subscription to \"%s\" course has been completed successfully.";
$strings['SubscriptionToOpenSession'] = "Subscription to open course";
$strings['GoToSessionX'] = "Go to \"%s\" course";
$strings['YouAreAlreadySubscribedToSessionX'] = "You are already subscribed to \"%s\" course.";
$strings['SessionXWithoutVacancies'] = 'The course "%s" has no vacancies.';
$strings['SuccessSubscriptionToSessionX'] = '<h4>¡Congratulations!</h4>Your subscription to "%s" course has been completed successfully.';
$strings['SubscriptionToOpenSession'] = 'Subscription to open course';
$strings['GoToSessionX'] = 'Go to "%s" course';
$strings['YouAreAlreadySubscribedToSessionX'] = 'You are already subscribed to "%s" course.';
// Admin view
$strings['SelectASession'] = 'Select a training session';

@ -26,16 +26,16 @@ $strings['terms_and_conditions'] = 'Conditions d\'utilisation';
$strings['AdvancedSubscriptionNotConnected'] = "Vous n'êtes pas connecté à la plateforme. Merci d'introduire votre nom d'utilisateur / mot de passe afin de vous inscrire";
$strings['AdvancedSubscriptionProfileIncomplete'] = "Vous devez d'abord compléter votre profil <strong>à %d pourcents</strong> ou plus. Pour l'instant vous n'avez complété que <strong>%d pourcents</strong>";
$strings['AdvancedSubscriptionIncompleteInduction'] = "Vous n'avez pas encore passé le cours d'induction. Merci de commencer par cette étape.";
$strings['AdvancedSubscriptionCostXLimitReached'] = "Désolé, vous avez déjà atteint la limite de %s unités de taxe pour les cours que vous avez suivi cette année";
$strings['AdvancedSubscriptionTimeXLimitReached'] = "Désolé, vous avez déjà atteint la limite annuelle du nombre de %s heures pour les cours que vous avez suivi cette année";
$strings['AdvancedSubscriptionCourseXLimitReached'] = "Désolé, vous avez déjà atteint la limite annuelle du nombre de cours (%s) à suivre cette année";
$strings['AdvancedSubscriptionCostXLimitReached'] = 'Désolé, vous avez déjà atteint la limite de %s unités de taxe pour les cours que vous avez suivi cette année';
$strings['AdvancedSubscriptionTimeXLimitReached'] = 'Désolé, vous avez déjà atteint la limite annuelle du nombre de %s heures pour les cours que vous avez suivi cette année';
$strings['AdvancedSubscriptionCourseXLimitReached'] = 'Désolé, vous avez déjà atteint la limite annuelle du nombre de cours (%s) à suivre cette année';
$strings['AdvancedSubscriptionNotMoreAble'] = "Désolé, vous ne répondez plus aux conditions d'utilisation minimum pour l'inscription à un cours";
$strings['AdvancedSubscriptionIncompleteParams'] = "Les paramètres envoyés ne sont pas complets ou sont incorrects.";
$strings['AdvancedSubscriptionIncompleteParams'] = 'Les paramètres envoyés ne sont pas complets ou sont incorrects.';
$strings['AdvancedSubscriptionIsNotEnabled'] = "L'inscription avancée n'est pas activée";
$strings['AdvancedSubscriptionNoQueue'] = "Vous n'êtes pas inscrit dans ce cours";
$strings['AdvancedSubscriptionNoQueueIsAble'] = "Vous n'êtes pas inscrit mais vous qualifiez pour ce cours";
$strings['AdvancedSubscriptionQueueStart'] = "Votre demande d'inscription est en attente de l'approbation de votre supérieur(e). Merci de patienter.";
$strings['AdvancedSubscriptionQueueBossDisapproved'] = "Désolé, votre inscription a été déclinée par votre supérieur(e).";
$strings['AdvancedSubscriptionQueueBossDisapproved'] = 'Désolé, votre inscription a été déclinée par votre supérieur(e).';
$strings['AdvancedSubscriptionQueueBossApproved'] = "Votre demande d'inscription a été acceptée par votre supérieur(e), mais est en attente de places libres.";
$strings['AdvancedSubscriptionQueueAdminDisapproved'] = "Désolé, votre inscription a été déclinée par l'administrateur.";
$strings['AdvancedSubscriptionQueueAdminApproved'] = "Félicitations! Votre inscription a été acceptée par l'administrateur.";
@ -54,11 +54,11 @@ $strings['MailRemindSuperior'] = 'Demandes d\'inscription en attente de votre ap
$strings['MailRemindAdmin'] = 'Inscriptions en attente de votre approbation';
// TPL translations
$strings['SessionXWithoutVacancies'] = "Le cours \"%s\" ne dispose plus de places libres.";
$strings['SuccessSubscriptionToSessionX'] = "<h4>Félicitations!</h4> Votre inscription au cours \"%s\" est en ordre.";
$strings['SubscriptionToOpenSession'] = "Inscription à cours ouvert";
$strings['GoToSessionX'] = "Aller dans le cours \"%s\"";
$strings['YouAreAlreadySubscribedToSessionX'] = "Vous êtes déjà inscrit(e) au cours \"%s\".";
$strings['SessionXWithoutVacancies'] = 'Le cours "%s" ne dispose plus de places libres.';
$strings['SuccessSubscriptionToSessionX'] = '<h4>Félicitations!</h4> Votre inscription au cours "%s" est en ordre.';
$strings['SubscriptionToOpenSession'] = 'Inscription à cours ouvert';
$strings['GoToSessionX'] = 'Aller dans le cours "%s"';
$strings['YouAreAlreadySubscribedToSessionX'] = 'Vous êtes déjà inscrit(e) au cours "%s".';
// Admin view
$strings['SelectASession'] = 'Sélectionnez une session de formation';

@ -8,39 +8,39 @@ $strings['ws_url_help'] = 'La URL de la cual se solicitará información para el
$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_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_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['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['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['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)';
$strings['secret_key'] = 'LLave secreta';
$strings['terms_and_conditions'] = 'Términos y condiciones';
/* 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'] = "Debe llenar el <strong>%d porciento</strong> de tu perfil como mínimo. Por ahora has llenado el <strong>%d porciento</strong>";
$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'] = "Usted no está inscrito para este curso.";
$strings['AdvancedSubscriptionNoQueueIsAble'] = "Usted no está inscrito, pero está calificado para este curso.";
$strings['AdvancedSubscriptionQueueStart'] = "Su solicitud de inscripción está pendiente de la aprobación de su jefe, por favor espere atentamente.";
$strings['AdvancedSubscriptionQueueBossDisapproved'] = "Lo sentimos, tu inscripción fue rechazada por tu jefe.";
$strings['AdvancedSubscriptionQueueBossApproved'] = "Tu solicitud de inscripción ha sido aceptado por tu jefe, ahora está en espera de vacantes.";
$strings['AdvancedSubscriptionQueueAdminDisapproved'] = "Lo sentimos, Tu inscripción ha sido rechazada por el administrador.";
$strings['AdvancedSubscriptionQueueAdminApproved'] = "¡Felicitaciones! Tu inscripción ha sido aceptada por el administrador.";
$strings['AdvancedSubscriptionQueueDefaultX'] = "Hubo un error el estado en cola %d no está definido en el sistema.";
$strings['AdvancedSubscriptionNotConnected'] = 'Usted no está conectado en la plataforma. Por favor ingrese su usuario / constraseña para poder inscribirse';
$strings['AdvancedSubscriptionProfileIncomplete'] = 'Debe llenar el <strong>%d porciento</strong> de tu perfil como mínimo. Por ahora has llenado el <strong>%d porciento</strong>';
$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'] = 'Usted no está inscrito para este curso.';
$strings['AdvancedSubscriptionNoQueueIsAble'] = 'Usted no está inscrito, pero está calificado para este curso.';
$strings['AdvancedSubscriptionQueueStart'] = 'Su solicitud de inscripción está pendiente de la aprobación de su jefe, por favor espere atentamente.';
$strings['AdvancedSubscriptionQueueBossDisapproved'] = 'Lo sentimos, tu inscripción fue rechazada por tu jefe.';
$strings['AdvancedSubscriptionQueueBossApproved'] = 'Tu solicitud de inscripción ha sido aceptado por tu jefe, ahora está en espera de vacantes.';
$strings['AdvancedSubscriptionQueueAdminDisapproved'] = 'Lo sentimos, Tu inscripción ha sido rechazada por el administrador.';
$strings['AdvancedSubscriptionQueueAdminApproved'] = '¡Felicitaciones! Tu inscripción ha sido aceptada por el administrador.';
$strings['AdvancedSubscriptionQueueDefaultX'] = 'Hubo un error el estado en cola %d no está definido en el sistema.';
// Mail translations
$strings['MailStudentRequest'] = 'Solicitud de registro de estudiante';
@ -55,11 +55,11 @@ $strings['MailRemindSuperior'] = 'Solicitudes de inscripción estan pendientes d
$strings['MailRemindAdmin'] = 'Inscripciones de cursos estan pendientes de tu aprobación';
// TPL translations
$strings['SessionXWithoutVacancies'] = "El curso \"%s\" no tiene cupos disponibles.";
$strings['SuccessSubscriptionToSessionX'] = "<h4>¡Felicitaciones!</h4> Tu inscripción al curso \"%s\" se realizó correctamente.";
$strings['SubscriptionToOpenSession'] = "Inscripcion a curso abierto";
$strings['GoToSessionX'] = "Ir al curso \"%s\"";
$strings['YouAreAlreadySubscribedToSessionX'] = "Usted ya está inscrito al curso \"%s\".";
$strings['SessionXWithoutVacancies'] = 'El curso "%s" no tiene cupos disponibles.';
$strings['SuccessSubscriptionToSessionX'] = '<h4>¡Felicitaciones!</h4> Tu inscripción al curso "%s" se realizó correctamente.';
$strings['SubscriptionToOpenSession'] = 'Inscripcion a curso abierto';
$strings['GoToSessionX'] = 'Ir al curso "%s"';
$strings['YouAreAlreadySubscribedToSessionX'] = 'Usted ya está inscrito al curso "%s".';
// Admin view
$strings['SelectASession'] = 'Elija una sesión de formación';

@ -1,10 +1,9 @@
<?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).

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
@ -12,8 +13,6 @@ use Chamilo\CoreBundle\Hook\Interfaces\HookPluginInterface;
* Class AdvancedSubscriptionPlugin
* 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
{
@ -53,7 +52,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
static $result = null;
return $result ? $result : $result = new self();
return $result ?: $result = new self();
}
/**
@ -186,6 +185,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
];
$client = new SoapClient(null, $options);
$userInfo = api_get_user_info($userId);
try {
$profileCompleted = $client->__soapCall('getProfileCompletionPercentage', $userInfo['extra']['drupal_user_id']);
} catch (\Exception $e) {
@ -304,7 +304,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$numberOfApprovedInductionSessions = $this->getApprovedInductionSessions($userId);
$completedInduction = $numberOfApprovedInductionSessions > 0;
if ($checkInduction == 'true' && !$completedInduction) {
if ('true' == $checkInduction && !$completedInduction) {
$this->errorMessages[] = $this->get_lang('AdvancedSubscriptionIncompleteInduction');
if (!$collectErrors) {
@ -326,8 +326,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
public function addToQueue($userId, $sessionId)
{
// Filter input variables
$userId = intval($userId);
$sessionId = intval($sessionId);
$userId = (int) $userId;
$sessionId = (int) $sessionId;
$now = api_get_utc_datetime();
$advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$attributes = [
@ -338,9 +338,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
'updated_at' => null,
];
$id = Database::insert($advancedSubscriptionQueueTable, $attributes);
return $id;
return Database::insert($advancedSubscriptionQueueTable, $attributes);
}
/**
@ -355,22 +353,20 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
public function saveLastMessage($mailId, $userId, $sessionId)
{
// Filter variables
$mailId = intval($mailId);
$userId = intval($userId);
$sessionId = intval($sessionId);
$mailId = (int) $mailId;
$userId = (int) $userId;
$sessionId = (int) $sessionId;
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$attributes = [
'last_message_id' => $mailId,
'updated_at' => api_get_utc_datetime(),
];
$num = Database::update(
return Database::update(
$queueTable,
$attributes,
['user_id = ? AND session_id = ?' => [$userId, $sessionId]]
);
return $num;
}
/**
@ -387,6 +383,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$result = 'Params not found';
if (!empty($sessionId) && !empty($userId)) {
$plugin = self::create();
try {
if ($plugin->isAllowedToDoRequest($userId, $params)) {
$result = (bool) $plugin->addToQueue($userId, $sessionId);
@ -450,7 +447,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$this->saveLastMessage($mailId, $student['user_id'], $sessionId);
}
} else {
$studentId = intval($studentId);
$studentId = (int) $studentId;
$this->saveLastMessage($mailId, $studentId, $sessionId);
}
} elseif (!empty($mailId)) {
@ -520,13 +517,13 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$userFieldVariable
);
$isInTargetGroup = false;
if (isset($sessionTarget) && (!empty($sessionTarget)) && $sessionTarget['value'] == 'minedu') {
if (substr($userArea['value'], 0, 6) == 'MINEDU') {
if (isset($sessionTarget) && (!empty($sessionTarget)) && 'minedu' == $sessionTarget['value']) {
if ('MINEDU' == substr($userArea['value'], 0, 6)) {
$isInTargetGroup = true;
}
}
if (isset($sessionTarget) && (!empty($sessionTarget)) && $sessionTarget['value'] == 'regiones') {
if ((substr($userArea['value'], 0, 4) == 'UGEL') || (substr($userArea['value'], 0, 3) == 'DRE')) {
if (isset($sessionTarget) && (!empty($sessionTarget)) && 'regiones' == $sessionTarget['value']) {
if (('UGEL' == substr($userArea['value'], 0, 4)) || ('DRE' == substr($userArea['value'], 0, 3))) {
$isInTargetGroup = true;
}
}
@ -544,18 +541,18 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function updateQueueStatus($params, $newStatus)
{
$newStatus = intval($newStatus);
$newStatus = (int) $newStatus;
$res = false;
if (isset($params['queue']['id'])) {
$where = [
'id = ?' => intval($params['queue']['id']),
'id = ?' => (int) ($params['queue']['id']),
];
} elseif (isset($params['studentUserId']) && isset($params['sessionId'])) {
$where = [
'user_id = ? AND session_id = ? AND status <> ? AND status <> ?' => [
intval($params['studentUserId']),
intval($params['sessionId']),
(int) ($params['studentUserId']),
(int) ($params['sessionId']),
$newStatus,
ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED,
],
@ -622,6 +619,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/student_notice_superior.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_APPROVE:
// Mail to student
@ -652,6 +650,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$data['sessionId']
);
}
break;
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_DISAPPROVE:
// Mail to student
@ -671,6 +670,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/superior_rejected_notice_superior.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_SUPERIOR_SELECT:
// Mail to student
@ -690,6 +690,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/student_notice_superior.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_ADMIN_APPROVE:
$fileAttachments = [];
@ -748,6 +749,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/admin_accepted_notice_admin.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_ADMIN_DISAPPROVE:
// Mail to student
@ -777,6 +779,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/admin_rejected_notice_admin.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_STUDENT_REQUEST_NO_BOSS:
// Mail to student
@ -799,6 +802,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$data['sessionId']
);
}
break;
case ADVANCED_SUBSCRIPTION_ACTION_REMINDER_STUDENT:
$mailIds['render'] = $this->sendMailMessage(
@ -809,6 +813,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$data['sessionId'],
true
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_REMINDER_SUPERIOR:
$mailIds['render'] = $this->sendMailMessage(
@ -818,6 +823,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/reminder_notice_superior.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_REMINDER_SUPERIOR_MAX:
$mailIds['render'] = $this->sendMailMessage(
@ -827,6 +833,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$template->fetch('/advanced_subscription/views/reminder_notice_superior_max.tpl'),
$data['sessionId']
);
break;
case ADVANCED_SUBSCRIPTION_ACTION_REMINDER_ADMIN:
// Mail to admin
@ -840,6 +847,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$data['sessionId']
);
}
break;
default:
break;
@ -867,13 +875,13 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$where['1 = ? '] = 1;
if (isset($params['sessions']) && is_array($params['sessions'])) {
foreach ($params['sessions'] as &$sessionId) {
$sessionId = intval($sessionId);
$sessionId = (int) $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);
$status = (int) $status;
}
$where['AND status IN ( ? ) '] = implode($params['status']);
}
@ -923,8 +931,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getQueueStatus($userId, $sessionId)
{
$userId = intval($userId);
$sessionId = intval($sessionId);
$userId = (int) $userId;
$sessionId = (int) $sessionId;
if (!empty($userId) && !empty($sessionId)) {
$queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
$row = Database::select(
@ -937,7 +945,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
]
);
if (count($row) == 1) {
if (1 == count($row)) {
return $row[0]['status'];
} else {
return ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE;
@ -962,7 +970,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$sessionId,
'vacancies'
);
$vacancy = intval($var['value']);
$vacancy = (int) ($var['value']);
if (!empty($vacancy)) {
$vacancy -= $this->countQueueByParams(
[
@ -1015,8 +1023,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$mergedArray = array_merge([$sessionId], array_keys($fields));
$sql = "SELECT * FROM ".Database::get_main_table(TABLE_EXTRA_FIELD_VALUES)."
WHERE item_id = %d AND field_id IN (%d, %d, %d, %d, %d, %d, %d)";
$sql = 'SELECT * FROM '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).'
WHERE item_id = %d AND field_id IN (%d, %d, %d, %d, %d, %d, %d)';
$sql = vsprintf($sql, $mergedArray);
$sessionFieldValueList = Database::query($sql);
while ($sessionFieldValue = Database::fetch_assoc($sessionFieldValueList)) {
@ -1059,21 +1067,27 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
if ($isAble) {
$message = $this->get_lang('AdvancedSubscriptionNoQueueIsAble');
}
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);
@ -1091,9 +1105,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getSessionUrl($sessionId)
{
$url = api_get_path(WEB_CODE_PATH).'session/?session_id='.intval($sessionId);
return $url;
return api_get_path(WEB_CODE_PATH).'session/?session_id='.(int) $sessionId;
}
/**
@ -1114,7 +1126,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
if ($userIsSubscribed) {
return api_get_path(WEB_CODE_PATH)
.'session/index.php?session_id='
.intval($params['session_id']);
.(int) ($params['session_id']);
}
$params['secret_key'] = null;
@ -1144,18 +1156,16 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getQueueUrl($params)
{
$url = api_get_path(WEB_PLUGIN_PATH).'advanced_subscription/ajax/advanced_subscription.ajax.php?'.
return 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']).'&'.
's='.(int) ($params['sessionId']).'&'.
'current_user_id='.(int) ($params['currentUserId']).'&'.
'e='.(int) ($params['newStatus']).'&'.
'u='.(int) ($params['studentUserId']).'&'.
'q='.(int) ($params['queueId']).'&'.
'is_connected=1&'.
'profile_completed='.intval($params['profile_completed']).'&'.
'profile_completed='.(int) ($params['profile_completed']).'&'.
'v='.$this->generateHash($params);
return $url;
}
/**
@ -1168,7 +1178,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
public function listAllStudentsInQueueBySession($sessionId)
{
// Filter input variable
$sessionId = intval($sessionId);
$sessionId = (int) $sessionId;
// Assign variables
$fieldsArray = [
'target',
@ -1219,19 +1229,22 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$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']);
$status = (int) ($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'] = 'No';
break;
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_BOSS_APPROVED:
case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED:
$student['validation'] = 'Yes';
break;
default:
error_log(__FILE__.' '.__FUNCTION__.' Student status no detected');
@ -1254,7 +1267,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function listAllSessions($limit = 100)
{
$limit = intval($limit);
$limit = (int) $limit;
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION);
$columns = 'id, name';
$conditions = [];
@ -1279,12 +1292,12 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
$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['action'] = (string) ($data['action']);
$dataPrepared['sessionId'] = (int) ($data['sessionId']);
$dataPrepared['currentUserId'] = (int) ($data['currentUserId']);
$dataPrepared['studentUserId'] = (int) ($data['studentUserId']);
$dataPrepared['queueId'] = (int) ($data['queueId']);
$dataPrepared['newStatus'] = (int) ($data['newStatus']);
$dataPrepared = serialize($dataPrepared);
return sha1($dataPrepared.$key);
@ -1326,13 +1339,13 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
$urlParams = [
'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']),
's' => (int) ($params['sessionId']),
'current_user_id' => (int) ($params['currentUserId']),
'e' => (int) ($params['newStatus']),
'u' => (int) ($params['studentUserId']),
'q' => (int) ($params['queueId']),
'is_connected' => 1,
'profile_completed' => intval($params['profile_completed']),
'profile_completed' => (int) ($params['profile_completed']),
'v' => $this->generateHash($params),
];
@ -1340,17 +1353,19 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
case ADVANCED_SUBSCRIPTION_TERMS_MODE_POPUP:
case ADVANCED_SUBSCRIPTION_TERMS_MODE_FINAL:
$urlParams['r'] = 0;
break;
case ADVANCED_SUBSCRIPTION_TERMS_MODE_REJECT:
$urlParams['r'] = 1;
break;
}
$url = api_get_path(WEB_PLUGIN_PATH)."advanced_subscription/src/terms_and_conditions.php?";
$url = api_get_path(WEB_PLUGIN_PATH).'advanced_subscription/src/terms_and_conditions.php?';
$url .= http_build_query($urlParams);
// Launch popup
if ($mode == ADVANCED_SUBSCRIPTION_TERMS_MODE_POPUP) {
if (ADVANCED_SUBSCRIPTION_TERMS_MODE_POPUP == $mode) {
$url = 'javascript:void(window.open(\''.$url.'\',\'AdvancedSubscriptionTerms\', \'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700px,height=600px\', \'100\' ))';
}
@ -1366,11 +1381,9 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getRenderMailUrl($params)
{
$url = api_get_path(WEB_PLUGIN_PATH).'advanced_subscription/src/render_mail.php?'.
return api_get_path(WEB_PLUGIN_PATH).'advanced_subscription/src/render_mail.php?'.
'q='.$params['queueId'].'&'.
'v='.$this->generateHash($params);
return $url;
}
/**
@ -1383,8 +1396,8 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
*/
public function getLastMessageId($studentUserId, $sessionId)
{
$studentUserId = intval($studentUserId);
$sessionId = intval($sessionId);
$studentUserId = (int) $studentUserId;
$sessionId = (int) $sessionId;
if (!empty($sessionId) && !empty($studentUserId)) {
$row = Database::select(
'last_message_id',
@ -1415,12 +1428,11 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
public function renderTemplateString($templateContent, $data = [])
{
$twigString = new \Twig_Environment(new \Twig_Loader_String());
$templateContent = $twigString->render(
return $twigString->render(
$templateContent,
$data
);
return $templateContent;
}
/**
@ -1430,7 +1442,7 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
{
$extraField = new ExtraField('user');
$extraFieldHandler = $extraField->get_handler_field_info_by_field_variable('area');
$areaExists = $extraFieldHandler !== false;
$areaExists = false !== $extraFieldHandler;
if (!$areaExists) {
$extraField = new ExtraField('user');
@ -1455,15 +1467,15 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
$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)); ";
'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);
}
@ -1504,11 +1516,11 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
sf.extra_field_type = $extraFieldType AND
sf.variable = 'is_induction_session' AND
su.relation_type = 0 AND
su.user_id = ".intval($userId);
su.user_id = ".(int) $userId;
$result = Database::query($sql);
if ($result === false) {
if (false === $result) {
return 0;
}
@ -1532,12 +1544,12 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
if (count($courseCategories) > 0 &&
Category::userFinishedCourse($userId, $courseCategories[0])
) {
$numberOfApprovedCourses++;
++$numberOfApprovedCourses;
}
}
if ($numberOfApprovedCourses === count($courses)) {
$numberOfApproved++;
++$numberOfApproved;
}
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Hook\HookObserver;
@ -44,7 +45,7 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
{
$data = $hook->getEventData();
// if ($data['type'] === HOOK_EVENT_TYPE_PRE) // Nothing to do
if ($data['type'] === HOOK_EVENT_TYPE_POST) {
if (HOOK_EVENT_TYPE_POST === $data['type']) {
if (isset($data['blocks'])) {
$data['blocks']['sessions']['items'][] = [
'url' => '../../plugin/advanced_subscription/src/admin_view.php',
@ -65,11 +66,11 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
{
$data = $hook->getEventData();
//if ($data['type'] === HOOK_EVENT_TYPE_PRE) // nothing to do
if ($data['type'] === HOOK_EVENT_TYPE_POST) {
if (HOOK_EVENT_TYPE_POST === $data['type']) {
/** @var \nusoap_server $server */
$server = &$data['server'];
/** WSSessionListInCategory */
/* WSSessionListInCategory */
// Output params for sessionBriefList WSSessionListInCategory
$server->wsdl->addComplexType(
@ -187,7 +188,7 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
]
);
/** WSListSessionsDetailsByCategory */
/* WSListSessionsDetailsByCategory */
// Input params for WSListSessionsDetailsByCategory
$server->wsdl->addComplexType(
@ -447,14 +448,13 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
'schedule',
];
$datePub = new DateTime();
$sessionList = SessionManager::getShortSessionListAndExtraByCategory(
return SessionManager::getShortSessionListAndExtraByCategory(
$sessionCategoryId,
$params['target'],
$fields,
$datePub
);
return $sessionList;
}
/**
@ -508,24 +508,24 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
$data['message'] = $e->getMessage();
}
$params['action'] = 'subscribe';
$params['sessionId'] = intval($sessionId);
$params['sessionId'] = (int) $sessionId;
$params['currentUserId'] = 0; // No needed
$params['studentUserId'] = intval($userId);
$params['studentUserId'] = (int) $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) {
if (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE == $status) {
// No in Queue, require queue subscription url action
$data['action_url'] = self::$plugin->getTermsUrl($params);
} elseif ($status == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
} elseif (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED == $status) {
// send url action
$data['action_url'] = self::$plugin->getSessionUrl($sessionId);
} // Else: In queue, output status message, no more info.
} else {
if ($status == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED) {
if (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED == $status) {
$data['action_url'] = self::$plugin->getSessionUrl($sessionId);
} elseif ($status == ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE) {
} elseif (ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE == $status) {
// in Queue or not, cannot be subscribed to session
$data['action_url'] = self::$plugin->getTermsUrl($params);
} // Else: In queue, output status message, no more info.
@ -635,11 +635,11 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
public function hookNotificationContent(HookNotificationContentEventInterface $hook)
{
$data = $hook->getEventData();
if ($data['type'] === HOOK_EVENT_TYPE_PRE) {
if (HOOK_EVENT_TYPE_PRE === $data['type']) {
$data['advanced_subscription_pre_content'] = $data['content'];
return $data;
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) {
} elseif (HOOK_EVENT_TYPE_POST === $data['type']) {
if (isset($data['content']) &&
!empty($data['content']) &&
isset($data['advanced_subscription_pre_content']) &&
@ -669,11 +669,11 @@ class HookAdvancedSubscription extends HookObserver implements HookAdminBlockObs
public function hookNotificationTitle(HookNotificationTitleEventInterface $hook)
{
$data = $hook->getEventData();
if ($data['type'] === HOOK_EVENT_TYPE_PRE) {
if (HOOK_EVENT_TYPE_PRE === $data['type']) {
$data['advanced_subscription_pre_title'] = $data['title'];
return $data;
} elseif ($data['type'] === HOOK_EVENT_TYPE_POST) {
} elseif (HOOK_EVENT_TYPE_POST === $data['type']) {
if (isset($data['advanced_subscription_pre_title']) &&
!empty($data['advanced_subscription_pre_title'])
) {

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Index of the Advanced subscription plugin courses list.
*
* @package chamilo.plugin.advanced_subscription
*/
/**
* Init.
@ -14,7 +13,7 @@ api_protect_admin_script();
// start plugin
$plugin = AdvancedSubscriptionPlugin::create();
// Session ID
$sessionId = isset($_REQUEST['s']) ? intval($_REQUEST['s']) : null;
$sessionId = isset($_REQUEST['s']) ? (int) ($_REQUEST['s']) : null;
// Init template
$tpl = new Template($plugin->get_lang('plugin_title'));
@ -66,20 +65,20 @@ if (!empty($sessionId)) {
$isWesternNameOrder = api_is_western_name_order();
foreach ($studentList['students'] as &$student) {
$studentId = intval($student['user_id']);
$studentId = (int) ($student['user_id']);
$data['studentUserId'] = $studentId;
$fieldValue = new ExtraFieldValue('user');
$areaField = $fieldValue->get_values_by_handler_and_field_variable($studentId, 'area', true);
$student['area'] = $areaField['value'];
if (substr($student['area'], 0, 6) == 'MINEDU') {
if ('MINEDU' == substr($student['area'], 0, 6)) {
$student['institution'] = 'Minedu';
} else {
$student['institution'] = 'Regiones';
}
$student['userLink'] = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$studentId;
$data['queueId'] = intval($student['queue_id']);
$data['queueId'] = (int) ($student['queue_id']);
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED;
$data['profile_completed'] = 100;
$student['acceptUrl'] = $plugin->getQueueUrl($data);

@ -1,11 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Validate requirements for a open session.
*
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*
* @package chamilo.plugin.advanced_subscription
*/
require_once __DIR__.'/../config.php';

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Render an email from data.
*
* @package chamilo.plugin.advanced_subscription
*/
/**
@ -15,7 +14,7 @@ $plugin = AdvancedSubscriptionPlugin::create();
// Get validation hash
$hash = Security::remove_XSS($_REQUEST['v']);
// Get data from request (GET or POST)
$data['queueId'] = intval($_REQUEST['q']);
$data['queueId'] = (int) ($_REQUEST['q']);
// Check if data is valid or is for start subscription
$verified = $plugin->checkHash($data, $hash);
if ($verified) {

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* This script generates session fields needed for this plugin.
*
* @package chamilo.plugin.advanced_subscription
*/
//exit;

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* This script generates four session categories.
*
* @package chamilo.plugin.advanced_subscription
*/
require_once __DIR__.'/../../config.php';

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Script to show sessions terms and conditions.
*
* @package chamilo.plugin.advanced_subscription
*/
/**
* Init.
@ -13,14 +12,14 @@ require_once __DIR__.'/../config.php';
$plugin = AdvancedSubscriptionPlugin::create();
// Session ID
$data['action'] = Security::remove_XSS($_REQUEST['a']);
$data['sessionId'] = isset($_REQUEST['s']) ? intval($_REQUEST['s']) : 0;
$data['currentUserId'] = isset($_REQUEST['current_user_id']) ? intval($_REQUEST['current_user_id']) : 0;
$data['studentUserId'] = isset($_REQUEST['u']) ? intval($_REQUEST['u']) : 0;
$data['queueId'] = isset($_REQUEST['q']) ? intval($_REQUEST['q']) : 0;
$data['newStatus'] = isset($_REQUEST['e']) ? intval($_REQUEST['e']) : 0;
$data['sessionId'] = isset($_REQUEST['s']) ? (int) ($_REQUEST['s']) : 0;
$data['currentUserId'] = isset($_REQUEST['current_user_id']) ? (int) ($_REQUEST['current_user_id']) : 0;
$data['studentUserId'] = isset($_REQUEST['u']) ? (int) ($_REQUEST['u']) : 0;
$data['queueId'] = isset($_REQUEST['q']) ? (int) ($_REQUEST['q']) : 0;
$data['newStatus'] = isset($_REQUEST['e']) ? (int) ($_REQUEST['e']) : 0;
$data['is_connected'] = true;
$data['profile_completed'] = isset($_REQUEST['profile_completed']) ? floatval($_REQUEST['profile_completed']) : 0;
$data['termsRejected'] = isset($_REQUEST['r']) ? intval($_REQUEST['r']) : 0;
$data['profile_completed'] = isset($_REQUEST['profile_completed']) ? (float) ($_REQUEST['profile_completed']) : 0;
$data['termsRejected'] = isset($_REQUEST['r']) ? (int) ($_REQUEST['r']) : 0;
// Init template
$tpl = new Template($plugin->get_lang('plugin_title'));
@ -37,7 +36,7 @@ if (
api_get_plugin_setting('courselegal', 'tool_enable')
) {
$lastMessageId = $plugin->getLastMessageId($data['studentUserId'], $data['sessionId']);
if ($lastMessageId !== false) {
if (false !== $lastMessageId) {
// Render mail
$url = $plugin->getRenderMailUrl(['queueId' => $lastMessageId]);
header('Location: '.$url);

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* A script to render all mails templates.
*
* @package chamilo.plugin.advanced_subscription
*/
require_once __DIR__.'/../config.php';
@ -123,7 +122,7 @@ foreach ($files as $k => &$file) {
if (
is_file($dir.$file) &&
strpos($file, '.tpl') &&
$file != 'admin_view.tpl'
'admin_view.tpl' != $file
) {
echo '<pre>', $file, '</pre>';
echo $tpl->fetch('/advanced_subscription/views/'.$file);

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* A script to render all mails templates.
*
* @package chamilo.plugin.advanced_subscription
*/
require_once __DIR__.'/../config.php';
@ -15,8 +14,8 @@ $data['currentUserId'] = 1;
$data['queueId'] = 0;
$data['is_connected'] = true;
$data['profile_completed'] = 90.0;
$data['sessionId'] = intval($_REQUEST['s']);
$data['studentUserId'] = intval($_REQUEST['u']);
$data['sessionId'] = (int) ($_REQUEST['s']);
$data['studentUserId'] = (int) ($_REQUEST['u']);
$data['student'] = api_get_user_info($data['studentUserId']);
$data['session'] = api_get_session_info($data['sessionId']);

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
@ -17,9 +18,9 @@ $hookPlugin = Container::instantiateHook(HookAdvancedSubscription::class);
// Get params from request (GET or POST)
$params = [];
// Init result array
$params['user_id'] = intval($_REQUEST['u']);
$params['user_id'] = (int) ($_REQUEST['u']);
$params['user_field'] = 'drupal_user_id';
$params['session_id'] = intval($_REQUEST['s']);
$params['session_id'] = (int) ($_REQUEST['s']);
$params['profile_completed'] = 100;
$params['is_connected'] = true;
@ -35,7 +36,7 @@ $ip = trim($_SERVER['REMOTE_ADDR']);
// if we are behind a reverse proxy, assume it will send the
// HTTP_X_FORWARDED_FOR header and use this IP instead
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
list($ip1, $ip2) = split(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
list($ip1, $ip2) = preg_split('/,/D', $_SERVER['HTTP_X_FORWARDED_FOR']);
$ip = trim($ip1);
}
// Check if a file that limits access from webservices exists and contains
@ -54,7 +55,7 @@ if ($check_ip) {
$security_key = $ip.$_configuration['security_key'];
//error_log($secret_key.'-'.$security_key);
}
/**
/*
* End WSHelperVerifyKey.
*/
$params['secret_key'] = sha1($security_key);
@ -66,7 +67,7 @@ $options = [
'uri' => $wsUrl,
];
/**
/*
* WS test.
*/
try {
@ -76,7 +77,7 @@ try {
$result = $client->__soapCall('HookAdvancedSubscription..WSSessionGetDetailsByUser', [$params]);
if (is_object($result) && isset($result->action_url)) {
echo '<br />';
echo Display::url("message".$result->message, $result->action_url);
echo Display::url('message'.$result->message, $result->action_url);
}
} catch (\Exception $e) {
var_dump($e);

@ -1,11 +1,10 @@
<?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
*/
/**

@ -1,15 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*
* @package chamilo.plugin.azure_active_directory
*/
/** @var AzureActiveDirectory $activeDirectoryPlugin */
$activeDirectoryPlugin = AzureActiveDirectory::create();
if ($activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_ENABLE) === 'true') {
if ('true' === $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_ENABLE)) {
$_template['block_title'] = $activeDirectoryPlugin->get(AzureActiveDirectory::SETTING_BLOCK_NAME);
$_template['signin_url'] = $activeDirectoryPlugin->getUrl(AzureActiveDirectory::URL_TYPE_AUTHORIZE);

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
if (!api_is_platform_admin()) {

@ -1,11 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Strings to english L10n.
*
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*
* @package chamilo.plugin.azure_active_directory
*/
$strings['plugin_title'] = 'Azure Active Directory';
$strings['plugin_comment'] = 'Allow authentication with Microsoft\'s Azure Active Directory';

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
require __DIR__.'/../../main/inc/global.inc.php';
@ -16,7 +17,7 @@ if ('true' !== $pluginEnabled || 'true' !== $managementLoginEnabled) {
$userId = api_get_user_id();
if (!($userId) || api_is_anonymous($userId)) {
if (!$userId || api_is_anonymous($userId)) {
$managementLoginName = $plugin->get(AzureActiveDirectory::SETTING_MANAGEMENT_LOGIN_NAME);
if (empty($managementLoginName)) {

@ -1,9 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*
* @package chamilo.plugin.azure_active_directory
*/
$plugin_info = AzureActiveDirectory::create()->get_info();

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
use TheNetworg\OAuth2\Client\Provider\Azure;
@ -7,8 +8,6 @@ use TheNetworg\OAuth2\Client\Provider\Azure;
* AzureActiveDirectory plugin class.
*
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*
* @package chamilo.plugin.azure_active_directory
*/
class AzureActiveDirectory extends Plugin
{
@ -55,7 +54,7 @@ class AzureActiveDirectory extends Plugin
{
static $result = null;
return $result ? $result : $result = new self();
return $result ?: $result = new self();
}
/**
@ -71,13 +70,11 @@ class AzureActiveDirectory extends Plugin
*/
public function getProvider()
{
$provider = new Azure([
return new Azure([
'clientId' => $this->get(self::SETTING_APP_ID),
'clientSecret' => $this->get(self::SETTING_APP_SECRET),
'redirectUri' => api_get_path(WEB_PLUGIN_PATH).'azure_active_directory/src/callback.php',
]);
return $provider;
}
/**

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
require __DIR__.'/../../../main/inc/global.inc.php';
@ -33,7 +34,7 @@ $token = $provider->getAccessToken('authorization_code', [
$me = null;
try {
$me = $provider->get("me", $token);
$me = $provider->get('me', $token);
} catch (Exception $e) {
exit;
}

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\UserBundle\Entity\User;
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
$cidReset = true;
@ -73,8 +72,8 @@ if ($action) {
foreach ($meetings as $meeting) {
$dataToExport[] = [
$meeting['created_at'],
$meeting['status'] == 1 ? $plugin->get_lang('MeetingOpened') : $plugin->get_lang('MeetingClosed'),
$meeting['record'] == 1 ? get_lang('Yes') : get_lang('No'),
1 == $meeting['status'] ? $plugin->get_lang('MeetingOpened') : $plugin->get_lang('MeetingClosed'),
1 == $meeting['record'] ? get_lang('Yes') : get_lang('No'),
$meeting['course'] ? $meeting['course']->getTitle() : '-',
$meeting['session'] ? $meeting['session']->getName() : '-',
isset($meeting['participants']) ? implode(PHP_EOL, $meeting['participants']) : null,
@ -82,6 +81,7 @@ if ($action) {
}
Export::arrayToXls($dataToExport);
break;
}
}

@ -1,8 +1,6 @@
<?php
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
$cidReset = true;
@ -10,7 +8,7 @@ $cidReset = true;
require_once __DIR__.'/../../main/inc/global.inc.php';
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
$meetingId = isset($_REQUEST['meeting']) ? intval($_REQUEST['meeting']) : 0;
$meetingId = isset($_REQUEST['meeting']) ? (int) ($_REQUEST['meeting']) : 0;
$bbb = new bbb('', '');
@ -29,7 +27,7 @@ switch ($action) {
$meetingInfo = Database::select(
'*',
'plugin_bbb_meeting',
['where' => ['id = ?' => intval($meetingId)]],
['where' => ['id = ?' => (int) $meetingId]],
'first'
);
@ -43,5 +41,6 @@ switch ($action) {
header('Content-Type: application/json');
echo json_encode(['url' => $url, 'link' => $link]);
}
break;
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/* bbb parameters that will be registered in the course settings */

@ -2,10 +2,8 @@
/**
* This script is included by the course_home.php script (indirectly) and is
* used to show the link to the plugin from inside the course's tools list.
*
* @package chamilo.plugin.bigbluebutton
*/
/**
* Display course tool title.
*/
echo "Videoconference";
echo 'Videoconference';

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/../../vendor/autoload.php';

@ -2,8 +2,6 @@
/**
* 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.bigbluebutton
*/
require_once __DIR__.'/config.php';
BBBPlugin::create()->install();

@ -1,33 +1,34 @@
<?php
/* License: see /license.txt */
// Needed in order to show the plugin title
$strings['plugin_title'] = "Videoconference";
$strings['plugin_comment'] = "Add a videoconference room in a Chamilo course using BigBlueButton (BBB)";
$strings['plugin_title'] = 'Videoconference';
$strings['plugin_comment'] = 'Add a videoconference room in a Chamilo course using BigBlueButton (BBB)';
$strings['Videoconference'] = "Videoconference";
$strings['MeetingOpened'] = "Meeting opened";
$strings['MeetingClosed'] = "Meeting closed";
$strings['MeetingClosedComment'] = "If you have asked for your sessions to be recorded, the recording will be available in the list below when it has been completely generated.";
$strings['CloseMeeting'] = "Close meeting";
$strings['Videoconference'] = 'Videoconference';
$strings['MeetingOpened'] = 'Meeting opened';
$strings['MeetingClosed'] = 'Meeting closed';
$strings['MeetingClosedComment'] = 'If you have asked for your sessions to be recorded, the recording will be available in the list below when it has been completely generated.';
$strings['CloseMeeting'] = 'Close meeting';
$strings['VideoConferenceXCourseX'] = "Videoconference #%s course %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconference added to the calendar";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videoconference added to the link tool";
$strings['VideoConferenceXCourseX'] = 'Videoconference #%s course %s';
$strings['VideoConferenceAddedToTheCalendar'] = 'Videoconference added to the calendar';
$strings['VideoConferenceAddedToTheLinkTool'] = 'Videoconference added to the link tool';
$strings['GoToTheVideoConference'] = "Go to the videoconference";
$strings['GoToTheVideoConference'] = 'Go to the videoconference';
$strings['Records'] = "Recording";
$strings['Meeting'] = "Meeting";
$strings['Records'] = 'Recording';
$strings['Meeting'] = 'Meeting';
$strings['ViewRecord'] = "View recording";
$strings['CopyToLinkTool'] = "Copy to link tool";
$strings['ViewRecord'] = 'View recording';
$strings['CopyToLinkTool'] = 'Copy to link tool';
$strings['EnterConference'] = "Enter the videoconference";
$strings['RecordList'] = "Recording list";
$strings['ServerIsNotRunning'] = "Videoconference server is not running";
$strings['ServerIsNotConfigured'] = "Videoconference server is not configured";
$strings['EnterConference'] = 'Enter the videoconference';
$strings['RecordList'] = 'Recording list';
$strings['ServerIsNotRunning'] = 'Videoconference server is not running';
$strings['ServerIsNotConfigured'] = 'Videoconference server is not configured';
$strings['XUsersOnLine'] = "%s user(s) online";
$strings['XUsersOnLine'] = '%s user(s) online';
$strings['host'] = 'BigBlueButton host';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running.
@ -64,7 +65,7 @@ $strings['MaxXUsersWarning'] = 'This conference room has a maximum number of %s
$strings['MaxXUsersReached'] = 'The limit of %s simultaneous users has been reached for this conference room. Please wait for one seat to be freed or for another conference to start in order to join.';
$strings['MaxXUsersReachedManager'] = 'The limit of %s simultaneous users has been reached for this conference room. To increase this limit, please contact the platform administrator.';
$strings['MaxUsersInConferenceRoom'] = 'Max simultaneous users in a conference room';
$strings['global_conference_allow_roles'] = "Global conference link only visible for this user roles";
$strings['global_conference_allow_roles'] = 'Global conference link only visible for this user roles';
$strings['CreatedAt'] = 'Created at';
$strings['interface'] = 'Default Interface';

@ -1,33 +1,34 @@
<?php
/* License: see /license.txt */
//Needed in order to show the plugin title
$strings['plugin_title'] = "Vidéoconférence";
$strings['plugin_comment'] = "Ajoutez un espace de vidéoconférences aux cours de Chamilo avec BigBlueButton (BBB)";
$strings['plugin_title'] = 'Vidéoconférence';
$strings['plugin_comment'] = 'Ajoutez un espace de vidéoconférences aux cours de Chamilo avec BigBlueButton (BBB)';
$strings['Videoconference'] = "Vidéoconférence";
$strings['MeetingOpened'] = "Session ouverte";
$strings['MeetingClosed'] = "Session fermée";
$strings['Videoconference'] = 'Vidéoconférence';
$strings['MeetingOpened'] = 'Session ouverte';
$strings['MeetingClosed'] = 'Session fermée';
$strings['MeetingClosedComment'] = "Si vous avez demandé l'enregistrement des sessions de conférence, cet enregistrement apparaîtra dans la liste ci-dessous dans quelques instants.";
$strings['CloseMeeting'] = "Fermer la session";
$strings['CloseMeeting'] = 'Fermer la session';
$strings['VideoConferenceXCourseX'] = "Vidéoconférence #%s, cours %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Vidéoconférence ajoutée au calendrier";
$strings['VideoConferenceXCourseX'] = 'Vidéoconférence #%s, cours %s';
$strings['VideoConferenceAddedToTheCalendar'] = 'Vidéoconférence ajoutée au calendrier';
$strings['VideoConferenceAddedToTheLinkTool'] = "Vidéoconférence ajoutée comme lien. Vous pouvez éditer et publier le lien sur la page principale du cours depuis l'outil liens.";
$strings['GoToTheVideoConference'] = "Entrer dans la salle de conférence";
$strings['GoToTheVideoConference'] = 'Entrer dans la salle de conférence';
$strings['Records'] = "Enregistrement";
$strings['Meeting'] = "Salle de conférence";
$strings['Records'] = 'Enregistrement';
$strings['Meeting'] = 'Salle de conférence';
$strings['ViewRecord'] = "Voir l'enregistrement";
$strings['CopyToLinkTool'] = "Ajouter comme lien du cours";
$strings['CopyToLinkTool'] = 'Ajouter comme lien du cours';
$strings['EnterConference'] = "Entrer dans la salle de conférence";
$strings['RecordList'] = "Liste des enregistrements";
$strings['ServerIsNotRunning'] = "Le serveur de vidéoconférence ne fonctionne pas";
$strings['EnterConference'] = 'Entrer dans la salle de conférence';
$strings['RecordList'] = 'Liste des enregistrements';
$strings['ServerIsNotRunning'] = 'Le serveur de vidéoconférence ne fonctionne pas';
$strings['ServerIsNotConfigured'] = "Le serveur de vidéoconférence n'est pas configuré correctement";
$strings['XUsersOnLine'] = "%s utilisateurs dans la salle";
$strings['XUsersOnLine'] = '%s utilisateurs dans la salle';
$strings['host'] = 'Hôte de BigBlueButton';
$strings['host_help'] = "C'est le nom du serveur où le serveur de vidéoconférence a été habilité.
@ -62,8 +63,8 @@ $strings['MaxXUsersWarning'] = 'Cette salle de conférence est limitée à %s ut
$strings['MaxXUsersReached'] = 'La limite de %s utilisateurs simultanés a été atteinte dans cette salle de conférence. Veuillez rafraîchir dans quelque minutes pour voir si un siège s\'est libéré, ou attendre l\'ouverture d\'une nouvelle salle de conférence pour participer.';
$strings['MaxXUsersReachedManager'] = 'La limite de %s utilisateurs simultanés a été atteinte dans cette salle de conférence. Pour augmenter la limite, prenez contact avec l\'administrateur du portail.';
$strings['MaxUsersInConferenceRoom'] = 'Nombre max d\'utilisateurs simultanés dans une salle de conférence';
$strings['global_conference_allow_roles'] = "Visibilité du lien de vidéo conférence global pour les profils suivant";
$strings['CreatedAt'] = "Créé à";
$strings['global_conference_allow_roles'] = 'Visibilité du lien de vidéo conférence global pour les profils suivant';
$strings['CreatedAt'] = 'Créé à';
$strings['interface'] = 'Interface par défaut';
$strings['launch_type'] = 'Type d\'interface au lancement';

@ -1,33 +1,34 @@
<?php
/* License: see /license.txt */
// Needed in order to show the plugin title
$strings['plugin_title'] = "Videokonferenz";
$strings['plugin_comment'] = "Add a videoconference room in a Chamilo course using BigBlueButton (BBB)";
$strings['plugin_title'] = 'Videokonferenz';
$strings['plugin_comment'] = 'Add a videoconference room in a Chamilo course using BigBlueButton (BBB)';
$strings['Videoconference'] = "Videokonferenz";
$strings['MeetingOpened'] = "Offen";
$strings['MeetingClosed'] = "Beendet";
$strings['MeetingClosedComment'] = "Wenn Sie die Videokonferenz aufgezeichnet haben, ist die Videoaufzeichnung in der Liste unten in wenigen Augenblicken verfügbar.";
$strings['CloseMeeting'] = "Meeting beenden";
$strings['Videoconference'] = 'Videokonferenz';
$strings['MeetingOpened'] = 'Offen';
$strings['MeetingClosed'] = 'Beendet';
$strings['MeetingClosedComment'] = 'Wenn Sie die Videokonferenz aufgezeichnet haben, ist die Videoaufzeichnung in der Liste unten in wenigen Augenblicken verfügbar.';
$strings['CloseMeeting'] = 'Meeting beenden';
$strings['VideoConferenceXCourseX'] = "Videokonferenz #%s Lerninsel %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videokonferenz zum Kalender hinzugefügt";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videokonferenz zum Link-Tool hinzugefügt";
$strings['VideoConferenceXCourseX'] = 'Videokonferenz #%s Lerninsel %s';
$strings['VideoConferenceAddedToTheCalendar'] = 'Videokonferenz zum Kalender hinzugefügt';
$strings['VideoConferenceAddedToTheLinkTool'] = 'Videokonferenz zum Link-Tool hinzugefügt';
$strings['GoToTheVideoConference'] = "Gehe zur Videokonferenz";
$strings['GoToTheVideoConference'] = 'Gehe zur Videokonferenz';
$strings['Records'] = "Videoaufzeichnung";
$strings['Meeting'] = "Meeting";
$strings['Records'] = 'Videoaufzeichnung';
$strings['Meeting'] = 'Meeting';
$strings['ViewRecord'] = "Videoaufzeichnung ansehen";
$strings['CopyToLinkTool'] = "Copy to link tool";
$strings['ViewRecord'] = 'Videoaufzeichnung ansehen';
$strings['CopyToLinkTool'] = 'Copy to link tool';
$strings['EnterConference'] = "Videokonferenz starten";
$strings['RecordList'] = "Liste der Videoaufzeichnungen";
$strings['ServerIsNotRunning'] = "Videokonferenzserver läuft nicht";
$strings['ServerIsNotConfigured'] = "Videokonferenzserver ist nicht konfiguriert";
$strings['EnterConference'] = 'Videokonferenz starten';
$strings['RecordList'] = 'Liste der Videoaufzeichnungen';
$strings['ServerIsNotRunning'] = 'Videokonferenzserver läuft nicht';
$strings['ServerIsNotConfigured'] = 'Videokonferenzserver ist nicht konfiguriert';
$strings['XUsersOnLine'] = "%s Benutzer online";
$strings['XUsersOnLine'] = '%s Benutzer online';
$strings['host'] = 'BigBlueButton host';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running. Might be localhost, an IP address (e.g. http://192.168.13.54) or a domain name (e.g. http://my.video.com).';
@ -61,8 +62,8 @@ $strings['MaxXUsersWarning'] = 'Dieser Konferenzraum hat eine maximale Anzahl vo
$strings['MaxXUsersReached'] = 'The limit of %s simultaneous users has been reached for this conference room. Please wait for one seat to be freed or for another conference to start in order to join.';
$strings['MaxXUsersReachedManager'] = 'The limit of %s simultaneous users has been reached for this conference room. To increase this limit, please contact the platform administrator.';
$strings['MaxUsersInConferenceRoom'] = 'Max simultaneous users in a conference room';
$strings['global_conference_allow_roles'] = "Globaler Konferenz-Link nur für diese Benutzerrollen sichtbar";
$strings['CreatedAt'] = "Erstellt am";
$strings['global_conference_allow_roles'] = 'Globaler Konferenz-Link nur für diese Benutzerrollen sichtbar';
$strings['CreatedAt'] = 'Erstellt am';
$strings['interface'] = 'Standardbenutzeroberfläche';
$strings['launch_type'] = 'Wahl der Benutzeroberfläche beim Start';

@ -1,33 +1,34 @@
<?php
/* License: see /license.txt */
// Needed in order to show the plugin title
$strings['plugin_title'] = "Videoconferencia";
$strings['plugin_comment'] = "Añade una sala de videoconferencia en los cursos de Chamilo con BigBlueButton (BBB)";
$strings['plugin_title'] = 'Videoconferencia';
$strings['plugin_comment'] = 'Añade una sala de videoconferencia en los cursos de Chamilo con BigBlueButton (BBB)';
$strings['Videoconference'] = "Videoconferencia";
$strings['MeetingOpened'] = "Sala abierta";
$strings['MeetingClosed'] = "Sala cerrada";
$strings['MeetingClosedComment'] = "Si ha pedido grabar la sesión de videoconferencia en los parámetros del curso, esta grabación aparecerá en la lista siguiente una vez generada.";
$strings['CloseMeeting'] = "Cerrar sala";
$strings['Videoconference'] = 'Videoconferencia';
$strings['MeetingOpened'] = 'Sala abierta';
$strings['MeetingClosed'] = 'Sala cerrada';
$strings['MeetingClosedComment'] = 'Si ha pedido grabar la sesión de videoconferencia en los parámetros del curso, esta grabación aparecerá en la lista siguiente una vez generada.';
$strings['CloseMeeting'] = 'Cerrar sala';
$strings['VideoConferenceXCourseX'] = "Videoconferencia #%s, curso %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconferencia añadida al calendario";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videoconferencia añadida como enlace. Puede editar y publicar el enlace en la página principal del curso desde la herramienta de enlace.";
$strings['VideoConferenceXCourseX'] = 'Videoconferencia #%s, curso %s';
$strings['VideoConferenceAddedToTheCalendar'] = 'Videoconferencia añadida al calendario';
$strings['VideoConferenceAddedToTheLinkTool'] = 'Videoconferencia añadida como enlace. Puede editar y publicar el enlace en la página principal del curso desde la herramienta de enlace.';
$strings['GoToTheVideoConference'] = "Ir a la videoconferencia";
$strings['GoToTheVideoConference'] = 'Ir a la videoconferencia';
$strings['Records'] = "Grabación";
$strings['Meeting'] = "Sala de conferencia";
$strings['Records'] = 'Grabación';
$strings['Meeting'] = 'Sala de conferencia';
$strings['ViewRecord'] = "Ver grabación";
$strings['CopyToLinkTool'] = "Añadir como enlace del curso";
$strings['ViewRecord'] = 'Ver grabación';
$strings['CopyToLinkTool'] = 'Añadir como enlace del curso';
$strings['EnterConference'] = "Entrar a la videoconferencia";
$strings['RecordList'] = "Lista de grabaciones";
$strings['ServerIsNotRunning'] = "El servidor de videoconferencia no está funcionando";
$strings['ServerIsNotConfigured'] = "El servidor de videoconferencia no está configurado correctamente";
$strings['EnterConference'] = 'Entrar a la videoconferencia';
$strings['RecordList'] = 'Lista de grabaciones';
$strings['ServerIsNotRunning'] = 'El servidor de videoconferencia no está funcionando';
$strings['ServerIsNotConfigured'] = 'El servidor de videoconferencia no está configurado correctamente';
$strings['XUsersOnLine'] = "%s usuario(s) en la sala";
$strings['XUsersOnLine'] = '%s usuario(s) en la sala';
$strings['host'] = 'Host de BigBlueButton';
$strings['host_help'] = 'Este es el nombre del servidor donde su servidor BigBlueButton está corriendo. Puede ser localhost, una dirección IP (ej: http://192.168.13.54) o un nombre de dominio (ej: http://mi.video.com).';
@ -36,8 +37,8 @@ $strings['salt'] = 'Clave BigBlueButton';
$strings['salt_help'] = 'Esta es la llave de seguridad de su servidor BigBlueButton (llamada "salt" en inglés), que permitirá a su servidor de autentifica la instalación de Chamilo (como autorizada). Refiérese a la documentación de BigBlueButton para ubicarla, o use el comando "bbb-conf --salt" si tiene acceso al servidor en línea de comando.';
$strings['tool_enable'] = 'Herramienta de videoconferencia BigBlueButton activada';
$strings['tool_enable_help'] = "Escoja si desea activar la herramienta de videoconferencia BigBlueButton.
Una vez activada, se mostrará como una herramienta adicional en todas las páginas principales de cursos, y los profesores podrán iniciar una conferencia en cualquier momento. Los estudiantes no podrían lanzar una conferencia, solo juntarse a una existente. Si no tiene un servidor de videoconferencia BigBlueButton, por favor <a target=\"_blank\" href=\"http://bigbluebutton.org/\">configure uno</a> antes de seguir, o pida una cotización a uno de los proveedores oficiales de Chamilo. BigBlueButton es una herramienta de software libre (y gratuita), pero su instalación requiere de competencias que quizás no sean inmediatamente disponibles para todos. Puede instalarla usted mismo o buscar ayuda profesional. Esta ayuda podría no obstante generar algunos costos (por lo menos el tiempo de la persona quien lo ayude). En el puro espíritu del software libre, le ofrecemos las herramientas para hacer su trabajo más simple, en la medida de nuestras posibilidades, y le recomendamos profesionales (los proveedores oficiales de Chamilo) para ayudarlo en caso esto fuera demasiado complicado.<br />";
$strings['tool_enable_help'] = 'Escoja si desea activar la herramienta de videoconferencia BigBlueButton.
Una vez activada, se mostrará como una herramienta adicional en todas las páginas principales de cursos, y los profesores podrán iniciar una conferencia en cualquier momento. Los estudiantes no podrían lanzar una conferencia, solo juntarse a una existente. Si no tiene un servidor de videoconferencia BigBlueButton, por favor <a target="_blank" href="http://bigbluebutton.org/">configure uno</a> antes de seguir, o pida una cotización a uno de los proveedores oficiales de Chamilo. BigBlueButton es una herramienta de software libre (y gratuita), pero su instalación requiere de competencias que quizás no sean inmediatamente disponibles para todos. Puede instalarla usted mismo o buscar ayuda profesional. Esta ayuda podría no obstante generar algunos costos (por lo menos el tiempo de la persona quien lo ayude). En el puro espíritu del software libre, le ofrecemos las herramientas para hacer su trabajo más simple, en la medida de nuestras posibilidades, y le recomendamos profesionales (los proveedores oficiales de Chamilo) para ayudarlo en caso esto fuera demasiado complicado.<br />';
$strings['big_blue_button_welcome_message'] = 'Mensaje de bienvenida de BigBlueButton';
$strings['enable_global_conference'] = 'Activar la conferencia global';

@ -1,8 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class VM
* Class VM.
*/
class VM
{
@ -11,6 +12,7 @@ class VM
/**
* VM constructor.
*
* @param $config
*/
public function __construct($config)
@ -34,7 +36,6 @@ class VM
$config = $this->getConfig();
if (!isset($config)) {
return false;
}
@ -43,7 +44,6 @@ class VM
}
if (isset($config['enabled']) && $config['enabled']) {
return true;
}
@ -58,9 +58,6 @@ class VM
return $this->virtualMachine;
}
/**
* @param VirtualMachineInterface $virtualMachine
*/
public function setVirtualMachine(VirtualMachineInterface $virtualMachine)
{
$this->virtualMachine = $virtualMachine;
@ -74,10 +71,11 @@ class VM
$vmList = $this->config['vms'];
foreach ($vmList as $vm) {
if (isset($vm['enabled']) && $vm['enabled'] == true) {
if (isset($vm['enabled']) && true == $vm['enabled']) {
$className = $vm['name'].'VM';
return new $className($vm);
break;
}
}
@ -86,7 +84,7 @@ class VM
}
/**
* Resize the VM to the max size
* Resize the VM to the max size.
*/
public function resizeToMaxLimit()
{
@ -96,7 +94,7 @@ class VM
}
/**
* Resize the VM to the min size
* Resize the VM to the min size.
*/
public function resizeToMinLimit()
{

File diff suppressed because it is too large Load Diff

@ -75,12 +75,12 @@ class BigBlueButtonBN
else
return false;
}
return (simplexml_load_file($url));
return simplexml_load_file($url);
}
private function _requiredParam($param) {
/* Process required params and throw errors if we don't get values */
if ((isset($param)) && ($param != '')) {
if (isset($param) && ($param != '')) {
return $param;
}
elseif (!isset($param)) {
@ -94,12 +94,11 @@ class BigBlueButtonBN
private function _optionalParam($param) {
/* Pass most optional params through as set value, or set to '' */
/* Don't know if we'll use this one, but let's build it in case. */
if ((isset($param)) && ($param != '')) {
if (isset($param) && ($param != '')) {
return $param;
}
else {
$param = '';
return $param;
return '';
}
}
@ -215,7 +214,7 @@ class BigBlueButtonBN
'&userID='.urlencode($joinParams['userID']).
'&webVoiceConf='.urlencode($joinParams['webVoiceConf']);
// Only use createTime if we really want to use it. If it's '', then don't pass it:
if (((isset($joinParams['createTime'])) && ($joinParams['createTime'] != ''))) {
if ((isset($joinParams['createTime']) && ($joinParams['createTime'] != ''))) {
$params .= '&createTime='.urlencode($joinParams['createTime']);
}
@ -307,8 +306,7 @@ class BigBlueButtonBN
We do this in a separate function so we have the option to just get this
URL and print it if we want for some reason.
*/
$getMeetingsUrl = $this->_bbbServerBaseUrl."api/getMeetings?checksum=".sha1("getMeetings".$this->_securitySalt);
return $getMeetingsUrl;
return $this->_bbbServerBaseUrl."api/getMeetings?checksum=".sha1("getMeetings".$this->_securitySalt);
}
public function getMeetingsWithXmlResponseArray() {
@ -320,19 +318,17 @@ class BigBlueButtonBN
if($xml) {
// If we don't get a success code, stop processing and return just the returncode:
if ($xml->returncode != 'SUCCESS') {
$result = array(
return array(
'returncode' => $xml->returncode->__toString()
);
return $result;
}
elseif ($xml->messageKey == 'noMeetings') {
/* No meetings on server, so return just this info: */
$result = array(
return array(
'returncode' => $xml->returncode->__toString(),
'messageKey' => $xml->messageKey->__toString(),
'message' => $xml->message->__toString()
);
return $result;
}
else {
// In this case, we have success and meetings. First return general response:
@ -389,12 +385,11 @@ class BigBlueButtonBN
if($xml) {
// If we don't get a success code or messageKey, find out why:
if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
$result = array(
return array(
'returncode' => $xml->returncode->__toString(),
'messageKey' => $xml->messageKey->__toString(),
'message' => $xml->message->__toString()
);
return $result;
} else {
// In this case, we have success and meeting info:
$result = array(
@ -465,12 +460,11 @@ class BigBlueButtonBN
if($xml) {
// If we don't get a success code or messageKey, find out why:
if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
$result = array(
return array(
'returncode' => $xml->returncode->__toString(),
'messageKey' => $xml->messageKey->__toString(),
'message' => $xml->message->__toString()
);
return $result;
}
else {
// In this case, we have success and recording info:
@ -528,12 +522,11 @@ class BigBlueButtonBN
if($xml) {
// If we don't get a success code or messageKey, find out why:
if (($xml->returncode != 'SUCCESS') || ($xml->messageKey == null)) {
$result = array(
return array(
'returncode' => $xml->returncode->__toString(),
'messageKey' => $xml->messageKey->__toString(),
'message' => $xml->message->__toString()
);
return $result;
}
else {
// In this case, we have success and recording info:

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/* To show the plugin course icons you need to add these icons:
@ -7,11 +8,11 @@
* main/img/icons/64/plugin_name_na.png
*/
/**
* Videoconference plugin with BBB
* Videoconference plugin with BBB.
*/
/**
* Class BBBPlugin
* Class BBBPlugin.
*/
class BBBPlugin extends Plugin
{
@ -37,7 +38,7 @@ class BBBPlugin extends Plugin
[
'name' => 'bbb_force_record_generation',
'type' => 'checkbox',
]
],
];
/**
@ -64,16 +65,16 @@ class BBBPlugin extends Plugin
PLATFORM_ADMIN => get_lang('Administrator'),
COURSEMANAGER => get_lang('Trainer'),
STUDENT => get_lang('Learner'),
STUDENT_BOSS => get_lang('LearnerBoss')
STUDENT_BOSS => get_lang('LearnerBoss'),
],
'attributes' => ['multiple' => 'multiple']
'attributes' => ['multiple' => 'multiple'],
],
'interface' => [
'type' => 'select',
'options' => [
self::INTERFACE_FLASH => 'Flash',
self::INTERFACE_HTML5 => 'HTML5',
]
],
],
'launch_type' => [
'type' => 'select',
@ -93,12 +94,13 @@ class BBBPlugin extends Plugin
/**
* @param string $variable
*
* @return bool
*/
public function validateCourseSetting($variable)
{
if ($variable === 'bbb_enable_conference_in_groups') {
if ($this->get('enable_conference_in_course_groups') === 'true') {
if ('bbb_enable_conference_in_groups' === $variable) {
if ('true' === $this->get('enable_conference_in_course_groups')) {
return true;
}
@ -114,11 +116,12 @@ class BBBPlugin extends Plugin
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
return $result ?: $result = new self();
}
/**
* Install
* Install.
*/
public function install()
{
@ -149,14 +152,14 @@ class BBBPlugin extends Plugin
Database::query($sql);
Database::query(
"CREATE TABLE IF NOT EXISTS plugin_bbb_room (
'CREATE TABLE IF NOT EXISTS plugin_bbb_room (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
meeting_id int NOT NULL,
participant_id int(11) NOT NULL,
in_at datetime,
out_at datetime,
interface int NOT NULL DEFAULT 0
);"
);'
);
$fieldLabel = 'plugin_bbb_course_users_limit';
$fieldType = ExtraField::FIELD_TYPE_INTEGER;
@ -176,7 +179,7 @@ class BBBPlugin extends Plugin
'variable' => 'plugin_bbb_course_users_limit',
'changeable' => 1,
'visible_to_self' => 1,
'visible_to_others' => 0
'visible_to_others' => 0,
]
);
$fieldLabel = 'plugin_bbb_session_users_limit';
@ -194,7 +197,7 @@ class BBBPlugin extends Plugin
'variable' => 'plugin_bbb_session_users_limit',
'changeable' => 1,
'visible_to_self' => 1,
'visible_to_others' => 0
'visible_to_others' => 0,
]
);
@ -203,7 +206,7 @@ class BBBPlugin extends Plugin
}
/**
* Uninstall
* Uninstall.
*/
public function uninstall()
{
@ -263,7 +266,7 @@ class BBBPlugin extends Plugin
}
/**
* Return an array with URL
* Return an array with URL.
*
* @param string $conferenceUrl
*
@ -284,12 +287,11 @@ class BBBPlugin extends Plugin
*/
public function getFlashUrl($conferenceUrl)
{
$data = [
return [
'text' => $this->get_lang('EnterConferenceFlash'),
'url' => $conferenceUrl.'&interface='.self::INTERFACE_FLASH,
'icon' => 'resources/img/64/videoconference_flash.png'
'icon' => 'resources/img/64/videoconference_flash.png',
];
return $data;
}
/**
@ -299,11 +301,10 @@ class BBBPlugin extends Plugin
*/
public function getHtmlUrl($conferenceUrl)
{
$data = [
return [
'text' => $this->get_lang('EnterConferenceHTML5'),
'url' => $conferenceUrl.'&interface='.self::INTERFACE_HTML5,
'icon' => 'resources/img/64/videoconference_html5.png',
];
return $data;
}
}

@ -1,8 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class AbstractVM
* Class AbstractVM.
*/
abstract class AbstractVM
{
@ -14,7 +15,7 @@ abstract class AbstractVM
public $vmMaxSize;
public $apiKey;
public $vmClientId;
public $messages = array();
public $messages = [];
protected $connector;
/**

@ -1,44 +1,25 @@
<?php
/* For licensing terms, see /license.txt */
use DigitalOcean\DigitalOcean;
use DigitalOcean\Credentials;
/* For licensing terms, see /license.txt */
/**
* Class AmazonVM
* Class AmazonVM.
*/
class AmazonVM extends AbstractVM implements VirtualMachineInterface
{
/**
* @inheritdoc
*/
public function connect()
{
}
/**
* @inheritdoc
*/
public function runCron()
{
}
/**
* @inheritdoc
*/
public function resizeToMaxLimit()
{
}
/**
* @inheritdoc
*/
public function resizeToMinLimit()
{
}
}

@ -1,26 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
use DigitalOcean\DigitalOcean;
use DigitalOcean\Credentials;
use DigitalOcean\DigitalOcean;
/**
* Class DigitalOceanVM
* Class DigitalOceanVM.
*/
class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
{
/**
*
*/
public function __construct($settings)
{
parent::__construct($settings);
$this->connect();
}
/**
* @inheritdoc
*/
public function connect()
{
// Set up your credentials.
@ -50,8 +45,7 @@ class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
$sizes = $this->getConnector()->sizes();
$availableSizes = $sizes->getAll();
if (isset($availableSizes->status) && $availableSizes->status == 'OK') {
if (isset($availableSizes->status) && 'OK' == $availableSizes->status) {
$minSizeIdExists = false;
$maxSizeIdExists = false;
@ -75,7 +69,7 @@ class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
$dropletInfo = $droplets->show($this->vmId);
if ($dropletInfo->status == 'OK') {
if ('OK' == $dropletInfo->status) {
switch ($type) {
case 'min':
if ($dropletInfo->droplet->size_id == $this->vmMinSize) {
@ -97,10 +91,11 @@ class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
} else {
$this->resize($this->vmMaxSize);
}
break;
}
} else {
throw new \Exception(" Id ".$this->vmId." doesn't exists.");
throw new \Exception(' Id '.$this->vmId." doesn't exists.");
}
} catch (Exception $e) {
die($e->getMessage());
@ -108,7 +103,8 @@ class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
}
/**
* Turns off / resize / turns on
* Turns off / resize / turns on.
*
* @param int $sizeId
*/
public function resize($sizeId)
@ -126,7 +122,7 @@ class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
$resizeDroplet = $droplets->resize(
$this->vmId,
array('size_id' => intval($sizeId))
['size_id' => (int) $sizeId]
);
$this->addMessage('Resize droplet to size id: '.$sizeId);
$this->waitForEvent($resizeDroplet->event_id);
@ -134,45 +130,36 @@ class DigitalOceanVM extends AbstractVM implements VirtualMachineInterface
$powerOn = $droplets->powerOn($this->vmId);
$this->waitForEvent($powerOn->event_id);
$this->addMessage('Power on droplet #'.$this->vmId);
}
/**
* Loops until an event answer 100 percentage
* Loops until an event answer 100 percentage.
*
* @param int $eventId
*/
public function waitForEvent($eventId)
{
$events = $this->getConnector()->events();
$status = false;
while ($status == false) {
while (false == $status) {
$infoStatus = $events->show($eventId);
if ($infoStatus->status == 'OK' && $infoStatus->event->percentage == 100) {
if ('OK' == $infoStatus->status && 100 == $infoStatus->event->percentage) {
$status = true;
}
}
}
/**
* @inheritdoc
*/
public function runCron()
{
$this->resizeToMinLimit();
echo $this->getMessageToString();
}
/**
* @inheritdoc
*/
public function resizeToMaxLimit()
{
$this->resizeTo('max');
}
/**
* @inheritdoc
*/
public function resizeToMinLimit()
{
$this->resizeTo('min');

@ -1,29 +1,17 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Interface VirtualMachineInterface
* Interface VirtualMachineInterface.
*/
interface VirtualMachineInterface
{
/**
* @return mixed
*/
function connect();
public function connect();
/**
* @return mixed
*/
function runCron();
public function runCron();
/**
* @return mixed
*/
function resizeToMaxLimit();
public function resizeToMaxLimit();
/**
* @return mixed
*/
function resizeToMinLimit();
public function resizeToMinLimit();
}

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
require_once __DIR__.'/config.php';
@ -56,6 +55,7 @@ if ($conferenceManager) {
} else {
$message = Display::return_message(get_lang('Error'), 'error');
}
break;
case 'copy_record_to_link_tool':
$result = $bbb->copyRecordingToLinkTool($_GET['id']);
@ -64,9 +64,10 @@ if ($conferenceManager) {
} else {
$message = Display::return_message(get_lang('Error'), 'error');
}
break;
case 'regenerate_record':
if ($plugin->get('allow_regenerate_recording') !== 'true') {
if ('true' !== $plugin->get('allow_regenerate_recording')) {
api_not_allowed(true);
}
$recordId = isset($_GET['record_id']) ? $_GET['record_id'] : '';
@ -80,6 +81,7 @@ if ($conferenceManager) {
Display::addFlash($message);
header('Location: '.$bbb->getListingUrl());
exit;
break;
case 'delete_record':
$result = $bbb->deleteRecording($_GET['id']);
@ -92,6 +94,7 @@ if ($conferenceManager) {
Display::addFlash($message);
header('Location: '.$bbb->getListingUrl());
exit;
break;
case 'end':
$bbb->endMeeting($_GET['id']);
@ -116,24 +119,27 @@ if ($conferenceManager) {
Display::addFlash($message);
header('Location: '.$bbb->getListingUrl());
exit;
break;
case 'publish':
$bbb->publishMeeting($_GET['id']);
Display::addFlash(Display::return_message(get_lang('Update successful')));
header('Location: '.$bbb->getListingUrl());
exit;
break;
case 'unpublish':
$bbb->unpublishMeeting($_GET['id']);
Display::addFlash(Display::return_message(get_lang('Update successful')));
header('Location: '.$bbb->getListingUrl());
exit;
break;
case 'logout':
if ($plugin->get('allow_regenerate_recording') !== 'true') {
if ('true' !== $plugin->get('allow_regenerate_recording')) {
api_not_allowed(true);
}
$allow = api_get_course_setting('bbb_force_record_generation', $courseInfo) == 1 ? true : false;
$allow = 1 == api_get_course_setting('bbb_force_record_generation', $courseInfo) ? true : false;
if ($allow) {
$result = $bbb->getMeetingByRemoteId($_GET['remote_id']);
if (!empty($result)) {
@ -147,6 +153,7 @@ if ($conferenceManager) {
}
header('Location: '.$bbb->getListingUrl());
exit;
break;
default:
break;
@ -175,17 +182,17 @@ if ($bbb->isGlobalConference() && $bbb->isGlobalConferencePerUserEnabled()) {
$userCanSeeJoinButton = true;
}
if (($meetingExists || $userCanSeeJoinButton) && ($maxUsers == 0 || $maxUsers > $usersOnline)) {
if (($meetingExists || $userCanSeeJoinButton) && (0 == $maxUsers || $maxUsers > $usersOnline)) {
$showJoinButton = true;
}
$conferenceUrl = $bbb->getConferenceUrl();
$courseInfo = api_get_course_info();
$formToString = '';
if ($bbb->isGlobalConference() === false &&
if (false === $bbb->isGlobalConference() &&
$conferenceManager &&
!empty($courseInfo) &&
$plugin->get('enable_conference_in_course_groups') === 'true'
'true' === $plugin->get('enable_conference_in_course_groups')
) {
$url = api_get_self().'?'.api_get_cidreq(true, false).'&gidReq=';
$htmlHeadXtra[] = '<script>
@ -207,7 +214,7 @@ if ($bbb->isGlobalConference() === false &&
foreach ($groups as &$groupData) {
$itemGroupId = $groupData['id'];
if (isset($meetingsGroup[$itemGroupId]) && $meetingsGroup[$itemGroupId] == 1) {
if (isset($meetingsGroup[$itemGroupId]) && 1 == $meetingsGroup[$itemGroupId]) {
$groupData['name'] .= ' ('.get_lang('active').')';
}
}
@ -240,6 +247,7 @@ switch ($type) {
$conferenceUrl.'&interface='.$plugin->get('interface'),
['target' => '_blank', 'class' => 'btn btn-primary btn-large']
);
break;
case BBBPlugin::LAUNCH_TYPE_SET_BY_TEACHER:
if ($conferenceManager) {
@ -251,12 +259,15 @@ switch ($type) {
switch ($meetingInfo['interface']) {
case BBBPlugin::INTERFACE_FLASH:
$url = $plugin->getFlashUrl($conferenceUrl);
break;
case BBBPlugin::INTERFACE_HTML5:
$url = $plugin->getHtmlUrl($conferenceUrl);
break;
}
}
break;
case BBBPlugin::LAUNCH_TYPE_SET_BY_STUDENT:
if ($conferenceManager) {

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
require_once __DIR__.'/config.php';

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* This script initiates a video conference session, calling the BigBlueButton API.
*
* @package chamilo.plugin.bigbluebutton
*/
require_once __DIR__.'/../../vendor/autoload.php';
@ -37,7 +36,7 @@ if ($bbb->isGlobalConference()) {
if ($bbb->pluginEnabled) {
if ($bbb->isServerRunning()) {
if (isset($_GET['launch']) && $_GET['launch'] == 1) {
if (isset($_GET['launch']) && 1 == $_GET['launch']) {
if (file_exists(__DIR__.'/config.vm.php')) {
$config = require __DIR__.'/config.vm.php';
$vmIsEnabled = true;

@ -1,12 +1,11 @@
<?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.bigbluebutton
*/
require_once __DIR__.'/config.php';
BBBPlugin::create()->uninstall();

@ -1,7 +1,5 @@
<?php
/**
* @package chamilo.plugin.before_login
*/
if (api_is_anonymous()) {
// Only available in the index.php page
$loginAccepted = isset($_SESSION['before_login_accepted']) ? $_SESSION['before_login_accepted'] : null;

@ -4,7 +4,6 @@
* These settings will be used in the administration interface for plugins
* (Chamilo configuration settings->Plugins).
*
* @package chamilo.plugin
*
* @author Julio Montoya <gugli100@gmail.com>
*/
@ -14,7 +13,7 @@
// The plugin title.
$plugin_info['title'] = 'Show HTML before login';
// The comments that go with the plugin.
$plugin_info['comment'] = "Show a content before loading the login page.";
$plugin_info['comment'] = 'Show a content before loading the login page.';
// The plugin version.
$plugin_info['version'] = '1.0';
// The plugin author.

@ -1,3 +1,4 @@
<?php
// Redirect to buycourses/index.php
header('location: index.php');

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* Plugin database installation script. Can only be executed if included
* inside another script loading global.inc.php.
*
* @package chamilo.plugin.buycourses
*/
/**
* Check if script can be called.
@ -379,7 +378,7 @@ $culqiTable = Database::get_main_table(BuyCoursesPlugin::TABLE_CULQI);
$globalTable = Database::get_main_table(BuyCoursesPlugin::TABLE_GLOBAL_CONFIG);
$paypalExtraField = Database::select(
"*",
'*',
$extraFieldTable,
[
'where' => ['variable = ?' => 'paypal'],

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
/**
* Show form.

@ -1,10 +1,9 @@
<?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.buycourses
*/
/**
* Initialization.

@ -1,96 +1,97 @@
<?php
$strings['plugin_title'] = "Vender cursos";
$strings['plugin_comment'] = "Venda cursos diretamente através de seu portal Chamilo, usando uma conta do PayPal para receber fundos Nem a associação Chamilo nem os desenvolvedores envolvidos poderia ser considerado responsável de qualquer problema que você pode sofrer de usar este plugin..";
$strings['show_main_menu_tab'] = "Mostrar guia no menu principal";
$strings['show_main_menu_tab_help'] = "No caso de não querer mostrar a guia, você pode criar esse link em sua página Chamilo: %s";
$strings['include_sessions'] = "Incluir sessões";
$strings['paypal_enable'] = "Ativar PayPal";
$strings['transfer_enable'] = "Permitir transferência bancária";
$strings['unregistered_users_enable'] = "Permitir que usuários anônimos";
$strings['Free'] = "GRÁTIS";
$strings['banktransfer'] = "Transferência Bancária";
$strings['SaleStatusPending'] = "Venda pendente";
$strings['SaleStatusCanceled'] = "Venda cancelada";
$strings['SaleStatusCompleted'] = "Venda concluída";
$strings['CourseListOnSale'] = "Lista de cursos à venda";
$strings['AvailableCourses'] = "Campos disponíveis";
$strings['Price'] = "Preço";
$strings['SearchFilter'] = "Filtrar Pesquisa";
$strings['MinimumPrice'] = "Preço mínimo";
$strings['MaximumPrice'] = "Preço máximo";
$strings['AvailableCoursesConfiguration'] = "Configuração cursos disponíveis";
$strings['PaymentsConfiguration'] = "Configurar pagamentos";
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = "Você está registrado no curso.";
$strings['SeeDescription'] = "Descriçao";
$strings['Buy'] = "Comprar";
$strings['WaitingToReceiveThePayment'] = "Atualmente pendente de pagamento";
$strings['TheUserIsAlreadyRegisteredInTheSession'] = "Você já está registrado na sessão";
$strings['ItemNotSaved'] = "Item não salvo";
$strings['TitlePlugin'] = "Tudo o que você precisa para ensinar e vender cursos on-line";
$strings['PluginPresentation'] = "O BuyCourses Plugin dá-lhe os meios para vender seus cursos ou sessões e ensinar on-line, através de apenas alguns passos e configurações simples. O que você está esperando para começar a vender cursos através Chamilo LMS?";
$strings['Instructions'] = "Instruções";
$strings['InstructionsStepOne'] = "Criar um curso ou sessão na plataforma.";
$strings['InstructionsStepTwo'] = "Em - <strong>configurar pagamento</strong> - Defina a moeda com a qual você gostaria de vender seus cursos ou sessões";
$strings['InstructionsStepThree'] = "Para configurar cursos para vender. Vá em: <strong> configurar cursos e preços.</strong>";
$strings['BuyCourses'] = "Comprar cursos";
$strings['ConfigurationOfCoursesAndPrices'] = "Configurar cursos e preços ";
$strings['SalesReport'] = "Relatório de vendas";
$strings['UserInformation'] = "Detalhes do comprador";
$strings['PaymentMethods'] = "Métodos de pagamento";
$strings['ConfirmOrder'] = "Confirmar pedido";
$strings['PurchaseData'] = "Dados de Compra";
$strings['bc_subject'] = "Confirmação de ordem do curso";
$strings['PurchaseStatusX'] = "Estado de compra: %s";
$strings['PendingReasonByTransfer'] = "<b> Pendente </b> Aguardando confirmação da transferência.";
$strings['CancelOrder'] = "Anular ordem";
$strings['BankAccountInformation'] = "Detalhes da conta bancária";
$strings['BankAccount'] = "Contas bancárias";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Uma vez confirmada, você receberá um e-mail com os dados bancários e uma referência de ordem.";
$strings['SubscriptionToCourseXSuccessful'] = "Sua inscrição para <a href=\"%s\"><strong>\"%s\"</strong></a> foi concluída com sucesso.";
$strings['OrderCanceled'] = "Ordem cancelada";
$strings['OrderStatus'] = "Status do pedido";
$strings['SearchByStatus'] = "Pesquisar por estado";
$strings['OrderReference'] = "Código de encomenda";
$strings['OrderDate'] = "Data do pedido";
$strings['ProductType'] = "Tipo de produto";
$strings['SubscribeUser'] = "Inscrever utilizador";
$strings['DeleteOrder'] = "Excluir a ordem";
$strings['ErrorContactPlatformAdmin'] = "Por favor entre em contato com o administrador da plataforma de erro desconhecido..";
$strings['PendingReasonByAddress'] = ". <b> Pendente </b> Você não digitou um endereço de entrega confirmado.";
$strings['PendingReasonByAuthorization'] = "<b> Pendentes </b> fundos Nós ainda não capturados..";
$strings['PendingReasonByEcheck'] = "<b> Pendente </b> O pagamento foi feito por um eCheck que ainda não foi eliminada.";
$strings['PendingReasonByIntl'] = "<b> Pendente </b> Nós não temos um mecanismo de retirada de fundos..";
$strings['PendingReasonByMulticurrency'] = "<b> Pendente </b> Nós não equilibrar na moeda enviado.";
$strings['PendingReasonByOrder'] = "<b> Pendente </b> Ordem feita Nós ainda não capturado fundos...";
$strings['PendingReasonByPaymentReview'] = "<b> Pendente </b> O pagamento está sendo revisto pelo PayPal para o risco.";
$strings['PendingReasonByRegulatoryReview'] = "<b> Pendente </b> O pagamento está sendo revisado para conformidade com regulamentações governamentais..";
$strings['PendingReasonByUnilateral'] = "<b> Pendente </b> O e-mail ainda não está registrado o confirmou..";
$strings['PendingReasonByUpgrade'] = "<b> Pendente </b> O pagamento foi feito por cartão de crédito..";
$strings['PendingReasonByVerify'] = "<b> Pendente </b> Desculpe Nós ainda não são verificados no PayPal...";
$strings['PendingReasonByOther'] = "<b> Pendente </b> Por favor, entre em contato com o administrador da plataforma..";
$strings['plugin_title'] = 'Vender cursos';
$strings['plugin_comment'] = 'Venda cursos diretamente através de seu portal Chamilo, usando uma conta do PayPal para receber fundos Nem a associação Chamilo nem os desenvolvedores envolvidos poderia ser considerado responsável de qualquer problema que você pode sofrer de usar este plugin..';
$strings['show_main_menu_tab'] = 'Mostrar guia no menu principal';
$strings['show_main_menu_tab_help'] = 'No caso de não querer mostrar a guia, você pode criar esse link em sua página Chamilo: %s';
$strings['include_sessions'] = 'Incluir sessões';
$strings['paypal_enable'] = 'Ativar PayPal';
$strings['transfer_enable'] = 'Permitir transferência bancária';
$strings['unregistered_users_enable'] = 'Permitir que usuários anônimos';
$strings['Free'] = 'GRÁTIS';
$strings['banktransfer'] = 'Transferência Bancária';
$strings['SaleStatusPending'] = 'Venda pendente';
$strings['SaleStatusCanceled'] = 'Venda cancelada';
$strings['SaleStatusCompleted'] = 'Venda concluída';
$strings['CourseListOnSale'] = 'Lista de cursos à venda';
$strings['AvailableCourses'] = 'Campos disponíveis';
$strings['Price'] = 'Preço';
$strings['SearchFilter'] = 'Filtrar Pesquisa';
$strings['MinimumPrice'] = 'Preço mínimo';
$strings['MaximumPrice'] = 'Preço máximo';
$strings['AvailableCoursesConfiguration'] = 'Configuração cursos disponíveis';
$strings['PaymentsConfiguration'] = 'Configurar pagamentos';
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'Você está registrado no curso.';
$strings['SeeDescription'] = 'Descriçao';
$strings['Buy'] = 'Comprar';
$strings['WaitingToReceiveThePayment'] = 'Atualmente pendente de pagamento';
$strings['TheUserIsAlreadyRegisteredInTheSession'] = 'Você já está registrado na sessão';
$strings['ItemNotSaved'] = 'Item não salvo';
$strings['TitlePlugin'] = 'Tudo o que você precisa para ensinar e vender cursos on-line';
$strings['PluginPresentation'] = 'O BuyCourses Plugin dá-lhe os meios para vender seus cursos ou sessões e ensinar on-line, através de apenas alguns passos e configurações simples. O que você está esperando para começar a vender cursos através Chamilo LMS?';
$strings['Instructions'] = 'Instruções';
$strings['InstructionsStepOne'] = 'Criar um curso ou sessão na plataforma.';
$strings['InstructionsStepTwo'] = 'Em - <strong>configurar pagamento</strong> - Defina a moeda com a qual você gostaria de vender seus cursos ou sessões';
$strings['InstructionsStepThree'] = 'Para configurar cursos para vender. Vá em: <strong> configurar cursos e preços.</strong>';
$strings['BuyCourses'] = 'Comprar cursos';
$strings['ConfigurationOfCoursesAndPrices'] = 'Configurar cursos e preços ';
$strings['SalesReport'] = 'Relatório de vendas';
$strings['UserInformation'] = 'Detalhes do comprador';
$strings['PaymentMethods'] = 'Métodos de pagamento';
$strings['ConfirmOrder'] = 'Confirmar pedido';
$strings['PurchaseData'] = 'Dados de Compra';
$strings['bc_subject'] = 'Confirmação de ordem do curso';
$strings['PurchaseStatusX'] = 'Estado de compra: %s';
$strings['PendingReasonByTransfer'] = '<b> Pendente </b> Aguardando confirmação da transferência.';
$strings['CancelOrder'] = 'Anular ordem';
$strings['BankAccountInformation'] = 'Detalhes da conta bancária';
$strings['BankAccount'] = 'Contas bancárias';
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = 'Uma vez confirmada, você receberá um e-mail com os dados bancários e uma referência de ordem.';
$strings['SubscriptionToCourseXSuccessful'] = 'Sua inscrição para <a href="%s"><strong>"%s"</strong></a> foi concluída com sucesso.';
$strings['OrderCanceled'] = 'Ordem cancelada';
$strings['OrderStatus'] = 'Status do pedido';
$strings['SearchByStatus'] = 'Pesquisar por estado';
$strings['OrderReference'] = 'Código de encomenda';
$strings['OrderDate'] = 'Data do pedido';
$strings['ProductType'] = 'Tipo de produto';
$strings['SubscribeUser'] = 'Inscrever utilizador';
$strings['DeleteOrder'] = 'Excluir a ordem';
$strings['ErrorContactPlatformAdmin'] = 'Por favor entre em contato com o administrador da plataforma de erro desconhecido..';
$strings['PendingReasonByAddress'] = '. <b> Pendente </b> Você não digitou um endereço de entrega confirmado.';
$strings['PendingReasonByAuthorization'] = '<b> Pendentes </b> fundos Nós ainda não capturados..';
$strings['PendingReasonByEcheck'] = '<b> Pendente </b> O pagamento foi feito por um eCheck que ainda não foi eliminada.';
$strings['PendingReasonByIntl'] = '<b> Pendente </b> Nós não temos um mecanismo de retirada de fundos..';
$strings['PendingReasonByMulticurrency'] = '<b> Pendente </b> Nós não equilibrar na moeda enviado.';
$strings['PendingReasonByOrder'] = '<b> Pendente </b> Ordem feita Nós ainda não capturado fundos...';
$strings['PendingReasonByPaymentReview'] = '<b> Pendente </b> O pagamento está sendo revisto pelo PayPal para o risco.';
$strings['PendingReasonByRegulatoryReview'] = '<b> Pendente </b> O pagamento está sendo revisado para conformidade com regulamentações governamentais..';
$strings['PendingReasonByUnilateral'] = '<b> Pendente </b> O e-mail ainda não está registrado o confirmou..';
$strings['PendingReasonByUpgrade'] = '<b> Pendente </b> O pagamento foi feito por cartão de crédito..';
$strings['PendingReasonByVerify'] = '<b> Pendente </b> Desculpe Nós ainda não são verificados no PayPal...';
$strings['PendingReasonByOther'] = '<b> Pendente </b> Por favor, entre em contato com o administrador da plataforma..';
$strings['PayPalPaymentOKPleaseConfirm'] = "PayPal relata a transação está pronto para ser executado. Para confirmar que você está OK para prosseguir, clique no botão de confirmação abaixo. Uma vez clicado, você será registrado para o curso e os fundos serão transferido da sua conta PayPal para a nossa loja. Você sempre pode acessar seus cursos através da aba 'Meus cursos' Obrigado por seu costume.!";
$strings['Sandbox'] = "Ambiente de teste";
$strings['PayPalConfig'] = "Configuração PayPal:";
$strings['TransfersConfig'] = "Configurar transferências bancárias:";
$strings['PluginInstruction'] = "Você pode ativar ou desativar a opção de pagar via PayPal ou transferência bancária na seção de configuração do plugin.";
$strings['ClickHere'] = "<i> Clique aqui </i> para obter mais detalhes";
$strings['CurrencyType'] = "Tipo de moeda";
$strings['InfoCurrency'] = "Define a moeda para o pagamento de seus cursos.";
$strings['ApiUsername'] = "Nome de usuário API";
$strings['ApiPassword'] = "Senha API";
$strings['ApiSignature'] = "Assinatura API";
$strings['InfoApiCredentials'] = "Para gerar as suas credenciais de API para integrar Chamilo com a sua conta PayPal, você deve seguir os seguintes passos";
$strings['InfoApiStepOne'] = "Vá para a sua conta do PayPal, <strong> Resumo </strong>, então <front> preferências do vendedor </front> na <front> Ferramentas de Vendas </front> menu (se o fizer não ter este item de menu, você pode precisar de obter a autorização para vender o material através do PayPal em primeiro lugar).";
$strings['InfoApiStepTwo'] = "No parágrafo <strong> Acesso API </strong>, clique em <strong> Atualizar </strong>";
$strings['InfoApiStepThree'] = "Na opção 2 (credenciais de solicitação de API para criar o seu próprio nome de usuário e senha API), clique no botão <strong> Exibir API Assinatura link </strong>, e copiar as credenciais apresentadas à direita no formulário do plugin BuyCourses.";
$strings['ErrorOccurred'] = "<strong> Ocorreu um erro </strong> Código: %s. Mensagem: %s. Por favor, entre em contato com o Admin da plataforma.";
$strings['VisibleInCatalog'] = "Visível no catálogo";
$strings['Beneficiaries'] = "Beneficiários";
$strings['AvailableCourse'] = "Campo disponível";
$strings['ShowOnCourseCatalog'] = "Mostrar no catálogo de cursos";
$strings['ByStatus'] = "Por estado";
$strings['ByUser'] = "Por usuário";
$strings['PaymentMethod'] = "Método de pagamento";
$strings['SWIFT'] = "Código SWIFT";
$strings['SWIFT_help'] = "Formato padrão de Códigos de Identificação Bancária (BIC) e serve como um identificador exclusivo de um banco ou instituição financeira";
$strings['Sandbox'] = 'Ambiente de teste';
$strings['PayPalConfig'] = 'Configuração PayPal:';
$strings['TransfersConfig'] = 'Configurar transferências bancárias:';
$strings['PluginInstruction'] = 'Você pode ativar ou desativar a opção de pagar via PayPal ou transferência bancária na seção de configuração do plugin.';
$strings['ClickHere'] = '<i> Clique aqui </i> para obter mais detalhes';
$strings['CurrencyType'] = 'Tipo de moeda';
$strings['InfoCurrency'] = 'Define a moeda para o pagamento de seus cursos.';
$strings['ApiUsername'] = 'Nome de usuário API';
$strings['ApiPassword'] = 'Senha API';
$strings['ApiSignature'] = 'Assinatura API';
$strings['InfoApiCredentials'] = 'Para gerar as suas credenciais de API para integrar Chamilo com a sua conta PayPal, você deve seguir os seguintes passos';
$strings['InfoApiStepOne'] = 'Vá para a sua conta do PayPal, <strong> Resumo </strong>, então <front> preferências do vendedor </front> na <front> Ferramentas de Vendas </front> menu (se o fizer não ter este item de menu, você pode precisar de obter a autorização para vender o material através do PayPal em primeiro lugar).';
$strings['InfoApiStepTwo'] = 'No parágrafo <strong> Acesso API </strong>, clique em <strong> Atualizar </strong>';
$strings['InfoApiStepThree'] = 'Na opção 2 (credenciais de solicitação de API para criar o seu próprio nome de usuário e senha API), clique no botão <strong> Exibir API Assinatura link </strong>, e copiar as credenciais apresentadas à direita no formulário do plugin BuyCourses.';
$strings['ErrorOccurred'] = '<strong> Ocorreu um erro </strong> Código: %s. Mensagem: %s. Por favor, entre em contato com o Admin da plataforma.';
$strings['VisibleInCatalog'] = 'Visível no catálogo';
$strings['Beneficiaries'] = 'Beneficiários';
$strings['AvailableCourse'] = 'Campo disponível';
$strings['ShowOnCourseCatalog'] = 'Mostrar no catálogo de cursos';
$strings['ByStatus'] = 'Por estado';
$strings['ByUser'] = 'Por usuário';
$strings['PaymentMethod'] = 'Método de pagamento';
$strings['SWIFT'] = 'Código SWIFT';
$strings['SWIFT_help'] = 'Formato padrão de Códigos de Identificação Bancária (BIC) e serve como um identificador exclusivo de um banco ou instituição financeira';

@ -1,135 +1,136 @@
<?php
$strings['plugin_title'] = "Sell courses";
$strings['plugin_comment'] = "Sell courses directly through your Chamilo portal, using a PayPal account to receive funds. Neither the Chamilo association nor the developers involved could be considered responsible of any issue you might suffer using this plugin.";
$strings['show_main_menu_tab'] = "Show tab in hoofdmenu";
$strings['show_main_menu_tab_help'] = "In case of not wanting to show the tab, you can create this link in your Chamilo homepage : %s";
$strings['public_main_menu_tab'] = "Show tab in main menu aan anonyme gebruikers";
$strings['include_sessions'] = "Inclusief sessies";
$strings['paypal_enable'] = "Instellen van PayPal";
$strings['commissions_enable'] = "Instellen van Opdrachten";
$strings['transfer_enable'] = "Instellen van bankoverschrijving";
$strings['unregistered_users_enable'] = "Sta anonieme gebruikers toe";
$strings['Free'] = "FREE";
$strings['PaypalPayoutCommissions'] = "Paypal Uitbetaal Opdrachten";
$strings['MyPayouts'] = "Mijn Betalingsoverzicht";
$strings['Commission'] = "Commissie";
$strings['Commissions'] = "Commissies";
$strings['SetCommissions'] = "Set commissies";
$strings['CommissionsConfig'] = "Configureren Commissies";
$strings['PayoutReport'] = "Uitbetalingen rapport";
$strings['Stats'] = "Statistieken";
$strings['InfoCommissions'] = "Vul hier de omzet commissie als een percentage(% ) , de organisatie die het platform controleert. Deze percentage wordt in mindering gebracht op de door docenten ontvangen bedrag voor elke cursus of sessie dat verkocht is.";
$strings['NeedToSelectPaymentType'] = "Hier u betalings type selecteren";
$strings['IndividualPayout'] = "Individuele uitbetalingen";
$strings['CancelPayout'] = "Annuleer Uitbetalingen";
$strings['ContinuePayout'] = "Continue Uitbetalingen";
$strings['ProceedPayout'] = "Ga verder met de betaling";
$strings['TheActualPlatformCommissionIsX'] = "De huidige platform commissie <b> %s </b>. Deze percentage zal invermindering gebracht worden van de totale prijs van het product. Het verschil in het bedrag zal aan de volgende commissies toegepast worden.";
$strings['CoursesInSessionsDoesntDisplayHere'] = "De cursussen die binnen een training zitten worden niet weergegeven in de lijst van de cursussen als afzonderlijke producten.";
$strings['WantToSellCourses'] = "Wilt u leren en wat geld verdienen met uw eigen cursussen? Deze lijst kan worden gevuld met de verkoop van uw cursussen via dit platform. Neem contact op met ons.";
$strings['SelectOptionToProceed'] = "Selecteer de optie om verder te gaan";
$strings['VerifyTotalAmountToProceedPayout'] = "Controleer het totale bedrag voor over te gaan tot de betaling van commissies. Dit bedrag heeft geen extra kosten voor PayPal rekening houder. De cursussen verkopen die niet meetellen met een Paypal-account voor de begunstigden niet in aanmerking genomen.";
$strings['TotalAcounts'] = "Totaal van de rekeningen:";
$strings['TotalPayout'] = "Totaal te betalen:";
$strings['PayoutDate'] = "Betaaldatum:";
$strings['CautionThisProcessCantBeCanceled'] = "<b>Let op</b>:Dit proces kan een paar minuten duren en kan niet worden geannuleerd.";
$strings['ProcessingPayoutsDontCloseThisWindow'] = "<b>Verder gaan met betalingen. Dit venster niet sluiten totdat dit proces is afgerond.</b>";
$strings['PayoutSuccess'] = "Betalingen met succes verwerkt";
$strings['Buyer'] = "Koper";
$strings['BankTransfer'] = "Bankoverschrijving";
$strings['SaleInfo'] = "Verkoop Informatie";
$strings['SaleStatusPending'] = "Verkoop in behandeling";
$strings['SaleStatusCanceled'] = "Verkoop geannuleerd";
$strings['SaleStatusCompleted'] = "verkoop afgerond";
$strings['PayoutStatusPending'] = "Betaling in behandeling";
$strings['PayoutStatusCanceled'] = "Betaling geannuleerd";
$strings['PayoutStatusCompleted'] = "Betaling afgerond";
$strings['PayoutsTotalPending'] = "Onafgehandelde betalingen:";
$strings['PayoutsTotalCanceled'] = "Geannuleerde betalingen:";
$strings['PayoutsTotalCompleted'] = "Afgeronde betalingen:";
$strings['TotalAmount'] = "Totaalbedrag:";
$strings['CourseListOnSale'] = "Lijst van cursussen in verkoop";
$strings['AvailableCourses'] = "Beschikbare Cursussen";
$strings['Price'] = "Prijs";
$strings['SearchFilter'] = "Zoekmachine";
$strings['MinimumPrice'] = "Minimuum prijs";
$strings['MaximumPrice'] = "Maximuumm prijs";
$strings['AvailableCoursesConfiguration'] = "Beschikbare cursussen overzicht";
$strings['PaymentsConfiguration'] = "Betalingsoverzicht";
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = "Je bent geregistreerd voor de cursus.";
$strings['SeeDescription'] = "Omschrijving";
$strings['Buy'] = "Koop / inschrijven";
$strings['WaitingToReceiveThePayment'] = "In afwachting van uw betaling";
$strings['TheUserIsAlreadyRegisteredInTheSession'] = "Je bent geregistreerd voor de sessie";
$strings['ItemNotSaved'] = "Item niet opgeslagen";
$strings['TitlePlugin'] = "Alles wat je nodig hebt om online cursussen te onderwijzen en te verkopen";
$strings['PluginPresentation'] = "The BuyCourses Plugin gives you the means to sell your courses or sessions and teach online, through only a few simple steps and settings. What are you waiting for? Start selling courses through Chamilo LMS!";
$strings['Instructions'] = "Instructies";
$strings['InstructionsStepOne'] = "Maak een cursus of een sessie op het platform.";
$strings['InstructionsStepTwo'] = "In de <strong> betaling </strong>, stelt de valuta waarmee u wilt uw cursussen of sessies te verkopen.";
$strings['InstructionsStepThree'] = "Overzicht van cursussen om te verkopen in de <strong> Cursussen en prijzen </strong> Instellingen.";
$strings['BuyCourses'] = "Cursussen Kopen";
$strings['ConfigurationOfCoursesAndPrices'] = "Cursussen en Prijzen overzicht";
$strings['SalesReport'] = "Verkoopcijfers";
$strings['UserInformation'] = "Gegevens van de koper";
$strings['PaymentMethods'] = "Betaal methodes";
$strings['ConfirmOrder'] = "Bevestig bestelling";
$strings['PurchaseData'] = "Aankoopgegevens";
$strings['bc_subject'] = "Bevestiging cursus order";
$strings['PurchaseStatusX'] = "Aankoop status: %s";
$strings['PendingReasonByTransfer'] = "<b> In afwachting </b>. In afwachting van de overdracht bevestiging";
$strings['CancelOrder'] = "Annuleer order";
$strings['BankAccountInformation'] = "Bankgegevens";
$strings['BankAccount'] = "Bankrekening";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Eenmaal bevestigd, ontvangt u een e-mail met de bankgegevens en een orderreferentie.";
$strings['SubscriptionToCourseXSuccessful'] = "Uw aankoop op <a href=\"%s\"><strong>\"%s\"</strong></a> werd met succes afgerond.";
$strings['OrderCanceled'] = "Order geannuleerd";
$strings['OrderStatus'] = "Bestelstatus";
$strings['PayoutStatus'] = "Betalingsstatus";
$strings['SearchByStatus'] = "Zoeken op status";
$strings['OrderReference'] = "Bestelreferentie";
$strings['OrderDate'] = "Besteldatum";
$strings['OrderPrice'] = "Bestel prijs";
$strings['ProductType'] = "Artikel type";
$strings['SubscribeUser'] = "Onderteken gebruiker";
$strings['DeleteOrder'] = "Verwijder bestelling";
$strings['ErrorContactPlatformAdmin'] = "Onbekende fout. Neem contact op met het platform administrator.";
$strings['PendingReasonByAddress'] = "<b>in afwachting</b>. Je hebt een bevestigde verzendadres niet in te voeren.";
$strings['PendingReasonByAuthorization'] = "<b>in afwachting</b>. We hebben nog geen betalingen.";
$strings['PendingReasonByEcheck'] = "<b>in afwachting</b>. De betaling is verricht door een eCheck die nog niet is vrijgemaakt";
$strings['PendingReasonByIntl'] = "<b>in afwachting</b>.We hebben geen terugtrekking mechanisme voor betalingen.";
$strings['PendingReasonByMulticurrency'] = "<b>in afwachting</b>. We hebben niet in evenwicht te brengen in de valuta verzonden.";
$strings['PendingReasonByOrder'] = "<b>in afwachting</b>. Bestelling. We hebben nog geen betalingen.";
$strings['PendingReasonByPaymentReview'] = "<b>in afwachting</b>. De betaling wordt beoordeeld door PayPal voor risico.";
$strings['PendingReasonByRegulatoryReview'] = "<b>in afwachting</b>. De betaling wordt beoordeeld voor de naleving van regelgeving van de overheid.";
$strings['PendingReasonByUnilateral'] = "<b>in afwachting</b>. Het e-mailadres is nog niet geregistreerd of bevestigd.";
$strings['PendingReasonByUpgrade'] = "<b>in afwachting</b>. De betaling werd gedaan via credit card.";
$strings['PendingReasonByVerify'] = "<b>in afwachting</b>. Sorry. We zijn nog niet in Paypal geverifieerd.";
$strings['PendingReasonByOther'] = "<b>in afwachting</b>. Neem contact op met het platform admin.";
$strings['plugin_title'] = 'Sell courses';
$strings['plugin_comment'] = 'Sell courses directly through your Chamilo portal, using a PayPal account to receive funds. Neither the Chamilo association nor the developers involved could be considered responsible of any issue you might suffer using this plugin.';
$strings['show_main_menu_tab'] = 'Show tab in hoofdmenu';
$strings['show_main_menu_tab_help'] = 'In case of not wanting to show the tab, you can create this link in your Chamilo homepage : %s';
$strings['public_main_menu_tab'] = 'Show tab in main menu aan anonyme gebruikers';
$strings['include_sessions'] = 'Inclusief sessies';
$strings['paypal_enable'] = 'Instellen van PayPal';
$strings['commissions_enable'] = 'Instellen van Opdrachten';
$strings['transfer_enable'] = 'Instellen van bankoverschrijving';
$strings['unregistered_users_enable'] = 'Sta anonieme gebruikers toe';
$strings['Free'] = 'FREE';
$strings['PaypalPayoutCommissions'] = 'Paypal Uitbetaal Opdrachten';
$strings['MyPayouts'] = 'Mijn Betalingsoverzicht';
$strings['Commission'] = 'Commissie';
$strings['Commissions'] = 'Commissies';
$strings['SetCommissions'] = 'Set commissies';
$strings['CommissionsConfig'] = 'Configureren Commissies';
$strings['PayoutReport'] = 'Uitbetalingen rapport';
$strings['Stats'] = 'Statistieken';
$strings['InfoCommissions'] = 'Vul hier de omzet commissie als een percentage(% ) , de organisatie die het platform controleert. Deze percentage wordt in mindering gebracht op de door docenten ontvangen bedrag voor elke cursus of sessie dat verkocht is.';
$strings['NeedToSelectPaymentType'] = 'Hier u betalings type selecteren';
$strings['IndividualPayout'] = 'Individuele uitbetalingen';
$strings['CancelPayout'] = 'Annuleer Uitbetalingen';
$strings['ContinuePayout'] = 'Continue Uitbetalingen';
$strings['ProceedPayout'] = 'Ga verder met de betaling';
$strings['TheActualPlatformCommissionIsX'] = 'De huidige platform commissie <b> %s </b>. Deze percentage zal invermindering gebracht worden van de totale prijs van het product. Het verschil in het bedrag zal aan de volgende commissies toegepast worden.';
$strings['CoursesInSessionsDoesntDisplayHere'] = 'De cursussen die binnen een training zitten worden niet weergegeven in de lijst van de cursussen als afzonderlijke producten.';
$strings['WantToSellCourses'] = 'Wilt u leren en wat geld verdienen met uw eigen cursussen? Deze lijst kan worden gevuld met de verkoop van uw cursussen via dit platform. Neem contact op met ons.';
$strings['SelectOptionToProceed'] = 'Selecteer de optie om verder te gaan';
$strings['VerifyTotalAmountToProceedPayout'] = 'Controleer het totale bedrag voor over te gaan tot de betaling van commissies. Dit bedrag heeft geen extra kosten voor PayPal rekening houder. De cursussen verkopen die niet meetellen met een Paypal-account voor de begunstigden niet in aanmerking genomen.';
$strings['TotalAcounts'] = 'Totaal van de rekeningen:';
$strings['TotalPayout'] = 'Totaal te betalen:';
$strings['PayoutDate'] = 'Betaaldatum:';
$strings['CautionThisProcessCantBeCanceled'] = '<b>Let op</b>:Dit proces kan een paar minuten duren en kan niet worden geannuleerd.';
$strings['ProcessingPayoutsDontCloseThisWindow'] = '<b>Verder gaan met betalingen. Dit venster niet sluiten totdat dit proces is afgerond.</b>';
$strings['PayoutSuccess'] = 'Betalingen met succes verwerkt';
$strings['Buyer'] = 'Koper';
$strings['BankTransfer'] = 'Bankoverschrijving';
$strings['SaleInfo'] = 'Verkoop Informatie';
$strings['SaleStatusPending'] = 'Verkoop in behandeling';
$strings['SaleStatusCanceled'] = 'Verkoop geannuleerd';
$strings['SaleStatusCompleted'] = 'verkoop afgerond';
$strings['PayoutStatusPending'] = 'Betaling in behandeling';
$strings['PayoutStatusCanceled'] = 'Betaling geannuleerd';
$strings['PayoutStatusCompleted'] = 'Betaling afgerond';
$strings['PayoutsTotalPending'] = 'Onafgehandelde betalingen:';
$strings['PayoutsTotalCanceled'] = 'Geannuleerde betalingen:';
$strings['PayoutsTotalCompleted'] = 'Afgeronde betalingen:';
$strings['TotalAmount'] = 'Totaalbedrag:';
$strings['CourseListOnSale'] = 'Lijst van cursussen in verkoop';
$strings['AvailableCourses'] = 'Beschikbare Cursussen';
$strings['Price'] = 'Prijs';
$strings['SearchFilter'] = 'Zoekmachine';
$strings['MinimumPrice'] = 'Minimuum prijs';
$strings['MaximumPrice'] = 'Maximuumm prijs';
$strings['AvailableCoursesConfiguration'] = 'Beschikbare cursussen overzicht';
$strings['PaymentsConfiguration'] = 'Betalingsoverzicht';
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'Je bent geregistreerd voor de cursus.';
$strings['SeeDescription'] = 'Omschrijving';
$strings['Buy'] = 'Koop / inschrijven';
$strings['WaitingToReceiveThePayment'] = 'In afwachting van uw betaling';
$strings['TheUserIsAlreadyRegisteredInTheSession'] = 'Je bent geregistreerd voor de sessie';
$strings['ItemNotSaved'] = 'Item niet opgeslagen';
$strings['TitlePlugin'] = 'Alles wat je nodig hebt om online cursussen te onderwijzen en te verkopen';
$strings['PluginPresentation'] = 'The BuyCourses Plugin gives you the means to sell your courses or sessions and teach online, through only a few simple steps and settings. What are you waiting for? Start selling courses through Chamilo LMS!';
$strings['Instructions'] = 'Instructies';
$strings['InstructionsStepOne'] = 'Maak een cursus of een sessie op het platform.';
$strings['InstructionsStepTwo'] = 'In de <strong> betaling </strong>, stelt de valuta waarmee u wilt uw cursussen of sessies te verkopen.';
$strings['InstructionsStepThree'] = 'Overzicht van cursussen om te verkopen in de <strong> Cursussen en prijzen </strong> Instellingen.';
$strings['BuyCourses'] = 'Cursussen Kopen';
$strings['ConfigurationOfCoursesAndPrices'] = 'Cursussen en Prijzen overzicht';
$strings['SalesReport'] = 'Verkoopcijfers';
$strings['UserInformation'] = 'Gegevens van de koper';
$strings['PaymentMethods'] = 'Betaal methodes';
$strings['ConfirmOrder'] = 'Bevestig bestelling';
$strings['PurchaseData'] = 'Aankoopgegevens';
$strings['bc_subject'] = 'Bevestiging cursus order';
$strings['PurchaseStatusX'] = 'Aankoop status: %s';
$strings['PendingReasonByTransfer'] = '<b> In afwachting </b>. In afwachting van de overdracht bevestiging';
$strings['CancelOrder'] = 'Annuleer order';
$strings['BankAccountInformation'] = 'Bankgegevens';
$strings['BankAccount'] = 'Bankrekening';
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = 'Eenmaal bevestigd, ontvangt u een e-mail met de bankgegevens en een orderreferentie.';
$strings['SubscriptionToCourseXSuccessful'] = 'Uw aankoop op <a href="%s"><strong>"%s"</strong></a> werd met succes afgerond.';
$strings['OrderCanceled'] = 'Order geannuleerd';
$strings['OrderStatus'] = 'Bestelstatus';
$strings['PayoutStatus'] = 'Betalingsstatus';
$strings['SearchByStatus'] = 'Zoeken op status';
$strings['OrderReference'] = 'Bestelreferentie';
$strings['OrderDate'] = 'Besteldatum';
$strings['OrderPrice'] = 'Bestel prijs';
$strings['ProductType'] = 'Artikel type';
$strings['SubscribeUser'] = 'Onderteken gebruiker';
$strings['DeleteOrder'] = 'Verwijder bestelling';
$strings['ErrorContactPlatformAdmin'] = 'Onbekende fout. Neem contact op met het platform administrator.';
$strings['PendingReasonByAddress'] = '<b>in afwachting</b>. Je hebt een bevestigde verzendadres niet in te voeren.';
$strings['PendingReasonByAuthorization'] = '<b>in afwachting</b>. We hebben nog geen betalingen.';
$strings['PendingReasonByEcheck'] = '<b>in afwachting</b>. De betaling is verricht door een eCheck die nog niet is vrijgemaakt';
$strings['PendingReasonByIntl'] = '<b>in afwachting</b>.We hebben geen terugtrekking mechanisme voor betalingen.';
$strings['PendingReasonByMulticurrency'] = '<b>in afwachting</b>. We hebben niet in evenwicht te brengen in de valuta verzonden.';
$strings['PendingReasonByOrder'] = '<b>in afwachting</b>. Bestelling. We hebben nog geen betalingen.';
$strings['PendingReasonByPaymentReview'] = '<b>in afwachting</b>. De betaling wordt beoordeeld door PayPal voor risico.';
$strings['PendingReasonByRegulatoryReview'] = '<b>in afwachting</b>. De betaling wordt beoordeeld voor de naleving van regelgeving van de overheid.';
$strings['PendingReasonByUnilateral'] = '<b>in afwachting</b>. Het e-mailadres is nog niet geregistreerd of bevestigd.';
$strings['PendingReasonByUpgrade'] = '<b>in afwachting</b>. De betaling werd gedaan via credit card.';
$strings['PendingReasonByVerify'] = '<b>in afwachting</b>. Sorry. We zijn nog niet in Paypal geverifieerd.';
$strings['PendingReasonByOther'] = '<b>in afwachting</b>. Neem contact op met het platform admin.';
$strings['PayPalPaymentOKPleaseConfirm'] = "PayPal rapporteert de transactie nu worden gestart. Om te erkennen dat u op OK om verder te gaan, klikt u op de knop bevestiging hieronder. Eenmaal geklikt, wordt u ingeschreven voor de cursus en het geld zal naar onze winkel worden overgedragen van uw PayPal-rekening. U kunt altijd toegang tot uw cursussen via het tabblad 'Mijn cursussen'. Dank u voor uw aankoop";
$strings['Sandbox'] = "Test omgeving";
$strings['PayPalAccount'] = "Paypal rekening";
$strings['NoPayPalAccountDetected'] = "Geen Paypal account gedetecteerd";
$strings['PayPalConfig'] = "PayPal bevestiging:";
$strings['TransfersConfig'] = "Bank overschrijving bevestiging:";
$strings['PluginInstruction'] = "U kunt de optie in- of uitschakelen om te betalen via PayPal of overschrijving instellen in de configuratie sectie van de plugin.";
$strings['ClickHere'] = "<i>Click here</i> voor meer details";
$strings['CurrencyType'] = "Valuta type";
$strings['InfoCurrency'] = "Stel in de valuta voor de betaling van uw cursussen.";
$strings['ApiUsername'] = "API Gebruikersnaam";
$strings['ApiPassword'] = "API Paswoord";
$strings['ApiSignature'] = "API Handtekening";
$strings['InfoApiCredentials'] = "To generate your API credentials to integrate Chamilo with your PayPal account, you must follow the following steps";
$strings['InfoApiStepOne'] = "Ga naar je PayPal-account, <strong> Overzicht </strong> en <front> verkoper voorkeuren </front> in het <front> Verkoop Tools </front> menu (als je niet dit menu-item hebt, om spullen te verkopen moet u eerst via PayPal om de toestemming te krijgen ).";
$strings['InfoApiStepTwo'] = "In paragraaf <strong> API-toegang </strong>, klikt u op <strong> Bijwerken </strong>";
$strings['InfoApiStepThree'] = "In optie 2 (API Request referenties aan uw eigen API gebruikersnaam en wachtwoord), klikt u op de <strong> Bekijk API Handtekening </strong>, en kopieer de getoonde rechtsaf de Cursusshop plugin vorm referenties";
$strings['ErrorOccurred'] = "<strong> Er is een fout opgetreden </strong>. Code:% s. Bericht:% s. Neem contact op met naar platform admin";
$strings['VisibleInCatalog'] = "Zichtbaar in catalogus";
$strings['Beneficiaries'] = "begunstigden";
$strings['AvailableCourse'] = "beschikbare cursus";
$strings['ShowOnCourseCatalog'] = "Toon op de cursusoverzicht";
$strings['ByStatus'] = "Door de status";
$strings['ByUser'] = "Door de gebruiker";
$strings['PaymentMethod'] = "Betaal methodes";
$strings['SWIFT'] = "SWIFT code";
$strings['SWIFT_help'] = "Standaardformaat van Bank Identifier Codes (BIC) en dient als een unieke identificatiecode voor een bank of financiële instelling";
$strings['Sandbox'] = 'Test omgeving';
$strings['PayPalAccount'] = 'Paypal rekening';
$strings['NoPayPalAccountDetected'] = 'Geen Paypal account gedetecteerd';
$strings['PayPalConfig'] = 'PayPal bevestiging:';
$strings['TransfersConfig'] = 'Bank overschrijving bevestiging:';
$strings['PluginInstruction'] = 'U kunt de optie in- of uitschakelen om te betalen via PayPal of overschrijving instellen in de configuratie sectie van de plugin.';
$strings['ClickHere'] = '<i>Click here</i> voor meer details';
$strings['CurrencyType'] = 'Valuta type';
$strings['InfoCurrency'] = 'Stel in de valuta voor de betaling van uw cursussen.';
$strings['ApiUsername'] = 'API Gebruikersnaam';
$strings['ApiPassword'] = 'API Paswoord';
$strings['ApiSignature'] = 'API Handtekening';
$strings['InfoApiCredentials'] = 'To generate your API credentials to integrate Chamilo with your PayPal account, you must follow the following steps';
$strings['InfoApiStepOne'] = 'Ga naar je PayPal-account, <strong> Overzicht </strong> en <front> verkoper voorkeuren </front> in het <front> Verkoop Tools </front> menu (als je niet dit menu-item hebt, om spullen te verkopen moet u eerst via PayPal om de toestemming te krijgen ).';
$strings['InfoApiStepTwo'] = 'In paragraaf <strong> API-toegang </strong>, klikt u op <strong> Bijwerken </strong>';
$strings['InfoApiStepThree'] = 'In optie 2 (API Request referenties aan uw eigen API gebruikersnaam en wachtwoord), klikt u op de <strong> Bekijk API Handtekening </strong>, en kopieer de getoonde rechtsaf de Cursusshop plugin vorm referenties';
$strings['ErrorOccurred'] = '<strong> Er is een fout opgetreden </strong>. Code:% s. Bericht:% s. Neem contact op met naar platform admin';
$strings['VisibleInCatalog'] = 'Zichtbaar in catalogus';
$strings['Beneficiaries'] = 'begunstigden';
$strings['AvailableCourse'] = 'beschikbare cursus';
$strings['ShowOnCourseCatalog'] = 'Toon op de cursusoverzicht';
$strings['ByStatus'] = 'Door de status';
$strings['ByUser'] = 'Door de gebruiker';
$strings['PaymentMethod'] = 'Betaal methodes';
$strings['SWIFT'] = 'SWIFT code';
$strings['SWIFT_help'] = 'Standaardformaat van Bank Identifier Codes (BIC) en dient als een unieke identificatiecode voor een bank of financiële instelling';

@ -1,191 +1,192 @@
<?php
$strings['plugin_title'] = "Sell courses";
$strings['plugin_comment'] = "Sell courses directly through your Chamilo portal, using a PayPal account to receive funds. Neither the Chamilo association nor the developers involved could be considered responsible of any issue you might suffer using this plugin.";
$strings['show_main_menu_tab'] = "Show tab in main menu";
$strings['show_main_menu_tab_help'] = "In case of not wanting to show the tab, you can create this link in your Chamilo homepage : %s";
$strings['public_main_menu_tab'] = "Show tab in main menu to anonymous users too";
$strings['include_sessions'] = "Include sessions";
$strings['paypal_enable'] = "Enable PayPal";
$strings['commissions_enable'] = "Enable Commissions";
$strings['transfer_enable'] = "Enable bank transfer";
$strings['unregistered_users_enable'] = "Allow anonymous users";
$strings['invoicing_enable'] = "Enable Invoicing";
$strings['tax_enable'] = "Enable Taxation";
$strings['Free'] = "FREE";
$strings['PaypalPayoutCommissions'] = "Paypal Payout Commissions";
$strings['MyPayouts'] = "My payments";
$strings['Commission'] = "Commission";
$strings['Commissions'] = "Commissions";
$strings['SetCommissions'] = "Set commissions";
$strings['CommissionsConfig'] = "Configure Commissions";
$strings['PayoutReport'] = "Payouts report";
$strings['Stats'] = "Statistics";
$strings['InfoCommissions'] = "Enter here the sales commission as a percentage (% ) , the organization that controls the platform. This percentage is deducted from the amount received by teachers for each course or Session sold on the platform.";
$strings['NeedToSelectPaymentType'] = "Need to select payment type";
$strings['IndividualPayout'] = "Individual payout";
$strings['CancelPayout'] = "Cancel payout";
$strings['ContinuePayout'] = "Continue Payout";
$strings['ProceedPayout'] = "Proceed with payment";
$strings['TheActualPlatformCommissionIsX'] = "The current platform commission is <b> %s </b>. This percentage will be discounted from the total product price. The difference will be the amount to apply the following commissions.";
$strings['plugin_title'] = 'Sell courses';
$strings['plugin_comment'] = 'Sell courses directly through your Chamilo portal, using a PayPal account to receive funds. Neither the Chamilo association nor the developers involved could be considered responsible of any issue you might suffer using this plugin.';
$strings['show_main_menu_tab'] = 'Show tab in main menu';
$strings['show_main_menu_tab_help'] = 'In case of not wanting to show the tab, you can create this link in your Chamilo homepage : %s';
$strings['public_main_menu_tab'] = 'Show tab in main menu to anonymous users too';
$strings['include_sessions'] = 'Include sessions';
$strings['paypal_enable'] = 'Enable PayPal';
$strings['commissions_enable'] = 'Enable Commissions';
$strings['transfer_enable'] = 'Enable bank transfer';
$strings['unregistered_users_enable'] = 'Allow anonymous users';
$strings['invoicing_enable'] = 'Enable Invoicing';
$strings['tax_enable'] = 'Enable Taxation';
$strings['Free'] = 'FREE';
$strings['PaypalPayoutCommissions'] = 'Paypal Payout Commissions';
$strings['MyPayouts'] = 'My payments';
$strings['Commission'] = 'Commission';
$strings['Commissions'] = 'Commissions';
$strings['SetCommissions'] = 'Set commissions';
$strings['CommissionsConfig'] = 'Configure Commissions';
$strings['PayoutReport'] = 'Payouts report';
$strings['Stats'] = 'Statistics';
$strings['InfoCommissions'] = 'Enter here the sales commission as a percentage (% ) , the organization that controls the platform. This percentage is deducted from the amount received by teachers for each course or Session sold on the platform.';
$strings['NeedToSelectPaymentType'] = 'Need to select payment type';
$strings['IndividualPayout'] = 'Individual payout';
$strings['CancelPayout'] = 'Cancel payout';
$strings['ContinuePayout'] = 'Continue Payout';
$strings['ProceedPayout'] = 'Proceed with payment';
$strings['TheActualPlatformCommissionIsX'] = 'The current platform commission is <b> %s </b>. This percentage will be discounted from the total product price. The difference will be the amount to apply the following commissions.';
$strings['CoursesInSessionsDoesntDisplayHere'] = "The courses which are inside a training session don't appear in the list of courses to configure as individual products.";
$strings['WantToSellCourses'] = "Do you want to teach and earn some money with your own courses? This list could be filled with your earnings selling courses through this platform. Get in touch with us.";
$strings['SelectOptionToProceed'] = "Select option to proceed";
$strings['WantToSellCourses'] = 'Do you want to teach and earn some money with your own courses? This list could be filled with your earnings selling courses through this platform. Get in touch with us.';
$strings['SelectOptionToProceed'] = 'Select option to proceed';
$strings['VerifyTotalAmountToProceedPayout'] = "Please check the total amount to proceed with the payment of commissions. This amount doesn't take extra costs for PayPal into account. The courses sales that do not count with a Paypal account for the beneficiaries will not be considered.";
$strings['TotalAcounts'] = "Total of accounts:";
$strings['TotalPayout'] = "Total to be paid:";
$strings['PayoutDate'] = "Payment date:";
$strings['CautionThisProcessCantBeCanceled'] = "<b>Caution</b>: this process can take a few minutes and cannot be cancelled.";
$strings['TotalAcounts'] = 'Total of accounts:';
$strings['TotalPayout'] = 'Total to be paid:';
$strings['PayoutDate'] = 'Payment date:';
$strings['CautionThisProcessCantBeCanceled'] = '<b>Caution</b>: this process can take a few minutes and cannot be cancelled.';
$strings['ProcessingPayoutsDontCloseThisWindow'] = "<b>Proceeding with payments. Don't close this window until this process is finalized.</b>";
$strings['PayoutSuccess'] = "Payments processed successfully";
$strings['Buyer'] = "Buyer";
$strings['BankTransfer'] = "Bank transfer";
$strings['SaleInfo'] = "Sale information";
$strings['SaleStatusPending'] = "Sale pending";
$strings['SaleStatusCanceled'] = "Sale canceled";
$strings['SaleStatusCompleted'] = "Sale completed";
$strings['PayoutStatusPending'] = "Payment pending";
$strings['PayoutStatusCanceled'] = "Payment cancelled";
$strings['PayoutStatusCompleted'] = "Payment completed";
$strings['PayoutsTotalPending'] = "Pending payments:";
$strings['PayoutsTotalCanceled'] = "Cancelled payments:";
$strings['PayoutsTotalCompleted'] = "Completed payments:";
$strings['Total'] = "Total";
$strings['TotalAmount'] = "Total amount:";
$strings['CourseListOnSale'] = "List of courses on sale";
$strings['AvailableCourses'] = "Available Courses";
$strings['Price'] = "Price";
$strings['SearchFilter'] = "Search filter";
$strings['MinimumPrice'] = "Minimum price";
$strings['MaximumPrice'] = "Maximum price";
$strings['AvailableCoursesConfiguration'] = "Available courses configuration";
$strings['PaymentsConfiguration'] = "Payments configuration";
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = "You are already registered in the course.";
$strings['SeeDescription'] = "Description";
$strings['Buy'] = "Buy";
$strings['WaitingToReceiveThePayment'] = "Currently pending payment";
$strings['TheUserIsAlreadyRegisteredInTheSession'] = "You are already registered in the session";
$strings['ItemNotSaved'] = "Item not saved";
$strings['TitlePlugin'] = "Everything you need to teach and sell courses online";
$strings['PluginPresentation'] = "The BuyCourses Plugin gives you the means to sell your courses or sessions and teach online, through only a few simple steps and settings. What are you waiting for? Start selling courses through Chamilo LMS!";
$strings['Instructions'] = "Instructions";
$strings['InstructionsStepOne'] = "Create a course or session on the platform.";
$strings['InstructionsStepTwo'] = "In the <strong>payment settings</strong>, set the currency with which you would like to sell your courses or sessions.";
$strings['InstructionsStepThree'] = "Configure courses to sell in the <strong>Courses and prices</strong > settings.";
$strings['BuyCourses'] = "Buy courses";
$strings['ConfigurationOfCoursesAndPrices'] = "Courses and prices configuration";
$strings['SalesReport'] = "Sales report";
$strings['PayoutSuccess'] = 'Payments processed successfully';
$strings['Buyer'] = 'Buyer';
$strings['BankTransfer'] = 'Bank transfer';
$strings['SaleInfo'] = 'Sale information';
$strings['SaleStatusPending'] = 'Sale pending';
$strings['SaleStatusCanceled'] = 'Sale canceled';
$strings['SaleStatusCompleted'] = 'Sale completed';
$strings['PayoutStatusPending'] = 'Payment pending';
$strings['PayoutStatusCanceled'] = 'Payment cancelled';
$strings['PayoutStatusCompleted'] = 'Payment completed';
$strings['PayoutsTotalPending'] = 'Pending payments:';
$strings['PayoutsTotalCanceled'] = 'Cancelled payments:';
$strings['PayoutsTotalCompleted'] = 'Completed payments:';
$strings['Total'] = 'Total';
$strings['TotalAmount'] = 'Total amount:';
$strings['CourseListOnSale'] = 'List of courses on sale';
$strings['AvailableCourses'] = 'Available Courses';
$strings['Price'] = 'Price';
$strings['SearchFilter'] = 'Search filter';
$strings['MinimumPrice'] = 'Minimum price';
$strings['MaximumPrice'] = 'Maximum price';
$strings['AvailableCoursesConfiguration'] = 'Available courses configuration';
$strings['PaymentsConfiguration'] = 'Payments configuration';
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'You are already registered in the course.';
$strings['SeeDescription'] = 'Description';
$strings['Buy'] = 'Buy';
$strings['WaitingToReceiveThePayment'] = 'Currently pending payment';
$strings['TheUserIsAlreadyRegisteredInTheSession'] = 'You are already registered in the session';
$strings['ItemNotSaved'] = 'Item not saved';
$strings['TitlePlugin'] = 'Everything you need to teach and sell courses online';
$strings['PluginPresentation'] = 'The BuyCourses Plugin gives you the means to sell your courses or sessions and teach online, through only a few simple steps and settings. What are you waiting for? Start selling courses through Chamilo LMS!';
$strings['Instructions'] = 'Instructions';
$strings['InstructionsStepOne'] = 'Create a course or session on the platform.';
$strings['InstructionsStepTwo'] = 'In the <strong>payment settings</strong>, set the currency with which you would like to sell your courses or sessions.';
$strings['InstructionsStepThree'] = 'Configure courses to sell in the <strong>Courses and prices</strong > settings.';
$strings['BuyCourses'] = 'Buy courses';
$strings['ConfigurationOfCoursesAndPrices'] = 'Courses and prices configuration';
$strings['SalesReport'] = 'Sales report';
$strings['UserInformation'] = "Buyer's details";
$strings['PaymentMethods'] = "Payment methods";
$strings['ConfirmOrder'] = "Confirm order";
$strings['PurchaseData'] = "Purchase data";
$strings['bc_subject'] = "Confirmation of course order";
$strings['PurchaseStatusX'] = "Purchase status: %s";
$strings['PendingReasonByTransfer'] = "<b>Pending</b>. Awaiting for transfer confirmation";
$strings['CancelOrder'] = "Cancel order";
$strings['BankAccountInformation'] = "Bank account details";
$strings['BankAccount'] = "Bank account";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Once confirmed, you will receive an e-mail with the bank details and an order reference.";
$strings['SubscriptionToCourseXSuccessful'] = "Your subscription to <a href=\"%s\"><strong>\"%s\"</strong></a> was completed successfully.";
$strings['OrderCanceled'] = "Order canceled";
$strings['OrderStatus'] = "Order status";
$strings['PayoutStatus'] = "Payment status";
$strings['SearchByStatus'] = "Search by status";
$strings['OrderReference'] = "Order reference";
$strings['OrderDate'] = "Order date";
$strings['OrderPrice'] = "Order price";
$strings['ProductType'] = "Product type";
$strings['SubscribeUser'] = "Subscribe user";
$strings['DeleteOrder'] = "Delete order";
$strings['ErrorContactPlatformAdmin'] = "Unknown error. Please contact the platform administrator.";
$strings['PendingReasonByAddress'] = "<b>Pending</b>. You did not enter a confirmed shipping address.";
$strings['PendingReasonByAuthorization'] = "<b>Pending</b>. We have not yet captured funds.";
$strings['PendingReasonByEcheck'] = "<b>Pending</b>. The payment was made by an eCheck that has not yet cleared";
$strings['PendingReasonByIntl'] = "<b>Pending</b>. We have no a withdrawal mechanism for funds.";
$strings['PendingReasonByMulticurrency'] = "<b>Pending</b>. We have not balance in the currency sent.";
$strings['PendingReasonByOrder'] = "<b>Pending</b>. Order made. We have not yet captured funds.";
$strings['PendingReasonByPaymentReview'] = "<b>Pending</b>. The payment is being reviewed by PayPal for risk.";
$strings['PendingReasonByRegulatoryReview'] = "<b>Pending</b>. The payment is being reviewed for compliance with government regulations.";
$strings['PendingReasonByUnilateral'] = "<b>Pending</b>. The email address is not yet registered o confirmed.";
$strings['PendingReasonByUpgrade'] = "<b>Pending</b>. The payment was made via credit card.";
$strings['PendingReasonByVerify'] = "<b>Pending</b>. Sorry. We are not yet verified in PayPal.";
$strings['PendingReasonByOther'] = "<b>Pending</b>. Please contact with the platform admin.";
$strings['PaymentMethods'] = 'Payment methods';
$strings['ConfirmOrder'] = 'Confirm order';
$strings['PurchaseData'] = 'Purchase data';
$strings['bc_subject'] = 'Confirmation of course order';
$strings['PurchaseStatusX'] = 'Purchase status: %s';
$strings['PendingReasonByTransfer'] = '<b>Pending</b>. Awaiting for transfer confirmation';
$strings['CancelOrder'] = 'Cancel order';
$strings['BankAccountInformation'] = 'Bank account details';
$strings['BankAccount'] = 'Bank account';
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = 'Once confirmed, you will receive an e-mail with the bank details and an order reference.';
$strings['SubscriptionToCourseXSuccessful'] = 'Your subscription to <a href="%s"><strong>"%s"</strong></a> was completed successfully.';
$strings['OrderCanceled'] = 'Order canceled';
$strings['OrderStatus'] = 'Order status';
$strings['PayoutStatus'] = 'Payment status';
$strings['SearchByStatus'] = 'Search by status';
$strings['OrderReference'] = 'Order reference';
$strings['OrderDate'] = 'Order date';
$strings['OrderPrice'] = 'Order price';
$strings['ProductType'] = 'Product type';
$strings['SubscribeUser'] = 'Subscribe user';
$strings['DeleteOrder'] = 'Delete order';
$strings['ErrorContactPlatformAdmin'] = 'Unknown error. Please contact the platform administrator.';
$strings['PendingReasonByAddress'] = '<b>Pending</b>. You did not enter a confirmed shipping address.';
$strings['PendingReasonByAuthorization'] = '<b>Pending</b>. We have not yet captured funds.';
$strings['PendingReasonByEcheck'] = '<b>Pending</b>. The payment was made by an eCheck that has not yet cleared';
$strings['PendingReasonByIntl'] = '<b>Pending</b>. We have no a withdrawal mechanism for funds.';
$strings['PendingReasonByMulticurrency'] = '<b>Pending</b>. We have not balance in the currency sent.';
$strings['PendingReasonByOrder'] = '<b>Pending</b>. Order made. We have not yet captured funds.';
$strings['PendingReasonByPaymentReview'] = '<b>Pending</b>. The payment is being reviewed by PayPal for risk.';
$strings['PendingReasonByRegulatoryReview'] = '<b>Pending</b>. The payment is being reviewed for compliance with government regulations.';
$strings['PendingReasonByUnilateral'] = '<b>Pending</b>. The email address is not yet registered o confirmed.';
$strings['PendingReasonByUpgrade'] = '<b>Pending</b>. The payment was made via credit card.';
$strings['PendingReasonByVerify'] = '<b>Pending</b>. Sorry. We are not yet verified in PayPal.';
$strings['PendingReasonByOther'] = '<b>Pending</b>. Please contact with the platform admin.';
$strings['PayPalPaymentOKPleaseConfirm'] = "PayPal reports the transaction is ready to be executed. To acknowledge that you are OK to proceed, please click the confirmation button below. Once clicked, you will be registered to the course and the funds will be transferred from your PayPal account to our shop. You can always access your courses through the 'My courses' tab. Thank you for your custom!";
$strings['Sandbox'] = "Test environment";
$strings['PayPalAccount'] = "Paypal account";
$strings['NoPayPalAccountDetected'] = "No Paypal account detected";
$strings['PayPalConfig'] = "PayPal configuration:";
$strings['TransfersConfig'] = "Bank transfers configuration:";
$strings['PluginInstruction'] = "You can enable or disable the option to pay via PayPal, Culqi or bank transfer settings in the configuration section of the plugin.";
$strings['ClickHere'] = "<i>Click here</i> for more details";
$strings['CurrencyType'] = "Currency type";
$strings['InfoCurrency'] = "Sets the currency for the payment of your courses.";
$strings['ApiUsername'] = "API Username";
$strings['ApiPassword'] = "API Password";
$strings['ApiSignature'] = "API Signature";
$strings['InfoApiCredentials'] = "To generate your API credentials to integrate Chamilo with your PayPal account, you must follow the following steps";
$strings['InfoApiStepOne'] = "Go to your PayPal account, <strong>Summary</strong>, then <front>Seller preferences</front> in the <front>Selling Tools</front> menu (if you do not have this menu entry, you might need to get the authorization to sell stuff through PayPal first).";
$strings['InfoApiStepTwo'] = "In paragraph <strong>API access</strong>, click <strong>Update</strong>";
$strings['InfoApiStepThree'] = "In Option 2 (Request API credentials to create your own API username and password), click the <strong>View API Signature</strong> link, and copy the credentials shown right into the BuyCourses plugin form";
$strings['ErrorOccurred'] = "<strong>An error ocurred</strong>. Code: %s. Message: %s. Please contact to platform admin";
$strings['VisibleInCatalog'] = "Visible in catalog";
$strings['Beneficiaries'] = "Beneficiaries";
$strings['AvailableCourse'] = "Available course";
$strings['ShowOnCourseCatalog'] = "Show on course catalog";
$strings['ByStatus'] = "By status";
$strings['ByUser'] = "By user";
$strings['PaymentMethod'] = "Payment method";
$strings['SWIFT'] = "SWIFT code";
$strings['SWIFT_help'] = "Standard format of Bank Identifier Codes (BIC) and serves as a unique identifier for a bank or financial institution";
$strings['PleaseSelectThePaymentMethodBeforeConfirmYourOrder'] = "Please select your favorite payment method before confirming your order";
$strings['Sandbox'] = 'Test environment';
$strings['PayPalAccount'] = 'Paypal account';
$strings['NoPayPalAccountDetected'] = 'No Paypal account detected';
$strings['PayPalConfig'] = 'PayPal configuration:';
$strings['TransfersConfig'] = 'Bank transfers configuration:';
$strings['PluginInstruction'] = 'You can enable or disable the option to pay via PayPal, Culqi or bank transfer settings in the configuration section of the plugin.';
$strings['ClickHere'] = '<i>Click here</i> for more details';
$strings['CurrencyType'] = 'Currency type';
$strings['InfoCurrency'] = 'Sets the currency for the payment of your courses.';
$strings['ApiUsername'] = 'API Username';
$strings['ApiPassword'] = 'API Password';
$strings['ApiSignature'] = 'API Signature';
$strings['InfoApiCredentials'] = 'To generate your API credentials to integrate Chamilo with your PayPal account, you must follow the following steps';
$strings['InfoApiStepOne'] = 'Go to your PayPal account, <strong>Summary</strong>, then <front>Seller preferences</front> in the <front>Selling Tools</front> menu (if you do not have this menu entry, you might need to get the authorization to sell stuff through PayPal first).';
$strings['InfoApiStepTwo'] = 'In paragraph <strong>API access</strong>, click <strong>Update</strong>';
$strings['InfoApiStepThree'] = 'In Option 2 (Request API credentials to create your own API username and password), click the <strong>View API Signature</strong> link, and copy the credentials shown right into the BuyCourses plugin form';
$strings['ErrorOccurred'] = '<strong>An error ocurred</strong>. Code: %s. Message: %s. Please contact to platform admin';
$strings['VisibleInCatalog'] = 'Visible in catalog';
$strings['Beneficiaries'] = 'Beneficiaries';
$strings['AvailableCourse'] = 'Available course';
$strings['ShowOnCourseCatalog'] = 'Show on course catalog';
$strings['ByStatus'] = 'By status';
$strings['ByUser'] = 'By user';
$strings['PaymentMethod'] = 'Payment method';
$strings['SWIFT'] = 'SWIFT code';
$strings['SWIFT_help'] = 'Standard format of Bank Identifier Codes (BIC) and serves as a unique identifier for a bank or financial institution';
$strings['PleaseSelectThePaymentMethodBeforeConfirmYourOrder'] = 'Please select your favorite payment method before confirming your order';
$strings['NoPaymentOptionAvailable'] = 'No payment option available. Please report to the administrator.';
$strings['XIsOnlyPaymentMethodAvailable'] = '%s is the only payment method available for this purchase.';
$strings['hide_free_text'] = "Hide 'Free' text";
$strings['culqi_enable'] = "Enable culqi";
$strings['include_services'] = "Include services";
$strings['CurrencyIsNotConfigured'] = "Please, configure a currency before continuing.";
$strings['Services'] = "Services";
$strings['ServiceName'] = "Service name";
$strings['AppliesTo'] = "Applies to";
$strings['ListOfServicesOnSale'] = "List of services on sale";
$strings['GlobalConfig'] = "Global configuration";
$strings['WriteHereTheTermsAndConditionsOfYourECommerce'] = "Write here the terms and conditions of your e-commerce";
$strings['NewService'] = "New service";
$strings['Service'] = "Service";
$strings['ServiceInformation'] = "Service information";
$strings['EditService'] = "Edit service";
$strings['DeleteThisService'] = "Delete this service";
$strings['IConfirmIReadAndAcceptTermsAndCondition'] = "I confirm I read and accept the terms and conditions";
$strings['PleaseSelectTheCorrectInfoToApplyTheService'] = "Please select the correct info to apply the service";
$strings['SaleStatusCancelled'] = "Sale cancelled";
$strings['ServiceSaleInfo'] = "Service sale info";
$strings['ServiceId'] = "Service Id";
$strings['BoughtBy'] = "Bought by";
$strings['PurchaserUser'] = "Purchaser user";
$strings['Pending'] = "Pending";
$strings['Names'] = "Names";
$strings['SellerName'] = "Seller name";
$strings['SellerId'] = "Seller id";
$strings['SellerAddress'] = "Seller address";
$strings['SellerEmail'] = "Seller e-mail";
$strings['NextNumberInvoice'] = "Next invoice number";
$strings['NextNumberInvoiceDescription'] = "Number of the following invoice";
$strings['InvoiceSeries'] = "Invoice series";
$strings['InvoiceSeriesDescription'] = "Optional parameter: Example invoice Id &lt;series&gt;&lt;year&gt;/&lt;number&gt;";
$strings['InvoiceView'] = "View invoice";
$strings['NoInvoiceEnable'] = "No invoicing block enable";
$strings['Company'] = "Company";
$strings['VAT'] = "VAT";
$strings['Address'] = "Address";
$strings['InvoiceNumber'] = "Invoice number";
$strings['InvoiceDate'] = "Invoice date";
$strings['Invoice'] = "Invoice";
$strings['SaleEmail'] = "Sales e-mail";
$strings['PurchaseDetailsIntro'] = "Purchase details";
$strings['PurchaseDetailsEnd'] = "Regards";
$strings['ProductName'] = "Product name";
$strings['BankAccountIntro'] = "Bank Account Info";
$strings['culqi_enable'] = 'Enable culqi';
$strings['include_services'] = 'Include services';
$strings['CurrencyIsNotConfigured'] = 'Please, configure a currency before continuing.';
$strings['Services'] = 'Services';
$strings['ServiceName'] = 'Service name';
$strings['AppliesTo'] = 'Applies to';
$strings['ListOfServicesOnSale'] = 'List of services on sale';
$strings['GlobalConfig'] = 'Global configuration';
$strings['WriteHereTheTermsAndConditionsOfYourECommerce'] = 'Write here the terms and conditions of your e-commerce';
$strings['NewService'] = 'New service';
$strings['Service'] = 'Service';
$strings['ServiceInformation'] = 'Service information';
$strings['EditService'] = 'Edit service';
$strings['DeleteThisService'] = 'Delete this service';
$strings['IConfirmIReadAndAcceptTermsAndCondition'] = 'I confirm I read and accept the terms and conditions';
$strings['PleaseSelectTheCorrectInfoToApplyTheService'] = 'Please select the correct info to apply the service';
$strings['SaleStatusCancelled'] = 'Sale cancelled';
$strings['ServiceSaleInfo'] = 'Service sale info';
$strings['ServiceId'] = 'Service Id';
$strings['BoughtBy'] = 'Bought by';
$strings['PurchaserUser'] = 'Purchaser user';
$strings['Pending'] = 'Pending';
$strings['Names'] = 'Names';
$strings['SellerName'] = 'Seller name';
$strings['SellerId'] = 'Seller id';
$strings['SellerAddress'] = 'Seller address';
$strings['SellerEmail'] = 'Seller e-mail';
$strings['NextNumberInvoice'] = 'Next invoice number';
$strings['NextNumberInvoiceDescription'] = 'Number of the following invoice';
$strings['InvoiceSeries'] = 'Invoice series';
$strings['InvoiceSeriesDescription'] = 'Optional parameter: Example invoice Id &lt;series&gt;&lt;year&gt;/&lt;number&gt;';
$strings['InvoiceView'] = 'View invoice';
$strings['NoInvoiceEnable'] = 'No invoicing block enable';
$strings['Company'] = 'Company';
$strings['VAT'] = 'VAT';
$strings['Address'] = 'Address';
$strings['InvoiceNumber'] = 'Invoice number';
$strings['InvoiceDate'] = 'Invoice date';
$strings['Invoice'] = 'Invoice';
$strings['SaleEmail'] = 'Sales e-mail';
$strings['PurchaseDetailsIntro'] = 'Purchase details';
$strings['PurchaseDetailsEnd'] = 'Regards';
$strings['ProductName'] = 'Product name';
$strings['BankAccountIntro'] = 'Bank Account Info';
$strings['AdditionalInfoRequired'] = 'More information needed';
$strings['SubscriptionToServiceXSuccessful'] = "Subscription to service %s completed.";
$strings['ClickHereToFinish'] = "Click here to finish";
$strings['OrderCancelled'] = "Order cancelled";
$strings['use_currency_symbol'] = "Use currency symbol";
$strings['SubscriptionToServiceXSuccessful'] = 'Subscription to service %s completed.';
$strings['ClickHereToFinish'] = 'Click here to finish';
$strings['OrderCancelled'] = 'Order cancelled';
$strings['use_currency_symbol'] = 'Use currency symbol';

@ -1,163 +1,164 @@
<?php
$strings['plugin_title'] = "Vente de cours";
$strings['plugin_title'] = 'Vente de cours';
$strings['plugin_comment'] = "Vendez vos cours directement depuis votre portail Chamilo, au travers d'un compte PayPal. Ni l'association Chamilo ni les développeurs impliqués dans le développement de ce plugin ne sauraient être tenus responsables d'un quelconque inconvénient causé par celui-ci.";
$strings['show_main_menu_tab'] = "Montrer l'onglet dans le menu principal";
$strings['show_main_menu_tab_help'] = "Dans le cas où vous ne souhaitez pas montrer l'onglet, il est possible de rajouter le lien suivant à votre portail Chamilo: %s";
$strings['include_sessions'] = "Inclure les sessions";
$strings['paypal_enable'] = "Activer PayPal";
$strings['commissions_enable'] = "Activer commissions";
$strings['transfer_enable'] = "Activer les transferts bancaires";
$strings['include_sessions'] = 'Inclure les sessions';
$strings['paypal_enable'] = 'Activer PayPal';
$strings['commissions_enable'] = 'Activer commissions';
$strings['transfer_enable'] = 'Activer les transferts bancaires';
$strings['unregistered_users_enable'] = "Permettre l'accès aux utilisateurs non enregistrés sur la plateforme";
$strings['Free'] = "GRATUIT";
$strings['Free'] = 'GRATUIT';
$strings['PaypalPayoutCommissions'] = "Commissions PayPal Payouts";
$strings['MyPayouts'] = "Mes paiements";
$strings['Commission'] = "Commission";
$strings['Commissions'] = "Commissions";
$strings['SetCommissions'] = "Établir commissions";
$strings['CommissionsConfig'] = "Configurer Commissions";
$strings['PayoutReport'] = "Rapport de paiements";
$strings['Stats'] = "Statistiques";
$strings['PaypalPayoutCommissions'] = 'Commissions PayPal Payouts';
$strings['MyPayouts'] = 'Mes paiements';
$strings['Commission'] = 'Commission';
$strings['Commissions'] = 'Commissions';
$strings['SetCommissions'] = 'Établir commissions';
$strings['CommissionsConfig'] = 'Configurer Commissions';
$strings['PayoutReport'] = 'Rapport de paiements';
$strings['Stats'] = 'Statistiques';
$strings['InfoCommissions'] = "Saisissez ici la commission de vente en pourcentage ( % ) , l'organisation qui contrôle la plate-forme . Ce pourcentage est déduit du montant reçu par les enseignants pour chaque cours ou session vendus sur la plate-forme.";
$strings['NeedToSelectPaymentType'] = "Besoin pour sélectionner le type de paiement";
$strings['IndividualPayout'] = "Paiement individuel";
$strings['CancelPayout'] = "Annuler paiement";
$strings['ContinuePayout'] = "Continuer paiement";
$strings['ProceedPayout'] = "Confirmer le paiement";
$strings['TheActualPlatformCommissionIsX'] = "La commission de la plateforme est actuellement établie à <b> %s </b>. Ce pourcentage sera soustrait du prix total du produit. La différence sera répartie selon les commissions définies ci-dessous.";
$strings['NeedToSelectPaymentType'] = 'Besoin pour sélectionner le type de paiement';
$strings['IndividualPayout'] = 'Paiement individuel';
$strings['CancelPayout'] = 'Annuler paiement';
$strings['ContinuePayout'] = 'Continuer paiement';
$strings['ProceedPayout'] = 'Confirmer le paiement';
$strings['TheActualPlatformCommissionIsX'] = 'La commission de la plateforme est actuellement établie à <b> %s </b>. Ce pourcentage sera soustrait du prix total du produit. La différence sera répartie selon les commissions définies ci-dessous.';
$strings['CoursesInSessionsDoesntDisplayHere'] = "Les cours qui se trouvent dans une session n'apparaissent pas dans la liste de cours individuels.";
$strings['WantToSellCourses'] = "Envie d'enseigner et de gagner un peu d'argent avec vos propres cours? Cette liste pourraît être pleine de ventes de vos cours. Contactez-nous.";
$strings['SelectOptionToProceed'] = "Sélectionnez une option pour continuer";
$strings['SelectOptionToProceed'] = 'Sélectionnez une option pour continuer';
$strings['VerifyTotalAmountToProceedPayout'] = "Veuillez vérifier le montant total avant de continuer le paiement des commissions. Ce montant ne prend pas en compte le coût additionnel éventuellement perçu par PayPal. Les ventes de cours pour lesquelles les bénéficiaires n'ont pas de compte PayPal configuré ne seront pas prises en compte.";
$strings['TotalAcounts'] = "Total des comptes:";
$strings['TotalPayout'] = "Total à payer:";
$strings['PayoutDate'] = "Date de paiement:";
$strings['CautionThisProcessCantBeCanceled'] = "<b>Attention</b>: ce processus peut prendre quelques minutes et ne peut pas être interrompu.";
$strings['ProcessingPayoutsDontCloseThisWindow'] = "<b>Exécution des paiements. Ne fermez pas cette fenêtre avant que le processus ne soit finalisé.</b>";
$strings['PayoutSuccess'] = "Paiements effectués avec succès";
$strings['Buyer'] = "Acheteur";
$strings['BankTransfer'] = "Transfert bancaire";
$strings['SaleInfo'] = "Information vente";
$strings['SaleStatusPending'] = "Vente non confirmée";
$strings['SaleStatusCanceled'] = "Vente annulée";
$strings['SaleStatusCompleted'] = "Vente finalisée";
$strings['PayoutStatusPending'] = "Paiement en attente";
$strings['PayoutStatusCanceled'] = "Paiement annulé";
$strings['PayoutStatusCompleted'] = "Paiement complété";
$strings['PayoutsTotalPending'] = "Paiements en attente:";
$strings['PayoutsTotalCanceled'] = "Paiements annulés:";
$strings['PayoutsTotalCompleted'] = "Paiements complétés:";
$strings['TotalAmount'] = "Montant total:";
$strings['CourseListOnSale'] = "Liste de cours en vente";
$strings['AvailableCourses'] = "Cours disponibles";
$strings['Price'] = "Prix";
$strings['SearchFilter'] = "Filtre de recherche";
$strings['MinimumPrice'] = "Prix minimum";
$strings['MaximumPrice'] = "Prix maximum";
$strings['AvailableCoursesConfiguration'] = "Configuration des cours disponibles";
$strings['PaymentsConfiguration'] = "Configuration des paiements";
$strings['TotalAcounts'] = 'Total des comptes:';
$strings['TotalPayout'] = 'Total à payer:';
$strings['PayoutDate'] = 'Date de paiement:';
$strings['CautionThisProcessCantBeCanceled'] = '<b>Attention</b>: ce processus peut prendre quelques minutes et ne peut pas être interrompu.';
$strings['ProcessingPayoutsDontCloseThisWindow'] = '<b>Exécution des paiements. Ne fermez pas cette fenêtre avant que le processus ne soit finalisé.</b>';
$strings['PayoutSuccess'] = 'Paiements effectués avec succès';
$strings['Buyer'] = 'Acheteur';
$strings['BankTransfer'] = 'Transfert bancaire';
$strings['SaleInfo'] = 'Information vente';
$strings['SaleStatusPending'] = 'Vente non confirmée';
$strings['SaleStatusCanceled'] = 'Vente annulée';
$strings['SaleStatusCompleted'] = 'Vente finalisée';
$strings['PayoutStatusPending'] = 'Paiement en attente';
$strings['PayoutStatusCanceled'] = 'Paiement annulé';
$strings['PayoutStatusCompleted'] = 'Paiement complété';
$strings['PayoutsTotalPending'] = 'Paiements en attente:';
$strings['PayoutsTotalCanceled'] = 'Paiements annulés:';
$strings['PayoutsTotalCompleted'] = 'Paiements complétés:';
$strings['TotalAmount'] = 'Montant total:';
$strings['CourseListOnSale'] = 'Liste de cours en vente';
$strings['AvailableCourses'] = 'Cours disponibles';
$strings['Price'] = 'Prix';
$strings['SearchFilter'] = 'Filtre de recherche';
$strings['MinimumPrice'] = 'Prix minimum';
$strings['MaximumPrice'] = 'Prix maximum';
$strings['AvailableCoursesConfiguration'] = 'Configuration des cours disponibles';
$strings['PaymentsConfiguration'] = 'Configuration des paiements';
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = "L'utilisateur est déjà inscrit au cours";
$strings['SeeDescription'] = "Voir description";
$strings['Buy'] = "Acheter";
$strings['WaitingToReceiveThePayment'] = "En attente de réception du paiement";
$strings['TheUserIsAlreadyRegisteredInTheSession'] = "Vous êtes déjà inscrit à cette session";
$strings['ItemNotSaved'] = "Article non sauvé";
$strings['TitlePlugin'] = "Tout le nécessaire pour enseigner et vendre des cours en ligne";
$strings['SeeDescription'] = 'Voir description';
$strings['Buy'] = 'Acheter';
$strings['WaitingToReceiveThePayment'] = 'En attente de réception du paiement';
$strings['TheUserIsAlreadyRegisteredInTheSession'] = 'Vous êtes déjà inscrit à cette session';
$strings['ItemNotSaved'] = 'Article non sauvé';
$strings['TitlePlugin'] = 'Tout le nécessaire pour enseigner et vendre des cours en ligne';
$strings['PluginPresentation'] = "Le plugin BuyCourses vous donne les moyens nécessaires pour vendre vos cours ou vos sessions existants et d'enseigner en ligne, en quelques étapes très simples. Qu'attendez-vous? Commencez à vendre des cours grâce à Chamilo dès maintenant!";
$strings['Instructions'] = "Instructions d'utilisation";
$strings['InstructionsStepOne'] = "Créer un cours ou une session de formation sur la plateforme.";
$strings['InstructionsStepTwo'] = "Dans la section <strong>configuration de paiements</strong>, configurer le type de devise dans lequel vous souhaitez vendre vos cours et sessions";
$strings['InstructionsStepThree'] = "Configurer les cours à vendre dans la section <strong>Configuration de cours et prix</strong>";
$strings['BuyCourses'] = "Acheter des cours";
$strings['ConfigurationOfCoursesAndPrices'] = "Configuration des cours et prix";
$strings['SalesReport'] = "Rapport des ventes";
$strings['UserInformation'] = "Fiche acheteur";
$strings['PaymentMethods'] = "Méthodes de paiement";
$strings['ConfirmOrder'] = "Confirmer commande";
$strings['InstructionsStepOne'] = 'Créer un cours ou une session de formation sur la plateforme.';
$strings['InstructionsStepTwo'] = 'Dans la section <strong>configuration de paiements</strong>, configurer le type de devise dans lequel vous souhaitez vendre vos cours et sessions';
$strings['InstructionsStepThree'] = 'Configurer les cours à vendre dans la section <strong>Configuration de cours et prix</strong>';
$strings['BuyCourses'] = 'Acheter des cours';
$strings['ConfigurationOfCoursesAndPrices'] = 'Configuration des cours et prix';
$strings['SalesReport'] = 'Rapport des ventes';
$strings['UserInformation'] = 'Fiche acheteur';
$strings['PaymentMethods'] = 'Méthodes de paiement';
$strings['ConfirmOrder'] = 'Confirmer commande';
$strings['PurchaseData'] = "Détails d'achat";
$strings['bc_subject'] = "Confirmation de commande de cours";
$strings['PurchaseStatusX'] = "État de la vente: %s";
$strings['PendingReasonByTransfer'] = "<b>En attente</b>. Transfert pas encore confirmé";
$strings['CancelOrder'] = "Annuler la commande";
$strings['BankAccountInformation'] = "Détails du compte bancaire";
$strings['BankAccount'] = "Compte bancaire";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Une fois confirmée, vous recevrez un e-mail avec les données bancaires et la référence de la commande";
$strings['SubscriptionToCourseXSuccessful'] = "Votre inscription au <a href=\"%s\"><strong>\"%s\"</strong></a> est terminée.";
$strings['OrderCanceled'] = "Commande annulée";
$strings['OrderStatus'] = "Statut de commande";
$strings['PayoutStatus'] = "État du paiement";
$strings['SearchByStatus'] = "Recherche par statut";
$strings['OrderReference'] = "Référence de la commande";
$strings['OrderDate'] = "Date de commande";
$strings['OrderPrice'] = "Commande Prix";
$strings['ProductType'] = "Type de produit";
$strings['SubscribeUser'] = "Inscrire utilisateur";
$strings['DeleteOrder'] = "Éliminer la commande";
$strings['bc_subject'] = 'Confirmation de commande de cours';
$strings['PurchaseStatusX'] = 'État de la vente: %s';
$strings['PendingReasonByTransfer'] = '<b>En attente</b>. Transfert pas encore confirmé';
$strings['CancelOrder'] = 'Annuler la commande';
$strings['BankAccountInformation'] = 'Détails du compte bancaire';
$strings['BankAccount'] = 'Compte bancaire';
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = 'Une fois confirmée, vous recevrez un e-mail avec les données bancaires et la référence de la commande';
$strings['SubscriptionToCourseXSuccessful'] = 'Votre inscription au <a href="%s"><strong>"%s"</strong></a> est terminée.';
$strings['OrderCanceled'] = 'Commande annulée';
$strings['OrderStatus'] = 'Statut de commande';
$strings['PayoutStatus'] = 'État du paiement';
$strings['SearchByStatus'] = 'Recherche par statut';
$strings['OrderReference'] = 'Référence de la commande';
$strings['OrderDate'] = 'Date de commande';
$strings['OrderPrice'] = 'Commande Prix';
$strings['ProductType'] = 'Type de produit';
$strings['SubscribeUser'] = 'Inscrire utilisateur';
$strings['DeleteOrder'] = 'Éliminer la commande';
$strings['ErrorContactPlatformAdmin'] = "Une erreur inconnue s'est produite. Veuillez contacter l'administrateur de la plateforme.";
$strings['PendingReasonByAddress'] = "<b>En attente</b>. Il manque une adresse de livraison.";
$strings['PendingReasonByAddress'] = '<b>En attente</b>. Il manque une adresse de livraison.';
$strings['PendingReasonByAuthorization'] = "<b>En attente</b>. Nous n'avons pas confirmé la réception des fonds.";
$strings['PendingReasonByEcheck'] = "<b>En attente</b>. Le paiement a été fait via un chèque qui n'a pas encore été libéré";
$strings['PendingReasonByIntl'] = "<b>En attente</b>. Aucun moyen de toucher les fonds.";
$strings['PendingReasonByIntl'] = '<b>En attente</b>. Aucun moyen de toucher les fonds.';
$strings['PendingReasonByMulticurrency'] = "<b>En attente</b>. Nous n'avons pas de compte dans la devise indiquée.";
$strings['PendingReasonByOrder'] = "<b>En attente</b>. Commande enregistrée. Les fonds n'ont pas encore été libérés.";
$strings['PendingReasonByPaymentReview'] = "<b>En attente</b>. Le paiement est en révision anti-fraude chez PayPal.";
$strings['PendingReasonByRegulatoryReview'] = "<b>En attente</b>. Le paiement est actuellement revu pour correspondre aux règles mises en vigueur par le gouvernement.";
$strings['PendingReasonByPaymentReview'] = '<b>En attente</b>. Le paiement est en révision anti-fraude chez PayPal.';
$strings['PendingReasonByRegulatoryReview'] = '<b>En attente</b>. Le paiement est actuellement revu pour correspondre aux règles mises en vigueur par le gouvernement.';
$strings['PendingReasonByUnilateral'] = "<b>En attente</b>. L'adresse e-mail n'est pas encore confirmée ou enregistrée.";
$strings['PendingReasonByUpgrade'] = "<b>En attente</b>. Le paiement a été fait par carte de crédit.";
$strings['PendingReasonByUpgrade'] = '<b>En attente</b>. Le paiement a été fait par carte de crédit.';
$strings['PendingReasonByVerify'] = "<b>En attente</b>. Désolé, nous n'avons pas encore vérifié sur PayPal.";
$strings['PendingReasonByOther'] = "<b>En attente</b>. Veuillez contacter l'administrateur.";
$strings['PayPalPaymentOKPleaseConfirm'] = "PayPal nous indique que la transaction est prête à être exécutée. Par mesure de sécurité, nous vous demandons de bien vouloir confirmer une dernière fois la transaction en cliquant sur le bouton de confirmation ci-dessous. Une fois cliqué, vous serez immédiatement enregistré au cours, et les fonds correspondants seront soustraits de votre compte PayPal. Vous pouvez accéder à vos cours à tout moment à partir de l'onglet 'Mes cours'. Merci de votre fidélité!";
$strings['Sandbox'] = "Environnement de test";
$strings['PayPalAccount'] = "Compte Paypal";
$strings['NoPayPalAccountDetected'] = "Pas de compte paypal détecté";
$strings['PayPalConfig'] = "Configuration PayPal:";
$strings['TransfersConfig'] = "Configuration des transfers bancaires:";
$strings['Sandbox'] = 'Environnement de test';
$strings['PayPalAccount'] = 'Compte Paypal';
$strings['NoPayPalAccountDetected'] = 'Pas de compte paypal détecté';
$strings['PayPalConfig'] = 'Configuration PayPal:';
$strings['TransfersConfig'] = 'Configuration des transfers bancaires:';
$strings['PluginInstruction'] = "Vous pouvez activer ou désactiver l'option de paiements via PayPal, Culqi ou de transferts bancaires dans la section de configuration des plugins.";
$strings['ClickHere'] = "Cliquez ici pour plus d'infos";
$strings['CurrencyType'] = "Type de devise";
$strings['CurrencyType'] = 'Type de devise';
$strings['InfoCurrency'] = "Permet de configurer la devise pour l'achat des cours.";
$strings['ApiUsername'] = "Nom d'utilisateur de l'API";
$strings['ApiPassword'] = "Mot de passe de l'API";
$strings['ApiSignature'] = "Signature de l'API";
$strings['InfoApiCredentials'] = "Pour générer vos données API pour intégrer votre compte PayPal à Chamilo, il vous faudra suivre les étapes suivantes";
$strings['InfoApiCredentials'] = 'Pour générer vos données API pour intégrer votre compte PayPal à Chamilo, il vous faudra suivre les étapes suivantes';
$strings['InfoApiStepOne'] = "Aller dans l'option <strong>profil</strong> de PayPal, et ensuite dans <strong>Outils de vente</strong>";
$strings['InfoApiStepTwo'] = "Dans la section <strong>API d'accès</strong>, cliquer sur l'option <strong>Mettre à jour</strong>";
$strings['InfoApiStepThree'] = "Dans l'option 2 de Configuration des données et permissions API, cliquer sur <strong>Voir signature API</strong>. Copier ces donées dans le formulaire de configuration de ce plugin";
$strings['ErrorOccurred'] = "<strong>Une erreur est survenue</strong>. Code: %s. Message: %s. Veuillez contacter l'administrateur de la plateforme";
$strings['VisibleInCatalog'] = "Visible dans le catalogue";
$strings['Beneficiaries'] = "Bénéficiaires";
$strings['AvailableCourse'] = "Cours disponibles";
$strings['ShowOnCourseCatalog'] = "Afficher dans le catalogue de cours";
$strings['ByStatus'] = "Par statut";
$strings['ByUser'] = "Par utilisateur";
$strings['PaymentMethod'] = "Méthodes de paiement";
$strings['SWIFT'] = "Code SWIFT";
$strings['VisibleInCatalog'] = 'Visible dans le catalogue';
$strings['Beneficiaries'] = 'Bénéficiaires';
$strings['AvailableCourse'] = 'Cours disponibles';
$strings['ShowOnCourseCatalog'] = 'Afficher dans le catalogue de cours';
$strings['ByStatus'] = 'Par statut';
$strings['ByUser'] = 'Par utilisateur';
$strings['PaymentMethod'] = 'Méthodes de paiement';
$strings['SWIFT'] = 'Code SWIFT';
$strings['SWIFT_help'] = "Format standard des codes d'identification de banque (BIC) et sert un identifiant unique pour une banque ou une institution financière.";
$strings['PleaseSelectThePaymentMethodBeforeConfirmYourOrder'] = 'Veuillez sélectionner votre méthode de paiement préférée avant de confirmer';
$strings['NoPaymentOptionAvailable'] = 'Aucune méthode de paiement disponible. Merci de bien vouloir rapporter ce problème à l\'administrateur.';
$strings['XIsOnlyPaymentMethodAvailable'] = '%s est la seule méthode de paiement disponible pour cet achat.';
$strings['public_main_menu_tab'] = "Montrer l'onglet dans le menu principal aux utilisateurs anonyme également";
$strings['culqi_enable'] = "Activé culqi";
$strings['include_services'] = "Inclure les services";
$strings['culqi_enable'] = 'Activé culqi';
$strings['include_services'] = 'Inclure les services';
$strings['hide_free_text'] = "Cacher le texte 'Free' ou 'Gratuit'";
$strings['Services'] = "Services";
$strings['ServiceName'] = "Nom du service";
$strings['Services'] = 'Services';
$strings['ServiceName'] = 'Nom du service';
$strings['AppliesTo'] = "S'applique à";
$strings['ListOfServicesOnSale'] = "Liste de services en vente";
$strings['GlobalConfig'] = "Configuration globale";
$strings['WriteHereTheTermsAndConditionsOfYourECommerce'] = "Écrire les conditions de ventes de votre e-commerce";
$strings['NewService'] = "Nouveau service";
$strings['Service'] = "Service";
$strings['ServiceInformation'] = "Information sur le service";
$strings['EditService'] = "Edition du service";
$strings['DeleteThisService'] = "Supprimer ce service";
$strings['ListOfServicesOnSale'] = 'Liste de services en vente';
$strings['GlobalConfig'] = 'Configuration globale';
$strings['WriteHereTheTermsAndConditionsOfYourECommerce'] = 'Écrire les conditions de ventes de votre e-commerce';
$strings['NewService'] = 'Nouveau service';
$strings['Service'] = 'Service';
$strings['ServiceInformation'] = 'Information sur le service';
$strings['EditService'] = 'Edition du service';
$strings['DeleteThisService'] = 'Supprimer ce service';
$strings['IConfirmIReadAndAcceptTermsAndCondition'] = "Je confirme que j'ai lu et que j'accepte les termes et conditions";
$strings['PleaseSelectTheCorrectInfoToApplyTheService'] = "Veuillez choisir l'information à appliquer au service";
$strings['SaleStatusCancelled'] = "Vente annulée";
$strings['ServiceSaleInfo'] = "Information de vente";
$strings['ServiceId'] = "Id du service";
$strings['BoughtBy'] = "Acheté par";
$strings['PurchaserUser'] = "Utilisateur acheteur";
$strings['Pending'] = "En attente";
$strings['Names'] = "Nom";
$strings['SaleStatusCancelled'] = 'Vente annulée';
$strings['ServiceSaleInfo'] = 'Information de vente';
$strings['ServiceId'] = 'Id du service';
$strings['BoughtBy'] = 'Acheté par';
$strings['PurchaserUser'] = 'Utilisateur acheteur';
$strings['Pending'] = 'En attente';
$strings['Names'] = 'Nom';

@ -1,173 +1,174 @@
<?php
$strings['plugin_title'] = "Venta de cursos";
$strings['plugin_comment'] = "Vender cursos a través de PayPal directamente desde su portal Chamilo. La asociación Chamilo y los desarrolladores involucrados no pueden ser considerados responsables de cualquier inconveniente que se presente.";
$strings['show_main_menu_tab'] = "Mostrar pestaña en el menu principal";
$strings['show_main_menu_tab_help'] = "En caso de no querer mostrar la pestaña, puede agregar el siguiente enlace a su portal Chamilo: %s";
$strings['public_main_menu_tab'] = "Mostrar pestaña a usuarios sin login";
$strings['include_sessions'] = "Incluir sesiones";
$strings['paypal_enable'] = "Habilitar PayPal";
$strings['commissions_enable'] = "Habilitar Comisiones";
$strings['transfer_enable'] = "Habilitar transferencia";
$strings['unregistered_users_enable'] = "Permitir usuarios sin registro en la plataforma";
$strings['invoicing_enable'] = "Habilitar Facturación";
$strings['tax_enable'] = "Habilitar Impuestos";
$strings['Free'] = "GRATIS";
$strings['PaypalPayoutCommissions'] = "Pagar comisiones por Paypal";
$strings['MyPayouts'] = "Mis Pagos";
$strings['Commission'] = "Comisión";
$strings['Commissions'] = "Comisiones";
$strings['SetCommissions'] = "Aplicar comisiones";
$strings['CommissionsConfig'] = "Configurar Comisiones";
$strings['PayoutReport'] = "Reporte de Pagos";
$strings['Stats'] = "Estadísticas";
$strings['InfoCommissions'] = "Ingrese aquí la comisión de ventas, en porcentaje (%), para la organización que controla la plataforma. Este porcentaje se deducirá del monto percibido por los docentes por cada curso o sesión vendido en la plataforma.";
$strings['NeedToSelectPaymentType'] = "Necesita seleccionar el tipo de pago";
$strings['IndividualPayout'] = "Pago individual";
$strings['CancelPayout'] = "Cancelar Payout";
$strings['ContinuePayout'] = "Continuar con el Pago";
$strings['ProceedPayout'] = "Proceder con el Pago";
$strings['TheActualPlatformCommissionIsX'] = "La actual comisión de la plataforma es de <b> %s </b>, este porcentaje será descontado del total del precio del producto cuya diferencia será el monto base para aplicar estas comisiones.";
$strings['CoursesInSessionsDoesntDisplayHere'] = "Los cursos que se encuentren dentro de una sesión de formación no aparecerán en la lista de cursos a configurar como productos individuales.";
$strings['WantToSellCourses'] = "¿Quieres enseñar y ganar dinero con tus propios cursos?, Esta lista puede estar llena de tus ganancias vendiendo cursos a través de esta plataforma!. Informate con nosotros! ";
$strings['SelectOptionToProceed'] = "Selecciona una opción para proceder";
$strings['VerifyTotalAmountToProceedPayout'] = "Por favor verificar el monto total para proceder con el pago de comisiones, este monto no considera cargos extras por paypal, las ventas de cursos que no cuenten con una cuenta de Paypal para el o los beneficiarios no serán consideradas.";
$strings['TotalAcounts'] = "Total de cuentas:";
$strings['TotalPayout'] = "Total a pagar:";
$strings['PayoutDate'] = "Fecha del Pago:";
$strings['CautionThisProcessCantBeCanceled'] = "<b>Precaución</b>: este proceso puede tomar unos minutos y no puede ser cancelado.";
$strings['ProcessingPayoutsDontCloseThisWindow'] = "<b>Procesando los pagos, no cierre esta ventana hasta que haya finalizado</b>";
$strings['PayoutSuccess'] = "Los pagos se han realizado con éxito";
$strings['Buyer'] = "Comprador";
$strings['BankTransfer'] = "Transferencia Bancaria";
$strings['SaleInfo'] = "Información de la venta";
$strings['SaleStatusPending'] = "Venta pendiente";
$strings['SaleStatusCanceled'] = "Venta cancelada";
$strings['SaleStatusCompleted'] = "Venta completada";
$strings['PayoutStatusPending'] = "Pago pendiente";
$strings['PayoutStatusCanceled'] = "Pago cancelado";
$strings['PayoutStatusCompleted'] = "Pago completado";
$strings['PayoutsTotalPending'] = "Pagos pendientes:";
$strings['PayoutsTotalCanceled'] = "Pagos cancelados:";
$strings['PayoutsTotalCompleted'] = "Pagos completados:";
$strings['Total'] = "Total";
$strings['TotalAmount'] = "Monto total:";
$strings['CourseListOnSale'] = "Lista de cursos a la venta";
$strings['AvailableCourses'] = "Cursos disponibles";
$strings['Price'] = "Precio";
$strings['SearchFilter'] = "Filtro de búsqueda";
$strings['MinimumPrice'] = "Precio mínimo";
$strings['MaximumPrice'] = "Precio máximo";
$strings['AvailableCoursesConfiguration'] = "Configuración de cursos disponibles";
$strings['PaymentsConfiguration'] = "Configuración de Pagos";
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = "Usted ya está registrado en el curso.";
$strings['SeeDescription'] = "Ver descripción";
$strings['Buy'] = "Comprar";
$strings['WaitingToReceiveThePayment'] = "Se encuentra a la espera de recibir el pago";
$strings['TheUserIsAlreadyRegisteredInTheSession'] = "Usted ya está registrado en la sesión";
$strings['ItemNotSaved'] = "Elemento no guardado";
$strings['TitlePlugin'] = "Todo lo que necesita para enseñar y vender cursos en línea";
$strings['PluginPresentation'] = "El Plugin BuyCourses le da los recursos para vender sus cursos o sus sesiones ya creados y enseñar en línea, todo en unos simples pasos y configuraciones. ¿Qué espera? Empiece a vender cursos a través de Chamilo ahora!";
$strings['Instructions'] = "Instrucciones de uso";
$strings['InstructionsStepOne'] = "Crea un curso o una sesión de formación en la plataforma.";
$strings['InstructionsStepTwo'] = "En la sección <strong>configuración de pagos</strong>, configure el tipo de moneda con el que venderá sus cursos o sesiones.";
$strings['InstructionsStepThree'] = "Configure los cursos a vender en la sección <strong>Configuración de cursos y precios</strong>";
$strings['BuyCourses'] = "Comprar cursos";
$strings['ConfigurationOfCoursesAndPrices'] = "Configuración de cursos y precios";
$strings['SalesReport'] = "Reporte de ventas";
$strings['UserInformation'] = "Ficha del comprador";
$strings['PaymentMethods'] = "Métodos de pago";
$strings['ConfirmOrder'] = "Confirmar Orden";
$strings['PurchaseData'] = "Datos de la compra";
$strings['bc_subject'] = "Confirmación pedido de cursos";
$strings['PurchaseStatusX'] = "Estado de la compra: %s";
$strings['PendingReasonByTransfer'] = "<b>Pendiente</b>. Esperando la confirmación de la transferencia";
$strings['CancelOrder'] = "Cancelar Orden";
$strings['BankAccountInformation'] = "Información de la Cuenta Bancaria";
$strings['BankAccount'] = "Cuenta Bancaria";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Una vez confirmado, recibira un e-mail con los datos bancarios y una referencia del pedido.";
$strings['SubscriptionToCourseXSuccessful'] = "<p class=\"lead\">Tu subscripción a <a href=\"%s\"><strong>\"%s\"</strong></a> se realizó correctamente.</p>";
$strings['OrderCanceled'] = "Pedido cancelado";
$strings['OrderStatus'] = "Estado del pedido";
$strings['PayoutStatus'] = "Estado del pago";
$strings['SearchByStatus'] = "Buscar por estado";
$strings['OrderReference'] = "Referencia del pedido";
$strings['OrderDate'] = "Fecha del pedido";
$strings['OrderPrice'] = "Precio del pedido";
$strings['ProductType'] = "Tipo de producto";
$strings['SubscribeUser'] = "Inscribir usuario";
$strings['DeleteOrder'] = "Eliminar pedido";
$strings['ErrorContactPlatformAdmin'] = "Se ha producido un error desconocido. Por favor, póngase en contacto con el administrador de la plataforma.";
$strings['PendingReasonByAddress'] = "<b>Pendiente</b>. No has ingresado una dirección de correo confirmada.";
$strings['PendingReasonByAuthorization'] = "<b>Pendiente</b>. No hemos recibido los fondos.";
$strings['PendingReasonByEcheck'] = "<b>Pendiente</b>. El pago fue hecho a través de un eCheck que aún no está declarado";
$strings['PendingReasonByIntl'] = "<b>Pendiente</b>. No tenemos un mecanismo de retiro de fondos.";
$strings['PendingReasonByMulticurrency'] = "<b>Pending</b>. No podemos realizar el cambio de moneda.";
$strings['PendingReasonByOrder'] = "<b>Pendiente</b>. Pedido realizado. No hemos recibido los fondos.";
$strings['PendingReasonByPaymentReview'] = "<b>Pendiente</b>. El pago está siendo revisado por PayPal por riesgo.";
$strings['PendingReasonByRegulatoryReview'] = "<b>Pendiente</b>. El pago está siendo revisado por cumplimiento con regulaciones gubernamentales.";
$strings['PendingReasonByUnilateral'] = "<b>Pendiente</b>. La dirección de correo electrónico aún no está registrada o confirmada.";
$strings['PendingReasonByUpgrade'] = "<b>Pendiente</b>. El pago fue realizado a través de una tarjeta de crédito.";
$strings['PendingReasonByVerify'] = "<b>Pendiente</b>. Lo sentimos. Todavía no estamos verificados en PayPal.";
$strings['PendingReasonByOther'] = "<b>Pendiente</b>. Por favor contacta al administrador de la plataforma.";
$strings['plugin_title'] = 'Venta de cursos';
$strings['plugin_comment'] = 'Vender cursos a través de PayPal directamente desde su portal Chamilo. La asociación Chamilo y los desarrolladores involucrados no pueden ser considerados responsables de cualquier inconveniente que se presente.';
$strings['show_main_menu_tab'] = 'Mostrar pestaña en el menu principal';
$strings['show_main_menu_tab_help'] = 'En caso de no querer mostrar la pestaña, puede agregar el siguiente enlace a su portal Chamilo: %s';
$strings['public_main_menu_tab'] = 'Mostrar pestaña a usuarios sin login';
$strings['include_sessions'] = 'Incluir sesiones';
$strings['paypal_enable'] = 'Habilitar PayPal';
$strings['commissions_enable'] = 'Habilitar Comisiones';
$strings['transfer_enable'] = 'Habilitar transferencia';
$strings['unregistered_users_enable'] = 'Permitir usuarios sin registro en la plataforma';
$strings['invoicing_enable'] = 'Habilitar Facturación';
$strings['tax_enable'] = 'Habilitar Impuestos';
$strings['Free'] = 'GRATIS';
$strings['PaypalPayoutCommissions'] = 'Pagar comisiones por Paypal';
$strings['MyPayouts'] = 'Mis Pagos';
$strings['Commission'] = 'Comisión';
$strings['Commissions'] = 'Comisiones';
$strings['SetCommissions'] = 'Aplicar comisiones';
$strings['CommissionsConfig'] = 'Configurar Comisiones';
$strings['PayoutReport'] = 'Reporte de Pagos';
$strings['Stats'] = 'Estadísticas';
$strings['InfoCommissions'] = 'Ingrese aquí la comisión de ventas, en porcentaje (%), para la organización que controla la plataforma. Este porcentaje se deducirá del monto percibido por los docentes por cada curso o sesión vendido en la plataforma.';
$strings['NeedToSelectPaymentType'] = 'Necesita seleccionar el tipo de pago';
$strings['IndividualPayout'] = 'Pago individual';
$strings['CancelPayout'] = 'Cancelar Payout';
$strings['ContinuePayout'] = 'Continuar con el Pago';
$strings['ProceedPayout'] = 'Proceder con el Pago';
$strings['TheActualPlatformCommissionIsX'] = 'La actual comisión de la plataforma es de <b> %s </b>, este porcentaje será descontado del total del precio del producto cuya diferencia será el monto base para aplicar estas comisiones.';
$strings['CoursesInSessionsDoesntDisplayHere'] = 'Los cursos que se encuentren dentro de una sesión de formación no aparecerán en la lista de cursos a configurar como productos individuales.';
$strings['WantToSellCourses'] = '¿Quieres enseñar y ganar dinero con tus propios cursos?, Esta lista puede estar llena de tus ganancias vendiendo cursos a través de esta plataforma!. Informate con nosotros! ';
$strings['SelectOptionToProceed'] = 'Selecciona una opción para proceder';
$strings['VerifyTotalAmountToProceedPayout'] = 'Por favor verificar el monto total para proceder con el pago de comisiones, este monto no considera cargos extras por paypal, las ventas de cursos que no cuenten con una cuenta de Paypal para el o los beneficiarios no serán consideradas.';
$strings['TotalAcounts'] = 'Total de cuentas:';
$strings['TotalPayout'] = 'Total a pagar:';
$strings['PayoutDate'] = 'Fecha del Pago:';
$strings['CautionThisProcessCantBeCanceled'] = '<b>Precaución</b>: este proceso puede tomar unos minutos y no puede ser cancelado.';
$strings['ProcessingPayoutsDontCloseThisWindow'] = '<b>Procesando los pagos, no cierre esta ventana hasta que haya finalizado</b>';
$strings['PayoutSuccess'] = 'Los pagos se han realizado con éxito';
$strings['Buyer'] = 'Comprador';
$strings['BankTransfer'] = 'Transferencia Bancaria';
$strings['SaleInfo'] = 'Información de la venta';
$strings['SaleStatusPending'] = 'Venta pendiente';
$strings['SaleStatusCanceled'] = 'Venta cancelada';
$strings['SaleStatusCompleted'] = 'Venta completada';
$strings['PayoutStatusPending'] = 'Pago pendiente';
$strings['PayoutStatusCanceled'] = 'Pago cancelado';
$strings['PayoutStatusCompleted'] = 'Pago completado';
$strings['PayoutsTotalPending'] = 'Pagos pendientes:';
$strings['PayoutsTotalCanceled'] = 'Pagos cancelados:';
$strings['PayoutsTotalCompleted'] = 'Pagos completados:';
$strings['Total'] = 'Total';
$strings['TotalAmount'] = 'Monto total:';
$strings['CourseListOnSale'] = 'Lista de cursos a la venta';
$strings['AvailableCourses'] = 'Cursos disponibles';
$strings['Price'] = 'Precio';
$strings['SearchFilter'] = 'Filtro de búsqueda';
$strings['MinimumPrice'] = 'Precio mínimo';
$strings['MaximumPrice'] = 'Precio máximo';
$strings['AvailableCoursesConfiguration'] = 'Configuración de cursos disponibles';
$strings['PaymentsConfiguration'] = 'Configuración de Pagos';
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'Usted ya está registrado en el curso.';
$strings['SeeDescription'] = 'Ver descripción';
$strings['Buy'] = 'Comprar';
$strings['WaitingToReceiveThePayment'] = 'Se encuentra a la espera de recibir el pago';
$strings['TheUserIsAlreadyRegisteredInTheSession'] = 'Usted ya está registrado en la sesión';
$strings['ItemNotSaved'] = 'Elemento no guardado';
$strings['TitlePlugin'] = 'Todo lo que necesita para enseñar y vender cursos en línea';
$strings['PluginPresentation'] = 'El Plugin BuyCourses le da los recursos para vender sus cursos o sus sesiones ya creados y enseñar en línea, todo en unos simples pasos y configuraciones. ¿Qué espera? Empiece a vender cursos a través de Chamilo ahora!';
$strings['Instructions'] = 'Instrucciones de uso';
$strings['InstructionsStepOne'] = 'Crea un curso o una sesión de formación en la plataforma.';
$strings['InstructionsStepTwo'] = 'En la sección <strong>configuración de pagos</strong>, configure el tipo de moneda con el que venderá sus cursos o sesiones.';
$strings['InstructionsStepThree'] = 'Configure los cursos a vender en la sección <strong>Configuración de cursos y precios</strong>';
$strings['BuyCourses'] = 'Comprar cursos';
$strings['ConfigurationOfCoursesAndPrices'] = 'Configuración de cursos y precios';
$strings['SalesReport'] = 'Reporte de ventas';
$strings['UserInformation'] = 'Ficha del comprador';
$strings['PaymentMethods'] = 'Métodos de pago';
$strings['ConfirmOrder'] = 'Confirmar Orden';
$strings['PurchaseData'] = 'Datos de la compra';
$strings['bc_subject'] = 'Confirmación pedido de cursos';
$strings['PurchaseStatusX'] = 'Estado de la compra: %s';
$strings['PendingReasonByTransfer'] = '<b>Pendiente</b>. Esperando la confirmación de la transferencia';
$strings['CancelOrder'] = 'Cancelar Orden';
$strings['BankAccountInformation'] = 'Información de la Cuenta Bancaria';
$strings['BankAccount'] = 'Cuenta Bancaria';
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = 'Una vez confirmado, recibira un e-mail con los datos bancarios y una referencia del pedido.';
$strings['SubscriptionToCourseXSuccessful'] = '<p class="lead">Tu subscripción a <a href="%s"><strong>"%s"</strong></a> se realizó correctamente.</p>';
$strings['OrderCanceled'] = 'Pedido cancelado';
$strings['OrderStatus'] = 'Estado del pedido';
$strings['PayoutStatus'] = 'Estado del pago';
$strings['SearchByStatus'] = 'Buscar por estado';
$strings['OrderReference'] = 'Referencia del pedido';
$strings['OrderDate'] = 'Fecha del pedido';
$strings['OrderPrice'] = 'Precio del pedido';
$strings['ProductType'] = 'Tipo de producto';
$strings['SubscribeUser'] = 'Inscribir usuario';
$strings['DeleteOrder'] = 'Eliminar pedido';
$strings['ErrorContactPlatformAdmin'] = 'Se ha producido un error desconocido. Por favor, póngase en contacto con el administrador de la plataforma.';
$strings['PendingReasonByAddress'] = '<b>Pendiente</b>. No has ingresado una dirección de correo confirmada.';
$strings['PendingReasonByAuthorization'] = '<b>Pendiente</b>. No hemos recibido los fondos.';
$strings['PendingReasonByEcheck'] = '<b>Pendiente</b>. El pago fue hecho a través de un eCheck que aún no está declarado';
$strings['PendingReasonByIntl'] = '<b>Pendiente</b>. No tenemos un mecanismo de retiro de fondos.';
$strings['PendingReasonByMulticurrency'] = '<b>Pending</b>. No podemos realizar el cambio de moneda.';
$strings['PendingReasonByOrder'] = '<b>Pendiente</b>. Pedido realizado. No hemos recibido los fondos.';
$strings['PendingReasonByPaymentReview'] = '<b>Pendiente</b>. El pago está siendo revisado por PayPal por riesgo.';
$strings['PendingReasonByRegulatoryReview'] = '<b>Pendiente</b>. El pago está siendo revisado por cumplimiento con regulaciones gubernamentales.';
$strings['PendingReasonByUnilateral'] = '<b>Pendiente</b>. La dirección de correo electrónico aún no está registrada o confirmada.';
$strings['PendingReasonByUpgrade'] = '<b>Pendiente</b>. El pago fue realizado a través de una tarjeta de crédito.';
$strings['PendingReasonByVerify'] = '<b>Pendiente</b>. Lo sentimos. Todavía no estamos verificados en PayPal.';
$strings['PendingReasonByOther'] = '<b>Pendiente</b>. Por favor contacta al administrador de la plataforma.';
$strings['PayPalPaymentOKPleaseConfirm'] = "PayPal nos indicó que todo estaba listo para ejecutar el pago. Por seguridad, le pedimos confirme una última vez su pedido dando clic en el botón de confirmación a bajo. Una vez le haya dado clic, será registrado al curso y el monto correspondiente será retirado de su cuenta PayPal. Siempre puede acceder a sus cursos a partir de la pestaña 'Mis cursos'. Gracias por su compra!";
$strings['Sandbox'] = "Entorno de Pruebas";
$strings['PayPalAccount'] = "Cuenta de Paypal";
$strings['NoPayPalAccountDetected'] = "No se ingresó una cuenta de Paypal";
$strings['PayPalConfig'] = "Configuración PayPal:";
$strings['TransfersConfig'] = "Configuraci&oacute;n de transferencias:";
$strings['PluginInstruction'] = "Puede activar o desactivar la opción de pagos vía PayPal, Culqi o configuración de transferencias bancarias, en la sección del configuración del plugin.";
$strings['ClickHere'] = "<i>Clic aquí</i> para más detalles";
$strings['CurrencyType'] = "Tipo de moneda";
$strings['InfoCurrency'] = "Permite configurar el tipo de moneda (de pago) para sus cursos.";
$strings['ApiUsername'] = "Nombre de usuario de API";
$strings['ApiPassword'] = "Contraseña de API";
$strings['ApiSignature'] = "Firma";
$strings['InfoApiCredentials'] = "Para generar tu credenciales API para integrar su cuenta PayPal con Chamilo LMS, deberá seguir los siguientes pasos";
$strings['InfoApiStepOne'] = "Ir a la opción de <strong>Perfil de PayPal</strong>, luego en <strong>Mis herramientas de venta</strong>";
$strings['InfoApiStepTwo'] = "En el apartado <strong>Acceso API</strong>, dar clic en la opción <strong>Actualizar</strong>";
$strings['InfoApiStepThree'] = "En la opción 2, de Configuración de credenciales y permisos de API, dar clic en <strong>Ver firma de API</strong>. Copiar los datos de las credenciales en el formulario de configuración de este plugin";
$strings['ErrorOccurred'] = "<strong>Ocurrio un error</strong>. Codigo: %s. Mensaje: %s. Por favor, contacta al administrador de la plataforma.";
$strings['VisibleInCatalog'] = "Visible en el catálogo";
$strings['Beneficiaries'] = "Beneficiarios";
$strings['AvailableCourse'] = "Curso disponible";
$strings['ShowOnCourseCatalog'] = "Mostrar en el catálogo de cursos";
$strings['ByStatus'] = "Por estado";
$strings['ByUser'] = "Por usuario";
$strings['PaymentMethod'] = "Método de pago";
$strings['SWIFT'] = "Código SWIFT";
$strings['SWIFT_help'] = "Formato estándar de los Códigos de Identificación Bancaria (BIC) que sirve como identificador único para un banco o institución financiera.";
$strings['include_services'] = "Incluir Servicios";
$strings['Services'] = "Servicios";
$strings['Service'] = "Servicio";
$strings['NewService'] = "Nuevo servicio";
$strings['ServiceName'] = "Nombre de servicio";
$strings['AppliesTo'] = "Aplicado a";
$strings['ServiceInformation'] = "Información del servicio";
$strings['EditService'] = "Editar servicio";
$strings['ServiceAdded'] = "Servicio agregado";
$strings['ServiceEdited'] = "Servicio editado";
$strings['ServiceSaleInfo'] = "Información del servicio";
$strings['ListOfServicesOnSale'] = "Lista de servicios a la venta";
$strings['AdditionalInfo'] = "Información adicional";
$strings['PleaseSelectTheCorrectInfoToApplyTheService'] = "Porfavor Seleccione la información correcta para aplicar el servicio";
$strings['SubscriptionToServiceXSuccessful'] = "La subscripción al servicio %s ha sido satisfactoria";
$strings['culqi_enable'] = "Habilitar Culqi";
$strings['CulqiConfig'] = "Configuración de CULQI:";
$strings['InfoCulqiCredentials'] = "Para obtener las credenciales es necesario crearse una cuenta en Culqi e ingresar en modo desarrollo, copiar el código de comercio que se encuentra en su panel de control, luego ingresar al apartado de API Keys y generar la Key correspondiente para copiarla aquí";
$strings['CommerceCode'] = "Codigo de comercio";
$strings['IConfirmIReadAndAcceptTermsAndCondition'] = "He leído y aceptado los terminos y condiciones del servicio";
$strings['NoTermsAndConditionsProvided'] = "Terminos y condiciones no establecidos";
$strings['GlobalConfig'] = "Configuración global:";
$strings['WriteHereTheTermsAndConditionsOfYourECommerce'] = "Escriba aquí los terminos y condiciones para su tienda virtual";
$strings['PleaseSelectThePaymentMethodBeforeConfirmYourOrder'] = "Por favor seleccione el método de pago de su preferencia antes de confirmar su orden";
$strings['MyServices'] = "Mis servicios";
$strings['ServiceId'] = "Id de servicio";
$strings['BoughtBy'] = "Comprado por";
$strings['PurchaserUser'] = "Usuario comprador";
$strings['SalePrice'] = "Precio de venta";
$strings['Pending'] = "Pendiente";
$strings['YouNeedToBeRegisteredInAtLeastOneCourse'] = "Necesitas estar registrado en al menos un curso";
$strings['YouNeedToBeRegisteredInAtLeastOneSession'] = "Necesitas estar registrado en al menos una sesión";
$strings['Sandbox'] = 'Entorno de Pruebas';
$strings['PayPalAccount'] = 'Cuenta de Paypal';
$strings['NoPayPalAccountDetected'] = 'No se ingresó una cuenta de Paypal';
$strings['PayPalConfig'] = 'Configuración PayPal:';
$strings['TransfersConfig'] = 'Configuraci&oacute;n de transferencias:';
$strings['PluginInstruction'] = 'Puede activar o desactivar la opción de pagos vía PayPal, Culqi o configuración de transferencias bancarias, en la sección del configuración del plugin.';
$strings['ClickHere'] = '<i>Clic aquí</i> para más detalles';
$strings['CurrencyType'] = 'Tipo de moneda';
$strings['InfoCurrency'] = 'Permite configurar el tipo de moneda (de pago) para sus cursos.';
$strings['ApiUsername'] = 'Nombre de usuario de API';
$strings['ApiPassword'] = 'Contraseña de API';
$strings['ApiSignature'] = 'Firma';
$strings['InfoApiCredentials'] = 'Para generar tu credenciales API para integrar su cuenta PayPal con Chamilo LMS, deberá seguir los siguientes pasos';
$strings['InfoApiStepOne'] = 'Ir a la opción de <strong>Perfil de PayPal</strong>, luego en <strong>Mis herramientas de venta</strong>';
$strings['InfoApiStepTwo'] = 'En el apartado <strong>Acceso API</strong>, dar clic en la opción <strong>Actualizar</strong>';
$strings['InfoApiStepThree'] = 'En la opción 2, de Configuración de credenciales y permisos de API, dar clic en <strong>Ver firma de API</strong>. Copiar los datos de las credenciales en el formulario de configuración de este plugin';
$strings['ErrorOccurred'] = '<strong>Ocurrio un error</strong>. Codigo: %s. Mensaje: %s. Por favor, contacta al administrador de la plataforma.';
$strings['VisibleInCatalog'] = 'Visible en el catálogo';
$strings['Beneficiaries'] = 'Beneficiarios';
$strings['AvailableCourse'] = 'Curso disponible';
$strings['ShowOnCourseCatalog'] = 'Mostrar en el catálogo de cursos';
$strings['ByStatus'] = 'Por estado';
$strings['ByUser'] = 'Por usuario';
$strings['PaymentMethod'] = 'Método de pago';
$strings['SWIFT'] = 'Código SWIFT';
$strings['SWIFT_help'] = 'Formato estándar de los Códigos de Identificación Bancaria (BIC) que sirve como identificador único para un banco o institución financiera.';
$strings['include_services'] = 'Incluir Servicios';
$strings['Services'] = 'Servicios';
$strings['Service'] = 'Servicio';
$strings['NewService'] = 'Nuevo servicio';
$strings['ServiceName'] = 'Nombre de servicio';
$strings['AppliesTo'] = 'Aplicado a';
$strings['ServiceInformation'] = 'Información del servicio';
$strings['EditService'] = 'Editar servicio';
$strings['ServiceAdded'] = 'Servicio agregado';
$strings['ServiceEdited'] = 'Servicio editado';
$strings['ServiceSaleInfo'] = 'Información del servicio';
$strings['ListOfServicesOnSale'] = 'Lista de servicios a la venta';
$strings['AdditionalInfo'] = 'Información adicional';
$strings['PleaseSelectTheCorrectInfoToApplyTheService'] = 'Porfavor Seleccione la información correcta para aplicar el servicio';
$strings['SubscriptionToServiceXSuccessful'] = 'La subscripción al servicio %s ha sido satisfactoria';
$strings['culqi_enable'] = 'Habilitar Culqi';
$strings['CulqiConfig'] = 'Configuración de CULQI:';
$strings['InfoCulqiCredentials'] = 'Para obtener las credenciales es necesario crearse una cuenta en Culqi e ingresar en modo desarrollo, copiar el código de comercio que se encuentra en su panel de control, luego ingresar al apartado de API Keys y generar la Key correspondiente para copiarla aquí';
$strings['CommerceCode'] = 'Codigo de comercio';
$strings['IConfirmIReadAndAcceptTermsAndCondition'] = 'He leído y aceptado los terminos y condiciones del servicio';
$strings['NoTermsAndConditionsProvided'] = 'Terminos y condiciones no establecidos';
$strings['GlobalConfig'] = 'Configuración global:';
$strings['WriteHereTheTermsAndConditionsOfYourECommerce'] = 'Escriba aquí los terminos y condiciones para su tienda virtual';
$strings['PleaseSelectThePaymentMethodBeforeConfirmYourOrder'] = 'Por favor seleccione el método de pago de su preferencia antes de confirmar su orden';
$strings['MyServices'] = 'Mis servicios';
$strings['ServiceId'] = 'Id de servicio';
$strings['BoughtBy'] = 'Comprado por';
$strings['PurchaserUser'] = 'Usuario comprador';
$strings['SalePrice'] = 'Precio de venta';
$strings['Pending'] = 'Pendiente';
$strings['YouNeedToBeRegisteredInAtLeastOneCourse'] = 'Necesitas estar registrado en al menos un curso';
$strings['YouNeedToBeRegisteredInAtLeastOneSession'] = 'Necesitas estar registrado en al menos una sesión';
$strings['IfYouWantToGetTheCertificateAndOrSkillsAsociatedToThisCourseYouNeedToBuyTheCertificateServiceYouCanGoToServiceCatalogClickingHere'] = "Si quieres obtener el certificado y/o las competencias asociadas a este curso, necesitas comprar el servicio de <b> Certificado </b>, puedes ir al catálogo de servicios para comprarlo haciendo click <a target='_blank' href='%s'>AQUÍ</a>";
$strings['AdditionalInfoRequired'] = 'Se requiere que se elija la información adicional antes de proceder';
$strings['ServiceDeleted'] = 'Servicio eliminado';
@ -175,38 +176,38 @@ $strings['DeleteThisService'] = 'Eliminar este servicio';
$strings['YourCoursesNeedAtLeastOneLearningPath'] = 'Los cursos en los que estás registrado necesitan tener al menos una lección que contenga un item de cerficado final';
$strings['NoPaymentOptionAvailable'] = 'No existen opciones de pago. Por favor reporte este problema al administrador.';
$strings['XIsOnlyPaymentMethodAvailable'] = '%s es el único método de pago disponible para esta compra.';
$strings['GlobalTaxPerc'] = "Porcentaje del impuesto global";
$strings['GlobalTaxPercDescription'] = "Porcentaje por defecto que se usará, excepto si existe un impuesto específico en el curso, sesión o servicio.";
$strings['TaxPerc'] = "Porcentaje del impuesto";
$strings['TaxPercDescription'] = "Si se deja vacío se usará valor global por defecto.";
$strings['ByDefault'] = "por defecto (valor global)";
$strings['OnlyCourses'] = "Solo Cursos";
$strings['OnlySessions'] = "Solo Sesiones";
$strings['OnlyServices'] = "Solo Servicios";
$strings['TaxAppliesTo'] = "Impuestos aplicados a";
$strings['AllCoursesSessionsAndServices'] = "Todos (Cursos, sesiones y servicios)";
$strings['TaxNameCustom'] = "Nombre del impuesto";
$strings['TaxNameExamples'] = "VAT, IVA, IGV, TVA, IV ...";
$strings['ErrorUpdateFieldDB'] = "Error al actualizar los campos de la base de datos";
$strings['SellerName'] = "Nombre vendedor";
$strings['SellerId'] = "Identificador vendedor";
$strings['SellerAddress'] = "Dirección vendedor";
$strings['SellerEmail'] = "E-mail vendedor";
$strings['NextNumberInvoice'] = "Número siguiente factura";
$strings['NextNumberInvoiceDescription'] = "Número de la siguiente factura asignado de forma manual";
$strings['InvoiceSeries'] = "Serie factura";
$strings['InvoiceSeriesDescription'] = "Parámetro opcional: Ejemplo de numeración factura &lt;serie&gt;&lt;año&gt;/&lt;número&gt;";
$strings['InvoiceView'] = "Ver factura";
$strings['NoInvoiceEnable'] = "No está habilitado el bloque de facturación";
$strings['Company'] = "Empresa";
$strings['VAT'] = "CIF";
$strings['Address'] = "Dirección";
$strings['InvoiceNumber'] = "Num. factura";
$strings['InvoiceDate'] = "Fecha de emisión";
$strings['Invoice'] = "Factura";
$strings['SaleEmail'] = "E-mail de ventas";
$strings['PurchaseDetailsIntro'] = "Detalles de la comprar";
$strings['PurchaseDetailsEnd'] = "Atentamente";
$strings['ProductName'] = "Nombre producto";
$strings['BankAccountIntro'] = "Información cuentas bancarias";
$strings['CurrencyIsNotConfigured'] = "Por favor, confogure una moneda antes de continuar.";
$strings['GlobalTaxPerc'] = 'Porcentaje del impuesto global';
$strings['GlobalTaxPercDescription'] = 'Porcentaje por defecto que se usará, excepto si existe un impuesto específico en el curso, sesión o servicio.';
$strings['TaxPerc'] = 'Porcentaje del impuesto';
$strings['TaxPercDescription'] = 'Si se deja vacío se usará valor global por defecto.';
$strings['ByDefault'] = 'por defecto (valor global)';
$strings['OnlyCourses'] = 'Solo Cursos';
$strings['OnlySessions'] = 'Solo Sesiones';
$strings['OnlyServices'] = 'Solo Servicios';
$strings['TaxAppliesTo'] = 'Impuestos aplicados a';
$strings['AllCoursesSessionsAndServices'] = 'Todos (Cursos, sesiones y servicios)';
$strings['TaxNameCustom'] = 'Nombre del impuesto';
$strings['TaxNameExamples'] = 'VAT, IVA, IGV, TVA, IV ...';
$strings['ErrorUpdateFieldDB'] = 'Error al actualizar los campos de la base de datos';
$strings['SellerName'] = 'Nombre vendedor';
$strings['SellerId'] = 'Identificador vendedor';
$strings['SellerAddress'] = 'Dirección vendedor';
$strings['SellerEmail'] = 'E-mail vendedor';
$strings['NextNumberInvoice'] = 'Número siguiente factura';
$strings['NextNumberInvoiceDescription'] = 'Número de la siguiente factura asignado de forma manual';
$strings['InvoiceSeries'] = 'Serie factura';
$strings['InvoiceSeriesDescription'] = 'Parámetro opcional: Ejemplo de numeración factura &lt;serie&gt;&lt;año&gt;/&lt;número&gt;';
$strings['InvoiceView'] = 'Ver factura';
$strings['NoInvoiceEnable'] = 'No está habilitado el bloque de facturación';
$strings['Company'] = 'Empresa';
$strings['VAT'] = 'CIF';
$strings['Address'] = 'Dirección';
$strings['InvoiceNumber'] = 'Num. factura';
$strings['InvoiceDate'] = 'Fecha de emisión';
$strings['Invoice'] = 'Factura';
$strings['SaleEmail'] = 'E-mail de ventas';
$strings['PurchaseDetailsIntro'] = 'Detalles de la comprar';
$strings['PurchaseDetailsEnd'] = 'Atentamente';
$strings['ProductName'] = 'Nombre producto';
$strings['BankAccountIntro'] = 'Información cuentas bancarias';
$strings['CurrencyIsNotConfigured'] = 'Por favor, confogure una moneda antes de continuar.';

@ -1,10 +1,9 @@
<?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.buycourses
*/
/**
* Plugin details (must be present).

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Course;
@ -9,7 +10,6 @@ use Doctrine\ORM\Query\Expr\Join;
/**
* Plugin class for the BuyCourses plugin.
*
* @package chamilo.plugin.buycourses
*
* @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Imanol Losada <imanol.losada@beeznest.com>
@ -68,7 +68,7 @@ class BuyCoursesPlugin extends Plugin
{
parent::__construct(
'5.0',
"
'
Jose Angel Ruiz - NoSoloRed (original author) <br/>
Francis Gonzales and Yannick Warnier - BeezNest (integration) <br/>
Alex Aragón - BeezNest (Design icons and css styles) <br/>
@ -76,7 +76,7 @@ class BuyCoursesPlugin extends Plugin
Angel Fernando Quiroz Campos - BeezNest (cleanup and new reports) <br/>
José Loguercio Silva - BeezNest (Payouts and buy Services) <br/>
Julio Montoya
",
',
[
'show_main_menu_tab' => 'boolean',
'public_main_menu_tab' => 'boolean',
@ -102,7 +102,7 @@ class BuyCoursesPlugin extends Plugin
{
static $result = null;
return $result ? $result : $result = new self();
return $result ?: $result = new self();
}
/**
@ -182,7 +182,7 @@ class BuyCoursesPlugin extends Plugin
$sql = "SHOW COLUMNS FROM $table WHERE Field = 'global_tax_perc'";
$res = Database::query($sql);
if (Database::num_rows($res) === 0) {
if (0 === Database::num_rows($res)) {
$sql = "ALTER TABLE $table ADD (
sale_email varchar(255) NOT NULL,
global_tax_perc int unsigned NOT NULL,
@ -205,7 +205,7 @@ class BuyCoursesPlugin extends Plugin
$sql = "SHOW COLUMNS FROM $table WHERE Field = 'tax_perc'";
$res = Database::query($sql);
if (Database::num_rows($res) === 0) {
if (0 === Database::num_rows($res)) {
$sql = "ALTER TABLE $table ADD tax_perc int unsigned NULL";
$res = Database::query($sql);
if (!$res) {
@ -217,7 +217,7 @@ class BuyCoursesPlugin extends Plugin
$sql = "SHOW COLUMNS FROM $table WHERE Field = 'tax_perc'";
$res = Database::query($sql);
if (Database::num_rows($res) === 0) {
if (0 === Database::num_rows($res)) {
$sql = "ALTER TABLE $table ADD tax_perc int unsigned NULL";
$res = Database::query($sql);
if (!$res) {
@ -229,7 +229,7 @@ class BuyCoursesPlugin extends Plugin
$sql = "SHOW COLUMNS FROM $table WHERE Field = 'tax_perc'";
$res = Database::query($sql);
if (Database::num_rows($res) === 0) {
if (0 === Database::num_rows($res)) {
$sql = "ALTER TABLE $table ADD (
price_without_tax decimal(10,2) NULL,
tax_perc int unsigned NULL,
@ -246,7 +246,7 @@ class BuyCoursesPlugin extends Plugin
$sql = "SHOW COLUMNS FROM $table WHERE Field = 'tax_perc'";
$res = Database::query($sql);
if (Database::num_rows($res) === 0) {
if (0 === Database::num_rows($res)) {
$sql = "ALTER TABLE $table ADD (
price_without_tax decimal(10,2) NULL,
tax_perc int unsigned NULL,
@ -315,9 +315,9 @@ class BuyCoursesPlugin extends Plugin
public function buyCoursesForGridCatalogValidator($productId, $productType)
{
$return = [];
$paypal = $this->get('paypal_enable') === 'true';
$transfer = $this->get('transfer_enable') === 'true';
$hideFree = $this->get('hide_free_text') === 'true';
$paypal = 'true' === $this->get('paypal_enable');
$transfer = 'true' === $this->get('transfer_enable');
$hideFree = 'true' === $this->get('hide_free_text');
if ($paypal || $transfer) {
$item = $this->getItemByProduct($productId, $productType);
@ -328,7 +328,7 @@ class BuyCoursesPlugin extends Plugin
</span>';
$return['verificator'] = true;
} else {
if ($hideFree == false) {
if (false == $hideFree) {
$html .= '<span class="label label-primary label-free">
<strong>'.$this->get_lang('Free').'</strong>
</span>';
@ -350,17 +350,16 @@ class BuyCoursesPlugin extends Plugin
* @param int $productId
* @param int $productType
*
* @return string $html
* @return string
*/
public function returnBuyCourseButton($productId, $productType)
{
$productId = (int) $productId;
$productType = (int) $productType;
$url = api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process.php?i='.$productId.'&t='.$productType;
$html = '<a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
Display::returnFontAwesomeIcon('shopping-cart').'</a>';
return $html;
return '<a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
Display::returnFontAwesomeIcon('shopping-cart').'</a>';
}
/**
@ -584,7 +583,7 @@ class BuyCoursesPlugin extends Plugin
{
$sessions = $this->filterSessionList($start, $end, $name, $min, $max, $typeResult);
if ($typeResult === 'count') {
if ('count' === $typeResult) {
return $sessions;
}
@ -653,7 +652,7 @@ class BuyCoursesPlugin extends Plugin
{
$courses = $this->filterCourseList($first, $pageSize, $name, $min, $max, $typeResult);
if ($typeResult === 'count') {
if ('count' === $typeResult) {
return $courses;
}
@ -706,11 +705,11 @@ class BuyCoursesPlugin extends Plugin
*/
public function getPriceWithCurrencyFromIsoCode($price, $isoCode)
{
$useSymbol = $this->get('use_currency_symbol') === 'true';
$useSymbol = 'true' === $this->get('use_currency_symbol');
$result = $isoCode.' '.$price;
if ($useSymbol) {
if ($isoCode === 'BRL') {
if ('BRL' === $isoCode) {
$symbol = 'R$';
} else {
$symbol = Symfony\Component\Intl\Intl::getCurrencyBundle()->getCurrencySymbol($isoCode);
@ -902,7 +901,7 @@ class BuyCoursesPlugin extends Plugin
}
$productName = '';
if ($item['product_type'] == self::PRODUCT_TYPE_COURSE) {
if (self::PRODUCT_TYPE_COURSE == $item['product_type']) {
$course = $entityManager->find('ChamiloCoreBundle:Course', $item['product_id']);
if (empty($course)) {
@ -910,7 +909,7 @@ class BuyCoursesPlugin extends Plugin
}
$productName = $course->getTitle();
} elseif ($item['product_type'] == self::PRODUCT_TYPE_SESSION) {
} elseif (self::PRODUCT_TYPE_SESSION == $item['product_type']) {
$session = $entityManager->find('ChamiloCoreBundle:Session', $item['product_id']);
if (empty($session)) {
@ -924,21 +923,21 @@ class BuyCoursesPlugin extends Plugin
$priceWithoutTax = null;
$taxPerc = null;
$taxAmount = 0;
$taxEnable = $this->get('tax_enable') === 'true';
$taxEnable = 'true' === $this->get('tax_enable');
$globalParameters = $this->getGlobalParameters();
$taxAppliesTo = $globalParameters['tax_applies_to'];
if ($taxEnable &&
(
$taxAppliesTo == self::TAX_APPLIES_TO_ALL ||
($taxAppliesTo == self::TAX_APPLIES_TO_ONLY_COURSE && $item['product_type'] == self::PRODUCT_TYPE_COURSE) ||
($taxAppliesTo == self::TAX_APPLIES_TO_ONLY_SESSION && $item['product_type'] == self::PRODUCT_TYPE_SESSION)
self::TAX_APPLIES_TO_ALL == $taxAppliesTo ||
(self::TAX_APPLIES_TO_ONLY_COURSE == $taxAppliesTo && self::PRODUCT_TYPE_COURSE == $item['product_type']) ||
(self::TAX_APPLIES_TO_ONLY_SESSION == $taxAppliesTo && self::PRODUCT_TYPE_SESSION == $item['product_type'])
)
) {
$priceWithoutTax = $item['price'];
$globalTaxPerc = $globalParameters['global_tax_perc'];
$precision = 2;
$taxPerc = is_null($item['tax_perc']) ? $globalTaxPerc : $item['tax_perc'];
$taxPerc = null === $item['tax_perc'] ? $globalTaxPerc : $item['tax_perc'];
$taxAmount = round($priceWithoutTax * $taxPerc / 100, $precision);
$price = $priceWithoutTax + $taxAmount;
}
@ -1113,7 +1112,7 @@ class BuyCoursesPlugin extends Plugin
{
$sale = $this->getSale($saleId);
if ($sale['status'] == self::SALE_STATUS_COMPLETED) {
if (self::SALE_STATUS_COMPLETED == $sale['status']) {
return true;
}
@ -1122,6 +1121,7 @@ class BuyCoursesPlugin extends Plugin
case self::PRODUCT_TYPE_COURSE:
$course = api_get_course_info_by_id($sale['product_id']);
$saleIsCompleted = CourseManager::subscribeUser($sale['user_id'], $course['code']);
break;
case self::PRODUCT_TYPE_SESSION:
SessionManager::subscribeUsersToSession(
@ -1132,12 +1132,13 @@ class BuyCoursesPlugin extends Plugin
);
$saleIsCompleted = true;
break;
}
if ($saleIsCompleted) {
$this->updateSaleStatus($sale['id'], self::SALE_STATUS_COMPLETED);
if ($this->get('invoicing_enable') === 'true') {
if ('true' === $this->get('invoicing_enable')) {
$this->setInvoice($sale['id']);
}
}
@ -1195,7 +1196,7 @@ class BuyCoursesPlugin extends Plugin
);
$numInvoice = 1;
if ($item !== false) {
if (false !== $item) {
$numInvoice = (int) ($item['num_invoice'] + 1);
}
} else {
@ -1350,7 +1351,7 @@ class BuyCoursesPlugin extends Plugin
$salt .= $uppercase ? 'ACDEFHKNPRSTUVWXYZ' : '';
$salt .= $numbers ? (strlen($salt) ? '2345679' : '0123456789') : '';
if (strlen($salt) == 0) {
if (0 == strlen($salt)) {
return '';
}
@ -1358,7 +1359,7 @@ class BuyCoursesPlugin extends Plugin
srand((float) microtime() * 1000000);
for ($i = 0; $i < $length; $i++) {
for ($i = 0; $i < $length; ++$i) {
$numbers = rand(0, strlen($salt) - 1);
$str .= substr($salt, $numbers, 1);
}
@ -1479,7 +1480,7 @@ class BuyCoursesPlugin extends Plugin
$item = $this->getItemByProduct($course->getId(), self::PRODUCT_TYPE_COURSE);
if ($item !== false) {
if (false !== $item) {
$courseItem['item_id'] = $item['id'];
$courseItem['visible'] = true;
$courseItem['currency'] = $item['iso_code'];
@ -1550,7 +1551,7 @@ class BuyCoursesPlugin extends Plugin
'first'
);
if ($item !== false) {
if (false !== $item) {
$sessionItem['item_id'] = $item['id'];
$sessionItem['visible'] = true;
$sessionItem['currency'] = $item['iso_code'];
@ -1714,9 +1715,8 @@ class BuyCoursesPlugin extends Plugin
{
$sale = $this->getSale($saleId);
$item = $this->getItemByProduct($sale['product_id'], $sale['product_type']);
$itemBeneficiaries = $this->getItemBeneficiaries($item['id']);
return $itemBeneficiaries;
return $this->getItemBeneficiaries($item['id']);
}
/**
@ -1733,9 +1733,9 @@ class BuyCoursesPlugin extends Plugin
$payoutId = false,
$userId = false
) {
$condition = ($payoutId) ? 'AND p.id = '.((int) $payoutId) : '';
$condition2 = ($userId) ? ' AND p.user_id = '.((int) $userId) : '';
$typeResult = ($condition) ? 'first' : 'all';
$condition = $payoutId ? 'AND p.id = '.((int) $payoutId) : '';
$condition2 = $userId ? ' AND p.user_id = '.((int) $userId) : '';
$typeResult = $condition ? 'first' : 'all';
$payoutsTable = Database::get_main_table(self::TABLE_PAYPAL_PAYOUTS);
$saleTable = Database::get_main_table(self::TABLE_SALE);
$currencyTable = Database::get_main_table(self::TABLE_CURRENCY);
@ -1744,7 +1744,7 @@ class BuyCoursesPlugin extends Plugin
$extraFieldValues = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$paypalExtraField = Database::select(
"*",
'*',
$extraFieldTable,
[
'where' => ['variable = ?' => 'paypal'],
@ -1761,19 +1761,17 @@ class BuyCoursesPlugin extends Plugin
INNER JOIN $saleTable s ON s.id = p.sale_id
INNER JOIN $currencyTable c ON s.currency_id = c.id
LEFT JOIN $extraFieldValues efv ON p.user_id = efv.item_id
AND field_id = ".((int) $paypalExtraField['id'])."
";
AND field_id = ".((int) $paypalExtraField['id']).'
';
$payouts = Database::select(
"p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code",
return Database::select(
'p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code',
"$payoutsTable p $innerJoins",
[
'where' => ['p.status = ? '.$condition.' '.$condition2 => $status],
],
$typeResult
);
return $payouts;
}
/**
@ -1815,7 +1813,7 @@ class BuyCoursesPlugin extends Plugin
return false;
}
if ($paypalAccount['value'] === '') {
if ('' === $paypalAccount['value']) {
return false;
}
@ -1837,7 +1835,7 @@ class BuyCoursesPlugin extends Plugin
$sale = $this->getSale($saleId);
$commission = (int) $platformCommission['commission'];
$teachersCommission = number_format(
(floatval($sale['price']) * $commission) / 100,
(float) ($sale['price']) * $commission / 100,
2
);
@ -1852,7 +1850,7 @@ class BuyCoursesPlugin extends Plugin
'sale_id' => (int) $saleId,
'user_id' => $beneficiary['user_id'],
'commission' => number_format(
(floatval($teachersCommission) * $beneficiaryCommission) / 100,
(float) $teachersCommission * $beneficiaryCommission / 100,
2
),
'status' => self::PAYOUT_STATUS_PENDING,
@ -1929,7 +1927,7 @@ class BuyCoursesPlugin extends Plugin
'name' => Security::remove_XSS($service['name']),
'description' => Security::remove_XSS($service['description']),
'price' => $service['price'],
'tax_perc' => $service['tax_perc'] != '' ? (int) $service['tax_perc'] : null,
'tax_perc' => '' != $service['tax_perc'] ? (int) $service['tax_perc'] : null,
'duration_days' => (int) $service['duration_days'],
'applies_to' => (int) $service['applies_to'],
'owner_id' => (int) $service['owner_id'],
@ -1984,7 +1982,7 @@ class BuyCoursesPlugin extends Plugin
'name' => Security::remove_XSS($service['name']),
'description' => Security::remove_XSS($service['description']),
'price' => $service['price'],
'tax_perc' => $service['tax_perc'] != '' ? (int) $service['tax_perc'] : null,
'tax_perc' => '' != $service['tax_perc'] ? (int) $service['tax_perc'] : null,
'duration_days' => (int) $service['duration_days'],
'applies_to' => (int) $service['applies_to'],
'owner_id' => (int) $service['owner_id'],
@ -2035,7 +2033,7 @@ class BuyCoursesPlugin extends Plugin
$product['tax_amount'] = 0;
$precision = 2;
if ($this->checkTaxEnabledInProduct($productType)) {
if (is_null($product['tax_perc'])) {
if (null === $product['tax_perc']) {
$globalParameters = $this->getGlobalParameters();
$globalTaxPerc = $globalParameters['global_tax_perc'];
$taxPerc = $globalTaxPerc;
@ -2126,7 +2124,7 @@ class BuyCoursesPlugin extends Plugin
$typeResult
);
if ($typeResult === 'count') {
if ('count' === $typeResult) {
return $return;
}
@ -2309,7 +2307,7 @@ class BuyCoursesPlugin extends Plugin
public function completeServiceSale($serviceSaleId)
{
$serviceSale = $this->getServiceSale($serviceSaleId);
if ($serviceSale['status'] == self::SERVICE_STATUS_COMPLETED) {
if (self::SERVICE_STATUS_COMPLETED == $serviceSale['status']) {
return true;
}
@ -2318,7 +2316,7 @@ class BuyCoursesPlugin extends Plugin
self::SERVICE_STATUS_COMPLETED
);
if ($this->get('invoicing_enable') === 'true') {
if ('true' === $this->get('invoicing_enable')) {
$this->setInvoice($serviceSaleId, 1);
}
@ -2356,7 +2354,7 @@ class BuyCoursesPlugin extends Plugin
$whereConditions['AND s.price <= ?'] = $max;
}
if (!$appliesTo == '') {
if ('' == !$appliesTo) {
$whereConditions['AND s.applies_to = ?'] = $appliesTo;
}
@ -2371,7 +2369,7 @@ class BuyCoursesPlugin extends Plugin
$typeResult
);
if ($typeResult === 'count') {
if ('count' === $typeResult) {
return $return;
}
@ -2413,18 +2411,18 @@ class BuyCoursesPlugin extends Plugin
$price = $service['price'];
$priceWithoutTax = null;
$taxPerc = null;
$taxEnable = $this->get('tax_enable') === 'true';
$taxEnable = 'true' === $this->get('tax_enable');
$globalParameters = $this->getGlobalParameters();
$taxAppliesTo = $globalParameters['tax_applies_to'];
$taxAmount = 0;
if ($taxEnable &&
($taxAppliesTo == self::TAX_APPLIES_TO_ALL || $taxAppliesTo == self::TAX_APPLIES_TO_ONLY_SERVICES)
(self::TAX_APPLIES_TO_ALL == $taxAppliesTo || self::TAX_APPLIES_TO_ONLY_SERVICES == $taxAppliesTo)
) {
$priceWithoutTax = $service['price'];
$globalTaxPerc = $globalParameters['global_tax_perc'];
$precision = 2;
$taxPerc = is_null($service['tax_perc']) ? $globalTaxPerc : $service['tax_perc'];
$taxPerc = null === $service['tax_perc'] ? $globalTaxPerc : $service['tax_perc'];
$taxAmount = round($priceWithoutTax * $taxPerc / 100, $precision);
$price = $priceWithoutTax + $taxAmount;
}
@ -2457,9 +2455,7 @@ class BuyCoursesPlugin extends Plugin
'payment_type' => (int) $paymentType,
];
$returnedServiceSaleId = Database::insert(self::TABLE_SERVICES_SALE, $values);
return $returnedServiceSaleId;
return Database::insert(self::TABLE_SERVICES_SALE, $values);
}
/**
@ -2511,13 +2507,13 @@ class BuyCoursesPlugin extends Plugin
'sale_email' => $params['sale_email'],
];
if ($this->get('tax_enable') === 'true') {
if ('true' === $this->get('tax_enable')) {
$sqlParams['global_tax_perc'] = $params['global_tax_perc'];
$sqlParams['tax_applies_to'] = $params['tax_applies_to'];
$sqlParams['tax_name'] = $params['tax_name'];
}
if ($this->get('invoicing_enable') === 'true') {
if ('true' === $this->get('invoicing_enable')) {
$sqlParams['seller_name'] = $params['seller_name'];
$sqlParams['seller_id'] = $params['seller_id'];
$sqlParams['seller_address'] = $params['seller_address'];
@ -2555,13 +2551,13 @@ class BuyCoursesPlugin extends Plugin
*/
public function checkTaxEnabledInProduct($productType)
{
if (empty($this->get('tax_enable') === 'true')) {
if (empty('true' === $this->get('tax_enable'))) {
return false;
}
$globalParameters = $this->getGlobalParameters();
$taxAppliesTo = $globalParameters['tax_applies_to'];
if ($taxAppliesTo == self::TAX_APPLIES_TO_ALL) {
if (self::TAX_APPLIES_TO_ALL == $taxAppliesTo) {
return true;
}
@ -2628,10 +2624,12 @@ class BuyCoursesPlugin extends Plugin
case self::PRODUCT_TYPE_COURSE:
$courseInfo = api_get_course_info_by_id($saleInfo['product_id']);
$url = api_get_course_url($courseInfo['code']);
break;
case self::PRODUCT_TYPE_SESSION:
$sessionId = (int) $saleInfo['product_id'];
$url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionId;
break;
default:
$url = '#';
@ -2660,7 +2658,7 @@ class BuyCoursesPlugin extends Plugin
$qb2 = $em->createQueryBuilder();
$qb3 = $em->createQueryBuilder();
$qb = $qb
return $qb
->select('c')
->from('ChamiloCoreBundle:Course', 'c')
->where(
@ -2695,8 +2693,6 @@ class BuyCoursesPlugin extends Plugin
)
->setFirstResult($first)
->setMaxResults($maxResults);
return $qb;
}
/**
@ -2839,8 +2835,8 @@ class BuyCoursesPlugin extends Plugin
$itemTable = Database::get_main_table(self::TABLE_ITEM);
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION);
$min = floatval($min);
$max = floatval($max);
$min = (float) $min;
$max = (float) $max;
$innerJoin = "$itemTable i ON s.id = i.product_id";
$whereConditions = [
@ -2869,7 +2865,7 @@ class BuyCoursesPlugin extends Plugin
$typeResult
);
if ($typeResult === 'count') {
if ('count' === $typeResult) {
return $sessionIds;
}
@ -2906,8 +2902,8 @@ class BuyCoursesPlugin extends Plugin
$urlId = api_get_current_access_url_id();
$min = floatval($min);
$max = floatval($max);
$min = (float) $min;
$max = (float) $max;
$whereConditions = [
'i.product_type = ? ' => self::PRODUCT_TYPE_COURSE,
@ -2941,7 +2937,7 @@ class BuyCoursesPlugin extends Plugin
$typeResult
);
if ($typeResult === 'count') {
if ('count' === $typeResult) {
return $courseIds;
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Course;
@ -8,8 +9,6 @@ use Chamilo\UserBundle\Entity\User;
/**
* Responses to AJAX calls.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -38,6 +37,7 @@ switch ($action) {
} else {
echo '<b style="color: red; font-size: 70%;">* '.$plugin->get_lang('NoPayPalAccountDetected').'</b>';
}
break;
case 'saleInfo':
if (api_is_anonymous()) {
@ -46,18 +46,17 @@ switch ($action) {
$saleId = isset($_POST['id']) ? (int) $_POST['id'] : '';
$sale = $plugin->getSale($saleId);
$productType = $sale['product_type'] == 1 ? get_lang('Course') : get_lang('Session');
$paymentType = $sale['payment_type'] == 1 ? 'Paypal' : $plugin->get_lang('BankTransfer');
$productInfo = $sale['product_type'] == 1
$productType = 1 == $sale['product_type'] ? get_lang('Course') : get_lang('Session');
$paymentType = 1 == $sale['payment_type'] ? 'Paypal' : $plugin->get_lang('BankTransfer');
$productInfo = 1 == $sale['product_type']
? api_get_course_info_by_id($sale['product_id'])
: api_get_session_info($sale['product_id']);
$currency = $plugin->getSelectedCurrency();
if ($sale['product_type'] == 1) {
if (1 == $sale['product_type']) {
$productImage = $productInfo['course_image_large'];
} else {
$productImage = ($productInfo['image'])
? $productInfo['image']
: Template::get_icon_path('session_default.png');
$productImage = $productInfo['image']
?: Template::get_icon_path('session_default.png');
}
$userInfo = api_get_user_info($sale['user_id']);
@ -84,6 +83,7 @@ switch ($action) {
$html .= '</div>';
echo $html;
break;
case 'stats':
if (api_is_anonymous()) {
@ -124,19 +124,20 @@ switch ($action) {
$html = '<div class="row">'
.'<p>'
.'<ul>'
.'<li>'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").' <b>'.$stats['completed_count']
.'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['completed_total_amount'].' '
.'<li>'.get_plugin_lang('PayoutsTotalCompleted', 'BuyCoursesPlugin').' <b>'.$stats['completed_count']
.'</b> - '.get_plugin_lang('TotalAmount', 'BuyCoursesPlugin').' <b>'.$stats['completed_total_amount'].' '
.$currency['iso_code'].'</b></li>'
.'<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").' <b>'.$stats['pending_count'].'</b> - '
.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['pending_total_amount'].' '
.'<li>'.get_plugin_lang('PayoutsTotalPending', 'BuyCoursesPlugin').' <b>'.$stats['pending_count'].'</b> - '
.get_plugin_lang('TotalAmount', 'BuyCoursesPlugin').' <b>'.$stats['pending_total_amount'].' '
.$currency['iso_code'].'</b></li>'
.'<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").' <b>'.$stats['canceled_count']
.'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").' <b>'.$stats['canceled_total_amount'].' '
.'<li>'.get_plugin_lang('PayoutsTotalCanceled', 'BuyCoursesPlugin').' <b>'.$stats['canceled_count']
.'</b> - '.get_plugin_lang('TotalAmount', 'BuyCoursesPlugin').' <b>'.$stats['canceled_total_amount'].' '
.$currency['iso_code'].'</b></li>'
.'</ul>'
.'</p>';
$html .= '</div>';
echo $html;
break;
case 'processPayout':
if (api_is_anonymous()) {
@ -152,10 +153,11 @@ switch ($action) {
if (!$payouts) {
echo Display::return_message(
get_plugin_lang("SelectOptionToProceed", "BuyCoursesPlugin"),
get_plugin_lang('SelectOptionToProceed', 'BuyCoursesPlugin'),
'error',
false
);
break;
}
@ -165,24 +167,25 @@ switch ($action) {
foreach ($allPays as $payout) {
$totalPayout += number_format($payout['commission'], 2);
$totalAccounts++;
++$totalAccounts;
}
$currentCurrency = $plugin->getSelectedCurrency();
$isoCode = $currentCurrency['iso_code'];
$html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
$html .= '<p>'.get_plugin_lang('VerifyTotalAmountToProceedPayout', 'BuyCoursesPlugin').'</p>';
$html .= ''
.'<p>'
.'<ul>'
.'<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>'
.'<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
.'<li>'.get_plugin_lang('TotalAcounts', 'BuyCoursesPlugin').' <b>'.$totalAccounts.'</b></li>'
.'<li>'.get_plugin_lang('TotalPayout', 'BuyCoursesPlugin').' <b>'.$isoCode.' '.$totalPayout.'</b></li>'
.'</ul>'
.'</p>';
$html .= '<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>';
$html .= '<p>'.get_plugin_lang('CautionThisProcessCantBeCanceled', 'BuyCoursesPlugin').'</p>';
$html .= '<br /><br />';
$html .= '<div id="spinner" class="text-center"></div>';
echo $html;
break;
case 'proceedPayout':
if (api_is_anonymous()) {
@ -191,12 +194,12 @@ switch ($action) {
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$pruebas = 1 == $paypalParams['sandbox'];
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
require_once "paypalfunctions.php";
require_once 'paypalfunctions.php';
$allPayouts = [];
$totalAccounts = 0;
@ -206,10 +209,11 @@ switch ($action) {
if (!$payouts) {
echo Display::return_message(
get_plugin_lang("SelectOptionToProceed", "BuyCoursesPlugin"),
get_plugin_lang('SelectOptionToProceed', 'BuyCoursesPlugin'),
'error',
false
);
break;
}
@ -223,19 +227,19 @@ switch ($action) {
$currentCurrency = $plugin->getSelectedCurrency();
$isoCode = $currentCurrency['iso_code'];
$result = MassPayment($allPayouts, $isoCode);
if ($result['ACK'] === 'Success') {
if ('Success' === $result['ACK']) {
foreach ($allPayouts as $payout) {
$plugin->setStatusPayouts(
$payout['id'],
BuyCoursesPlugin::PAYOUT_STATUS_COMPLETED
);
if ($plugin->get('invoicing_enable') === 'true') {
if ('true' === $plugin->get('invoicing_enable')) {
$plugin->setInvoice($payout['id']);
}
}
echo Display::return_message(
get_plugin_lang("PayoutSuccess", "BuyCoursesPlugin"),
get_plugin_lang('PayoutSuccess', 'BuyCoursesPlugin'),
'success',
false
);
@ -247,6 +251,7 @@ switch ($action) {
false
);
}
break;
case 'cancelPayout':
if (api_is_anonymous()) {
@ -301,19 +306,19 @@ switch ($action) {
try {
$cargo = $culqi->Cargos->create([
"moneda" => $currency['iso_code'],
"monto" => intval(floatval($sale['price']) * 100),
"usuario" => $user['username'],
"descripcion" => $sale['product_name'],
"pedido" => $sale['reference'],
"codigo_pais" => "PE",
"direccion" => get_lang('none'),
"ciudad" => get_lang('none'),
"telefono" => 0,
"nombres" => $user['firstname'],
"apellidos" => $user['lastname'],
"correo_electronico" => $user['email'],
"token" => $tokenId,
'moneda' => $currency['iso_code'],
'monto' => (int) ((float) ($sale['price']) * 100),
'usuario' => $user['username'],
'descripcion' => $sale['product_name'],
'pedido' => $sale['reference'],
'codigo_pais' => 'PE',
'direccion' => get_lang('none'),
'ciudad' => get_lang('none'),
'telefono' => 0,
'nombres' => $user['firstname'],
'apellidos' => $user['lastname'],
'correo_electronico' => $user['email'],
'token' => $tokenId,
]);
if (is_object($cargo)) {
@ -349,6 +354,7 @@ switch ($action) {
);
}
}
break;
case 'culqi_cargo_service':
if (!$culqiEnable) {
@ -387,19 +393,19 @@ switch ($action) {
try {
$cargo = $culqi->Cargos->create([
"moneda" => $serviceSale['currency'],
"monto" => intval(floatval($serviceSale['price']) * 100),
"usuario" => $user['username'],
"descripcion" => $serviceSale['service']['name'],
"pedido" => $serviceSale['reference'],
"codigo_pais" => "PE",
"direccion" => get_lang('none'),
"ciudad" => get_lang('none'),
"telefono" => 0,
"nombres" => $user['firstname'],
"apellidos" => $user['lastname'],
"correo_electronico" => $user['email'],
"token" => $tokenId,
'moneda' => $serviceSale['currency'],
'monto' => (int) ((float) ($serviceSale['price']) * 100),
'usuario' => $user['username'],
'descripcion' => $serviceSale['service']['name'],
'pedido' => $serviceSale['reference'],
'codigo_pais' => 'PE',
'direccion' => get_lang('none'),
'ciudad' => get_lang('none'),
'telefono' => 0,
'nombres' => $user['firstname'],
'apellidos' => $user['lastname'],
'correo_electronico' => $user['email'],
'token' => $tokenId,
]);
if (is_object($cargo)) {
@ -442,6 +448,7 @@ switch ($action) {
);
}
}
break;
case 'service_sale_info':
$id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
@ -454,32 +461,32 @@ switch ($action) {
$ajaxCallFile = $plugin->getPath('SRC').'buycourses.ajax.php';
$serviceImg = $plugin->getPath('SERVICE_IMAGES').$serviceSale['service']['image'];
$html = "<img class='img-responsive text-center' src='$serviceImg'>";
$html .= "<br />";
$html .= '<br />';
$html .= "<legend>{$plugin->get_lang('ServiceInformation')}</legend>";
$html .= "<ul>";
$html .= '<ul>';
$html .= "<li><b>{$plugin->get_lang('ServiceName')}:</b> {$serviceSale['service']['name']}</li> ";
$html .= "<li><b>{$plugin->get_lang('Description')}:</b> {$serviceSale['service']['description']}</li> ";
$nodeType = $serviceSale['node_type'];
$nodeName = '';
if ($nodeType == BuyCoursesPlugin::SERVICE_TYPE_USER) {
if (BuyCoursesPlugin::SERVICE_TYPE_USER == $nodeType) {
$nodeType = get_lang('User');
/** @var User $user */
$user = UserManager::getManager()->find($serviceSale['node_id']);
$nodeName = $user ? UserManager::formatUserFullName($user, true) : null;
} else {
if ($nodeType == BuyCoursesPlugin::SERVICE_TYPE_COURSE) {
if (BuyCoursesPlugin::SERVICE_TYPE_COURSE == $nodeType) {
$nodeType = get_lang('Course');
/** @var Course $course */
$course = $em->find('ChamiloCoreBundle:Course', $serviceSale['node_id']);
$nodeName = $course ? $course->getTitle() : null;
} else {
if ($nodeType == BuyCoursesPlugin::SERVICE_TYPE_SESSION) {
if (BuyCoursesPlugin::SERVICE_TYPE_SESSION == $nodeType) {
$nodeType = get_lang('Session');
/** @var Session $session */
$session = $em->find('ChamiloCoreBundle:Session', $serviceSale['node_id']);
$nodeName = $session ? $session->getName() : null;
} else {
if ($nodeType == BuyCoursesPlugin::SERVICE_TYPE_LP_FINAL_ITEM) {
if (BuyCoursesPlugin::SERVICE_TYPE_LP_FINAL_ITEM == $nodeType) {
$nodeType = get_lang('Certificate of completion');
/** @var CLp $lp */
$lp = $em->find('ChamiloCourseBundle:CLp', $serviceSale['node_id']);
@ -489,22 +496,22 @@ switch ($action) {
}
}
$html .= "</ul>";
$html .= '</ul>';
$html .= "<legend>{$plugin->get_lang('SaleInfo')}</legend>";
$html .= "<ul>";
$html .= '<ul>';
$html .= "<li><b>{$plugin->get_lang('BoughtBy')}:</b> {$serviceSale['buyer']['name']}</li> ";
$html .= "<li><b>{$plugin->get_lang('PurchaserUser')}:</b> {$serviceSale['buyer']['username']}</li> ";
$html .= "<li><b>{$plugin->get_lang('Total')}:</b> {$serviceSale['service']['total_price']}</li> ";
$orderDate = api_format_date($serviceSale['buy_date'], DATE_FORMAT_LONG);
$html .= "<li><b>{$plugin->get_lang('OrderDate')}:</b> $orderDate</li> ";
$paymentType = $serviceSale['payment_type'];
if ($paymentType == BuyCoursesPlugin::PAYMENT_TYPE_PAYPAL) {
if (BuyCoursesPlugin::PAYMENT_TYPE_PAYPAL == $paymentType) {
$paymentType = 'PayPal';
} else {
if ($paymentType == BuyCoursesPlugin::PAYMENT_TYPE_TRANSFER) {
if (BuyCoursesPlugin::PAYMENT_TYPE_TRANSFER == $paymentType) {
$paymentType = $plugin->get_lang('BankTransfer');
} else {
if ($paymentType == BuyCoursesPlugin::PAYMENT_TYPE_CULQI) {
if (BuyCoursesPlugin::PAYMENT_TYPE_CULQI == $paymentType) {
$paymentType = 'Culqi';
}
}
@ -512,54 +519,55 @@ switch ($action) {
$html .= "<li><b>{$plugin->get_lang('PaymentMethod')}:</b> $paymentType</li> ";
$status = $serviceSale['status'];
$buttons = '';
if ($status == BuyCoursesPlugin::SERVICE_STATUS_COMPLETED) {
if (BuyCoursesPlugin::SERVICE_STATUS_COMPLETED == $status) {
$status = $plugin->get_lang('active');
} else {
if ($status == BuyCoursesPlugin::SERVICE_STATUS_PENDING) {
if (BuyCoursesPlugin::SERVICE_STATUS_PENDING == $status) {
$status = $plugin->get_lang('Pending');
if ($isAdmin) {
$buttons .= "<a id='{$serviceSale['id']}' tag='service_sale_confirm' class='btn btn-success pull-left'>{$plugin->get_lang('ConfirmOrder')}</a>";
$buttons .= "<a id='{$serviceSale['id']}' tag='service_sale_cancel' class='btn btn-danger pull-right'>{$plugin->get_lang('CancelOrder')}</a>";
}
} else {
if ($status == BuyCoursesPlugin::SERVICE_STATUS_CANCELLED) {
if (BuyCoursesPlugin::SERVICE_STATUS_CANCELLED == $status) {
$status = $plugin->get_lang('Cancelled');
}
}
}
$html .= "<li><b>{$plugin->get_lang('Status')}:</b> $status</li> ";
$html .= "</ul>";
$html .= "<br />";
$html .= '</ul>';
$html .= '<br />';
$html .= "<div class='row'>";
$html .= "<div class='col-md-2'></div>";
$html .= "<div class='col-md-8 text-center'>";
$html .= "<div class='bc-action-buttons'>";
$html .= $buttons;
$html .= "</div>";
$html .= "</div>";
$html .= '</div>';
$html .= '</div>';
$html .= "<div class='col-md-2'></div>";
$html .= "<script>";
$html .= '<script>';
$html .= "$('.bc-action-buttons a').click(function() {";
$html .= "var id = $(this).attr('id');";
$html .= "var action = $(this).attr('tag');";
$html .= "$.ajax({";
$html .= '$.ajax({';
$html .= "data: 'id='+id,";
$html .= "url: '$ajaxCallFile?a='+action,";
$html .= "type: 'POST',";
$html .= "beforeSend: function() {";
$html .= 'beforeSend: function() {';
$processingLoaderText = $plugin->get_lang('ProcessingDontCloseThisWindow');
$html .= "$('.bootbox-close-button').remove();";
$html .= "$('.btn-default').attr('disabled', true);";
$html .= "$('.bc-action-buttons').html('<div class=\"wobblebar-loader\"></div><p> $processingLoaderText</p>');";
$html .= "},";
$html .= "success: function(response) {";
$html .= '},';
$html .= 'success: function(response) {';
$html .= "$('.bc-action-buttons').html(response);";
$html .= "},";
$html .= "});";
$html .= "});";
$html .= "</script>";
$html .= '},';
$html .= '});';
$html .= '});';
$html .= '</script>';
echo $html;
break;
case 'service_sale_confirm':
$id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
@ -576,14 +584,15 @@ switch ($action) {
$html .= Display::return_message('Error - '.$plugin->get_lang('There happened an unknown error. Please contact the platform administrator.'), 'error');
}
$html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish')."</a>";
$html .= "</div>";
$html .= "<script>";
$html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish').'</a>';
$html .= '</div>';
$html .= '<script>';
$html .= "$('#finish-button').click(function() {";
$html .= "location.reload();";
$html .= "});";
$html .= "</script>";
$html .= 'location.reload();';
$html .= '});';
$html .= '</script>';
echo $html;
break;
case 'service_sale_cancel':
$id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
@ -600,13 +609,14 @@ switch ($action) {
$html .= Display::return_message('Error - '.$plugin->get_lang('There happened an unknown error. Please contact the platform administrator.'), 'error');
}
$html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish')."</a>";
$html .= "</div>";
$html .= "<script>";
$html .= "<a id='finish-button' class='btn btn-primary'>".$plugin->get_lang('ClickHereToFinish').'</a>';
$html .= '</div>';
$html .= '<script>';
$html .= "$('#finish-button').click(function() {";
$html .= "location.reload();";
$html .= "});";
$html .= "</script>";
$html .= 'location.reload();';
$html .= '});';
$html .= '</script>';
echo $html;
break;
}

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* Configuration script for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -22,15 +21,15 @@ if (empty($id) || empty($type)) {
$plugin = BuyCoursesPlugin::create();
$commissionsEnable = $plugin->get('commissions_enable');
if ($commissionsEnable == 'true') {
if ('true' == $commissionsEnable) {
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_PLUGIN_PATH)
.'buycourses/resources/js/commissions.js"></script>';
$commissions = '';
}
$includeSession = $plugin->get('include_sessions') === 'true';
$editingCourse = $type === BuyCoursesPlugin::PRODUCT_TYPE_COURSE;
$editingSession = $type === BuyCoursesPlugin::PRODUCT_TYPE_SESSION;
$includeSession = 'true' === $plugin->get('include_sessions');
$editingCourse = BuyCoursesPlugin::PRODUCT_TYPE_COURSE === $type;
$editingSession = BuyCoursesPlugin::PRODUCT_TYPE_SESSION === $type;
$entityManager = Database::getManager();
$userRepo = UserManager::getRepository();
@ -72,7 +71,7 @@ if ($editingCourse) {
$currentBeneficiaries = $plugin->getItemBeneficiaries($courseItem['item_id']);
if (!empty($currentBeneficiaries)) {
$defaultBeneficiaries = array_column($currentBeneficiaries, 'user_id');
if ($commissionsEnable === 'true') {
if ('true' === $commissionsEnable) {
$defaultCommissions = array_column($currentBeneficiaries, 'commissions');
foreach ($defaultCommissions as $defaultCommission) {
$commissions .= $defaultCommission.',';
@ -91,7 +90,7 @@ if ($editingCourse) {
'price' => $courseItem['price'],
'tax_perc' => $courseItem['tax_perc'],
'beneficiaries' => $defaultBeneficiaries,
$commissionsEnable == 'true' ? 'commissions' : '' => $commissionsEnable == 'true' ? $commissions : '',
'true' == $commissionsEnable ? 'commissions' : '' => 'true' == $commissionsEnable ? $commissions : '',
];
} elseif ($editingSession) {
if (!$includeSession) {
@ -136,7 +135,7 @@ if ($editingCourse) {
if (!empty($currentBeneficiaries)) {
$defaultBeneficiaries = array_column($currentBeneficiaries, 'user_id');
if ($commissionsEnable == 'true') {
if ('true' == $commissionsEnable) {
$defaultCommissions = array_column($currentBeneficiaries, 'commissions');
foreach ($defaultCommissions as $defaultCommission) {
@ -157,13 +156,13 @@ if ($editingCourse) {
'price' => $sessionItem['price'],
'tax_perc' => $sessionItem['tax_perc'],
'beneficiaries' => $defaultBeneficiaries,
$commissionsEnable == 'true' ? 'commissions' : '' => $commissionsEnable == 'true' ? $commissions : '',
'true' == $commissionsEnable ? 'commissions' : '' => 'true' == $commissionsEnable ? $commissions : '',
];
} else {
api_not_allowed(true);
}
if ($commissionsEnable === 'true') {
if ('true' === $commissionsEnable) {
$htmlHeadXtra[] = "
<script>
$(function() {
@ -228,7 +227,7 @@ if ($editingCourse) {
$beneficiariesSelect->addOptGroup($courseCoachesOptions, get_lang('Session course coach'));
}
if ($commissionsEnable === 'true') {
if ('true' === $commissionsEnable) {
$platformCommission = $plugin->getPlatformCommission();
$form->addHtml(
'
@ -266,11 +265,11 @@ if ($form->validate()) {
$productItem = $plugin->getItemByProduct($id, $type);
if (isset($formValues['visible'])) {
$taxPerc = $formValues['tax_perc'] != '' ? (int) $formValues['tax_perc'] : null;
$taxPerc = '' != $formValues['tax_perc'] ? (int) $formValues['tax_perc'] : null;
if (!empty($productItem)) {
$plugin->updateItem(
[
'price' => floatval($formValues['price']),
'price' => (float) ($formValues['price']),
'tax_perc' => $taxPerc,
],
$id,
@ -281,7 +280,7 @@ if ($form->validate()) {
'currency_id' => (int) $currency['id'],
'product_type' => $type,
'product_id' => $id,
'price' => floatval($_POST['price']),
'price' => (float) ($_POST['price']),
'tax_perc' => $taxPerc,
]);
$productItem['id'] = $itemId;
@ -290,10 +289,10 @@ if ($form->validate()) {
$plugin->deleteItemBeneficiaries($productItem['id']);
if (isset($formValues['beneficiaries'])) {
if ($commissionsEnable === 'true') {
if ('true' === $commissionsEnable) {
$usersId = $formValues['beneficiaries'];
$commissions = explode(',', $formValues['commissions']);
$commissions = (count($usersId) != count($commissions))
$commissions = count($usersId) != count($commissions)
? array_fill(0, count($usersId), 0)
: $commissions;
$beneficiaries = array_combine($usersId, $commissions);

@ -1,18 +1,17 @@
<?php
/* For license terms, see /license.txt */
/**
* List of courses.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSessions = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$includeSessions = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
$nameFilter = '';
$minFilter = 0;

@ -1,18 +1,17 @@
<?php
/* For license terms, see /license.txt */
/**
* User Panel.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSessions = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$includeSessions = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
$userInfo = api_get_user_info();
@ -25,7 +24,7 @@ $sales = $plugin->getSaleListByUserId($userInfo['id']);
$saleList = [];
foreach ($sales as $sale) {
if ($sale['product_type'] == 1) {
if (1 == $sale['product_type']) {
$saleList[] = [
'id' => $sale['id'],
'reference' => $sale['reference'],

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Errors management for the Buy Courses plugin - Redirects to course_catalog.php.
*
* @package chamilo.plugin.buycourses
*/
/**
* Config.

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* PayPal Express Checkout Module.
*
* @package chamilo.plugin.buycourses
*/
/**
* Init.
@ -15,13 +14,13 @@ require_once 'paypalfunctions.php';
* earlier in a session variable
* by the shopping cart page.
*/
$paymentAmount = $_SESSION["Payment_Amount"];
$paymentAmount = $_SESSION['Payment_Amount'];
/**
* The currencyCodeType and paymentType
* are set to the selections made on the Integration Assistant.
*/
$paymentType = "Sale";
$paymentType = 'Sale';
/**
* Calls the SetExpressCheckout API call
@ -29,19 +28,19 @@ $paymentType = "Sale";
* it is included at the top of this file.
*/
$resArray = CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
RedirectToPayPal($resArray["TOKEN"]);
$ack = strtoupper($resArray['ACK']);
if ('SUCCESS' == $ack || 'SUCCESSWITHWARNING' == $ack) {
RedirectToPayPal($resArray['TOKEN']);
} else {
//Display a user friendly Error on the page using any of the following error information returned by PayPal
$ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
$ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
$ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
$ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
$ErrorCode = urldecode($resArray['L_ERRORCODE0']);
$ErrorShortMsg = urldecode($resArray['L_SHORTMESSAGE0']);
$ErrorLongMsg = urldecode($resArray['L_LONGMESSAGE0']);
$ErrorSeverityCode = urldecode($resArray['L_SEVERITYCODE0']);
echo "SetExpressCheckout API call failed. ";
echo "Detailed Error Message: ".$ErrorLongMsg;
echo "Short Error Message: ".$ErrorShortMsg;
echo "Error Code: ".$ErrorCode;
echo "Error Severity Code: ".$ErrorSeverityCode;
echo 'SetExpressCheckout API call failed. ';
echo 'Detailed Error Message: '.$ErrorLongMsg;
echo 'Short Error Message: '.$ErrorShortMsg;
echo 'Error Code: '.$ErrorCode;
echo 'Error Severity Code: '.$ErrorSeverityCode;
}

@ -1,15 +1,14 @@
<?php
/* For license terms, see /license.txt */
/**
* Index of the Buy Courses plugin courses list.
*
* @package chamilo.plugin.buycourses
*/
$plugin = BuyCoursesPlugin::create();
$allow = $plugin->get('unregistered_users_enable');
if (($allow === 'true' && api_is_anonymous()) || !api_is_anonymous()) {
if (('true' === $allow && api_is_anonymous()) || !api_is_anonymous()) {
$tpl = new Template();
$content = $tpl->fetch('buycourses/view/index.tpl');
$tpl->assign('content', $content);

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
/**
* Print invoice of the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -16,7 +15,7 @@ api_protect_admin_script();
$plugin = BuyCoursesPlugin::create();
$invoicingEnable = $plugin->get('invoicing_enable') === 'true';
$invoicingEnable = 'true' === $plugin->get('invoicing_enable');
if (!$invoicingEnable) {
api_not_allowed(true, $plugin->get_lang('NoInvoiceEnable'));
}
@ -31,10 +30,10 @@ $extraUserInfoData = UserManager::get_extra_user_data($infoSale['user_id']);
$infoInvoice = $plugin->getDataInvoice($saleId, $isService);
$taxAppliesTo = $globalParameters['tax_applies_to'];
$taxEnable = $plugin->get('tax_enable') === 'true' &&
($taxAppliesTo == BuyCoursesPlugin::TAX_APPLIES_TO_ALL ||
($taxAppliesTo == BuyCoursesPlugin::TAX_APPLIES_TO_ONLY_COURSE && !$isService) ||
($taxAppliesTo == BuyCoursesPlugin::TAX_APPLIES_TO_ONLY_SESSION && $isService));
$taxEnable = 'true' === $plugin->get('tax_enable') &&
(BuyCoursesPlugin::TAX_APPLIES_TO_ALL == $taxAppliesTo ||
(BuyCoursesPlugin::TAX_APPLIES_TO_ONLY_COURSE == $taxAppliesTo && !$isService) ||
(BuyCoursesPlugin::TAX_APPLIES_TO_ONLY_SESSION == $taxAppliesTo && $isService));
$htmlText = '<html>';
$htmlText .= '<link rel="stylesheet" type="text/css" href="plugin.css">';
@ -44,7 +43,7 @@ $htmlText .= '<body>';
$organization = ChamiloApi::getPlatformLogo('', [], true);
// Use custom logo image.
$pdfLogo = api_get_setting('pdf_logo_header');
if ($pdfLogo === 'true') {
if ('true' === $pdfLogo) {
$visualTheme = api_get_visual_theme();
$img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png';
if (file_exists($img)) {

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Configuration script for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
use Doctrine\ORM\Tools\Pagination\Paginator;
@ -12,9 +11,9 @@ $cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSession = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$taxEnable = $plugin->get('tax_enable') === 'true';
$includeSession = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
$taxEnable = 'true' === $plugin->get('tax_enable');
api_protect_admin_script(true);
@ -36,7 +35,7 @@ $courses = new Paginator($query, $fetchJoinCollection = true);
foreach ($courses as $course) {
$item = $plugin->getItemByProduct($course->getId(), BuyCoursesPlugin::PRODUCT_TYPE_COURSE);
$course->buyCourseData = [];
if ($item !== false) {
if (false !== $item) {
$course->buyCourseData = $item;
}
}

@ -1,22 +1,21 @@
<?php
/* For license terms, see /license.txt */
/**
* Configuration script for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSession = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$includeSession = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
if (!$includeServices) {
api_not_allowed(true);
}
$taxEnable = $plugin->get('tax_enable') === 'true';
$taxEnable = 'true' === $plugin->get('tax_enable');
api_protect_admin_script(true);

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Configuration script for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
use Doctrine\ORM\Tools\Pagination\Paginator;
@ -12,13 +11,13 @@ $cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSession = $plugin->get('include_sessions') === 'true';
$includeSession = 'true' === $plugin->get('include_sessions');
if (!$includeSession) {
api_not_allowed(true);
}
$includeServices = $plugin->get('include_services') === 'true';
$taxEnable = $plugin->get('tax_enable') === 'true';
$includeServices = 'true' === $plugin->get('include_services');
$taxEnable = 'true' === $plugin->get('tax_enable');
api_protect_admin_script(true);
@ -54,7 +53,7 @@ $sessions = new Paginator($query, $fetchJoinCollection = true);
foreach ($sessions as $session) {
$item = $plugin->getItemByProduct($session->getId(), BuyCoursesPlugin::PRODUCT_TYPE_SESSION);
$session->buyCourseData = [];
if ($item !== false) {
if (false !== $item) {
$session->buyCourseData = $item;
}
}

@ -1,10 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -24,18 +23,17 @@ switch ($action) {
//$saleId is only used in getSale() and is always filtered there
$saleId = isset($_POST['id']) ? $_POST['id'] : '';
$sale = $plugin->getSale($saleId);
$productType = ($sale['product_type'] == 1) ? get_lang('Course') : get_lang('Session');
$paymentType = ($sale['payment_type'] == 1) ? 'Paypal' : $plugin->get_lang('BankTransfer');
$productInfo = ($sale['product_type'] == 1)
$productType = 1 == $sale['product_type'] ? get_lang('Course') : get_lang('Session');
$paymentType = 1 == $sale['payment_type'] ? 'Paypal' : $plugin->get_lang('BankTransfer');
$productInfo = 1 == $sale['product_type']
? api_get_course_info_by_id($sale['product_id'])
: api_get_session_info($sale['product_id']);
$currency = $plugin->getSelectedCurrency();
if ($sale['product_type'] == 1) {
if (1 == $sale['product_type']) {
$productImage = $productInfo['course_image_large'];
} else {
$productImage = ($productInfo['image'])
? $productInfo['image']
: Template::get_icon_path('session_default.png');
$productImage = $productInfo['image']
?: Template::get_icon_path('session_default.png');
}
$userInfo = api_get_user_info($sale['user_id']);
@ -58,6 +56,7 @@ switch ($action) {
$html .= '</div>';
$html .= '</div>';
echo $html;
break;
case 'stats':
$stats = [];
@ -96,16 +95,16 @@ switch ($action) {
<p>
<ul>
<li>
'.get_plugin_lang("PayoutsTotalCompleted", "BuyCoursesPlugin").'
<b>'.$stats['completed_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").'
'.get_plugin_lang('PayoutsTotalCompleted', 'BuyCoursesPlugin').'
<b>'.$stats['completed_count'].'</b> - '.get_plugin_lang('TotalAmount', 'BuyCoursesPlugin').'
<b>'.$stats['completed_total_amount'].' '.$currency['iso_code'].'</b>
</li>
<li>'.get_plugin_lang("PayoutsTotalPending", "BuyCoursesPlugin").'
<b>'.$stats['pending_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").'
<li>'.get_plugin_lang('PayoutsTotalPending', 'BuyCoursesPlugin').'
<b>'.$stats['pending_count'].'</b> - '.get_plugin_lang('TotalAmount', 'BuyCoursesPlugin').'
<b>'.$stats['pending_total_amount'].' '.$currency['iso_code'].'</b>
</li>
<li>'.get_plugin_lang("PayoutsTotalCanceled", "BuyCoursesPlugin").'
<b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang("TotalAmount", "BuyCoursesPlugin").'
<li>'.get_plugin_lang('PayoutsTotalCanceled', 'BuyCoursesPlugin').'
<b>'.$stats['canceled_count'].'</b> - '.get_plugin_lang('TotalAmount', 'BuyCoursesPlugin').'
<b>'.$stats['canceled_total_amount'].' '.$currency['iso_code'].'</b>
</li>
</ul>
@ -113,6 +112,7 @@ switch ($action) {
</div>
';
echo $html;
break;
case 'processPayout':
if (api_is_anonymous()) {
@ -126,7 +126,7 @@ switch ($action) {
$payouts = isset($_POST['payouts']) ? $_POST['payouts'] : '';
if (!$payouts) {
echo Display::return_message(get_plugin_lang("SelectOptionToProceed", "BuyCoursesPlugin"), 'error', false);
echo Display::return_message(get_plugin_lang('SelectOptionToProceed', 'BuyCoursesPlugin'), 'error', false);
break;
}
@ -137,27 +137,28 @@ switch ($action) {
foreach ($allPays as $payout) {
$totalPayout += number_format($payout['commission'], 2);
$totalAccounts++;
++$totalAccounts;
}
$currentCurrency = $plugin->getSelectedCurrency();
$isoCode = $currentCurrency['iso_code'];
$html .= '<p>'.get_plugin_lang("VerifyTotalAmountToProceedPayout", "BuyCoursesPlugin").'</p>';
$html .= '<p>'.get_plugin_lang('VerifyTotalAmountToProceedPayout', 'BuyCoursesPlugin').'</p>';
$html .= '
<p>
<ul>
<li>'.get_plugin_lang("TotalAcounts", "BuyCoursesPlugin").' <b>'.$totalAccounts.'</b></li>
<li>'.get_plugin_lang("TotalPayout", "BuyCoursesPlugin").' <b>'.$isoCode.' '.$totalPayout.'</b></li>
<li>'.get_plugin_lang('TotalAcounts', 'BuyCoursesPlugin').' <b>'.$totalAccounts.'</b></li>
<li>'.get_plugin_lang('TotalPayout', 'BuyCoursesPlugin').' <b>'.$isoCode.' '.$totalPayout.'</b></li>
</ul>
</p>
<p>'.get_plugin_lang("CautionThisProcessCantBeCanceled", "BuyCoursesPlugin").'</p>
<p>'.get_plugin_lang('CautionThisProcessCantBeCanceled', 'BuyCoursesPlugin').'</p>
<br /><br />
<div id="spinner" class="text-center"></div>
';
echo $html;
break;
case 'proceedPayout':
@ -166,11 +167,11 @@ switch ($action) {
}
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$pruebas = 1 == $paypalParams['sandbox'];
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
require_once "paypalfunctions.php";
require_once 'paypalfunctions.php';
$allPayouts = [];
$totalAccounts = 0;
$totalPayout = 0;
@ -178,7 +179,7 @@ switch ($action) {
$payouts = isset($_POST['payouts']) ? $_POST['payouts'] : '';
if (!$payouts) {
echo Display::return_message(get_plugin_lang("SelectOptionToProceed", "BuyCoursesPlugin"), 'error', false);
echo Display::return_message(get_plugin_lang('SelectOptionToProceed', 'BuyCoursesPlugin'), 'error', false);
break;
}
@ -193,11 +194,11 @@ switch ($action) {
$result = MassPayment($allPayouts, $isoCode);
if ($result['ACK'] === 'Success') {
if ('Success' === $result['ACK']) {
foreach ($allPayouts as $payout) {
$plugin->setStatusPayouts($payout['id'], BuyCoursesPlugin::PAYOUT_STATUS_COMPLETED);
}
echo Display::return_message(get_plugin_lang("PayoutSuccess", "BuyCoursesPlugin"), 'success', false);
echo Display::return_message(get_plugin_lang('PayoutSuccess', 'BuyCoursesPlugin'), 'success', false);
} else {
echo Display::return_message(
'<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '
@ -206,6 +207,7 @@ switch ($action) {
false
);
}
break;
case 'cancelPayout':
@ -216,6 +218,7 @@ switch ($action) {
$payoutId = isset($_POST['id']) ? $_POST['id'] : '';
$plugin->setStatusPayouts($payoutId, BuyCoursesPlugin::PAYOUT_STATUS_CANCELED);
echo '';
break;
}
exit;

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* Configuration page for payment methods for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -20,7 +19,7 @@ $commissionsEnable = $plugin->get('commissions_enable');
$culqiEnable = $plugin->get('culqi_enable');
if (isset($_GET['action'], $_GET['id'])) {
if ($_GET['action'] == 'delete_taccount') {
if ('delete_taccount' == $_GET['action']) {
$plugin->deleteTransferAccount($_GET['id']);
Display::addFlash(
@ -90,8 +89,8 @@ $globalSettingForm->addElement(
$plugin->get_lang('SaleEmail')
);
$taxEnable = $plugin->get('tax_enable') === 'true';
$invoicingEnable = $plugin->get('invoicing_enable') === 'true';
$taxEnable = 'true' === $plugin->get('tax_enable');
$invoicingEnable = 'true' === $plugin->get('invoicing_enable');
if ($taxEnable) {
$globalSettingForm->addHtml('<hr/>');

@ -1,8 +1,6 @@
<?php
/**
* User Panel.
*
* @package chamilo.plugin.buycourses
*/
/**
* Initialization.
@ -12,7 +10,7 @@ $cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSessions = $plugin->get('include_sessions') === 'true';
$includeSessions = 'true' === $plugin->get('include_sessions');
$userInfo = api_get_user_info();
@ -26,7 +24,7 @@ foreach ($payouts as $payout) {
'sale_id' => $payout['sale_id'],
'reference' => $payout['sale_reference'],
'date' => api_format_date($payout['date'], DATE_TIME_FORMAT_LONG_24H),
'payout_date' => ($payout['payout_date'] === '0000-00-00 00:00:00')
'payout_date' => '0000-00-00 00:00:00' === $payout['payout_date']
? '-'
: api_format_date($payout['payout_date'], DATE_TIME_FORMAT_LONG_24H),
'currency' => $payout['iso_code'],

@ -3,8 +3,6 @@
/* For license terms, see /license.txt */
/**
* List of pending payments of the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
//Initialization
$cidReset = true;
@ -23,7 +21,7 @@ $commissionsEnable = $plugin->get('commissions_enable');
$payoutStatuses = $plugin->getPayoutStatuses();
$selectedStatus = isset($_GET['status']) ? $_GET['status'] : BuyCoursesPlugin::SALE_STATUS_COMPLETED;
if ($commissionsEnable !== "true") {
if ('true' !== $commissionsEnable) {
api_not_allowed(true);
}
@ -32,7 +30,7 @@ $form = new FormValidator('search', 'get');
if ($form->validate()) {
$selectedStatus = $form->getSubmitValue('status');
if ($selectedStatus === false) {
if (false === $selectedStatus) {
$selectedStatus = BuyCoursesPlugin::PAYOUT_STATUS_PENDING;
}
}
@ -67,7 +65,7 @@ foreach ($payouts as $payout) {
'sale_id' => $payout['sale_id'],
'reference' => $payout['sale_reference'],
'date' => api_format_date($payout['date'], DATE_TIME_FORMAT_LONG_24H),
'payout_date' => ($payout['payout_date'] === '0000-00-00 00:00:00')
'payout_date' => '0000-00-00 00:00:00' === $payout['payout_date']
? '-'
: api_format_date($payout['payout_date'], DATE_TIME_FORMAT_LONG_24H),
'currency' => $payout['iso_code'],

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* List page for Paypal Payout for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
/**
* Initialization.
@ -22,7 +21,7 @@ $plugin = BuyCoursesPlugin::create();
$paypalEnable = $plugin->get('paypal_enable');
$commissionsEnable = $plugin->get('commissions_enable');
if ($paypalEnable !== "true" && $commissionsEnable !== "true") {
if ('true' !== $paypalEnable && 'true' !== $commissionsEnable) {
api_not_allowed(true);
}

@ -20,9 +20,9 @@ $API_Password = $paypalPassword;
$API_Signature = $paypalSignature;
// BN Code is only applicable for partners
$sBNCode = "PP-ECWizard";
$sBNCode = 'PP-ECWizard';
/**
/*
* Define the PayPal Redirect URLs.
* This is the URL that the buyer is first sent to do authorize payment with their paypal account
* change the URL depending if you are testing on the sandbox or the live PayPal site.
@ -30,18 +30,18 @@ $sBNCode = "PP-ECWizard";
* For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
* For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
if ($SandboxFlag == true) {
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$PAYPAL_URL = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
if (true == $SandboxFlag) {
$API_Endpoint = 'https://api-3t.sandbox.paypal.com/nvp';
$PAYPAL_URL = 'https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=';
} else {
$API_Endpoint = "https://api-3t.paypal.com/nvp";
$PAYPAL_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
$API_Endpoint = 'https://api-3t.paypal.com/nvp';
$PAYPAL_URL = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';
}
$USE_PROXY = false;
$version = "93";
$version = '93';
if (session_id() == "") {
if ('' == session_id()) {
session_start();
}
@ -66,26 +66,26 @@ if (session_id() == "") {
function CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $extra)
{
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
$nvpstr = "&PAYMENTREQUEST_0_AMT=".$paymentAmount;
$nvpstr .= "&PAYMENTREQUEST_0_ITEMAMT=".$paymentAmount;
$nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=".$paymentType;
$nvpstr .= "&RETURNURL=".$returnURL;
$nvpstr .= "&CANCELURL=".$cancelURL;
$nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyCodeType;
$nvpstr = '&PAYMENTREQUEST_0_AMT='.$paymentAmount;
$nvpstr .= '&PAYMENTREQUEST_0_ITEMAMT='.$paymentAmount;
$nvpstr .= '&PAYMENTREQUEST_0_PAYMENTACTION='.$paymentType;
$nvpstr .= '&RETURNURL='.$returnURL;
$nvpstr .= '&CANCELURL='.$cancelURL;
$nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE='.$currencyCodeType;
$nvpstr .= $extra;
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
$_SESSION['currencyCodeType'] = $currencyCodeType;
$_SESSION['PaymentType'] = $paymentType;
/**
* Make the API call to PayPal
* If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
* If an error occured, show the resulting errors.
*/
$resArray = hash_call("SetExpressCheckout", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
$token = urldecode($resArray["TOKEN"]);
$resArray = hash_call('SetExpressCheckout', $nvpstr);
$ack = strtoupper($resArray['ACK']);
if ('SUCCESS' == $ack || 'SUCCESSWITHWARNING' == $ack) {
$token = urldecode($resArray['TOKEN']);
$_SESSION['TOKEN'] = $token;
}
@ -125,33 +125,33 @@ function CallMarkExpressCheckout(
$phoneNum
) {
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
$nvpstr = "&PAYMENTREQUEST_0_AMT=".$paymentAmount;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_PAYMENTACTION=".$paymentType;
$nvpstr = $nvpstr."&RETURNURL=".$returnURL;
$nvpstr = $nvpstr."&CANCELURL=".$cancelURL;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyCodeType;
$nvpstr = $nvpstr."&ADDROVERRIDE=1";
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTONAME=".$shipToName;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTREET=".$shipToStreet;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTREET2=".$shipToStreet2;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOCITY=".$shipToCity;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTATE=".$shipToState;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=".$shipToCountryCode;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOZIP=".$shipToZip;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOPHONENUM=".$phoneNum;
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
$nvpstr = '&PAYMENTREQUEST_0_AMT='.$paymentAmount;
$nvpstr .= '&PAYMENTREQUEST_0_PAYMENTACTION='.$paymentType;
$nvpstr .= '&RETURNURL='.$returnURL;
$nvpstr .= '&CANCELURL='.$cancelURL;
$nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE='.$currencyCodeType;
$nvpstr .= '&ADDROVERRIDE=1';
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTONAME='.$shipToName;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOSTREET='.$shipToStreet;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOSTREET2='.$shipToStreet2;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOCITY='.$shipToCity;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOSTATE='.$shipToState;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE='.$shipToCountryCode;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOZIP='.$shipToZip;
$nvpstr .= '&PAYMENTREQUEST_0_SHIPTOPHONENUM='.$phoneNum;
$_SESSION['currencyCodeType'] = $currencyCodeType;
$_SESSION['PaymentType'] = $paymentType;
/**
* Make the API call to PayPal
* If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment.
* If an error occured, show the resulting errors.
*/
$resArray = hash_call("SetExpressCheckout", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
$token = urldecode($resArray["TOKEN"]);
$resArray = hash_call('SetExpressCheckout', $nvpstr);
$ack = strtoupper($resArray['ACK']);
if ('SUCCESS' == $ack || 'SUCCESSWITHWARNING' == $ack) {
$token = urldecode($resArray['TOKEN']);
$_SESSION['TOKEN'] = $token;
}
@ -179,7 +179,7 @@ function GetShippingDetails($token)
* Build a second API request to PayPal, using the token as the
* ID to get the details on the payment authorization
*/
$nvpstr = "&TOKEN=".$token;
$nvpstr = '&TOKEN='.$token;
/**
* Make the API call and store the results in an array.
@ -187,9 +187,9 @@ function GetShippingDetails($token)
* an action to complete the payment.
* If failed, show the error.
*/
$resArray = hash_call("GetExpressCheckoutDetails", $nvpstr);
$ack = strtoupper($resArray["ACK"]);
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
$resArray = hash_call('GetExpressCheckoutDetails', $nvpstr);
$ack = strtoupper($resArray['ACK']);
if ('SUCCESS' == $ack || 'SUCCESSWITHWARNING' == $ack) {
$_SESSION['payer_id'] = $resArray['PAYERID'];
}
@ -237,14 +237,14 @@ function ConfirmPayment($FinalPaymentAmt)
* Make the call to PayPal to finalize payment
* If an error occured, show the resulting errors.
*/
$resArray = hash_call("DoExpressCheckoutPayment", $nvpstr);
$resArray = hash_call('DoExpressCheckoutPayment', $nvpstr);
/**
* Display the API response back to the browser.
* If the response from PayPal was a success, display the response parameters
* If the response was an error, display the errors received using APIError.php.
*/
$ack = strtoupper($resArray["ACK"]);
$ack = strtoupper($resArray['ACK']);
return $resArray;
}
@ -286,24 +286,22 @@ function DirectPayment(
$currencyCode
) {
//Construct the parameter string that describes DoDirectPayment
$nvpstr = "&AMT=".$paymentAmount;
$nvpstr = $nvpstr."&CURRENCYCODE=".$currencyCode;
$nvpstr = $nvpstr."&PAYMENTACTION=".$paymentType;
$nvpstr = $nvpstr."&CREDITCARDTYPE=".$creditCardType;
$nvpstr = $nvpstr."&ACCT=".$creditCardNumber;
$nvpstr = $nvpstr."&EXPDATE=".$expDate;
$nvpstr = $nvpstr."&CVV2=".$cvv2;
$nvpstr = $nvpstr."&FIRSTNAME=".$firstName;
$nvpstr = $nvpstr."&LASTNAME=".$lastName;
$nvpstr = $nvpstr."&STREET=".$street;
$nvpstr = $nvpstr."&CITY=".$city;
$nvpstr = $nvpstr."&STATE=".$state;
$nvpstr = $nvpstr."&COUNTRYCODE=".$countryCode;
$nvpstr = $nvpstr."&IPADDRESS=".$_SERVER['REMOTE_ADDR'];
$resArray = hash_call("DoDirectPayment", $nvpstr);
return $resArray;
$nvpstr = '&AMT='.$paymentAmount;
$nvpstr .= '&CURRENCYCODE='.$currencyCode;
$nvpstr .= '&PAYMENTACTION='.$paymentType;
$nvpstr .= '&CREDITCARDTYPE='.$creditCardType;
$nvpstr .= '&ACCT='.$creditCardNumber;
$nvpstr .= '&EXPDATE='.$expDate;
$nvpstr .= '&CVV2='.$cvv2;
$nvpstr .= '&FIRSTNAME='.$firstName;
$nvpstr .= '&LASTNAME='.$lastName;
$nvpstr .= '&STREET='.$street;
$nvpstr .= '&CITY='.$city;
$nvpstr .= '&STATE='.$state;
$nvpstr .= '&COUNTRYCODE='.$countryCode;
$nvpstr .= '&IPADDRESS='.$_SERVER['REMOTE_ADDR'];
return hash_call('DoDirectPayment', $nvpstr);
}
/**
@ -316,20 +314,18 @@ function DirectPayment(
*/
function MassPayment(array $beneficiaries, $currencyCode)
{
$nvpstr = "&RECEIVERTYPE=EmailAddress";
$nvpstr .= "&CURRENCYCODE=".$currencyCode;
$nvpstr = '&RECEIVERTYPE=EmailAddress';
$nvpstr .= '&CURRENCYCODE='.$currencyCode;
$index = 0;
foreach ($beneficiaries as $beneficiary) {
$nvpstr .= "&L_EMAIL".$index."=".$beneficiary['paypal_account'];
$nvpstr .= "&L_AMT".$index."=".$beneficiary['commission'];
$index++;
$nvpstr .= '&L_EMAIL'.$index.'='.$beneficiary['paypal_account'];
$nvpstr .= '&L_AMT'.$index.'='.$beneficiary['commission'];
++$index;
}
$resArray = hash_call("MassPay", $nvpstr);
return $resArray;
return hash_call('MassPay', $nvpstr);
}
/**
@ -359,13 +355,13 @@ function hash_call($methodName, $nvpStr)
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php
if ($USE_PROXY) {
curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST.":".$PROXY_PORT);
curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST.':'.$PROXY_PORT);
}
//NVPRequest for submitting to server
$nvpreq = "METHOD=".urlencode($methodName)."&VERSION=".urlencode($version).
"&PWD=".urlencode($API_Password)."&USER=".urlencode($API_UserName).
"&SIGNATURE=".urlencode($API_Signature).$nvpStr."&BUTTONSOURCE=".urlencode($sBNCode);
$nvpreq = 'METHOD='.urlencode($methodName).'&VERSION='.urlencode($version).
'&PWD='.urlencode($API_Password).'&USER='.urlencode($API_UserName).
'&SIGNATURE='.urlencode($API_Signature).$nvpStr.'&BUTTONSOURCE='.urlencode($sBNCode);
//setting the nvpreq as POST FIELD to curl
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
@ -399,7 +395,7 @@ function RedirectToPayPal($token)
global $PAYPAL_URL;
// Redirect to paypal.com here
$payPalURL = $PAYPAL_URL.$token;
header("Location: ".$payPalURL);
header('Location: '.$payPalURL);
exit;
}
@ -419,7 +415,7 @@ function deformatNVP($nvpstr)
//postion of Key
$keypos = strpos($nvpstr, '=');
//position of value
$valuepos = strpos($nvpstr, '&') ? strpos($nvpstr, '&') : strlen($nvpstr);
$valuepos = strpos($nvpstr, '&') ?: strlen($nvpstr);
/*getting the Key and Value values and storing in a Associative Array*/
$keyval = substr($nvpstr, $intial, $keypos);
$valval = substr($nvpstr, $keypos + 1, $valuepos - $keypos - 1);

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
use ChamiloSession as Session;
/**
* Process payments for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
require_once '../config.php';
@ -16,10 +15,10 @@ $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(
WEB_PLUGIN_PATH
).'buycourses/resources/css/style.css"/>';
$plugin = BuyCoursesPlugin::create();
$includeSession = $plugin->get('include_sessions') === 'true';
$paypalEnabled = $plugin->get('paypal_enable') === 'true';
$transferEnabled = $plugin->get('transfer_enable') === 'true';
$culqiEnabled = $plugin->get('culqi_enable') === 'true';
$includeSession = 'true' === $plugin->get('include_sessions');
$paypalEnabled = 'true' === $plugin->get('paypal_enable');
$transferEnabled = 'true' === $plugin->get('transfer_enable');
$culqiEnabled = 'true' === $plugin->get('culqi_enable');
if (!$paypalEnabled && !$transferEnabled && !$culqiEnabled) {
api_not_allowed(true);
@ -29,9 +28,9 @@ if (!isset($_REQUEST['t'], $_REQUEST['i'])) {
api_not_allowed(true);
}
$buyingCourse = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_COURSE;
$buyingSession = intval($_REQUEST['t']) === BuyCoursesPlugin::PRODUCT_TYPE_SESSION;
$queryString = 'i='.intval($_REQUEST['i']).'&t='.intval($_REQUEST['t']);
$buyingCourse = BuyCoursesPlugin::PRODUCT_TYPE_COURSE === (int) ($_REQUEST['t']);
$buyingSession = BuyCoursesPlugin::PRODUCT_TYPE_SESSION === (int) ($_REQUEST['t']);
$queryString = 'i='.(int) ($_REQUEST['i']).'&t='.(int) ($_REQUEST['t']);
if (empty($currentUserId)) {
Session::write('buy_course_redirect', api_get_self().'?'.$queryString);
@ -61,7 +60,7 @@ if ($form->validate()) {
$saleId = $plugin->registerSale($item['id'], $formValues['payment_type']);
if ($saleId !== false) {
if (false !== $saleId) {
$_SESSION['bc_sale_id'] = $saleId;
header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/process_confirm.php');
}
@ -84,11 +83,11 @@ if (!$culqiEnabled) {
}
$count = count($paymentTypesOptions);
if ($count === 0) {
if (0 === $count) {
$form->addHtml($plugin->get_lang('NoPaymentOptionAvailable'));
$form->addHtml('<br />');
$form->addHtml('<br />');
} elseif ($count === 1) {
} elseif (1 === $count) {
// get the only array item
foreach ($paymentTypesOptions as $type => $value) {
$form->addHtml(sprintf($plugin->get_lang('XIsOnlyPaymentMethodAvailable'), $value));
@ -106,8 +105,8 @@ if ($count === 0) {
$form->addRadio('payment_type', null, $paymentTypesOptions);
}
$form->addHidden('t', intval($_GET['t']));
$form->addHidden('i', intval($_GET['i']));
$form->addHidden('t', (int) ($_GET['t']));
$form->addHidden('i', (int) ($_GET['i']));
$form->addButton('submit', $plugin->get_lang('ConfirmOrder'), 'check', 'success', 'btn-lg pull-right');
// View

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* Process purchase confirmation script for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
require_once '../config.php';
@ -31,17 +30,17 @@ switch ($sale['payment_type']) {
case BuyCoursesPlugin::PAYMENT_TYPE_PAYPAL:
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$pruebas = 1 == $paypalParams['sandbox'];
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
require_once "paypalfunctions.php";
require_once 'paypalfunctions.php';
$i = 0;
$extra = "&L_PAYMENTREQUEST_0_NAME0={$sale['product_name']}";
$extra .= "&L_PAYMENTREQUEST_0_AMT0={$sale['price']}";
$extra .= "&L_PAYMENTREQUEST_0_QTY0=1";
$extra .= '&L_PAYMENTREQUEST_0_QTY0=1';
$expressCheckout = CallShortcutExpressCheckout(
$sale['price'],
@ -52,7 +51,7 @@ switch ($sale['payment_type']) {
$extra
);
if ($expressCheckout["ACK"] !== 'Success') {
if ('Success' !== $expressCheckout['ACK']) {
$erroMessage = vsprintf(
$plugin->get_lang('An error occurred.'),
[$expressCheckout['L_ERRORCODE0'], $expressCheckout['L_LONGMESSAGE0']]
@ -86,7 +85,8 @@ switch ($sale['payment_type']) {
);
}
RedirectToPayPal($expressCheckout["TOKEN"]);
RedirectToPayPal($expressCheckout['TOKEN']);
break;
case BuyCoursesPlugin::PAYMENT_TYPE_TRANSFER:
$buyingCourse = false;
@ -96,10 +96,12 @@ switch ($sale['payment_type']) {
case BuyCoursesPlugin::PRODUCT_TYPE_COURSE:
$buyingCourse = true;
$course = $plugin->getCourseInfo($sale['product_id']);
break;
case BuyCoursesPlugin::PRODUCT_TYPE_SESSION:
$buyingSession = true;
$session = $plugin->getSessionInfo($sale['product_id']);
break;
}
@ -219,6 +221,7 @@ switch ($sale['payment_type']) {
$template->assign('content', $content);
$template->display_one_col_template();
break;
case BuyCoursesPlugin::PAYMENT_TYPE_CULQI:
// We need to include the main online script, acording to the Culqi documentation the JS needs to be loeaded
@ -232,10 +235,12 @@ switch ($sale['payment_type']) {
case BuyCoursesPlugin::PRODUCT_TYPE_COURSE:
$buyingCourse = true;
$course = $plugin->getCourseInfo($sale['product_id']);
break;
case BuyCoursesPlugin::PRODUCT_TYPE_SESSION:
$buyingSession = true;
$session = $plugin->getSessionInfo($sale['product_id']);
break;
}
@ -299,7 +304,7 @@ switch ($sale['payment_type']) {
$template->assign('buying_session', $buyingSession);
$template->assign('terms', $globalParameters['terms_and_conditions']);
$template->assign('title', $sale['product_name']);
$template->assign('price', floatval($sale['price']));
$template->assign('price', (float) ($sale['price']));
$template->assign('currency', $plugin->getSelectedCurrency());
$template->assign('user', $userInfo);
$template->assign('sale', $sale);

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* List of pending payments of the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -17,7 +16,7 @@ $plugin = BuyCoursesPlugin::create();
$paypalEnable = $plugin->get('paypal_enable');
$commissionsEnable = $plugin->get('commissions_enable');
$includeServices = $plugin->get('include_services');
$invoicingEnable = $plugin->get('invoicing_enable') === 'true';
$invoicingEnable = 'true' === $plugin->get('invoicing_enable');
if (isset($_GET['order'])) {
$sale = $plugin->getSale($_GET['order']);
@ -40,6 +39,7 @@ if (isset($_GET['order'])) {
'status' => BuyCoursesPlugin::SALE_STATUS_COMPLETED,
'sale' => $sale['id'],
]);
break;
case 'cancel':
$plugin->cancelSale($sale['id']);
@ -55,6 +55,7 @@ if (isset($_GET['order'])) {
'status' => BuyCoursesPlugin::SALE_STATUS_CANCELED,
'sale' => $sale['id'],
]);
break;
}
@ -68,7 +69,7 @@ $paymentTypes = $plugin->getPaymentTypes();
$selectedFilterType = '0';
$selectedStatus = isset($_GET['status']) ? $_GET['status'] : BuyCoursesPlugin::SALE_STATUS_PENDING;
$selectedSale = isset($_GET['sale']) ? intval($_GET['sale']) : 0;
$selectedSale = isset($_GET['sale']) ? (int) ($_GET['sale']) : 0;
$searchTerm = '';
$form = new FormValidator('search', 'get');
@ -78,11 +79,11 @@ if ($form->validate()) {
$selectedStatus = $form->getSubmitValue('status');
$searchTerm = $form->getSubmitValue('user');
if ($selectedStatus === false) {
if (false === $selectedStatus) {
$selectedStatus = BuyCoursesPlugin::SALE_STATUS_PENDING;
}
if ($selectedFilterType === false) {
if (false === $selectedFilterType) {
$selectedFilterType = '0';
}
}
@ -92,10 +93,10 @@ $form->addRadio(
get_lang('Filter'),
[$plugin->get_lang('ByStatus'), $plugin->get_lang('ByUser')]
);
$form->addHtml('<div id="report-by-status" '.($selectedFilterType !== '0' ? 'style="display:none"' : '').'>');
$form->addHtml('<div id="report-by-status" '.('0' !== $selectedFilterType ? 'style="display:none"' : '').'>');
$form->addSelect('status', $plugin->get_lang('OrderStatus'), $saleStatuses);
$form->addHtml('</div>');
$form->addHtml('<div id="report-by-user" '.($selectedFilterType !== '1' ? 'style="display:none"' : '').'>');
$form->addHtml('<div id="report-by-user" '.('1' !== $selectedFilterType ? 'style="display:none"' : '').'>');
$form->addText('user', get_lang('Username'), false);
$form->addHtml('</div>');
$form->addButtonFilter(get_lang('Search'));
@ -107,9 +108,11 @@ $form->setDefaults([
switch ($selectedFilterType) {
case '0':
$sales = $plugin->getSaleListByStatus($selectedStatus);
break;
case '1':
$sales = $plugin->getSaleListByUser($searchTerm);
break;
}
@ -125,7 +128,7 @@ $interbreadcrumb[] = ['url' => '../index.php', 'name' => $plugin->get_lang('plug
$templateName = $plugin->get_lang('SalesReport');
$template = new Template($templateName);
$toolbar = '';
if ($paypalEnable === 'true' && $commissionsEnable === 'true') {
if ('true' === $paypalEnable && 'true' === $commissionsEnable) {
$toolbar .= Display::toolbarButton(
$plugin->get_lang('PaypalPayoutCommissions'),
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php',
@ -140,7 +143,7 @@ if ($paypalEnable === 'true' && $commissionsEnable === 'true') {
);
}
if ($commissionsEnable === 'true') {
if ('true' === $commissionsEnable) {
$toolbar .= Display::toolbarButton(
$plugin->get_lang('PayoutReport'),
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php',

@ -1,16 +1,14 @@
<?php
/**
* List of services.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once '../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSessions = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$includeSessions = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
$nameFilter = null;
$minFilter = 0;

@ -1,9 +1,8 @@
<?php
/* For license terms, see /license.txt */
/**
* Errors management for the Buy Courses plugin - Redirects to service_catalog.php with a error msg.
*
* @package chamilo.plugin.buycourses
*/
require_once '../config.php';
@ -13,7 +12,7 @@ if (isset($_SESSION['bc_service_sale_id'])) {
unset($_SESSION['bc_service_sale_id']);
$serviceSale = $plugin->getServiceSale($serviceSaleId);
$plugin->cancelServiceSale(intval($serviceSaleId));
$plugin->cancelServiceSale((int) $serviceSaleId);
Display::addFlash(
Display::return_message(
$plugin->get_lang('OrderCancelled'),

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -6,20 +7,18 @@
* Show information about a service (for custom purposes).
*
* @author José Loguercio Silva <jose.loguercio@beeznest.com>
*
* @package chamilo.buycourses_plugin
*/
$cidReset = true;
require_once '../../../main/inc/global.inc.php';
$serviceId = isset($_GET['service_id']) ? intval($_GET['service_id']) : false;
$serviceId = isset($_GET['service_id']) ? (int) ($_GET['service_id']) : false;
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(
WEB_PLUGIN_PATH
).'buycourses/resources/css/style.css"/>';
$plugin = BuyCoursesPlugin::create();
$includeServices = $plugin->get('include_services') === 'true';
$includeServices = 'true' === $plugin->get('include_services');
if (!$includeServices) {
api_not_allowed(true);

@ -1,16 +1,14 @@
<?php
/**
* User Panel.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once '../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeServices = $plugin->get('include_services') === 'true';
$includeSessions = $plugin->get('include_sessions') === 'true';
$servicesOnly = $plugin->get('show_services_only') === 'true';
$includeServices = 'true' === $plugin->get('include_services');
$includeSessions = 'true' === $plugin->get('include_sessions');
$servicesOnly = 'true' === $plugin->get('show_services_only');
$userInfo = api_get_user_info();

@ -1,4 +1,5 @@
<?php
/* For license terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Session;
@ -7,8 +8,6 @@ use Chamilo\UserBundle\Entity\User;
/**
* Process payments for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -32,18 +31,18 @@ $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(
$em = Database::getManager();
$plugin = BuyCoursesPlugin::create();
$includeServices = $plugin->get('include_services');
$paypalEnabled = $plugin->get('paypal_enable') === 'true';
$transferEnabled = $plugin->get('transfer_enable') === 'true';
$culqiEnabled = $plugin->get('culqi_enable') === 'true';
$paypalEnabled = 'true' === $plugin->get('paypal_enable');
$transferEnabled = 'true' === $plugin->get('transfer_enable');
$culqiEnabled = 'true' === $plugin->get('culqi_enable');
$additionalQueryString = '';
if ($includeServices !== 'true') {
if ('true' !== $includeServices) {
api_not_allowed(true);
}
$typeUser = $type === BuyCoursesPlugin::SERVICE_TYPE_USER;
$typeCourse = $type === BuyCoursesPlugin::SERVICE_TYPE_COURSE;
$typeSession = $type === BuyCoursesPlugin::SERVICE_TYPE_SESSION;
$typeFinalLp = $type === BuyCoursesPlugin::SERVICE_TYPE_LP_FINAL_ITEM;
$typeUser = BuyCoursesPlugin::SERVICE_TYPE_USER === $type;
$typeCourse = BuyCoursesPlugin::SERVICE_TYPE_COURSE === $type;
$typeSession = BuyCoursesPlugin::SERVICE_TYPE_SESSION === $type;
$typeFinalLp = BuyCoursesPlugin::SERVICE_TYPE_LP_FINAL_ITEM === $type;
$queryString = 'i='.$serviceId.'&t='.$type.$additionalQueryString;
$serviceInfo = $plugin->getService($serviceId);
@ -97,7 +96,7 @@ if ($typeUser) {
if (!empty($users)) {
/** @var User $user */
foreach ($users as $user) {
if (intval($userInfo['user_id']) !== intval($user->getId())) {
if ((int) ($userInfo['user_id']) !== (int) ($user->getId())) {
$selectOptions[$user->getId()] = UserManager::formatUserFullName($user, true);
}
}
@ -173,7 +172,7 @@ if ($typeUser) {
foreach ($thisLpItems as $item) {
//Now only we need the final item and return the current LP
if ($item->getItemType() == TOOL_LP_FINAL_ITEM) {
if (TOOL_LP_FINAL_ITEM == $item->getItemType()) {
$checker = true;
$sessionLpList[$lp->getCId()] = $lp->getName().' ('.$session->getSession()->getName().')';
}
@ -187,7 +186,7 @@ if ($typeUser) {
$thisLpItems = $em->getRepository('ChamiloCourseBundle:CLpItem')->findBy(['lpId' => $lp->getId()]);
foreach ($thisLpItems as $item) {
//Now only we need the final item and return the current LP
if ($item->getItemType() == TOOL_LP_FINAL_ITEM) {
if (TOOL_LP_FINAL_ITEM == $item->getItemType()) {
$checker = true;
$sessionLpList[$lp->getCId()] = $lp->getName().' ('.$session->getSession()->getName().')';
}
@ -207,8 +206,8 @@ if ($typeUser) {
$form->addSelect('info_select', get_lang('Learning paths'), $selectOptions);
}
$form->addHidden('t', intval($_GET['t']));
$form->addHidden('i', intval($_GET['i']));
$form->addHidden('t', (int) ($_GET['t']));
$form->addHidden('i', (int) ($_GET['i']));
$form->addButton('submit', $plugin->get_lang('ConfirmOrder'), 'check', 'success');
if ($form->validate()) {
@ -241,7 +240,7 @@ if ($form->validate()) {
$infoSelected
);
if ($serviceSaleId !== false) {
if (false !== $serviceSaleId) {
$_SESSION['bc_service_sale_id'] = $serviceSaleId;
header('Location: '.api_get_path(WEB_PLUGIN_PATH).'buycourses/src/service_process_confirm.php');
}

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
use ChamiloSession as Session;
/**
* Process purchase confirmation script for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
require_once '../config.php';
@ -31,7 +30,7 @@ switch ($serviceSale['payment_type']) {
case BuyCoursesPlugin::PAYMENT_TYPE_PAYPAL:
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$pruebas = 1 == $paypalParams['sandbox'];
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
@ -49,7 +48,7 @@ switch ($serviceSale['payment_type']) {
require_once 'paypalfunctions.php';
$extra .= "&L_PAYMENTREQUEST_0_NAME0={$serviceSale['service']['name']}";
$extra .= "&L_PAYMENTREQUEST_0_QTY0=1";
$extra .= '&L_PAYMENTREQUEST_0_QTY0=1';
$extra .= "&L_PAYMENTREQUEST_0_AMT0=$itemPrice";
// Full Checkout express
@ -62,7 +61,7 @@ switch ($serviceSale['payment_type']) {
$extra
);
if ($expressCheckout['ACK'] !== 'Success') {
if ('Success' !== $expressCheckout['ACK']) {
$erroMessage = vsprintf(
$plugin->get_lang('An error occurred.'),
[$expressCheckout['L_ERRORCODE0'], $expressCheckout['L_LONGMESSAGE0']]
@ -99,6 +98,7 @@ switch ($serviceSale['payment_type']) {
}
RedirectToPayPal($expressCheckout['TOKEN']);
break;
case BuyCoursesPlugin::PAYMENT_TYPE_TRANSFER:
$transferAccounts = $plugin->getTransferAccounts();
@ -222,6 +222,7 @@ switch ($serviceSale['payment_type']) {
$template->assign('content', $content);
$template->display_one_col_template();
break;
case BuyCoursesPlugin::PAYMENT_TYPE_CULQI:
// We need to include the main online script, acording to the Culqi documentation the JS needs to be loeaded
@ -278,7 +279,7 @@ switch ($serviceSale['payment_type']) {
$template = new Template();
$template->assign('terms', $globalParameters['terms_and_conditions']);
$template->assign('title', $serviceSale['service']['name']);
$template->assign('price', floatval($serviceSale['price']));
$template->assign('price', (float) ($serviceSale['price']));
$template->assign('currency', $plugin->getSelectedCurrency());
$template->assign('buying_service', $serviceSale);
$template->assign('user', $userInfo);
@ -290,5 +291,6 @@ switch ($serviceSale['payment_type']) {
$content = $template->fetch('buycourses/view/process_confirm.tpl');
$template->assign('content', $content);
$template->display_one_col_template();
break;
}

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* List of pending payments of the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -17,7 +16,7 @@ $plugin = BuyCoursesPlugin::create();
$paypalEnable = $plugin->get('paypal_enable');
$commissionsEnable = $plugin->get('commissions_enable');
$includeServices = $plugin->get('include_services');
$invoicingEnable = $plugin->get('invoicing_enable') === 'true';
$invoicingEnable = 'true' === $plugin->get('invoicing_enable');
$saleStatuses = $plugin->getServiceSaleStatuses();
$selectedStatus = isset($_GET['status']) ? $_GET['status'] : BuyCoursesPlugin::SALE_STATUS_PENDING;
@ -25,7 +24,7 @@ $form = new FormValidator('search', 'get');
if ($form->validate()) {
$selectedStatus = $form->getSubmitValue('status');
if ($selectedStatus === false) {
if (false === $selectedStatus) {
$selectedStatus = BuyCoursesPlugin::SALE_STATUS_PENDING;
}
}
@ -41,7 +40,7 @@ $templateName = $plugin->get_lang('SalesReport');
$template = new Template($templateName);
if ($paypalEnable == 'true' && $commissionsEnable == 'true') {
if ('true' == $paypalEnable && 'true' == $commissionsEnable) {
$toolbar = Display::toolbarButton(
$plugin->get_lang('PaypalPayoutCommissions'),
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/paypal_payout.php',
@ -56,7 +55,7 @@ if ($paypalEnable == 'true' && $commissionsEnable == 'true') {
);
}
if ($commissionsEnable == 'true') {
if ('true' == $commissionsEnable) {
$toolbar = Display::toolbarButton(
$plugin->get_lang('PayoutReport'),
api_get_path(WEB_PLUGIN_PATH).'buycourses/src/payout_report.php',

@ -1,15 +1,14 @@
<?php
/* For license terms, see /license.txt */
/**
* Success page for the purchase of a service in the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
require_once '../config.php';
$plugin = BuyCoursesPlugin::create();
$paypalEnabled = $plugin->get('paypal_enable') === 'true';
$paypalEnabled = 'true' === $plugin->get('paypal_enable');
if (!$paypalEnabled) {
api_not_allowed(true);
@ -25,12 +24,12 @@ if (empty($serviceSale)) {
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$pruebas = 1 == $paypalParams['sandbox'];
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
require_once "paypalfunctions.php";
require_once 'paypalfunctions.php';
$buyerInformation = GetShippingDetails(urlencode($_SESSION['TOKEN']));
@ -66,7 +65,7 @@ if ($form->validate()) {
}
$confirmPayments = ConfirmPayment($itemPrice);
if ($confirmPayments['ACK'] !== 'Success') {
if ('Success' !== $confirmPayments['ACK']) {
$erroMessage = vsprintf(
$plugin->get_lang('An error occurred.'),
[$expressCheckout['L_ERRORCODE0'], $confirmPayments['L_LONGMESSAGE0']]
@ -79,7 +78,7 @@ if ($form->validate()) {
exit;
}
switch ($confirmPayments["PAYMENTINFO_0_PAYMENTSTATUS"]) {
switch ($confirmPayments['PAYMENTINFO_0_PAYMENTSTATUS']) {
case 'Completed':
$serviceSaleIsCompleted = $plugin->completeServiceSale($serviceSale['id']);
@ -97,45 +96,58 @@ if ($form->validate()) {
Display::addFlash(
Display::return_message($plugin->get_lang('There happened an unknown error. Please contact the platform administrator.'), 'error')
);
break;
case 'Pending':
switch ($confirmPayments["PAYMENTINFO_0_PENDINGREASON"]) {
switch ($confirmPayments['PAYMENTINFO_0_PENDINGREASON']) {
case 'address':
$purchaseStatus = $plugin->get_lang('PendingReasonByAddress');
break;
case 'authorization':
$purchaseStatus = $plugin->get_lang('PendingReasonByAuthorization');
break;
case 'echeck':
$purchaseStatus = $plugin->get_lang('PendingReasonByEcheck');
break;
case 'intl':
$purchaseStatus = $plugin->get_lang('PendingReasonByIntl');
break;
case 'multicurrency':
$purchaseStatus = $plugin->get_lang('PendingReasonByMulticurrency');
break;
case 'order':
$purchaseStatus = $plugin->get_lang('PendingReasonByOrder');
break;
case 'paymentreview':
$purchaseStatus = $plugin->get_lang('PendingReasonByPaymentReview');
break;
case 'regulatoryreview':
$purchaseStatus = $plugin->get_lang('PendingReasonByRegulatoryReview');
break;
case 'unilateral':
$purchaseStatus = $plugin->get_lang('PendingReasonByUnilateral');
break;
case 'upgrade':
$purchaseStatus = $plugin->get_lang('PendingReasonByUpgrade');
break;
case 'verify':
$purchaseStatus = $plugin->get_lang('PendingReasonByVerify');
break;
case 'other':
default:
$purchaseStatus = $plugin->get_lang('PendingReasonByOther');
break;
}
@ -146,13 +158,15 @@ if ($form->validate()) {
false
)
);
break;
default:
$plugin->cancelServiceSale(intval($serviceSale['id']));
$plugin->cancelServiceSale((int) ($serviceSale['id']));
Display::addFlash(
Display::return_message($plugin->get_lang('There happened an unknown error. Please contact the platform administrator.'), 'error')
);
break;
}
@ -167,8 +181,8 @@ if (empty($token)) {
}
$interbreadcrumb[] = [
"url" => "service_catalog.php",
"name" => $plugin->get_lang('ListOfServicesOnSale'),
'url' => 'service_catalog.php',
'name' => $plugin->get_lang('ListOfServicesOnSale'),
];
$templateName = $plugin->get_lang('PaymentMethods');

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* Create new Services for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -106,9 +105,9 @@ $form->addSelect(
$form->addCheckBox('visibility', $plugin->get_lang('VisibleInCatalog'));
$form->addFile(
'picture',
(get_lang(
get_lang(
'AddImage'
)),
),
['id' => 'picture', 'class' => 'picture-form', 'crop_image' => true, 'crop_ratio' => '16 / 9']
);
$form->addText('video_url', get_lang('Video URL'), false);

@ -1,10 +1,9 @@
<?php
/* For license terms, see /license.txt */
/**
* Create new Services for the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
@ -46,9 +45,9 @@ $formDefaultValues = [
'price' => $service['price'],
'tax_perc' => $service['tax_perc'],
'duration_days' => $service['duration_days'],
'owner_id' => intval($service['owner_id']),
'applies_to' => intval($service['applies_to']),
'visibility' => ($service['visibility'] == 1) ? true : false,
'owner_id' => (int) ($service['owner_id']),
'applies_to' => (int) ($service['applies_to']),
'visibility' => 1 == $service['visibility'] ? true : false,
'image' => is_file(api_get_path(SYS_PLUGIN_PATH).'buycourses/uploads/services/images/simg-'.$serviceId.'.png')
? api_get_path(WEB_PLUGIN_PATH).'buycourses/uploads/services/images/simg-'.$serviceId.'.png'
: api_get_path(WEB_CODE_PATH).'img/session_default.png',
@ -120,7 +119,7 @@ $form->addSelect(
$form->addCheckBox('visibility', $plugin->get_lang('VisibleInCatalog'));
$form->addFile(
'picture',
$formDefaultValues['image'] != '' ? get_lang('Update Image') : get_lang('Add image'),
'' != $formDefaultValues['image'] ? get_lang('Update Image') : get_lang('Add image'),
['id' => 'picture', 'class' => 'picture-form', 'crop_image' => true, 'crop_ratio' => '16 / 9']
);
$form->addText('video_url', get_lang('Video URL'), false);

@ -1,18 +1,17 @@
<?php
/* For license terms, see /license.txt */
/**
* List of courses.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSessions = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$includeSessions = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
if (!$includeSessions) {
api_not_allowed(true);

@ -1,18 +1,17 @@
<?php
/* For license terms, see /license.txt */
/**
* User Panel.
*
* @package chamilo.plugin.buycourses
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
$plugin = BuyCoursesPlugin::create();
$includeSessions = $plugin->get('include_sessions') === 'true';
$includeServices = $plugin->get('include_services') === 'true';
$includeSessions = 'true' === $plugin->get('include_sessions');
$includeServices = 'true' === $plugin->get('include_services');
$userInfo = api_get_user_info();
@ -25,7 +24,7 @@ $sales = $plugin->getSaleListByUserId($userInfo['id']);
$saleList = [];
foreach ($sales as $sale) {
if ($sale['product_type'] == 2) {
if (2 == $sale['product_type']) {
$saleList[] = [
'id' => $sale['id'],
'reference' => $sale['reference'],

@ -1,15 +1,14 @@
<?php
/* For license terms, see /license.txt */
/**
* Success page for the purchase of a course in the Buy Courses plugin.
*
* @package chamilo.plugin.buycourses
*/
require_once '../config.php';
$plugin = BuyCoursesPlugin::create();
$paypalEnabled = $plugin->get('paypal_enable') === 'true';
$paypalEnabled = 'true' === $plugin->get('paypal_enable');
if (!$paypalEnabled) {
api_not_allowed(true);
@ -28,20 +27,22 @@ switch ($sale['product_type']) {
case BuyCoursesPlugin::PRODUCT_TYPE_COURSE:
$buyingCourse = true;
$course = $plugin->getCourseInfo($sale['product_id']);
break;
case BuyCoursesPlugin::PRODUCT_TYPE_SESSION:
$buyingSession = true;
$session = $plugin->getSessionInfo($sale['product_id']);
break;
}
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$pruebas = 1 == $paypalParams['sandbox'];
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
require_once "paypalfunctions.php";
require_once 'paypalfunctions.php';
$form = new FormValidator(
'success',
@ -65,7 +66,7 @@ if ($form->validate()) {
$confirmPayments = ConfirmPayment($sale['price']);
if ($confirmPayments['ACK'] !== 'Success') {
if ('Success' !== $confirmPayments['ACK']) {
$erroMessage = vsprintf(
$plugin->get_lang('An error occurred.'),
[$expressCheckout['L_ERRORCODE0'], $confirmPayments['L_LONGMESSAGE0']]
@ -88,51 +89,65 @@ if ($form->validate()) {
$plugin->getSubscriptionSuccessMessage($sale)
);
$plugin->storePayouts($sale['id']);
break;
}
Display::addFlash(
Display::return_message($plugin->get_lang('There happened an unknown error. Please contact the platform administrator.'), 'error')
);
break;
case 'Pending':
switch ($confirmPayments["PAYMENTINFO_0_PENDINGREASON"]) {
switch ($confirmPayments['PAYMENTINFO_0_PENDINGREASON']) {
case 'address':
$purchaseStatus = $plugin->get_lang('PendingReasonByAddress');
break;
case 'authorization':
$purchaseStatus = $plugin->get_lang('PendingReasonByAuthorization');
break;
case 'echeck':
$purchaseStatus = $plugin->get_lang('PendingReasonByEcheck');
break;
case 'intl':
$purchaseStatus = $plugin->get_lang('PendingReasonByIntl');
break;
case 'multicurrency':
$purchaseStatus = $plugin->get_lang('PendingReasonByMulticurrency');
break;
case 'order':
$purchaseStatus = $plugin->get_lang('PendingReasonByOrder');
break;
case 'paymentreview':
$purchaseStatus = $plugin->get_lang('PendingReasonByPaymentReview');
break;
case 'regulatoryreview':
$purchaseStatus = $plugin->get_lang('PendingReasonByRegulatoryReview');
break;
case 'unilateral':
$purchaseStatus = $plugin->get_lang('PendingReasonByUnilateral');
break;
case 'upgrade':
$purchaseStatus = $plugin->get_lang('PendingReasonByUpgrade');
break;
case 'verify':
$purchaseStatus = $plugin->get_lang('PendingReasonByVerify');
break;
case 'other':
default:
$purchaseStatus = $plugin->get_lang('PendingReasonByOther');
break;
}
@ -143,11 +158,13 @@ if ($form->validate()) {
false
)
);
break;
default:
Display::addFlash(
Display::return_message($plugin->get_lang('There happened an unknown error. Please contact the platform administrator.'), 'error')
);
break;
}
@ -164,7 +181,7 @@ if (empty($token)) {
$shippingDetails = GetShippingDetails($token);
if ($shippingDetails['ACK'] !== 'Success') {
if ('Success' !== $shippingDetails['ACK']) {
$erroMessage = vsprintf(
$plugin->get_lang('An error occurred.'),
[$expressCheckout['L_ERRORCODE0'], $shippingDetails['L_LONGMESSAGE0']]
@ -176,7 +193,7 @@ if ($shippingDetails['ACK'] !== 'Success') {
exit;
}
$interbreadcrumb[] = ["url" => "course_catalog.php", "name" => $plugin->get_lang('CourseListOnSale')];
$interbreadcrumb[] = ['url' => 'course_catalog.php', 'name' => $plugin->get_lang('CourseListOnSale')];
$templateName = $plugin->get_lang('PaymentMethods');
$tpl = new Template($templateName);

@ -1,12 +1,11 @@
<?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.buycourses
*/
/**
* Queries.

@ -1,9 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Update the plugin.
*
* @package chamilo.plugin.buycourses
*/
require_once __DIR__.'/config.php';

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -6,8 +7,6 @@
* install/uninstall the plugin.
*
* @author Damien Renou
*
* @package chamilo.plugin.card_game
*/
class CardGame extends Plugin
{
@ -26,26 +25,26 @@ class CardGame extends Plugin
{
static $result = null;
return $result ? $result : $result = new self();
return $result ?: $result = new self();
}
public function install()
{
// 'pan' is the ID of the current background image/panel
$sql = "CREATE TABLE IF NOT EXISTS plugin_card_game(
$sql = 'CREATE TABLE IF NOT EXISTS plugin_card_game(
id INT NOT NULL AUTO_INCREMENT,
user_id INT NOT NULL,
pan int NOT NULL,
access_date DATE NOT NULL,
parts VARCHAR(500) NOT NULL,
PRIMARY KEY (id)
)";
)';
Database::query($sql);
}
public function uninstall()
{
$sql = "DROP TABLE IF EXISTS plugin_card_game";
$sql = 'DROP TABLE IF EXISTS plugin_card_game';
Database::query($sql);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save