Completed
Push — 1.10.x ( 501d19...0db498 )
by Yannick
89:35 queued 49:03
created
plugin/ticket/src/ticket.class.php 2 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param $category_id
58 58
      * @param $course_id
59 59
      * @param $project_id
60
-     * @param $other_area
60
+     * @param integer $other_area
61 61
      * @param $email
62 62
      * @param $subject
63 63
      * @param $content
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 
241 241
     /**
242 242
      * Assign ticket to admin
243
-     * @param $ticket_id
244
-     * @param $user_id
243
+     * @param string $ticket_id
244
+     * @param integer $user_id
245 245
      */
246 246
     public static function assign_ticket_user($ticket_id, $user_id)
247 247
     {
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 
295 295
     /**
296 296
      * Insert message between Users and Admins
297
-     * @param $ticket_id
298
-     * @param $subject
299
-     * @param $content
297
+     * @param string $ticket_id
298
+     * @param string $subject
299
+     * @param string $content
300 300
      * @param $file_attachments
301 301
      * @param $user_id
302 302
      * @param string $status
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
     /**
403 403
      * Attachment files when a message is sent
404 404
      * @param $file_attach
405
-     * @param $ticket_id
406
-     * @param $message_id
407
-     * @param $message_attch_id
405
+     * @param integer $ticket_id
406
+     * @param integer $message_id
407
+     * @param integer $message_attch_id
408 408
      * @return array
409 409
      */
410 410
     public static function save_message_attachment_file(
Please login to merge, or discard this 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);
@@ -431,11 +431,11 @@  discard block
 block discarded – undo
431 431
         } else {
432 432
             $new_file_name = uniqid('');
433 433
             $path_attachment = api_get_path(SYS_ARCHIVE_PATH);
434
-            $path_message_attach = $path_attachment . 'plugin_ticket_messageattch/';
434
+            $path_message_attach = $path_attachment.'plugin_ticket_messageattch/';
435 435
             if (!file_exists($path_message_attach)) {
436 436
                 @mkdir($path_message_attach, api_get_permissions_for_new_directories(), true);
437 437
             }
438
-            $new_path = $path_message_attach . $new_file_name;
438
+            $new_path = $path_message_attach.$new_file_name;
439 439
             if (is_uploaded_file($file_attach['tmp_name'])) {
440 440
                 @copy($file_attach['tmp_name'], $new_path);
441 441
             }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                     '$ticket_id',
459 459
                     '$message_id',
460 460
                     '$message_attch_id',
461
-                    '" . $file_attach['size'] . "',
461
+                    '".$file_attach['size']."',
462 462
                     '$user_id',
463 463
                     '$now',
464 464
                     '$user_id',
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
             Database::query($sql);
468 468
 
469 469
             return array(
470
-                'path' => $path_message_attach . $safe_new_file_name,
470
+                'path' => $path_message_attach.$safe_new_file_name,
471 471
                 'filename' => $safe_file_name
472 472
             );
473 473
         }
@@ -692,14 +692,14 @@  discard block
 block discarded – undo
692 692
             $result_unread = Database::query($sql_unread);
693 693
             $unread = Database::fetch_object($result_unread)->unread;
694 694
             $userInfo = api_get_user_info($row['user_id']);
695
-            $hrefUser = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
695
+            $hrefUser = $webPath.'main/admin/user_information.php?user_id='.$row['user_id'];
696 696
             $name = "<a href='$hrefUser'> {$userInfo['username']} </a>";
697 697
             $actions = "";
698 698
 
699 699
             if ($row['responsible'] != 0) {
700 700
                 $row['responsible'] = api_get_user_info($row['responsible']);
701 701
                 if (!empty($row['responsible'])) {
702
-                    $hrefResp = $webPath . 'main/admin/user_information.php?user_id=' . $row['responsible']['user_id'];
702
+                    $hrefResp = $webPath.'main/admin/user_information.php?user_id='.$row['responsible']['user_id'];
703 703
                     $row['responsible'] = "<a href='$hrefResp'> {$row['responsible']['username']} </a>";
704 704
                 } else {
705 705
                     $row['responsible'] = get_lang('UnknownUser');
@@ -707,9 +707,9 @@  discard block
 block discarded – undo
707 707
 
708 708
             } else {
709 709
                 if ($row['status_id'] != 'REE') {
710
-                    $row['responsible'] = '<span style="color:#ff0000;">' . $plugin->get_lang('ToBeAssigned') . '</span>';
710
+                    $row['responsible'] = '<span style="color:#ff0000;">'.$plugin->get_lang('ToBeAssigned').'</span>';
711 711
                 } else {
712
-                    $row['responsible'] = '<span style="color:#00ff00;">' . get_lang('MessageResent') . '</span>';
712
+                    $row['responsible'] = '<span style="color:#00ff00;">'.get_lang('MessageResent').'</span>';
713 713
                 }
714 714
             }
715 715
 
@@ -730,17 +730,17 @@  discard block
 block discarded – undo
730 730
             $row['col1'] = api_get_local_time($row['col1']);
731 731
             $row['col2'] = api_get_local_time($row['col2']);
732 732
             if ($isAdmin) {
733
-                $actions .= '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . Display::return_icon(
733
+                $actions .= '<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.Display::return_icon(
734 734
                                 'synthese_view.gif', get_lang('Info')
735
-                        ) . '</a>&nbsp;&nbsp;';
735
+                        ).'</a>&nbsp;&nbsp;';
736 736
                 if ($row['priority_id'] == 'HGH' && $row['status_id'] != 'CLS') {
737
-                    $actions .= '<img src="' . $webCodePath . 'img/exclamation.png" border="0" />';
737
+                    $actions .= '<img src="'.$webCodePath.'img/exclamation.png" border="0" />';
738 738
                 }
739 739
                 $row['col0'] = Display::return_icon(
740 740
                                 $img_source, get_lang('Info')
741
-                        ) . '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . $row['ticket_code'] . '</a>';
741
+                        ).'<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.$row['ticket_code'].'</a>';
742 742
                 if ($row['col7'] == 'PENDIENTE') {
743
-                    $row['col7'] = '<span style="color: #f00; font-weight:bold;">' . $row['col7'] . '</span>';
743
+                    $row['col7'] = '<span style="color: #f00; font-weight:bold;">'.$row['col7'].'</span>';
744 744
                 }
745 745
 
746 746
                 $ticket = array(
@@ -757,22 +757,22 @@  discard block
 block discarded – undo
757 757
                 );
758 758
             } else {
759 759
                 $actions = "";
760
-                $actions .= '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . Display::return_icon(
760
+                $actions .= '<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.Display::return_icon(
761 761
                                 'synthese_view.gif', get_lang('Info')
762
-                        ) . '</a>&nbsp;&nbsp;';
762
+                        ).'</a>&nbsp;&nbsp;';
763 763
                 $row['col0'] = Display::return_icon(
764 764
                                 $img_source, get_lang('Info')
765
-                        ) . '<a href="ticket_details.php?ticket_id=' . $row['col0'] . '">' . $row['ticket_code'] . '</a>';
765
+                        ).'<a href="ticket_details.php?ticket_id='.$row['col0'].'">'.$row['ticket_code'].'</a>';
766 766
                 $now = api_strtotime(api_get_utc_datetime());
767 767
                 $last_edit_date = api_strtotime($row['sys_lastedit_datetime']);
768 768
                 $dif = $now - $last_edit_date;
769 769
 
770 770
                 if ($dif > 172800 && $row['priority_id'] == 'NRM' && $row['status_id'] != 'CLS') {
771
-                    $actions .= '<a href="myticket.php?ticket_id=' . $row['ticket_id'] . '&amp;action=alert">
772
-                                 <img src="' . Display::returnIconPath('exclamation.png') . '" border="0" /></a>';
771
+                    $actions .= '<a href="myticket.php?ticket_id='.$row['ticket_id'].'&amp;action=alert">
772
+                                 <img src="' . Display::returnIconPath('exclamation.png').'" border="0" /></a>';
773 773
                 }
774 774
                 if ($row['priority_id'] == 'HGH') {
775
-                    $actions .= '<img src="' . Display::returnIconPath('admin_star.png') . '" border="0" />';
775
+                    $actions .= '<img src="'.Display::returnIconPath('admin_star.png').'" border="0" />';
776 776
                 }
777 777
                 $ticket = array(
778 778
                     $row['col0'],
@@ -784,14 +784,14 @@  discard block
 block discarded – undo
784 784
                 );
785 785
             }
786 786
             if ($unread > 0) {
787
-                $ticket['0'] = $ticket['0'] . '&nbsp;&nbsp;(' . $unread . ')<a href="ticket_details.php?ticket_id=' . $row['ticket_id'] . '">
788
-                                <img src="' . Display::returnIconPath('message_new.png') . '" border="0" title="' . $unread . ' ' . get_lang('Messages') . '"/>
787
+                $ticket['0'] = $ticket['0'].'&nbsp;&nbsp;('.$unread.')<a href="ticket_details.php?ticket_id='.$row['ticket_id'].'">
788
+                                <img src="' . Display::returnIconPath('message_new.png').'" border="0" title="'.$unread.' '.get_lang('Messages').'"/>
789 789
                                 </a>';
790 790
             }
791 791
             if ($isAdmin) {
792
-                $ticket['0'] .= '&nbsp;&nbsp;<a  href="javascript:void(0)" onclick="load_history_ticket(\'div_' . $row['ticket_id'] . '\',' . $row['ticket_id'] . ')">
793
-					<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') . '"/>
794
-					<div class="blackboard_hide" id="div_' . $row['ticket_id'] . '">&nbsp;&nbsp;</div>
792
+                $ticket['0'] .= '&nbsp;&nbsp;<a  href="javascript:void(0)" onclick="load_history_ticket(\'div_'.$row['ticket_id'].'\','.$row['ticket_id'].')">
793
+					<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').'"/>
794
+					<div class="blackboard_hide" id="div_' . $row['ticket_id'].'">&nbsp;&nbsp;</div>
795 795
 					</a>&nbsp;&nbsp;';
796 796
             }
797 797
             $tickets[] = $ticket;
@@ -1029,8 +1029,8 @@  discard block
 block discarded – undo
1029 1029
                     }
1030 1030
                 }
1031 1031
                 $userInfo = api_get_user_info($row['request_user']);
1032
-                $row['user_url'] = '<a href="' . api_get_path(WEB_PATH) . 'main/admin/user_information.php?user_id=' . $row['request_user'] . '">
1033
-                ' . api_get_person_name($userInfo['firstname'], $userInfo['lastname']) . '</a>';
1032
+                $row['user_url'] = '<a href="'.api_get_path(WEB_PATH).'main/admin/user_information.php?user_id='.$row['request_user'].'">
1033
+                ' . api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'</a>';
1034 1034
                 $ticket['usuario'] = $userInfo;
1035 1035
                 $ticket['ticket'] = $row;
1036 1036
             }
@@ -1047,10 +1047,10 @@  discard block
 block discarded – undo
1047 1047
             while ($row = Database::fetch_assoc($result)) {
1048 1048
                 $message = $row;
1049 1049
                 $completeName = api_get_person_name($row['firstname'], $row['lastname']);
1050
-                $href = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
1050
+                $href = $webPath.'main/admin/user_information.php?user_id='.$row['user_id'];
1051 1051
                 //Check if user is an admin
1052 1052
                 $sql_admin = "SELECT user_id FROM $admin_table
1053
-		              WHERE user_id = '" . intval($message['user_id']) . "'
1053
+		              WHERE user_id = '".intval($message['user_id'])."'
1054 1054
                               LIMIT 1";
1055 1055
                 $result_admin = Database::query($sql_admin);
1056 1056
                 $message['admin'] = false;
@@ -1062,12 +1062,12 @@  discard block
 block discarded – undo
1062 1062
                 $sql = "SELECT *
1063 1063
                         FROM $table_support_message_attachments
1064 1064
                         WHERE
1065
-                            message_id = " . $row['message_id'] . " AND
1065
+                            message_id = ".$row['message_id']." AND
1066 1066
                             ticket_id= '$ticket_id'  ";
1067 1067
                 $result_attach = Database::query($sql);
1068 1068
                 while ($row2 = Database::fetch_assoc($result_attach)) {
1069
-                    $archiveURL = $archiveURL = $webPath . "plugin/" . PLUGIN_NAME . '/src/download.php?ticket_id=' . $ticket_id . '&file=';
1070
-                    $row2['attachment_link'] = $attach_icon . '&nbsp;<a href="' . $archiveURL . $row2['path'] . '&title=' . $row2['filename'] . '">' . $row2['filename'] . '</a>&nbsp;(' . $row2['size'] . ')';
1069
+                    $archiveURL = $archiveURL = $webPath."plugin/".PLUGIN_NAME.'/src/download.php?ticket_id='.$ticket_id.'&file=';
1070
+                    $row2['attachment_link'] = $attach_icon.'&nbsp;<a href="'.$archiveURL.$row2['path'].'&title='.$row2['filename'].'">'.$row2['filename'].'</a>&nbsp;('.$row2['size'].')';
1071 1071
                     $message['atachments'][] = $row2;
1072 1072
                 }
1073 1073
                 $ticket['messages'][] = $message;
@@ -1091,9 +1091,9 @@  discard block
 block discarded – undo
1091 1091
         );
1092 1092
         $table_support_tickets = Database::get_main_table(TABLE_TICKET_TICKET);
1093 1093
         $now = api_get_utc_datetime();
1094
-        $sql = "UPDATE " . $table_support_messages . "
1095
-                SET status = 'LEI', sys_lastedit_user_id ='" . api_get_user_id() . "',
1096
-                sys_lastedit_datetime ='" . $now . "'
1094
+        $sql = "UPDATE ".$table_support_messages."
1095
+                SET status = 'LEI', sys_lastedit_user_id ='" . api_get_user_id()."',
1096
+                sys_lastedit_datetime ='" . $now."'
1097 1097
                 WHERE ticket_id ='$ticket_id' ";
1098 1098
 
1099 1099
         if (api_is_platform_admin()) {
@@ -1192,10 +1192,10 @@  discard block
 block discarded – undo
1192 1192
         $user_id = intval($user_id);
1193 1193
 
1194 1194
         $now = api_get_utc_datetime();
1195
-        $sql = "UPDATE " . $table_support_tickets . " SET
1195
+        $sql = "UPDATE ".$table_support_tickets." SET
1196 1196
                 status_id = '$status_id',
1197 1197
                 sys_lastedit_user_id ='$user_id',
1198
-                sys_lastedit_datetime ='" . $now . "'
1198
+                sys_lastedit_datetime ='".$now."'
1199 1199
                 WHERE ticket_id ='$ticket_id'";
1200 1200
         $result = Database::query($sql);
1201 1201
 
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
         $sql = "UPDATE $table_support_tickets SET
1282 1282
                     status_id = 'CLS',
1283 1283
                     sys_lastedit_user_id ='$user_id',
1284
-                    sys_lastedit_datetime ='" . $now . "',
1284
+                    sys_lastedit_datetime ='".$now."',
1285 1285
                     end_date ='$now'
1286 1286
                 WHERE ticket_id ='$ticket_id'";
1287 1287
         Database::query($sql);
@@ -1338,8 +1338,8 @@  discard block
 block discarded – undo
1338 1338
             $row['assigned_date'] = api_convert_and_format_date(
1339 1339
                 api_get_local_time($row['assigned_date']), '%d/%m/%y-%H:%M:%S', _api_get_timezone()
1340 1340
             );
1341
-            $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');
1342
-            $row['insertuser'] = '<a href="' . $webpath . 'main/admin/user_information.php?user_id=' . $row['sys_insert_user_id'] . '"  target="_blank">' . $insertuser['username'] . '</a>';
1341
+            $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');
1342
+            $row['insertuser'] = '<a href="'.$webpath.'main/admin/user_information.php?user_id='.$row['sys_insert_user_id'].'"  target="_blank">'.$insertuser['username'].'</a>';
1343 1343
             $history[] = $row;
1344 1344
         }
1345 1345
         return $history;
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
         while ($row = Database::fetch_assoc($result)) {
1535 1535
             if ($row['responsable'] != 0) {
1536 1536
                 $row['responsable'] = api_get_user_info($row['responsable']);
1537
-                $row['responsable'] = $row['responsable']['firstname'] . ' ' . $row['responsable']['lastname'];
1537
+                $row['responsable'] = $row['responsable']['firstname'].' '.$row['responsable']['lastname'];
1538 1538
             }
1539 1539
             $row['sys_insert_datetime'] = api_format_date(
1540 1540
                     $row['sys_insert_datetime'], '%d/%m/%y - %I:%M:%S %p'
Please login to merge, or discard this patch.
plugin/ticket/src/ticket_plugin.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     /**
13 13
      * Set the result
14 14
      * @staticvar null $result
15
-     * @return type
15
+     * @return TicketPlugin
16 16
      */
17 17
     static function create()
18 18
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function install()
47 47
     {
48 48
         // Create database tables and insert a Tab
49
-        require_once api_get_path(SYS_PLUGIN_PATH) . PLUGIN_NAME . '/database.php';
49
+        require_once api_get_path(SYS_PLUGIN_PATH).PLUGIN_NAME.'/database.php';
50 50
     }
51 51
 
52 52
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $rsTab = $this->deleteTab($plugSetting['comment']);
93 93
 
94 94
         if ($rsTab) {
95
-            echo "<script>location.href = '" . $_SERVER['REQUEST_URI'] . "';</script>";
95
+            echo "<script>location.href = '".$_SERVER['REQUEST_URI']."';</script>";
96 96
         }
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
plugin/ticket/src/tutor_report.lib.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 /**
75 75
  * @param $courseInfo
76
- * @param $weeksCount
76
+ * @param string $weeksCount
77 77
  * @param $page
78 78
  * @return array
79 79
  */
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 /**
184 184
  * @param $datos
185
- * @param $pagina
185
+ * @param integer $pagina
186 186
  * @return string
187 187
  */
188 188
 function showStudentResult($datos, $pagina)
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
 
202 202
 /**
203 203
  * @param $data
204
- * @param $numero_semanas
205
- * @return array
204
+ * @param integer $numero_semanas
205
+ * @return string[]
206 206
  */
207 207
 function showStudentResultExport($data, $numero_semanas)
208 208
 {
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     $table_post = Database::get_course_table(TABLE_FORUM_POST);
22 22
     $table_work = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
23 23
     $course_code = Database::escape_string($course_code);
24
-    $res = Database::query("SELECT COUNT(*) as cant FROM $table_reporte_semanas WHERE course_code = '" . $course_code . "'");
24
+    $res = Database::query("SELECT COUNT(*) as cant FROM $table_reporte_semanas WHERE course_code = '".$course_code."'");
25 25
     $sqlWeeks = "SELECT semanas FROM $table_semanas_curso WHERE course_code = '$course_code'";
26 26
     $resWeeks = Database::query($sqlWeeks);
27 27
     $weeks = Database::fetch_object($resWeeks);
@@ -105,52 +105,52 @@  discard block
 block discarded – undo
105 105
     $lineHeaderExport = array(null, null);
106 106
     $lineHeaderExport2 = array(null, ull);
107 107
     while ($rowe = Database::fetch_assoc($resultHeader)) {
108
-        $lineHeaderExport[] = utf8_decode('Work' . $rowe['week_id']);
109
-        $lineHeaderExport[] = utf8_decode('Forum' . $rowe['week_id']);
108
+        $lineHeaderExport[] = utf8_decode('Work'.$rowe['week_id']);
109
+        $lineHeaderExport[] = utf8_decode('Forum'.$rowe['week_id']);
110 110
         //$fila_export_encabezado[] =  utf8_decode('Eval'.$rowe['week_id']);
111 111
         //$fila_export_encabezado[] =  utf8_decode('PC'.$rowe['week_id']);
112 112
         $lineHeaderExport2[] = utf8_decode($rowe['work_title']);
113 113
         $lineHeaderExport2[] = utf8_decode($rowe['thread_title']);
114 114
         //$fila_export_encabezado2[] = utf8_decode($rowe['eval_title']);
115 115
         //$fila_export_encabezado2[] = utf8_decode($rowe['pc_title']);
116
-        $fila_export = array('Work' . $rowe['week_id'], 'Forum' . $rowe['week_id'], 'Eval' . $rowe['week_id'], 'PC' . $rowe['week_id']);
116
+        $fila_export = array('Work'.$rowe['week_id'], 'Forum'.$rowe['week_id'], 'Eval'.$rowe['week_id'], 'PC'.$rowe['week_id']);
117 117
         if ($rowe['week_id'] > (($page - 1) * 7) && $rowe['week_id'] <= (7 * $page)) {
118 118
             $ids[$rowe['week_id']] = $rowe['id'];
119
-            $line.='<th>
120
-                <a href="#" onClick="showContent(' . "'tarea" . $rowe['week_id'] . "'" . ');">Work' . $rowe['week_id'] . '
121
-                        <div class="blackboard_hide" id="tarea' . $rowe['week_id'] . '">' . $rowe['work_title'] . '</div>
119
+            $line .= '<th>
120
+                <a href="#" onClick="showContent(' . "'tarea".$rowe['week_id']."'".');">Work'.$rowe['week_id'].'
121
+                        <div class="blackboard_hide" id="tarea' . $rowe['week_id'].'">'.$rowe['work_title'].'</div>
122 122
                 </a></th>';
123
-            $line.= '<th>
124
-                <a href="#" onClick="showContent(' . "'foro" . $rowe['week_id'] . "'" . ');">Forum' . $rowe['week_id'] . '
125
-                        <div class="blackboard_hide" id="foro' . $rowe['week_id'] . '">' . $rowe['thread_title'] . '</div>
123
+            $line .= '<th>
124
+                <a href="#" onClick="showContent(' . "'foro".$rowe['week_id']."'".');">Forum'.$rowe['week_id'].'
125
+                        <div class="blackboard_hide" id="foro' . $rowe['week_id'].'">'.$rowe['thread_title'].'</div>
126 126
                 </a>
127 127
                 </th>';
128 128
         }
129 129
     }
130 130
     $tableExport[] = $lineHeaderExport;
131 131
     $tableExport[] = $lineHeaderExport2;
132
-    $line.= '</tr>';
132
+    $line .= '</tr>';
133 133
 
134 134
     $html = '<form action="tutor.php" name="semanas" id="semanas" method="POST">
135 135
             <div class="row">
136
-            ' . get_lang('SelectWeeksSpan') . '
136
+            ' . get_lang('SelectWeeksSpan').'
137 137
             <select name="weeksNumber" id="weeksNumber" onChange="submit();">
138
-            <option value="7" ' . (($weeksCount == 7) ? 'selected="selected"' : "") . '>7 weeks</option>
139
-            <option value="14" ' . (($weeksCount == 14) ? 'selected="selected"' : "") . '>14 weeks</option>
138
+            <option value="7" ' . (($weeksCount == 7) ? 'selected="selected"' : "").'>7 weeks</option>
139
+            <option value="14" ' . (($weeksCount == 14) ? 'selected="selected"' : "").'>14 weeks</option>
140 140
             </select>';
141 141
 
142 142
 
143 143
     if ($weeksCount == 14) {
144
-        $html .= '<span style="float:right;"><a href="tutor.php?page=' . (($page == 1) ? 2 : 1) . '">' . (($page == 1) ? "Siguiente" : "Anterior") . '</a></span>';
144
+        $html .= '<span style="float:right;"><a href="tutor.php?page='.(($page == 1) ? 2 : 1).'">'.(($page == 1) ? "Siguiente" : "Anterior").'</a></span>';
145 145
     }
146
-    $html .= '<span style="float:right;"><a href="' . api_get_self() . '?action=export' . $get_parameter . $get_parameter2 . '">' . Display::return_icon('export_excel.png', get_lang('Export'), '', '32') . '</a></span>';
146
+    $html .= '<span style="float:right;"><a href="'.api_get_self().'?action=export'.$get_parameter.$get_parameter2.'">'.Display::return_icon('export_excel.png', get_lang('Export'), '', '32').'</a></span>';
147 147
 
148 148
     $html .= '</form>';
149 149
     $html .= '<table class="reports">';
150 150
     $html .= '<tr>
151 151
             <th ></th>';
152 152
     for ($i = (7 * $page - 6); $i <= $page * 7; $i++) {
153
-        $html .= '<th colspan="2">Week ' . $i . '<a href="assign_tickets.php?id=' . $ids[$i] . '" class="ajax">' . Display::return_icon('edit.png', get_lang('Edit'), array('width' => '16', 'height' => '16'), 22) . '</a></th>';
153
+        $html .= '<th colspan="2">Week '.$i.'<a href="assign_tickets.php?id='.$ids[$i].'" class="ajax">'.Display::return_icon('edit.png', get_lang('Edit'), array('width' => '16', 'height' => '16'), 22).'</a></th>';
154 154
     }
155 155
     $html .= '</tr>';
156 156
     $html .= $line;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         if ($row['week_id'] > (($page - 1) * 7) && $row['week_id'] <= (7 * $page)) {
168 168
             $results[$row['username']][$row['week_id']] = $row;
169 169
             if (count($results[$row['username']]) == 7) {
170
-                $html.= showStudentResult($results[$row['username']], $page);
170
+                $html .= showStudentResult($results[$row['username']], $page);
171 171
             }
172 172
         }
173 173
         if (count($resultadose[$row['username']]) == $weeksCount) {
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
     $inicio = (7 * $pagina - 6);
191 191
     $fila = '<tr>';
192 192
 
193
-    $fila.= '<td><a href="' . api_get_path(WEB_CODE_PATH) . 'user/userInfo.php?' . api_get_cidreq() . '&uInfo=' . $datos[$inicio]['user_id'] . '">' . $datos[$inicio]['username'] . '</a></td>';
193
+    $fila .= '<td><a href="'.api_get_path(WEB_CODE_PATH).'user/userInfo.php?'.api_get_cidreq().'&uInfo='.$datos[$inicio]['user_id'].'">'.$datos[$inicio]['username'].'</a></td>';
194 194
     foreach ($datos as $dato) {
195
-        $fila.= '<td align="center">' . (($dato['work_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')) . '</td>';
196
-        $fila.= '<td align="center">' . (($dato['thread_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')) . '</td>';
195
+        $fila .= '<td align="center">'.(($dato['work_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')).'</td>';
196
+        $fila .= '<td align="center">'.(($dato['thread_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')).'</td>';
197 197
     }
198
-    $fila.= '</tr>';
198
+    $fila .= '</tr>';
199 199
     return $fila;
200 200
 }
201 201
 
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
     /**
95 95
      * @param array $templates
96 96
      *
97
-     * @return null
97
+     * @return null|string
98 98
      */
99 99
     public function formatTemplates($templates)
100 100
     {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
         return [[
146 146
             'title' => get_lang('EmptyTemplate'),
147 147
             'description' => null,
148
-            'image' => api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/empty.gif',
148
+            'image' => api_get_path(WEB_APP_PATH).'home/default_platform_document/template_thumb/empty.gif',
149 149
             'html' => '
150 150
                 <!DOCYTPE html>
151 151
                 <html>
152 152
                     <head>
153
-                        <meta charset="' . api_get_system_encoding() . '" />
153
+                        <meta charset="' . api_get_system_encoding().'" />
154 154
                     </head>
155
-                    <body  dir="' . api_get_text_direction() . '">
155
+                    <body  dir="' . api_get_text_direction().'">
156 156
                         <p>
157 157
                             <br/>
158 158
                         </p>
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $search = array('{CSS}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}');
176 176
         $replace = array(
177 177
             '',
178
-            api_get_path(REL_CODE_PATH) . 'img/',
178
+            api_get_path(REL_CODE_PATH).'img/',
179 179
             api_get_path(REL_PATH),
180 180
             api_get_path(REL_DEFAULT_COURSE_DOCUMENT_PATH),
181 181
             api_get_path(REL_DEFAULT_COURSE_DOCUMENT_PATH)
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         foreach ($systemTemplates as $template) {
187 187
             $image = $template->getImage();
188 188
             $image = !empty($image) ? $image : 'empty.gif';
189
-            $image = api_get_path(WEB_APP_PATH) . 'home/default_platform_document/template_thumb/' . $image;
189
+            $image = api_get_path(WEB_APP_PATH).'home/default_platform_document/template_thumb/'.$image;
190 190
 
191 191
             /*$image = $this->urlGenerator->generate(
192 192
                 'get_document_template_action',
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
             $templateItem['image'] = api_get_path(WEB_APP_PATH)
239 239
                 . 'home/default_platform_document/template_thumb/noimage.gif';
240 240
             $templateItem['html'] = file_get_contents(api_get_path(SYS_COURSE_PATH)
241
-                . $courseDirectory . '/document' . $templateData['path']);
241
+                . $courseDirectory.'/document'.$templateData['path']);
242 242
 
243 243
             $image = $template->getImage();
244 244
             if (!empty($image)) {
245 245
                 $templateItem['image'] = api_get_path(WEB_COURSE_PATH)
246
-                    . $courseDirectory . '/upload/template_thumbnails/' . $template->getImage();
246
+                    . $courseDirectory.'/upload/template_thumbnails/'.$template->getImage();
247 247
             }
248 248
 
249 249
             $templateList[] = $templateItem;
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Component/Editor/Connector.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 
85 85
     /**
86 86
      * Available driver list.
87
-     * @return array
87
+     * @return string[]
88 88
      */
89 89
     private function getDefaultDriverList()
90 90
     {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             'root_sys' => api_get_path(SYS_PATH),
52 52
             'sys_root' => api_get_path(SYS_PATH), // just an alias
53 53
             'sys_course_path' => api_get_path(SYS_COURSE_PATH),
54
-         //   'sys_config_path' => $app['path.config'],
54
+            //   'sys_config_path' => $app['path.config'],
55 55
             'path.temp' => api_get_path(SYS_ARCHIVE_PATH),
56 56
             //'sys_log_path' => $app['path.logs']
57 57
         );
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
      **/
326 326
     public function access($attr, $path, $data, $volume)
327 327
     {
328
-    	return strpos(basename($path), '.') === 0       // if file/folder begins with '.' (dot)
329
-    		? !($attr == 'read' || $attr == 'write')    // set read+write to false, other (locked+hidden) set to true
330
-    		:  null;                                    // else elFinder decide it itself
328
+        return strpos(basename($path), '.') === 0       // if file/folder begins with '.' (dot)
329
+            ? !($attr == 'read' || $attr == 'write')    // set read+write to false, other (locked+hidden) set to true
330
+            :  null;                                    // else elFinder decide it itself
331 331
     }
332 332
 
333 333
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -327,7 +327,7 @@
 block discarded – undo
327 327
     {
328 328
     	return strpos(basename($path), '.') === 0       // if file/folder begins with '.' (dot)
329 329
     		? !($attr == 'read' || $attr == 'write')    // set read+write to false, other (locked+hidden) set to true
330
-    		:  null;                                    // else elFinder decide it itself
330
+    		:  null; // else elFinder decide it itself
331 331
     }
332 332
 
333 333
     /**
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Component/Editor/Driver/DropBoxDriver.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     /**
134 134
      * Close connection
135 135
      *
136
-     * @return void
136
+     * @return boolean
137 137
      * @author Dmitry (dio) Levashov
138 138
      **/
139 139
     public function umount() {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
      * Close opened file
489 489
      *
490 490
      * @param  resource  $fp  file pointer
491
-     * @return bool
491
+     * @return boolean|null
492 492
      * @author Dmitry (dio) Levashov
493 493
      **/
494 494
     protected function _fclose($fp, $path='') {
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
      *
506 506
      * @param  string  $path  parent dir path
507 507
      * @param string  $name  new directory name
508
-     * @return string|bool
508
+     * @return string|false
509 509
      * @author Dmitry (dio) Levashov
510 510
      **/
511 511
     protected function _mkdir($path, $name) {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -633,8 +633,8 @@
 block discarded – undo
633 633
     }
634 634
 
635 635
     /**
636
-    * {@inheritdoc}
637
-    */
636
+     * {@inheritdoc}
637
+     */
638 638
     protected function _archive($dir, $files, $name, $arc) {
639 639
         return false;
640 640
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
      * @return resource|false
465 465
      * @author Dmitry (dio) Levashov
466 466
      **/
467
-    protected function _fopen($path, $mode='rb') {
467
+    protected function _fopen($path, $mode = 'rb') {
468 468
         $fp = $this->tmbPath
469 469
             ? @fopen($this->tmpname($path), 'w+')
470 470
             : @tmpfile();
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
      * @return bool
492 492
      * @author Dmitry (dio) Levashov
493 493
      **/
494
-    protected function _fclose($fp, $path='') {
494
+    protected function _fclose($fp, $path = '') {
495 495
         @fclose($fp);
496 496
         if ($path) {
497 497
             @unlink($this->tmpname($path));
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/BranchSync.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -532,7 +532,6 @@  discard block
 block discarded – undo
532 532
      /**
533 533
      * Set sslPubKey
534 534
      *
535
-     * @param string $sslPubKey
536 535
      * @return BranchSync
537 536
      */
538 537
     public function setBranchType($branchType)
@@ -714,7 +713,7 @@  discard block
 block discarded – undo
714 713
     }
715 714
 
716 715
     /**
717
-     * @return mixed
716
+     * @return null|BranchSync
718 717
      */
719 718
     public function getParent()
720 719
     {
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private $lastSyncType;
138 138
 
139
-     /**
140
-     * @var string
141
-     *
142
-     * @ORM\Column(name="ssl_pub_key", type="string", length=250, nullable=true, unique=false)
143
-     */
139
+        /**
140
+         * @var string
141
+         *
142
+         * @ORM\Column(name="ssl_pub_key", type="string", length=250, nullable=true, unique=false)
143
+         */
144 144
     private $sslPubKey;
145 145
 
146 146
     /**
@@ -529,12 +529,12 @@  discard block
 block discarded – undo
529 529
         return $this->sslPubKey;
530 530
     }
531 531
 
532
-     /**
533
-     * Set sslPubKey
534
-     *
535
-     * @param string $sslPubKey
536
-     * @return BranchSync
537
-     */
532
+        /**
533
+         * Set sslPubKey
534
+         *
535
+         * @param string $sslPubKey
536
+         * @return BranchSync
537
+         */
538 538
     public function setBranchType($branchType)
539 539
     {
540 540
         $this->branchType = $branchType;
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/Course.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
     }
319 319
 
320 320
     /**
321
-     * @return ArrayCollection
321
+     * @return CTool[]
322 322
      */
323 323
     public function getTools()
324 324
     {
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
     }
1147 1147
 
1148 1148
     /**
1149
-     * @return array
1149
+     * @return string[]
1150 1150
      */
1151 1151
     public static function getStatusList()
1152 1152
     {
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/CourseRelUser.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
     }
140 140
 
141 141
     /**
142
-     * @param $user
142
+     * @param User $user
143 143
      * @return $this
144 144
      */
145 145
     public function setUser($user)
Please login to merge, or discard this patch.