Browse Source

Update plugins to work with new v2 structure

jmontoyaa 8 years ago
parent
commit
57d2452670
38 changed files with 98 additions and 158 deletions
  1. 1 0
      plugin/buycourses/index.php
  2. 2 3
      plugin/buycourses/install.php
  3. 2 1
      plugin/buycourses/plugin.php
  4. 0 2
      plugin/buycourses/src/buycourses.ajax.php
  5. 3 3
      plugin/buycourses/src/configuration.php
  6. 3 4
      plugin/buycourses/src/configure_course.php
  7. 0 2
      plugin/buycourses/src/course_catalog.php
  8. 0 2
      plugin/buycourses/src/course_panel.php
  9. 2 3
      plugin/buycourses/src/error.php
  10. 3 4
      plugin/buycourses/src/expresscheckout.php
  11. 8 23
      plugin/buycourses/src/panel.ajax.php
  12. 0 2
      plugin/buycourses/src/paymentsetup.php
  13. 0 2
      plugin/buycourses/src/payout_panel.php
  14. 0 2
      plugin/buycourses/src/payout_report.php
  15. 1 2
      plugin/buycourses/src/paypal_payout.php
  16. 2 4
      plugin/buycourses/src/process.php
  17. 1 1
      plugin/buycourses/src/process_confirm.php
  18. 4 2
      plugin/buycourses/src/sales_report.php
  19. 1 4
      plugin/buycourses/src/service_error.php
  20. 0 2
      plugin/buycourses/src/service_information.php
  21. 1 5
      plugin/buycourses/src/service_process.php
  22. 2 4
      plugin/buycourses/src/service_process_confirm.php
  23. 1 1
      plugin/buycourses/src/service_sales_report.php
  24. 3 4
      plugin/buycourses/src/service_success.php
  25. 2 7
      plugin/buycourses/src/services_add.php
  26. 1 6
      plugin/buycourses/src/services_edit.php
  27. 1 5
      plugin/buycourses/src/session_catalog.php
  28. 0 2
      plugin/buycourses/src/session_panel.php
  29. 2 4
      plugin/buycourses/src/success.php
  30. 2 3
      plugin/buycourses/uninstall.php
  31. 5 3
      plugin/buycourses/view/catalog.html.twig
  32. 1 1
      plugin/buycourses/view/configuration.html.twig
  33. 2 2
      plugin/buycourses/view/payout_report.html.twig
  34. 3 3
      plugin/buycourses/view/paypal_payout.html.twig
  35. 1 1
      plugin/buycourses/view/service_information.html.twig
  36. 36 36
      plugin/buycourses/view/service_sales_report.html.twig
  37. 0 0
      plugin/clockworksms/readme.md
  38. 2 3
      plugin/courseblock/CourseBlockPlugin.php

+ 1 - 0
plugin/buycourses/index.php

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

+ 2 - 3
plugin/buycourses/install.php

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

+ 2 - 1
plugin/buycourses/plugin.php

@@ -1,7 +1,8 @@
 <?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)
  * @package chamilo.plugin.buycourses
  */

+ 0 - 2
plugin/buycourses/src/buycourses.ajax.php

@@ -8,8 +8,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 api_protect_admin_script(true);
 
 $plugin = BuyCoursesPlugin::create();

+ 3 - 3
plugin/buycourses/src/configuration.php

@@ -7,15 +7,15 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 $plugin = BuyCoursesPlugin::create();
 $includeSession = $plugin->get('include_sessions') === 'true';
 $includeServices = $plugin->get('include_services') === 'true';
 
 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();
 

+ 3 - 4
plugin/buycourses/src/configure_course.php

@@ -1,15 +1,14 @@
 <?php
 /* For license terms, see /license.txt */
+
 /**
  * Configuration script for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Initialization
- */
+
 $cidReset = true;
 
-require_once '../config.php';
+require_once __DIR__.'/../config.php';
 
 api_protect_admin_script();
 

+ 0 - 2
plugin/buycourses/src/course_catalog.php

@@ -6,8 +6,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 $plugin = BuyCoursesPlugin::create();
 $includeSessions = $plugin->get('include_sessions') === 'true';
 $includeServices = $plugin->get('include_services') === 'true';

+ 0 - 2
plugin/buycourses/src/course_panel.php

@@ -6,8 +6,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 $plugin = BuyCoursesPlugin::create();
 $includeSessions = $plugin->get('include_sessions') === 'true';
 

+ 2 - 3
plugin/buycourses/src/error.php

@@ -4,9 +4,8 @@
  * Errors management for the Buy Courses plugin - Redirects to course_catalog.php
  * @package chamilo.plugin.buycourses
  */
-/**
- * Config
- */
+
 unset($_SESSION['bc_sale_id']);
 
 header('Location: course_catalog.php');
+exit;

+ 3 - 4
plugin/buycourses/src/expresscheckout.php

@@ -1,12 +1,11 @@
 <?php
 /* For license terms, see /license.txt */
+
 /**
  * PayPal Express Checkout Module
  * @package chamilo.plugin.buycourses
  */
-/**
- * Init
- */
+
 require_once 'paypalfunctions.php';
 /**
  *
@@ -15,7 +14,7 @@ require_once 'paypalfunctions.php';
  * earlier in a session variable
  * by the shopping cart page
  */
-$paymentAmount = $_SESSION["Payment_Amount"];
+$paymentAmount = $_SESSION['Payment_Amount'];
 
 /**
  * The currencyCodeType and paymentType

+ 8 - 23
plugin/buycourses/src/panel.ajax.php

@@ -1,6 +1,6 @@
 <?php
-
 /* For licensing terms, see /chamilo_license.txt */
+
 /**
  * Responses to AJAX calls
  * @package chamilo.plugin.buycourses
@@ -8,8 +8,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 api_protect_admin_script(true);
 
 $plugin = BuyCoursesPlugin::create();
@@ -21,7 +19,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);
@@ -57,9 +54,7 @@ switch ($action) {
         echo $html;
 
         break;
-
     case 'stats':
-
         $stats = [];
         $stats['completed_count'] = 0;
         $stats['completed_total_amount'] = 0;
@@ -102,9 +97,7 @@ switch ($action) {
         . '</p>';
         $html .= '</div>';
         echo $html;
-
         break;
-
     case 'processPayout':
         if (api_is_anonymous()) {
             break;
@@ -151,7 +144,6 @@ switch ($action) {
 
         echo $html;
         break;
-
     case 'proceedPayout':
         if (api_is_anonymous()) {
             break;
@@ -198,24 +190,17 @@ switch ($action) {
             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':
-        if (api_is_anonymous()) {
-            break;
-        }
-
-        $payoutId = isset($_POST['id']) ? $_POST['id'] : '';
-
-        $plugin->setStatusPayouts($payoutId, BuyCoursesPlugin::PAYOUT_STATUS_CANCELED);
-
-        echo '';
+            if (api_is_anonymous()) {
+                break;
+            }
 
-        break;
+            $payoutId = isset($_POST['id']) ? $_POST['id'] : '';
+            $plugin->setStatusPayouts($payoutId, BuyCoursesPlugin::PAYOUT_STATUS_CANCELED);
+            echo '';
+            break;
 }
 exit;

+ 0 - 2
plugin/buycourses/src/paymentsetup.php

@@ -7,8 +7,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 api_protect_admin_script(true);
 
 $plugin = BuyCoursesPlugin::create();

+ 0 - 2
plugin/buycourses/src/payout_panel.php

@@ -6,8 +6,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 $plugin = BuyCoursesPlugin::create();
 $includeSessions = $plugin->get('include_sessions') === 'true';
 

+ 0 - 2
plugin/buycourses/src/payout_report.php

@@ -8,8 +8,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 $htmlHeadXtra[] = api_get_css('plugins/buycourses/css/style.css');
 $htmlHeadXtra[] = '<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>';
 

+ 1 - 2
plugin/buycourses/src/paypal_payout.php

@@ -1,12 +1,11 @@
 <?php
-
 /* For license terms, see /license.txt */
+
 /**
  * List page for Paypal Payout for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
 $cidReset = true;
-require_once __DIR__.'/../../../main/inc/global.inc.php';
 
 $htmlHeadXtra[] = api_get_css('plugins/buycourses/css/style.css');
 

+ 2 - 4
plugin/buycourses/src/process.php

@@ -4,10 +4,8 @@
  * Process payments for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Initialization
- */
-require_once '../config.php';
+
+require_once __DIR__.'/../config.php';
 
 $currentUserId = api_get_user_id();
 

+ 1 - 1
plugin/buycourses/src/process_confirm.php

@@ -4,7 +4,7 @@
  * Process purchase confirmation script for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-require_once '../config.php';
+require_once __DIR__.'/../config.php';
 
 $htmlHeadXtra[] = api_get_css('plugins/buycourses/css/style.css');
 

+ 4 - 2
plugin/buycourses/src/sales_report.php

@@ -1,6 +1,6 @@
 <?php
-
 /* For license terms, see /license.txt */
+
 /**
  * List of pending payments of the Buy Courses plugin
  * @package chamilo.plugin.buycourses
@@ -8,7 +8,7 @@
 
 $cidReset = true;
 
-require_once '../config.php';
+require_once __DIR__.'/../config.php';
 
 api_protect_admin_script();
 
@@ -174,6 +174,8 @@ $template->assign('sale_list', $saleList);
 $template->assign('sale_status_canceled', BuyCoursesPlugin::SALE_STATUS_CANCELED);
 $template->assign('sale_status_pending', BuyCoursesPlugin::SALE_STATUS_PENDING);
 $template->assign('sale_status_completed', BuyCoursesPlugin::SALE_STATUS_COMPLETED);
+$template->assign('showing_services', false);
+
 
 $content = $template->fetch('@plugin/buycourses/view/sales_report.tpl');
 

+ 1 - 4
plugin/buycourses/src/service_error.php

@@ -4,11 +4,8 @@
  * Errors management for the Buy Courses plugin - Redirects to service_catalog.php with a error msg
  * @package chamilo.plugin.buycourses
  */
-/**
- * Config
- */
 
-require_once '../config.php';
+require_once __DIR__.'/../config.php';
 
 if (isset($_SESSION['bc_service_sale_id'])) {
 

+ 0 - 2
plugin/buycourses/src/service_information.php

@@ -10,8 +10,6 @@
 
 $cidReset = true;
 
-require_once '../../../main/inc/global.inc.php';
-
 $serviceId = isset($_GET['service_id']) ? intval($_GET['service_id']) : false;
 
 $plugin = BuyCoursesPlugin::create();

+ 1 - 5
plugin/buycourses/src/service_process.php

@@ -4,13 +4,10 @@
  * Process payments for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Initialization
- */
 
 $cidReset = true;
 
-require_once '../config.php';
+require_once __DIR__.'/../config.php';
 
 if (!isset($_REQUEST['t'], $_REQUEST['i'])) {
     header('Location: ' . api_get_path(WEB_PLUGIN_PATH) . 'buycourses/src/service_catalog.php');
@@ -131,7 +128,6 @@ $tpl->assign('service', $serviceInfo);
 $tpl->assign('user', api_get_user_info());
 $tpl->assign('form', $form->returnForm());
 
-
 $content = $tpl->fetch('@plugin/buycourses/view/process.tpl');
 
 $tpl->assign('content', $content);

+ 2 - 4
plugin/buycourses/src/service_process_confirm.php

@@ -4,10 +4,8 @@
  * Process purchase confirmation script for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Init
- */
-require_once '../config.php';
+
+require_once __DIR__.'/../config.php';
 
 $plugin = BuyCoursesPlugin::create();
 

+ 1 - 1
plugin/buycourses/src/service_sales_report.php

@@ -7,7 +7,7 @@
  */
 $cidReset = true;
 
-require_once '../config.php';
+require_once __DIR__.'/../config.php';
 
 api_protect_admin_script();
 

+ 3 - 4
plugin/buycourses/src/service_success.php

@@ -1,13 +1,12 @@
 <?php
 /* For license terms, see /license.txt */
+
 /**
  * Success page for the purchase of a service in the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Init
- */
-require_once '../config.php';
+
+require_once __DIR__.'/../config.php';
 
 $plugin = BuyCoursesPlugin::create();
 $paypalEnabled = $plugin->get('paypal_enable') === 'true';

+ 2 - 7
plugin/buycourses/src/services_add.php

@@ -4,14 +4,9 @@
  * Create new Services for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Init
- */
 
 $cidReset = true;
 
-require_once '../../../main/inc/global.inc.php';
-
 $plugin = BuyCoursesPlugin::create();
 $currency = $plugin->getSelectedCurrency();
 $em = Database::getManager();
@@ -104,13 +99,13 @@ $form->setDefaults($formDefaultValues);
 
 if ($form->validate()) {
     $values = $form->getSubmitValues();
-    
+
     $plugin->storeService($values);
 
     Display::addFlash(
         Display::return_message($plugin->get_lang('ServiceAdded'), 'success')
     );
-    
+
     header('Location: configuration.php');
     exit;
 }

+ 1 - 6
plugin/buycourses/src/services_edit.php

@@ -4,18 +4,13 @@
  * Create new Services for the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Init
- */
 
 $cidReset = true;
-
-require_once '../../../main/inc/global.inc.php';
-
 $serviceId = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null;
 
 if (!$serviceId) {
     header('Location: configuration.php');
+    exit;
 }
 
 $plugin = BuyCoursesPlugin::create();

+ 1 - 5
plugin/buycourses/src/session_catalog.php

@@ -3,12 +3,8 @@
  * List of courses
  * @package chamilo.plugin.buycourses
  */
-/**
- * Initialization
- */
-$cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
+$cidReset = true;
 
 $plugin = BuyCoursesPlugin::create();
 $includeSessions = $plugin->get('include_sessions') === 'true';

+ 0 - 2
plugin/buycourses/src/session_panel.php

@@ -6,8 +6,6 @@
 
 $cidReset = true;
 
-require_once __DIR__.'/../../../main/inc/global.inc.php';
-
 $plugin = BuyCoursesPlugin::create();
 $includeSessions = $plugin->get('include_sessions') === 'true';
 

+ 2 - 4
plugin/buycourses/src/success.php

@@ -4,10 +4,8 @@
  * Success page for the purchase of a course in the Buy Courses plugin
  * @package chamilo.plugin.buycourses
  */
-/**
- * Init
- */
-require_once '../config.php';
+
+require_once __DIR__.'/../config.php';
 
 $plugin = BuyCoursesPlugin::create();
 $paypalEnabled = $plugin->get('paypal_enable') === 'true';

+ 2 - 3
plugin/buycourses/uninstall.php

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

+ 5 - 3
plugin/buycourses/view/catalog.html.twig

@@ -55,7 +55,7 @@
                                                     <a class="ajax btn btn-primary" title="" href="{{ course_description_url }}" data-title="{{ course.title }}">
                                                         <em class="fa fa-file-text"></em> {{ 'SeeDescription'|get_plugin_lang('BuyCoursesPlugin') }}
                                                     </a>
-                                                    <a class="btn btn-success" title="" href="{{ _p.web_plugin ~ 'buycourses/src/process.php?' ~ {'i': course.id, 't': 1}|url_encode() }}">
+                                                    <a class="btn btn-success" title="" href="{{ url('legacy_plugin', {'name' :'buycourses/src/process.php', 'i': course.id, 't': 1 }) }}">
                                                         <em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
                                                     </a>
                                                 </div>
@@ -102,7 +102,7 @@
                                                 </div>
                                             {% elseif session.enrolled == "NO" %}
                                                 <div class="text-center">
-                                                    <a class="btn btn-success" href="{{ _p.web_plugin ~ 'buycourses/src/process.php?' ~ {'i': session.id, 't': 2}|url_encode() }}">
+                                                    <a class="btn btn-success" href="{{ url('legacy_plugin', {'name' :'buycourses/src/process.php', 'i': session.id, 't': 2 }) }}">
                                                         <em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
                                                     </a>
                                                 </div>
@@ -120,7 +120,9 @@
                                 <div class="col-md-4 col-sm-6">
                                     <div class="items-course">
                                         <div class="items-course-image">
-                                            <a href="{{ _p.web }}service/{{ service.id }}"><img alt="{{ service.name }}" class="img-responsive" src="{{ service.image }}"></a>
+                                            <a href="{{ _p.web }}service/{{ service.id }}">
+                                                <img alt="{{ service.name }}" class="img-responsive" src="{{ service.image }}">
+                                            </a>
                                         </div>
                                         <div class="items-course-info">
                                             <h4 class="title">

+ 1 - 1
plugin/buycourses/view/configuration.html.twig

@@ -135,7 +135,7 @@
     {% if services_are_included %}
         <div role="tabpanel" class="tab-pane" id="services">
             <div class="table-responsive">
-                <a href="{{ _p.web_plugin ~ 'buycourses/src/services_add.php' }}" class="btn btn-primary">
+                <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/services_add.php'}) }}" class="btn btn-primary">
                     <em class="fa fa-cart-plus fa-fw"></em> {{ 'NewService'| get_plugin_lang('BuyCoursesPlugin') }}
                 </a>
                 </br>

+ 2 - 2
plugin/buycourses/view/payout_report.html.twig

@@ -71,7 +71,7 @@
             var id = this.id;
             $.ajax({
                 data: 'id='+id,
-                url: '{{ _p.web_plugin ~ 'buycourses/src/buycourses.ajax.php?' ~  { 'a': 'saleInfo' } | url_encode() }}',
+                url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'saleInfo' }) }}',
                 type: 'POST',
                 success: function(response) {
                     $("#contentSale").html(response);
@@ -83,7 +83,7 @@
             var id = this.id;
             $.ajax({
                 data: 'id='+id,
-                url: '{{ _p.web_plugin ~ 'buycourses/src/buycourses.ajax.php?' ~  { 'a': 'stats' } | url_encode() }}',
+                url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'stats' }) }}',
                 type: 'POST',
                 success: function(response) {
                     $("#contentStats").html(response);

+ 3 - 3
plugin/buycourses/view/paypal_payout.html.twig

@@ -70,7 +70,7 @@
 
             $.ajax({
                 data: { payouts : val },
-                url: '{{ _p.web_plugin ~ 'buycourses/src/buycourses.ajax.php?' ~  { 'a': 'processPayout' } | url_encode() }}',
+                url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'processPayout' }) }}',
                 type: 'POST',
                 success: function(response) {
                     $("#content").html(response);
@@ -87,7 +87,7 @@
 
             $.ajax({
                 data: { payouts : val },
-                url: '{{ _p.web_plugin ~ 'buycourses/src/buycourses.ajax.php?' ~  { 'a': 'proceedPayout' } | url_encode() }}',
+                url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'processPayout' }) }}',
                 type: 'POST',
                 beforeSend: function() {
                     $("#proceedPayout").hide();
@@ -105,7 +105,7 @@
             var id = this.id;
             $.ajax({
                 data: 'id='+id,
-                url: '{{ _p.web_plugin ~ 'buycourses/src/buycourses.ajax.php?' ~  { 'a': 'cancelPayout' } | url_encode() }}',
+                url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php', 'a': 'cancelPayout' }) }}',
                 type: 'POST',
                 success: function() {
                     window.location.reload();

+ 1 - 1
plugin/buycourses/view/service_information.html.twig

@@ -32,7 +32,7 @@
                         <p><em class="fa fa-money"></em> <b>{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</b> : {{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }}</p>
                         <p><em class="fa fa-align-justify"></em> <b>{{ 'Details' | get_lang }}</b> : {{ service.description }}</p>
                         <div class="text-right" style="padding-bottom: 20px;">
-                            <a href="{{ _p.web_plugin ~ 'buycourses/src/service_process.php?t=4&i=' ~ service.id }}" class="btn btn-success btn-lg">
+                            <a href="{{ url('legacy_plugin', {'name' :'buycourses/src/service_process.ajax.php', 't' : 4, 'i': service.id }) }}" class="btn btn-success btn-lg">
                                 <em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }}
                             </a>
                         </div>

+ 36 - 36
plugin/buycourses/view/service_sales_report.html.twig

@@ -55,43 +55,43 @@
 </div>
 
 <script>
-    $(document).on('ready', function () {
-        $("td a").click(function() {
-            var id = $(this).attr('tag');
-            var action = $(this).attr('id');
-            $.ajax({
-                data: 'id='+id,
-                url: '{{ _p.web_plugin }}buycourses/src/buycourses.ajax.php?a='+action,
-                type: 'POST',
-                beforeSend: function() {
-                    if (action == 'renewable_info') {
-                        $('a[name=r_'+id+']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading' | get_lang }}');
-                    } else if (action == 'service_sale_info') {
-                        $('a[name=s_'+id+']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading' | get_lang }}');
-                    }
-                },
-                success: function(response) {
-                    $('a[name=r_'+id+']').html('{{ 'Info' | get_lang }}');
-                    $('a[name=s_'+id+']').html('{{ 'Info' | get_lang }}');
-                    var title = "";
-                    if (action == "renewable_info") {
-                        title = "{{ 'RecurringPaymentProfilePaypalInformation' | get_plugin_lang('BuyCoursesPlugin') }}";
-                    } else if (action == 'service_sale_info') {
-                        title = "{{ 'ServiceSaleInfo' | get_plugin_lang('BuyCoursesPlugin') }}";
-                    }
-                    bootbox.dialog({
-                        message: response,
-                        title: title,
-                        buttons: {
-                            main: {
-                                label: "{{ 'Close' | get_lang }}",
-                                className: "btn-default"
-                            }
-                        }
-                    });
+$(document).on('ready', function () {
+    $("td a").click(function() {
+        var id = $(this).attr('tag');
+        var action = $(this).attr('id');
+        $.ajax({
+            data: 'id='+id,
+            url: '{{ url('legacy_plugin', {'name' :'buycourses/src/buycourses.ajax.php' }) }}?'+a+'=action',
+            type: 'POST',
+            beforeSend: function() {
+                if (action == 'renewable_info') {
+                    $('a[name=r_'+id+']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading' | get_lang }}');
+                } else if (action == 'service_sale_info') {
+                    $('a[name=s_'+id+']').html('<em class="fa fa-spinner fa-pulse"></em> {{ 'Loading' | get_lang }}');
                 }
-            })
-        });
+            },
+            success: function(response) {
+                $('a[name=r_'+id+']').html('{{ 'Info' | get_lang }}');
+                $('a[name=s_'+id+']').html('{{ 'Info' | get_lang }}');
+                var title = "";
+                if (action == "renewable_info") {
+                    title = "{{ 'RecurringPaymentProfilePaypalInformation' | get_plugin_lang('BuyCoursesPlugin') }}";
+                } else if (action == 'service_sale_info') {
+                    title = "{{ 'ServiceSaleInfo' | get_plugin_lang('BuyCoursesPlugin') }}";
+                }
+                bootbox.dialog({
+                    message: response,
+                    title: title,
+                    buttons: {
+                        main: {
+                            label: "{{ 'Close' | get_lang }}",
+                            className: "btn-default"
+                        }
+                    }
+                });
+            }
+        })
     });
+});
 </script>
 {% endautoescape %}

+ 0 - 0
plugin/clockworksms/readme.txt → plugin/clockworksms/readme.md


+ 2 - 3
plugin/courseblock/CourseBlockPlugin.php

@@ -52,8 +52,6 @@ class CourseBlockPlugin extends Plugin
         );
     }
 
-    ///public function
-
     public function install()
     {
         // Installing course settings
@@ -66,7 +64,7 @@ class CourseBlockPlugin extends Plugin
         $this->uninstall_course_fields_in_all_courses();
     }
 
-        /**
+    /**
      * @param string $region
      * @return string
      */
@@ -91,6 +89,7 @@ class CourseBlockPlugin extends Plugin
                 $content = $content === -1 ? '' : $content;
                 break;
         }
+
         return $content;
     }
 }