Completed
Push — 1.10.x ( 8f997c...918380 )
by Yannick
259:37 queued 220:06
created
main/survey/link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 if (!SurveyManager::survey_generation_hash_available()) {
12 12
     api_not_allowed(true);
13 13
 }
14
-$course_info  = api_get_course_info_by_id($_REQUEST['c']);
14
+$course_info = api_get_course_info_by_id($_REQUEST['c']);
15 15
 
16 16
 $hash_is_valid = SurveyManager::validate_survey_hash(
17 17
     $survey_id,
Please login to merge, or discard this patch.
main/survey/ch_percentage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             $options[$key] = $value;
22 22
         }
23 23
 
24
-        $name = 'question' . $questionData['question_id'];
24
+        $name = 'question'.$questionData['question_id'];
25 25
 
26 26
         $form->addSelect(
27 27
             $name, null, $options
Please login to merge, or discard this patch.
main/survey/survey_question.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if ($surveyData['survey_type'] == 1) {
65 65
             $table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP);
66 66
             $sql = 'SELECT id,name FROM '.$table_survey_question_group.'
67
-                    WHERE survey_id = '.(int)$_GET['survey_id'].'
67
+                    WHERE survey_id = '.(int) $_GET['survey_id'].'
68 68
                     ORDER BY name';
69 69
             $rs = Database::query($sql);
70 70
             $glist = null;
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
             $grouplist = $grouplist1 = $grouplist2 = $glist;
76 76
 
77 77
             if (!empty($formData['assigned'])) {
78
-                $grouplist = str_replace('<option value="'.$formData['assigned'].'"','<option value="'.$formData['assigned'].'" selected',$glist);
78
+                $grouplist = str_replace('<option value="'.$formData['assigned'].'"', '<option value="'.$formData['assigned'].'" selected', $glist);
79 79
             }
80 80
 
81 81
             if (!empty($formData['assigned1'])) {
82
-                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"','<option value="'.$formData['assigned1'].'" selected',$glist);
82
+                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"', '<option value="'.$formData['assigned1'].'" selected', $glist);
83 83
             }
84 84
 
85 85
             if (!empty($formData['assigned2'])) {
86
-                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"','<option value="'.$formData['assigned2'].'" selected',$glist);
86
+                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"', '<option value="'.$formData['assigned2'].'" selected', $glist);
87 87
             }
88 88
 
89 89
             $this->html .= '	<tr><td colspan="">
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             $this->html .= '
97 97
 			<b>'.get_lang('Secondary').'</b><br />
98
-			'.'<input type="radio" name="choose" value="2" '.(($formData['choose']==2)?'checked':'').
98
+			'.'<input type="radio" name="choose" value="2" '.(($formData['choose'] == 2) ? 'checked' : '').
99 99
                 '><select name="assigned1">'.$grouplist1.'</select> '.
100 100
                 '<select name="assigned2">'.$grouplist2.'</select>'
101 101
                 .'</fieldset><br />';
Please login to merge, or discard this patch.
main/survey/copy_survey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 // Setting the global file that gets the general configuration, the databases, the languages, ...
8 8
 require_once '../inc/global.inc.php';
9
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
9
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
10 10
 api_protect_course_script(true);
11 11
 
12 12
 // Notice for unauthorized people.
Please login to merge, or discard this patch.
main/survey/preview.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // We exit here if there is no valid $_GET parameter
45
-if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])){
45
+if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])) {
46 46
 	Display::display_header(get_lang('SurveyPreview'));
47 47
 	Display::display_error_message(get_lang('InvallidSurvey'), false);
48 48
 	Display::display_footer();
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 						survey_question_option.c_id = $course_id
161 161
 					WHERE
162 162
 					    survey_question.survey_id = '".intval($survey_id)."' AND
163
-						survey_question.question_id IN (".Database::escape_string(implode(',',$paged_questions[$_GET['show']]), null, false).") AND
163
+						survey_question.question_id IN (".Database::escape_string(implode(',', $paged_questions[$_GET['show']]), null, false).") AND
164 164
 						survey_question.c_id =  $course_id
165 165
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
166 166
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
 	// Displaying the form with the questions
199 199
 	if (isset($_GET['show'])) {
200
-		$show = (int)$_GET['show'] + 1;
200
+		$show = (int) $_GET['show'] + 1;
201 201
 	} else {
202 202
 		$show = 0;
203 203
 	}
Please login to merge, or discard this patch.
main/survey/ch_score.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
             $options = array(
39 39
                 '--' => '--'
40 40
             );
41
-            for ($i=1; $i <= $questionData['maximum_score']; $i++) {
41
+            for ($i = 1; $i <= $questionData['maximum_score']; $i++) {
42 42
                 $options[$i] = $i;
43 43
             }
44 44
 
Please login to merge, or discard this patch.
main/survey/survey_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     if (api_is_allowed_to_edit()) {
76 76
         SurveyManager::copy_survey($_GET['survey_id']);
77 77
         $message = get_lang('SurveyCopied');
78
-        header('Location: ' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?' . api_get_cidreq());
78
+        header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq());
79 79
         exit;
80 80
     }
81 81
 }
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 if (!api_is_course_coach() || $extend_rights_for_coachs == 'true') {
163 163
     // Action links
164 164
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=add">'.
165
-        Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'),'',ICON_SIZE_MEDIUM).'</a> ';
165
+        Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'), '', ICON_SIZE_MEDIUM).'</a> ';
166 166
 }
167 167
 echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;search=advanced">'.
168
-    Display::return_icon('search.png', get_lang('Search'),'',ICON_SIZE_MEDIUM).'</a>';
168
+    Display::return_icon('search.png', get_lang('Search'), '', ICON_SIZE_MEDIUM).'</a>';
169 169
 echo '</div>';
170 170
 
171 171
 // Load main content
Please login to merge, or discard this patch.
main/survey/create_new_survey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@
 block discarded – undo
216 216
             foreach ($field_list as $key => & $field) {
217 217
                 if ($field['visibility'] == 1) {
218 218
                     $form->addElement('checkbox', 'profile_'.$key, ' ', '&nbsp;&nbsp;'.$field['name']);
219
-                    $input_name_list.= 'profile_'.$key.',';
219
+                    $input_name_list .= 'profile_'.$key.',';
220 220
                 }
221 221
             }
222 222
 
Please login to merge, or discard this patch.
main/session/session_course_user_list.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 $id_session = intval($_GET['id_session']);
19 19
 SessionManager::protectSession($id_session);
20 20
 
21
-if (empty($id_session )) {
21
+if (empty($id_session)) {
22 22
     api_not_allowed();
23 23
 }
24 24
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 
29 29
 $page           = isset($_GET['page']) ? intval($_GET['page']) : null;
30 30
 $action         = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
31
-$default_sort   = api_sort_by_first_name() ? 'firstname':'lastname';
32
-$sort           = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname','firstname','username')) ? $_GET['sort'] : $default_sort;
31
+$default_sort   = api_sort_by_first_name() ? 'firstname' : 'lastname';
32
+$sort           = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname', 'firstname', 'username')) ? $_GET['sort'] : $default_sort;
33 33
 $idChecked      = isset($_GET['idChecked']) && is_array($_GET['idChecked']) ? $_GET['idChecked'] : (isset($_POST['idChecked']) && is_array($_POST['idChecked']) ? $_POST['idChecked'] : null);
34
-$direction      = isset($_GET['direction']) && in_array($_GET['direction'], array('desc','asc')) ? $_GET['direction'] : 'desc';
34
+$direction      = isset($_GET['direction']) && in_array($_GET['direction'], array('desc', 'asc')) ? $_GET['direction'] : 'desc';
35 35
 
36 36
 if (is_array($idChecked)) {
37 37
     $my_temp = array();
38 38
     foreach ($idChecked as $id) {
39 39
         // forcing the intval
40
-        $my_temp[]= intval($id);
40
+        $my_temp[] = intval($id);
41 41
     }
42 42
     $idChecked = $my_temp;
43 43
 }
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 		WHERE src.session_id='$id_session' AND src.c_id='$courseId' ";
50 50
 
51 51
 $result = Database::query($sql);
52
-if (!list($session_name,$course_title) = Database::fetch_row($result)) {
52
+if (!list($session_name, $course_title) = Database::fetch_row($result)) {
53 53
 	header('Location: session_course_list.php?id_session='.$id_session);
54 54
 	exit();
55 55
 }
56 56
 
57 57
 switch ($action) {
58 58
     case 'delete':
59
-        if (is_array($idChecked) && count($idChecked)>0) {
59
+        if (is_array($idChecked) && count($idChecked) > 0) {
60 60
             array_map('intval', $idChecked);
61 61
             $idChecked = implode(',', $idChecked);
62 62
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
          ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = '".$courseId."' )
92 92
          WHERE s.session_id='$id_session'
93 93
          ORDER BY $sort $direction
94
-         LIMIT $from,".($limit+1);
94
+         LIMIT $from,".($limit + 1);
95 95
 
96 96
 if ($direction == 'desc') {
97 97
     $direction = 'asc';
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 $tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title;
108 108
 
109 109
 //$interbreadcrumb[] = array("url" => "index.php","name" => get_lang('PlatformAdmin'));
110
-$interbreadcrumb[] = array("url" => "session_list.php","name" => get_lang('SessionList'));
111
-$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview'));
110
+$interbreadcrumb[] = array("url" => "session_list.php", "name" => get_lang('SessionList'));
111
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview'));
112 112
 
113 113
 Display::display_header($tool_name);
114 114
 
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 <form method="post" action="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>" onsubmit="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
118 118
 <div align="right">
119 119
 <?php
120
-if($page) {
120
+if ($page) {
121 121
 ?>
122
-<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a>
122
+<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
123 123
 <?php
124 124
 } else {
125 125
 	echo get_lang('Previous');
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 ?>
128 128
 |
129 129
 <?php
130
-if($nbr_results > $limit) {
130
+if ($nbr_results > $limit) {
131 131
 ?>
132
-<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a>
132
+<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
133 133
 <?php
134 134
 } else {
135 135
 	echo get_lang('Next');
@@ -141,39 +141,39 @@  discard block
 block discarded – undo
141 141
 <tr>
142 142
   <th>&nbsp;</th>
143 143
   <?php if ($is_western_name_order) { ?>
144
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th>
145
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th>
144
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th>
145
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th>
146 146
   <?php } else { ?>
147
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th>
148
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th>
147
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th>
148
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th>
149 149
   <?php } ?>
150
-  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login');?></a></th>
151
-  <th><?php echo get_lang('Actions');?></th>
150
+  <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login'); ?></a></th>
151
+  <th><?php echo get_lang('Actions'); ?></th>
152 152
 </tr>
153 153
 <?php
154
-$i=0;
154
+$i = 0;
155 155
 foreach ($users as $key => $enreg) {
156 156
 
157 157
 	if ($key == $limit) {
158 158
 		break;
159 159
 	}
160 160
     ?>
161
-    <tr class="<?php echo $i?'row_odd':'row_even'; ?>">
161
+    <tr class="<?php echo $i ? 'row_odd' : 'row_even'; ?>">
162 162
         <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>
163 163
         <?php if ($is_western_name_order) { ?>
164
-        <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
165
-        <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
164
+        <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
165
+        <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
166 166
         <?php } else { ?>
167
-        <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
168
-        <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
167
+        <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
168
+        <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
169 169
         <?php } ?>
170
-        <td><?php echo api_htmlentities($enreg['username'],ENT_QUOTES,$charset); ?></td>
170
+        <td><?php echo api_htmlentities($enreg['username'], ENT_QUOTES, $charset); ?></td>
171 171
         <td>
172 172
         <?php if ($enreg['is_subscribed']) { ?>
173 173
             <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=delete&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
174 174
                 <?php Display::display_icon('delete.png', get_lang('Delete')); ?>
175 175
             </a>
176
-        <?php } else  { ?>
176
+        <?php } else { ?>
177 177
             <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=add&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
178 178
                 <?php Display::display_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL); ?>
179 179
             </a>
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         </td>
183 183
     </tr>
184 184
     <?php
185
-        $i=$i ? 0 : 1;
185
+        $i = $i ? 0 : 1;
186 186
 }
187 187
 unset($users);
188 188
 ?>
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 <br />
191 191
 <div align="left">
192 192
     <?php
193
-    if($page) {
193
+    if ($page) {
194 194
     ?>
195
-    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
195
+    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a>
196 196
     <?php
197 197
     } else {
198 198
         echo get_lang('Previous');
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
     ?>
201 201
     |
202 202
     <?php
203
-    if($nbr_results > $limit) {
203
+    if ($nbr_results > $limit) {
204 204
     ?>
205
-    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
205
+    <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a>
206 206
     <?php
207 207
     } else {
208 208
         echo get_lang('Next');
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 </div>
212 212
 <br />
213 213
 <select name="action">
214
-<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession');?></option>
215
-<option value="add"><?php echo get_lang('AddUsers');?></option>
214
+<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession'); ?></option>
215
+<option value="add"><?php echo get_lang('AddUsers'); ?></option>
216 216
 </select>
217 217
 <button class="save" type="submit"> <?php echo get_lang('Ok'); ?></button>
218 218
 </form>
Please login to merge, or discard this patch.