[icinga-checkins] icinga.org: icingaweb2-module-director/master: PropertymodifierTable: show target column if any

git at icinga.org git at icinga.org
Thu Oct 6 21:38:03 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Oct  6 19:37:01 2016 +0000

PropertymodifierTable: show target column if any

refs #12856

---

 application/tables/PropertymodifierTable.php |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/application/tables/PropertymodifierTable.php b/application/tables/PropertymodifierTable.php
index 3bf9bf5..bc708c3 100644
--- a/application/tables/PropertymodifierTable.php
+++ b/application/tables/PropertymodifierTable.php
@@ -12,7 +12,9 @@ class PropertymodifierTable extends QuickTable
             'id'                => 'm.id',
             'source_id'         => 'm.source_id',
             'source_name'       => 's.source_name',
-            'property_name'     => 'm.property_name',
+            'property'          => 'CASE WHEN m.target_property IS NULL'
+                                 . ' THEN m.property_name'
+                                 . " ELSE m.target_property || ' <- ' || m.property_name END",
             'provider_class'    => 'm.provider_class',
             'priority'          => 'm.priority',
         );
@@ -33,7 +35,7 @@ class PropertymodifierTable extends QuickTable
     {
         $view = $this->view();
         return array(
-            'property_name'     => $view->translate('Property'),
+            'property' => $view->translate('Property'),
         );
     }
 
@@ -48,7 +50,8 @@ class PropertymodifierTable extends QuickTable
             array('m' => 'import_row_modifier'),
             's.id = m.source_id',
             array()
-        )->order('m.property_name');
+        )->order('property')
+        ->order('priority');
 
         return $query;
     }



More information about the icinga-checkins mailing list