Completed
Pull Request — 1.11.x (#1285)
by José
66:28 queued 22:09
created
main/survey/preview.php 1 patch
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 // We exit here if there is no valid $_GET parameter
45 45
 if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])) {
46 46
     api_not_allowed(true, Display::return_message(get_lang('InvallidSurvey'), 'error', false));
47
-	exit;
47
+    exit;
48 48
 }
49 49
 
50 50
 // Getting the survey information
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 
54 54
 if (empty($survey_data)) {
55 55
     api_not_allowed(true, Display::return_message(get_lang('InvallidSurvey'), 'error', false));
56
-	exit;
56
+    exit;
57 57
 }
58 58
 
59 59
 $urlname = strip_tags($survey_data['title']);
60 60
 if (api_is_allowed_to_edit()) {
61
-	// Breadcrumbs
62
-	$interbreadcrumb[] = array(
61
+    // Breadcrumbs
62
+    $interbreadcrumb[] = array(
63 63
         'url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq(),
64 64
         'name' => get_lang('SurveyList')
65 65
     );
@@ -86,57 +86,57 @@  discard block
 block discarded – undo
86 86
 $counter_question = 0;
87 87
 // Only a course admin is allowed to preview a survey: you are a course admin
88 88
 if (api_is_course_admin() ||
89
-	(api_is_course_admin() && $_GET['isStudentView'] == 'true') ||
90
-	api_is_allowed_to_session_edit(false, true)
89
+    (api_is_course_admin() && $_GET['isStudentView'] == 'true') ||
90
+    api_is_allowed_to_session_edit(false, true)
91 91
 ) {
92
-	// Survey information
93
-	echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>';
94
-	echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>';
92
+    // Survey information
93
+    echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>';
94
+    echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>';
95 95
 
96
-	// Displaying the survey introduction
97
-	if (!isset($_GET['show'])) {
96
+    // Displaying the survey introduction
97
+    if (!isset($_GET['show'])) {
98 98
         if (!empty($survey_data['survey_introduction'])) {
99 99
             echo '<div id="survey_content" class="survey_content">'.$survey_data['survey_introduction'].'</div>';
100 100
         }
101
-		$limit = 0;
102
-	}
101
+        $limit = 0;
102
+    }
103 103
 
104
-	// Displaying the survey thanks message
105
-	if (isset($_POST['finish_survey'])) {
106
-		Display::display_confirmation_message(get_lang('SurveyFinished'));
104
+    // Displaying the survey thanks message
105
+    if (isset($_POST['finish_survey'])) {
106
+        Display::display_confirmation_message(get_lang('SurveyFinished'));
107 107
         echo $survey_data['survey_thanks'];
108
-		Display :: display_footer();
109
-		exit;
110
-	}
108
+        Display :: display_footer();
109
+        exit;
110
+    }
111 111
 
112 112
     $questions = array();
113 113
 
114
-	if (isset($_GET['show'])) {
115
-		// Getting all the questions for this page and add them to a
116
-		// multidimensional array where the first index is the page.
117
-		// as long as there is no pagebreak fount we keep adding questions to the page
118
-		$questions_displayed = array();
119
-		$paged_questions = array();
120
-		$counter = 0;
121
-		$sql = "SELECT * FROM $table_survey_question
114
+    if (isset($_GET['show'])) {
115
+        // Getting all the questions for this page and add them to a
116
+        // multidimensional array where the first index is the page.
117
+        // as long as there is no pagebreak fount we keep adding questions to the page
118
+        $questions_displayed = array();
119
+        $paged_questions = array();
120
+        $counter = 0;
121
+        $sql = "SELECT * FROM $table_survey_question
122 122
 		        WHERE c_id = $course_id AND survey_id = '".intval($survey_id)."'
123 123
 				ORDER BY sort ASC";
124
-		$result = Database::query($sql);
124
+        $result = Database::query($sql);
125 125
         $questions_exists = true;
126 126
         if (Database::num_rows($result)) {
127
-    		while ($row = Database::fetch_array($result)) {
128
-    			if ($row['type'] == 'pagebreak') {
129
-    				$counter++;
130
-    			} else {
131
-    				$paged_questions[$counter][] = $row['question_id'];
132
-    			}
133
-    		}
127
+            while ($row = Database::fetch_array($result)) {
128
+                if ($row['type'] == 'pagebreak') {
129
+                    $counter++;
130
+                } else {
131
+                    $paged_questions[$counter][] = $row['question_id'];
132
+                }
133
+            }
134 134
         } else {
135 135
             $questions_exists = false;
136 136
         }
137 137
 
138
-		if (array_key_exists($_GET['show'], $paged_questions)) {
139
-			$sql = "SELECT
138
+        if (array_key_exists($_GET['show'], $paged_questions)) {
139
+            $sql = "SELECT
140 140
                         survey_question.question_id,
141 141
                         survey_question.survey_id,
142 142
                         survey_question.survey_question,
@@ -158,75 +158,75 @@  discard block
 block discarded – undo
158 158
 						survey_question.c_id =  $course_id
159 159
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
160 160
 
161
-			$result = Database::query($sql);
162
-			$question_counter_max = Database::num_rows($result);
163
-			$limit = 0;
164
-			while ($row = Database::fetch_array($result)) {
165
-				// If the type is not a pagebreak we store it in the $questions array
166
-				if ($row['type'] != 'pagebreak') {
167
-					$questions[$row['sort']]['question_id'] = $row['question_id'];
168
-					$questions[$row['sort']]['survey_id'] = $row['survey_id'];
169
-					$questions[$row['sort']]['survey_question'] = $row['survey_question'];
170
-					$questions[$row['sort']]['display'] = $row['display'];
171
-					$questions[$row['sort']]['type'] = $row['type'];
172
-					$questions[$row['sort']]['options'][intval($row['option_sort'])] = $row['option_text'];
173
-					$questions[$row['sort']]['maximum_score'] = $row['max_value'];
174
-				} else {
175
-					// If the type is a pagebreak we are finished loading the questions for this page
176
-					break;
177
-				}
178
-				$counter_question++;
179
-			}
180
-		}
181
-	}
182
-
183
-	// Selecting the maximum number of pages
184
-	$sql = "SELECT * FROM $table_survey_question
161
+            $result = Database::query($sql);
162
+            $question_counter_max = Database::num_rows($result);
163
+            $limit = 0;
164
+            while ($row = Database::fetch_array($result)) {
165
+                // If the type is not a pagebreak we store it in the $questions array
166
+                if ($row['type'] != 'pagebreak') {
167
+                    $questions[$row['sort']]['question_id'] = $row['question_id'];
168
+                    $questions[$row['sort']]['survey_id'] = $row['survey_id'];
169
+                    $questions[$row['sort']]['survey_question'] = $row['survey_question'];
170
+                    $questions[$row['sort']]['display'] = $row['display'];
171
+                    $questions[$row['sort']]['type'] = $row['type'];
172
+                    $questions[$row['sort']]['options'][intval($row['option_sort'])] = $row['option_text'];
173
+                    $questions[$row['sort']]['maximum_score'] = $row['max_value'];
174
+                } else {
175
+                    // If the type is a pagebreak we are finished loading the questions for this page
176
+                    break;
177
+                }
178
+                $counter_question++;
179
+            }
180
+        }
181
+    }
182
+
183
+    // Selecting the maximum number of pages
184
+    $sql = "SELECT * FROM $table_survey_question
185 185
 	        WHERE
186 186
 	            c_id = $course_id AND
187 187
 	            type='".Database::escape_string('pagebreak')."' AND
188 188
 	            survey_id='".intval($survey_id)."'";
189
-	$result = Database::query($sql);
190
-	$numberofpages = Database::num_rows($result) + 1;
191
-
192
-	// Displaying the form with the questions
193
-	if (isset($_GET['show'])) {
194
-		$show = (int)$_GET['show'] + 1;
195
-	} else {
196
-		$show = 0;
197
-	}
198
-
199
-	$url = api_get_self().'?survey_id='.Security::remove_XSS($survey_id).'&show='.$show;
200
-	$form = new FormValidator('question', 'post', $url);
201
-
202
-	if (is_array($questions) && count($questions) > 0) {
203
-		foreach ($questions as $key => & $question) {
204
-			$ch_type = 'ch_'.$question['type'];
205
-			/** @var survey_question $display */
206
-			$display = new $ch_type;
207
-			$form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">');
208
-			$form->addHtml($question['survey_question']);
209
-			$display->render($form, $question);
210
-			$form->addHtml('</div></div>');
211
-		}
212
-	}
213
-
214
-	if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) {
189
+    $result = Database::query($sql);
190
+    $numberofpages = Database::num_rows($result) + 1;
191
+
192
+    // Displaying the form with the questions
193
+    if (isset($_GET['show'])) {
194
+        $show = (int)$_GET['show'] + 1;
195
+    } else {
196
+        $show = 0;
197
+    }
198
+
199
+    $url = api_get_self().'?survey_id='.Security::remove_XSS($survey_id).'&show='.$show;
200
+    $form = new FormValidator('question', 'post', $url);
201
+
202
+    if (is_array($questions) && count($questions) > 0) {
203
+        foreach ($questions as $key => & $question) {
204
+            $ch_type = 'ch_'.$question['type'];
205
+            /** @var survey_question $display */
206
+            $display = new $ch_type;
207
+            $form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">');
208
+            $form->addHtml($question['survey_question']);
209
+            $display->render($form, $question);
210
+            $form->addHtml('</div></div>');
211
+        }
212
+    }
213
+
214
+    if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) {
215 215
         if ($show == 0) {
216
-			$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
216
+            $form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
217 217
         } else {
218
-			$form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right');
218
+            $form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right');
219 219
         }
220
-	}
221
-	if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) {
222
-		if ($questions_exists == false) {
223
-			echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
224
-		}
225
-		$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
226
-	}
227
-	$form->display();
220
+    }
221
+    if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) {
222
+        if ($questions_exists == false) {
223
+            echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
224
+        }
225
+        $form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
226
+    }
227
+    $form->display();
228 228
 } else {
229
-	Display :: display_error_message(get_lang('NotAllowed'), false);
229
+    Display :: display_error_message(get_lang('NotAllowed'), false);
230 230
 }
231 231
 
232 232
 Display :: display_footer();
Please login to merge, or discard this patch.
src/Chamilo/TicketBundle/Entity/Ticket.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -94,12 +94,12 @@
 block discarded – undo
94 94
      */
95 95
     protected $assignedLastUser;
96 96
 
97
-     /**
98
-     * @var Status
99
-     *
100
-     * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Status")
101
-     * @ORM\JoinColumn(name="status_id", referencedColumnName="id")
102
-     **/
97
+        /**
98
+         * @var Status
99
+         *
100
+         * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Status")
101
+         * @ORM\JoinColumn(name="status_id", referencedColumnName="id")
102
+         **/
103 103
     protected $status;
104 104
 
105 105
     /**
Please login to merge, or discard this patch.
src/Chamilo/TicketBundle/Entity/MessageAttachment.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     protected $filename;
58 58
 
59
-   /**
59
+    /**
60 60
      * @var integer
61 61
      *
62 62
      * @ORM\Column(name="size", type="integer", nullable=false, unique=false)
Please login to merge, or discard this patch.
plugin/courseblock/CourseBlockPlugin.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
     // When creating a new course this settings are added to the course
12 12
     public $course_settings = array(
13
-         array(
13
+            array(
14 14
             'name' => 'course_block_pre_footer',
15 15
             'type' => 'textarea'
16 16
         ),
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     }
67 67
 
68 68
         /**
69
-     * @param string $region
70
-     * @return string
71
-     */
69
+         * @param string $region
70
+         * @return string
71
+         */
72 72
     public function renderRegion($region)
73 73
     {
74 74
         $content = '';
Please login to merge, or discard this patch.
src/Chamilo/TicketBundle/Entity/Message.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@
 block discarded – undo
53 53
      */
54 54
     protected $ipAddress;
55 55
 
56
-     /**
57
-     * @var Ticket
58
-     *
59
-     * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket")
60
-     * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
61
-     **/
56
+        /**
57
+         * @var Ticket
58
+         *
59
+         * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket")
60
+         * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
61
+         **/
62 62
     protected $ticket;
63 63
 
64 64
     /**
Please login to merge, or discard this patch.
main/ticket/assign_tickets.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
 api_protect_course_script();
12 12
 if (!api_is_allowed_to_edit()) {
13
-	api_not_allowed();
13
+    api_not_allowed();
14 14
 }
15 15
 $course_info = api_get_course_info();
16 16
 $course_code = $course_info['code'];
Please login to merge, or discard this patch.
main/ticket/new_ticket.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -563,7 +563,7 @@
 block discarded – undo
563 563
         $photo = '<img src="' . $userPicture. '" alt="' . api_get_person_name($user[2], $user[3]) . '" title="' . api_get_person_name($user[2], $user[3]) . '" />';
564 564
         $button = '<a  href="javascript:void(0)" onclick="load_course_list(\'div_' . $user_id . '\',' . $user_id . ', \'' . $user[5] . '\')">'
565 565
                     . Display::return_icon('view_more_stats.gif', get_lang('Info')) .
566
-                   '</a>&nbsp;&nbsp;';
566
+                    '</a>&nbsp;&nbsp;';
567 567
         $users[] = array(
568 568
             $photo,
569 569
             $user_id,
Please login to merge, or discard this patch.
main/ticket/ticket_details.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
     foreach ($admins as $admin) {
354 354
         $select_admins.= "<option value = '" . $admin['user_id'] . "' " . (($user_id == $admin['user_id']) ? ("selected='selected'") : '') . ">" .
355
-           $admin['complete_name'] . "</option>";
355
+            $admin['complete_name'] . "</option>";
356 356
     }
357 357
     $select_admins .= "</select>";
358 358
     echo '<div id="dialog-form" title="' . $plugin->get_lang('AssignTicket') . '" >';
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
         $form->addElement(
549 549
             'checkbox',
550 550
             'confirmation',
551
-             null,
551
+                null,
552 552
             $plugin->get_lang('RequestConfirmation')
553 553
         );
554 554
     }
Please login to merge, or discard this patch.
main/ticket/categories.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
         "categories.php?action=delete&id={$row['id']}"
102 102
     );
103 103
 
104
-	return $result;
104
+    return $result;
105 105
 }
106 106
 
107 107
 Display::display_header($plugin->get_lang('MyTickets'));
Please login to merge, or discard this patch.