Passed
Push — 1.10.x ( b8d3c5...c1c0ee )
by Angel Fernando Quiroz
296:52 queued 257:06
created
main/inc/lib/search/search_widget.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  * Get one term html select
31 31
  */
32 32
 function format_one_specific_field_select($prefix, $sf_term_array, $op, $extra_select_attr='size="7" class="sf-select-multiple"') {
33
-	global $charset;
33
+    global $charset;
34 34
     $multiple_select = '<select '. $extra_select_attr .' title="'. $prefix .'" id="sf-'. $prefix .'" name="sf_'. $prefix .'[]">';
35 35
 
36 36
     $all_selected = '';
@@ -119,20 +119,20 @@  discard block
 block discarded – undo
119 119
      * could not send a form in pagination
120 120
      */
121 121
 
122
-	if (isset($_GET['action']) && strcmp(trim($_GET['action']),'search')===0) {
123
-		$action='index.php';
124
-	}
125
-	$navigator_info = api_get_navigator();
122
+    if (isset($_GET['action']) && strcmp(trim($_GET['action']),'search')===0) {
123
+        $action='index.php';
124
+    }
125
+    $navigator_info = api_get_navigator();
126 126
 
127
-	if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
128
-		$submit_button1	= '<input type="submit" id="submit" value="'. get_lang('Search') .'" />';
129
-		$submit_button2 = '<input class="lower-submit" type="submit" value="'. get_lang('Search') .'" />';
127
+    if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=='6') {
128
+        $submit_button1	= '<input type="submit" id="submit" value="'. get_lang('Search') .'" />';
129
+        $submit_button2 = '<input class="lower-submit" type="submit" value="'. get_lang('Search') .'" />';
130 130
         $reset_button 	= '<input type="submit" id="tags-clean" value="'. get_lang('SearchResetKeywords') .'" />';
131
-	} else {
132
-		$submit_button1 = '<button class="search" type="submit" id="submit" value="'. get_lang("Search") .'" /> '. get_lang('Search') .'</button>';
133
-		$submit_button2 = '<button class="search" type="submit" value="'. get_lang('Search') .'" />'. get_lang('Search') .'</button>';
131
+    } else {
132
+        $submit_button1 = '<button class="search" type="submit" id="submit" value="'. get_lang("Search") .'" /> '. get_lang('Search') .'</button>';
133
+        $submit_button2 = '<button class="search" type="submit" value="'. get_lang('Search') .'" />'. get_lang('Search') .'</button>';
134 134
         $reset_button 	= '<button class="save"   type="submit" id="tags-clean" value="'. get_lang('SearchResetKeywords') .'" />'. get_lang('SearchResetKeywords') .'</button> ';
135
-	}
135
+    }
136 136
 
137 137
     $form = '<form id="chamilo_search" action="'. $action .'" method="GET">
138 138
             <input type="text" id="query" name="query" size="40" value="'.stripslashes(Security::remove_XSS($_REQUEST['query'])).'" />
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
      * SortableTableFromArray pagination is done with simple links, so now we
198 198
      * could not send a form in pagination
199 199
      */
200
-	if (isset($_GET['action']) && strcmp(trim($_GET['action']),'search')===0) {
201
-		$action='index.php';
202
-	}
200
+    if (isset($_GET['action']) && strcmp(trim($_GET['action']),'search')===0) {
201
+        $action='index.php';
202
+    }
203 203
 
204 204
     $form = '
205 205
         <form id="chamilo_search" action="'. $action .'" method="GET">
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                         </table>
265 265
                     </div>';
266 266
         }
267
-       $form .= '
267
+        $form .= '
268 268
         </form>
269 269
         <br style="clear: both;"/>';
270 270
 
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
         foreach ($specific_fields as $specific_field) {
323 323
             $temp = array();
324 324
             if (is_array($dkterms) && count($dkterms)>0) {
325
-            	foreach($dkterms[1] as $obj) {
326
-                	$temp = array_merge($obj['sf-'.$specific_field['code']], $temp);
327
-            	}
328
-        	}
325
+                foreach($dkterms[1] as $obj) {
326
+                    $temp = array_merge($obj['sf-'.$specific_field['code']], $temp);
327
+                }
328
+            }
329 329
             $sf_terms[$specific_field['code']] = $temp;
330 330
             $url_params[] = 'sf_'.$specific_field['code'];
331 331
             unset($temp);
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
     }
341 341
     echo '<h2>'.get_lang('Search').'</h2>';
342 342
 
343
-	// Tool introduction
343
+    // Tool introduction
344 344
     // TODO: Settings for the online editor to be checked (insert an image for example). Probably this is a special case here.
345 345
     if (api_get_course_id() !== -1)
346 346
     if (!empty($groupId)) {
Please login to merge, or discard this patch.
main/inc/lib/search/ChamiloQuery.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  * @param   string    $query_string   The term string
34 34
  */
35 35
 function chamilo_get_boolean_query($term) {
36
-  return xapian_get_boolean_query($term);
36
+    return xapian_get_boolean_query($term);
37 37
 }
38 38
 
39 39
 /**
@@ -44,22 +44,22 @@  discard block
 block discarded – undo
44 44
     $results_by_tool = array();
45 45
     if (count($results)>0) {
46 46
 
47
-	    foreach ($results as $key => $row) {
48
-	        $results_by_tool[$row['toolid']][] = $row;
49
-	    }
47
+        foreach ($results as $key => $row) {
48
+            $results_by_tool[$row['toolid']][] = $row;
49
+        }
50 50
 
51
-	    $processed_results = array();
52
-	    foreach ($results_by_tool as $toolid => $rows) {
53
-	        $tool_processor_class = $toolid .'_processor';
54
-	        $tool_processor_path = api_get_path(LIBRARY_PATH) .'search/tool_processors/'. $tool_processor_class .'.class.php';
55
-	        if (file_exists($tool_processor_path)) {
56
-	            require_once($tool_processor_path);
57
-	            $tool_processor = new $tool_processor_class($rows);
58
-	            $processed_results = array_merge($tool_processor->process(), $processed_results);
59
-	        }
60
-	    }
51
+        $processed_results = array();
52
+        foreach ($results_by_tool as $toolid => $rows) {
53
+            $tool_processor_class = $toolid .'_processor';
54
+            $tool_processor_path = api_get_path(LIBRARY_PATH) .'search/tool_processors/'. $tool_processor_class .'.class.php';
55
+            if (file_exists($tool_processor_path)) {
56
+                require_once($tool_processor_path);
57
+                $tool_processor = new $tool_processor_class($rows);
58
+                $processed_results = array_merge($tool_processor->process(), $processed_results);
59
+            }
60
+        }
61 61
 
62
-	    return array(count($processed_results), $processed_results);
62
+        return array(count($processed_results), $processed_results);
63 63
     }
64 64
 }
65 65
 
@@ -72,5 +72,5 @@  discard block
 block discarded – undo
72 72
  * @return XapianQuery query joined
73 73
  */
74 74
 function chamilo_join_queries($query1, $query2=NULL, $op='or') {
75
-	return xapian_join_queries($query1, $query2, $op);
75
+    return xapian_join_queries($query1, $query2, $op);
76 76
 }
Please login to merge, or discard this patch.
main/chat/chat_whoisonline.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 
38 38
     list($pseudo_user) = Database::fetch_array($result);
39 39
 
40
-	$isAllowed = !(empty($pseudo_user) || !$_cid);
41
-	$isMaster = api_is_course_admin();
40
+    $isAllowed = !(empty($pseudo_user) || !$_cid);
41
+    $isMaster = api_is_course_admin();
42 42
     $date_inter = api_get_utc_datetime(time() - 120);
43 43
 
44 44
     $users = array();
45 45
     $course_id = api_get_course_int_id();
46 46
 
47 47
     if (empty($session_id)) {
48
-		$sql = "SELECT DISTINCT
48
+        $sql = "SELECT DISTINCT
49 49
 		            t1.user_id,
50 50
 		            username,
51 51
 		            firstname,
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 
66 66
         $result = Database::query($sql);
67 67
         $users = Database::store_result($result);
68
-	} else {
68
+    } else {
69 69
         $session_condition = api_get_session_condition($session_id, true, false, 't3.session_id');
70
-		// select learners
71
-		$query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email
70
+        // select learners
71
+        $query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email
72 72
                   FROM $tbl_user t1, $tbl_chat_connected t2, $tbl_session_course_user t3
73 73
 		          WHERE
74 74
 		          t2.c_id = $course_id AND
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 		          t3.c_id = '".$courseInfo['real_id']."' AND
78 78
 		          t2.last_connection>'".$date_inter."' $session_condition
79 79
 		          ORDER BY username";
80
-		$result = Database::query($query);
81
-		while ($learner = Database::fetch_array($result)) {
80
+        $result = Database::query($query);
81
+        while ($learner = Database::fetch_array($result)) {
82 82
             $users[$learner['user_id']] = $learner;
83
-		}
83
+        }
84 84
 
85
-		// select session coach
86
-		$query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email
85
+        // select session coach
86
+        $query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email
87 87
 		          FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session t3
88 88
 		          WHERE
89 89
 					t2.c_id = $course_id AND
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
 					t2.last_connection > '".$date_inter."'
94 94
 					$extra_condition
95 95
 				  ORDER BY username";
96
-		$result = Database::query($query);
97
-		if ($coach = Database::fetch_array($result)) {
98
-			$users[$coach['user_id']] = $coach;
99
-		}
96
+        $result = Database::query($query);
97
+        if ($coach = Database::fetch_array($result)) {
98
+            $users[$coach['user_id']] = $coach;
99
+        }
100 100
 
101
-		// select session course coach
102
-		$query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email
101
+        // select session course coach
102
+        $query = "SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri,email
103 103
 				FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session_course_user t3
104 104
 				WHERE
105 105
 					t2.c_id = $course_id AND
@@ -110,15 +110,15 @@  discard block
 block discarded – undo
110 110
 					AND t2.last_connection>'".$date_inter."' $extra_condition
111 111
 				ORDER BY username";
112 112
 
113
-		$result = Database::query($query);
114
-		$course_coaches = array();
115
-		while ($coaches = Database::fetch_array($result)) {
116
-			$users[$coaches['user_id']] = $coaches;
117
-		}
118
-	}
119
-	require 'header_frame.inc.php';
113
+        $result = Database::query($query);
114
+        $course_coaches = array();
115
+        while ($coaches = Database::fetch_array($result)) {
116
+            $users[$coaches['user_id']] = $coaches;
117
+        }
118
+    }
119
+    require 'header_frame.inc.php';
120 120
 
121
-	?>
121
+    ?>
122 122
 	<div class="user-connected">
123 123
 	<div id="user-online-scroll" class="user-online">
124 124
 		<div class="title"><?php echo get_lang('Users'); ?> <?php echo get_lang('Connected'); ?></div>
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 }
135 135
                 $fileUrl = UserManager::getUserPicture($user['user_id'], USER_IMAGE_SIZE_MEDIUM);
136 136
                 $url_user_profile=api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user['user_id'].'&';
137
-			?>
137
+            ?>
138 138
 			<li class="list-group-item">
139 139
 				<img src="<?php echo $fileUrl;?>" border="0" width="50" alt="" class="user-image-chat" />
140 140
 				<div class="user-name">
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                         } else {
148 148
                             echo Display::return_icon('students.gif', get_lang('Student'), array('height' => '18'));
149 149
                         }
150
-					?>
150
+                    ?>
151 151
 				</div>
152 152
 				<div class="user-email"><?php echo $user['username']; ?></div>
153 153
 			</li>
Please login to merge, or discard this patch.
main/chat/chat_functions.lib.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -15,27 +15,27 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function user_connected_in_chat($user_id)
17 17
 {
18
- 	$tbl_chat_connected = Database::get_course_table(TABLE_CHAT_CONNECTED);
18
+        $tbl_chat_connected = Database::get_course_table(TABLE_CHAT_CONNECTED);
19 19
     $user_id 	= intval($user_id);
20
- 	$session_id = api_get_session_id();
20
+        $session_id = api_get_session_id();
21 21
     $group_id   = api_get_group_id();
22 22
     $course_id  = api_get_course_int_id();
23 23
 
24
-	if (!empty($group_id)) {
25
-		$extra_condition = " AND to_group_id = '$group_id'";
26
-	} else {
27
-		$extra_condition = api_get_session_condition($session_id);
28
-	}
24
+    if (!empty($group_id)) {
25
+        $extra_condition = " AND to_group_id = '$group_id'";
26
+    } else {
27
+        $extra_condition = api_get_session_condition($session_id);
28
+    }
29 29
 
30
- 	$sql = 'SELECT COUNT(*) AS count
30
+        $sql = 'SELECT COUNT(*) AS count
31 31
  	        FROM '.$tbl_chat_connected .' c
32 32
  	        WHERE
33 33
  	            c_id = '.$course_id.' AND
34 34
  	            user_id='.$user_id.$extra_condition;
35
- 	$result = Database::query($sql);
36
- 	$count  = Database::fetch_array($result,'ASSOC');
35
+        $result = Database::query($sql);
36
+        $count  = Database::fetch_array($result,'ASSOC');
37 37
 
38
- 	return $count['count'] == 1;
38
+        return $count['count'] == 1;
39 39
 }
40 40
 
41 41
 /**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     $cdate_h = date('H', $now);
72 72
     $cdate_m = date('i', $now);
73 73
     $cdate_s = date('s', $now);
74
-	$cd_count_time_seconds = $cdate_h*3600 + $cdate_m*60 + $cdate_s;
74
+    $cd_count_time_seconds = $cdate_h*3600 + $cdate_m*60 + $cdate_s;
75 75
 
76 76
     if (is_array($list_info_user_in_chat) && count($list_info_user_in_chat) > 0) {
77 77
         foreach ($list_info_user_in_chat as $list_info_user) {
@@ -101,26 +101,26 @@  discard block
 block discarded – undo
101 101
  */
102 102
 function users_list_in_chat()
103 103
 {
104
-	$list_users_in_chat = array();
105
- 	$tbl_chat_connected = Database::get_course_table(TABLE_CHAT_CONNECTED);
104
+    $list_users_in_chat = array();
105
+        $tbl_chat_connected = Database::get_course_table(TABLE_CHAT_CONNECTED);
106 106
     $course_id = api_get_course_int_id();
107 107
 
108
- 	$session_id = api_get_session_id();
108
+        $session_id = api_get_session_id();
109 109
     $group_id   = api_get_group_id();
110 110
 
111
-	if (!empty($group_id)) {
112
-		$extra_condition = " WHERE to_group_id = '$group_id'";
113
-	} else{
114
-		$extra_condition = api_get_session_condition($session_id, false);
115
-	}
111
+    if (!empty($group_id)) {
112
+        $extra_condition = " WHERE to_group_id = '$group_id'";
113
+    } else{
114
+        $extra_condition = api_get_session_condition($session_id, false);
115
+    }
116 116
     $extra_condition.= " AND c_id = $course_id ";
117
- 	$sql = 'SELECT user_id, last_connection FROM '.$tbl_chat_connected.$extra_condition;
118
- 	$result = Database::query($sql);
119
- 	while ($row = Database::fetch_array($result, 'ASSOC')) {
120
- 		$list_users_in_chat[] = $row;
121
- 	}
117
+        $sql = 'SELECT user_id, last_connection FROM '.$tbl_chat_connected.$extra_condition;
118
+        $result = Database::query($sql);
119
+        while ($row = Database::fetch_array($result, 'ASSOC')) {
120
+            $list_users_in_chat[] = $row;
121
+        }
122 122
 
123
- 	return $list_users_in_chat;
123
+        return $list_users_in_chat;
124 124
 }
125 125
 
126 126
 /**
Please login to merge, or discard this patch.
main/exercice/hotpotatoes_exercise_report.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 if (!$is_allowedToEdit) {
48
-   // api_not_allowed();
48
+    // api_not_allowed();
49 49
 }
50 50
 
51 51
 if (!empty($_REQUEST['path'])) {
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
         get_lang('Actions')
191 191
     );
192 192
 
193
-  // Column config
194
-  // @todo fix search firstname/lastname that doesn't work. rmove search for the moment
195
-	$column_model   = array(
193
+    // Column config
194
+    // @todo fix search firstname/lastname that doesn't work. rmove search for the moment
195
+    $column_model   = array(
196 196
         array('name'=>'firstname',      'index'=>'firstname',		'width'=>'50',   'align'=>'left', 'search' => 'false'),
197 197
         array('name'=>'lastname',		    'index'=>'lastname',		'width'=>'50',   'align'=>'left', 'formatter'=>'action_formatter', 'search' => 'false'),
198 198
         array('name'=>'login',          'hidden'=>'true',       'index'=>'username',        'width'=>'40',   'align'=>'left', 'search' => 'false'),
Please login to merge, or discard this patch.
main/exercice/question_list_admin.inc.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  * @author Patrick Cool
17 17
  * @author René Haentjens, added CSV file import (October 2004)
18 18
  * @package chamilo.link
19
-
20 19
  */
21 20
 
22 21
 // Including libraries
Please login to merge, or discard this patch.
main/dashboard/index.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $actions = array('listing', 'store_user_block', 'disable_block');
27 27
 $action = 'listing';
28 28
 if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
29
-	$action = $_GET['action'];
29
+    $action = $_GET['action'];
30 30
 }
31 31
 
32 32
 // load styles from dashboard plugins
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $dashboard_controller = new DashboardController();
38 38
 
39 39
 if (isset($_GET['path'])) {
40
-	$path = $_GET['path'];
40
+    $path = $_GET['path'];
41 41
 }
42 42
 
43 43
 // distpacher actions to controller
Please login to merge, or discard this patch.
main/auth/ldap/newUser.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@
 block discarded – undo
21 21
 
22 22
 if ($ldap_login_success)
23 23
 {
24
-	//error_log('Found user '.$login.' on LDAP server',0);
25
-	/*
24
+    //error_log('Found user '.$login.' on LDAP server',0);
25
+    /*
26 26
 		In here, we know that
27 27
 		- the user does not exist in dokeos
28 28
 		- the users login and password are correct
29 29
 	*/
30
-	$info_array = ldap_find_user_info($login);
31
-	ldap_put_user_info_locally($login, $info_array);
30
+    $info_array = ldap_find_user_info($login);
31
+    ldap_put_user_info_locally($login, $info_array);
32 32
 } else {
33 33
     //error_log('Could not find '.$login.' on LDAP server',0);
34
-	$loginFailed = true;
35
-	unset($_user['user_id']);
36
-	$uidReset = false;
34
+    $loginFailed = true;
35
+    unset($_user['user_id']);
36
+    $uidReset = false;
37 37
 }
Please login to merge, or discard this patch.
main/cron/user_import/get_data_from_mail.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,16 +20,16 @@
 block discarded – undo
20 20
 $users = Database::get_main_table(TABLE_MAIN_USER);
21 21
 $string='';
22 22
 foreach ($list as $mail) {
23
-  $mail = trim($mail);
24
-  $sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n";
25
-  $res = Database::query($sql);
26
-  if ($res === false) { die(mysql_error());}
27
-  if (Database::num_rows($res) == 0) {
23
+    $mail = trim($mail);
24
+    $sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n";
25
+    $res = Database::query($sql);
26
+    if ($res === false) { die(mysql_error());}
27
+    if (Database::num_rows($res) == 0) {
28 28
     $string .= 'No encontrado;'.$row['email'];
29
-  } else {
29
+    } else {
30 30
     $row = Database::fetch_assoc($res);
31
-   $string .= $row['user_id'].';'.$row['email'].';'.$row['firstname'].';'.$row['lastname'].';'.$row['official_code']."\r\n";
32
-  }
31
+    $string .= $row['user_id'].';'.$row['email'].';'.$row['firstname'].';'.$row['lastname'].';'.$row['official_code']."\r\n";
32
+    }
33 33
 }
34 34
 echo $string;
35 35
 file_put_contents('/tmp/list.txt',$string);
Please login to merge, or discard this patch.