Completed
Push — 1.10.x ( 3c9fe3...995e8b )
by Yannick
116:12 queued 73:22
created
main/admin/add_users_to_group.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
               <?php
402 402
                 $selected_letter = isset($_POST['firstLetterUser']) ? $_POST['firstLetterUser'] : null;
403 403
                 echo Display :: get_alphabet_options($selected_letter);
404
-              ?>
404
+                ?>
405 405
 	     </select>
406 406
     </div>
407 407
 </td>
@@ -412,59 +412,59 @@  discard block
 block discarded – undo
412 412
   <td align="center">
413 413
   <div id="content_source">
414 414
   	  <?php
415
-  	  if (!($add_type=='multiple')) {
416
-  	  	?>
415
+        if (!($add_type=='multiple')) {
416
+            ?>
417 417
 		<input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single',document.getElementById('relation').value)" />
418 418
 		<div id="ajax_list_users_single"></div>
419 419
 		<?php
420
-  	  } else {
421
-  	  ?>
420
+        } else {
421
+        ?>
422 422
   	  <div id="ajax_origin_list_multiple">
423 423
 	  <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">
424 424
 		<?php
425
-		if (!empty($nosessionUsersList)) {
426
-			foreach($nosessionUsersList as $enreg) {
427
-			?>
425
+        if (!empty($nosessionUsersList)) {
426
+            foreach($nosessionUsersList as $enreg) {
427
+            ?>
428 428
 				<option value="<?php echo $enreg['user_id']; ?>"  > <?php echo $enreg['firstname'].' '.$enreg['lastname'].' ('.$enreg['username'].')'; ?></option>
429 429
 			<?php
430
-			}
431
-		}
432
-		?>
430
+            }
431
+        }
432
+        ?>
433 433
 	  </select>
434 434
 	  </div>
435 435
 	<?php
436
-  	  }
437
-  	  unset($nosessionUsersList);
438
-  	 ?>
436
+        }
437
+        unset($nosessionUsersList);
438
+        ?>
439 439
   </div>
440 440
   </td>
441 441
   <td width="10%" valign="middle" align="center">
442 442
   <?php
443
-  if ($ajax_search) {
444
-  ?>
443
+    if ($ajax_search) {
444
+    ?>
445 445
     <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" ><em class="fa fa-arrow-left"></em></button>
446 446
   <?php
447
-  } else {
448
-  ?>
447
+    } else {
448
+    ?>
449 449
   	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))"><em class="fa fa-arrow-right"></em></button>
450 450
 	<br /><br />
451 451
 	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))"><em class="fa fa-arrow-left"></em></button>
452 452
 	<?php
453
-  }
454
-  ?>
453
+    }
454
+    ?>
455 455
 	<br /><br /><br /><br /><br />
456 456
   </td>
457 457
   <td align="center">
458 458
   <div id="ajax_destination_list">
459 459
   <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" style="width:360px;">
460 460
 	<?php
461
-	if (!empty($sessionUsersList)) {
462
-		foreach($sessionUsersList as $enreg) { ?>
461
+    if (!empty($sessionUsersList)) {
462
+        foreach($sessionUsersList as $enreg) { ?>
463 463
 			<option value="<?php echo $enreg['user_id']; ?>">
464 464
                 <?php echo $enreg['firstname'].' '.$enreg['lastname'].' ('.$enreg['username'].')'; ?>
465 465
             </option>
466 466
 	<?php }
467
-	} unset($sessionUsersList);
467
+    } unset($sessionUsersList);
468 468
     ?>
469 469
   </select>
470 470
   </div>
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 	<td colspan="3" align="center">
475 475
 		<br />
476 476
 		<?php
477
-		echo '<button class="btn btn-success" type="button" value="" onclick="valide()" ><em class="fa fa-floppy-o"></em> '.get_lang('SubscribeUsersToGroup').'</button>';
478
-		?>
477
+        echo '<button class="btn btn-success" type="button" value="" onclick="valide()" ><em class="fa fa-floppy-o"></em> '.get_lang('SubscribeUsersToGroup').'</button>';
478
+        ?>
479 479
 	</td>
480 480
 </tr>
481 481
 </table>
Please login to merge, or discard this patch.
main/admin/specific_fields.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 $table->set_column_filter(3, 'edit_filter');
44 44
 
45 45
 function edit_filter($id,$url_params,$row) {
46
-	global $charset;
47
-	$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
48
-	$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
49
-	return $return;
46
+    global $charset;
47
+    $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
48
+    $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
49
+    return $return;
50 50
 }
51 51
 
52 52
 if ($_REQUEST['action'] == 'delete') {
53
-	delete_specific_field($_REQUEST['field_id']);
54
-	header('Location: specific_fields.php?message='.get_lang('FieldRemoved'));
53
+    delete_specific_field($_REQUEST['field_id']);
54
+    header('Location: specific_fields.php?message='.get_lang('FieldRemoved'));
55 55
 }
56 56
 
57 57
 // Start output
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro'));
62 62
 
63 63
 if(!empty($_GET['message'])) {
64
-  Display::display_confirmation_message($_GET['message']);
64
+    Display::display_confirmation_message($_GET['message']);
65 65
 }
66 66
 
67 67
 echo '<div class="actions">';
Please login to merge, or discard this patch.
main/admin/configure_extensions.php 1 patch
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@  discard block
 block discarded – undo
14 14
 $message = '';
15 15
 
16 16
 if (isset($_POST['activeExtension'])) {
17
-	switch ($_POST['extension_code']) {
18
-		case 'visio' :
19
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
17
+    switch ($_POST['extension_code']) {
18
+        case 'visio' :
19
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
20 20
 					selected_value="true"
21 21
 					WHERE variable="service_visio"
22 22
 					AND subkey="active"';
23
-			$rs = Database::query($sql);
24
-			if (Database::affected_rows($rs)>0) {
25
-				// select all the courses and insert the tool inside
26
-				$sql = 'SELECT id FROM '.Database::get_main_table(TABLE_MAIN_COURSE);
27
-				$rs = Database::query($sql);
28
-				while($row = Database::fetch_array($rs)){
29
-					if(!empty($_POST['visio_host'])) {
30
-						$tool_table = Database::get_course_table(TABLE_TOOL_LIST);
31
-						$select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CONFERENCE."'";
32
-						$selectres = Database::query($select);
33
-						if (Database::num_rows($selectres)<1) {
34
-							$sql = 'INSERT INTO '.$tool_table.' SET
23
+            $rs = Database::query($sql);
24
+            if (Database::affected_rows($rs)>0) {
25
+                // select all the courses and insert the tool inside
26
+                $sql = 'SELECT id FROM '.Database::get_main_table(TABLE_MAIN_COURSE);
27
+                $rs = Database::query($sql);
28
+                while($row = Database::fetch_array($rs)){
29
+                    if(!empty($_POST['visio_host'])) {
30
+                        $tool_table = Database::get_course_table(TABLE_TOOL_LIST);
31
+                        $select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CONFERENCE."'";
32
+                        $selectres = Database::query($select);
33
+                        if (Database::num_rows($selectres)<1) {
34
+                            $sql = 'INSERT INTO '.$tool_table.' SET
35 35
 							        c_id =  '.$row['id'].',
36 36
 									name="'.TOOL_VISIO_CONFERENCE.'",
37 37
 									link="conference/index.php?type=conference",
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 									address="squaregrey.gif",
42 42
 									target="_self",
43 43
 									category="interaction"';
44
-							Database::query($sql);
45
-						}
46
-						$select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CLASSROOM."'";
47
-						$selectres = Database::query($select);
48
-						if(Database::num_rows($selectres)<1) {
49
-							$sql = 'INSERT INTO '.$tool_table.' SET
44
+                            Database::query($sql);
45
+                        }
46
+                        $select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CLASSROOM."'";
47
+                        $selectres = Database::query($select);
48
+                        if(Database::num_rows($selectres)<1) {
49
+                            $sql = 'INSERT INTO '.$tool_table.' SET
50 50
 							        c_id =  '.$row['id'].',
51 51
 									name="'.TOOL_VISIO_CLASSROOM.'",
52 52
 									link="conference/index.php?type=classroom",
@@ -56,92 +56,92 @@  discard block
 block discarded – undo
56 56
 									address="squaregrey.gif",
57 57
 									target="_self",
58 58
 									category="authoring"';
59
-							Database::query($sql);
60
-						}
61
-					}
62
-				}
63
-				$message = get_lang('ServiceActivated');
64
-
65
-			}
66
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
59
+                            Database::query($sql);
60
+                        }
61
+                    }
62
+                }
63
+                $message = get_lang('ServiceActivated');
64
+
65
+            }
66
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
67 67
 					selected_value="'.Database::escape_string($_POST['visio_host']).'"
68 68
 					WHERE variable="service_visio"
69 69
 					AND subkey="visio_host"';
70
-			$rs = Database::query($sql);
70
+            $rs = Database::query($sql);
71 71
 
72
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
72
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
73 73
 					selected_value="'.Database::escape_string($_POST['visio_port']).'"
74 74
 					WHERE variable="service_visio"
75 75
 					AND subkey="visio_port"';
76
-			$rs = Database::query($sql);
76
+            $rs = Database::query($sql);
77 77
 
78
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
78
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
79 79
 					selected_value="'.Database::escape_string($_POST['visio_pass']).'"
80 80
 					WHERE variable="service_visio"
81 81
 					AND subkey="visio_pass"';
82
-			$rs = Database::query($sql);
82
+            $rs = Database::query($sql);
83 83
 
84
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
84
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
85 85
 					selected_value="'.($_POST['visio_use_rtmpt']=='true'?'true':'false').'"
86 86
 					WHERE variable="service_visio"
87 87
 					AND subkey="visio_use_rtmpt"';
88
-			$rs = Database::query($sql);
88
+            $rs = Database::query($sql);
89 89
 
90
-			if(empty($message)) {
91
-				$message = get_lang('ServiceReconfigured');
92
-			}
93
-			break;
90
+            if(empty($message)) {
91
+                $message = get_lang('ServiceReconfigured');
92
+            }
93
+            break;
94 94
 
95
-		case 'ppt2lp' :
96
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
95
+        case 'ppt2lp' :
96
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
97 97
 					selected_value="true"
98 98
 					WHERE variable="service_ppt2lp"
99 99
 					AND subkey="active"';
100 100
 
101
-			$rs = Database::query($sql);
101
+            $rs = Database::query($sql);
102 102
 
103
-			if (Database::affected_rows($rs)>0){
104
-				$message = get_lang('ServiceActivated');
105
-			}
103
+            if (Database::affected_rows($rs)>0){
104
+                $message = get_lang('ServiceActivated');
105
+            }
106 106
 
107
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
107
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
108 108
 					selected_value="'.addslashes($_POST['host']).'"
109 109
 					WHERE variable="service_ppt2lp"
110 110
 					AND subkey="host"';
111
-			Database::query($sql);
111
+            Database::query($sql);
112 112
 
113
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
113
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
114 114
 					selected_value="'.addslashes($_POST['port']).'"
115 115
 					WHERE variable="service_ppt2lp"
116 116
 					AND subkey="port"';
117
-			Database::query($sql);
117
+            Database::query($sql);
118 118
 
119
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
119
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
120 120
 					selected_value="'.addslashes($_POST['ftp_password']).'"
121 121
 					WHERE variable="service_ppt2lp"
122 122
 					AND subkey="ftp_password"';
123
-			Database::query($sql);
123
+            Database::query($sql);
124 124
 
125
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
125
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
126 126
 					selected_value="'.addslashes($_POST['user']).'"
127 127
 					WHERE variable="service_ppt2lp"
128 128
 					AND subkey="user"';
129
-			Database::query($sql);
129
+            Database::query($sql);
130 130
 
131
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
131
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
132 132
 					selected_value="'.addslashes($_POST['path_to_lzx']).'"
133 133
 					WHERE variable="service_ppt2lp"
134 134
 					AND subkey="path_to_lzx"';
135
-			Database::query($sql);
135
+            Database::query($sql);
136 136
 
137
-			$sql = 'UPDATE '.$tbl_settings_current.' SET
137
+            $sql = 'UPDATE '.$tbl_settings_current.' SET
138 138
 					selected_value="'.addslashes($_POST['size']).'"
139 139
 					WHERE variable="service_ppt2lp"
140 140
 					AND subkey="size"';
141
-			Database::query($sql);
141
+            Database::query($sql);
142 142
 
143
-			break;
144
-	}
143
+            break;
144
+    }
145 145
 
146 146
 }
147 147
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 
155 155
 $rs = Database::query($sql);
156 156
 while($row = Database::fetch_array($rs)){
157
-	$listActiveServices[] = $row['variable'];
157
+    $listActiveServices[] = $row['variable'];
158 158
 }
159 159
 
160 160
 // javascript to handle accordion behaviour
161 161
 $javascript_message = '';
162 162
 if(!empty($message)){
163
-	$javascript_message =
164
-	'
163
+    $javascript_message =
164
+    '
165 165
 	document.getElementById("message").style.display = "block";
166 166
 	var timer = setTimeout(hideMessage,5000);
167 167
 	';
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 ?>
216 216
 <div id="message" style="display: none">
217 217
 	<?php
218
-	if(!empty($message))
219
-		Display::display_normal_message($message)
220
-	?>
218
+    if(!empty($message))
219
+        Display::display_normal_message($message)
220
+    ?>
221 221
 </div>
222 222
 
223 223
 <div id="content" align="center">
@@ -303,63 +303,63 @@  discard block
 block discarded – undo
303 303
                     <form method="POST" class="form-horizontal" action="<?php echo api_get_self(); ?>">
304 304
 						<?php
305 305
 
306
-						$form = new FormValidator('ppt2lp');
307
-						$form -> addElement('text', 'host', get_lang('Host'));
308
-						//$form -> addElement('html','<br /><br />');
309
-						$form -> addElement('text', 'port', get_lang('Port'));
310
-						//$form -> addElement('html','<br /><br />');
311
-						$form -> addElement('text', 'user', get_lang('UserOnHost'));
312
-						//$form -> addElement('html','<br /><br />');
313
-						$form -> addElement('text', 'ftp_password', get_lang('FtpPassword'));
314
-						//$form -> addElement('html','<br /><br />');
315
-						$form -> addElement('text', 'path_to_lzx', get_lang('PathToLzx'));
316
-						//$form -> addElement('html','<br /><br />');
317
-						$options = array(
318
-									'540x405'=>'540x405',
319
-									'640x480'=>'640x480',
320
-									'720x540'=>'720x540',
321
-									'800x600'=>'800x600',
322
-									'1000x750'=>'1000x750'
323
-									);
324
-						$form -> addElement('select', 'size', get_lang('SlideSize'), $options);
325
-
326
-
327
-						$form -> addElement('hidden', 'extension_code', 'ppt2lp');
328
-
329
-						$defaults = array();
330
-						$renderer = $form -> defaultRenderer();
331
-						$renderer -> setElementTemplate('<div style="text-align:left">{label}</div><div style="text-align:left">{element}</div>');
332
-						//$form -> addElement('html','<br /><br />');
333
-						if(in_array('service_ppt2lp',$listActiveServices))
334
-						{
335
-							$sql = 'SELECT subkey, selected_value FROM '.$tbl_settings_current.'
306
+                        $form = new FormValidator('ppt2lp');
307
+                        $form -> addElement('text', 'host', get_lang('Host'));
308
+                        //$form -> addElement('html','<br /><br />');
309
+                        $form -> addElement('text', 'port', get_lang('Port'));
310
+                        //$form -> addElement('html','<br /><br />');
311
+                        $form -> addElement('text', 'user', get_lang('UserOnHost'));
312
+                        //$form -> addElement('html','<br /><br />');
313
+                        $form -> addElement('text', 'ftp_password', get_lang('FtpPassword'));
314
+                        //$form -> addElement('html','<br /><br />');
315
+                        $form -> addElement('text', 'path_to_lzx', get_lang('PathToLzx'));
316
+                        //$form -> addElement('html','<br /><br />');
317
+                        $options = array(
318
+                                    '540x405'=>'540x405',
319
+                                    '640x480'=>'640x480',
320
+                                    '720x540'=>'720x540',
321
+                                    '800x600'=>'800x600',
322
+                                    '1000x750'=>'1000x750'
323
+                                    );
324
+                        $form -> addElement('select', 'size', get_lang('SlideSize'), $options);
325
+
326
+
327
+                        $form -> addElement('hidden', 'extension_code', 'ppt2lp');
328
+
329
+                        $defaults = array();
330
+                        $renderer = $form -> defaultRenderer();
331
+                        $renderer -> setElementTemplate('<div style="text-align:left">{label}</div><div style="text-align:left">{element}</div>');
332
+                        //$form -> addElement('html','<br /><br />');
333
+                        if(in_array('service_ppt2lp',$listActiveServices))
334
+                        {
335
+                            $sql = 'SELECT subkey, selected_value FROM '.$tbl_settings_current.'
336 336
 									WHERE variable = "service_ppt2lp"
337 337
 									AND subkey <> "active"';
338
-							$rs = Database::query($sql);
339
-							while($row = Database::fetch_array($rs,'ASSOC'))
340
-							{
341
-								$defaults[$row['subkey']] = $row['selected_value'];
342
-							}
343
-							$form->addButtonSave(get_lang('ReconfigureExtension'), 'activeExtension');
344
-						}
345
-						else {
346
-							$defaults['host'] = 'localhost';
347
-							$defaults['port'] = '2002';
348
-							$defaults['size'] = '720x540';
349
-							$form->addButtonSave(get_lang('ActivateExtension'), 'activeExtension');
350
-						}
351
-
352
-						$form -> setDefaults($defaults);
353
-						$form -> display();
354
-						echo '<br />';
355
-						?>
338
+                            $rs = Database::query($sql);
339
+                            while($row = Database::fetch_array($rs,'ASSOC'))
340
+                            {
341
+                                $defaults[$row['subkey']] = $row['selected_value'];
342
+                            }
343
+                            $form->addButtonSave(get_lang('ReconfigureExtension'), 'activeExtension');
344
+                        }
345
+                        else {
346
+                            $defaults['host'] = 'localhost';
347
+                            $defaults['port'] = '2002';
348
+                            $defaults['size'] = '720x540';
349
+                            $form->addButtonSave(get_lang('ActivateExtension'), 'activeExtension');
350
+                        }
351
+
352
+                        $form -> setDefaults($defaults);
353
+                        $form -> display();
354
+                        echo '<br />';
355
+                        ?>
356 356
 						</form>
357 357
                 </div>
358 358
             </div>
359 359
         </div>
360 360
 	
361 361
 	<?php
362
-	/*
362
+    /*
363 363
 	<!-- EPHORUS -->
364 364
 	<div id="main_ephorus">
365 365
 		<div id="extension_header_ephorus" class="accordion_header">
Please login to merge, or discard this patch.
main/admin/class_user_import.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
     $classcodes = array ();
19 19
 
20 20
     if (!isset($_POST['subscribe']) && !isset($_POST['subscribe']))  {
21
-          $user_class['error'] = get_lang('SelectAnAction');
22
-          $errors[] = $user_class;
23
-          return $errors;
21
+            $user_class['error'] = get_lang('SelectAnAction');
22
+            $errors[] = $user_class;
23
+            return $errors;
24 24
     }
25 25
     foreach ($user_classes as $index => $user_class) {
26 26
         $user_class['line'] = $index + 1;
Please login to merge, or discard this patch.
main/admin/special_exports.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 require_once '../coursecopy/classes/CourseSelectForm.class.php';
29 29
 
30 30
 if (function_exists('ini_set')) {
31
-	api_set_memory_limit('256M');
32
-	ini_set('max_execution_time',0);
31
+    api_set_memory_limit('256M');
32
+    ini_set('max_execution_time',0);
33 33
 }
34 34
 
35 35
 // Displaying the header
@@ -50,36 +50,36 @@  discard block
 block discarded – undo
50 50
 if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') ||
51 51
     (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'full_backup')
52 52
 ) {
53
-	$export = false;
54
-	if (isset ($_POST['action']) && $_POST['action'] == 'course_select_form') {
55
-		$FileZip = create_zip();
56
-		$to_group_id = 0;
57
-		$sql_session = "SELECT id, name FROM $tbl_session ";
58
-		$query_session = Database::query($sql_session);
59
-		$ListSession = array();
60
-		while ($rows_session = Database::fetch_assoc($query_session)) {
61
-			$ListSession[$rows_session['id']] = $rows_session['name'];
62
-		}
53
+    $export = false;
54
+    if (isset ($_POST['action']) && $_POST['action'] == 'course_select_form') {
55
+        $FileZip = create_zip();
56
+        $to_group_id = 0;
57
+        $sql_session = "SELECT id, name FROM $tbl_session ";
58
+        $query_session = Database::query($sql_session);
59
+        $ListSession = array();
60
+        while ($rows_session = Database::fetch_assoc($query_session)) {
61
+            $ListSession[$rows_session['id']] = $rows_session['name'];
62
+        }
63 63
 
64 64
         $groupCondition = " props.to_group_id = $to_group_id";
65 65
         if (empty($to_group_id)) {
66 66
             $groupCondition = " (props.to_group_id = 0 OR props.to_group_id IS NULL)";
67 67
         }
68 68
 
69
-		$zip_folder=new PclZip($FileZip['TEMP_FILE_ZIP']);
70
-		if(!isset($_POST['resource']) || count($_POST['resource']) == 0 ) {
71
-			Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
72
-		} else {
73
-			$Resource = $_POST['resource'];
69
+        $zip_folder=new PclZip($FileZip['TEMP_FILE_ZIP']);
70
+        if(!isset($_POST['resource']) || count($_POST['resource']) == 0 ) {
71
+            Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
72
+        } else {
73
+            $Resource = $_POST['resource'];
74 74
 
75
-			foreach ($Resource as $Code_course => $Sessions) {
76
-				$_course 		= api_get_course_info($Code_course);
77
-				$tbl_document 	= Database::get_course_table(TABLE_DOCUMENT);
78
-				$tbl_property 	= Database::get_course_table(TABLE_ITEM_PROPERTY);
79
-				$course_id 		= $_course['real_id'];
75
+            foreach ($Resource as $Code_course => $Sessions) {
76
+                $_course 		= api_get_course_info($Code_course);
77
+                $tbl_document 	= Database::get_course_table(TABLE_DOCUMENT);
78
+                $tbl_property 	= Database::get_course_table(TABLE_ITEM_PROPERTY);
79
+                $course_id 		= $_course['real_id'];
80 80
 
81
-				//Add item to the zip file course
82
-				$sql = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
81
+                //Add item to the zip file course
82
+                $sql = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
83 83
                         WHERE props.tool='".TOOL_DOCUMENT."'
84 84
 						AND docs.id=props.ref
85 85
 						AND docs.path LIKE '".$querypath."/%'
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 						AND $groupCondition
90 90
 						AND docs.c_id = $course_id
91 91
 						AND props.c_id = $course_id";
92
-				$query = Database::query($sql );
93
-				while ($rows_course_file = Database::fetch_assoc($query)) {
92
+                $query = Database::query($sql );
93
+                while ($rows_course_file = Database::fetch_assoc($query)) {
94 94
                     $zip_folder->add(
95 95
                         $FileZip['PATH_COURSE'].$_course['directory']."/document".$rows_course_file['path'],
96 96
                         PCLZIP_OPT_ADD_PATH,
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
                         PCLZIP_OPT_REMOVE_PATH,
99 99
                         $FileZip['PATH_COURSE'].$_course['directory']."/document".$FileZip['PATH_REMOVE']
100 100
                     );
101
-				}
101
+                }
102 102
 
103
-				foreach ($Sessions as $IdSession => $value){
104
-					$session_id = Security::remove_XSS($IdSession);
105
-					//Add tem to the zip file session course
106
-					$sql_session_doc = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
103
+                foreach ($Sessions as $IdSession => $value){
104
+                    $session_id = Security::remove_XSS($IdSession);
105
+                    //Add tem to the zip file session course
106
+                    $sql_session_doc = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
107 107
 						WHERE props.tool='".TOOL_DOCUMENT."'
108 108
 							AND docs.id=props.ref
109 109
 							AND docs.path LIKE '".$querypath."/%'
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 							AND $groupCondition
114 114
 							AND docs.c_id = $course_id
115 115
 							AND props.c_id = $course_id";
116
-					$query_session_doc = Database::query($sql_session_doc);
117
-					while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) {
116
+                    $query_session_doc = Database::query($sql_session_doc);
117
+                    while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) {
118 118
                         $zip_folder->add(
119 119
                             $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$rows_course_session_file['path'],
120 120
                             PCLZIP_OPT_ADD_PATH,
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
                             PCLZIP_OPT_REMOVE_PATH,
123 123
                             $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE']
124 124
                         );
125
-					}
126
-				}
127
-			}
128
-			$name = rename_zip($FileZip);
129
-			$export = true;
130
-		}
131
-	} else {
132
-		$name = fullexportspecial();
133
-	}
125
+                    }
126
+                }
127
+            }
128
+            $name = rename_zip($FileZip);
129
+            $export = true;
130
+        }
131
+    } else {
132
+        $name = fullexportspecial();
133
+    }
134 134
 ?>
135 135
 <!-- Manual download <script language="JavaScript">
136 136
  // setTimeout(\'download_backup()\',2000);
@@ -143,23 +143,23 @@  discard block
 block discarded – undo
143 143
 }
144 144
 
145 145
 if ($export && $name) {
146
-	Display::display_confirmation_message(get_lang('BackupCreated'));
147
-	echo '<br /><a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.urlencode($name).'&session=true">'.get_lang('Download').'</a>';
146
+    Display::display_confirmation_message(get_lang('BackupCreated'));
147
+    echo '<br /><a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.urlencode($name).'&session=true">'.get_lang('Download').'</a>';
148 148
 } else {
149
-	// Display forms especial export
150
-	if (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') {
151
-		$cb = new CourseBuilder();
152
-		$course = $cb->build_session_course();
153
-		if($course === false){
154
-			Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
155
-			form_special_export();
156
-		} else {
157
-			Display::display_normal_message(get_lang('ToExportSpecialSelect'));
158
-			CourseSelectForm :: display_form_session_export($course);
159
-		}
160
-	} else {
161
-		form_special_export();
162
-	}
149
+    // Display forms especial export
150
+    if (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') {
151
+        $cb = new CourseBuilder();
152
+        $course = $cb->build_session_course();
153
+        if($course === false){
154
+            Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
155
+            form_special_export();
156
+        } else {
157
+            Display::display_normal_message(get_lang('ToExportSpecialSelect'));
158
+            CourseSelectForm :: display_form_session_export($course);
159
+        }
160
+    } else {
161
+        form_special_export();
162
+    }
163 163
 }
164 164
 
165 165
 /* FOOTER */
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
     }
201 201
     $temp_zip_file = $temp_zip_dir."/".md5(time()).".zip";  //create zipfile of given directory
202 202
     return array('PATH' => $path,
203
-                 'PATH_TEMP_ARCHIVE' => $temp_zip_dir,
204
-                 'PATH_COURSE' => $sys_course_path,
205
-                 'TEMP_FILE_ZIP' => $temp_zip_file,
206
-                 'PATH_REMOVE' => $remove_dir);
203
+                    'PATH_TEMP_ARCHIVE' => $temp_zip_dir,
204
+                    'PATH_COURSE' => $sys_course_path,
205
+                    'TEMP_FILE_ZIP' => $temp_zip_file,
206
+                    'PATH_REMOVE' => $remove_dir);
207 207
 }
208 208
 
209 209
 function rename_zip($FileZip) {
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
                 $query_session_doc = Database::query($sql_session_doc);
288 288
                 while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) {
289 289
                     $zip_folder->add($FileZip['PATH_COURSE'].$_course['directory'].'/document'.$rows_course_session_file['path'],
290
-                         PCLZIP_OPT_ADD_PATH, $_course['directory']."/".$rows_session['name'],
291
-                         PCLZIP_OPT_REMOVE_PATH, $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE']
292
-                     );
290
+                            PCLZIP_OPT_ADD_PATH, $_course['directory']."/".$rows_session['name'],
291
+                            PCLZIP_OPT_REMOVE_PATH, $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE']
292
+                        );
293 293
                 }
294 294
             }
295 295
         }
Please login to merge, or discard this patch.
main/notebook/index.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 
38 38
 // Tool name
39 39
 if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
40
-	$tool = 'NoteAddNew';
41
-	$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
40
+    $tool = 'NoteAddNew';
41
+    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
42 42
 }
43 43
 if (isset($_GET['action']) && $_GET['action'] == 'editnote') {
44
-	$tool = 'ModifyNote';
45
-	$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
44
+    $tool = 'ModifyNote';
45
+    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
46 46
 }
47 47
 
48 48
 // Displaying the header
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 
54 54
 // Action handling: Adding a note
55 55
 if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
56
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
57
-		api_not_allowed();
58
-	}
56
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
57
+        api_not_allowed();
58
+    }
59 59
 
60
-	if (!empty($_GET['isStudentView'])) {
61
-		NotebookManager::display_notes();
62
-		exit;
63
-	}
60
+    if (!empty($_GET['isStudentView'])) {
61
+        NotebookManager::display_notes();
62
+        exit;
63
+    }
64 64
 
65
-	$_SESSION['notebook_view'] = 'creation_date';
65
+    $_SESSION['notebook_view'] = 'creation_date';
66 66
 
67 67
     $form = new FormValidator(
68 68
         'note',
Please login to merge, or discard this patch.
main/survey/fillsurvey.php 1 patch
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@
 block discarded – undo
6 6
 * @author unknown, the initial survey that did not make it in 1.8 because of bad code
7 7
 * @author Patrick Cool <[email protected]>, Ghent University: cleanup, refactoring and rewriting large parts of the code
8 8
 * @author Julio Montoya Armas <[email protected]>, Chamilo: Personality Test modification and rewriting large parts of the code as well
9
-
10
-* @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
9
+ * @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
11 10
 * @todo performance could be improved if not the survey_id was stored with the invitation but the survey_code
12 11
  */
13 12
 // Unsetting the course id (because it is in the URL)
Please login to merge, or discard this patch.
main/survey/reporting.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,15 +83,15 @@
 block discarded – undo
83 83
 
84 84
 /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
85 85
 if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) {
86
-	Display :: display_header(get_lang('ToolSurvey'));
86
+    Display :: display_header(get_lang('ToolSurvey'));
87 87
     // Show error message if the survey can be seen only by tutors
88 88
     if ($survey_data['visible_results'] != SURVEY_VISIBLE_TUTOR) {
89 89
         SurveyUtil::handle_reporting_actions($survey_data, $people_filled);
90 90
     } else {
91 91
         Display :: display_error_message(get_lang('NotAllowed'), false);
92 92
     }
93
-	Display :: display_footer();
94
-	exit;
93
+    Display :: display_footer();
94
+    exit;
95 95
 }
96 96
 
97 97
 // Database table definitions
Please login to merge, or discard this patch.
main/survey/question.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 
20 20
 /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
21 21
 if (!api_is_allowed_to_edit(false, true)) {
22
-	Display :: display_header();
23
-	Display :: display_error_message(get_lang('NotAllowed'), false);
24
-	Display :: display_footer();
25
-	exit;
22
+    Display :: display_header();
23
+    Display :: display_error_message(get_lang('NotAllowed'), false);
24
+    Display :: display_footer();
25
+    exit;
26 26
 }
27 27
 
28 28
 // Is valid request
@@ -42,30 +42,30 @@  discard block
 block discarded – undo
42 42
 $surveyData = SurveyManager::get_survey($_GET['survey_id']);
43 43
 
44 44
 if (empty($surveyData)) {
45
-	Display :: display_header(get_lang('ToolSurvey'));
46
-	Display :: display_error_message(get_lang('InvallidSurvey'), false);
47
-	Display :: display_footer();
48
-	exit;
45
+    Display :: display_header(get_lang('ToolSurvey'));
46
+    Display :: display_error_message(get_lang('InvallidSurvey'), false);
47
+    Display :: display_footer();
48
+    exit;
49 49
 }
50 50
 
51 51
 $urlname = api_substr(api_html_entity_decode($surveyData['title'], ENT_QUOTES), 0, 40);
52 52
 if (api_strlen(strip_tags($surveyData['title'])) > 40) {
53
-	$urlname .= '...';
53
+    $urlname .= '...';
54 54
 }
55 55
 
56 56
 if ($surveyData['survey_type'] == 1) {
57
-	$sql = 'SELECT id FROM '.Database :: get_course_table(TABLE_SURVEY_QUESTION_GROUP).'
57
+    $sql = 'SELECT id FROM '.Database :: get_course_table(TABLE_SURVEY_QUESTION_GROUP).'
58 58
 	        WHERE
59 59
                 c_id = '.$course_id.' AND
60 60
                 survey_id = '.(int)$_GET['survey_id'].' LIMIT 1';
61
-	$rs = Database::query($sql);
62
-	if (Database::num_rows($rs)===0) {
61
+    $rs = Database::query($sql);
62
+    if (Database::num_rows($rs)===0) {
63 63
         Display::addFlash(
64 64
             Display::return_message(get_lang('YouNeedToCreateGroups'))
65 65
         );
66
-		header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.(int)$_GET['survey_id']);
67
-		exit;
68
-	}
66
+        header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.(int)$_GET['survey_id']);
67
+        exit;
68
+    }
69 69
 }
70 70
 
71 71
 // Breadcrumbs
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
 
81 81
 // Tool name
82 82
 if ($_GET['action'] == 'add') {
83
-	$tool_name = get_lang('AddQuestion');
83
+    $tool_name = get_lang('AddQuestion');
84 84
 }
85 85
 if ($_GET['action'] == 'edit') {
86
-	$tool_name = get_lang('EditQuestion');
86
+    $tool_name = get_lang('EditQuestion');
87 87
 }
88 88
 
89 89
 // The possible question types
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
 // Actions
104 104
 $actions = '<div class="actions">';
105 105
 $actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.intval($_GET['survey_id']).'">'.
106
-	Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
106
+    Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
107 107
 $actions .= '</div>';
108 108
 // Checking if it is a valid type
109 109
 if (!in_array($_GET['type'], $possible_types)) {
110
-	Display :: display_header($tool_name, 'Survey');
111
-	echo $actions;
112
-	Display :: display_error_message(get_lang('TypeDoesNotExist'), false);
113
-	Display :: display_footer();
110
+    Display :: display_header($tool_name, 'Survey');
111
+    echo $actions;
112
+    Display :: display_error_message(get_lang('TypeDoesNotExist'), false);
113
+    Display :: display_footer();
114 114
 }
115 115
 
116 116
 $error_message = '';
@@ -126,27 +126,27 @@  discard block
 block discarded – undo
126 126
 $formData['answers'] = array('', '');
127 127
 
128 128
 if ($_GET['type'] == 'yesno') {
129
-	$formData['answers'][0] = get_lang('Yes');
130
-	$formData['answers'][1] = get_lang('No');
129
+    $formData['answers'][0] = get_lang('Yes');
130
+    $formData['answers'][1] = get_lang('No');
131 131
 }
132 132
 
133 133
 if ($_GET['type'] == 'personality') {
134
-	$formData['answers'][0] = 1;
135
-	$formData['answers'][1] = 2;
136
-	$formData['answers'][2] = 3;
137
-	$formData['answers'][3] = 4;
138
-	$formData['answers'][4] = 5;
139
-
140
-	$formData['values'][0] = 0;
141
-	$formData['values'][1] = 0;
142
-	$formData['values'][2] = 1;
143
-	$formData['values'][3] = 2;
144
-	$formData['values'][4] = 3;
134
+    $formData['answers'][0] = 1;
135
+    $formData['answers'][1] = 2;
136
+    $formData['answers'][2] = 3;
137
+    $formData['answers'][3] = 4;
138
+    $formData['answers'][4] = 5;
139
+
140
+    $formData['values'][0] = 0;
141
+    $formData['values'][1] = 0;
142
+    $formData['values'][2] = 1;
143
+    $formData['values'][3] = 2;
144
+    $formData['values'][4] = 3;
145 145
 }
146 146
 
147 147
 // We are editing a question
148 148
 if (isset($_GET['question_id']) && !empty($_GET['question_id'])) {
149
-	$formData = SurveyManager::get_question($_GET['question_id']);
149
+    $formData = SurveyManager::get_question($_GET['question_id']);
150 150
 }
151 151
 
152 152
 $formData = $surveyQuestion->preSave($formData);
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 $surveyQuestion->renderForm();
156 156
 
157 157
 if ($surveyQuestion->getForm()->validate()) {
158
-	$values = $surveyQuestion->getForm()->getSubmitValues();
159
-	$surveyQuestion->save($surveyData, $values);
158
+    $values = $surveyQuestion->getForm()->getSubmitValues();
159
+    $surveyQuestion->save($surveyData, $values);
160 160
 }
161 161
 
162 162
 Display::display_header($tool_name, 'Survey');
Please login to merge, or discard this patch.