Completed
Push — 1.10.x ( fe0e5a...3a6f9c )
by Yannick
134:15 queued 86:39
created
plugin/tour/src/tour_plugin.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,9 +129,9 @@
 block discarded – undo
129 129
      */
130 130
     public function getTourConfig()
131 131
     {
132
-        $pluginPath = api_get_path(PLUGIN_PATH) . 'tour/';
132
+        $pluginPath = api_get_path(PLUGIN_PATH).'tour/';
133 133
 
134
-        $jsonContent = file_get_contents($pluginPath . 'config/tour.json');
134
+        $jsonContent = file_get_contents($pluginPath.'config/tour.json');
135 135
 
136 136
         $jsonData = json_decode($jsonContent, true);
137 137
 
Please login to merge, or discard this patch.
plugin/tour/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@
 block discarded – undo
5 5
  * @author Angel Fernando Quiroz Campos <[email protected]>
6 6
  * @package chamilo.plugin.tour
7 7
  */
8
-require_once __DIR__ . '/config.php';
8
+require_once __DIR__.'/config.php';
9 9
 
10
-$pluginPath = api_get_path(PLUGIN_PATH) . 'tour/';
11
-$pluginWebPath = api_get_path(WEB_PLUGIN_PATH) . 'tour/';
10
+$pluginPath = api_get_path(PLUGIN_PATH).'tour/';
11
+$pluginWebPath = api_get_path(WEB_PLUGIN_PATH).'tour/';
12 12
 
13 13
 $userId = api_get_user_id();
14 14
 
Please login to merge, or discard this patch.
plugin/tour/ajax/save.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 /**
9 9
  * Init
10 10
  */
11
-require_once __DIR__ . '/../../../main/inc/global.inc.php';
12
-require_once __DIR__ . '/../config.php';
11
+require_once __DIR__.'/../../../main/inc/global.inc.php';
12
+require_once __DIR__.'/../config.php';
13 13
 
14 14
 if (!api_is_anonymous()) {
15 15
     $currentPageClass = isset($_POST['page_class']) ? $_POST['page_class'] : '';
Please login to merge, or discard this patch.
plugin/tour/ajax/steps.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
  * @package chamilo.plugin.tour
7 7
  */
8 8
 require_once __DIR__.'/../../../main/inc/global.inc.php';
9
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
10
-require_once api_get_path(PLUGIN_PATH) . 'tour/src/tour_plugin.class.php';
9
+require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
10
+require_once api_get_path(PLUGIN_PATH).'tour/src/tour_plugin.class.php';
11 11
 
12 12
 if (!api_is_anonymous()) {
13 13
     $currentPageClass = isset($_GET['page_class']) ? $_GET['page_class'] : '';
Please login to merge, or discard this patch.
plugin/tour/config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 define('TABLE_TOUR_LOG', 'plugin_tour_log');
11 11
 
12
-require_once api_get_path(SYS_PATH) . 'main/inc/global.inc.php';
13
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
14
-require_once api_get_path(PLUGIN_PATH) . 'tour/src/tour_plugin.class.php';
12
+require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
13
+require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
14
+require_once api_get_path(PLUGIN_PATH).'tour/src/tour_plugin.class.php';
15 15
 // Edit the config/tour.json file to add more pages or more elements to the guide
Please login to merge, or discard this patch.
plugin/advanced_subscription/src/AdvancedSubscriptionPlugin.php 1 patch
Spacing   +41 added lines, -42 removed lines patch added patch discarded remove patch
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
     {
107 107
         $advancedSubscriptionQueueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
108 108
 
109
-        $sql = "CREATE TABLE IF NOT EXISTS $advancedSubscriptionQueueTable (" .
110
-            "id int UNSIGNED NOT NULL AUTO_INCREMENT, " .
111
-            "session_id int UNSIGNED NOT NULL, " .
112
-            "user_id int UNSIGNED NOT NULL, " .
113
-            "status int UNSIGNED NOT NULL, " .
114
-            "last_message_id int UNSIGNED NOT NULL, " .
115
-            "created_at datetime NOT NULL, " .
116
-            "updated_at datetime NULL, " .
117
-            "PRIMARY KEY PK_advanced_subscription_queue (id), " .
109
+        $sql = "CREATE TABLE IF NOT EXISTS $advancedSubscriptionQueueTable (".
110
+            "id int UNSIGNED NOT NULL AUTO_INCREMENT, ".
111
+            "session_id int UNSIGNED NOT NULL, ".
112
+            "user_id int UNSIGNED NOT NULL, ".
113
+            "status int UNSIGNED NOT NULL, ".
114
+            "last_message_id int UNSIGNED NOT NULL, ".
115
+            "created_at datetime NOT NULL, ".
116
+            "updated_at datetime NULL, ".
117
+            "PRIMARY KEY PK_advanced_subscription_queue (id), ".
118 118
             "UNIQUE KEY UK_advanced_subscription_queue (user_id, session_id)); ";
119 119
         Database::query($sql);
120 120
     }
@@ -265,11 +265,10 @@  discard block
 block discarded – undo
265 265
         $now = new DateTime(api_get_utc_datetime());
266 266
         $newYearDate = $plugin->get('course_session_credit_year_start_date');
267 267
         $newYearDate = !empty($newYearDate) ?
268
-            new \DateTime($newYearDate . $now->format('/Y')) :
269
-            $now;
268
+            new \DateTime($newYearDate.$now->format('/Y')) : $now;
270 269
         $extra = new ExtraFieldValue('session');
271
-        $joinSessionTable = Database::get_main_table(TABLE_MAIN_SESSION_USER) . ' su INNER JOIN ' .
272
-            Database::get_main_table(TABLE_MAIN_SESSION) . ' s ON s.id = su.session_id';
270
+        $joinSessionTable = Database::get_main_table(TABLE_MAIN_SESSION_USER).' su INNER JOIN '.
271
+            Database::get_main_table(TABLE_MAIN_SESSION).' s ON s.id = su.session_id';
273 272
         $whereSessionParams = 'su.relation_type = ? AND s.access_start_date >= ? AND su.user_id = ?';
274 273
         $whereSessionParamsValues = array(
275 274
             0,
@@ -734,14 +733,14 @@  discard block
 block discarded – undo
734 733
                     $tpl->assign('termsContent', $termsAndConditions);
735 734
                     $termsAndConditions = $tpl->fetch('/advanced_subscription/views/terms_and_conditions_to_pdf.tpl');
736 735
                     $pdf = new PDF();
737
-                    $filename = 'terms' . sha1(rand(0,99999));
736
+                    $filename = 'terms'.sha1(rand(0, 99999));
738 737
                     $pdf->content_to_pdf($termsAndConditions, null, $filename, null, 'F');
739 738
                     $fileAttachments['file'][] = array(
740
-                        'name' => $filename . '.pdf',
741
-                        'application/pdf' => $filename . '.pdf',
742
-                        'tmp_name' => api_get_path(SYS_ARCHIVE_PATH) . $filename . '.pdf',
739
+                        'name' => $filename.'.pdf',
740
+                        'application/pdf' => $filename.'.pdf',
741
+                        'tmp_name' => api_get_path(SYS_ARCHIVE_PATH).$filename.'.pdf',
743 742
                         'error' => UPLOAD_ERR_OK,
744
-                        'size' => filesize(api_get_path(SYS_ARCHIVE_PATH) . $filename . '.pdf'),
743
+                        'size' => filesize(api_get_path(SYS_ARCHIVE_PATH).$filename.'.pdf'),
745 744
                     );
746 745
                     $fileAttachments['comments'][] = get_lang('TermsAndConditions');
747 746
                 }
@@ -1032,7 +1031,7 @@  discard block
 block discarded – undo
1032 1031
 
1033 1032
             $mergedArray = array_merge(array($sessionId), array_keys($fields));
1034 1033
 
1035
-            $sql = "SELECT * FROM " . Database::get_main_table(TABLE_EXTRA_FIELD_VALUES) ."
1034
+            $sql = "SELECT * FROM ".Database::get_main_table(TABLE_EXTRA_FIELD_VALUES)."
1036 1035
                     WHERE item_id = %d AND field_id IN (%d, %d, %d, %d, %d, %d, %d)";
1037 1036
             $sql = vsprintf($sql, $mergedArray);
1038 1037
             $sessionFieldValueList = Database::query($sql);
@@ -1048,10 +1047,10 @@  discard block
 block discarded – undo
1048 1047
             $sessionArray['description'] = SessionManager::getDescriptionFromSessionId($sessionId);
1049 1048
 
1050 1049
             if (isset($sessionArray['brochure'])) {
1051
-                $sessionArray['brochure'] = api_get_path(WEB_UPLOAD_PATH) . $sessionArray['brochure'];
1050
+                $sessionArray['brochure'] = api_get_path(WEB_UPLOAD_PATH).$sessionArray['brochure'];
1052 1051
             }
1053 1052
             if (isset($sessionArray['banner'])) {
1054
-                $sessionArray['banner'] = api_get_path(WEB_UPLOAD_PATH) . $sessionArray['banner'];
1053
+                $sessionArray['banner'] = api_get_path(WEB_UPLOAD_PATH).$sessionArray['banner'];
1055 1054
             }
1056 1055
 
1057 1056
             return $sessionArray;
@@ -1108,7 +1107,7 @@  discard block
 block discarded – undo
1108 1107
      */
1109 1108
     public function getSessionUrl($sessionId)
1110 1109
     {
1111
-        $url = api_get_path(WEB_CODE_PATH) . 'session/?session_id=' . intval($sessionId);
1110
+        $url = api_get_path(WEB_CODE_PATH).'session/?session_id='.intval($sessionId);
1112 1111
 
1113 1112
         return $url;
1114 1113
     }
@@ -1157,16 +1156,16 @@  discard block
 block discarded – undo
1157 1156
      */
1158 1157
     public function getQueueUrl($params)
1159 1158
     {
1160
-        $url = api_get_path(WEB_PLUGIN_PATH) . 'advanced_subscription/ajax/advanced_subscription.ajax.php?' .
1161
-            'a=' . Security::remove_XSS($params['action']) . '&' .
1162
-            's=' . intval($params['sessionId']) . '&' .
1163
-            'current_user_id=' . intval($params['currentUserId']) . '&' .
1164
-            'e=' . intval($params['newStatus']) . '&' .
1165
-            'u=' . intval($params['studentUserId']) . '&' .
1166
-            'q=' . intval($params['queueId']) . '&' .
1167
-            'is_connected=' . 1 . '&' .
1168
-            'profile_completed=' . intval($params['profile_completed']) . '&' .
1169
-            'v=' . $this->generateHash($params);
1159
+        $url = api_get_path(WEB_PLUGIN_PATH).'advanced_subscription/ajax/advanced_subscription.ajax.php?'.
1160
+            'a='.Security::remove_XSS($params['action']).'&'.
1161
+            's='.intval($params['sessionId']).'&'.
1162
+            'current_user_id='.intval($params['currentUserId']).'&'.
1163
+            'e='.intval($params['newStatus']).'&'.
1164
+            'u='.intval($params['studentUserId']).'&'.
1165
+            'q='.intval($params['queueId']).'&'.
1166
+            'is_connected='.1.'&'.
1167
+            'profile_completed='.intval($params['profile_completed']).'&'.
1168
+            'v='.$this->generateHash($params);
1170 1169
 
1171 1170
         return $url;
1172 1171
     }
@@ -1219,7 +1218,7 @@  discard block
 block discarded – undo
1219 1218
         }
1220 1219
         $queueTable = Database::get_main_table(TABLE_ADVANCED_SUBSCRIPTION_QUEUE);
1221 1220
         $userTable = Database::get_main_table(TABLE_MAIN_USER);
1222
-        $userJoinTable = $queueTable . ' q INNER JOIN ' . $userTable . ' u ON q.user_id = u.user_id';
1221
+        $userJoinTable = $queueTable.' q INNER JOIN '.$userTable.' u ON q.user_id = u.user_id';
1223 1222
         $where = array(
1224 1223
             'where' => array(
1225 1224
                 'q.session_id = ?' => array(
@@ -1232,7 +1231,7 @@  discard block
 block discarded – undo
1232 1231
         $students = Database::select($select, $userJoinTable, $where);
1233 1232
         foreach ($students as &$student) {
1234 1233
             $status = intval($student['status']);
1235
-            switch($status) {
1234
+            switch ($status) {
1236 1235
                 case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_NO_QUEUE:
1237 1236
                 case ADVANCED_SUBSCRIPTION_QUEUE_STATUS_START:
1238 1237
                     $student['validation'] = '';
@@ -1246,7 +1245,7 @@  discard block
 block discarded – undo
1246 1245
                     $student['validation'] = 'Yes';
1247 1246
                     break;
1248 1247
                 default:
1249
-                    error_log(__FILE__ . ' ' . __FUNCTION__ . ' Student status no detected');
1248
+                    error_log(__FILE__.' '.__FUNCTION__.' Student status no detected');
1250 1249
             }
1251 1250
         }
1252 1251
         $return = array(
@@ -1295,7 +1294,7 @@  discard block
 block discarded – undo
1295 1294
         $dataPrepared['queueId'] = intval($data['queueId']);
1296 1295
         $dataPrepared['newStatus'] = intval($data['newStatus']);
1297 1296
         $dataPrepared = serialize($dataPrepared);
1298
-        return sha1($dataPrepared . $key);
1297
+        return sha1($dataPrepared.$key);
1299 1298
     }
1300 1299
 
1301 1300
     /**
@@ -1350,12 +1349,12 @@  discard block
 block discarded – undo
1350 1349
                 break;
1351 1350
         }
1352 1351
 
1353
-        $url = api_get_path(WEB_PLUGIN_PATH) . "advanced_subscription/src/terms_and_conditions.php?";
1352
+        $url = api_get_path(WEB_PLUGIN_PATH)."advanced_subscription/src/terms_and_conditions.php?";
1354 1353
         $url .= http_build_query($urlParams);
1355 1354
 
1356 1355
         // Launch popup
1357 1356
         if ($mode == ADVANCED_SUBSCRIPTION_TERMS_MODE_POPUP) {
1358
-            $url = 'javascript:void(window.open(\'' . $url .'\',\'AdvancedSubscriptionTerms\', \'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700px,height=600px\', \'100\' ))';
1357
+            $url = 'javascript:void(window.open(\''.$url.'\',\'AdvancedSubscriptionTerms\', \'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700px,height=600px\', \'100\' ))';
1359 1358
         }
1360 1359
         return $url;
1361 1360
     }
@@ -1367,9 +1366,9 @@  discard block
 block discarded – undo
1367 1366
      */
1368 1367
     public function getRenderMailUrl($params)
1369 1368
     {
1370
-        $url = api_get_path(WEB_PLUGIN_PATH) . 'advanced_subscription/src/render_mail.php?' .
1371
-            'q=' . $params['queueId'] . '&' .
1372
-            'v=' . $this->generateHash($params);
1369
+        $url = api_get_path(WEB_PLUGIN_PATH).'advanced_subscription/src/render_mail.php?'.
1370
+            'q='.$params['queueId'].'&'.
1371
+            'v='.$this->generateHash($params);
1373 1372
         return $url;
1374 1373
     }
1375 1374
 
@@ -1440,7 +1439,7 @@  discard block
 block discarded – undo
1440 1439
                 sf.extra_field_type = $extraFieldType AND
1441 1440
                 sf.variable = 'is_induction_session' AND
1442 1441
                 su.relation_type = 0 AND
1443
-                su.user_id = " . intval($userId);
1442
+                su.user_id = ".intval($userId);
1444 1443
 
1445 1444
         $result = Database::query($sql);
1446 1445
 
Please login to merge, or discard this patch.
plugin/advanced_subscription/src/HookAdvancedSubscription.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.plugin.advanced_subscription
7 7
  */
8 8
 
9
-require_once __DIR__ . '/../config.php';
9
+require_once __DIR__.'/../config.php';
10 10
 
11 11
 /**
12 12
  * Class HookAdvancedSubscription extends the HookObserver to implements
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
         if ($debug) {
422 422
             error_log(__FUNCTION__);
423
-            error_log('Params ' . print_r($params, 1));
423
+            error_log('Params '.print_r($params, 1));
424 424
         }
425 425
         if (!WSHelperVerifyKey($params)) {
426 426
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 
472 472
         if ($debug) {
473 473
             error_log('WSUserSubscribedInCourse');
474
-            error_log('Params ' . print_r($params, 1));
474
+            error_log('Params '.print_r($params, 1));
475 475
         }
476 476
         if (!WSHelperVerifyKey($params)) {
477 477
             return return_error(WS_ERROR_SECRET_KEY);
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 
577 577
         if ($debug) {
578 578
             error_log('WSListSessionsDetailsByCategory');
579
-            error_log('Params ' . print_r($params, 1));
579
+            error_log('Params '.print_r($params, 1));
580 580
         }
581 581
         $secretKey = $params['secret_key'];
582 582
 
Please login to merge, or discard this patch.
plugin/advanced_subscription/src/admin_view.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 /**
8 8
  * Init
9 9
  */
10
-require_once __DIR__ . '/../config.php';
10
+require_once __DIR__.'/../config.php';
11 11
 // protect
12 12
 api_protect_admin_script();
13 13
 // start plugin
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
         $data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_DISAPPROVED;
86 86
         $student['rejectUrl'] = $plugin->getQueueUrl($data);
87 87
         $student['complete_name'] = $isWesternNameOrder ?
88
-            $student['firstname'] . ', ' . $student['lastname'] :
89
-            $student['lastname'] . ', ' . $student['firstname'];
88
+            $student['firstname'].', '.$student['lastname'] : $student['lastname'].', '.$student['firstname'];
90 89
     }
91 90
     $tpl->assign('session', $sessionArray);
92 91
     $tpl->assign('students', $studentList['students']);
Please login to merge, or discard this patch.
plugin/advanced_subscription/src/scripts/insert_session_fields.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
 //exit;
9 9
 
10
-require_once __DIR__ . '/../../config.php';
10
+require_once __DIR__.'/../../config.php';
11 11
 
12 12
 api_protect_admin_script();
13 13
 
Please login to merge, or discard this patch.