Completed
Pull Request — 1.11.x (#1293)
by José
387:57 queued 349:55
created
main/gradebook/lib/be/result.class.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -152,10 +152,11 @@
 block discarded – undo
152 152
             $paramcount ++;
153 153
         }
154 154
         if (!empty($user_id)) {
155
-            if ($paramcount != 0)
156
-                $sql .= ' AND';
157
-            else
158
-                $sql .= ' WHERE';
155
+            if ($paramcount != 0) {
156
+                            $sql .= ' AND';
157
+            } else {
158
+                            $sql .= ' WHERE';
159
+            }
159 160
             $sql .= ' gr.user_id = ' . intval($user_id);
160 161
             $paramcount ++;
161 162
         }
Please login to merge, or discard this patch.
main/gradebook/lib/be/evaluation.class.php 1 patch
Braces   +27 added lines, -12 removed lines patch added patch discarded remove patch
@@ -228,36 +228,51 @@  discard block
 block discarded – undo
228 228
 		}
229 229
 
230 230
 		if (isset ($user_id)) {
231
-			if ($paramcount != 0) $sql .= ' AND';
232
-			else $sql .= ' WHERE';
231
+			if ($paramcount != 0) {
232
+			    $sql .= ' AND';
233
+			} else {
234
+			    $sql .= ' WHERE';
235
+			}
233 236
 			$sql .= ' user_id = '.intval($user_id);
234 237
 			$paramcount ++;
235 238
 		}
236 239
 
237 240
 		if (isset ($course_code) && $course_code <> '-1') {
238
-			if ($paramcount != 0) $sql .= ' AND';
239
-			else $sql .= ' WHERE';
241
+			if ($paramcount != 0) {
242
+			    $sql .= ' AND';
243
+			} else {
244
+			    $sql .= ' WHERE';
245
+			}
240 246
 			$sql .= " course_code = '".Database::escape_string($course_code)."'";
241 247
 			$paramcount ++;
242 248
 		}
243 249
 
244 250
 		if (isset ($category_id)) {
245
-			if ($paramcount != 0) $sql .= ' AND';
246
-			else $sql .= ' WHERE';
251
+			if ($paramcount != 0) {
252
+			    $sql .= ' AND';
253
+			} else {
254
+			    $sql .= ' WHERE';
255
+			}
247 256
 			$sql .= ' category_id = '.intval($category_id);
248 257
 			$paramcount ++;
249 258
 		}
250 259
 
251 260
 		if (isset ($visible)) {
252
-			if ($paramcount != 0) $sql .= ' AND';
253
-			else $sql .= ' WHERE';
261
+			if ($paramcount != 0) {
262
+			    $sql .= ' AND';
263
+			} else {
264
+			    $sql .= ' WHERE';
265
+			}
254 266
 			$sql .= ' visible = '.intval($visible);
255 267
 			$paramcount ++;
256 268
 		}
257 269
 
258 270
 		if (isset ($locked)) {
259
-			if ($paramcount != 0) $sql .= ' AND';
260
-			else $sql .= ' WHERE';
271
+			if ($paramcount != 0) {
272
+			    $sql .= ' AND';
273
+			} else {
274
+			    $sql .= ' WHERE';
275
+			}
261 276
 			$sql .= ' locked = '.intval($locked);
262 277
 		}
263 278
 
@@ -397,7 +412,7 @@  discard block
 block discarded – undo
397 412
 			.', description = ';
398 413
 		if (isset($this->description)) {
399 414
 			$sql .= "'".Database::escape_string($this->get_description())."'";
400
-		}else {
415
+		} else {
401 416
 			$sql .= 'null';
402 417
 		}
403 418
 		$sql .= ', user_id = '.intval($this->get_user_id())
@@ -468,7 +483,7 @@  discard block
 block discarded – undo
468 483
 				$sql .= ' AND user_id = '.api_get_user_id();
469 484
 			}
470 485
 
471
-		}else {
486
+		} else {
472 487
 			$sql .= ' AND user_id = '.api_get_user_id();
473 488
 		}
474 489
 
Please login to merge, or discard this patch.
main/admin/ldap_import_students.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -269,8 +269,7 @@
 block discarded – undo
269 269
     echo '<br /><br />';
270 270
     echo '</div>';
271 271
 
272
-}
273
-elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes'))
272
+} elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes'))
274 273
 {
275 274
 	$id=$_POST['username_form'];
276 275
 	$UserList=array();
Please login to merge, or discard this patch.
main/admin/access_url_add_usergroup_to_url.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,10 @@  discard block
 block discarded – undo
99 99
         <td width="40%" align="center">
100 100
         <select name="user_group_list[]" multiple="multiple" size="20" style="width:400px;">
101 101
 		<?php foreach ($dbUserGroups as $item) { ?>
102
-			<option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) echo 'selected="selected"'; ?>><?php echo $item['name']; ?>
102
+			<option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) {
103
+    echo 'selected="selected"';
104
+}
105
+?>><?php echo $item['name']; ?>
103 106
             </option>
104 107
         <?php } ?>
105 108
     </select>
@@ -110,7 +113,10 @@  discard block
 block discarded – undo
110 113
    <td width="40%" align="center">
111 114
     <select name="url_list[]" multiple="multiple" size="20" style="width:300px;">
112 115
 		<?php foreach ($db_urls as $url_obj) { ?>
113
-        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
116
+        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) {
117
+    echo 'selected="selected"';
118
+}
119
+?>><?php echo $url_obj['url']; ?>
114 120
         </option>
115 121
 		<?php } ?>
116 122
     </select>
Please login to merge, or discard this patch.
main/admin/ldap_form_add_users_group.php 1 patch
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,16 +14,14 @@  discard block
 block discarded – undo
14 14
 	if($statut==1)
15 15
 	{
16 16
 		echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>';
17
-	}
18
-	else
17
+	} else
19 18
 	{
20 19
 		echo '<input type="hidden" name="mailling" value="1">';
21 20
 	}
22 21
 if(!empty($course))
23 22
 {
24 23
 	echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">';
25
-}
26
-elseif(!empty($id_session))
24
+} elseif(!empty($id_session))
27 25
 {
28 26
 	echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">';
29 27
 }
@@ -42,7 +40,11 @@  discard block
 block discarded – undo
42 40
 	  '</tr>'."\n";
43 41
 while (list ($key, $val) = each($nom_form)) {
44 42
 	$nbre=$nbre+1;
45
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
43
+	if($nbre & 1) {
44
+	    $ndiv=2;
45
+	} else {
46
+	    $ndiv=3;
47
+	}
46 48
 	echo '<tr align="center" id="header'.$ndiv.'">';
47 49
 	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
48 50
 	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
@@ -50,8 +52,7 @@  discard block
 block discarded – undo
50 52
 	{
51 53
 		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
52 54
 		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
53
-	}
54
-	else
55
+	} else
55 56
 	{
56 57
 		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
57 58
 		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
Please login to merge, or discard this patch.
main/admin/sub_language.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,8 +200,9 @@
 block discarded – undo
200 200
 					continue;
201 201
 				}
202 202
 
203
-				if (is_array($variable_value))
204
-					echo $lang_file;
203
+				if (is_array($variable_value)) {
204
+									echo $lang_file;
205
+				}
205 206
 				$founded = false;
206 207
 				if ($search_in_english && $search_in_variable) {
207 208
 					// searching the item in the parent tool
Please login to merge, or discard this patch.
main/admin/access_url_edit_courses_to_url.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -108,8 +108,9 @@  discard block
 block discarded – undo
108 108
 
109 109
 api_display_tool_title($tool_name);
110 110
 
111
-if (isset($_GET['action']) && $_GET['action'] == 'show_message')
111
+if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
112 112
 	Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
113
+}
113 114
 
114 115
 $no_course_list = $course_list = array();
115 116
 $ajax_search = $add_type == 'unique' ? true : false;
@@ -261,10 +262,11 @@  discard block
 block discarded – undo
261 262
 				<td colspan="3" align="center">
262 263
 					<br />
263 264
 					<?php
264
-					if(isset($_GET['add']))
265
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
266
-					else
267
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
265
+					if(isset($_GET['add'])) {
266
+											echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
267
+					} else {
268
+											echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
269
+					}
268 270
 					?>
269 271
 				</td>
270 272
 			</tr>
Please login to merge, or discard this patch.
main/admin/archive_cleanup.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,10 +49,11 @@
 block discarded – undo
49 49
 Display::display_warning_message(get_lang('ArchiveDirCleanupDescr'));
50 50
 
51 51
 if (isset($_GET['msg']) && isset($_GET['type'])) {
52
-	if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed')))
53
-	switch($_GET['type']) {
52
+	if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) {
53
+		switch($_GET['type']) {
54 54
 		case 'error':
55 55
 			$message = Display::return_message(get_lang($_GET['msg']), 'error');
56
+	}
56 57
 			break;
57 58
 		case 'confirmation':
58 59
 			$message = Display::return_message(get_lang($_GET['msg']), 'confirm');
Please login to merge, or discard this patch.
main/admin/add_sessions_to_promotion.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,10 @@
 block discarded – undo
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) {
148
+    echo '&add=true' ;
149
+}
150
+?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
148 151
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 152
 
150 153
 if ($add_type=='multiple') {
Please login to merge, or discard this patch.