Completed
Push — 1.11.x ( d3f3e5...5e1f1f )
by José
232:20 queued 193:34
created
src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -532,7 +532,9 @@  discard block
 block discarded – undo
532 532
 
533 533
                                 if (in_array($file_info['extension'], array('html', 'htm'))) {
534 534
                                     $content = file_get_contents($path.$document->path);
535
-                                    if (UTF8_CONVERT) $content = utf8_encode($content);
535
+                                    if (UTF8_CONVERT) {
536
+                                        $content = utf8_encode($content);
537
+                                    }
536 538
                                     $content = DocumentManager::replace_urls_inside_content_html_from_copy_course(
537 539
                                         $content,
538 540
                                         $this->course->code,
@@ -2788,8 +2790,9 @@  discard block
 block discarded – undo
2788 2790
                             echo '<font color="red">File ('.$path.') '.get_lang('NotHavePermission').'</font>';
2789 2791
                         }*/
2790 2792
                     } elseif(is_dir($path)) {
2791
-                        if (!is_dir($dest . '/' . $file))
2792
-                        mkdir($dest . '/' . $file);
2793
+                        if (!is_dir($dest . '/' . $file)) {
2794
+                                                mkdir($dest . '/' . $file);
2795
+                        }
2793 2796
                         self:: allow_create_all_directory($path, $dest . '/' . $file, $overwrite);
2794 2797
                     }
2795 2798
                 }
Please login to merge, or discard this patch.
main/upload/upload.document.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,9 +64,10 @@
 block discarded – undo
64 64
     	$new_comment = isset($_POST['comment']) ? Database::escape_string(trim($_POST['comment'])) : '';
65 65
     	$new_title = isset($_POST['title']) ? Database::escape_string(trim($_POST['title'])) : '';
66 66
 
67
-    	if ($new_path && ($new_comment || $new_title))
68
-    	if (($docid = DocumentManager::get_document_id($_course, $new_path))) {
67
+    	if ($new_path && ($new_comment || $new_title)) {
68
+    	    	if (($docid = DocumentManager::get_document_id($_course, $new_path))) {
69 69
         	$table_document = Database::get_course_table(TABLE_DOCUMENT);
70
+    	}
70 71
         	$ct = '';
71 72
             if ($new_comment) {
72 73
                 $ct .= ", comment='$new_comment'";
Please login to merge, or discard this patch.
main/exercise/hotspot_admin.inc.php 1 patch
Braces   +29 added lines, -11 removed lines patch added patch discarded remove patch
@@ -679,12 +679,15 @@  discard block
 block discarded – undo
679 679
                                     $option1 = $option2 = $option3 = '';
680 680
                                     for ($k = 1; $k <= 100; $k++) {
681 681
                                         $selected1 = $selected2 = $selected3 = '';
682
-                                        if ($k == $threadhold1[$i])
683
-                                            $selected1 = 'selected="selected"';
684
-                                        if ($k == $threadhold2[$i])
685
-                                            $selected2 = 'selected="selected"';
686
-                                        if ($k == $threadhold3[$i])
687
-                                            $selected3 = 'selected="selected"';
682
+                                        if ($k == $threadhold1[$i]) {
683
+                                                                                    $selected1 = 'selected="selected"';
684
+                                        }
685
+                                        if ($k == $threadhold2[$i]) {
686
+                                                                                    $selected2 = 'selected="selected"';
687
+                                        }
688
+                                        if ($k == $threadhold3[$i]) {
689
+                                                                                    $selected3 = 'selected="selected"';
690
+                                        }
688 691
                                         $option1.='<option ' . $selected1 . ' >' . $k . ' % </option>';
689 692
                                         $option2.='<option ' . $selected2 . ' >' . $k . ' % </option>';
690 693
                                         $option3.='<option ' . $selected3 . '>' . $k . ' %</option>';
@@ -731,7 +734,10 @@  discard block
 block discarded – undo
731 734
                                                 <div class="checkbox">
732 735
                                                     <p>
733 736
                                                         <label>
734
-                                                            <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]"  <?php if ($try[$i] == 1) echo'checked'; ?> />
737
+                                                            <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]"  <?php if ($try[$i] == 1) {
738
+    echo'checked';
739
+}
740
+?> />
735 741
                                                             <?php echo get_lang('TryAgain'); ?>
736 742
                                                         </label>
737 743
                                                     </p>
@@ -784,7 +790,10 @@  discard block
 block discarded – undo
784 790
                                                             <div class="checkbox">
785 791
                                                                 <p>
786 792
                                                                     <label>
787
-                                                                        <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if ($try[$i] == 1) echo'checked'; ?> />
793
+                                                                        <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if ($try[$i] == 1) {
794
+    echo'checked';
795
+}
796
+?> />
788 797
                                                                         <?php echo get_lang('TryAgain'); ?>
789 798
                                                                     </label>
790 799
                                                                 </p>
@@ -823,7 +832,10 @@  discard block
 block discarded – undo
823 832
                                             <th ><?php echo get_lang('OAR'); ?>*</th>
824 833
                                             <?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?>
825 834
                                                 <th colspan="2" ><?php echo get_lang('Comment'); ?></th>
826
-                                                <th ><?php if ($answerType == HOT_SPOT_DELINEATION) echo get_lang('Scenario'); ?></th>
835
+                                                <th ><?php if ($answerType == HOT_SPOT_DELINEATION) {
836
+    echo get_lang('Scenario');
837
+}
838
+?></th>
827 839
                                             <?php } else { ?>
828 840
                                                 <th colspan="3" ><?php echo get_lang('Comment'); ?></th>
829 841
                                             <?php } ?>
@@ -849,7 +861,10 @@  discard block
 block discarded – undo
849 861
                                                 <div class="checkbox">
850 862
                                                     <p>
851 863
                                                         <label>
852
-                                                            <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if (isset($try[$i]) && $try[$i] == 1) echo'checked'; ?> />
864
+                                                            <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if (isset($try[$i]) && $try[$i] == 1) {
865
+    echo'checked';
866
+}
867
+?> />
853 868
                                                             <?php echo get_lang('TryAgain'); ?>
854 869
                                                         </label>
855 870
                                                     </p>
@@ -998,7 +1013,10 @@  discard block
 block discarded – undo
998 1013
                                         <div class="checkbox">
999 1014
                                             <p>
1000 1015
                                                 <label>
1001
-                                                    <input type="checkbox" class="checkbox" name="try_noerror" <?php if ($try_noerror == 1) echo'checked'; ?> />
1016
+                                                    <input type="checkbox" class="checkbox" name="try_noerror" <?php if ($try_noerror == 1) {
1017
+    echo'checked';
1018
+}
1019
+?> />
1002 1020
                                                     <?php echo get_lang('TryAgain'); ?>
1003 1021
                                                 </label>
1004 1022
                                             </p>
Please login to merge, or discard this patch.
main/inc/lib/blog.lib.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1007,8 +1007,9 @@  discard block
 block discarded – undo
1007 1007
             $blog_post_actions .= '</a>';
1008 1008
         }
1009 1009
 
1010
-        if (api_is_allowed('BLOG_' . $blog_id, 'article_rate'))
1011
-            $rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1010
+        if (api_is_allowed('BLOG_' . $blog_id, 'article_rate')) {
1011
+                    $rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1012
+        }
1012 1013
 
1013 1014
         $blog_post_text=stripslashes($blog_post_text);
1014 1015
 
@@ -1652,8 +1653,9 @@  discard block
 block discarded – undo
1652 1653
 
1653 1654
                         $arrPermissions = array();
1654 1655
 
1655
-                        while ($row = Database::fetch_array($result))
1656
-                            $arrPermissions[] = $row['action'];
1656
+                        while ($row = Database::fetch_array($result)) {
1657
+                                                    $arrPermissions[] = $row['action'];
1658
+                        }
1657 1659
 
1658 1660
                             echo '<tr>';
1659 1661
                             echo '<td style="text-align:right; vertical-align:top;">' . get_lang('TaskManager') . ':&nbsp;&nbsp;</td>';
@@ -2329,8 +2331,9 @@  discard block
 block discarded – undo
2329 2331
         //Handle leap year
2330 2332
         $numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
2331 2333
 
2332
-        if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0))
2333
-            $numberofdays[2] = 29;
2334
+        if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {
2335
+                    $numberofdays[2] = 29;
2336
+        }
2334 2337
 
2335 2338
         //Get the first day of the month
2336 2339
         $dayone = getdate(mktime(0, 0, 0, $month, 1, $year));
@@ -2360,8 +2363,9 @@  discard block
 block discarded – undo
2360 2363
         if( Database::num_rows($result) > 0) {
2361 2364
             while($blog_post = Database::fetch_array($result)) {
2362 2365
                 // If the day of this post is not yet in the array, add it.
2363
-                if (!in_array($blog_post['post_day'], $posts))
2364
-                    $posts[] = $blog_post['post_day'];
2366
+                if (!in_array($blog_post['post_day'], $posts)) {
2367
+                                    $posts[] = $blog_post['post_day'];
2368
+                }
2365 2369
             }
2366 2370
         }
2367 2371
 
@@ -2400,8 +2404,9 @@  discard block
 block discarded – undo
2400 2404
 
2401 2405
         echo "<tr>";
2402 2406
 
2403
-        for($ii = 1; $ii < 8; $ii ++)
2404
-            echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2407
+        for($ii = 1; $ii < 8; $ii ++) {
2408
+                    echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2409
+        }
2405 2410
 
2406 2411
         echo "</tr>";
2407 2412
 
@@ -2411,8 +2416,9 @@  discard block
 block discarded – undo
2411 2416
         while ($curday <= $numberofdays[$month]) {
2412 2417
             echo "<tr>";
2413 2418
             for ($ii = 0; $ii < 7; $ii ++) {
2414
-                if (($curday == -1) && ($ii == $startdayofweek))
2415
-                    $curday = 1;
2419
+                if (($curday == -1) && ($ii == $startdayofweek)) {
2420
+                                    $curday = 1;
2421
+                }
2416 2422
 
2417 2423
                 if (($curday > 0) && ($curday <= $numberofdays[$month])) {
2418 2424
                     $bgcolor = $ii < 5 ? $class="class=\"days_week\"" : $class="class=\"days_weekend\"";
@@ -2426,10 +2432,11 @@  discard block
 block discarded – undo
2426 2432
                     echo "<td " . $class.">";
2427 2433
 
2428 2434
                     // If there are posts on this day, create a filter link.
2429
-                    if(in_array($curday, $posts))
2430
-                        echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2431
-                    else
2432
-                        echo $dayheader;
2435
+                    if(in_array($curday, $posts)) {
2436
+                                            echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2437
+                    } else {
2438
+                                            echo $dayheader;
2439
+                    }
2433 2440
 
2434 2441
                     if (count($tasks) > 0) {
2435 2442
                         if (isset($tasks[$curday]) && is_array($tasks[$curday])) {
@@ -2444,8 +2451,9 @@  discard block
 block discarded – undo
2444 2451
 
2445 2452
                     echo "</td>";
2446 2453
                     $curday ++;
2447
-                } else
2448
-                    echo "<td>&nbsp;</td>";
2454
+                } else {
2455
+                                    echo "<td>&nbsp;</td>";
2456
+                }
2449 2457
             }
2450 2458
             echo "</tr>";
2451 2459
         }
Please login to merge, or discard this patch.
main/inc/lib/message.lib.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -143,8 +143,9 @@  discard block
 block discarded – undo
143 143
             $direction = 'DESC';
144 144
         } else {
145 145
             $column = intval($column);
146
-            if (!in_array($direction, array('ASC', 'DESC')))
147
-                $direction = 'ASC';
146
+            if (!in_array($direction, array('ASC', 'DESC'))) {
147
+                            $direction = 'ASC';
148
+            }
148 149
         }
149 150
 
150 151
         $keyword = Session::read('message_search_keyword');
@@ -697,8 +698,9 @@  discard block
 block discarded – undo
697 698
      */
698 699
     public static function update_message($user_id, $message_id)
699 700
     {
700
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
701
-            return false;
701
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
702
+                    return false;
703
+        }
702 704
 
703 705
         $table_message = Database::get_main_table(TABLE_MESSAGE);
704 706
         $sql = "UPDATE $table_message SET msg_status = '0'
@@ -738,8 +740,9 @@  discard block
 block discarded – undo
738 740
      */
739 741
     public static function get_message_by_user($user_id, $message_id)
740 742
     {
741
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
742
-            return false;
743
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
744
+                    return false;
745
+        }
743 746
         $table_message = Database::get_main_table(TABLE_MESSAGE);
744 747
         $query = "SELECT * FROM $table_message
745 748
                   WHERE user_receiver_id=" . intval($user_id) . " AND id='" . intval($message_id) . "'";
@@ -864,8 +867,9 @@  discard block
 block discarded – undo
864 867
      */
865 868
     public static function exist_message($user_id, $id)
866 869
     {
867
-        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id)))
868
-            return false;
870
+        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) {
871
+                    return false;
872
+        }
869 873
         $table_message = Database::get_main_table(TABLE_MESSAGE);
870 874
         $query = "SELECT id FROM $table_message
871 875
                   WHERE
@@ -896,8 +900,9 @@  discard block
 block discarded – undo
896 900
             $direction = 'DESC';
897 901
         } else {
898 902
             $column = intval($column);
899
-            if (!in_array($direction, array('ASC', 'DESC')))
900
-                $direction = 'ASC';
903
+            if (!in_array($direction, array('ASC', 'DESC'))) {
904
+                            $direction = 'ASC';
905
+            }
901 906
         }
902 907
         $table_message = Database::get_main_table(TABLE_MESSAGE);
903 908
         $request = api_is_xml_http_request();
Please login to merge, or discard this patch.
main/admin/user_move_stats.php 1 patch
Braces   +99 added lines, -43 removed lines patch added patch discarded remove patch
@@ -107,7 +107,9 @@  discard block
 block discarded – undo
107 107
                 //Check if the user is registered in the session otherwise we will add it
108 108
                 $result = SessionManager::get_users_by_session($new_session_id);
109 109
                 if (empty($result) || !in_array($user_id, array_keys($result))) {
110
-                    if ($debug) echo 'User added to the session';
110
+                    if ($debug) {
111
+                        echo 'User added to the session';
112
+                    }
111 113
                     //Registering user to the new session
112 114
                     SessionManager::suscribe_users_to_session($new_session_id,array($user_id),false);
113 115
                 }
@@ -142,10 +144,11 @@  discard block
 block discarded – undo
142 144
                     $list[$row['exe_id']]= $row;
143 145
                 }
144 146
 
145
-                if (!empty($list))
146
-                    foreach ($list as $exe_id =>$data) {
147
+                if (!empty($list)) {
148
+                                    foreach ($list as $exe_id =>$data) {
147 149
                         if ($update_database) {
148 150
                             $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
151
+                }
149 152
                             $res = Database::query($sql);
150 153
                             $result_message[$TABLETRACK_EXERCICES]++;
151 154
                         } else {
@@ -169,10 +172,11 @@  discard block
 block discarded – undo
169 172
                         $list[$row['exe_id']]= $row;
170 173
                     }
171 174
 
172
-                    if (!empty($list))
173
-                        foreach ($list as $exe_id =>$data) {
175
+                    if (!empty($list)) {
176
+                                            foreach ($list as $exe_id =>$data) {
174 177
                             if ($update_database) {
175 178
                                 $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
179
+                    }
176 180
                                 $res = Database::query($sql);
177 181
                                 $result_message[$TABLETRACK_EXERCICES]++;
178 182
                             } else {
@@ -197,10 +201,11 @@  discard block
 block discarded – undo
197 201
                     $list[$row['course_access_id']] = $row;
198 202
                 }
199 203
 
200
-                if (!empty($list))
201
-                    foreach ($list as $id => $data) {
204
+                if (!empty($list)) {
205
+                                    foreach ($list as $id => $data) {
202 206
                         if ($update_database) {
203 207
                             $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = $new_session_id WHERE course_access_id = $id";
208
+                }
204 209
                             if ($debug) {
205 210
                                 echo $sql;
206 211
                             }
@@ -219,13 +224,18 @@  discard block
 block discarded – undo
219 224
                 while($row = Database::fetch_array($res,'ASSOC')) {
220 225
                     $list[] = $row['access_id'];
221 226
                 }
222
-                if (!empty($list))
223
-                    foreach ($list as $id) {
227
+                if (!empty($list)) {
228
+                                    foreach ($list as $id) {
224 229
                         if ($update_database) {
225 230
                             $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = $new_session_id WHERE access_id = $id";
226
-                            if ($debug) echo $sql;
231
+                }
232
+                            if ($debug) {
233
+                                echo $sql;
234
+                            }
227 235
                             $res = Database::query($sql);
228
-                            if ($debug) error_log(__FILE__ . ' +' . __LINE__ . ': ' . print_r($res, 1));
236
+                            if ($debug) {
237
+                                error_log(__FILE__ . ' +' . __LINE__ . ': ' . print_r($res, 1));
238
+                            }
229 239
                             $result_message[$TBL_TRACK_E_LAST_ACCESS]++;
230 240
                         }
231 241
                     }
@@ -249,13 +259,18 @@  discard block
 block discarded – undo
249 259
                     }
250 260
                 }
251 261
 
252
-                if (!empty($list))
253
-                    foreach ($list as $id=>$data) {
262
+                if (!empty($list)) {
263
+                                    foreach ($list as $id=>$data) {
254 264
                         if ($update_database) {
255 265
                             $sql = "UPDATE $TBL_LP_VIEW SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
256
-                            if ($debug) var_dump($sql);
266
+                }
267
+                            if ($debug) {
268
+                                var_dump($sql);
269
+                            }
257 270
                             $res = Database::query($sql);
258
-                            if ($debug) var_dump($res);
271
+                            if ($debug) {
272
+                                var_dump($res);
273
+                            }
259 274
                             $result_message[$TBL_LP_VIEW]++;
260 275
                         } else {
261 276
                             //Getting all information of that lp_item_id
@@ -282,10 +297,11 @@  discard block
 block discarded – undo
282 297
                             $list[$row['id']] = $row;
283 298
                         }
284 299
                     }
285
-                    if (!empty($list))
286
-                        foreach ($list as $id=>$data) {
300
+                    if (!empty($list)) {
301
+                                            foreach ($list as $id=>$data) {
287 302
                             //Getting all information of that lp_item_id
288 303
                             $score    = Tracking::get_avg_student_score($user_id, $origin_course_code,        array($data['lp_id']), $new_session_id);
304
+                    }
289 305
                             $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code,     array($data['lp_id']), $new_session_id);
290 306
                             $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
291 307
                         }
@@ -301,9 +317,13 @@  discard block
 block discarded – undo
301 317
                     $id = $row['ref'];
302 318
                     if ($update_database) {
303 319
                         $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
304
-                        if ($debug) var_dump($sql);
320
+                        if ($debug) {
321
+                            var_dump($sql);
322
+                        }
305 323
                         $res_update = Database::query($sql);
306
-                        if ($debug) var_dump($res_update);
324
+                        if ($debug) {
325
+                            var_dump($res_update);
326
+                        }
307 327
                         $result_message['agenda']++;
308 328
                     }
309 329
                 }
@@ -315,22 +335,30 @@  discard block
 block discarded – undo
315 335
                 //echo '<h1>Student publication</h1>';
316 336
 
317 337
                 $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id";
318
-                if ($debug) echo $sql;
338
+                if ($debug) {
339
+                    echo $sql;
340
+                }
319 341
                 $res = Database::query($sql);
320 342
                 while($row = Database::fetch_array($res,'ASSOC')) {
321 343
                     $id = $row['ref'];
322 344
                     $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id";
323
-                    if ($debug) var_dump($sql);
345
+                    if ($debug) {
346
+                        var_dump($sql);
347
+                    }
324 348
                     $sub_res = Database::query($sql);
325 349
                     if (Database::num_rows($sub_res) > 0 ) {
326 350
                         $data = Database::fetch_array($sub_res,'ASSOC');
327
-                        if ($debug) var_dump($data);
351
+                        if ($debug) {
352
+                            var_dump($data);
353
+                        }
328 354
                         $parent_id = $data['parent_id'];
329 355
                         if (isset($data['parent_id']) && !empty($data['parent_id'])) {
330 356
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $parent_id AND c_id = $course_id";
331 357
                             $select_res     = Database::query($sql);
332 358
                             $parent_data    = Database::fetch_array($select_res,'ASSOC');
333
-                            if ($debug)     var_dump($parent_data);
359
+                            if ($debug) {
360
+                                var_dump($parent_data);
361
+                            }
334 362
 
335 363
                             $sys_course_path = api_get_path(SYS_COURSE_PATH);
336 364
                             $course_dir = $sys_course_path . $course_info['path'];
@@ -345,7 +373,9 @@  discard block
 block discarded – undo
345 373
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION
346 374
                             		WHERE description like '%$search_this%' AND url LIKE '%$search_this2%' AND session_id = $new_session_id AND c_id = $course_id
347 375
                             		ORDER BY id desc  LIMIT 1";
348
-                            if ($debug) echo $sql;
376
+                            if ($debug) {
377
+                                echo $sql;
378
+                            }
349 379
                             $sub_res = Database::query($sql);
350 380
                             $num_rows = Database::num_rows($sub_res);
351 381
 
@@ -389,7 +419,9 @@  discard block
 block discarded – undo
389 419
 
390 420
                             //Creating student_publication_assignment if exists
391 421
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id";
392
-                            if ($debug) var_dump($sql);
422
+                            if ($debug) {
423
+                                var_dump($sql);
424
+                            }
393 425
                             $rest_select     = Database::query($sql);
394 426
                             if (Database::num_rows($rest_select) > 0 ) {
395 427
                                 if ($update_database) {
@@ -401,7 +433,9 @@  discard block
 block discarded – undo
401 433
                                        add_to_calendar      = '".$assignment_data['add_to_calendar']."',
402 434
                                        enable_qualification = '".$assignment_data['enable_qualification']."',
403 435
                                        publication_id       = '".$new_parent_id."'";
404
-                                    if ($debug) echo $sql_add_publication;
436
+                                    if ($debug) {
437
+                                        echo $sql_add_publication;
438
+                                    }
405 439
                                     $rest_select     = Database::query($sql_add_publication);
406 440
                                     $id = Database::insert_id();
407 441
 
@@ -409,11 +443,15 @@  discard block
 block discarded – undo
409 443
                                         "has_properties         = '".$id."',
410 444
                                        view_properties    = '1'
411 445
                                        WHERE id   = ".$new_parent_id;
412
-                                    if ($debug) echo $sql_update;
446
+                                    if ($debug) {
447
+                                        echo $sql_update;
448
+                                    }
413 449
                                     $rest_update     = Database::query($sql_update);
414 450
 
415 451
 
416
-                                    if ($debug) var_dump($sql_update);
452
+                                    if ($debug) {
453
+                                        var_dump($sql_update);
454
+                                    }
417 455
                                     $result_message[$TBL_STUDENT_PUBLICATION_ASSIGNMENT]++;
418 456
                                 }
419 457
                             }
@@ -454,7 +492,9 @@  discard block
 block discarded – undo
454 492
                                     if ($result) {
455 493
                                         unlink($full_file_name);
456 494
                                         $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id'];
457
-                                        if ($debug) var_dump($sql);
495
+                                        if ($debug) {
496
+                                            var_dump($sql);
497
+                                        }
458 498
                                         $result_delete     = Database::query($sql);
459 499
                                         api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id());
460 500
                                     }
@@ -470,22 +510,30 @@  discard block
 block discarded – undo
470 510
                 //10. Dropbox - not neccesary to move categories (no presence of session_id)
471 511
 
472 512
                 $sql = "SELECT id FROM $TBL_DROPBOX_FILE WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id";
473
-                if ($debug) var_dump($sql);
513
+                if ($debug) {
514
+                    var_dump($sql);
515
+                }
474 516
                 $res = Database::query($sql);
475 517
                 while($row = Database::fetch_array($res,'ASSOC')) {
476 518
                     $id = $row['id'];
477 519
                     if ($update_database) {
478 520
                         $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id";
479
-                        if ($debug) var_dump($sql);
521
+                        if ($debug) {
522
+                            var_dump($sql);
523
+                        }
480 524
                         $res = Database::query($sql);
481
-                        if ($debug) var_dump($res);
525
+                        if ($debug) {
526
+                            var_dump($res);
527
+                        }
482 528
 
483 529
                         $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id";
484
-                        if ($debug)
485
-                            var_dump($sql);
530
+                        if ($debug) {
531
+                                                    var_dump($sql);
532
+                        }
486 533
                         $res = Database::query($sql);
487
-                        if ($debug)
488
-                            var_dump($res);
534
+                        if ($debug) {
535
+                                                    var_dump($res);
536
+                        }
489 537
                         $result_message[$TBL_DROPBOX_FILE]++;
490 538
                     }
491 539
                 }
@@ -494,23 +542,30 @@  discard block
 block discarded – undo
494 542
 
495 543
                 $sql = "SELECT notebook_id FROM $TBL_NOTEBOOK
496 544
                         WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id";
497
-                if ($debug) var_dump($sql);
545
+                if ($debug) {
546
+                    var_dump($sql);
547
+                }
498 548
                 $res = Database::query($sql);
499 549
                 while($row = Database::fetch_array($res,'ASSOC')) {
500 550
                     $id = $row['notebook_id'];
501 551
                     if ($update_database) {
502 552
                         $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id";
503
-                        if ($debug) var_dump($sql);
553
+                        if ($debug) {
554
+                            var_dump($sql);
555
+                        }
504 556
                         $res = Database::query($sql);
505
-                        if ($debug) var_dump($res);
557
+                        if ($debug) {
558
+                            var_dump($res);
559
+                        }
506 560
                     }
507 561
                 }
508 562
 
509 563
                 if ($update_database) {
510 564
                     echo '<h2>'.get_lang('StatsMoved').'</h2>';
511
-                    if (is_array($result_message))
512
-                        foreach ($result_message as $table=>$times) {
565
+                    if (is_array($result_message)) {
566
+                                            foreach ($result_message as $table=>$times) {
513 567
                             echo 'Table '.$table.' - '.$times.' records updated <br />';
568
+                    }
514 569
                         }
515 570
                 } else {
516 571
                     echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>';
@@ -626,10 +681,11 @@  discard block
 block discarded – undo
626 681
 }
627 682
 $navigation .= '&nbsp;';
628 683
 $page ++;
629
-if ($page < $nro_pages)
684
+if ($page < $nro_pages) {
630 685
     $navigation .= '<a href="'.api_get_self().'?page='.$page.'">'.get_lang('Next').'</a>';
631
-else
686
+} else {
632 687
     $navigation .= get_lang('Next');
688
+}
633 689
 
634 690
 echo $navigation;
635 691
 $user_list      = UserManager::get_user_list(array(), array(), $begin, $default);
Please login to merge, or discard this patch.
main/install/install.lib.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -972,8 +972,7 @@  discard block
 block discarded – undo
972 972
                 <?php echo get_lang('Error'); ?>!<br />
973 973
                 Chamilo <?php echo implode('|', $update_from_version_8).' '.get_lang('HasNotBeenFoundInThatDir'); ?>.
974 974
             </div>
975
-        <?php }
976
-        else {
975
+        <?php } else {
977 976
             echo '<br />';
978 977
         }
979 978
         ?>
@@ -1088,7 +1087,10 @@  discard block
 block discarded – undo
1088 1087
         <button type="submit" name="step1" class="btn btn-default" onclick="javascript: window.location='index.php'; return false;" value="<?php echo get_lang('Previous'); ?>" >
1089 1088
             <em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?>
1090 1089
         </button>
1091
-        <button type="submit" name="step2_install" class="btn btn-success" value="<?php echo get_lang("NewInstallation"); ?>" <?php if ($error) echo 'disabled="disabled"'; ?> >
1090
+        <button type="submit" name="step2_install" class="btn btn-success" value="<?php echo get_lang("NewInstallation"); ?>" <?php if ($error) {
1091
+    echo 'disabled="disabled"';
1092
+}
1093
+?> >
1092 1094
             <em class="fa fa-forward"> </em> <?php echo get_lang('NewInstallation'); ?>
1093 1095
         </button>
1094 1096
         <input type="hidden" name="is_executable" id="is_executable" value="-" />
@@ -1374,7 +1376,7 @@  discard block
 block discarded – undo
1374 1376
                 <input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /><?php echo $dbHostForm; ?>
1375 1377
             </div>
1376 1378
             <div class="col-sm-3"></div>
1377
-            <?php }else{ ?>
1379
+            <?php } else{ ?>
1378 1380
             <div class="col-sm-5">
1379 1381
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" />
1380 1382
             </div>
@@ -1388,7 +1390,7 @@  discard block
 block discarded – undo
1388 1390
                 <input type="hidden" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /><?php echo $dbPortForm; ?>
1389 1391
             </div>
1390 1392
             <div class="col-sm-3"></div>
1391
-            <?php }else{ ?>
1393
+            <?php } else{ ?>
1392 1394
             <div class="col-sm-5">
1393 1395
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" />
1394 1396
             </div>
@@ -1470,9 +1472,12 @@  discard block
 block discarded – undo
1470 1472
             Database port: <strong><?php echo $manager->getConnection()->getPort(); ?></strong><br/>
1471 1473
             Database driver: <strong><?php echo $manager->getConnection()->getDriver()->getName(); ?></strong><br/>
1472 1474
         </div>
1473
-    <?php else: ?>
1475
+    <?php else {
1476
+    : ?>
1474 1477
         <div id="db_status" class="alert alert-danger">
1475
-            <p><?php echo get_lang('FailedConectionDatabase'); ?></strong></p>
1478
+            <p><?php echo get_lang('FailedConectionDatabase');
1479
+}
1480
+?></strong></p>
1476 1481
             <code><?php echo $database_exists_text ?></code>
1477 1482
         </div>
1478 1483
     <?php endif; ?>
Please login to merge, or discard this patch.
main/admin/access_url_edit_courses_to_url.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -260,10 +260,11 @@
 block discarded – undo
260 260
 				<td colspan="3" align="center">
261 261
 					<br />
262 262
 					<?php
263
-					if(isset($_GET['add']))
264
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
265
-					else
266
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
263
+					if(isset($_GET['add'])) {
264
+											echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
265
+					} else {
266
+											echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
267
+					}
267 268
 					?>
268 269
 				</td>
269 270
 			</tr>
Please login to merge, or discard this patch.
main/lp/aicc.class.php 1 patch
Braces   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -509,7 +509,9 @@  discard block
 block discarded – undo
509 509
                     if ($file != '.' && $file != '..') {
510 510
                         $filetype = 'file';
511 511
 
512
-                        if (is_dir($course_sys_dir.$new_dir.$file)) $filetype = 'folder';
512
+                        if (is_dir($course_sys_dir.$new_dir.$file)) {
513
+                            $filetype = 'folder';
514
+                        }
513 515
 
514 516
                         // TODO: RENAMING FILES CAN BE VERY DANGEROUS AICC-WISE, avoid that as much as possible!
515 517
                         //$safe_file = api_replace_dangerous_char($file, 'strict');
@@ -908,37 +910,43 @@  discard block
 block discarded – undo
908 910
                     if ($enclosed && $data{$i+1} == $enclosure) {
909 911
                         $fldval .= $chr;
910 912
                         ++$i; // Skip the next character.
911
-                    } else
912
-                        $enclosed = !$enclosed;
913
+                    } else {
914
+                                            $enclosed = !$enclosed;
915
+                    }
913 916
                     break;
914 917
                 case $delim:
915 918
                     if (!$enclosed) {
916 919
                         $ret_array[$linecount][$fldcount++] = $fldval;
917 920
                         $fldval = '';
918
-                    } else
919
-                        $fldval .= $chr;
921
+                    } else {
922
+                                            $fldval .= $chr;
923
+                    }
920 924
                     break;
921 925
                 case "\r":
922
-                    if (!$enclosed&&$data{$i+1} == "\n")
923
-                        continue;
926
+                    if (!$enclosed&&$data{$i+1} == "\n") {
927
+                                            continue;
928
+                    }
924 929
                 case "\n":
925 930
                     if (!$enclosed) {
926 931
                         $ret_array[$linecount++][$fldcount] = $fldval;
927 932
                         $fldcount = 0;
928 933
                         $fldval = '';
929
-                    } else
930
-                        $fldval .= $chr;
934
+                    } else {
935
+                                            $fldval .= $chr;
936
+                    }
931 937
                     break;
932 938
                 case "\\r":
933
-                    if (!$enclosed&&$data{$i+1} == "\\n")
934
-                        continue;
939
+                    if (!$enclosed&&$data{$i+1} == "\\n") {
940
+                                            continue;
941
+                    }
935 942
                 case "\\n":
936 943
                     if (!$enclosed) {
937 944
                         $ret_array[$linecount++][$fldcount] = $fldval;
938 945
                         $fldcount = 0;
939 946
                         $fldval = '';
940
-                    } else
941
-                        $fldval .= $chr;
947
+                    } else {
948
+                                            $fldval .= $chr;
949
+                    }
942 950
                     break;
943 951
                 default:
944 952
                     $fldval .= $chr;
Please login to merge, or discard this patch.