implement new hook timeline_actions

This commit is contained in:
Alexandre Delaunay
2019-02-21 09:50:53 +01:00
committed by Cédric Anne
parent 511aba6951
commit 2621e6ceb9
2 changed files with 29 additions and 0 deletions

View File

@ -117,4 +117,28 @@ class PluginExampleItemForm {
echo $out;
}
static public function timelineActions($params = []) {
$rand = $params['rand'];
$ticket = $params['item'];
if (get_class($ticket) !== "Ticket") {
return false;
}
$edit_panel = "viewitem".$ticket->fields['id'].$rand;
$JS = <<<JAVASCRIPT
$(function() {
$(document).on('click', '#email_transfer_{$rand}', function(event) {
$('#{$edit_panel}').html('email send');
});
});
JAVASCRIPT;
echo "<li class='followup' id='email_transfer_$rand'>
<i class='far fa-envelope'></i>".
__("Send a notification").
Html::scriptBlock($JS)."
</li>";
}
}