mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Merge pull request #4285 from Icinga/bugfix/curl-monitoring-service-show-4281
CheckNowCommandForm#init(): set submit label
This commit is contained in:
commit
91d4669dcb
@ -737,6 +737,7 @@ class Form extends Zend_Form
|
|||||||
/**
|
/**
|
||||||
* Get whether the form is an API target
|
* Get whether the form is an API target
|
||||||
*
|
*
|
||||||
|
* @todo This should probably only return true if the request is also an api request
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getIsApiTarget()
|
public function getIsApiTarget()
|
||||||
@ -1157,6 +1158,7 @@ class Form extends Zend_Form
|
|||||||
|
|
||||||
$formData = $this->getRequestData();
|
$formData = $this->getRequestData();
|
||||||
if ($this->getIsApiTarget()
|
if ($this->getIsApiTarget()
|
||||||
|
// TODO: Very very bad, wasSent() must not be bypassed if it's only an api request but not an qpi target
|
||||||
|| $this->getRequest()->isApiRequest()
|
|| $this->getRequest()->isApiRequest()
|
||||||
|| $this->getUidDisabled()
|
|| $this->getUidDisabled()
|
||||||
|| $this->wasSent($formData)
|
|| $this->wasSent($formData)
|
||||||
@ -1170,6 +1172,7 @@ class Form extends Zend_Form
|
|||||||
&& (($this->onSuccess !== null && false !== call_user_func($this->onSuccess, $this))
|
&& (($this->onSuccess !== null && false !== call_user_func($this->onSuccess, $this))
|
||||||
|| ($this->onSuccess === null && false !== $this->onSuccess()))
|
|| ($this->onSuccess === null && false !== $this->onSuccess()))
|
||||||
) {
|
) {
|
||||||
|
// TODO: Still bad. An api target must not behave as one if it's not an api request
|
||||||
if ($this->getIsApiTarget() || $this->getRequest()->isApiRequest()) {
|
if ($this->getIsApiTarget() || $this->getRequest()->isApiRequest()) {
|
||||||
// API targets and API requests will never redirect but immediately respond w/ JSON-encoded
|
// API targets and API requests will never redirect but immediately respond w/ JSON-encoded
|
||||||
// notifications
|
// notifications
|
||||||
@ -1189,6 +1192,7 @@ class Form extends Zend_Form
|
|||||||
} else {
|
} else {
|
||||||
$this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl();
|
$this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl();
|
||||||
}
|
}
|
||||||
|
// TODO: Still bad. An api target must not behave as one if it's not an api request
|
||||||
} elseif ($this->getIsApiTarget() || $this->getRequest()->isApiRequest()) {
|
} elseif ($this->getIsApiTarget() || $this->getRequest()->isApiRequest()) {
|
||||||
$this->getResponse()->json()->setFailData($this->getMessages())->sendResponse();
|
$this->getResponse()->json()->setFailData($this->getMessages())->sendResponse();
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
|
|||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setAttrib('class', 'inline');
|
$this->setAttrib('class', 'inline');
|
||||||
|
$this->setSubmitLabel($this->translate('Check now'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user