Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 0fff09d

Browse files
committed
continue work on locales
1 parent 1bd12fe commit 0fff09d

7 files changed

Lines changed: 961 additions & 826 deletions

File tree

hook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function plugin_mantis_getAddSearchOptions($itemtype) {
9191
$sopt[78963]['searchtype'] = 'equals';
9292
$sopt[78963]['nosearch'] = true;
9393
$sopt[78963]['datatype'] = 'bool';
94-
$sopt[78963]['name'] = __('ticket linked to mantis', 'mantis');
94+
$sopt[78963]['name'] = __('Tickets linked to MantisBT', 'mantis');
9595
$sopt[78963]['joinparams'] = array(
9696
'jointype' => "itemtype_item"
9797
);
@@ -103,7 +103,7 @@ function plugin_mantis_getAddSearchOptions($itemtype) {
103103
$sopt[78964]['searchtype'] = 'equals';
104104
$sopt[78964]['nosearch'] = true;
105105
$sopt[78964]['datatype'] = 'bool';
106-
$sopt[78964]['name'] = __('problem linked to mantis', 'mantis');
106+
$sopt[78964]['name'] = __('Problems linked to MantisBT', 'mantis');
107107
$sopt[78964]['joinparams'] = array(
108108
'jointype' => "itemtype_item"
109109
);

inc/issue.class.php

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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");

inc/userpref.class.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,53 +122,53 @@ public function showForm($ID, $options = array()) {
122122

123123
echo "<form method='post' action='" . $target . "' method='post'>";
124124
echo "<table id='table2' class='tab_cadre_fixe' cellpadding='2'>";
125-
echo "<tr class='headerRow'><th colspan='2'>" . __("Checkbox checked by default", "mantis") . "</th></tr>";
125+
echo "<tr class='headerRow'><th colspan='2'>" . __("Default checkbox status", "mantis") . "</th></tr>";
126126

127-
// FOLLOW ATTACHMENT
128127
$checked = ($this->fields['followAttachment']) ? "checked" : "";
129128
echo "<tr class='tab_bg_1'>";
130129
echo "<th>" . __("Attachments", "mantis") . "</th>";
131-
echo "<td><INPUT type='checkbox' name='followAttachment' id='followAttachment' " . $checked . ">" . __("To forward attachments", "mantis") . "<div id='attachmentforLinkToProject' ><div/></td></tr>";
130+
echo "<td><input type='checkbox' name='followAttachment' id='followAttachment' " . $checked . ">"
131+
. __("Forward attachments", "mantis")
132+
. "<div id='attachmentforLinkToProject' ><div/></td></tr>";
132133

133-
// FOLLOW GLPI FOLLOW
134134
$checked = ($this->fields['followFollow']) ? "checked" : "";
135135
echo "<tr class='tab_bg_1' >";
136136
echo "<th>" . __("Glpi follow", "mantis") . "</th>";
137-
echo "<td><INPUT type='checkbox' name='followFollow' id='followFollow' " . $checked . ">" . __("To forward follow", "mantis") . "</td></tr>";
137+
echo "<td><input type='checkbox' name='followFollow' id='followFollow' " . $checked . ">"
138+
. __("Forward followups", "mantis") . "</td></tr>";
138139

139-
// FOLLOW GLPI TASK
140140
$checked = ($this->fields['followTask']) ? "checked" : "";
141141
echo "<tr class='tab_bg_1'>";
142142
echo "<th>" . __("Glpi task", "mantis") . "</th>";
143-
echo "<td><INPUT type='checkbox' name='followTask' id='followTask' " . $checked . ">" . __("To forward task", "mantis") . "</td></tr>";
143+
echo "<td><input type='checkbox' name='followTask' id='followTask' " . $checked . ">"
144+
. __("Forward tasks", "mantis") . "</td></tr>";
144145

145-
// FOLLOW GLPI TITLE
146146
$checked = ($this->fields['followTitle']) ? "checked" : "";
147147
echo "<tr class='tab_bg_1'>";
148148
echo "<th>" . __("Glpi title", "mantis") . "</th>";
149-
echo "<td><INPUT type='checkbox' name='followTitle' id='followTitle' " . $checked . ">" . __("To forward title", "mantis") . "</td></tr>";
149+
echo "<td><input type='checkbox' name='followTitle' id='followTitle' " . $checked . ">"
150+
. __("Forward title", "mantis") . "</td></tr>";
150151

151-
// FOLLOW GLPI DEXCRIPTION
152152
$checked = ($this->fields['followDescription']) ? "checked" : "";
153153
echo "<tr class='tab_bg_1'>";
154154
echo "<th>" . __("Glpi description", "mantis") . "</th>";
155-
echo "<td><INPUT type='checkbox' name='followDescription' id='followDescription' " . $checked . ">" . __("To forward description", "mantis") . "</td></tr>";
155+
echo "<td><input type='checkbox' name='followDescription' id='followDescription' " . $checked . ">"
156+
. __("Forward description", "mantis") . "</td></tr>";
156157

157-
// FOLLOW GLPI CATEGORIE
158158
$checked = ($this->fields['followCategorie']) ? "checked" : "";
159159
echo "<tr class='tab_bg_1'>";
160160
echo "<th>" . __("Glpi categorie", "mantis") . "</th>";
161-
echo "<td><INPUT type='checkbox' name='followCategorie' id='followCategorie' " . $checked . ">" . __("To forward categorie", "mantis") . "</td></tr>";
161+
echo "<td><input type='checkbox' name='followCategorie' id='followCategorie' " . $checked . ">"
162+
. __("Forward category", "mantis") . "</td></tr>";
162163

163-
// FOLLOW GLPI LINKED
164164
$checked = ($this->fields['followLinkedItem']) ? "checked" : "";
165165
echo "<tr class='tab_bg_1' >";
166166
echo "<th>" . _n('Linked ticket', 'Linked tickets', 2) . "</th>";
167-
echo "<td><INPUT type='checkbox' name='followLinkedItem' id='followLinkedItem' " . $checked . ">" . __("To forward linked Ticket", "mantis") . "</td></tr>";
167+
echo "<td><input type='checkbox' name='followLinkedItem' id='followLinkedItem' " . $checked . ">"
168+
. __("Forward linked tickets", "mantis") . "</td></tr>";
168169

169-
// INPUT BUTTON
170170
echo "<tr class='tab_bg_1'>";
171-
echo "<td><input id='update' type='submit' name='update' value='" . __("Update", "mantis") . "' class='submit'></td><td></td></tr>";
171+
echo "<td><input id='update' type='submit' name='update' value='" . __('Update') . "' class='submit'></td><td></td></tr>";
172172
echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
173173
echo "<input type='hidden' name='users_id' value=" . $this->fields["users_id"] . ">";
174174

0 commit comments

Comments
 (0)