parent
1f10cb3124
commit
1a2ea656fd
|
@ -28,14 +28,15 @@
|
|||
|
||||
namespace Monitoring\Form\Command;
|
||||
|
||||
use \DateTime;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use \DateTime as PhpDateTime;
|
||||
use \DateInterval;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Protocol\Commandpipe\Acknowledgement;
|
||||
use Icinga\Protocol\Commandpipe\Comment;
|
||||
|
||||
/**
|
||||
* Form for acknowledge commands
|
||||
* Form for problem acknowledgements
|
||||
*/
|
||||
class AcknowledgeForm extends CommandForm
|
||||
{
|
||||
|
@ -90,7 +91,7 @@ class AcknowledgeForm extends CommandForm
|
|||
);
|
||||
|
||||
if ($this->getRequest()->getPost('expire', '0') === '1') {
|
||||
$now = new PhpDateTime();
|
||||
$now = new DateTime();
|
||||
$interval = new DateInterval('PT1H'); // Add 3600 seconds
|
||||
$now->add($interval);
|
||||
|
||||
|
@ -162,7 +163,7 @@ class AcknowledgeForm extends CommandForm
|
|||
{
|
||||
$expireTime = -1;
|
||||
if ($this->getValue('expire')) {
|
||||
$time = new PhpDateTime($this->getValue('expiretime'));
|
||||
$time = new DateTime($this->getValue('expiretime'));
|
||||
$expireTime = $time->getTimestamp();
|
||||
}
|
||||
return new Acknowledgement(
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
namespace Monitoring\Form\Command;
|
||||
|
||||
use \DateTime;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Zend_Form_Element_Checkbox;
|
||||
use DateTime as PhpDateTime;
|
||||
|
||||
/**
|
||||
* Form for RescheduleNextCheck
|
||||
|
@ -44,7 +44,7 @@ class RescheduleNextCheckForm extends WithChildrenCommandForm
|
|||
protected function create()
|
||||
{
|
||||
|
||||
$now = new PhpDateTime();
|
||||
$now = new DateTime();
|
||||
$dateElement = new DateTimePicker(
|
||||
array(
|
||||
'name' => 'checktime',
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
|
||||
namespace Monitoring\Form\Command;
|
||||
|
||||
use \DateTime;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Protocol\Commandpipe\Downtime;
|
||||
use Icinga\Protocol\Commandpipe\Comment;
|
||||
use \DateTime as PhpDateTime;
|
||||
use \DateInterval;
|
||||
use \Zend_Form_Element_Text;
|
||||
use \Zend_Validate_GreaterThan;
|
||||
|
@ -75,7 +75,7 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm
|
|||
{
|
||||
$out = array();
|
||||
|
||||
$dateTimeObject = new PhpDateTime();
|
||||
$dateTimeObject = new DateTime();
|
||||
$out[] = $dateTimeObject->format($this->getDateFormat());
|
||||
|
||||
$dateInterval = new DateInterval(self::DEFAULT_ENDTIME_INTERVAL);
|
||||
|
@ -304,8 +304,8 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm
|
|||
if ($this->getValue('type') === self::TYPE_FLEXIBLE) {
|
||||
$duration = ($this->getValue('hours')*3600) + ($this->getValue('minutes')*60);
|
||||
}
|
||||
$starttime = new PhpDateTime($this->getValue('starttime'));
|
||||
$endtime = new PhpDateTime($this->getValue('endtime'));
|
||||
$starttime = new DateTime($this->getValue('starttime'));
|
||||
$endtime = new DateTime($this->getValue('endtime'));
|
||||
|
||||
$downtime = new Downtime(
|
||||
$starttime->getTimestamp(),
|
||||
|
|
Loading…
Reference in New Issue