Переглянути джерело

Minor - Format code and PHP Doc - refs #7768

Angel Fernando Quiroz Campos 9 роки тому
батько
коміт
1ebec60d96

+ 5 - 11
plugin/buycourses/src/buy_course_plugin.class.php

@@ -44,7 +44,7 @@ class BuyCoursesPlugin extends Plugin
                 Jose Angel Ruiz - NoSoloRed (original author),
                 Francis Gonzales and Yannick Warnier - BeezNest (integration),
                 Alex Aragón - BeezNest (Design icons and css styles),
-                Imanol Losada - BeezNest (introduction of sessions purchase)
+                Imanol Losada - BeezNest (introduction of sessions purchase),
                 Angel Fernando Quiroz Campos - BeezNest
             ",
             array(
@@ -540,10 +540,6 @@ class BuyCoursesPlugin extends Plugin
         return 'NO';
     }
 
-    /**
-     * Lists current user course details
-     * @return array
-     */
     /**
      * Lists current user course details
      * @param string $name Optional. The name filter
@@ -915,8 +911,8 @@ class BuyCoursesPlugin extends Plugin
 
     /**
      * Get a list of sales by the status
-     * @param type $status
-     * @return type
+     * @param int $status The status to filter
+     * @return array The sale list. Otherwise return false
      */
     public function getSaleListByStatus($status = self::SALE_STATUS_PENDING)
     {
@@ -925,10 +921,8 @@ class BuyCoursesPlugin extends Plugin
         $userTable = Database::get_main_table(TABLE_MAIN_USER);
 
         $innerJoins = "
-            INNER JOIN $currencyTable c
-                ON s.currency_id = c.id
-            INNER JOIN $userTable u
-                ON s.user_id = u.id
+            INNER JOIN $currencyTable c ON s.currency_id = c.id
+            INNER JOIN $userTable u ON s.user_id = u.id
         ";
 
         return Database::select(

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

@@ -1,4 +1,5 @@
 <?php
+
 /* For license terms, see /license.txt */
 /**
  * List of pending payments of the Buy Courses plugin
@@ -35,7 +36,7 @@ if (isset($_GET['order'])) {
 
             $urlToRedirect .= http_build_query([
                 'status' => BuyCoursesPlugin::SALE_STATUS_COMPLETED,
-                'sale' =>  $sale['id']
+                'sale' => $sale['id']
             ]);
             break;
         case 'cancel':
@@ -50,7 +51,7 @@ if (isset($_GET['order'])) {
 
             $urlToRedirect .= http_build_query([
                 'status' => BuyCoursesPlugin::SALE_STATUS_CANCELED,
-                'sale' =>  $sale['id']
+                'sale' => $sale['id']
             ]);
             break;
     }

+ 4 - 4
plugin/buycourses/view/catalog.tpl

@@ -23,7 +23,7 @@
                         {% if showing_courses %}
                             {% for course in courses %}
                                 <div class="col-md-4 col-sm-6">
-                                    <div class="thumbnail">
+                                    <article class="thumbnail">
                                         <img alt="{{ course.title }}" class="img-responsive" src="{{ course.course_img ? course.course_img : 'session_default.png'|icon() }}">
                                         <div class="caption">
                                             {% set course_description_url = _p.web_ajax ~ 'course_home.ajax.php?' ~ {'code': course.code, 'a': 'show_course_information'}|url_encode() %}
@@ -53,7 +53,7 @@
                                                 <div class="alert alert-info">{{ 'WaitingToReceiveThePayment'|get_plugin_lang('BuyCoursesPlugin') }}</div>
                                             {% endif %}
                                         </div>
-                                    </div>
+                                    </article>
                                 </div>
                             {% endfor %}
                         {% endif %}
@@ -61,7 +61,7 @@
                         {% if showing_sessions %}
                             {% for session in sessions %}
                                 <div class="col-md-4 col-sm-6">
-                                    <div class="thumbnail">
+                                    <article class="thumbnail">
                                         <img alt="{{ session.name }}" class="img-responsive" src="{{ session.image ? session.image : 'session_default.png'|icon() }}">
                                         <div class="caption">
                                             <h3>
@@ -100,7 +100,7 @@
                                                 <div class="alert alert-info">{{ 'WaitingToReceiveThePayment'|get_plugin_lang('BuyCoursesPlugin') }}</div>
                                             {% endif %}
                                         </div>
-                                    </div>
+                                    </article>
                                 </div>
                             {% endfor %}
                         {% endif %}

+ 11 - 11
plugin/buycourses/view/sales_report.tpl

@@ -11,7 +11,7 @@
                 <th class="text-center">{{ 'ProductType'|get_plugin_lang('BuyCoursesPlugin') }}</th>
                 <th>{{ 'Name'|get_lang }}</th>
                 <th>{{ 'UserName'|get_lang }}</th>
-                    <th class="text-center">{{ 'Options'|get_lang }}</th>
+                <th class="text-center">{{ 'Options'|get_lang }}</th>
             </tr>
         </thead>
         <tbody>
@@ -32,16 +32,16 @@
                     <td class="text-center">{{ sale.product_type }}</td>
                     <td>{{ sale.product_name }}</td>
                     <td>{{ sale.complete_user_name }}</td>
-                        <td class="text-center">
-                            {% if sale.status == sale_status_pending %}
-                                <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'confirm'}|url_encode() }}" class="btn btn-success btn-sm">
-                                    <i class="fa fa-user-plus fa-fw"></i> {{ 'SubscribeUser'|get_plugin_lang('BuyCoursesPlugin') }}
-                                </a>
-                                <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'cancel'}|url_encode() }}" class="btn btn-danger btn-sm">
-                                    <i class="fa fa-times fa-fw"></i> {{ 'DeleteOrder'|get_plugin_lang('BuyCoursesPlugin') }}
-                                </a>
-                            {% endif %}
-                        </td>
+                    <td class="text-center">
+                        {% if sale.status == sale_status_pending %}
+                            <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'confirm'}|url_encode() }}" class="btn btn-success btn-sm">
+                                <i class="fa fa-user-plus fa-fw"></i> {{ 'SubscribeUser'|get_plugin_lang('BuyCoursesPlugin') }}
+                            </a>
+                            <a href="{{ _p.web_self ~ '?' ~ {'order': sale.id, 'action': 'cancel'}|url_encode() }}" class="btn btn-danger btn-sm">
+                                <i class="fa fa-times fa-fw"></i> {{ 'DeleteOrder'|get_plugin_lang('BuyCoursesPlugin') }}
+                            </a>
+                        {% endif %}
+                    </td>
                 </tr>
             {% endfor %}
         </tbody>