getHelper('CommandForm'); $data = array('host' => $object->host_name); if ($object->service_description) { $data['service'] = $object->service_description; } $list = array(); foreach ($object->downtimes as $downtime) { $deleteData = $data; $deleteData['downtimeid'] = $downtime->id; // TODO: This needs improvement if ((int) $downtime->is_in_effect) { $state = 'in downtime since ' . $this->timeSince($downtime->start); } else { if ($downtime->is_fixed) { $state = 'scheduled ' . $this->timeUntil($downtime->start); } else { $state = 'scheduled flexible ' . $this->timeUntil($downtime->start); } } // $iconForm = $cf->iconSubmitForm( // 'img/icons/remove_petrol.png', $iconForm = $cf->labelSubmitForm( 'X', 'Remove Downtime', 'link-like', 'removedowntime', $deleteData ); // Ticket hook sample $text = $this->tickets ? preg_replace_callback( $this->tickets->getPattern(), array($this->tickets, 'createLink'), $this->escape($downtime->comment) ) : $this->escape($downtime->comment); $list[] = sprintf( '%s
%s %s:%s
', $this->escape($downtime->author), $iconForm, $state, str_replace(array('\r\n', '\n'), '
', $text) ); } ?> translate('Downtimes') ?> icon('in_downtime_petrol.png') ?> translate('Schedule downtime') ?>