[icinga-checkins] icinga.org: icingaweb2-module-director/master: Syncrule: load and render preview and run forms

git at icinga.org git at icinga.org
Mon Jun 27 09:17:09 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 6e560d2c0f8a1b7b1fc0607ffcb0cb4694df60f6
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=6e560d2c0f8a1b7b1fc0607ffcb0cb4694df60f6

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sat Jun 25 23:03:21 2016 +0200

Syncrule: load and  render preview and run forms

---

 application/controllers/SyncruleController.php |    9 +++++++++
 application/views/scripts/syncrule/index.phtml |    5 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/application/controllers/SyncruleController.php b/application/controllers/SyncruleController.php
index 057cd9a..5220120 100644
--- a/application/controllers/SyncruleController.php
+++ b/application/controllers/SyncruleController.php
@@ -28,6 +28,15 @@ class SyncruleController extends ActionController
         } else {
             $this->view->run = null;
         }
+        $this->view->checkForm = $this
+            ->loadForm('syncCheck')
+            ->setSyncRule($rule)
+            ->handleRequest();
+
+        $this->view->runForm = $this
+            ->loadForm('syncRun')
+            ->setSyncRule($rule)
+            ->handleRequest();
     }
 
     public function addAction()
diff --git a/application/views/scripts/syncrule/index.phtml b/application/views/scripts/syncrule/index.phtml
index 9ec3487..9ac398e 100644
--- a/application/views/scripts/syncrule/index.phtml
+++ b/application/views/scripts/syncrule/index.phtml
@@ -43,6 +43,8 @@ TODO: check whether...
       - there have been activities since then
 */ ?></p>
 <?php endif ?>
+<?= $this->checkForm ?>
+<?= $this->runForm ?>
 <?php if ($this->run): ?>
  <h3><?= $this->translate('Last sync run details') ?></h3>
  <?= $this->render('syncrule/syncRunDetails.phtml') ?><br />
@@ -51,8 +53,5 @@ TODO: check whether...
     $this->translate("It has been renamed since then, it's former name was %s"),
     $run->rule_name
 )) ?>
-
-<pre><?= $this->escape( print_r($this->run->getProperties(), 1)); ?></pre>
-
 <?php endif ?>
 <?php endif ?>



More information about the icinga-checkins mailing list