mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Sample ticket hook
This commit is contained in:
parent
c58f79c161
commit
b09ea7c690
44
library/Icinga/Web/Hook/Ticket.php
Normal file
44
library/Icinga/Web/Hook/Ticket.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icinga Web Ticket Hook
|
||||||
|
*/
|
||||||
|
namespace Icinga\Web\Hook;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icinga Web Ticket Hook base class
|
||||||
|
*
|
||||||
|
* Extend this class if you want to integrate your ticketing solution nicely into
|
||||||
|
* Icinga Web
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2013 Icinga-Web Team <info@icinga.org>
|
||||||
|
* @author Icinga-Web Team <info@icinga.org>
|
||||||
|
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
||||||
|
*/
|
||||||
|
abstract class Ticket
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor must live without arguments right now
|
||||||
|
*
|
||||||
|
* Therefore the constructor is final, we might change our opinion about
|
||||||
|
* this one far day
|
||||||
|
*/
|
||||||
|
final public function __construct()
|
||||||
|
{
|
||||||
|
$this->init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overwrite this function if you want to do some initialization stuff
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function init()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract public function getPattern();
|
||||||
|
|
||||||
|
abstract public function createLink($match);
|
||||||
|
|
||||||
|
}
|
@ -65,6 +65,9 @@ class Monitoring_ShowController extends Controller
|
|||||||
// TODO: Well... this could be done better
|
// TODO: Well... this could be done better
|
||||||
$this->view->object = AbstractObject::fromRequest($this->getRequest());
|
$this->view->object = AbstractObject::fromRequest($this->getRequest());
|
||||||
}
|
}
|
||||||
|
if (Hook::has('ticket')) {
|
||||||
|
$this->view->tickets = Hook::first('ticket');
|
||||||
|
}
|
||||||
|
|
||||||
$this->createTabs();
|
$this->createTabs();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user