@@ -538,29 +538,38 @@ private function addAttachment($idTicket, $error, $ws, $idIssueCreate, $itemType
538538 $ data = file_get_contents ($ path );
539539 if (! $ data ) {
540540
541- Toolbox::logInFile ('mantis ' , sprintf (__ ('Can \'t load the attachment \'%1$s \'
542- to MantisBT, the process was interrupted ' , 'mantis ' ), $ doc ->getField ('filename ' )) . "\n" );
543- $ error .= sprintf (__ ('Can \'t load the attachment \'%1$s \',
544- the process was interrupted ' , 'mantis ' ), $ doc ->getField ('filename ' ));
541+ Toolbox::logInFile ('mantis ' , sprintf (
542+ __ ('Can \'t load the attachment [%1$s] to MantisBT, the process was interrupted. ' , 'mantis ' ),
543+ $ doc ->getField ('filename ' )));
544+
545+ $ error .= sprintf (
546+ __ ('Can \'t load the attachment [%1$s] to MantisBT, the process was interrupted. ' , 'mantis ' ),
547+ $ doc ->getField ('filename ' ));
545548 } else {
546549
547550 // $data = base64_encode($data);
548551 $ id_data = $ ws ->addAttachmentToIssue ($ idIssueCreate , $ doc ->getField ('filename ' ), $ doc ->getField ('mime ' ), $ data );
549552
550553 if (! $ id_data ) {
551554 $ id_attachment [] = $ id_data ;
552- Toolbox::logInFile ('mantis ' , sprintf (__ ('Can \'t send the attachment
553- \'%1$s \' to MantisBT, the process was interrupted ' , 'mantis ' ), $ doc ->getField ('filename ' )) . "\n" );
554- $ error .= sprintf (__ ('Can \'t send the attachment \'%1$s \'
555- to MantisBT, the process was interrupted ' , 'mantis ' ), $ doc ->getField ('filename ' ));
555+ Toolbox::logInFile ('mantis ' , sprintf (
556+ __ ('Can \'t send the attachment [%1$s] to MantisBT, the process was interrupted. ' , 'mantis ' ),
557+ $ doc ->getField ('filename ' )));
558+
559+ $ error .= sprintf (
560+ __ ('Can \'t send the attachment [%1$s] to MantisBT, the process was interrupted. ' , 'mantis ' ),
561+ $ doc ->getField ('filename ' ));
556562 }
557563 }
558564 } else {
559565
560- Toolbox::logInFile ('mantis ' , sprintf (__ ('Attachment \'%1$s \'
561- does not exist,the process was interrupted ' , 'mantis ' ), $ doc ->getField ('filename ' )) . "\n" );
562- $ error .= sprintf (__ ('Attachment \'%1$s \' does not exist,the
563- process was interrupted ' , 'mantis ' ), $ doc ->getField ('filename ' ));
566+ Toolbox::logInFile ('mantis ' , sprintf (
567+ __ ('Attachment [%1$s] doesn \'t exists, the process was interrupted. ' , 'mantis ' ),
568+ $ doc ->getField ('filename ' )));
569+
570+ $ error .= sprintf (
571+ __ ('Attachment [%1$s] doesn \'t exists,the process was interrupted. ' , 'mantis ' ),
572+ $ doc ->getField ('filename ' ));
564573 }
565574 }
566575 }
@@ -597,7 +606,7 @@ private function getAdditionalInfo($champsGlpi, $champsUrl, $ticket, $itilCatego
597606 }
598607
599608 if ($ champsUrl == 'additional_information ' ) {
600- $ infoTicket .= sprintf (__ ('Link to Glpi ticket = %1$s <br/> ' , 'mantis ' ), $ _SERVER ['HTTP_REFERER ' ]);
609+ $ infoTicket .= sprintf (__ ('Link to GLPi object = %1$s <br/> ' , 'mantis ' ), $ _SERVER ['HTTP_REFERER ' ]);
601610 }
602611
603612 if ($ linkedTicket == 'true ' ) {
@@ -635,7 +644,10 @@ private function getAdditionalInfo($champsGlpi, $champsUrl, $ticket, $itilCatego
635644 }
636645
637646 if ($ champsUrl == 'additional_information ' ) {
638- $ infoTicket .= sprintf (__ ('Link to Glpi ticket = %1$s <br/> ' , 'mantis ' ), str_replace ('id= ' . $ ticket ->fields ['id ' ], 'id= ' . $ t ->fields ['id ' ], $ _SERVER ['HTTP_REFERER ' ]));
647+ $ infoTicket .= sprintf (__ ('Link to GLPi object = %1$s <br/> ' , 'mantis ' ),
648+ str_replace ('id= ' . $ ticket ->fields ['id ' ],
649+ 'id= ' . $ t ->fields ['id ' ],
650+ $ _SERVER ['HTTP_REFERER ' ]));
639651 }
640652 }
641653 }
@@ -672,7 +684,7 @@ private function getInfoFromTicket($champsGlpi, $champsUrl, $ticket, $itilCatego
672684 }
673685
674686 if ($ champsUrl != 'additional_information ' && $ champsUrl != 'note ' ) {
675- $ infoTicket .= sprintf (__ ('Link to Glpi ticket = %1$s <br/> ' , 'mantis ' ), $ _SERVER ['HTTP_REFERER ' ]);
687+ $ infoTicket .= sprintf (__ ('Link to GLPi object = %1$s <br/> ' , 'mantis ' ), $ _SERVER ['HTTP_REFERER ' ]);
676688 }
677689
678690 if ($ linkedTicket == 'true ' ) {
@@ -711,7 +723,10 @@ private function getInfoFromTicket($champsGlpi, $champsUrl, $ticket, $itilCatego
711723 }
712724
713725 if ($ champsUrl != 'additional_information ' && $ champsUrl != 'note ' ) {
714- $ infoTicket .= sprintf (__ ('Link to Glpi ticket = %1$s <br/> ' , 'mantis ' ), str_replace ('id= ' . $ ticket ->fields ['id ' ], 'id= ' . $ t ->fields ['id ' ], $ _SERVER ['HTTP_REFERER ' ]));
726+ $ infoTicket .= sprintf (__ ('Link to GLPi object = %1$s <br/> ' , 'mantis ' ),
727+ str_replace ('id= ' . $ ticket ->fields ['id ' ],
728+ 'id= ' . $ t ->fields ['id ' ],
729+ $ _SERVER ['HTTP_REFERER ' ]));
715730 }
716731 }
717732 }
@@ -748,7 +763,7 @@ private function createNote($champsGlpi, $ticket, $itilCategorie, $champsUrl, $w
748763 }
749764
750765 if ($ champsUrl == 'note ' ) {
751- $ note .= sprintf (__ ('Link to Glpi ticket = %1$s <br/> ' , 'mantis ' ), $ _SERVER ['HTTP_REFERER ' ]);
766+ $ note .= sprintf (__ ('Link to GLPi object = %1$s <br/> ' , 'mantis ' ), $ _SERVER ['HTTP_REFERER ' ]);
752767 }
753768
754769 if ($ linkedTicket == 'true ' ) {
@@ -786,7 +801,10 @@ private function createNote($champsGlpi, $ticket, $itilCategorie, $champsUrl, $w
786801 }
787802
788803 if ($ champsUrl == 'note ' ) {
789- $ note .= sprintf (__ ('Link to Glpi ticket = %1$s <br/> ' , 'mantis ' ), str_replace ('id= ' . $ ticket ->fields ['id ' ], 'id= ' . $ t ->fields ['id ' ], $ _SERVER ['HTTP_REFERER ' ]));
804+ $ note .= sprintf (__ ('Link to GLPi object = %1$s <br/> ' , 'mantis ' ),
805+ str_replace ('id= ' . $ ticket ->fields ['id ' ],
806+ 'id= ' . $ t ->fields ['id ' ],
807+ $ _SERVER ['HTTP_REFERER ' ]));
790808 }
791809 }
792810 }
@@ -850,7 +868,13 @@ private function getFollowUpFromticket($ticket) {
850868 $ user = new User ();
851869 $ user ->getFromDB ($ row ["users_id " ]);
852870
853- $ content .= sprintf (__ ('Follow = %1$s -> date : %2$s, request type : %3$s, user : %4$s, content : %5$s<br/> ' , 'mantis ' ), $ ticket_followUp ->fields ['id ' ], $ ticket_followUp ->fields ['date ' ], $ request_type ->fields ['name ' ], $ user ->getName (), $ ticket_followUp ->getField ('content ' ));
871+ $ content .= sprintf (
872+ __ ('Followups = %1$s -> date : %2$s, request type : %3$s, user : %4$s, content : %5$s<br/> ' , 'mantis ' ),
873+ $ ticket_followUp ->fields ['id ' ],
874+ $ ticket_followUp ->fields ['date ' ],
875+ $ request_type ->fields ['name ' ],
876+ $ user ->getName (),
877+ $ ticket_followUp ->getField ('content ' ));
854878 }
855879 } else {
856880 $ content .= __ ("No follow-up " , "mantis " );
@@ -887,8 +911,12 @@ private function getTaskFromticket($ticket, $itemType) {
887911 $ user = new User ();
888912 $ user ->getFromDB ($ row ["users_id " ]);
889913
890- $ content .= sprintf (__ ('Task = %1$s -> date : %2$s, description : %3$s, time : %4$s,
891- <br/> ' , 'mantis ' ), $ task ->fields ['id ' ], $ task ->fields ['date ' ], $ task ->fields ['content ' ], Html::timestampToString ($ task ->fields ['actiontime ' ]));
914+ $ content .= sprintf (
915+ __ ('Task = %1$s -> date : %2$s, description : %3$s, time : %4$s<br/> ' , 'mantis ' ),
916+ $ task ->fields ['id ' ],
917+ $ task ->fields ['date ' ],
918+ $ task ->fields ['content ' ],
919+ Html::timestampToString ($ task ->fields ['actiontime ' ]));
892920 }
893921 } else {
894922 $ content .= __ ("No task " , "mantis " );
0 commit comments