Final touch to BuyCourses plugin before 1.9.8 - refs #5464

1.9.x
Yannick Warnier 12 years ago
parent 310db6663a
commit cc9f0ad702
  1. 4
      plugin/buycourses/config.php
  2. 51
      plugin/buycourses/database.php
  3. 2
      plugin/buycourses/index.php
  4. 9
      plugin/buycourses/install.php
  5. 19
      plugin/buycourses/js/buycourses.js
  6. 117
      plugin/buycourses/lang/english.php
  7. 72
      plugin/buycourses/lang/french.php
  8. 25
      plugin/buycourses/lang/spanish.php
  9. 7
      plugin/buycourses/plugin.php
  10. 10
      plugin/buycourses/readme.txt
  11. 6
      plugin/buycourses/resources/plugin.css
  12. 11
      plugin/buycourses/src/ajax.php
  13. 113
      plugin/buycourses/src/buy_course.lib.php
  14. 18
      plugin/buycourses/src/buy_course_plugin.class.php
  15. 15
      plugin/buycourses/src/configuration.php
  16. 12
      plugin/buycourses/src/error.php
  17. 12
      plugin/buycourses/src/expresscheckout.php
  18. 51
      plugin/buycourses/src/function.php
  19. 14
      plugin/buycourses/src/index.buycourses.php
  20. 9
      plugin/buycourses/src/inscription.php
  21. 11
      plugin/buycourses/src/list.php
  22. 27
      plugin/buycourses/src/paymentsetup.php
  23. 13
      plugin/buycourses/src/pending_orders.php
  24. 19
      plugin/buycourses/src/process.php
  25. 21
      plugin/buycourses/src/process_confirm.php
  26. 15
      plugin/buycourses/src/success.php
  27. 6
      plugin/buycourses/uninstall.php
  28. 8
      plugin/buycourses/view/configuration.tpl
  29. 2
      plugin/buycourses/view/index.tpl
  30. 24
      plugin/buycourses/view/list.tpl
  31. 28
      plugin/buycourses/view/paymentsetup.tpl
  32. 10
      plugin/buycourses/view/pending_orders.tpl
  33. 18
      plugin/buycourses/view/process.tpl
  34. 22
      plugin/buycourses/view/process_confirm.tpl
  35. 17
      plugin/buycourses/view/success.tpl

@ -4,10 +4,10 @@
define('TABLE_BUY_COURSE', 'plugin_buy_course'); define('TABLE_BUY_COURSE', 'plugin_buy_course');
define('TABLE_BUY_COURSE_COUNTRY', 'plugin_buy_course_country'); define('TABLE_BUY_COURSE_COUNTRY', 'plugin_buy_course_country');
define('TABLE_BUY_COURSE_PAYPAL', 'plugin_buy_course_paypal'); define('TABLE_BUY_COURSE_PAYPAL', 'plugin_buy_course_paypal');
define('TABLE_BUY_COURSE_TRANSFERENCE', 'plugin_buy_course_transference'); define('TABLE_BUY_COURSE_TRANSFER', 'plugin_buy_course_transfer');
define('TABLE_BUY_COURSE_TEMPORAL', 'plugin_buy_course_temporal'); define('TABLE_BUY_COURSE_TEMPORAL', 'plugin_buy_course_temporal');
define('TABLE_BUY_COURSE_SALE', 'plugin_buy_course_sale'); define('TABLE_BUY_COURSE_SALE', 'plugin_buy_course_sale');
require_once __DIR__ . '/../../main/inc/global.inc.php'; require_once __DIR__ . '/../../main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php'; require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
require_once api_get_path(PLUGIN_PATH) . 'buy_courses/src/buy_course_plugin.class.php'; require_once api_get_path(PLUGIN_PATH) . 'buycourses/src/buy_course_plugin.class.php';

@ -1,46 +1,55 @@
<?php <?php
/* For license terms, see /license.txt */
/** /**
* Created by PhpStorm. * Plugin database installation script. Can only be executed if included
* User: fgonzales * inside another script loading global.inc.php
* Date: 21/05/14 * @package chamilo.plugin.buycourses
* Time: 12:19 PM
*/ */
$objPlugin = Buy_CoursesPlugin::create(); /**
* Check if script can be called
*/
if (!function_exists('api_get_path')) {
die('This script must be loaded through the Chamilo plugin installer sequence');
}
/**
* Create the script context, then execute database queries to enable
*/
$objPlugin = BuyCoursesPlugin::create();
$table = Database::get_main_table(TABLE_BUY_COURSE); $table = Database::get_main_table(TABLE_BUY_COURSE);
$sql = "CREATE TABLE IF NOT EXISTS $table ( $sql = "CREATE TABLE IF NOT EXISTS $table (
id INT unsigned NOT NULL auto_increment PRIMARY KEY, id INT unsigned NOT NULL auto_increment PRIMARY KEY,
id_course INT unsigned NOT NULL DEFAULT '0', course_id INT unsigned NOT NULL DEFAULT '0',
code VARCHAR(40), code VARCHAR(40),
title VARCHAR(250), title VARCHAR(250),
visible int(1), visible int,
price FLOAT(11,2) NOT NULL DEFAULT '0', price FLOAT(11,2) NOT NULL DEFAULT '0',
sync int(1))"; sync int)";
Database::query($sql); Database::query($sql);
$tableCourse = Database::get_main_table(TABLE_MAIN_COURSE); $tableCourse = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT id, code, title FROM $tableCourse"; $sql = "SELECT id, code, title FROM $tableCourse";
$res = Database::query($sql); $res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) { while ($row = Database::fetch_assoc($res)) {
$presql = "INSERT INTO $table (id_course, code, title, visible) VALUES ('" . $row['id'] . "','" . $row['code'] . "','" . $row['title'] . "','NO')"; $presql = "INSERT INTO $table (course_id, code, title, visible) VALUES ('" . $row['id'] . "','" . $row['code'] . "','" . $row['title'] . "','NO')";
Database::query($presql); Database::query($presql);
} }
$table = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY); $table = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY);
$sql = "CREATE TABLE IF NOT EXISTS $table ( $sql = "CREATE TABLE IF NOT EXISTS $table (
`id_country` int(5) NOT NULL AUTO_INCREMENT, country_id int NOT NULL AUTO_INCREMENT,
`country_code` char(2) NOT NULL DEFAULT '', country_code char(2) NOT NULL DEFAULT '',
`country_name` varchar(45) NOT NULL DEFAULT '', country_name varchar(45) NOT NULL DEFAULT '',
`currency_code` char(3) DEFAULT NULL, currency_code char(3) DEFAULT NULL,
`iso_alpha3` char(3) DEFAULT NULL, iso_alpha3 char(3) DEFAULT NULL,
`status` int(1) DEFAULT '0', status int DEFAULT '0',
PRIMARY KEY (`id_country`) PRIMARY KEY (country_id)
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;"; ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;";
Database::query($sql); Database::query($sql);
$sql = "CREATE UNIQUE INDEX index_country ON $table (`country_code`)"; $sql = "CREATE UNIQUE INDEX index_country ON $table (country_code)";
Database::query($sql); Database::query($sql);
$sql = "INSERT INTO $table (`country_code`, `country_name`, `currency_code`, `iso_alpha3`) VALUES $sql = "INSERT INTO $table (country_code, country_name, currency_code, iso_alpha3) VALUES
('AD', 'Andorra', 'EUR', 'AND'), ('AD', 'Andorra', 'EUR', 'AND'),
('AE', 'United Arab Emirates', 'AED', 'ARE'), ('AE', 'United Arab Emirates', 'AED', 'ARE'),
('AF', 'Afghanistan', 'AFN', 'AFG'), ('AF', 'Afghanistan', 'AFN', 'AFG'),
@ -304,7 +313,7 @@ Database::query($sql);
$sql = "INSERT INTO $table (id,username,password,signature) VALUES ('1', 'API_UserName', 'API_Password', 'API_Signature')"; $sql = "INSERT INTO $table (id,username,password,signature) VALUES ('1', 'API_UserName', 'API_Password', 'API_Signature')";
Database::query($sql); Database::query($sql);
$table = Database::get_main_table(TABLE_BUY_COURSE_TRANSFERENCE); $table = Database::get_main_table(TABLE_BUY_COURSE_TRANSFER);
$sql = "CREATE TABLE IF NOT EXISTS $table ( $sql = "CREATE TABLE IF NOT EXISTS $table (
id INT unsigned NOT NULL auto_increment PRIMARY KEY, id INT unsigned NOT NULL auto_increment PRIMARY KEY,
name VARCHAR(100) NOT NULL DEFAULT '', name VARCHAR(100) NOT NULL DEFAULT '',
@ -336,8 +345,8 @@ $sql = "CREATE TABLE IF NOT EXISTS $table (
Database::query($sql); Database::query($sql);
//Menu main tabs //Menu main tabs
$rsTab = $objPlugin->addTab('Buy Courses', 'plugin/buy_courses/index.php'); $rsTab = $objPlugin->addTab('Buy Courses', 'plugin/buycourses/index.php');
if ($rsTab) { if ($rsTab) {
echo "<script>location.href = '" . $_SERVER['REQUEST_URI'] . "';</script>"; echo "<script>location.href = '" . Security::remove_XSS($_SERVER['REQUEST_URI']) . "';</script>";
} }

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

@ -1,12 +1,15 @@
<?php <?php
/* For license terms, see /license.txt */
/** /**
* This script is included by main/admin/settings.lib.php and generally * This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table) * includes things to execute in the main database (settings_current table)
* @package chamilo.plugin.bigbluebutton * @package chamilo.plugin.buycourses
*/ */
/** /**
* Initialization * Initialization
*/ */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__) . '/config.php';
Buy_CoursesPlugin::create()->install(); if (!api_is_platform_admin()) {
die ('You must have admin permissions to install plugins');
}
BuyCoursesPlugin::create()->install();

@ -1,3 +1,8 @@
/* For licensing terms, see /license.txt */
/**
* JS library for the Chamilo buy-courses plugin
* @package chamilo.plugin.buycourses
*/
$(document).ready(function () { $(document).ready(function () {
$("input[name='price']").change(function () { $("input[name='price']").change(function () {
$(this).parent().next().children().attr("style", "display:none"); $(this).parent().next().children().attr("style", "display:none");
@ -29,16 +34,16 @@ $(document).ready(function () {
$(".save").click(function () { $(".save").click(function () {
var visible = $(this).parent().parent().prev().prev().children().attr("checked"); var visible = $(this).parent().parent().prev().prev().children().attr("checked");
var price = $(this).parent().parent().prev().children().attr("value"); var price = $(this).parent().parent().prev().children().attr("value");
var id_course = $(this).attr('id'); var course_id = $(this).attr('id');
$.post("function.php", {tab: "save_mod", id_course: id_course, visible: visible, price: price}, $.post("function.php", {tab: "save_mod", course_id: course_id, visible: visible, price: price},
function (data) { function (data) {
if (data.status == "false") { if (data.status == "false") {
alert("Database Error"); alert("Database Error");
} else { } else {
$("#course" + data.id_course).children().attr("style", "display:''"); $("#course" + data.course_id).children().attr("style", "display:''");
$("#course" + data.id_course).children().next().attr("style", "display:none"); $("#course" + data.course_id).children().next().attr("style", "display:none");
$("#course" + data.id_course).parent().removeClass("fmod") $("#course" + data.course_id).parent().removeClass("fmod")
$("#course" + data.id_course).parent().children().each(function () { $("#course" + data.course_id).parent().children().each(function () {
$(this).removeClass("btop"); $(this).removeClass("btop");
}); });
} }
@ -216,4 +221,4 @@ function acciones_ajax() {
} }

@ -1,52 +1,65 @@
<?php <?php
//Needed in order to show the plugin title $strings['plugin_title'] = "Sell courses";
$strings['plugin_title'] = "Comprar cursos"; $strings['plugin_comment'] = "Sell courses directly through your Chamilo portal, using a PayPal account to receive funds. This plugin is in beta version. Neither the Chamilo association nor the developers involved could be considered responsible of any issue you might suffer using this plugin.";
$strings['plugin_comment'] = "Configurar precios, tipos de pago, visibilidad de cursos."; $strings['Visible'] = "Show list";
$strings['Options'] = "Options";
$strings['Visible'] = "Mostrar en el listado"; $strings['Price'] = "Price";
$strings['Options'] = "Opciones"; $strings['SyncCourseDatabase'] = "Synchronize courses from database";
$strings['Price'] = "Precio"; $strings['Private'] = "Private - access authorized only for course members";
$strings['SyncCourseDatabase'] = "Sincronizar cursos de la base de datos"; $strings['CourseVisibilityClosed'] = "Closed - no access to this course";
$strings['OpenToThePlatform'] = "Open - access authorized only for users registered on the platform";
$strings['Private'] = "Privado - acceso autorizado s&oacute;lo para los miembros del curso"; $strings['OpenToTheWorld'] = "Public - access open to anybody";
$strings['CourseVisibilityClosed'] = "Cerrado - no hay acceso a este curso"; $strings['Description'] = "Description";
$strings['OpenToThePlatform'] = "Abierto - acceso autorizado s&oacute;lo para los usuarios registrados en la plataforma"; $strings['Buy'] = "Buy";
$strings['OpenToTheWorld'] = "P&uacute;blico - acceso autorizado a cualquier persona"; $strings['Mostrar_disponibles'] = "Show available courses";
$strings['paypal_enable'] = "Enable PayPal";
$strings['bc_setting_courses_available'] = "Configuraci&oacute;n de cursos disponibles"; $strings['transfer_enable'] = "Enable bank transfer";
$strings['bc_setting_pay'] = "Configuraci&oacute;n pagos"; $strings['unregistered_users_enable'] = "Allow anonymous users";
$strings['Cancelacionpedido'] = "The payment has been cancelled.";
$strings['Description'] = "Descripci&oacute;n"; $strings['AlreadyBuy'] = "You are already subscribed to this course.";
$strings['Buy'] = "Comprar"; $strings['bc_subject'] = "Confirmation of course order";
$strings['Filtro_buscar'] = "Filtro de busqueda"; $strings['paypal'] = 'PayPal';
$strings['Curso'] = "Curso"; $strings['confirmar_compra'] = 'Course purchase confirmation';
$strings['Price_Maximum'] = "Precio mayor de"; $strings['TheUserIsAlreadyRegistered'] = 'The user is already registered';
$strings['Price_Minimum'] = "Precio menor de"; $strings['ProblemToSaveTheCurrencyType'] = 'Problem loading the currency type';
$strings['Mostrar_disponibles'] = "Mostrar cursos disponibles"; $strings['ProblemToSaveThePaypalParameters'] = 'Problem saving PayPal parameters';
$strings['Categorias'] = "Categorias"; $strings['ProblemToInsertANewAccount'] = 'Problem inserting the new account';
$strings['ProblemToDeleteTheAccount'] = 'Problem removing account';
$strings['paypal_enable'] = "Habilitar PayPal"; $strings['ProblemToSaveTheMessage'] = 'Problem saving message';
$strings['tarjet_credit_enable'] = "Habilitar TPV"; $strings['ProblemToSubscribeTheUser'] = 'Problem subscribing the user';
$strings['transference_enable'] = "Habilitar transferencia"; $strings['TheSubscriptionAndActivationWereDoneSuccessfully'] = 'The subscription and activation were successful';
$strings['unregistered_users_enable'] = "Permitir usuarios sin registro en la plataforma"; $strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'The user is already registered in the course.';
$strings['CourseListOnSale'] = 'List of courses on sale';
$strings['EnrollToCourseXSuccessful'] = "Su inscripci<EFBFBD>n en el curso %s se ha completado."; $strings['BuyCourses'] = 'Buy courses';
$strings['ErrorContactPlatformAdmin'] = "Se ha producido un error desconocido. Por favor, p<EFBFBD>ngase en contacto con el administrador de la plataforma."; $strings['ConfigurationOfCoursesAndPrices'] = 'Courses and prices configuration';
$strings['Cancelacionpedido'] = "El pedido se ha cancelado."; $strings['ConfigurationOfPayments'] = 'Payments configuration';
$strings['AlreadyBuy'] = "Ya est<EFBFBD> matriculado en el curso"; $strings['OrdersPendingOfPayment'] = 'Orders awaiting payment';
$strings['Message_conf_transf'] = "Una vez confirmado, recibira un e-mail con los datos bancarios y una referencia del pedido."; $strings['AvailableCoursesConfiguration'] = 'Available courses configuration';
$strings['bc_subject'] = "Confirmaci<EFBFBD>n pedido de cursos"; $strings['PaymentsConfiguration'] = 'Payments configuration';
$strings['bc_message'] = "Estimado {{name}}. <br />En cuanto recibamos confirmaci&oacute;n de pago procederemos a dar de alta su usuario en el curso <strong>{{curso}}</strong>.<br><br><strong>No olvide indicar en el concepto de la transferencia el n&uacute;mero de referencia del pedido: <div style='display:inline;text-align:center; font-weight:bold; font-size:20px; color:#333'>{{reference}}</div></strong>"; $strings['bc_message'] = "Dear {{name}}. <br />We are currently waiting for the payment confirmation. Once received, we will enable your user in course <strong>{{curso}}</strong>.<br><br><strong>Please do not forget to mention your order reference number in your transfer: <div style='display:inline;text-align:center; font-weight:bold; font-size:20px; color:#333'>{{reference}}</div></strong>";
$strings['bc_registrado'] = 'Ya se encuentra registrado en el curso'; $strings['Categories'] = "Categories";
$strings['bc_tmp_registrado'] = 'Se encuentra a la espera de recibir el pago'; $strings['BankTransfer'] = 'Bank transfer';
$strings['EnrollToCourseXSuccessful'] = "Your subscription to the course is complete";
$strings['bc_confi_index'] = 'Configuraci<EFBFBD>n cursos y precio'; $strings['SearchFilter'] = "Search filter";
$strings['bc_pagos_index'] = 'Configuraci<EFBFBD>n pagos'; $strings['MinimumPrice'] = "Minimum price";
$strings['bc_pending'] = 'Pedidos pendientes de pago'; $strings['MaximumPrice'] = "Maximum price";
$strings['AvailableCourses'] = "Courses available";
$strings['Ref_pedido'] = 'Referencia del pedido'; $strings['PaymentConfiguration'] = "Payment configuration";
$strings['transferencia_bancaria'] = 'Transferencia Bancaria'; $strings['WaitingToReceiveThePayment'] = "Currently pending payment";
$strings['paypal'] = 'PayPal'; $strings['CurrencyType'] = "Currency type";
$strings['confirmar_compra'] = 'Confirmar compra de curso'; $strings['SelectACurrency'] = "Choose a currency";
$strings['Sandbox'] = "Test environment";
$strings['The_User_Is_Already_Registered'] = 'El usuario ya está registrado'; $strings['BankAccount'] = "Bank account";
$strings['SubscribeUser'] = "Subscribe user";
$strings['DeleteTheOrder'] = "Delete order";
$strings['ReferenceOrder'] = 'Order reference';
$strings['UserInformation'] = "Buyer's details";
$strings['OnceItIsConfirmed,YouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Once confirmed, you will receive an e-mail with the bank details and an order reference.";
$strings['BankAccountInformation'] = 'Bank account details';
$strings['ConfirmOrder'] = 'Confirm order';
$strings['PaymentMethods'] = 'Payment methods';
$strings['CancelOrder'] = 'Cancel order';
$strings['ErrorContactPlatformAdmin'] = "Unknown error. Please contact the platform administrator.";
$strings['PayPalConfig'] = "PayPal configuration:";
$strings['TransfersConfig'] = "Bank transfers configuration:";
$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!";

@ -0,0 +1,72 @@
<?php
//Needed in order to show the plugin title
$strings['plugin_title'] = "Vente de cours";
$strings['plugin_comment'] = "Vendez vos cours directement depuis votre portail Chamilo, au travers d'un compte PayPal. Plugin en version beta, à utiliser avec précaution. 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['Visible'] = "Montrer dans la liste";
$strings['Options'] = "Options";
$strings['Price'] = "Prix";
$strings['SyncCourseDatabase'] = "Synchroniser les cours depuis la base de données";
$strings['Private'] = "Privé - Accès autorisé seulement aux inscrits au cours";
$strings['CourseVisibilityClosed'] = "Fermé - Pas d'accès au cours";
$strings['OpenToThePlatform'] = "Ouvert - Accès autorisé seulement pour les utilisateurs inscrits à la plateforme";
$strings['OpenToTheWorld'] = "Public - Accès autorisé à tous";
$strings['Description'] = "Description";
$strings['Buy'] = "Acheter";
$strings['Mostrar_disponibles'] = "Montrer les cours disponibles";
$strings['paypal_enable'] = "Activer PayPal";
$strings['transfer_enable'] = "Activer les transferts bancaires";
$strings['unregistered_users_enable'] = "Permettre l'accès aux utilisateurs non enregistrés sur la plateforme";
$strings['Cancelacionpedido'] = "La commande a été annulée.";
$strings['AlreadyBuy'] = "Vous êtes déjà inscrit au cours";
$strings['bc_subject'] = "Confirmation de commande de cours";
$strings['paypal'] = "PayPal";
$strings['confirmar_compra'] = "Confirmer achat de cours";
$strings['TheUserIsAlreadyRegistered'] = "L'utilisateur est déjà inscrit";
$strings['ProblemToSaveTheCurrencyType'] = "Problème de sauvegarde du type de devise";
$strings['ProblemToSaveThePaypalParameters'] = "Problème de sauvegarde des paramètres de Paypal";
$strings['ProblemToInsertANewAccount'] = "Problème à l'insertion du nouveau compte";
$strings['ProblemToDeleteTheAccount'] = "Problème de suppression du compte";
$strings['ProblemToSaveTheMessage'] = "Problème d'enregistrement du message";
$strings['ProblemToSubscribeTheUser'] = "Problème d'inscription de l'utilisateur";
$strings['TheSubscriptionAndActivationWereDoneSuccessfully'] = "L'inscription et l'activation se sont déroulés sans problème.";
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = "L'utilisateur est déjà inscrit au cours";
$strings['CourseListOnSale'] = "Liste de cours en vente";
$strings['BuyCourses'] = "Acheter des cours";
$strings['ConfigurationOfCoursesAndPrices'] = "Configuration des cours et prix";
$strings['ConfigurationOfPayments'] = "Configuration des paiements";
$strings['OrdersPendingOfPayment'] = "Commandes en attente de paiement";
$strings['AvailableCoursesConfiguration'] = "Configuration des cours disponibles";
$strings['PaymentsConfiguration'] = "Configuration des paiements";
$strings['bc_message'] = "Cher/Chère {{name}}. <br />À la réception de la confirmation de paiement, nous terminerons le processus d'inscrtipion au cours <strong>{{curso}}</strong>.<br><br><strong>N'oubliez pas d'indiquer le numéro de référence de la commande lors de votre transfert: <div style='display:inline;text-align:center; font-weight:bold; font-size:20px; color:#333'>{{reference}}</div></strong>";
$strings['Categories'] = "Catégories";
$strings['BankTransfer'] = 'Transfert bancaire';
$strings['EnrollToCourseXSuccessful'] = "Votre inscription au cours au cours %s est terminée.";
$strings['SearchFilter'] = "Filtre de recherche";
$strings['MinimumPrice'] = "Prix minimum";
$strings['MaximumPrice'] = "Prix maximum";
$strings['AvailableCourses'] = "Cours disponibles";
$strings['PaymentConfiguration'] = "Configuration des paiements";
$strings['WaitingToReceiveThePayment'] = "En attente de réception du paiement";
$strings['CurrencyType'] = "Tipe de device";
$strings['SelectACurrency'] = "Sélectionnez une devise";
$strings['Sandbox'] = "Environnement de test";
$strings['BankAccount'] = "Compte bancaire";
$strings['SubscribeUser'] = "Inscrire utilisateur";
$strings['DeleteTheOrder'] = "Éliminer la commande";
$strings['ReferenceOrder'] = "Référence de la commande";
$strings['UserInformation'] = "Fiche acheteur";
$strings['OnceItIsConfirmed,YouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Une fois confirmée, vous recevrez un e-mail avec les données bancaires et la référence de la commande";
$strings['BankAccountInformation'] = "Détails du compte bancaire";
$strings['ConfirmOrder'] = "Confirmer commande";
$strings['PaymentMethods'] = "Méthodes de paiement";
$strings['CancelOrder'] = "Annuler la commande";
$strings['ErrorContactPlatformAdmin'] = "Une erreur inconnue s'est produite. Veuillez contacter l'administrateur de la plateforme.";
$strings['PayPalConfig'] = "Configuration PayPal:";
$strings['TransfersConfig'] = "Configuration des transfers bancaires:";
$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é!";

@ -1,7 +1,7 @@
<?php <?php
//Needed in order to show the plugin title //Needed in order to show the plugin title
$strings['plugin_title'] = "Comprar cursos"; $strings['plugin_title'] = "Venta de cursos";
$strings['plugin_comment'] = "Configurar precios, tipos de pago, visibilidad de cursos."; $strings['plugin_comment'] = "Vender cursos a través de PayPal directamente desde su portal Chamilo. Plugin en versión Beta, a usar con mucha precaución. La asociación Chamilo y los desarrolladores involucrados no pueden ser considerados responsables de cualquier inconveniente que se presente.";
$strings['Visible'] = "Mostrar en el listado"; $strings['Visible'] = "Mostrar en el listado";
$strings['Options'] = "Opciones"; $strings['Options'] = "Opciones";
@ -18,11 +18,11 @@ $strings['Buy'] = "Comprar";
$strings['Mostrar_disponibles'] = "Mostrar cursos disponibles"; $strings['Mostrar_disponibles'] = "Mostrar cursos disponibles";
$strings['paypal_enable'] = "Habilitar PayPal"; $strings['paypal_enable'] = "Habilitar PayPal";
$strings['transference_enable'] = "Habilitar transferencia"; $strings['transfer_enable'] = "Habilitar transferencia";
$strings['unregistered_users_enable'] = "Permitir usuarios sin registro en la plataforma"; $strings['unregistered_users_enable'] = "Permitir usuarios sin registro en la plataforma";
$strings['Cancelacionpedido'] = "El pedido se ha cancelado."; $strings['Cancelacionpedido'] = "El pedido se ha cancelado.";
$strings['AlreadyBuy'] = "Ya est<EFBFBD> matriculado en el curso"; $strings['AlreadyBuy'] = "Ya está matriculado en el curso";
$strings['bc_subject'] = "Confirmaci<EFBFBD>n pedido de cursos"; $strings['bc_subject'] = "Confirmación pedido de cursos";
$strings['paypal'] = 'PayPal'; $strings['paypal'] = 'PayPal';
$strings['confirmar_compra'] = 'Confirmar compra de curso'; $strings['confirmar_compra'] = 'Confirmar compra de curso';
@ -38,18 +38,18 @@ $strings['TheSubscriptionAndActivationWereDoneSuccessfully'] = 'La suscripción
$strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'El usuario ya está registrado en el curso.'; $strings['TheUserIsAlreadyRegisteredInTheCourse'] = 'El usuario ya está registrado en el curso.';
$strings['CourseListOnSale'] = 'Lista de cursos a la venta'; $strings['CourseListOnSale'] = 'Lista de cursos a la venta';
$strings['BuyCourses'] = 'Comprar cursos'; $strings['BuyCourses'] = 'Comprar cursos';
$strings['ConfigurationOfCoursesAndPrices'] = 'Configuración de los cursos y precios'; $strings['ConfigurationOfCoursesAndPrices'] = 'Configuración de cursos y precios';
$strings['ConfigurationOfPayments'] = 'Configuración de pagos'; $strings['ConfigurationOfPayments'] = 'Configuración de pagos';
$strings['OrdersPendingOfPayment'] = 'Pedidos pendientes de pago'; $strings['OrdersPendingOfPayment'] = 'Pedidos pendientes de pago';
$strings['AvailableCoursesConfiguration'] = 'Configuración de cursos disponibles'; $strings['AvailableCoursesConfiguration'] = 'Configuración de cursos disponibles';
$strings['PaymentsConfiguration'] = 'Configuración de Pagos'; $strings['PaymentsConfiguration'] = 'Configuración de Pagos';
$strings['bc_message'] = "Estimado {{name}}. <br />En cuanto recibamos confirmaci&oacute;n de pago procederemos a dar de alta su usuario en el curso <strong>{{curso}}</strong>.<br><br><strong>No olvide indicar en el concepto de la transferencia el n&uacute;mero de referencia del pedido: <div style='display:inline;text-align:center; font-weight:bold; font-size:20px; color:#333'>{{reference}}</div></strong>"; $strings['bc_message'] = "Estimado {{name}}. <br />En cuanto recibamos confirmaci&oacute;n de pago procederemos a dar de alta su usuario en el curso <strong>{{curso}}</strong>.<br><br><strong>No olvide indicar en el concepto de la transferencia el n&uacute;mero de referencia del pedido: <div style='display:inline;text-align:center; font-weight:bold; font-size:20px; color:#333'>{{reference}}</div></strong>";
$strings['Categories'] = "Categorias"; $strings['Categories'] = "Categorias";
$strings['BankTransference'] = 'Transferencia Bancaria'; $strings['BankTransfer'] = 'Transferencia Bancaria';
$strings['EnrollToCourseXSuccessful'] = "Su inscripción en el curso %s se ha completado."; $strings['EnrollToCourseXSuccessful'] = "Su inscripción en el curso %s se ha completado.";
$strings['SearchFilter'] = "Filtro de búsqueda"; $strings['SearchFilter'] = "Filtro de búsqueda";
$strings['MinimumPrice'] = "Precio menor de"; $strings['MinimumPrice'] = "Precio mínimo";
$strings['MaximumPrice'] = "Precio mayor de"; $strings['MaximumPrice'] = "Precio máximo";
$strings['AvailableCourses'] = "Cursos disponibles"; $strings['AvailableCourses'] = "Cursos disponibles";
$strings['PaymentConfiguration'] = "Configuración de Pagos"; $strings['PaymentConfiguration'] = "Configuración de Pagos";
$strings['WaitingToReceiveThePayment'] = "Se encuentra a la espera de recibir el pago"; $strings['WaitingToReceiveThePayment'] = "Se encuentra a la espera de recibir el pago";
@ -60,10 +60,13 @@ $strings['BankAccount'] = "Cuenta Bancaria";
$strings['SubscribeUser'] = "Suscribir Usuario"; $strings['SubscribeUser'] = "Suscribir Usuario";
$strings['DeleteTheOrder'] = "Eliminar el Pedido"; $strings['DeleteTheOrder'] = "Eliminar el Pedido";
$strings['ReferenceOrder'] = 'Referencia del pedido'; $strings['ReferenceOrder'] = 'Referencia del pedido';
$strings['UserInformation'] = 'Información del Usuario'; $strings['UserInformation'] = 'Ficha del comprador';
$strings['OnceItIsConfirmed,YouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Una vez confirmado, recibira un e-mail con los datos bancarios y una referencia del pedido."; $strings['OnceItIsConfirmed,YouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Una vez confirmado, recibira un e-mail con los datos bancarios y una referencia del pedido.";
$strings['BankAccountInformation'] = 'Información de la Cuenta Bancaria'; $strings['BankAccountInformation'] = 'Información de la Cuenta Bancaria';
$strings['ConfirmOrder'] = 'Confirmar Orden'; $strings['ConfirmOrder'] = 'Confirmar Orden';
$strings['PaymentMethods'] = 'Métodos de pago'; $strings['PaymentMethods'] = 'Métodos de pago';
$strings['CancelOrder'] = 'Cancelar Orden'; $strings['CancelOrder'] = 'Cancelar Orden';
$strings['ErrorContactPlatformAdmin'] = "Se ha producido un error desconocido. Por favor, póngase en contacto con el administrador de la plataforma."; $strings['ErrorContactPlatformAdmin'] = "Se ha producido un error desconocido. Por favor, póngase en contacto con el administrador de la plataforma.";
$strings['PayPalConfig'] = "Configuraci&oacute;n PayPal:";
$strings['TransfersConfig'] = "Configuraci&oacute;n de transferencias:";
$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!";

@ -1,13 +1,12 @@
<?php <?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). * 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) * These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins)
* @package chamilo.plugin * @package chamilo.plugin.buycourses
* @author Yannick Warnier <ywarnier@beeznest.org>
*/ */
/** /**
* Plugin details (must be present) * Plugin details (must be present)
*/ */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__) . '/config.php';
$plugin_info = Buy_CoursesPlugin::create()->get_info(); $plugin_info = BuyCoursesPlugin::create()->get_info();

@ -1,5 +1,5 @@
Buy Courses<br/><br/> Courses purchase plugin<br/><br/>
Users can access to the catalog to buy the visible courses.<br/> Users can access the courses purchase catalog to buy available courses.<br/>
If the user is unregistered this user will be requested to register.<br/> If the user is unregistered he/she will be requested to register.<br/>
Once the course is chosen Chamilo is going to show different enabled payment types. <br/> Once the course is chosen, Chamilo shows the different payment types available (currently only PayPal works). <br/>
Finally the user will receive through email the user and password to access to the chosen course. <br/> Finally, the user receives user and password by e-mail, to access the chosen course. <br/>

@ -11,11 +11,11 @@ table td.ta-center, table th.ta-center {
text-align: center; text-align: center;
} }
#courses_table td, #transference_table td, #order_table td { #courses_table td, #transfer_table td, #order_table td {
vertical-align: middle; vertical-align: middle;
} }
#courses_table td input.price, #transference_table td input, #currency_type { #courses_table td input.price, #transfer_table td input, #currency_type {
margin: 0; margin: 0;
} }
@ -76,4 +76,4 @@ select#lsessions, select#lcourses, select#lexercises, select#status {
.margin-left-fifty{ .margin-left-fifty{
margin-left: 50px !important; margin-left: 50px !important;
} }

@ -1,5 +1,12 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* AJAX script to get courses descriptions
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
require_once '../config.php'; require_once '../config.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php'; require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
@ -26,4 +33,4 @@ if (Database::num_rows($result) > 0) {
echo CourseManager::get_details_course_description_html($descriptions, api_get_system_encoding(), false); echo CourseManager::get_details_course_description_html($descriptions, api_get_system_encoding(), false);
} else { } else {
echo get_lang('NoDescription'); echo get_lang('NoDescription');
} }

@ -1,12 +1,19 @@
<?php <?php
/* For license terms, see /license.txt */
/** /**
* Functions * Functions
* @package chamilo.plugin.notify * @package chamilo.plugin.buycourses
*/
/**
* Init
*/ */
require_once '../../../main/inc/global.inc.php'; require_once '../../../main/inc/global.inc.php';
require_once '../config.php'; require_once '../config.php';
require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php'; require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
/**
*
*/
function sync() function sync()
{ {
$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE); $tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
@ -18,13 +25,13 @@ function sync()
$sql = "SELECT id FROM $tableCourse"; $sql = "SELECT id FROM $tableCourse";
$res = Database::query($sql); $res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) { while ($row = Database::fetch_assoc($res)) {
$sql = "SELECT 1 FROM $tableBuyCourse WHERE id_course='" . $row['id'] . "';"; $sql = "SELECT 1 FROM $tableBuyCourse WHERE course_id='" . $row['id'] . "';";
Database::query($sql); Database::query($sql);
if (Database::affected_rows() > 0) { if (Database::affected_rows() > 0) {
$sql = "UPDATE $tableBuyCourse SET sync = 1 WHERE id_course='" . $row['id'] . "';"; $sql = "UPDATE $tableBuyCourse SET sync = 1 WHERE course_id='" . $row['id'] . "';";
Database::query($sql); Database::query($sql);
} else { } else {
$sql = "INSERT INTO $tableBuyCourse (id_course, visible, sync) VALUES ('" . $row['id'] . "', 0, 1);"; $sql = "INSERT INTO $tableBuyCourse (course_id, visible, sync) VALUES ('" . $row['id'] . "', 0, 1);";
Database::query($sql); Database::query($sql);
} }
} }
@ -32,13 +39,17 @@ function sync()
Database::query($sql); Database::query($sql);
} }
/**
* List courses detils from the buy-course table and the course table
* @return array Results (list of courses details)
*/
function listCourses() function listCourses()
{ {
$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE); $tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
$tableCourse = Database::get_main_table(TABLE_MAIN_COURSE); $tableCourse = Database::get_main_table(TABLE_MAIN_COURSE);
$sql = "SELECT a.id_course, a.visible, a.price, b.* $sql = "SELECT a.course_id, a.visible, a.price, b.*
FROM $tableBuyCourse a, $tableCourse b FROM $tableBuyCourse a, $tableCourse b
WHERE a.id_course = b.id;"; WHERE a.course_id = b.id;";
$res = Database::query($sql); $res = Database::query($sql);
$aux = array(); $aux = array();
@ -49,6 +60,9 @@ function listCourses()
return $aux; return $aux;
} }
/**
*
*/
function userCourseList() function userCourseList()
{ {
$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE); $tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
@ -56,9 +70,9 @@ function userCourseList()
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); $tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL); $tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL);
$sql = "SELECT a.id_course, a.visible, a.price, b.* $sql = "SELECT a.course_id, a.visible, a.price, b.*
FROM $tableBuyCourse a, $tableCourse b FROM $tableBuyCourse a, $tableCourse b
WHERE a.id_course = b.id AND a.visible = 1;"; WHERE a.course_id = b.id AND a.visible = 1;";
$res = Database::query($sql); $res = Database::query($sql);
$aux = array(); $aux = array();
while ($row = Database::fetch_assoc($res)) { while ($row = Database::fetch_assoc($res)) {
@ -115,6 +129,9 @@ function userCourseList()
return $aux; return $aux;
} }
/**
*
*/
function checkUserCourse($course, $user) function checkUserCourse($course, $user)
{ {
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); $tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
@ -129,7 +146,10 @@ function checkUserCourse($course, $user)
} }
} }
function checkUserCourseTransference($course, $user) /**
*
*/
function checkUserCourseTransfer($course, $user)
{ {
$tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL); $tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL);
$sql = "SELECT 1 FROM $tableBuyCourseTemporal $sql = "SELECT 1 FROM $tableBuyCourseTemporal
@ -143,6 +163,9 @@ function checkUserCourseTransference($course, $user)
} }
} }
/**
*
*/
function listCategories() function listCategories()
{ {
$tblCourseCategory = Database::get_main_table(TABLE_MAIN_CATEGORY); $tblCourseCategory = Database::get_main_table(TABLE_MAIN_CATEGORY);
@ -158,6 +181,8 @@ function listCategories()
/** /**
* Return an icon representing the visibility of the course * Return an icon representing the visibility of the course
* @param int $option The course visibility
* @return string HTML string of the visibility icon
*/ */
function getCourseVisibilityIcon($option) function getCourseVisibilityIcon($option)
{ {
@ -179,7 +204,10 @@ function getCourseVisibilityIcon($option)
return ''; return '';
} }
} }
/**
* List the available currencies
* @result array The list of currencies
*/
function listCurrency() function listCurrency()
{ {
$tableBuyCourseCountry = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY); $tableBuyCourseCountry = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY);
@ -193,11 +221,14 @@ function listCurrency()
return $aux; return $aux;
} }
/**
* Gets the list of accounts from the buy_course_transfer table
* @return array The list of accounts
*/
function listAccounts() function listAccounts()
{ {
$tableBuyCourseTransference = Database::get_main_table(TABLE_BUY_COURSE_TRANSFERENCE); $tableBuyCourseTransfer = Database::get_main_table(TABLE_BUY_COURSE_TRANSFER);
$sql = "SELECT * FROM $tableBuyCourseTransference"; $sql = "SELECT * FROM $tableBuyCourseTransfer";
$res = Database::query($sql); $res = Database::query($sql);
$aux = array(); $aux = array();
while ($row = Database::fetch_assoc($res)) { while ($row = Database::fetch_assoc($res)) {
@ -206,7 +237,10 @@ function listAccounts()
return $aux; return $aux;
} }
/**
* Gets the stored PayPal params
* @return array The stored PayPal params
*/
function paypalParameters() function paypalParameters()
{ {
$tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL); $tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL);
@ -216,11 +250,14 @@ function paypalParameters()
return $row; return $row;
} }
/**
function transferenceParameters() * Gets the parameters for the bank transfers payment method
* @result array Bank transfer payment parameters stored
*/
function transferParameters()
{ {
$tableBuyCourseTransference = Database::get_main_table(TABLE_BUY_COURSE_TRANSFERENCE); $tableBuyCourseTransfer = Database::get_main_table(TABLE_BUY_COURSE_TRANSFER);
$sql = "SELECT * FROM $tableBuyCourseTransference"; $sql = "SELECT * FROM $tableBuyCourseTransfer";
$res = Database::query($sql); $res = Database::query($sql);
$aux = array(); $aux = array();
while ($row = Database::fetch_assoc($res)) { while ($row = Database::fetch_assoc($res)) {
@ -229,7 +266,10 @@ function transferenceParameters()
return $aux; return $aux;
} }
/**
* Find the first enabled currency (there should be only one)
* @result string The code of the active currency
*/
function findCurrency() function findCurrency()
{ {
$tableBuyCourseCountry = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY); $tableBuyCourseCountry = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY);
@ -239,16 +279,21 @@ function findCurrency()
return $row['currency_code']; return $row['currency_code'];
} }
/**
* Extended information about the course (from the course table as well as
* the buy_course table)
* @param string $code The course code
* @return array Info about the course
*/
function courseInfo($code) function courseInfo($code)
{ {
$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE); $tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); $tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tableUser = Database::get_main_table(TABLE_MAIN_USER); $tableUser = Database::get_main_table(TABLE_MAIN_USER);
$code = Database::escape_string($code);
$sql = "SELECT a.id_course, a.visible, a.price, b.* $sql = "SELECT a.course_id, a.visible, a.price, b.*
FROM $tableBuyCourse a, course b FROM $tableBuyCourse a, course b
WHERE a.id_course=b.id WHERE a.course_id=b.id
AND a.visible = 1 AND a.visible = 1
AND b.id = '" . $code . "';"; AND b.id = '" . $code . "';";
$res = Database::query($sql); $res = Database::query($sql);
@ -286,7 +331,14 @@ function courseInfo($code)
return $row; return $row;
} }
/**
* Generates a random text (used for order references)
* @param int $long
* @param bool $minWords
* @param bool $maxWords
* @param bool $number
* @return string A random text
*/
function randomText($long = 6, $minWords = true, $maxWords = true, $number = true) function randomText($long = 6, $minWords = true, $maxWords = true, $number = true)
{ {
$salt = $minWords ? 'abchefghknpqrstuvwxyz' : ''; $salt = $minWords ? 'abchefghknpqrstuvwxyz' : '';
@ -310,7 +362,10 @@ function randomText($long = 6, $minWords = true, $maxWords = true, $number = tru
return $str; return $str;
} }
/**
* Generates an order reference
* @result string A reference number
*/
function calculateReference() function calculateReference()
{ {
$tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL); $tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL);
@ -327,7 +382,11 @@ function calculateReference()
return $reference; return $reference;
} }
/**
* Gets a list of pending orders
* @result array List of orders
* @todo Enable pagination
*/
function pendingList() function pendingList()
{ {
$tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL); $tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL);
@ -339,4 +398,4 @@ function pendingList()
} }
return $aux; return $aux;
} }

@ -1,12 +1,14 @@
<?php <?php
/* For license terms, see /license.txt */
/** /**
* Description of buy_courses_plugin * Description of buy_courses_plugin
* * @package chamilo.plugin.buycourses
* @copyright (c) 2013 Nosolored
* @author Jose Angel Ruiz <jaruiz@nosolored.com> * @author Jose Angel Ruiz <jaruiz@nosolored.com>
*/ */
class Buy_CoursesPlugin extends Plugin /**
* Plugin class for the BuyCourses plugin
*/
class BuyCoursesPlugin extends Plugin
{ {
/** /**
* *
@ -20,7 +22,7 @@ class Buy_CoursesPlugin extends Plugin
protected function __construct() protected function __construct()
{ {
parent::__construct('1.0', 'Jose Angel Ruiz, Francis Gonzales', array('paypal_enable' => 'boolean', 'transference_enable' => 'boolean', 'unregistered_users_enable' => 'boolean')); parent::__construct('1.0', 'Jose Angel Ruiz, Francis Gonzales', array('paypal_enable' => 'boolean', 'transfer_enable' => 'boolean', 'unregistered_users_enable' => 'boolean'));
} }
/** /**
@ -28,7 +30,7 @@ class Buy_CoursesPlugin extends Plugin
*/ */
function install() function install()
{ {
require_once api_get_path(SYS_PLUGIN_PATH) . 'buy_courses/database.php'; require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php';
} }
/** /**
@ -48,7 +50,7 @@ class Buy_CoursesPlugin extends Plugin
$sql = "DROP TABLE IF EXISTS $table"; $sql = "DROP TABLE IF EXISTS $table";
Database::query($sql); Database::query($sql);
$table = Database::get_main_table(TABLE_BUY_COURSE_TRANSFERENCE); $table = Database::get_main_table(TABLE_BUY_COURSE_TRANSFER);
$sql = "DROP TABLE IF EXISTS $table"; $sql = "DROP TABLE IF EXISTS $table";
Database::query($sql); Database::query($sql);
@ -60,4 +62,4 @@ class Buy_CoursesPlugin extends Plugin
$sql = "DROP TABLE IF EXISTS $table"; $sql = "DROP TABLE IF EXISTS $table";
Database::query($sql); Database::query($sql);
} }
} }

@ -1,4 +1,9 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* Configuration script for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/** /**
* Initialization * Initialization
*/ */
@ -6,7 +11,7 @@ require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php'; require_once '../../../main/inc/global.inc.php';
require_once 'buy_course_plugin.class.php'; require_once 'buy_course_plugin.class.php';
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$_cid = 0; $_cid = 0;
$templateName = $plugin->get_lang('AvailableCourses'); $templateName = $plugin->get_lang('AvailableCourses');
@ -28,8 +33,8 @@ if ($teacher) {
$visibility[] = getCourseVisibilityIcon('3'); $visibility[] = getCourseVisibilityIcon('3');
$coursesList = listCourses(); $coursesList = listCourses();
$confirmationImgPath = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png'; $confirmationImgPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/message_confirmation.png';
$saveImgPath = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/save.png'; $saveImgPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/save.png';
$currencyType = findCurrency(); $currencyType = findCurrency();
$tpl->assign('server', $_configuration['root_web']); $tpl->assign('server', $_configuration['root_web']);
@ -39,8 +44,8 @@ if ($teacher) {
$tpl->assign('save_img', $saveImgPath); $tpl->assign('save_img', $saveImgPath);
$tpl->assign('currency', $currencyType); $tpl->assign('currency', $currencyType);
$listing_tpl = 'buy_courses/view/configuration.tpl'; $listing_tpl = 'buycourses/view/configuration.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
} }

@ -1,5 +1,13 @@
<?php <?php
$course_plugin = 'buy_courses'; /* For license terms, see /license.txt */
/**
* Errors management for the Buy Courses plugin - Redirects to list.php
* @package chamilo.plugin.buycourses
*/
/**
* Config
*/
$course_plugin = 'buycourses';
require_once 'buy_course.lib.php'; require_once 'buy_course.lib.php';
require_once 'buy_course_plugin.class.php'; require_once 'buy_course_plugin.class.php';
@ -15,4 +23,4 @@ unset($_SESSION['TOKEN']);
$_SESSION['bc_success'] = false; $_SESSION['bc_success'] = false;
$_SESSION['bc_message'] = 'CancelOrder'; $_SESSION['bc_message'] = 'CancelOrder';
header('Location:list.php'); header('Location:list.php');

@ -1,8 +1,14 @@
<?php <?php
/* For license terms, see /license.txt */
require_once 'paypalfunctions.php';
/** /**
* PayPal Express Checkout Module * PayPal Express Checkout Module
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
require_once 'paypalfunctions.php';
/**
* *
* The paymentAmount is the total value of * The paymentAmount is the total value of
* the shopping cart, that was set * the shopping cart, that was set
@ -38,4 +44,4 @@ if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
echo "Short Error Message: " . $ErrorShortMsg; echo "Short Error Message: " . $ErrorShortMsg;
echo "Error Code: " . $ErrorCode; echo "Error Code: " . $ErrorCode;
echo "Error Severity Code: " . $ErrorSeverityCode; echo "Error Severity Code: " . $ErrorSeverityCode;
} }

@ -1,5 +1,12 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* Functions for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
require_once '../config.php'; require_once '../config.php';
require_once 'buy_course.lib.php'; require_once 'buy_course.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php'; require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
@ -8,13 +15,13 @@ require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE); $tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
$tableBuyCourseCountry = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY); $tableBuyCourseCountry = Database::get_main_table(TABLE_BUY_COURSE_COUNTRY);
$tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL); $tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL);
$tableBuyCourseTransference = Database::get_main_table(TABLE_BUY_COURSE_TRANSFERENCE); $tableBuyCourseTransfer = Database::get_main_table(TABLE_BUY_COURSE_TRANSFER);
$tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL); $tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL);
$tableCourse = Database::get_main_table(TABLE_MAIN_COURSE); $tableCourse = Database::get_main_table(TABLE_MAIN_COURSE);
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); $tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tableUser = Database::get_main_table(TABLE_MAIN_USER); $tableUser = Database::get_main_table(TABLE_MAIN_USER);
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$buy_name = $plugin->get_lang('Buy'); $buy_name = $plugin->get_lang('Buy');
if ($_REQUEST['tab'] == 'sync') { if ($_REQUEST['tab'] == 'sync') {
@ -33,7 +40,7 @@ if ($_REQUEST['tab'] == 'courses_filter') {
$priceMax = Database::escape_string($_REQUEST['pricemax']); $priceMax = Database::escape_string($_REQUEST['pricemax']);
$show = Database::escape_string($_REQUEST['show']); $show = Database::escape_string($_REQUEST['show']);
$category = Database::escape_string($_REQUEST['category']); $category = Database::escape_string($_REQUEST['category']);
$server = Database::escape_string($_configuration['root_web']); $server = api_get_path(WEB_PATH);
$filter = ''; $filter = '';
if ($course != '') { if ($course != '') {
@ -64,14 +71,14 @@ if ($_REQUEST['tab'] == 'courses_filter') {
} }
if ($filter == '') { if ($filter == '') {
$sql = "SELECT a.id_course, a.visible, a.price, b.* $sql = "SELECT a.course_id, a.visible, a.price, b.*
FROM $tableBuyCourse a, $tableCourse b FROM $tableBuyCourse a, $tableCourse b
WHERE a.id_course = b.id WHERE a.course_id = b.id
AND a.visible = 1;"; AND a.visible = 1;";
} else { } else {
$sql = "SELECT a.id_course, a.visible, a.price, b.* $sql = "SELECT a.course_id, a.visible, a.price, b.*
FROM $tableBuyCourse a, $tableCourse b FROM $tableBuyCourse a, $tableCourse b
WHERE a.id_course = b.id WHERE a.course_id = b.id
AND a.visible = 1 AND " . $filter . ";"; AND a.visible = 1 AND " . $filter . ";";
} }
@ -144,7 +151,7 @@ if ($_REQUEST['tab'] == 'courses_filter') {
$content .= '<div class="btn-toolbar right">'; $content .= '<div class="btn-toolbar right">';
$content .= '<a class="ajax btn btn-primary" title="" href="' . $server . 'main/inc/ajax/course_home.ajax.php?a=show_course_information&code=' . $course['code'] . '">' . get_lang('Description') . '</a>&nbsp;'; $content .= '<a class="ajax btn btn-primary" title="" href="' . $server . 'main/inc/ajax/course_home.ajax.php?a=show_course_information&code=' . $course['code'] . '">' . get_lang('Description') . '</a>&nbsp;';
if ($course['enrolled'] != "YES") { if ($course['enrolled'] != "YES") {
$content .= '<a class="btn btn-success" title="" href="' . $server . 'plugin/buy_courses/src/process.php?code=' . $course['id'] . '">' . $buy_name . '</a>'; $content .= '<a class="btn btn-success" title="" href="' . $server . 'plugin/buycourses/src/process.php?code=' . $course['id'] . '">' . $buy_name . '</a>';
} }
$content .= '</div>'; $content .= '</div>';
$content .= '</div>'; $content .= '</div>';
@ -156,10 +163,10 @@ if ($_REQUEST['tab'] == 'courses_filter') {
} }
if ($_REQUEST['tab'] == 'save_currency') { if ($_REQUEST['tab'] == 'save_currency') {
$id = $_REQUEST['currency']; $id = Database::escape_string($_REQUEST['currency']);
$sql = "UPDATE $tableBuyCourseCountry SET status='0';"; $sql = "UPDATE $tableBuyCourseCountry SET status='0';";
$res = Database::query($sql); $res = Database::query($sql);
$sql = "UPDATE $tableBuyCourseCountry SET status='1' WHERE id_country='" . $id . "';"; $sql = "UPDATE $tableBuyCourseCountry SET status='1' WHERE country_id='" . $id . "';";
$res = Database::query($sql); $res = Database::query($sql);
if (!res) { if (!res) {
$content = $plugin->get_lang('ProblemToSaveTheCurrencyType') . Database::error(); $content = $plugin->get_lang('ProblemToSaveTheCurrencyType') . Database::error();
@ -196,7 +203,7 @@ if ($_REQUEST['tab'] == 'add_account') {
$name = Database::escape_string($_REQUEST['name']); $name = Database::escape_string($_REQUEST['name']);
$account = Database::escape_string($_REQUEST['account']); $account = Database::escape_string($_REQUEST['account']);
$swift = Database::escape_string($_REQUEST['swift']); $swift = Database::escape_string($_REQUEST['swift']);
$sql = "INSERT INTO $tableBuyCourseTransference (name, account, swift) $sql = "INSERT INTO $tableBuyCourseTransfer (name, account, swift)
VALUES ('" . $name . "','" . $account . "', '" . $swift . "');"; VALUES ('" . $name . "','" . $account . "', '" . $swift . "');";
$res = Database::query($sql); $res = Database::query($sql);
@ -210,10 +217,9 @@ if ($_REQUEST['tab'] == 'add_account') {
} }
if ($_REQUEST['tab'] == 'delete_account') { if ($_REQUEST['tab'] == 'delete_account') {
$_REQUEST['id'] = intval($_REQUEST['id']); $id = intval($_REQUEST['id']);
$id = $_REQUEST['id'];
$sql = "DELETE FROM $tableBuyCourseTransference WHERE id='" . $id . "';"; $sql = "DELETE FROM $tableBuyCourseTransfer WHERE id='" . $id . "';";
$res = Database::query($sql); $res = Database::query($sql);
if (!res) { if (!res) {
$content = $plugin->get_lang('ProblemToDeleteTheAccount') . Database::error(); $content = $plugin->get_lang('ProblemToDeleteTheAccount') . Database::error();
@ -226,22 +232,21 @@ if ($_REQUEST['tab'] == 'delete_account') {
if ($_REQUEST['tab'] == 'save_mod') { if ($_REQUEST['tab'] == 'save_mod') {
$_REQUEST['id'] = Database::escape_string($_REQUEST['id']); $_REQUEST['id'] = Database::escape_string($_REQUEST['id']);
$idCourse = intval($_REQUEST['id_course']); $idCourse = intval($_REQUEST['course_id']);
$visible = ($_REQUEST['visible'] == "checked") ? 1 : 0; $visible = ($_REQUEST['visible'] == "checked") ? 1 : 0;
$price = Database::escape_string($_REQUEST['price']); $price = Database::escape_string($_REQUEST['price']);
$obj = $_REQUEST['obj'];
$sql = "UPDATE $tableBuyCourse $sql = "UPDATE $tableBuyCourse
SET visible = " . $visible . ", SET visible = " . $visible . ",
price = '" . $price . "' price = '" . $price . "'
WHERE id_course = '" . $idCourse . "';"; WHERE course_id = '" . $idCourse . "';";
$res = Database::query($sql); $res = Database::query($sql);
if (!res) { if (!res) {
$content = $plugin->get_lang('ProblemToSaveTheMessage') . Database::error(); $content = $plugin->get_lang('ProblemToSaveTheMessage') . Database::error();
echo json_encode(array("status" => "false", "content" => $content)); echo json_encode(array("status" => "false", "content" => $content));
} else { } else {
echo json_encode(array("status" => "true", "id_course" => $idCourse)); echo json_encode(array("status" => "true", "course_id" => $idCourse));
} }
} }
@ -261,8 +266,7 @@ if ($_REQUEST['tab'] == 'unset_variables') {
} }
if ($_REQUEST['tab'] == 'clear_order') { if ($_REQUEST['tab'] == 'clear_order') {
$_REQUEST['id'] = intval($_REQUEST['id']); $id = substr(intval($_REQUEST['id']), 6);
$id = substr($_REQUEST['id'], 6);
$sql = "DELETE FROM $tableBuyCourseTemporal WHERE cod='" . $id . "';"; $sql = "DELETE FROM $tableBuyCourseTemporal WHERE cod='" . $id . "';";
$res = Database::query($sql); $res = Database::query($sql);
@ -276,8 +280,7 @@ if ($_REQUEST['tab'] == 'clear_order') {
} }
if ($_REQUEST['tab'] == 'confirm_order') { if ($_REQUEST['tab'] == 'confirm_order') {
$_REQUEST['id'] = intval($_REQUEST['id']); $id = substr(intval($_REQUEST['id']), 6);
$id = substr($_REQUEST['id'], 6);
$sql = "SELECT * FROM $tableBuyCourseTemporal WHERE cod='" . $id . "';"; $sql = "SELECT * FROM $tableBuyCourseTemporal WHERE cod='" . $id . "';";
$res = Database::query($sql); $res = Database::query($sql);
$row = Database::fetch_assoc($res); $row = Database::fetch_assoc($res);
@ -307,4 +310,4 @@ if ($_REQUEST['tab'] == 'confirm_order') {
$content = $plugin->get_lang('ProblemToSubscribeTheUser'); $content = $plugin->get_lang('ProblemToSubscribeTheUser');
echo json_encode(array("status" => "false", "content" => $content)); echo json_encode(array("status" => "false", "content" => $content));
} }
} }

@ -1,9 +1,13 @@
<?php <?php
/* For license terms, see /license.txt */
/** /**
* @package chamilo.plugin.themeselect * Index of the Buy Courses plugin courses list
* @package chamilo.plugin.buycourses
*/ */
/**
$plugin = Buy_CoursesPlugin::create(); *
*/
$plugin = BuyCoursesPlugin::create();
$guess_enable = $plugin->get('unregistered_users_enable'); $guess_enable = $plugin->get('unregistered_users_enable');
if ($guess_enable == "true" || isset($_SESSION['_user'])) { if ($guess_enable == "true" || isset($_SESSION['_user'])) {
@ -17,9 +21,9 @@ if ($guess_enable == "true" || isset($_SESSION['_user'])) {
$tpl->assign('ConfigurationOfCoursesAndPrices', $plugin->get_lang('ConfigurationOfCoursesAndPrices')); $tpl->assign('ConfigurationOfCoursesAndPrices', $plugin->get_lang('ConfigurationOfCoursesAndPrices'));
$tpl->assign('ConfigurationOfPayments', $plugin->get_lang('ConfigurationOfPayments')); $tpl->assign('ConfigurationOfPayments', $plugin->get_lang('ConfigurationOfPayments'));
$tpl->assign('OrdersPendingOfPayment', $plugin->get_lang('OrdersPendingOfPayment')); $tpl->assign('OrdersPendingOfPayment', $plugin->get_lang('OrdersPendingOfPayment'));
$listing_tpl = 'buy_courses/view/index.tpl'; $listing_tpl = 'buycourses/view/index.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
} }

@ -1,11 +1,12 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script displays a form for registering new users. * This script displays a form for registering new users to a course directly
* @package chamilo.auth * @package chamilo.plugin.buycourses
*/
/**
* Init
*/ */
use ChamiloSession as Session; use ChamiloSession as Session;
$language_file = array('registration', 'admin'); $language_file = array('registration', 'admin');

@ -1,6 +1,7 @@
<?php <?php
/** /**
* @package chamilo.plugin.buy_courses * List of courses
* @package chamilo.plugin.buycourses
*/ */
/** /**
* Initialization * Initialization
@ -11,8 +12,8 @@ require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
require_once 'buy_course_plugin.class.php'; require_once 'buy_course_plugin.class.php';
require_once 'buy_course.lib.php'; require_once 'buy_course.lib.php';
$course_plugin = 'buy_courses'; $course_plugin = 'buycourses';
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$_cid = 0; $_cid = 0;
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
@ -49,7 +50,7 @@ $tpl->assign('courses', $courseList);
$tpl->assign('category', $categoryList); $tpl->assign('category', $categoryList);
$tpl->assign('currency', $currencyType); $tpl->assign('currency', $currencyType);
$listing_tpl = 'buy_courses/view/list.tpl'; $listing_tpl = 'buycourses/view/list.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -1,11 +1,16 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* Configuration page for payment methods for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/** /**
* Initialization * Initialization
*/ */
require_once dirname(__FILE__) . '/buy_course.lib.php'; require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php'; require_once '../../../main/inc/global.inc.php';
require_once 'buy_course_plugin.class.php'; require_once 'buy_course_plugin.class.php';
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$_cid = 0; $_cid = 0;
$templateName = $plugin->get_lang('PaymentConfiguration'); $templateName = $plugin->get_lang('PaymentConfiguration');
$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale')); $interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
@ -19,30 +24,30 @@ if ($teacher) {
// Sync course table with the plugin // Sync course table with the plugin
$listCurrency = listCurrency(); $listCurrency = listCurrency();
$paypalParams = paypalParameters(); $paypalParams = paypalParameters();
$transferenceParams = transferenceParameters(); $transferParams = transferParameters();
$confirmationImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png'; $confirmationImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/message_confirmation.png';
$saveImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/save.png'; $saveImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/save.png';
$moreImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/more.png'; $moreImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/more.png';
$deleteImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/delete.png'; $deleteImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/delete.png';
$showImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/acces_tool.gif'; $showImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/acces_tool.gif';
$paypalEnable = $plugin->get('paypal_enable'); $paypalEnable = $plugin->get('paypal_enable');
$transferenceEnable = $plugin->get('transference_enable'); $transferEnable = $plugin->get('transfer_enable');
$tpl->assign('server', $_configuration['root_web']); $tpl->assign('server', $_configuration['root_web']);
$tpl->assign('currencies', $listCurrency); $tpl->assign('currencies', $listCurrency);
$tpl->assign('paypal', $paypalParams); $tpl->assign('paypal', $paypalParams);
$tpl->assign('transference', $transferenceParams); $tpl->assign('transfer', $transferParams);
$tpl->assign('confirmation_img', $confirmationImg); $tpl->assign('confirmation_img', $confirmationImg);
$tpl->assign('save_img', $saveImg); $tpl->assign('save_img', $saveImg);
$tpl->assign('more_img', $moreImg); $tpl->assign('more_img', $moreImg);
$tpl->assign('delete_img', $deleteImg); $tpl->assign('delete_img', $deleteImg);
$tpl->assign('show_img', $showImg); $tpl->assign('show_img', $showImg);
$tpl->assign('paypal_enable', $paypalEnable); $tpl->assign('paypal_enable', $paypalEnable);
$tpl->assign('transference_enable', $transferenceEnable); $tpl->assign('transfer_enable', $transferEnable);
$listing_tpl = 'buy_courses/view/paymentsetup.tpl'; $listing_tpl = 'buycourses/view/paymentsetup.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -1,11 +1,16 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* List of pending payments of the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/** /**
* Initialization * Initialization
*/ */
require_once '../config.php'; require_once '../config.php';
require_once dirname(__FILE__) . '/buy_course.lib.php'; require_once dirname(__FILE__) . '/buy_course.lib.php';
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$_cid = 0; $_cid = 0;
$tableName = $plugin->get_lang('AvailableCoursesConfiguration'); $tableName = $plugin->get_lang('AvailableCoursesConfiguration');
$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale')); $interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
@ -18,8 +23,8 @@ api_protect_course_script(true);
if ($teacher) { if ($teacher) {
$pendingList = pendingList(); $pendingList = pendingList();
$confirmationImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png'; $confirmationImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/message_confirmation.png';
$deleteImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/delete.png'; $deleteImg = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/delete.png';
$currencyType = findCurrency(); $currencyType = findCurrency();
$tpl->assign('server', $_configuration['root_web']); $tpl->assign('server', $_configuration['root_web']);
@ -28,7 +33,7 @@ if ($teacher) {
$tpl->assign('delete_img', $deleteImg); $tpl->assign('delete_img', $deleteImg);
$tpl->assign('currency', $currencyType); $tpl->assign('currency', $currencyType);
$listing_tpl = 'buy_courses/view/pending_orders.tpl'; $listing_tpl = 'buycourses/view/pending_orders.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -1,11 +1,16 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* Process payments for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/** /**
* Initialization * Initialization
*/ */
require_once '../config.php'; require_once '../config.php';
require_once dirname(__FILE__) . '/buy_course.lib.php'; require_once dirname(__FILE__) . '/buy_course.lib.php';
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$_cid = 0; $_cid = 0;
$templateName = $plugin->get_lang('PaymentMethods'); $templateName = $plugin->get_lang('PaymentMethods');
$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale')); $interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
@ -23,8 +28,8 @@ $tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
$sql = "SELECT a.price, a.title, b.code $sql = "SELECT a.price, a.title, b.code
FROM $tableBuyCourse a, $tableCourse b FROM $tableBuyCourse a, $tableCourse b
WHERE a.id_course = " . $code . " WHERE a.course_id = " . $code . "
AND a.id_course = b.id;"; AND a.course_id = b.id;";
$res = Database::query($sql); $res = Database::query($sql);
$row = Database::fetch_assoc($res); $row = Database::fetch_assoc($res);
@ -58,7 +63,7 @@ if (checkUserCourse($_SESSION['bc_course_codetext'], $_SESSION['bc_user_id'])) {
header('Location: list.php'); header('Location: list.php');
} }
if (checkUserCourseTransference($_SESSION['bc_course_codetext'], $_SESSION['bc_user_id'])) { if (checkUserCourseTransfer($_SESSION['bc_course_codetext'], $_SESSION['bc_user_id'])) {
$_SESSION['bc_success'] = false; $_SESSION['bc_success'] = false;
$_SESSION['bc_message'] = 'bc_tmp_registered'; $_SESSION['bc_message'] = 'bc_tmp_registered';
header('Location: list.php'); header('Location: list.php');
@ -67,19 +72,19 @@ if (checkUserCourseTransference($_SESSION['bc_course_codetext'], $_SESSION['bc_u
$currencyType = findCurrency(); $currencyType = findCurrency();
$paypalEnable = $plugin->get('paypal_enable'); $paypalEnable = $plugin->get('paypal_enable');
$transferenceEnable = $plugin->get('transference_enable'); $transferEnable = $plugin->get('transfer_enable');
$courseInfo = courseInfo($code); $courseInfo = courseInfo($code);
$tpl->assign('course', $courseInfo); $tpl->assign('course', $courseInfo);
$tpl->assign('server', $_configuration['root_web']); $tpl->assign('server', $_configuration['root_web']);
$tpl->assign('paypal_enable', $paypalEnable); $tpl->assign('paypal_enable', $paypalEnable);
$tpl->assign('transference_enable', $transferenceEnable); $tpl->assign('transfer_enable', $transferEnable);
$tpl->assign('title', $_SESSION['bc_course_title']); $tpl->assign('title', $_SESSION['bc_course_title']);
$tpl->assign('price', $_SESSION['Payment_Amount']); $tpl->assign('price', $_SESSION['Payment_Amount']);
$tpl->assign('currency', $currencyType); $tpl->assign('currency', $currencyType);
$listing_tpl = 'buy_courses/view/process.tpl'; $listing_tpl = 'buycourses/view/process.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -1,5 +1,12 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* Process purchase confirmation script for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
require_once '../config.php'; require_once '../config.php';
require_once '../../../main/inc/lib/mail.lib.inc.php'; require_once '../../../main/inc/lib/mail.lib.inc.php';
require_once dirname(__FILE__) . '/buy_course.lib.php'; require_once dirname(__FILE__) . '/buy_course.lib.php';
@ -43,7 +50,7 @@ if (isset($_POST['Confirm'])) {
} }
$text .= '</table></div>'; $text .= '</table></div>';
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
$asunto = utf8_encode($plugin->get_lang('bc_subject')); $asunto = utf8_encode($plugin->get_lang('bc_subject'));
@ -87,8 +94,8 @@ if ($_POST['payment_type'] == "PayPal") {
$paymentAmount = $_SESSION["Payment_Amount"]; $paymentAmount = $_SESSION["Payment_Amount"];
$currencyCodeType = $currencyType; $currencyCodeType = $currencyType;
$paymentType = "Sale"; $paymentType = "Sale";
$returnURL = $server . "plugin/buy_courses/src/success.php"; $returnURL = $server . "plugin/buycourses/src/success.php";
$cancelURL = $server . "plugin/buy_courses/src/error.php"; $cancelURL = $server . "plugin/buycourses/src/error.php";
$courseInfo = courseInfo($_SESSION['bc_course_code']); $courseInfo = courseInfo($_SESSION['bc_course_code']);
$courseTitle = $courseInfo['title']; $courseTitle = $courseInfo['title'];
@ -116,7 +123,7 @@ if ($_POST['payment_type'] == "PayPal") {
} }
} }
if ($_POST['payment_type'] == "Transference") { if ($_POST['payment_type'] == "Transfer") {
$_cid = 0; $_cid = 0;
$templateName = $plugin->get_lang('PaymentMethods'); $templateName = $plugin->get_lang('PaymentMethods');
$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale')); $interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
@ -145,8 +152,8 @@ if ($_POST['payment_type'] == "Transference") {
$accountsList = listAccounts(); $accountsList = listAccounts();
$tpl->assign('accounts', $accountsList); $tpl->assign('accounts', $accountsList);
$listing_tpl = 'buy_courses/view/process_confirm.tpl'; $listing_tpl = 'buycourses/view/process_confirm.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
} }

@ -1,5 +1,12 @@
<?php <?php
/* For license terms, see /license.txt */
/**
* Success page for the purchase of a course in the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
use ChamiloSession as Session; use ChamiloSession as Session;
require_once '../config.php'; require_once '../config.php';
@ -9,7 +16,7 @@ require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
$tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL); $tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL);
$plugin = Buy_CoursesPlugin::create(); $plugin = BuyCoursesPlugin::create();
/** /**
* Paypal data * Paypal data
@ -118,7 +125,7 @@ if (!isset($_POST['paymentOption'])) {
} }
$listing_tpl = 'buy_courses/view/success.tpl'; $listing_tpl = 'buycourses/view/success.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
@ -310,4 +317,4 @@ if (!isset($_POST['paymentOption'])) {
header('Location:list.php'); header('Location:list.php');
} }
} }
} }

@ -1,13 +1,13 @@
<?php <?php
/* For license terms, see /license.txt */
/** /**
* This script is included by main/admin/settings.lib.php when unselecting a plugin * 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 * and is meant to remove things installed by the install.php script in both
* the global database and the courses tables * the global database and the courses tables
* @package chamilo.plugin.bigbluebutton * @package chamilo.plugin.buycourses
*/ */
/** /**
* Queries * Queries
*/ */
require_once dirname(__FILE__) . '/config.php'; require_once dirname(__FILE__) . '/config.php';
Buy_CoursesPlugin::create()->uninstall(); BuyCoursesPlugin::create()->uninstall();

@ -1,4 +1,4 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
@ -9,7 +9,7 @@
<th>{{ 'Title'|get_lang }}</th> <th>{{ 'Title'|get_lang }}</th>
<th>{{ 'OfficialCode'|get_lang }}</th> <th>{{ 'OfficialCode'|get_lang }}</th>
<th class="ta-center">{{ 'Visible'|get_lang }}</th> <th class="ta-center">{{ 'Visible'|get_lang }}</th>
<th class="span2">{{ 'Price'|get_plugin_lang('Buy_CoursesPlugin') }}</th> <th class="span2">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
<th class="span1 ta-center">{{ 'Option'|get_lang }}</th> <th class="span1 ta-center">{{ 'Option'|get_lang }}</th>
</tr> </tr>
{% set i = 0 %} {% set i = 0 %}
@ -35,11 +35,11 @@
<td><input type="text" name="price" value="{{course.price}}" class="span1 price" /> {{ currency }}</td> <td><input type="text" name="price" value="{{course.price}}" class="span1 price" /> {{ currency }}</td>
<td class=" ta-center" id="course{{ course.id }}"> <td class=" ta-center" id="course{{ course.id }}">
<div class="confirmed"><img src="{{ confirmation_img }}" alt="ok"/></div> <div class="confirmed"><img src="{{ confirmation_img }}" alt="ok"/></div>
<div class="modified" style="display:none"><img id="{{course.id_course}}" src="{{ save_img }}" alt="save" class="cursor save"/></div> <div class="modified" style="display:none"><img id="{{course.course_id}}" src="{{ save_img }}" alt="save" class="cursor save"/></div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
<div class="cleared"></div> <div class="cleared"></div>
</div> </div>

@ -16,4 +16,4 @@
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>

@ -1,17 +1,17 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row"> <div class="row">
<div class="span3"> <div class="span3">
<div id="course_category_well" class="well"> <div id="course_category_well" class="well">
<ul class="nav nav-list"> <ul class="nav nav-list">
<li class="nav-header"><h4>{{ 'SearchFilter'|get_plugin_lang('Buy_CoursesPlugin') }}:</h4></li> <li class="nav-header"><h4>{{ 'SearchFilter'|get_plugin_lang('BuyCoursesPlugin') }}:</h4></li>
<li class="nav-header">{{ 'Course'|get_lang }}:</li> <li class="nav-header">{{ 'CourseName'|get_lang }}:</li>
<li><input type="text" id="course_name" style="width:95%"/></li> <li><input type="text" id="course_name" style="width:95%"/></li>
<li class="nav-header">{{ 'MinimumPrice'|get_plugin_lang('Buy_CoursesPlugin') }}: <li class="nav-header">{{ 'MinimumPrice'|get_plugin_lang('BuyCoursesPlugin') }}:
<input type="text" id="price_min" class="span1"/> <input type="text" id="price_min" class="span1"/>
</li> </li>
<li class="nav-header">{{ 'MaximumPrice'|get_plugin_lang('Buy_CoursesPlugin') }}: <li class="nav-header">{{ 'MaximumPrice'|get_plugin_lang('BuyCoursesPlugin') }}:
<input type="text" id="price_max" class="span1"/> <input type="text" id="price_max" class="span1"/>
</li> </li>
<li class="nav-header">{{ 'Categories'|get_lang }}:</li> <li class="nav-header">{{ 'Categories'|get_lang }}:</li>
@ -41,7 +41,7 @@
<div class="row"> <div class="row">
<div class="span"> <div class="span">
<div class="thumbnail"> <div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title="" href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}"> <a class="ajax" rel="gb_page_center[778]" title="" href="{{ server }}plugin/buycourses/src/ajax.php?code={{ course.code }}">
<img alt="" src="{{ server }}{{ course.course_img }}"> <img alt="" src="{{ server }}{{ course.course_img }}">
</a> </a>
</div> </div>
@ -52,10 +52,10 @@
<h5>{{ 'Teacher'|get_lang }}: {{ course.teacher }}</h5> <h5>{{ 'Teacher'|get_lang }}: {{ course.teacher }}</h5>
</div> </div>
{% if course.enrolled == "YES" %} {% if course.enrolled == "YES" %}
<span class="label label-info">{{ 'TheUserIsAlreadyRegisteredInTheCourse'|get_plugin_lang('Buy_CoursesPlugin') }}</span> <span class="label label-info">{{ 'TheUserIsAlreadyRegisteredInTheCourse'|get_plugin_lang('BuyCoursesPlugin') }}</span>
{% endif %} {% endif %}
{% if course.enrolled == "TMP" %} {% if course.enrolled == "TMP" %}
<span class="label label-warning">{{ 'WaitingToReceiveThePayment'|get_plugin_lang('Buy_CoursesPlugin') }}</span> <span class="label label-warning">{{ 'WaitingToReceiveThePayment'|get_plugin_lang('BuyCoursesPlugin') }}</span>
{% endif %} {% endif %}
</div> </div>
<div class="span right"> <div class="span right">
@ -64,12 +64,12 @@
</div> </div>
<div class="cleared"></div> <div class="cleared"></div>
<div class="btn-toolbar right"> <div class="btn-toolbar right">
<a class="ajax btn btn-primary" title="" href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}"> <a class="ajax btn btn-primary" title="" href="{{ server }}plugin/buycourses/src/ajax.php?code={{ course.code }}">
{{ 'Description'|get_lang }} {{ 'Description'|get_lang }}
</a> </a>
{% if course.enrolled == "NO" %} {% if course.enrolled == "NO" %}
<a class="btn btn-success" title="" href="{{ server }}plugin/buy_courses/src/process.php?code={{ course.id }}"> <a class="btn btn-success" title="" href="{{ server }}plugin/buycourses/src/process.php?code={{ course.id }}">
{{ 'Buy'|get_plugin_lang('Buy_CoursesPlugin') }} {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
</a> </a>
{% endif %} {% endif %}
</div> </div>
@ -78,4 +78,4 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

@ -1,18 +1,18 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
<h3>{{ 'CurrencyType'|get_plugin_lang('Buy_CoursesPlugin') }}:</h3> <h3>{{ 'CurrencyType'|get_plugin_lang('BuyCoursesPlugin') }}:</h3>
<select id="currency_type"> <select id="currency_type">
<option value="" selected="selected">{{ 'SelectACurrency'|get_plugin_lang('Buy_CoursesPlugin') }}</option> <option value="" selected="selected">{{ 'SelectACurrency'|get_plugin_lang('BuyCoursesPlugin') }}</option>
{% for currency in currencies %} {% for currency in currencies %}
{% if currency.status == 1 %} {% if currency.status == 1 %}
<option value="{{ currency.id_country }}" selected="selected">{{ currency.country_name }} => {{ currency.currency_code }} <option value="{{ currency.country_id }}" selected="selected">{{ currency.country_name }} => {{ currency.currency_code }}
</option> </option>
{% else %} {% else %}
<option value="{{ currency.id_country }}">{{ currency.country_name }} => {{ currency.currency_code }}</option> <option value="{{ currency.country_id }}">{{ currency.country_name }} => {{ currency.currency_code }}</option>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select> </select>
@ -20,11 +20,11 @@
{% if paypal_enable == "true" %} {% if paypal_enable == "true" %}
<hr /> <hr />
<h3>Configuraci&oacute;n PayPal:</h3> <h3>{{ 'PayPalConfig'|get_plugin_lang('BuyCoursesPlugin') }}</h3>
{% if paypal.sandbox == "YES" %} {% if paypal.sandbox == "YES" %}
{{ 'Sandbox'|get_plugin_lang('Buy_CoursesPlugin') }}: <input type="checkbox" id="sandbox" value="YES" checked="checked"/> {{ 'Sandbox'|get_plugin_lang('BuyCoursesPlugin') }}: <input type="checkbox" id="sandbox" value="YES" checked="checked"/>
{% else %} {% else %}
{{ 'Sandbox'|get_plugin_lang('Buy_CoursesPlugin') }}: <input type="checkbox" id="sandbox" value="YES" /> {{ 'Sandbox'|get_plugin_lang('BuyCoursesPlugin') }}: <input type="checkbox" id="sandbox" value="YES" />
{% endif %} {% endif %}
<br /> <br />
API_UserName: <input type="text" id="username" value="{{ paypal.username | e}}" /><br/> API_UserName: <input type="text" id="username" value="{{ paypal.username | e}}" /><br/>
@ -33,19 +33,19 @@
<input type="button" id="save_paypal" class="btn btn-primary" value="{{ 'Save'|get_lang }}"/> <input type="button" id="save_paypal" class="btn btn-primary" value="{{ 'Save'|get_lang }}"/>
{% endif %} {% endif %}
{% if transference_enable == "true" %} {% if transfer_enable == "true" %}
<hr /> <hr />
<h3>Configuraci&oacute;n Transferencia: </h3> <h3>{{ 'TransfersConfig'|get_plugin_lang('BuyCoursesPlugin') }}</h3>
<table id="transference_table" class="data_table"> <table id="transfer_table" class="data_table">
<tr class="row_odd"> <tr class="row_odd">
<th>{{ 'Name'|get_lang }}</th> <th>{{ 'Name'|get_lang }}</th>
<th>{{ 'BankAccount'|get_plugin_lang('Buy_CoursesPlugin') }}</th> <th>{{ 'BankAccount'|get_plugin_lang('BuyCoursesPlugin') }}</th>
<th>{{ 'SWIFT'|get_lang }}</th> <th>{{ 'SWIFT'|get_lang }}</th>
<th class="span1 ta-center">{{ 'Option'|get_lang }}</th> <th class="span1 ta-center">{{ 'Option'|get_lang }}</th>
</tr> </tr>
{% set i = 0 %} {% set i = 0 %}
{% for transf in transference %} {% for transf in transfer %}
{{ i%2==0 ? ' {{ i%2==0 ? '
<tr class="row_even">' : ' <tr class="row_even">' : '
<tr class="row_odd">' }} <tr class="row_odd">' }}
@ -73,4 +73,4 @@
{% endif %} {% endif %}
</div> </div>
<div class="cleared"></div> <div class="cleared"></div>
</div> </div>

@ -1,4 +1,4 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
@ -6,7 +6,7 @@
<div class="span12"> <div class="span12">
<table id="orders_table" class="data_table"> <table id="orders_table" class="data_table">
<tr class="row_odd"> <tr class="row_odd">
<th class="ta-center">{{ 'ReferenceOrder'|get_plugin_lang('Buy_CoursesPlugin') }}</th> <th class="ta-center">{{ 'ReferenceOrder'|get_plugin_lang('BuyCoursesPlugin') }}</th>
<th>{{ 'Name'|get_lang }}</th> <th>{{ 'Name'|get_lang }}</th>
<th>{{ 'Title'|get_lang }}</th> <th>{{ 'Title'|get_lang }}</th>
<th class="span2">{{ 'Price'|get_lang }}</th> <th class="span2">{{ 'Price'|get_lang }}</th>
@ -25,10 +25,10 @@
<td class="ta-center">{{ order.date }}</td> <td class="ta-center">{{ order.date }}</td>
<td class="ta-center" id="order{{ order.cod }}"> <td class="ta-center" id="order{{ order.cod }}">
<img src="{{ confirmation_img }}" alt="ok" class="cursor confirm_order" <img src="{{ confirmation_img }}" alt="ok" class="cursor confirm_order"
title="{{ 'SubscribeUser'|get_plugin_lang('Buy_CoursesPlugin') }}"/> title="{{ 'SubscribeUser'|get_plugin_lang('BuyCoursesPlugin') }}"/>
&nbsp;&nbsp; &nbsp;&nbsp;
<img src="{{ delete_img }}" alt="delete" class="cursor clear_order" <img src="{{ delete_img }}" alt="delete" class="cursor clear_order"
title="{{ 'DeleteTheOrder'|get_plugin_lang('Buy_CoursesPlugin') }}"/> title="{{ 'DeleteTheOrder'|get_plugin_lang('BuyCoursesPlugin') }}"/>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -36,4 +36,4 @@
</table> </table>
</div> </div>
<div class="cleared"></div> <div class="cleared"></div>
</div> </div>

@ -1,4 +1,4 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
@ -6,7 +6,7 @@
<div class="span12"> <div class="span12">
<div id="course_category_well" class="well span3"> <div id="course_category_well" class="well span3">
<ul class="nav nav-list"> <ul class="nav nav-list">
<li class="nav-header"><h4>{{ 'UserInformation'|get_plugin_lang('Buy_CoursesPlugin') }}:</h4></li> <li class="nav-header"><h4>{{ 'UserInformation'|get_plugin_lang('BuyCoursesPlugin') }}:</h4></li>
<li class="nav-header">{{ 'Name'|get_lang }}:</li> <li class="nav-header">{{ 'Name'|get_lang }}:</li>
<li><h5>{{ name }}</h5></li> <li><h5>{{ name }}</h5></li>
<li class="nav-header">{{ 'User'|get_lang }}:</li> <li class="nav-header">{{ 'User'|get_lang }}:</li>
@ -24,7 +24,7 @@
<div class="span"> <div class="span">
<div class="thumbnail"> <div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title="" <a class="ajax" rel="gb_page_center[778]" title=""
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}"> href="{{ server }}plugin/buycourses/src/ajax.php?code={{ course.code }}">
<img alt="" src="{{ server }}{{ course.course_img }}"> <img alt="" src="{{ server }}{{ course.course_img }}">
</a> </a>
</div> </div>
@ -40,7 +40,7 @@
<div class="cleared"></div> <div class="cleared"></div>
<div class="btn-toolbar right"> <div class="btn-toolbar right">
<a class="ajax btn btn-primary" title="" <a class="ajax btn btn-primary" title=""
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">{{'Description'|get_lang }} href="{{ server }}plugin/buycourses/src/ajax.php?code={{ course.code }}">{{'Description'|get_lang }}
</a> </a>
</div> </div>
</div> </div>
@ -50,7 +50,7 @@
<div class="cleared"></div> <div class="cleared"></div>
<form class="form-horizontal span3 offset4" action="../src/process_confirm.php" method="post"> <form class="form-horizontal span3 offset4" action="../src/process_confirm.php" method="post">
<fieldset> <fieldset>
<legend align="center">{{ 'PaymentMethods'|get_plugin_lang('Buy_CoursesPlugin') }}</legend> <legend align="center">{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}</legend>
<div align="center" class="control-group"> <div align="center" class="control-group">
<div class="controls margin-left-fifty"> <div class="controls margin-left-fifty">
{% if paypal_enable == "true" %} {% if paypal_enable == "true" %}
@ -58,18 +58,18 @@
<input type="radio" id="payment_type-p" name="payment_type" value="PayPal" > Paypal <input type="radio" id="payment_type-p" name="payment_type" value="PayPal" > Paypal
</label> </label>
{% endif %} {% endif %}
{% if transference_enable == "true" %} {% if transfer_enable == "true" %}
<label class="radio"> <label class="radio">
<input type="radio" id="payment_type-tra" name="payment_type" value="Transference" > {{ 'BankTransference'|get_plugin_lang('Buy_CoursesPlugin') }} <input type="radio" id="payment_type-tra" name="payment_type" value="Transfer" > {{ 'BankTransfer'|get_plugin_lang('BuyCoursesPlugin') }}
</label> </label>
{% endif %} {% endif %}
</div> </div>
</br> </br>
<input type="hidden" name="currency_type" value="{{ currency }}" /> <input type="hidden" name="currency_type" value="{{ currency }}" />
<input type="hidden" name="server" value="{{ server }}"/> <input type="hidden" name="server" value="{{ server }}"/>
<input align="center" type="submit" class="btn btn-success" value="{{ 'ConfirmOrder'|get_plugin_lang('Buy_CoursesPlugin') }}"/> <input align="center" type="submit" class="btn btn-success" value="{{ 'ConfirmOrder'|get_plugin_lang('BuyCoursesPlugin') }}"/>
</div> </div>
</fieldset> </fieldset>
</form> </form>
<div class="cleared"></div> <div class="cleared"></div>
</div> </div>

@ -1,4 +1,4 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
@ -6,7 +6,7 @@
<div class="span12"> <div class="span12">
<div id="course_category_well" class="well span3"> <div id="course_category_well" class="well span3">
<ul class="nav nav-list"> <ul class="nav nav-list">
<li class="nav-header"><h4>{{ 'UserInformation'|get_plugin_lang('Buy_CoursesPlugin') }}:</h4></li> <li class="nav-header"><h4>{{ 'UserInformation'|get_plugin_lang('BuyCoursesPlugin') }}:</h4></li>
<li class="nav-header">{{ 'Name'|get_lang }}:</li> <li class="nav-header">{{ 'Name'|get_lang }}:</li>
<li><h5>{{ name | e }}</h5></li> <li><h5>{{ name | e }}</h5></li>
<li class="nav-header">{{ 'User'|get_lang }}:</li> <li class="nav-header">{{ 'User'|get_lang }}:</li>
@ -24,7 +24,7 @@
<div class="span"> <div class="span">
<div class="thumbnail"> <div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title="" <a class="ajax" rel="gb_page_center[778]" title=""
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}"> href="{{ server }}plugin/buycourses/src/ajax.php?code={{ course.code }}">
<img src="{{ server }}{{ course.course_img }}"> <img src="{{ server }}{{ course.course_img }}">
</a> </a>
</div> </div>
@ -40,7 +40,7 @@
<div class="cleared"></div> <div class="cleared"></div>
<div class="btn-toolbar right"> <div class="btn-toolbar right">
<a class="ajax btn btn-primary" title="" <a class="ajax btn btn-primary" title=""
href="{{ server }}plugin/buy_courses/src/ajax.php?code={{ course.code }}">{{'Description'|get_lang }} href="{{ server }}plugin/buycourses/src/ajax.php?code={{ course.code }}">{{'Description'|get_lang }}
</a> </a>
</div> </div>
</div> </div>
@ -52,7 +52,7 @@
<div align="center"> <div align="center">
<table class="data_table" style="width:70%"> <table class="data_table" style="width:70%">
<tr> <tr>
<th class="ta-center">{{ 'BankAccountInformation'|get_plugin_lang('Buy_CoursesPlugin') }}</th> <th class="ta-center">{{ 'BankAccountInformation'|get_plugin_lang('BuyCoursesPlugin') }}</th>
</tr> </tr>
{% set i = 0 %} {% set i = 0 %}
{% for account in accounts %} {% for account in accounts %}
@ -63,26 +63,26 @@
{% if account.swift != '' %} {% if account.swift != '' %}
SWIFT: <strong>{{ account.swift | e }}</strong><br/> SWIFT: <strong>{{ account.swift | e }}</strong><br/>
{% endif %} {% endif %}
{{ 'BankAccount'|get_plugin_lang('Buy_CoursesPlugin') }}: <strong>{{ account.account | e }}</strong><br/> {{ 'BankAccount'|get_plugin_lang('BuyCoursesPlugin') }}: <strong>{{ account.account | e }}</strong><br/>
</td></tr> </td></tr>
{% endfor %} {% endfor %}
</table> </table>
<br /> <br />
<div class="normal-message">{{ 'OnceItIsConfirmed,YouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'|get_plugin_lang('Buy_CoursesPlugin') | e}} <div class="normal-message">{{ 'OnceItIsConfirmed,YouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'|get_plugin_lang('BuyCoursesPlugin') | e}}
</div> </div>
<br/> <br/>
<form method="post" name="frmConfirm" action="../src/process_confirm.php"> <form method="post" name="frmConfirm" action="../src/process_confirm.php">
<input type="hidden" name="payment_type" value="Transference"/> <input type="hidden" name="payment_type" value="Transfer"/>
<input type="hidden" name="name" value="{{ name | e }}"/> <input type="hidden" name="name" value="{{ name | e }}"/>
<input type="hidden" name="price" value="{{ course.price }}"/> <input type="hidden" name="price" value="{{ course.price }}"/>
<input type="hidden" name="title" value="{{ course.title | e }}"/> <input type="hidden" name="title" value="{{ course.title | e }}"/>
<div class="btn_next"> <div class="btn_next">
<input class="btn btn-success" type="submit" name="Confirm" value="{{ 'ConfirmOrder'|get_plugin_lang('Buy_CoursesPlugin') }}"/> <input class="btn btn-success" type="submit" name="Confirm" value="{{ 'ConfirmOrder'|get_plugin_lang('BuyCoursesPlugin') }}"/>
<input class="btn btn-danger" type="button" name="Cancel" value="{{ 'CancelOrder'|get_plugin_lang('Buy_CoursesPlugin') }}" id="CancelOrder"/> <input class="btn btn-danger" type="button" name="Cancel" value="{{ 'CancelOrder'|get_plugin_lang('BuyCoursesPlugin') }}" id="CancelOrder"/>
</div> </div>
</form> </form>
</div> </div>
<div class="cleared"></div> <div class="cleared"></div>
</div> </div>

@ -1,4 +1,4 @@
<script type='text/javascript' src="../js/funciones.js"></script> <script type='text/javascript' src="../js/buycourses.js"></script>
<link rel="stylesheet" type="text/css" href="../resources/plugin.css"/> <link rel="stylesheet" type="text/css" href="../resources/plugin.css"/>
@ -6,7 +6,7 @@
<div class="span12"> <div class="span12">
<div id="course_category_well" class="well span3"> <div id="course_category_well" class="well span3">
<ul class="nav nav-list"> <ul class="nav nav-list">
<li class="nav-header"><h4>{{ 'UserInformation'|get_plugin_lang('Buy_CoursesPlugin') }}:</h4></li> <li class="nav-header"><h4>{{ 'UserInformation'|get_plugin_lang('BuyCoursesPlugin') }}:</h4></li>
<li class="nav-header">{{ 'Name'|get_lang }}:</li> <li class="nav-header">{{ 'Name'|get_lang }}:</li>
<li><h5>{{ name }}</h5></li> <li><h5>{{ name }}</h5></li>
<li class="nav-header">{{ 'User'|get_lang }}:</li> <li class="nav-header">{{ 'User'|get_lang }}:</li>
@ -24,7 +24,7 @@
<div class="span"> <div class="span">
<div class="thumbnail"> <div class="thumbnail">
<a class="ajax" rel="gb_page_center[778]" title="" <a class="ajax" rel="gb_page_center[778]" title=""
href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}"> href="{{ server }}plugin/buycourses/function/ajax.php?code={{ course.code }}">
<img alt="" src="{{ server }}{{ course.course_img }}"> <img alt="" src="{{ server }}{{ course.course_img }}">
</a> </a>
</div> </div>
@ -40,7 +40,7 @@
<div class="cleared"></div> <div class="cleared"></div>
<div class="btn-toolbar right"> <div class="btn-toolbar right">
<a class="ajax btn btn-primary" title="" <a class="ajax btn btn-primary" title=""
href="{{ server }}plugin/buy_courses/function/ajax.php?code={{ course.code }}">{{'Description'|get_lang }}</a> href="{{ server }}plugin/buycourses/function/ajax.php?code={{ course.code }}">{{'Description'|get_lang }}</a>
</div> </div>
</div> </div>
@ -50,14 +50,15 @@
<div class="cleared"></div> <div class="cleared"></div>
<hr/> <hr/>
<div align="center"> <div align="center">
<div class="confirmation-message">{{ 'PayPalPaymentOKPleaseConfirm'|get_plugin_lang('BuyCoursesPlugin') }}</div>
<br />
<form method="post" name="frmConfirm" action="../src/success.php"> <form method="post" name="frmConfirm" action="../src/success.php">
<input type="hidden" name="paymentOption" value="PayPal"/> <input type="hidden" name="paymentOption" value="PayPal"/>
<div class="btn_next"> <div class="btn_next">
<input class="btn btn-success" type="submit" name="Confirm" value="{{ 'ConfirmOrder'|get_plugin_lang('Buy_CoursesPlugin') }}"/> <input class="btn btn-success" type="submit" name="Confirm" value="{{ 'ConfirmOrder'|get_plugin_lang('BuyCoursesPlugin') }}"/>
<input class="btn btn-danger" type="button" name="Cancel" value="{{ 'CancelOrder'|get_plugin_lang('Buy_CoursesPlugin') }}" id="cancel_order"/> <input class="btn btn-danger" type="button" name="Cancel" value="{{ 'CancelOrder'|get_plugin_lang('BuyCoursesPlugin') }}" id="cancel_order"/>
</div> </div>
</form> </form>
</div> </div>
<div class="cleared"></div> <div class="cleared"></div>
</div> </div>

Loading…
Cancel
Save