diff --git a/library/Icinga/Web/Hook/Ticket.php b/library/Icinga/Web/Hook/Ticket.php new file mode 100644 index 000000000..1ba1192b0 --- /dev/null +++ b/library/Icinga/Web/Hook/Ticket.php @@ -0,0 +1,44 @@ + + * @author Icinga-Web Team + * @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); + +} diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index a15a55d17..7bd4a5124 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -65,6 +65,9 @@ class Monitoring_ShowController extends Controller // TODO: Well... this could be done better $this->view->object = AbstractObject::fromRequest($this->getRequest()); } + if (Hook::has('ticket')) { + $this->view->tickets = Hook::first('ticket'); + } $this->createTabs(); }