Skip to content

Commit

Permalink
Conform to coding guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
majentsch committed May 7, 2015
1 parent 1586275 commit 3187975
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
31 changes: 15 additions & 16 deletions modules/monitoring/application/controllers/DowntimesController.php
Expand Up @@ -36,9 +36,9 @@ class Monitoring_DowntimesController extends Controller
public function init()
{
$this->filter = Filter::fromQueryString(str_replace(
'downtime_id',
'downtime_internal_id',
(string)$this->params
'downtime_id',
'downtime_internal_id',
(string)$this->params
));
$this->downtimes = $this->backend->select()->from('downtime', array(
'id' => 'downtime_internal_id',
Expand Down Expand Up @@ -66,22 +66,21 @@ public function init()

if (false === $this->downtimes) {
throw new Zend_Controller_Action_Exception(
$this->translate('Downtime not found')
$this->translate('Downtime not found')
);
}

$this->getTabs()
->add(
'downtimes',
array(
'title' => $this->translate(
'Display detailed information about multiple downtimes.'
),
'icon' => 'plug',
'label' => $this->translate('Downtimes'),
'url' =>'monitoring/downtimes/show'
)
)->activate('downtimes')->extend(new DashboardAction());
$this->getTabs()->add(
'downtimes',
array(
'title' => $this->translate(
'Display detailed information about multiple downtimes.'
),
'icon' => 'plug',
'label' => $this->translate('Downtimes'),
'url' =>'monitoring/downtimes/show'
)
)->activate('downtimes');

foreach ($this->downtimes as $downtime) {
if (isset($downtime->service_description)) {
Expand Down
Expand Up @@ -84,7 +84,7 @@ public function onSuccess()
$delDowntime = new DeleteDowntimeCommand();
$delDowntime->setDowntimeId($id);
$delDowntime->setDowntimeType(
isset($firstDowntime->service_description) ?
isset($firstDowntime->service_description) ?
DeleteDowntimeCommand::DOWNTIME_TYPE_SERVICE :
DeleteDowntimeCommand::DOWNTIME_TYPE_HOST
);
Expand Down
Expand Up @@ -12,6 +12,11 @@
*/
class DeleteDowntimesCommandForm extends CommandForm
{
/**
* The downtimes to delete on success
*
* @var array
*/
protected $downtimes;

/**
Expand All @@ -31,12 +36,12 @@ public function createElements(array $formData = array())
{
$this->addElements(array(
array(
'hidden',
'redirect',
array(
'decorators' => array('ViewHelper')
)
'hidden',
'redirect',
array(
'decorators' => array('ViewHelper')
)
)
));
return $this;
}
Expand All @@ -60,7 +65,7 @@ public function onSuccess()
$delDowntime = new DeleteDowntimeCommand();
$delDowntime->setDowntimeId($downtime->id);
$delDowntime->setDowntimeType(
isset($downtime->service_description) ?
isset($downtime->service_description) ?
DeleteDowntimeCommand::DOWNTIME_TYPE_SERVICE :
DeleteDowntimeCommand::DOWNTIME_TYPE_HOST
);
Expand All @@ -76,9 +81,9 @@ public function onSuccess()

/**
* Set the downtimes to be deleted upon success
*
*
* @param type $downtimes
*
*
* @return $this
*/
public function setDowntimes($downtimes)
Expand Down

0 comments on commit 3187975

Please sign in to comment.