Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent 29cc2e630a
commit cdc93472b6
  1. 2
      main/attendance/index.php
  2. 3
      plugin/buycourses/src/buycourses.ajax.php
  3. 13
      plugin/buycourses/src/configuration.php
  4. 26
      plugin/buycourses/src/configure_course.php
  5. 13
      plugin/buycourses/src/course_catalog.php
  6. 3
      plugin/buycourses/src/course_panel.php
  7. 8
      plugin/buycourses/src/index.buycourses.php
  8. 26
      plugin/buycourses/src/panel.ajax.php
  9. 4
      plugin/buycourses/src/paymentsetup.php
  10. 2
      plugin/buycourses/src/paypal_payout.php
  11. 10
      plugin/buycourses/src/sales_report.php
  12. 2
      plugin/buycourses/src/service_information.php
  13. 10
      plugin/buycourses/src/service_sales_report.php
  14. 4
      plugin/buycourses/src/success.php
  15. 1
      plugin/vchamilo/lib/Virtual.php

@ -299,6 +299,6 @@ switch ($action) {
$attendanceController->getAttendanceBaseInLogin(false, true);
}
break;
default :
default:
$attendanceController->attendance_list();
}

@ -1,6 +1,5 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls
* @package chamilo.plugin.buycourses

@ -4,9 +4,7 @@
* Configuration script for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Initialization
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
@ -17,7 +15,12 @@ $includeServices = $plugin->get('include_services') === 'true';
api_protect_admin_script(true);
Display::addFlash(Display::return_message(get_lang('Info').' - '.$plugin->get_lang('CoursesInSessionsDoesntDisplayHere'), 'info'));
Display::addFlash(
Display::return_message(
get_lang('Info').' - '.$plugin->get_lang('CoursesInSessionsDoesntDisplayHere'),
'info'
)
);
$courses = $plugin->getCoursesForConfiguration();
@ -39,13 +42,11 @@ $tpl->assign('services_are_included', $includeServices);
if ($includeSession) {
$sessions = $plugin->getSessionsForConfiguration();
$tpl->assign('sessions', $sessions);
}
if ($includeServices) {
$services = $plugin->getServices();
$tpl->assign('services', $services);
}

@ -21,12 +21,10 @@ $plugin = BuyCoursesPlugin::create();
$commissionsEnable = $plugin->get('commissions_enable');
if ($commissionsEnable == "true") {
if ($commissionsEnable == 'true') {
$htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/resources/js/commissions.js"></script>';
$defaultCommissions = [];
$commissions = "";
$commissions = '';
}
$includeSession = $plugin->get('include_sessions') === 'true';
@ -58,7 +56,6 @@ if ($editingCourse) {
foreach ($teachers as $courseTeacher) {
$teacher = $courseTeacher->getUser();
$teachersOptions[] = [
'text' => $teacher->getCompleteName(),
'value' => $teacher->getId()
@ -71,10 +68,10 @@ if ($editingCourse) {
if (!empty($currentBeneficiaries)) {
$defaultBeneficiaries = array_column($currentBeneficiaries, 'user_id');
if ($commissionsEnable === 'true') {
$defaultCommissions = array_column($currentBeneficiaries, 'commissions');
foreach ($defaultCommissions as $defaultCommission) {
$commissions .= $defaultCommission.',';
}
@ -137,10 +134,10 @@ if ($editingCourse) {
if (!empty($currentBeneficiaries)) {
$defaultBeneficiaries = array_column($currentBeneficiaries, 'user_id');
if ($commissionsEnable == "true") {
$defaultCommissions = array_column($currentBeneficiaries, 'commissions');
foreach ($defaultCommissions as $defaultCommission) {
$commissions .= $defaultCommission.',';
}
@ -165,7 +162,6 @@ if ($editingCourse) {
}
if ($commissionsEnable === 'true') {
$htmlHeadXtra[] = ''
. '<script>'
. '$(function(){'
@ -189,7 +185,6 @@ if ($commissionsEnable === 'true') {
. '});'
. '});'
. '</script>';
}
$form = new FormValidator('beneficiaries');
@ -223,9 +218,7 @@ if ($editingCourse) {
}
if ($commissionsEnable === 'true') {
$platformCommission = $plugin->getPlatformCommission();
$form->addHtml( ''
. '<div class="form-group">'
. '<label for="sliders" class="col-sm-2 control-label">'
@ -241,9 +234,8 @@ if ($commissionsEnable === 'true') {
. '</div>'
. '</div>'
);
$form->addHidden('commissions', '');
}
$form->addHidden('t', null);
@ -285,7 +277,7 @@ if ($form->validate()) {
$commissions = array_fill(0, count($usersId), 0);
$beneficiaries = array_combine($usersId, $commissions);
}
$plugin->registerItemBeneficiaries($productItem['id'], $beneficiaries);
}
} else {
@ -298,7 +290,7 @@ if ($form->validate()) {
$form->setDefaults($formDefaults);
//View
// View
$templateName = $plugin->get_lang('AvailableCourse');
$interbreadcrumb[] = [

@ -3,9 +3,7 @@
* List of courses
* @package chamilo.plugin.buycourses
*/
/**
* Initialization
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';
@ -18,7 +16,14 @@ $nameFilter = null;
$minFilter = 0;
$maxFilter = 0;
$form = new FormValidator('search_filter_form', 'get', null, null, [], FormValidator::LAYOUT_INLINE);
$form = new FormValidator(
'search_filter_form',
'get',
null,
null,
[],
FormValidator::LAYOUT_INLINE
);
if ($form->validate()) {
$formValues = $form->getSubmitValues();

@ -3,9 +3,6 @@
* User Panel
* @package chamilo.plugin.buycourses
*/
/**
* Initialization
*/
$cidReset = true;

@ -1,12 +1,11 @@
<?php
/* For license terms, see /license.txt */
/**
* Index of the Buy Courses plugin courses list
* @package chamilo.plugin.buycourses
*/
/**
*
*/
$plugin = BuyCoursesPlugin::create();
$guess_enable = $plugin->get('unregistered_users_enable');
@ -18,10 +17,7 @@ if ($guess_enable == "true" || isset($_SESSION['_user'])) {
}
$tpl = new Template();
$content = $tpl->fetch('buycourses/view/index.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
}

@ -1,6 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/* For licensing terms, see /chamilo_license.txt */
/**
* Responses to AJAX calls
* @package chamilo.plugin.buycourses
@ -21,7 +21,6 @@ $action = isset($_GET['a']) ? $_GET['a'] : null;
switch ($action) {
case 'saleInfo':
//$saleId is only used in getSale() and is always filtered there
$saleId = isset($_POST['id']) ? $_POST['id'] : '';
$sale = $plugin->getSale($saleId);
@ -53,13 +52,9 @@ switch ($action) {
$html .= '<img class="thumbnail" src="'. $productImage .'" >';
$html .= '</div>';
$html .= '</div>';
echo $html;
break;
case 'stats':
$stats = [];
$stats['completed_count'] = 0;
$stats['completed_total_amount'] = 0;
@ -91,7 +86,6 @@ switch ($action) {
$stats['canceled_total_amount'] = number_format($stats['canceled_total_amount'], 2);
}
$html = '<div class="row">'
. '<p>'
. '<ul>'
@ -102,9 +96,7 @@ switch ($action) {
. '</p>';
$html .= '</div>';
echo $html;
break;
case 'processPayout':
if (api_is_anonymous()) {
break;
@ -114,11 +106,9 @@ switch ($action) {
$allPays = [];
$totalAccounts = 0;
$totalPayout = 0;
$payouts = isset($_POST['payouts']) ? $_POST['payouts'] : '';
if (!$payouts) {
echo Display::return_message(get_plugin_lang("SelectOptionToProceed", "BuyCoursesPlugin"), 'error', false);
break;
@ -158,14 +148,11 @@ switch ($action) {
}
$paypalParams = $plugin->getPaypalParams();
$pruebas = $paypalParams['sandbox'] == 1;
$paypalUsername = $paypalParams['username'];
$paypalPassword = $paypalParams['password'];
$paypalSignature = $paypalParams['signature'];
require_once("paypalfunctions.php");
$allPayouts = [];
$totalAccounts = 0;
$totalPayout = 0;
@ -173,7 +160,6 @@ switch ($action) {
$payouts = isset($_POST['payouts']) ? $_POST['payouts'] : '';
if (!$payouts) {
echo Display::return_message(get_plugin_lang("SelectOptionToProceed", "BuyCoursesPlugin"), 'error', false);
break;
@ -194,28 +180,20 @@ switch ($action) {
foreach ($allPayouts as $payout) {
$plugin->setStatusPayouts($payout['id'], BuyCoursesPlugin::PAYOUT_STATUS_COMPLETED);
}
echo Display::return_message(get_plugin_lang("PayoutSuccess", "BuyCoursesPlugin"), 'success', false);
} else {
echo Display::return_message('<b>'.$result['L_SEVERITYCODE0'].' '.$result['L_ERRORCODE0'].'</b> - '.$result['L_SHORTMESSAGE0'].'<br /><ul><li>'. $result['L_LONGMESSAGE0'].'</li></ul>', 'error', false);
}
break;
case 'cancelPayout':
case 'cancelPayout':
if (api_is_anonymous()) {
break;
}
$payoutId = isset($_POST['id']) ? $_POST['id'] : '';
$plugin->setStatusPayouts($payoutId, BuyCoursesPlugin::PAYOUT_STATUS_CANCELED);
echo '';
break;
}
exit;

@ -1,12 +1,10 @@
<?php
/* For license terms, see /license.txt */
/**
* Configuration page for payment methods for the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Initialization
*/
$cidReset = true;
require_once __DIR__.'/../../../main/inc/global.inc.php';

@ -1,6 +1,6 @@
<?php
/* For license terms, see /license.txt */
/**
* List page for Paypal Payout for the Buy Courses plugin
* @package chamilo.plugin.buycourses

@ -1,6 +1,6 @@
<?php
/* For license terms, see /license.txt */
/**
* List of pending payments of the Buy Courses plugin
* @package chamilo.plugin.buycourses
@ -150,9 +150,9 @@ if ($paypalEnable == "true" && $commissionsEnable == "true") {
'primary',
['title' => $plugin->get_lang('PaypalPayoutCommissions')]
);
$template->assign('actions', $toolbar);
}
if ($commissionsEnable == "true") {
@ -164,9 +164,9 @@ if ($commissionsEnable == "true") {
'info',
['title' => $plugin->get_lang('PayoutReport')]
);
$template->assign('actions', $toolbar);
}
$template->assign('form', $form->returnForm());
$template->assign('selected_sale', $selectedSale);

@ -1,6 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Service information page
* Show information about a service (for custom purposes)

@ -1,6 +1,6 @@
<?php
/* For license terms, see /license.txt */
/**
* List of pending payments of the Buy Courses plugin
* @package chamilo.plugin.buycourses
@ -62,9 +62,9 @@ if ($paypalEnable == 'true' && $commissionsEnable == 'true') {
'primary',
['title' => $plugin->get_lang('PaypalPayoutCommissions')]
);
$template->assign('actions', $toolbar);
}
if ($commissionsEnable == 'true') {
@ -76,9 +76,9 @@ if ($commissionsEnable == 'true') {
'info',
['title' => $plugin->get_lang('PayoutReport')]
);
$template->assign('actions', $toolbar);
}
$template->assign('form', $form->returnForm());
$template->assign('showing_services', true);

@ -4,9 +4,7 @@
* Success page for the purchase of a course in the Buy Courses plugin
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
require_once '../config.php';
$plugin = BuyCoursesPlugin::create();

@ -24,7 +24,6 @@ class Virtual
return;
}
// provides an effective value for the virtual root_web based on domain analysis
self::getHostName($_configuration);

Loading…
Cancel
Save