Completed
Push — 1.11.x ( 3ca1af...7f27ad )
by José
93:15 queued 54:45
created
main/admin/settings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     Display::addFlash(Display::return_message(get_lang('FileDeleted')));
60 60
 }
61 61
 
62
-if (isset($_GET['action']) &&  $_GET['action'] == 'delete_grading') {
62
+if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') {
63 63
     $id = intval($_GET['id']);
64 64
     api_delete_setting_option($id);
65 65
 }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         }
123 123
     }
124 124
 
125
-    if (isset($category) && $category== 'search_setting') {
125
+    if (isset($category) && $category == 'search_setting') {
126 126
         if (!empty($_REQUEST['search_field'])) {
127 127
             $settings = search_setting($_REQUEST['search_field']);
128 128
         }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         // Set true for allow_message_tool variable if social tool is actived
221 221
         foreach ($convert_byte_to_mega_list as $item) {
222 222
             if (isset($values[$item])) {
223
-                $values[$item] = round($values[$item]*1024*1024);
223
+                $values[$item] = round($values[$item] * 1024 * 1024);
224 224
             }
225 225
         }
226 226
 
Please login to merge, or discard this patch.
main/admin/career_dashboard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 $htmlHeadXtra[] = api_get_jqgrid_js();
19 19
 
20 20
 // setting breadcrumbs
21
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
22
-$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
21
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
22
+$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
23 23
 
24 24
 Display :: display_header(null);
25 25
 
26
-$form = new FormValidator('filter_form','GET', api_get_self());
26
+$form = new FormValidator('filter_form', 'GET', api_get_self());
27 27
 
28 28
 $career = new Career();
29 29
 
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 // action links
55 55
 echo '<div class="actions" style="margin-bottom:20px">';
56 56
     echo  '<a href="../admin/index.php">'.
57
-            Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>';
57
+            Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>';
58 58
     echo '<a href="careers.php">'.
59
-            Display::return_icon('career.png',get_lang('Careers'),'',ICON_SIZE_MEDIUM).'</a>';
59
+            Display::return_icon('career.png', get_lang('Careers'), '', ICON_SIZE_MEDIUM).'</a>';
60 60
     echo '<a href="promotions.php">'.
61
-            Display::return_icon('promotion.png',get_lang('Promotions'),'',ICON_SIZE_MEDIUM).'</a>';
61
+            Display::return_icon('promotion.png', get_lang('Promotions'), '', ICON_SIZE_MEDIUM).'</a>';
62 62
 echo '</div>';
63 63
 
64 64
 $form->display();
@@ -119,22 +119,22 @@  discard block
 block discarded – undo
119 119
     foreach ($career_array as $career_id => $data) {
120 120
         $career = $data['name'];
121 121
         $promotions = $data['promotions'];
122
-        $career = Display::url($career, 'careers.php?action=edit&id=' . $career_id);
122
+        $career = Display::url($career, 'careers.php?action=edit&id='.$career_id);
123 123
         $career = Display::tag('h4', $career);
124
-        echo '<tr><td style="background-color:#ECF0F1" colspan="3">' . $career . '</td></tr>';
124
+        echo '<tr><td style="background-color:#ECF0F1" colspan="3">'.$career.'</td></tr>';
125 125
         if (!empty($promotions)) {
126 126
             foreach ($promotions as $promotion_id => $promotion) {
127 127
                 $promotion_name = $promotion['name'];
128
-                $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id=' . $promotion_id);
128
+                $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id='.$promotion_id);
129 129
                 $sessions = $promotion['sessions'];
130 130
                 echo '<tr>';
131 131
                 $count = count($sessions);
132 132
                 $rowspan = '';
133 133
                 if (!empty($count)) {
134 134
                     $count++;
135
-                    $rowspan = 'rowspan="' . $count . '"';
135
+                    $rowspan = 'rowspan="'.$count.'"';
136 136
                 }
137
-                echo '<td ' . $rowspan . '>';
137
+                echo '<td '.$rowspan.'>';
138 138
                 echo Display::tag('h5', $promotion_url);
139 139
                 echo '</td>';
140 140
                 echo '</tr>';
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                         $course_list = $session['courses'];
145 145
 
146 146
                         $url = Display::url($session['data']['name'],
147
-                            '../session/resume_session.php?id_session=' . $session['data']['id']);
147
+                            '../session/resume_session.php?id_session='.$session['data']['id']);
148 148
                         echo '<tr>';
149 149
                         //Session name
150 150
                         echo Display::tag('td', $url);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
                                 $url = Display::url(
159 159
                                     $course['title'],
160
-                                    api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . $session['data']['id']
160
+                                    api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.$session['data']['id']
161 161
                                 );
162 162
                                 echo Display::tag('td', $url);
163 163
                                 echo '</tr>';
Please login to merge, or discard this patch.
main/admin/access_url_check_user_session.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,18 +15,18 @@  discard block
 block discarded – undo
15 15
 
16 16
 $tool_name = get_lang('SessionOverview');
17 17
 
18
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
19
-$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
20 20
 
21 21
 // Database Table Definitions
22
-$tbl_user							= Database::get_main_table(TABLE_MAIN_USER);
23
-$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER);
22
+$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
23
+$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
24 24
 $table_access_url_user              = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
25 25
 $url_id                             = api_get_current_access_url_id();
26 26
 
27 27
 $action = $_GET['action'];
28 28
 
29
-switch($action) {
29
+switch ($action) {
30 30
     case 'add_user_to_url':
31 31
         $user_id = $_REQUEST['user_id'];
32 32
         $result = UrlManager::add_user_to_url($user_id, $url_id);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 }
59 59
 
60 60
 
61
-foreach($session_list  as $session_item) {
61
+foreach ($session_list  as $session_item) {
62 62
     $session_id = $session_item['id'];
63 63
     $html .= '<h3>'.$session_item['name'].'</h3>';
64 64
 
Please login to merge, or discard this patch.
main/admin/access_url_edit_courses_to_url.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 $interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
36 36
 
37 37
 $add_type = 'multiple';
38
-if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
38
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
39 39
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
40 40
 }
41 41
 
42 42
 $access_url_id = 1;
43
-if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') {
43
+if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
44 44
 	$access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
45 45
 }
46 46
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 
93 93
 	if ($form_sent == 1) {
94
-		if ($access_url_id==0) {
94
+		if ($access_url_id == 0) {
95 95
 			header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
96 96
 		} elseif (is_array($course_list)) {
97 97
 			UrlManager::update_urls_rel_course($course_list, $access_url_id);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 Display::display_header($tool_name);
104 104
 
105 105
 echo '<div class="actions">';
106
-echo Display::url( Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'),''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php');
106
+echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php');
107 107
 echo '</div>';
108 108
 
109 109
 api_display_tool_title($tool_name);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 $no_course_list = $course_list = array();
115 115
 $ajax_search = $add_type == 'unique' ? true : false;
116 116
 
117
-if($ajax_search) {
117
+if ($ajax_search) {
118 118
 	$courses = UrlManager::get_url_rel_course_data($access_url_id);
119 119
 	foreach ($courses as $course) {
120 120
 		$course_list[$course['c_id']] = $course;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	}
130 130
 
131 131
 	$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
132
-	$sql="SELECT id, code, title
132
+	$sql = "SELECT id, code, title
133 133
 	  	  	FROM $tbl_course u
134 134
 			ORDER BY title, code";
135 135
 	$result = Database::query($sql);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 }
144 144
 
145
-if($add_type == 'multiple') {
145
+if ($add_type == 'multiple') {
146 146
 	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
147 147
 	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
148 148
 } else {
@@ -155,23 +155,23 @@  discard block
 block discarded – undo
155 155
 		<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
156 156
 	</div>
157 157
 	<br /><br />
158
-	<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?> >
158
+	<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?> >
159 159
 		<?php echo get_lang('SelectUrl').' : '; ?>
160 160
 		<select name="access_url_id" onchange="javascript:send();">
161 161
 			<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
162 162
 			<?php
163
-			$url_selected='';
163
+			$url_selected = '';
164 164
 			foreach ($url_list as $url_obj) {
165 165
 				$checked = '';
166 166
 				if (!empty($access_url_id)) {
167
-					if ($url_obj[0]==$access_url_id) {
167
+					if ($url_obj[0] == $access_url_id) {
168 168
 						$checked = 'selected=true';
169
-						$url_selected=$url_obj[1];
169
+						$url_selected = $url_obj[1];
170 170
 					}
171 171
 				}
172
-				if ($url_obj['active']==1) {
172
+				if ($url_obj['active'] == 1) {
173 173
 					?>
174
-					<option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option>
174
+					<option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option>
175 175
 				<?php
176 176
 				}
177 177
 			}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		<input type="hidden" name="form_sent" value="1" />
182 182
 		<input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
183 183
 		<?php
184
-		if(!empty($errorMsg)) {
184
+		if (!empty($errorMsg)) {
185 185
 			Display::display_normal_message($errorMsg); //main API
186 186
 		}
187 187
 		?>
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 				<td align="center">
200 200
 					<div id="content_source">
201 201
 						<?php
202
-						if($ajax_search) {
202
+						if ($ajax_search) {
203 203
 							?>
204 204
 							<input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" />
205 205
 							<div id="ajax_list_courses"></div>
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 							?>
209 209
 							<select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;">
210 210
 								<?php
211
-								foreach($no_course_list as $no_course) {
211
+								foreach ($no_course_list as $no_course) {
212 212
 									?>
213 213
 									<option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option>
214 214
 								<?php
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 				</td>
224 224
 				<td width="10%" valign="middle" align="center">
225 225
 					<?php
226
-					if($ajax_search) {
226
+					if ($ajax_search) {
227 227
 						?>
228 228
 						<button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" >
229 229
                             <em class="fa fa-arrow-left"></em>
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				<td align="center">
247 247
 					<select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
248 248
 						<?php
249
-						foreach($course_list as $course) {
249
+						foreach ($course_list as $course) {
250 250
 							$courseInfo = api_get_course_info_by_id($course['id']);
251 251
 							?>
252 252
 							<option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option>
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 				<td colspan="3" align="center">
262 262
 					<br />
263 263
 					<?php
264
-					if(isset($_GET['add']))
264
+					if (isset($_GET['add']))
265 265
 						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
266 266
 					else
267 267
 						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
Please login to merge, or discard this patch.
main/admin/archive_cleanup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 api_protect_admin_script(true);
17 17
 
18 18
 // setting breadcrumbs
19
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
19
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
20 20
 
21 21
 $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX);
22 22
 $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton'));
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 if (isset($_GET['msg']) && isset($_GET['type'])) {
52 52
 	if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed')))
53
-	switch($_GET['type']) {
53
+	switch ($_GET['type']) {
54 54
 		case 'error':
55 55
 			$message = Display::return_message(get_lang($_GET['msg']), 'error');
56 56
 			break;
Please login to merge, or discard this patch.
main/admin/course_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@
 block discarded – undo
12 12
  */
13 13
 function validate_data($courses)
14 14
 {
15
-    $errors = array ();
16
-    $coursecodes = array ();
15
+    $errors = array();
16
+    $coursecodes = array();
17 17
     foreach ($courses as $index => $course) {
18
-        $course['line'] = $index +1;
18
+        $course['line'] = $index + 1;
19 19
 
20 20
         // 1. Check whether mandatory fields are set.
21
-        $mandatory_fields = array ('Code', 'Title', 'CourseCategory');
21
+        $mandatory_fields = array('Code', 'Title', 'CourseCategory');
22 22
         foreach ($mandatory_fields as $field) {
23 23
             if (!isset($course[$field]) || strlen($course[$field]) == 0) {
24 24
                 $course['error'] = get_lang($field.'Mandatory');
Please login to merge, or discard this patch.
main/admin/teacher_time_report.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@
 block discarded – undo
295 295
 if (isset($_GET['export'])) {
296 296
     $dataToExport = $timeReport->prepareDataToExport($withFilter);
297 297
 
298
-    $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time();
298
+    $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time();
299 299
 
300 300
     switch ($_GET['export']) {
301 301
         case 'pdf':
Please login to merge, or discard this patch.
main/admin/skills_gradebook.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 // setting breadcrumbs
26 26
 
27 27
 $tool_name = get_lang('SkillsAndGradebooks');
28
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
28
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
29 29
 if ($action == 'add_skill') {
30
-    $interbreadcrumb[]=array('url' => 'skills_gradebook.php','name' => get_lang('SkillsAndGradebooks'));
30
+    $interbreadcrumb[] = array('url' => 'skills_gradebook.php', 'name' => get_lang('SkillsAndGradebooks'));
31 31
     $tool_name = get_lang('Add');
32 32
 }
33 33
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 //Column config
48 48
 $column_model   = array(
49
-                        array('name'=>'name',           'index'=>'name',        'width'=>'150', 'align'=>'left'),
50
-                        array('name'=>'certificate',    'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51
-                        array('name'=>'skills',         'index'=>'skills',      'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52
-                        array('name'=>'actions',        'index'=>'actions',     'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false')
49
+                        array('name'=>'name', 'index'=>'name', 'width'=>'150', 'align'=>'left'),
50
+                        array('name'=>'certificate', 'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51
+                        array('name'=>'skills', 'index'=>'skills', 'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52
+                        array('name'=>'actions', 'index'=>'actions', 'width'=>'30', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false')
53 53
                        );
54 54
 //Autowidth
55 55
 $extra_params['autowidth'] = 'true';
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
61 61
                         //certificates
62 62
                         if (rowObject[4] == 1) {
63
-                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'),'',ICON_SIZE_SMALL).'</a>'.'\';
63
+                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\';
64 64
                         } else {
65
-                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'),'',ICON_SIZE_SMALL).''.'\';
65
+                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\';
66 66
                         }
67 67
                  }';
68 68
 ?>
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 $(function() {
71 71
 <?php
72 72
     // grid definition see the $career->display() function
73
-    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links,true);
73
+    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
74 74
 ?>
75 75
 });
76 76
 </script>
77 77
 <?php
78 78
 $gradebook = new Gradebook();
79 79
 
80
-switch($action) {
80
+switch ($action) {
81 81
     case 'display':
82 82
         $gradebook->display();
83 83
         break;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
86 86
         $gradebook_info = $gradebook->get($id);
87 87
         $url  = api_get_self().'?action='.$action.'&id='.$id;
88
-        $form =  $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
88
+        $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
89 89
         if ($form->validate()) {
90 90
             $values = $form->exportValues();
91 91
             $res    = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']);
Please login to merge, or discard this patch.
main/admin/add_sessions_to_promotion.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 require_once '../inc/global.inc.php';
11 11
 
12 12
 $xajax = new xajax();
13
-$xajax->registerFunction ('search_sessions');
13
+$xajax->registerFunction('search_sessions');
14 14
 
15 15
 // setting the section (for the tabs)
16 16
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 api_protect_admin_script(true);
20 20
 
21 21
 // setting breadcrumbs
22
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
23
-$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
22
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
23
+$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
24 24
 
25 25
 // Setting the name of the tool
26 26
 $tool_name = get_lang('SubscribeSessionsToPromotions');
27 27
 $add_type = 'multiple';
28
-if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
28
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
29 29
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
30 30
 }
31 31
 
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 
68 68
 $form_sent  = 0;
69 69
 $errorMsg   = '';
70
-$users      =$sessions=array();
70
+$users      = $sessions = array();
71 71
 $promotion = new Promotion();
72 72
 $id = intval($_GET['id']);
73 73
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
74 74
     $form_sent = $_POST['form_sent'];
75 75
     $session_in_promotion_posted = $_POST['session_in_promotion_name'];
76 76
     if (!is_array($session_in_promotion_posted)) {
77
-        $session_in_promotion_posted=array();
77
+        $session_in_promotion_posted = array();
78 78
     }
79 79
     if ($form_sent == 1) {
80 80
         // Added a parameter to send emails when registering a user
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 $promotion_data = $promotion->get($id);
88 88
 $session_list = SessionManager::get_sessions_list(array(), array('name'));
89
-$session_not_in_promotion = $session_in_promotion= array();
89
+$session_not_in_promotion = $session_in_promotion = array();
90 90
 
91 91
 if (!empty($session_list)) {
92 92
     foreach ($session_list as $session) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             }
123 123
         }
124 124
         $return .= '</select>';
125
-        $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
125
+        $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
126 126
     }
127 127
 
128 128
     return $xajax_response;
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 }
141 141
 
142 142
 echo '<div class="actions">';
143
-echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
143
+echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
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'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
148 148
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 149
 
150
-if ($add_type=='multiple') {
150
+if ($add_type == 'multiple') {
151 151
     if (is_array($extra_field_list)) {
152 152
         if (is_array($new_field_list) && count($new_field_list) > 0) {
153 153
             echo '<h3>'.get_lang('FilterUsers').'</h3>';
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                 echo '&nbsp;<select name="'.$varname.'">';
158 158
                 echo '<option value="0">--'.get_lang('Select').'--</option>';
159 159
                 foreach ($new_field['data'] as $option) {
160
-                    $checked='';
160
+                    $checked = '';
161 161
                     if (isset($_POST[$varname])) {
162
-                        if ($_POST[$varname]==$option[1]) {
162
+                        if ($_POST[$varname] == $option[1]) {
163 163
                             $checked = 'selected="true"';
164 164
                         }
165 165
                     }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
   <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td>
190 190
 </tr>
191 191
 
192
-<?php if ($add_type=='multiple') { ?>
192
+<?php if ($add_type == 'multiple') { ?>
193 193
 <tr>
194 194
 <td align="center">
195 195
 <?php echo get_lang('FirstLetterSessions'); ?> :
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
   <td align="center">
208 208
   <div id="content_source">
209 209
       <?php
210
-      if (!($add_type=='multiple')) {
210
+      if (!($add_type == 'multiple')) {
211 211
         ?>
212 212
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
213 213
         <div id="ajax_list_users_single"></div>
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
       } else {
216 216
       ?>
217 217
       <div id="ajax_list_multiple">
218
-        <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?>
218
+        <?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_not_in_promotion', 'size'=>'15px'), false); ?>
219 219
       </div>
220 220
     <?php
221 221
       }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         'session_in_promotion_name[]',
251 251
         $session_in_promotion,
252 252
         '',
253
-        array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'),
253
+        array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'),
254 254
         false
255 255
     );
256 256
     unset($sessionUsersList);
Please login to merge, or discard this patch.