Passed
Push — 1.10.x ( 0d2152...84a3c1 )
by
unknown
160:16 queued 107:33
created
main/inc/lib/search/tool_processors/quiz_processor.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 /**
9 9
  * Code
10 10
  */
11
-include_once dirname(__FILE__) . '/../../../global.inc.php';
12
-require_once dirname(__FILE__) . '/search_processor.class.php';
11
+include_once dirname(__FILE__).'/../../../global.inc.php';
12
+require_once dirname(__FILE__).'/search_processor.class.php';
13 13
 
14 14
 /**
15 15
  * Process exercises before pass it to search listing scripts
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                     $visibility = api_get_item_visibility(api_get_course_info($courseid), TOOL_QUIZ, $exercise_id);
71 71
                     if ($visibility) {
72 72
                         list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $exercise_id);
73
-                        $url = api_get_path(WEB_PATH) . 'main/exercice/exercise_submit.php?cidReq=%s&exerciseId=%s';
73
+                        $url = api_get_path(WEB_PATH).'main/exercice/exercise_submit.php?cidReq=%s&exerciseId=%s';
74 74
                         $url = sprintf($url, $courseid, $exercise_id);
75 75
                         $result = array(
76 76
                             'toolid' => TOOL_QUIZ,
Please login to merge, or discard this patch.
plugin/ticket/src/ticket.class.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public static function get_all_tickets_status()
43 43
     {
44 44
         $table_support_status = Database::get_main_table(TABLE_TICKET_STATUS);
45
-        $sql = "SELECT * FROM " . $table_support_status;
45
+        $sql = "SELECT * FROM ".$table_support_status;
46 46
         $result = Database::query($sql);
47 47
         $types = array();
48 48
         while ($row = Database::fetch_assoc($result)) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         }
158 158
 
159 159
         if ($ticket_id != 0) {
160
-            $ticket_code = "A" . str_pad(
160
+            $ticket_code = "A".str_pad(
161 161
                 (int) $ticket_id, 11, "0", STR_PAD_LEFT
162 162
             );
163 163
             $sql_update_code = "UPDATE $table_support_tickets
@@ -175,24 +175,24 @@  discard block
 block discarded – undo
175 175
                     $user = api_get_user_info($request_user);
176 176
                     $helpDeskMessage = '<table>
177 177
                                             <tr>
178
-                                                <td width="100px"><b>' . get_lang('User') . '</b></td>
179
-                                                <td width="400px">' . $user['firstname']. ' ' . $user['lastname'] . '</td>
178
+                                                <td width="100px"><b>' . get_lang('User').'</b></td>
179
+                                                <td width="400px">' . $user['firstname'].' '.$user['lastname'].'</td>
180 180
                                             </tr>
181 181
                                             <tr>
182
-                                                <td width="100px"><b>' . get_lang('Username') . '</b></td>
183
-                                                <td width="400px">' . $user['username'] . '</td>
182
+                                                <td width="100px"><b>' . get_lang('Username').'</b></td>
183
+                                                <td width="400px">' . $user['username'].'</td>
184 184
                                             </tr>
185 185
                                             <tr>
186
-                                                <td width="100px"><b>' . get_lang('Date') . '</b></td>
187
-                                                <td width="400px">' . api_convert_and_format_date($now, DATE_TIME_FORMAT_LONG) . '</td>
186
+                                                <td width="100px"><b>' . get_lang('Date').'</b></td>
187
+                                                <td width="400px">' . api_convert_and_format_date($now, DATE_TIME_FORMAT_LONG).'</td>
188 188
                                             </tr>
189 189
                                             <tr>
190
-                                                <td width="100px"><b>' . get_lang('Topic') . '</b></td>
191
-                                                <td width="400px">' . $subject . '</td>
190
+                                                <td width="100px"><b>' . get_lang('Topic').'</b></td>
191
+                                                <td width="400px">' . $subject.'</td>
192 192
                                             </tr>
193 193
                                             <tr>
194
-                                                <td width="100px"><b>' . get_lang('Description') . '</b></td>
195
-                                                <td width="400px">' . $content . '</td>
194
+                                                <td width="100px"><b>' . get_lang('Description').'</b></td>
195
+                                                <td width="400px">' . $content.'</td>
196 196
                                             </tr>
197 197
                                         </table>';
198 198
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
             if ($insert_id != $user_id) {
275 275
                 $info = api_get_user_info($user_id);
276 276
                 $sender = api_get_user_info($insert_id);
277
-                $href = api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/src/ticket_details.php?ticket_id=' . $ticket_id;
277
+                $href = api_get_path(WEB_PLUGIN_PATH).PLUGIN_NAME.'/src/ticket_details.php?ticket_id='.$ticket_id;
278 278
                 $message = sprintf($plugin->get_lang('TicketAssignedMsg'), $info['complete_name'], $href, $ticket_id);
279 279
                 $mailTitle = sprintf($plugin->get_lang('TicketAssignX'), $ticket_id);
280 280
                 api_mail_html(
@@ -319,10 +319,10 @@  discard block
 block discarded – undo
319 319
         $table_support_tickets = Database::get_main_table(TABLE_TICKET_TICKET);
320 320
         $table_support_message_attachments = Database::get_main_table(TABLE_TICKET_MESSAGE_ATTACHMENTS);
321 321
         if ($sendConfirmation) {
322
-            $form = '<form action="ticket_details.php?ticket_id=' . $ticket_id . '" id="confirmticket" method="POST" >
323
-                         <p>' . $plugin->get_lang('TicketWasThisAnswerSatisfying') . '</p>
324
-                         <button name="response" id="responseyes" value="1">' . get_lang('Yes') . '</button>
325
-                         <button name="response" id="responseno" value="0">' . get_lang('No') . '</button>
322
+            $form = '<form action="ticket_details.php?ticket_id='.$ticket_id.'" id="confirmticket" method="POST" >
323
+                         <p>' . $plugin->get_lang('TicketWasThisAnswerSatisfying').'</p>
324
+                         <button name="response" id="responseyes" value="1">' . get_lang('Yes').'</button>
325
+                         <button name="response" id="responseno" value="0">' . get_lang('No').'</button>
326 326
                      </form>';
327 327
             $content .= $form;
328 328
             Database::query(
@@ -353,11 +353,11 @@  discard block
 block discarded – undo
353 353
             '$message_id',
354 354
             '$subject',
355 355
             '$content',
356
-            '" . Database::escape_string($_SERVER['REMOTE_ADDR']) . "',
356
+            '".Database::escape_string($_SERVER['REMOTE_ADDR'])."',
357 357
             '$user_id',
358
-            '" . $now . "',
358
+            '".$now."',
359 359
             '$user_id',
360
-            '" . $now . "',
360
+            '".$now."',
361 361
             '$status'
362 362
         )";
363 363
         Database::query($sql_insert_message);
@@ -428,11 +428,11 @@  discard block
 block discarded – undo
428 428
         } else {
429 429
             $new_file_name = uniqid('');
430 430
             $path_attachment = api_get_path(SYS_ARCHIVE_PATH);
431
-            $path_message_attach = $path_attachment . 'plugin_ticket_messageattch/';
431
+            $path_message_attach = $path_attachment.'plugin_ticket_messageattch/';
432 432
             if (!file_exists($path_message_attach)) {
433 433
                 @mkdir($path_message_attach, api_get_permissions_for_new_directories(), true);
434 434
             }
435
-            $new_path = $path_message_attach . $new_file_name;
435
+            $new_path = $path_message_attach.$new_file_name;
436 436
             if (is_uploaded_file($file_attach['tmp_name'])) {
437 437
                 @copy($file_attach['tmp_name'], $new_path);
438 438
             }
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
                     '$ticket_id',
456 456
                     '$message_id',
457 457
                     '$message_attch_id',
458
-                    '" . $file_attach['size'] . "',
458
+                    '".$file_attach['size']."',
459 459
                     '$user_id',
460 460
                     '$now',
461 461
                     '$user_id',
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
             Database::query($sql);
465 465
 
466 466
             return array(
467
-                'path' => $path_message_attach . $safe_new_file_name,
467
+                'path' => $path_message_attach.$safe_new_file_name,
468 468
                 'filename' => $safe_file_name
469 469
             );
470 470
         }
@@ -689,14 +689,14 @@  discard block
 block discarded – undo
689 689
             $result_unread = Database::query($sql_unread);
690 690
             $unread = Database::fetch_object($result_unread)->unread;
691 691
             $userInfo = api_get_user_info($row['user_id']);
692
-            $hrefUser = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
692
+            $hrefUser = $webPath.'main/admin/user_information.php?user_id='.$row['user_id'];
693 693
             $name = "<a href='$hrefUser'> {$userInfo['username']} </a>";
694 694
             $actions = "";
695 695
 
696 696
             if ($row['responsible'] != 0) {
697 697
                 $row['responsible'] = api_get_user_info($row['responsible']);
698 698
                 if (!empty($row['responsible'])) {
699
-                    $hrefResp = $webPath . 'main/admin/user_information.php?user_id=' . $row['responsible']['user_id'];
699
+                    $hrefResp = $webPath.'main/admin/user_information.php?user_id='.$row['responsible']['user_id'];
700 700
                     $row['responsible'] = "<a href='$hrefResp'> {$row['responsible']['username']} </a>";
701 701
                 } else {
702 702
                     $row['responsible'] = get_lang('UnknownUser');
@@ -704,9 +704,9 @@  discard block
 block discarded – undo
704 704
 
705 705
             } else {
706 706
                 if ($row['status_id'] != 'REE') {
707
-                    $row['responsible'] = '<span style="color:#ff0000;">' . $plugin->get_lang('ToBeAssigned') . '</span>';
707
+                    $row['responsible'] = '<span style="color:#ff0000;">'.$plugin->get_lang('ToBeAssigned').'</span>';
708 708
                 } else {
709
-                    $row['responsible'] = '<span style="color:#00ff00;">' . get_lang('MessageResent') . '</span>';
709
+                    $row['responsible'] = '<span style="color:#00ff00;">'.get_lang('MessageResent').'</span>';
710 710
                 }
711 711
             }
712 712
 
@@ -727,17 +727,17 @@  discard block
 block discarded – undo
727 727
             $row['col1'] = api_get_local_time($row['col1']);
728 728
             $row['col2'] = api_get_local_time($row['col2']);
729 729
             if ($isAdmin) {
730
-                $actions .= '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . Display::return_icon(
730
+                $actions .= '<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.Display::return_icon(
731 731
                                 'synthese_view.gif', get_lang('Info')
732
-                        ) . '</a>&nbsp;&nbsp;';
732
+                        ).'</a>&nbsp;&nbsp;';
733 733
                 if ($row['priority_id'] == 'HGH' && $row['status_id'] != 'CLS') {
734
-                    $actions .= '<img src="' . $webCodePath . 'img/exclamation.png" border="0" />';
734
+                    $actions .= '<img src="'.$webCodePath.'img/exclamation.png" border="0" />';
735 735
                 }
736 736
                 $row['col0'] = Display::return_icon(
737 737
                                 $img_source, get_lang('Info')
738
-                        ) . '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . $row['ticket_code'] . '</a>';
738
+                        ).'<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.$row['ticket_code'].'</a>';
739 739
                 if ($row['col7'] == 'PENDIENTE') {
740
-                    $row['col7'] = '<span style="color: #f00; font-weight:bold;">' . $row['col7'] . '</span>';
740
+                    $row['col7'] = '<span style="color: #f00; font-weight:bold;">'.$row['col7'].'</span>';
741 741
                 }
742 742
 
743 743
                 $ticket = array(
@@ -754,22 +754,22 @@  discard block
 block discarded – undo
754 754
                 );
755 755
             } else {
756 756
                 $actions = "";
757
-                $actions .= '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . Display::return_icon(
757
+                $actions .= '<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.Display::return_icon(
758 758
                                 'synthese_view.gif', get_lang('Info')
759
-                        ) . '</a>&nbsp;&nbsp;';
759
+                        ).'</a>&nbsp;&nbsp;';
760 760
                 $row['col0'] = Display::return_icon(
761 761
                                 $img_source, get_lang('Info')
762
-                        ) . '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . $row['ticket_code'] . '</a>';
762
+                        ).'<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.$row['ticket_code'].'</a>';
763 763
                 $now = api_strtotime(api_get_utc_datetime());
764 764
                 $last_edit_date = api_strtotime($row['sys_lastedit_datetime']);
765 765
                 $dif = $now - $last_edit_date;
766 766
 
767 767
                 if ($dif > 172800 && $row['priority_id'] == 'NRM' && $row['status_id'] != 'CLS') {
768
-                    $actions .= '<a href="myticket.php?ticket_id=' . $row['ticket_id'] . '&amp;action=alert">
769
-                                 <img src="' . Display::returnIconPath('exclamation.png') . '" border="0" /></a>';
768
+                    $actions .= '<a href="myticket.php?ticket_id='.$row['ticket_id'].'&amp;action=alert">
769
+                                 <img src="' . Display::returnIconPath('exclamation.png').'" border="0" /></a>';
770 770
                 }
771 771
                 if ($row['priority_id'] == 'HGH') {
772
-                    $actions .= '<img src="' . Display::returnIconPath('admin_star.png') . '" border="0" />';
772
+                    $actions .= '<img src="'.Display::returnIconPath('admin_star.png').'" border="0" />';
773 773
                 }
774 774
                 $ticket = array(
775 775
                     $row['col0'],
@@ -781,14 +781,14 @@  discard block
 block discarded – undo
781 781
                 );
782 782
             }
783 783
             if ($unread > 0) {
784
-                $ticket['0'] = $ticket['0'] . '&nbsp;&nbsp;(' . $unread . ')<a href="ticket_details.php?ticket_id=' . $row['ticket_id'] . '">
785
-                                <img src="' . Display::returnIconPath('message_new.png') . '" border="0" title="' . $unread . ' ' . get_lang('Messages') . '"/>
784
+                $ticket['0'] = $ticket['0'].'&nbsp;&nbsp;('.$unread.')<a href="ticket_details.php?ticket_id='.$row['ticket_id'].'">
785
+                                <img src="' . Display::returnIconPath('message_new.png').'" border="0" title="'.$unread.' '.get_lang('Messages').'"/>
786 786
                                 </a>';
787 787
             }
788 788
             if ($isAdmin) {
789
-                $ticket['0'] .= '&nbsp;&nbsp;<a  href="javascript:void(0)" onclick="load_history_ticket(\'div_' . $row['ticket_id'] . '\',' . $row['ticket_id'] . ')">
790
-					<img onclick="load_course_list(\'div_' . $row['ticket_id'] . '\',' . $row['ticket_id'] . ')" onmouseover="clear_course_list (\'div_' . $row['ticket_id'] . '\')" src="' . Display::returnIconPath('history.gif') . '" title="' . get_lang('Historial') . '" alt="' . get_lang('Historial') . '"/>
791
-					<div class="blackboard_hide" id="div_' . $row['ticket_id'] . '">&nbsp;&nbsp;</div>
789
+                $ticket['0'] .= '&nbsp;&nbsp;<a  href="javascript:void(0)" onclick="load_history_ticket(\'div_'.$row['ticket_id'].'\','.$row['ticket_id'].')">
790
+					<img onclick="load_course_list(\'div_' . $row['ticket_id'].'\','.$row['ticket_id'].')" onmouseover="clear_course_list (\'div_'.$row['ticket_id'].'\')" src="'.Display::returnIconPath('history.gif').'" title="'.get_lang('Historial').'" alt="'.get_lang('Historial').'"/>
791
+					<div class="blackboard_hide" id="div_' . $row['ticket_id'].'">&nbsp;&nbsp;</div>
792 792
 					</a>&nbsp;&nbsp;';
793 793
             }
794 794
             $tickets[] = $ticket;
@@ -1026,8 +1026,8 @@  discard block
 block discarded – undo
1026 1026
                     }
1027 1027
                 }
1028 1028
                 $userInfo = api_get_user_info($row['request_user']);
1029
-                $row['user_url'] = '<a href="' . api_get_path(WEB_PATH) . 'main/admin/user_information.php?user_id=' . $row['request_user'] . '">
1030
-                ' . api_get_person_name($userInfo['firstname'], $userInfo['lastname']) . '</a>';
1029
+                $row['user_url'] = '<a href="'.api_get_path(WEB_PATH).'main/admin/user_information.php?user_id='.$row['request_user'].'">
1030
+                ' . api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'</a>';
1031 1031
                 $ticket['usuario'] = $userInfo;
1032 1032
                 $ticket['ticket'] = $row;
1033 1033
             }
@@ -1044,10 +1044,10 @@  discard block
 block discarded – undo
1044 1044
             while ($row = Database::fetch_assoc($result)) {
1045 1045
                 $message = $row;
1046 1046
                 $completeName = api_get_person_name($row['firstname'], $row['lastname']);
1047
-                $href = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
1047
+                $href = $webPath.'main/admin/user_information.php?user_id='.$row['user_id'];
1048 1048
                 //Check if user is an admin
1049 1049
                 $sql_admin = "SELECT user_id FROM $admin_table
1050
-		              WHERE user_id = '" . intval($message['user_id']) . "'
1050
+		              WHERE user_id = '".intval($message['user_id'])."'
1051 1051
                               LIMIT 1";
1052 1052
                 $result_admin = Database::query($sql_admin);
1053 1053
                 $message['admin'] = false;
@@ -1059,12 +1059,12 @@  discard block
 block discarded – undo
1059 1059
                 $sql = "SELECT *
1060 1060
                         FROM $table_support_message_attachments
1061 1061
                         WHERE
1062
-                            message_id = " . $row['message_id'] . " AND
1062
+                            message_id = ".$row['message_id']." AND
1063 1063
                             ticket_id= '$ticket_id'  ";
1064 1064
                 $result_attach = Database::query($sql);
1065 1065
                 while ($row2 = Database::fetch_assoc($result_attach)) {
1066
-                    $archiveURL = $archiveURL = $webPath . "plugin/" . PLUGIN_NAME . '/src/download.php?ticket_id=' . $ticket_id . '&file=';
1067
-                    $row2['attachment_link'] = $attach_icon . '&nbsp;<a href="' . $archiveURL . $row2['path'] . '&title=' . $row2['filename'] . '">' . $row2['filename'] . '</a>&nbsp;(' . $row2['size'] . ')';
1066
+                    $archiveURL = $archiveURL = $webPath."plugin/".PLUGIN_NAME.'/src/download.php?ticket_id='.$ticket_id.'&file=';
1067
+                    $row2['attachment_link'] = $attach_icon.'&nbsp;<a href="'.$archiveURL.$row2['path'].'&title='.$row2['filename'].'">'.$row2['filename'].'</a>&nbsp;('.$row2['size'].')';
1068 1068
                     $message['atachments'][] = $row2;
1069 1069
                 }
1070 1070
                 $ticket['messages'][] = $message;
@@ -1088,9 +1088,9 @@  discard block
 block discarded – undo
1088 1088
         );
1089 1089
         $table_support_tickets = Database::get_main_table(TABLE_TICKET_TICKET);
1090 1090
         $now = api_get_utc_datetime();
1091
-        $sql = "UPDATE " . $table_support_messages . "
1092
-                SET status = 'LEI', sys_lastedit_user_id ='" . api_get_user_id() . "',
1093
-                sys_lastedit_datetime ='" . $now . "'
1091
+        $sql = "UPDATE ".$table_support_messages."
1092
+                SET status = 'LEI', sys_lastedit_user_id ='" . api_get_user_id()."',
1093
+                sys_lastedit_datetime ='" . $now."'
1094 1094
                 WHERE ticket_id ='$ticket_id' ";
1095 1095
 
1096 1096
         if (api_is_platform_admin()) {
@@ -1189,10 +1189,10 @@  discard block
 block discarded – undo
1189 1189
         $user_id = intval($user_id);
1190 1190
 
1191 1191
         $now = api_get_utc_datetime();
1192
-        $sql = "UPDATE " . $table_support_tickets . " SET
1192
+        $sql = "UPDATE ".$table_support_tickets." SET
1193 1193
                 status_id = '$status_id',
1194 1194
                 sys_lastedit_user_id ='$user_id',
1195
-                sys_lastedit_datetime ='" . $now . "'
1195
+                sys_lastedit_datetime ='".$now."'
1196 1196
                 WHERE ticket_id ='$ticket_id'";
1197 1197
         $result = Database::query($sql);
1198 1198
 
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
         $sql = "UPDATE $table_support_tickets SET
1278 1278
                     status_id = 'CLS',
1279 1279
                     sys_lastedit_user_id ='$user_id',
1280
-                    sys_lastedit_datetime ='" . $now . "',
1280
+                    sys_lastedit_datetime ='".$now."',
1281 1281
                     end_date ='$now'
1282 1282
                 WHERE ticket_id ='$ticket_id'";
1283 1283
         Database::query($sql);
@@ -1334,8 +1334,8 @@  discard block
 block discarded – undo
1334 1334
             $row['assigned_date'] = api_convert_and_format_date(
1335 1335
                 api_get_local_time($row['assigned_date']), '%d/%m/%y-%H:%M:%S', _api_get_timezone()
1336 1336
             );
1337
-            $row['assignuser'] = ($row['user_id'] != 0) ? ('<a href="' . $webpath . 'main/admin/user_information.php?user_id=' . $row['user_id'] . '"  target="_blank">' . $assignuser['username'] . '</a>') : get_lang('Unassign');
1338
-            $row['insertuser'] = '<a href="' . $webpath . 'main/admin/user_information.php?user_id=' . $row['sys_insert_user_id'] . '"  target="_blank">' . $insertuser['username'] . '</a>';
1337
+            $row['assignuser'] = ($row['user_id'] != 0) ? ('<a href="'.$webpath.'main/admin/user_information.php?user_id='.$row['user_id'].'"  target="_blank">'.$assignuser['username'].'</a>') : get_lang('Unassign');
1338
+            $row['insertuser'] = '<a href="'.$webpath.'main/admin/user_information.php?user_id='.$row['sys_insert_user_id'].'"  target="_blank">'.$insertuser['username'].'</a>';
1339 1339
             $history[] = $row;
1340 1340
         }
1341 1341
         return $history;
@@ -1531,7 +1531,7 @@  discard block
 block discarded – undo
1531 1531
         while ($row = Database::fetch_assoc($result)) {
1532 1532
             if ($row['responsable'] != 0) {
1533 1533
                 $row['responsable'] = api_get_user_info($row['responsable']);
1534
-                $row['responsable'] = $row['responsable']['firstname'] . ' ' . $row['responsable']['lastname'];
1534
+                $row['responsable'] = $row['responsable']['firstname'].' '.$row['responsable']['lastname'];
1535 1535
             }
1536 1536
             $row['sys_insert_datetime'] = api_format_date(
1537 1537
                     $row['sys_insert_datetime'], '%d/%m/%y - %I:%M:%S %p'
Please login to merge, or discard this patch.