diff --git a/plugin/buy_courses/js/funciones.js b/plugin/buy_courses/js/funciones.js
index e69d30e7b0..aa0802e4b9 100644
--- a/plugin/buy_courses/js/funciones.js
+++ b/plugin/buy_courses/js/funciones.js
@@ -29,16 +29,16 @@ $(document).ready(function () {
$(".guardar").click(function () {
var vvisible = $(this).parent().parent().prev().prev().children().attr("checked");
var vprice = $(this).parent().parent().prev().children().attr("value");
- var idcurso = $(this).parent().parent().attr("id");
- $.post("function.php", {tab: "save_mod", id: idcurso, visible: vvisible, price: vprice},
+ var courseid = $(this).parent().parent().attr("id");
+ $.post("function.php", {tab: "save_mod", id: courseid, visible: vvisible, price: vprice},
function (data) {
if (data.status == "false") {
alert("Error database");
} else {
- $("#curso" + data.id).children().attr("style", "display:''");
- $("#curso" + data.id).children().next().attr("style", "display:none");
- $("#curso" + data.id).parent().removeClass("fmod")
- $("#curso" + data.id).parent().children().each(function () {
+ $("#course" + data.id).children().attr("style", "display:''");
+ $("#course" + data.id).children().next().attr("style", "display:none");
+ $("#course" + data.id).parent().removeClass("fmod")
+ $("#course" + data.id).parent().children().each(function () {
$(this).removeClass("btop");
});
}
@@ -62,22 +62,22 @@ $(document).ready(function () {
$('#confirmar_filtro').click(function (e) {
- var vcurso = $("#course_name").attr("value");
+ var vcourse = $("#course_name").attr("value");
var pmin = $("#price_min").attr("value");
var pmax = $("#price_max").attr("value");
if ($("#mostrar_disponibles").attr("checked") == "checked") {
- var vmostrar = "SI";
+ var vshow = "SI";
} else {
- var vmostrar = "NO";
+ var vshow = "NO";
}
- var vcategoria = $("#categoria_cursos").attr("value");
- $.post("function.php", {tab: "courses_filter", course: vcurso, pricemin: pmin, pricemax: pmax, mostrar: vmostrar, categoria: vcategoria},
+ var vcategory = $("#courses_category").attr("value");
+ $.post("function.php", {tab: "courses_filter", course: vcourse, pricemin: pmin, pricemax: pmax, mostrar: vshow, category: vcategory},
function (data) {
if (data.status == "false") {
- alert(data.contenido);
- $("#resultado_cursos").html('');
+ alert(data.content);
+ $("#course_results").html('');
} else {
- $("#resultado_cursos").html(data.contenido);
+ $("#course_results").html(data.content);
}
$(document).ready(acciones_ajax);
}, "json");
diff --git a/plugin/buy_courses/lang/spanish.php b/plugin/buy_courses/lang/spanish.php
index 2fd61ff4a6..a89292c970 100644
--- a/plugin/buy_courses/lang/spanish.php
+++ b/plugin/buy_courses/lang/spanish.php
@@ -16,14 +16,11 @@ $strings['OpenToTheWorld'] = "Público - acceso autorizado a cualquier per
$strings['Description'] = "Descripción";
$strings['Buy'] = "Comprar";
$strings['Filtro_buscar'] = "Filtro de busqueda";
-$strings['Curso'] = "Curso";
$strings['Price_Maximum'] = "Precio mayor de";
$strings['Price_Minimum'] = "Precio menor de";
$strings['Mostrar_disponibles'] = "Mostrar cursos disponibles";
-$strings['Categorias'] = "Categorias";
$strings['paypal_enable'] = "Habilitar PayPal";
-$strings['tarjet_credit_enable'] = "Habilitar TPV";
$strings['transference_enable'] = "Habilitar transferencia";
$strings['unregistered_users_enable'] = "Permitir usuarios sin registro en la plataforma";
@@ -36,7 +33,6 @@ $strings['bc_subject'] = "Confirmaci�n pedido de cursos";
$strings['bc_tmp_registrado'] = 'Se encuentra a la espera de recibir el pago';
$strings['Ref_pedido'] = 'Referencia del pedido';
-$strings['transferencia_bancaria'] = 'Transferencia Bancaria';
$strings['paypal'] = 'PayPal';
$strings['confirmar_compra'] = 'Confirmar compra de curso';
@@ -56,4 +52,6 @@ $strings['ConfigurationOfPayments'] = 'Configuración de pagos';
$strings['OrdersPendingOfPayment'] = 'Pedidos pendientes de pago';
$strings['AvailableCoursesConfiguration'] = 'Configuración de cursos disponibles';
$strings['PaymentsConfiguration'] = 'Configuración de Pagos';
-$strings['bc_message'] = "Estimado {{name}}. En cuanto recibamos confirmación de pago procederemos a dar de alta su usuario en el curso {{curso}} .No olvide indicar en el concepto de la transferencia el número de referencia del pedido: {{reference}}
";
\ No newline at end of file
+$strings['bc_message'] = "Estimado {{name}}. En cuanto recibamos confirmación de pago procederemos a dar de alta su usuario en el curso {{curso}} .No olvide indicar en el concepto de la transferencia el número de referencia del pedido: {{reference}}
";
+$strings['Categories'] = "Categorias";
+$strings['BankTransference'] = 'Transferencia Bancaria';
diff --git a/plugin/buy_courses/resources/borrar.png b/plugin/buy_courses/resources/delete.png
similarity index 100%
rename from plugin/buy_courses/resources/borrar.png
rename to plugin/buy_courses/resources/delete.png
diff --git a/plugin/buy_courses/resources/plugin.css b/plugin/buy_courses/resources/plugin.css
index 2f1bbb03d7..3d72411cf7 100644
--- a/plugin/buy_courses/resources/plugin.css
+++ b/plugin/buy_courses/resources/plugin.css
@@ -11,20 +11,20 @@ table td.ta-center, table th.ta-center {
text-align: center;
}
-#tabla_cursos td, #tabla_trasferencia td, #tabla_pedidos td {
+#courses_table td, #transference_table td, #order_table td {
vertical-align: middle;
}
-#tabla_cursos td input.price, #tabla_trasferencia td input, #currency_type {
+#courses_table td input.price, #transference_table td input, #currency_type {
margin: 0;
}
-#tabla_cursos td.btop {
+#courses_table td.btop {
border-top: 1px solid red;
border-bottom: 1px solid red;
}
-#tabla_cursos tr.fmod {
+#courses_table tr.fmod {
border: 1px solid red;
background: #FFE0E0;
}
@@ -53,23 +53,23 @@ table td.ta-center, table th.ta-center {
text-align: center;
}
-textarea#mensaje {
+textarea#message {
width: 50%;
}
-.envio_resultado {
+.send_result {
font-weight: bold;
}
-select#lsesiones, select#lcursos, select#lejercicios, select#estado {
+select#lsessions, select#lcourses, select#lexercises, select#status {
margin-bottom: 0px;
}
-.columna_campo_filtro {
+.column_field_filter {
padding: 6px 10px 1px 1px;
text-align: right;
}
.height5 {
height: 5px;
-}
+}
\ No newline at end of file
diff --git a/plugin/buy_courses/src/buy_course_plugin.class.php b/plugin/buy_courses/src/buy_course_plugin.class.php
index 1d7d87b58f..3f60d08714 100644
--- a/plugin/buy_courses/src/buy_course_plugin.class.php
+++ b/plugin/buy_courses/src/buy_course_plugin.class.php
@@ -18,7 +18,7 @@ class Buy_CoursesPlugin extends Plugin
return $result ? $result : $result = new self();
}
- protected function __construct()
+ public function __construct()
{
parent::__construct('1.0', 'Jose Angel Ruiz, Francis Gonzales', array('paypal_enable' => 'boolean', 'transference_enable' => 'boolean', 'unregistered_users_enable' => 'boolean'));
}
diff --git a/plugin/buy_courses/src/configuration.php b/plugin/buy_courses/src/configuration.php
index de4694beae..e7a8192140 100644
--- a/plugin/buy_courses/src/configuration.php
+++ b/plugin/buy_courses/src/configuration.php
@@ -42,4 +42,4 @@ if ($teacher) {
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
-}
+}
\ No newline at end of file
diff --git a/plugin/buy_courses/src/error.php b/plugin/buy_courses/src/error.php
index c81e2f234d..d9cc805282 100644
--- a/plugin/buy_courses/src/error.php
+++ b/plugin/buy_courses/src/error.php
@@ -14,5 +14,5 @@ unset($_SESSION['nvpReqArray']);
unset($_SESSION['TOKEN']);
$_SESSION['bc_success'] = false;
$_SESSION['bc_message'] = 'CancelOrder';
-header('Location:list.php');
-?>
\ No newline at end of file
+
+header('Location:list.php');
\ No newline at end of file
diff --git a/plugin/buy_courses/src/expresscheckout.php b/plugin/buy_courses/src/expresscheckout.php
index 5784e6a24d..d949faa59e 100644
--- a/plugin/buy_courses/src/expresscheckout.php
+++ b/plugin/buy_courses/src/expresscheckout.php
@@ -58,5 +58,4 @@ if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
echo "Short Error Message: " . $ErrorShortMsg;
echo "Error Code: " . $ErrorCode;
echo "Error Severity Code: " . $ErrorSeverityCode;
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/plugin/buy_courses/src/list.php b/plugin/buy_courses/src/list.php
index eef9177e66..2e497efc4e 100644
--- a/plugin/buy_courses/src/list.php
+++ b/plugin/buy_courses/src/list.php
@@ -27,12 +27,12 @@ if (isset($_SESSION['bc_success'])) {
if ($_SESSION['bc_success'] == true) {
$message = sprintf(utf8_encode($plugin->get_lang($_SESSION['bc_message'])), $_SESSION['bc_url']);
unset($_SESSION['bc_url']);
- $tpl->assign('estilo', 'confirmation-message');
+ $tpl->assign('class', 'confirmation-message');
} else {
$message = utf8_encode($plugin->get_lang($_SESSION['bc_message']));
- $tpl->assign('estilo', 'warning-message');
+ $tpl->assign('class', 'warning-message');
}
- $tpl->assign('mensaje', $message);
+ $tpl->assign('message', $message);
unset($_SESSION['bc_success']);
unset($_SESSION['bc_message']);
@@ -45,11 +45,11 @@ $categoryList = listCategories();
$currencyType = findCurrency();
$tpl->assign('server', $_configuration['root_web']);
-$tpl->assign('cursos', $courseList);
-$tpl->assign('categorias', $categoryList);
+$tpl->assign('courses', $courseList);
+$tpl->assign('category', $categoryList);
$tpl->assign('currency', $currencyType);
$listing_tpl = 'buy_courses/view/list.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
-$tpl->display_one_col_template();
+$tpl->display_one_col_template();
\ No newline at end of file
diff --git a/plugin/buy_courses/src/paymentsetup.php b/plugin/buy_courses/src/paymentsetup.php
index c180635124..504eed9794 100644
--- a/plugin/buy_courses/src/paymentsetup.php
+++ b/plugin/buy_courses/src/paymentsetup.php
@@ -5,12 +5,12 @@
require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php';
require_once 'buy_course_plugin.class.php';
-
+$plugin = Buy_CoursesPlugin::create();
$_cid = 0;
-$interbreadcrumb[] = array("url" => "list.php", "name" => 'Listado de cursos a la venta');
-$interbreadcrumb[] = array("url" => "configuration.php", "name" => get_lang('Configuración de cursos disponibles'));
+$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
+$interbreadcrumb[] = array("url" => "configuration.php", "name" => $plugin->get_lang('AvailableCoursesConfiguration'));
-$tpl = new Template('Configuración de Pagos');
+$tpl = new Template('PaymentConfiguration');
$teacher = api_is_platform_admin();
api_protect_course_script(true);
@@ -18,34 +18,30 @@ api_protect_course_script(true);
if ($teacher) {
// Sync course table with the plugin
$listCurrency = listCurrency();
-
$paypalParams = paypalParameters();
$transferenceParams = transferenceParameters();
- $ruta = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png';
- $ruta2 = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/save.png';
- $ruta3 = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/more.png';
- $ruta4 = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/borrar.png';
- $ruta5 = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/acces_tool.gif';
+ $confirmationImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png';
+ $saveImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/save.png';
+ $moreImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/more.png';
+ $deleteImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/delete.png';
+ $showImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/acces_tool.gif';
$plugin = Buy_CoursesPlugin::create();
- $paypal_enable = $plugin->get('paypal_enable');
- $tarjeta_enable = $plugin->get('tarjet_credit_enable');
- $transference_enable = $plugin->get('transference_enable');
+ $paypalEnable = $plugin->get('paypal_enable');
+ $transferenceEnable = $plugin->get('transference_enable');
$tpl->assign('server', $_configuration['root_web']);
$tpl->assign('currencies', $listCurrency);
$tpl->assign('paypal', $paypalParams);
- $tpl->assign('transferencia', $transferenceParams);
- $tpl->assign('confirmation_img', $ruta);
- $tpl->assign('save_img', $ruta2);
- $tpl->assign('ruta_more', $ruta3);
- $tpl->assign('ruta_borrar', $ruta4);
- $tpl->assign('ruta_ver', $ruta5);
- $tpl->assign('paypal_enable', $paypal_enable);
- $tpl->assign('tarjeta_enable', $tarjeta_enable);
- $tpl->assign('transference_enable', $transference_enable);
-
+ $tpl->assign('transference', $transferenceParams);
+ $tpl->assign('confirmation_img', $confirmationImg);
+ $tpl->assign('save_img', $saveImg);
+ $tpl->assign('more_img', $moreImg);
+ $tpl->assign('delete_img', $deleteImg);
+ $tpl->assign('show_img', $showImg);
+ $tpl->assign('paypal_enable', $paypalEnable);
+ $tpl->assign('transference_enable', $transferenceEnable);
$listing_tpl = 'buy_courses/view/paymentsetup.tpl';
$content = $tpl->fetch($listing_tpl);
diff --git a/plugin/buy_courses/src/paypalfunctions.php b/plugin/buy_courses/src/paypalfunctions.php
index ca563d5943..32f33556a4 100644
--- a/plugin/buy_courses/src/paypalfunctions.php
+++ b/plugin/buy_courses/src/paypalfunctions.php
@@ -567,7 +567,4 @@ function deformatNVP($nvpstr)
return $nvpArray;
-}
-
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/plugin/buy_courses/src/pending_orders.php b/plugin/buy_courses/src/pending_orders.php
index 0a6599bc42..0ae1144775 100644
--- a/plugin/buy_courses/src/pending_orders.php
+++ b/plugin/buy_courses/src/pending_orders.php
@@ -6,27 +6,26 @@ require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php';
require_once 'lib/buy_course_plugin.class.php';
+$plugin = Buy_CoursesPlugin::create();
$_cid = 0;
-$interbreadcrumb[] = array("url" => "list.php", "name" => 'Listado de cursos a la venta');
-$interbreadcrumb[] = array("url" => "paymentsetup.php", "name" => get_lang('Configuración pagos'));
+$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
+$interbreadcrumb[] = array("url" => "paymentsetup.php", "name" => $plugin->get_lang('PaymentsConfiguration'));
-
-$tpl = new Template('Configuración de cursos disponibles');
+$tpl = new Template('AvailableCoursesConfiguration');
$teacher = api_is_platform_admin();
api_protect_course_script(true);
if ($teacher) {
$pendingList = pendingList();
- $ruta = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png';
- $ruta2 = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/borrar.png';
+ $confirmationImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/message_confirmation.png';
+ $deleteImg = api_get_path(WEB_PLUGIN_PATH) . 'buy_courses/resources/delete.png';
$currencyType = findCurrency();
-
$tpl->assign('server', $_configuration['root_web']);
- $tpl->assign('pendientes', $pendingList);
- $tpl->assign('confirmation_img', $ruta);
- $tpl->assign('ruta_imagen_borrar', $ruta2);
+ $tpl->assign('pending', $pendingList);
+ $tpl->assign('confirmation_img', $confirmationImg);
+ $tpl->assign('delete_img', $deleteImg);
$tpl->assign('currency', $currencyType);
$listing_tpl = 'buy_courses/view/pending_orders.tpl';
diff --git a/plugin/buy_courses/src/process.php b/plugin/buy_courses/src/process.php
index 93bafc72af..b1958966b6 100644
--- a/plugin/buy_courses/src/process.php
+++ b/plugin/buy_courses/src/process.php
@@ -6,17 +6,22 @@ require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once '../../../main/inc/global.inc.php';
require_once 'lib/buy_course_plugin.class.php';
+$plugin = Buy_CoursesPlugin::create();
$_cid = 0;
-$interbreadcrumb[] = array("url" => "list.php", "name" => 'Listado de cursos a la venta');
+$interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
-$tpl = new Template('Tipo de pago');
+$tpl = new Template('PaymentType');
if (isset($_GET['code'])) {
$code = (int)$_GET['code'];
} else {
$code = $_SESSION['bc_course_code'];
}
-$sql = "SELECT price, title, code FROM plugin_buycourses a, course b WHERE a.id_course='" . $code . "' AND a.id_course=b.id;";
+
+$tableBuyCourse = Database::get_main_table(TABLE_BUY_COURSE);
+$sql = "SELECT price, title, code FROM $tableBuyCourse a, course b
+ WHERE a.id_course='" . $code . "'
+ AND a.id_course=b.id;";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
$_SESSION['Payment_Amount'] = number_format($row['price'], 2, '.', '');
@@ -25,7 +30,7 @@ $_SESSION['bc_course_title'] = $row['title'];
$_SESSION['bc_course_code'] = $row['code'];
if (!isset($_SESSION['_user'])) {
- //Necesita registro
+ //Needs to be Registered
if (!isset($_SESSION['bc_user'])) {
header('Location:inscription.php');
exit;
@@ -43,7 +48,7 @@ if (!isset($_SESSION['_user'])) {
$tpl->assign('user', $_SESSION['bc_user']['username']);
}
-if (checkUserCourse($_SESSION['bc_curso_codetext'], $_SESSION['bc_user_id'])) {
+if (checkUserCourse($_SESSION['bc_course_codetext'], $_SESSION['bc_user_id'])) {
$_SESSION['bc_success'] = false;
$_SESSION['bc_message'] = 'AlreadyBuy';
header('Location: list.php');
@@ -51,28 +56,25 @@ if (checkUserCourse($_SESSION['bc_curso_codetext'], $_SESSION['bc_user_id'])) {
if (checkUserCourseTransference($_SESSION['bc_course_codetext'], $_SESSION['bc_user_id'])) {
$_SESSION['bc_success'] = false;
- $_SESSION['bc_message'] = 'bc_tmp_registrado';
+ $_SESSION['bc_message'] = 'bc_tmp_registered';
header('Location: list.php');
}
$currencyType = findCurrency();
$plugin = Buy_CoursesPlugin::create();
-$paypal_enable = $plugin->get('paypal_enable');
-$tarjeta_enable = $plugin->get('tarjet_credit_enable');
-$transference_enable = $plugin->get('transference_enable');
+$paypalEnable = $plugin->get('paypal_enable');
+$transferenceEnable = $plugin->get('transference_enable');
$courseInfo = courseInfo($code);
-$tpl->assign('curso', $courseInfo);
+$tpl->assign('course', $courseInfo);
$tpl->assign('server', $_configuration['root_web']);
-$tpl->assign('paypal_enable', $paypal_enable);
-$tpl->assign('tarjeta_enable', $tarjeta_enable);
-$tpl->assign('transference_enable', $transference_enable);
+$tpl->assign('paypal_enable', $paypalEnable);
+$tpl->assign('transference_enable', $transferenceEnable);
$tpl->assign('title', $_SESSION['bc_course_title']);
$tpl->assign('price', $_SESSION['Payment_Amount']);
$tpl->assign('currency', $currencyType);
-
$listing_tpl = 'buy_courses/view/process.tpl';
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
diff --git a/plugin/buy_courses/src/process_confirm.php b/plugin/buy_courses/src/process_confirm.php
index 24a5578398..f3a37bfbf9 100644
--- a/plugin/buy_courses/src/process_confirm.php
+++ b/plugin/buy_courses/src/process_confirm.php
@@ -6,25 +6,12 @@ require_once '../../../main/inc/lib/mail.lib.inc.php';
require_once dirname(__FILE__) . '/buy_course.lib.php';
require_once 'lib/buy_course_plugin.class.php';
-function completar($valor, $digitos)
-{
- $resultado = '';
- if (strlen($valor) < $digitos) {
- $ceros = $digitos - strlen(ceil($valor));
- for ($i = 0; $i < $ceros; $i++) {
- $resultado .= '0';
- }
- }
- $resultado .= $valor;
- return $resultado;
-}
-
if ($_POST['payment_type'] == '') {
header('Location:process.php');
}
if (isset($_POST['Aceptar'])) {
- //Almacenamos usuario, curso, referencia en tabla temporal
+ // Save the user, course and reference in a tmp table
$user_id = $_SESSION['bc_user_id'];
$course_code = $_SESSION['bc_course_codetext'];
$reference = calculateReference();
@@ -38,7 +25,7 @@ if (isset($_POST['Aceptar'])) {
$sql = "INSERT INTO plugin_bc_temporal (user_id, name, course_code, title, reference, price) VALUES ('" . $user_id . "', '" . $name . "','" . $course_code . "','" . $title . "','" . $reference . "','" . $price . "');";
$res = Database::query($sql);
- //Notificamos al usuario y enviamos datos bancarios
+ // Notify the user and send the bank info
$accountsList = listAccounts();
$texto = '
Datos Bancarios ';
@@ -67,16 +54,16 @@ if (isset($_POST['Aceptar'])) {
}
$courseInfo = courseInfo($_SESSION['bc_course_code']);
- $title_curso = $courseInfo['title'];
+ $title_course = $courseInfo['title'];
$message = utf8_encode($plugin->get_lang('bc_message'));
$message = str_replace("{{name}}", $name, $message);
- $message = str_replace("{{curso}}", $title_curso, $message);
+ $message = str_replace("{{course}}", $title_course, $message);
$message = str_replace("{{reference}}", $reference, $message);
$message .= $texto;
api_mail($name, $email, $asunto, $message);
- // Volvemos al listado de cursos
+ // Return to course list
header('Location:list.php');
}
@@ -128,16 +115,16 @@ if ($_POST['payment_type'] == "PayPal") {
}
}
-if ($_POST['payment_type'] == "Transferencia") {
+if ($_POST['payment_type'] == "Transference") {
$_cid = 0;
- $interbreadcrumb[] = array("url" => "list.php", "name" => 'Listado de cursos a la venta');
+ $interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
$tpl = new Template('Tipo de pago');
$code = $_SESSION['bc_course_code'];
$courseInfo = courseInfo($code);
- $tpl->assign('curso', $courseInfo);
+ $tpl->assign('course', $courseInfo);
$tpl->assign('server', $_configuration['root_web']);
$tpl->assign('title', $_SESSION['bc_course_title']);
$tpl->assign('price', $_SESSION['Payment_Amount']);
@@ -152,7 +139,7 @@ if ($_POST['payment_type'] == "Transferencia") {
$tpl->assign('user', $_SESSION['bc_user']['username']);
}
- //Obtenemos el listado de cuentas bancarias.
+ //Get bank list account
$accountsList = listAccounts();
$tpl->assign('accounts', $accountsList);
@@ -160,6 +147,4 @@ if ($_POST['payment_type'] == "Transferencia") {
$content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
-}
-
-?>
+}
\ No newline at end of file
diff --git a/plugin/buy_courses/src/success.php b/plugin/buy_courses/src/success.php
index 605cca9f55..31d05b328b 100644
--- a/plugin/buy_courses/src/success.php
+++ b/plugin/buy_courses/src/success.php
@@ -8,6 +8,7 @@ require_once 'lib/buy_course_plugin.class.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
+$plugin = Buy_CoursesPlugin::create();
/*
==================================================================
// DATOS DE PAYPAL //
@@ -95,14 +96,14 @@ if ($token != "") {
if (!isset($_POST['paymentOption'])) {
//PANTALLA DE CONFIRMACION DEL PEDIDO
$_cid = 0;
- $interbreadcrumb[] = array("url" => "list.php", "name" => 'Listado de cursos a la venta');
+ $interbreadcrumb[] = array("url" => "list.php", "name" => $plugin->get_lang('CourseListOnSale'));
- $tpl = new Template('Tipo de pago');
+ $tpl = new Template('PaymentType');
$code = $_SESSION['bc_course_code'];
$courseInfo = courseInfo($code);
- $tpl->assign('curso', $courseInfo);
+ $tpl->assign('course', $courseInfo);
$tpl->assign('server', $_configuration['root_web']);
$tpl->assign('title', $_SESSION['bc_course_title']);
$tpl->assign('price', $_SESSION['Payment_Amount']);
@@ -216,10 +217,6 @@ if (!isset($_POST['paymentOption'])) {
//INSERTAMOS LOS REGISTROS NECESARIOS EN LAS TABLAS DE BASES DE DATOS PARA DAR AL USUARIO DE ALTA
if ($paymentStatus == "Completed") {
- $plugin = Buy_CoursesPlugin::create();
-
- //echo "Se ha realizado la compra correctamente";
-
$user_id = $_SESSION['bc_user_id']; //api_get_user_id();
$course_code = $_SESSION['bc_course_codetext'];
$all_course_information = CourseManager::get_course_information($course_code);
diff --git a/plugin/buy_courses/view/configuration.tpl b/plugin/buy_courses/view/configuration.tpl
index e8857fea33..27cfbb7c63 100644
--- a/plugin/buy_courses/view/configuration.tpl
+++ b/plugin/buy_courses/view/configuration.tpl
@@ -4,7 +4,7 @@
-
+
{{ 'Title'|get_lang }}
{{ 'OfficialCode'|get_lang }}
@@ -14,7 +14,7 @@
{% set i = 0 %}
- {% for curso in cursos %}
+ {% for course in courses %}
{{ i%2==0 ? '
' : '
' }}
@@ -24,9 +24,9 @@
{{course.title}}
{{ course.visual_code }}
- {{curso.code}}
+ {{course.code}}
- {% if curso.visible == 1 %}
+ {% if course.visible == 1 %}
{% else %}
diff --git a/plugin/buy_courses/view/list.tpl b/plugin/buy_courses/view/list.tpl
index 369132205b..08cea72dfc 100644
--- a/plugin/buy_courses/view/list.tpl
+++ b/plugin/buy_courses/view/list.tpl
@@ -15,22 +15,22 @@
-
-
+
+
- {% for categoria in categorias %}
- {{ categoria.name }}
+ {% for category in categories %}
+ {{ category.name }}
{% endfor %}
-
+
-
+
{% if rmessage == "YES" %}
-
{{ mensaje }}
+
{{ message }}
{% endif %}
{% for course in courses %}
diff --git a/plugin/buy_courses/view/paymentsetup.tpl b/plugin/buy_courses/view/paymentsetup.tpl
index 49cba584c8..4578da8b4a 100644
--- a/plugin/buy_courses/view/paymentsetup.tpl
+++ b/plugin/buy_courses/view/paymentsetup.tpl
@@ -45,7 +45,7 @@
{% set i = 0 %}
- {% for transf in transferencia %}
+ {% for transf in transference %}
{{ i%2==0 ? '
' : '
' }}
@@ -54,7 +54,7 @@
{{ transf.account | e }}
{{ transf.swift | e }}
-
+
{% endfor %}
@@ -65,7 +65,7 @@
-
+
diff --git a/plugin/buy_courses/view/pending_orders.tpl b/plugin/buy_courses/view/pending_orders.tpl
index aee853269b..26fad299d1 100644
--- a/plugin/buy_courses/view/pending_orders.tpl
+++ b/plugin/buy_courses/view/pending_orders.tpl
@@ -4,7 +4,7 @@
-
+
{{ 'Ref_pedido'|get_lang }}
{{ 'Name'|get_lang }}
@@ -15,22 +15,22 @@
{% set i = 0 %}
- {% for pedido in pendientes %}
+ {% for order in pending %}
{{ i%2==0 ? '
' : '
' }}
{% set i = i + 1 %}
- {{ pedido.reference }}
- {{ pedido.name }}
- {{ pedido.title }}
- {{ pedido.price }} {{ currency }}
- {{ pedido.date }}
-
+ {{ order.reference }}
+ {{ order.name }}
+ {{ order.title }}
+ {{ order.price }} {{ currency }}
+ {{ order.date }}
+
-
+
{% endfor %}
diff --git a/plugin/buy_courses/view/process.tpl b/plugin/buy_courses/view/process.tpl
index c35762675a..22de8db224 100644
--- a/plugin/buy_courses/view/process.tpl
+++ b/plugin/buy_courses/view/process.tpl
@@ -24,23 +24,23 @@
-
{{ curso.title }}
- {{ 'Teacher'|get_lang }}: {{ curso.teacher }}
+ {{ course.title }}
+ {{ 'Teacher'|get_lang }}: {{ course.teacher }}
-
{{ curso.price }} {{ currency }}
+
{{ course.price }} {{ currency }}
@@ -60,13 +60,11 @@
{% if paypal_enable == "true" %}
- {{ 'paypal'|get_lang
- }}
+ {{ 'paypal'|get_lang }}
{% endif %}
{% if transference_enable == "true" %}
- {{
- 'transferencia_bancaria'|get_lang }}
+ {{ 'BankTransference'|get_lang }}
{% endif %}
diff --git a/plugin/buy_courses/view/process_confirm.tpl b/plugin/buy_courses/view/process_confirm.tpl
index d80512fe1c..7dc2c14673 100644
--- a/plugin/buy_courses/view/process_confirm.tpl
+++ b/plugin/buy_courses/view/process_confirm.tpl
@@ -24,23 +24,23 @@
-
{{ curso.title }}
- {{ 'Teacher'|get_lang }}: {{ curso.teacher }}
+ {{ course.title }}
+ {{ 'Teacher'|get_lang }}: {{ course.teacher }}
-
{{ curso.price }} {{ currency }}
+
{{ course.price }} {{ currency }}
@@ -76,14 +76,14 @@
diff --git a/plugin/buy_courses/view/success.tpl b/plugin/buy_courses/view/success.tpl
index d7d1c4da9f..f83c772e9c 100644
--- a/plugin/buy_courses/view/success.tpl
+++ b/plugin/buy_courses/view/success.tpl
@@ -24,23 +24,23 @@
-
{{ curso.title }}
- {{ 'Teacher'|get_lang }}: {{ curso.teacher }}
+ {{ course.title }}
+ {{ 'Teacher'|get_lang }}: {{ course.teacher }}