Commit ff7c2eec authored by Franco Fichtner's avatar Franco Fichtner

src: fix all the style

parent 8b05e4bb
......@@ -75,12 +75,15 @@ class SettingsController extends ApiControllerBase
if ($node != null) {
$result = array("result" => "failed", "validations" => array());
$jobInfo = $this->request->getPost("job");
if ( $node->origin->__toString() != "cron" ){
if ( $jobInfo["command"]!=$node->command->__toString() ) {
$result["validations"]["job.command"] = "This item has been created by another service, command and parameter may not be changed.";
if ($node->origin->__toString() != "cron") {
if ($jobInfo["command"]!=$node->command->__toString()) {
$result["validations"]["job.command"] = "This item has been created by " .
"another service, command and parameter may not be changed.";
}
if ( $jobInfo["parameters"]!=$node->parameters->__toString() ) {
$result["validations"]["job.parameters"] = "This item has been created by another service, command and parameter may not be changed. (was: " . $node->parameters->__toString() . " )";
if ($jobInfo["parameters"]!=$node->parameters->__toString()) {
$result["validations"]["job.parameters"] = "This item has been created by " .
"another service, command and parameter may not be changed. (was: " .
$node->parameters->__toString() . " )";
}
}
......@@ -96,7 +99,8 @@ class SettingsController extends ApiControllerBase
}
if (count($result['validations']) == 0) {
// we've already performed a validation, prevent issues from other items in the model reflecting back to us.
// we've already performed a validation, prevent issues
// from other items in the model reflecting back to us.
$mdlCron->serializeToConfig($disable_validation = true);
// save config if validated correctly
......@@ -135,7 +139,8 @@ class SettingsController extends ApiControllerBase
}
if (count($result['validations']) == 0) {
// we've already performed a validation, prevent issues from other items in the model reflecting back to us.
// we've already performed a validation, prevent issues from
// other items in the model reflecting back to us.
$mdlCron->serializeToConfig($disable_validation = true);
// save config if validated correctly
......@@ -211,7 +216,9 @@ class SettingsController extends ApiControllerBase
*/
public function searchJobsAction()
{
// if ($this->request->isPost()) {
// if (!$this->request->isPost()) {
// return array();
// }
$this->sessionClose();
// fetch query parameters
$itemsPerPage = $this->request->getPost('rowCount', 'int', 9999);
......@@ -243,10 +250,7 @@ class SettingsController extends ApiControllerBase
);
$mdlCron = new Cron();
$grid = new UIModelGrid($mdlCron->jobs->job);
return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);
// } else {
// return array();
// }
return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment