Skip to content

Commit

Permalink
Improved adding relation on OSSMailScanner #40
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuszkrzaczkowski committed Nov 20, 2020
1 parent b8652b8 commit 187c589
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions plugins/yetiforce/yetiforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,17 +391,29 @@ public function messageComposeBody(array $args)
$id = App\Purifier::purifyByType(rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC), 'Alnum');
$row = $_SESSION['compose_data_' . $id]['param']['mailData'];
$type = $_SESSION['compose_data_' . $id]['param']['type'];
if (!$row) {
return;
$params = $_SESSION['compose_data_' . $id]['param'];
$recordNumber = '';
if ($number = \App\Mail\RecordFinder::getRecordNumberFromString("[{$params['recordNumber']}]", $params['crmmodule'])) {
$recordNumber = "[{$number}]";
}
$bodyIsHtml = $args['html'];
if (!$row) {
if ($recordNumber) {
if (!$bodyIsHtml) {
$body = "\n ------------------------- \n" . $recordNumber;
} else {
$body = '<br><br><hr/>' . $recordNumber;
}
$args['body'] = $body;
}
return $args;
}
$body = $row['content'];
$date = $row['date'];
$from = $row['from_email'];
$to = $row['to_email'];
$body = $row['content'];
$subject = $row['subject'];
$replyto = $row['reply_to_email'];

$prefix = $suffix = '';
if ('forward' === $type) {
if (!$bodyIsHtml) {
Expand Down Expand Up @@ -456,9 +468,15 @@ public function messageComposeBody(array $args)
$body = rcmailWrapAndQuote($body, $LINE_LENGTH);
$prefix .= "\n";
$body = $prefix . $body . $suffix;
if ($recordNumber) {
$body .= "\n ------------------------- \n" . $recordNumber;
}
} else {
$prefix = '<p>' . rcube::Q($prefix) . "</p>\n";
$body = $prefix . '<blockquote>' . $body . '</blockquote>' . $suffix;
if ($recordNumber) {
$body .= '<hr/>' . $recordNumber;
}
}
}
$this->rc->output->set_env('compose_mode', $type);
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

return [
'patch' => '2020.11.20',
'version' => '0.0.102'
'version' => '0.0.103'
];

0 comments on commit 187c589

Please sign in to comment.