* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} namespace Monitoring\Form\Command; use \DateTime; use \Zend_Form_Element_Checkbox; use \Icinga\Web\Form\Element\DateTimePicker; use \Icinga\Util\DateTimeFactory; /** * Form for RescheduleNextCheck */ class RescheduleNextCheckForm extends WithChildrenCommandForm { /** * Create the form's elements */ protected function create() { $now = DateTimeFactory::create(); $dateElement = new DateTimePicker( array( 'name' => 'checktime', 'label' => t('Check time'), 'value' => $now->getTimestamp() ) ); $this->addElement($dateElement); $checkBox = new Zend_Form_Element_Checkbox( array( 'name' => 'forcecheck', 'label' => t('Force check'), 'value' => true ) ); $this->addElement($checkBox); if ($this->getWithChildren() === true) { $this->addNote(t('Reschedule next check for this host and its services.')); } else { $this->addNote(t('Reschedule next check for this object.')); } $this->setSubmitLabel(t('Reschedule check')); parent::create(); } public function isForced() { return $this->getValue('forcecheck') == true; } }