Merge pull request #4237 from Icinga/fix/generictts-hook-not-executed-everywhere

Use TicketHook where missing
This commit is contained in:
Johannes Meyer 2020-09-30 10:20:31 +02:00 committed by GitHub
commit 1f77414a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 1 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Monitoring\Controllers; namespace Icinga\Module\Monitoring\Controllers;
use Icinga\Application\Hook;
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
use Icinga\Web\Url; use Icinga\Web\Url;
@ -58,6 +59,10 @@ class CommentController extends Controller
'url' =>'monitoring/comments/show' 'url' =>'monitoring/comments/show'
) )
)->activate('comment')->extend(new DashboardAction())->extend(new MenuAction()); )->activate('comment')->extend(new DashboardAction())->extend(new MenuAction());
if (Hook::has('ticket')) {
$this->view->tickets = Hook::first('ticket');
}
} }
/** /**

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Monitoring\Controllers; namespace Icinga\Module\Monitoring\Controllers;
use Icinga\Application\Hook;
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
@ -68,6 +69,10 @@ class DowntimeController extends Controller
'url' =>'monitoring/downtimes/show' 'url' =>'monitoring/downtimes/show'
) )
)->activate('downtime')->extend(new DashboardAction())->extend(new MenuAction()); )->activate('downtime')->extend(new DashboardAction())->extend(new MenuAction());
if (Hook::has('ticket')) {
$this->view->tickets = Hook::first('ticket');
}
} }
/** /**

View File

@ -40,6 +40,13 @@ class EventController extends Controller
'dt_end' => 'downtimeevent' 'dt_end' => 'downtimeevent'
); );
public function init()
{
if (Hook::has('ticket')) {
$this->view->tickets = Hook::first('ticket');
}
}
public function showAction() public function showAction()
{ {
$type = $this->params->shiftRequired('type'); $type = $this->params->shiftRequired('type');

View File

@ -65,6 +65,11 @@
</td> </td>
</tr> </tr>
<tr>
<th><?= $this->translate('Comment') ?></th>
<td><?= $this->nl2br($this->createTicketLinks($this->markdown($comment->comment))) ?></td>
</tr>
<?php if (isset($delCommentForm)): // Form is unset if the current user lacks the respective permission ?> <?php if (isset($delCommentForm)): // Form is unset if the current user lacks the respective permission ?>
<tr class="newsection"> <tr class="newsection">
<th><?= $this->translate('Commands') ?></th> <th><?= $this->translate('Commands') ?></th>

View File

@ -45,7 +45,7 @@
</tr> </tr>
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>"> <tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<th><?= $this->translate('Comment') ?></th> <th><?= $this->translate('Comment') ?></th>
<td><?= $this->nl2br($this->markdown($this->downtime->comment)) ?></td> <td><?= $this->nl2br($this->createTicketLinks($this->markdown($downtime->comment))) ?></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>