Author:   Lars Michelsen <[email protected]>
Date:     Sat Jul 14 11:49:41 2012 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sat Jul 14 11:49:41 2012 +0200

Added options dialog_ack_sticky/notify/persist to control preselections in ack 
dialog

---

 ChangeLog                                        |    2 +
 docs/en_US/nagvis_config_format_description.html |   25 ++++++++++++++-
 etc/nagvis.ini.php-sample                        |    5 +++
 share/server/core/classes/GlobalMainCfg.php      |   37 +++++++++++++++++----
 share/server/core/classes/NagVisViewAck.php      |    6 ++--
 5 files changed, 64 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96159ad..381f0af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,8 @@ Frontend
   * Added rotations to sidebar
   * Info page shows json_encode/json_decode capability of used PHP
   * Host/Service problems can now be acknowledged from host/service context 
menus
+    Options dialog_ack_sticky, dialog_ack_notify, dialog_ack_persist control
+    the preselected checkboxes in this dialog
   * Bugfix: When releasing relative coordinates the parent object is not 
highlighted anymore
   * Bugfix: Fixed bug which suppressed the hover menu on overview page in some 
cases
   * Bugfix: Fixed some IE css warning message
diff --git a/docs/en_US/nagvis_config_format_description.html 
b/docs/en_US/nagvis_config_format_description.html
index 3cd2b40..1980675 100644
--- a/docs/en_US/nagvis_config_format_description.html
+++ b/docs/en_US/nagvis_config_format_description.html
@@ -70,8 +70,31 @@
               Object controls are for example the modify, delete and move 
icons.</td>
         </tr>
         <tr>
-        <td>dateformat</td><td> Y-m-d H:i:s </td><td> The format of date and 
time shown in NagVis. Available options like in <a 
href="http://www.php.net/date"; target="_blank">date</a> function of php</td>
+          <td>dateformat</td>
+          <td> Y-m-d H:i:s </td>
+          <td> The format of date and time shown in NagVis. Available options 
like 
+               in <a href="http://www.php.net/date"; target="_blank">date</a> 
function of php</td>
         </tr>
+
+        <tr>
+          <td>dialog_ack_sticky</td>
+          <td>1</td>
+          <td>Is set to 1 by default to enable the preselection of the "sticky 
acknowledgement"
+              checkbox in the problem acknowledgement dialog.</td>
+        </tr>
+        <tr>
+          <td>dialog_ack_notify</td>
+          <td>1</td>
+          <td>Is set to 1 by default to enable the preselection of the "notify 
acknowledgement"
+              checkbox in the problem acknowledgement dialog.</td>
+        </tr>
+        <tr>
+          <td>dialog_ack_persist</td>
+          <td>0</td>
+          <td>Is set to 0 by default to disable the preselection of the 
"persist comment"
+              checkbox in the problem acknowledgement dialog.</td>
+        </tr>
+
         <tr>
         
<td><strike>displayheader</strike></td><td><strike>1</strike></td><td><strike>Show
 header menu in maps</strike>. <font color="#ff0000">(Deprecated in 1.4. Moved 
as option &quot;headermenu&quot; to default and index section.)</font></td>
         </tr>
diff --git a/etc/nagvis.ini.php-sample b/etc/nagvis.ini.php-sample
index 05f0d53..21fc54c 100644
--- a/etc/nagvis.ini.php-sample
+++ b/etc/nagvis.ini.php-sample
@@ -40,6 +40,11 @@
 ; Dateformat of the time/dates shown in nagvis (For valid format see PHP docs)
 ;dateformat="Y-m-d H:i:s"
 ;
+; Used to configure the preselected options in the "acknowledge problem" dialog
+; dialog_ack_sticky=1
+; dialog_ack_notify=1
+; dialog_ack_persist=0
+;
 ; File group and mode are applied to all files which are written by NagVis.
 ; Usualy these values can be left as they are. In some rare cases you might
 ; want to change these values to make the files writeable/readable by some 
other
diff --git a/share/server/core/classes/GlobalMainCfg.php 
b/share/server/core/classes/GlobalMainCfg.php
index c17714a..159a4dc 100644
--- a/share/server/core/classes/GlobalMainCfg.php
+++ b/share/server/core/classes/GlobalMainCfg.php
@@ -77,11 +77,34 @@ class GlobalMainCfg {
                    'must'     => 1,
                     'editable' => 1,
                     'default'  => 10,
-                    'match'    => MATCH_INTEGER),
-                'dateformat' => Array('must' => 1,
+                    'match'    => MATCH_INTEGER
+                ),
+                'dateformat' => Array(
+                    'must'     => 1,
                     'editable' => 1,
-                    'default' => 'Y-m-d H:i:s',
-                    'match' => MATCH_STRING),
+                    'default'  => 'Y-m-d H:i:s',
+                    'match'    => MATCH_STRING
+                ),
+
+                'dialog_ack_sticky' => Array(
+                    'must'     => 1,
+                    'editable' => 1,
+                    'default'  => 1,
+                    'match'    => MATCH_BOOLEAN
+                ),
+                'dialog_ack_notify' => Array(
+                    'must'     => 1,
+                    'editable' => 1,
+                    'default'  => 1,
+                    'match'    => MATCH_BOOLEAN
+                ),
+                'dialog_ack_persist' => Array(
+                    'must'     => 1,
+                    'editable' => 1,
+                    'default'  => 0,
+                    'match'    => MATCH_BOOLEAN
+                ),
+
                 'displayheader' => Array('must' => 1,
                     'editable' => 1,
                     'deprecated' => 1,
@@ -1457,7 +1480,7 @@ class GlobalMainCfg {
                     foreach($arrValidConfig AS $key => &$val) {
                         if((isset($val['must']) && $val['must'] == '1')) {
                             // value is "must"
-                            if($this->getValue($type,$key) == '') {
+                            if($this->getValue($type,$key) === null) {
                                 // a "must" value is missing or empty
                                 throw new NagVisException(l('The needed 
attribute [ATTRIBUTE] is missing in section [TYPE] in main configuration file. 
Please take a look at the documentation.',
                                                             Array('ATTRIBUTE' 
=> $key, 'TYPE' => $type)));
@@ -1672,13 +1695,13 @@ class GlobalMainCfg {
                 if(isset($this->config[$sec]) && 
is_array($this->config[$sec])) {
                     return $this->validConfig['rotation'][$var]['default'];
                 } else {
-                    return FALSE;
+                    return null;
                 }
             } else {
                 return $this->validConfig[$sec][$var]['default'];
             }
         } else {
-            return FALSE;
+            return null;
         }
     }
 
diff --git a/share/server/core/classes/NagVisViewAck.php 
b/share/server/core/classes/NagVisViewAck.php
index ac3978f..4663ff0 100644
--- a/share/server/core/classes/NagVisViewAck.php
+++ b/share/server/core/classes/NagVisViewAck.php
@@ -59,9 +59,9 @@ class NagVisViewAck {
         $s .= $this->hidden('map', $attrs['map']);
         $s .= $this->hidden('object_id', $attrs['object_id']);
         $s .= $this->input(l('Comment'), 'comment');
-        $s .= $this->checkbox(l('Sticky'),            'sticky', true);
-        $s .= $this->checkbox(l('Send notification'), 'notify', true);
-        $s .= $this->checkbox(l('Persist comment'),   'persist');
+        $s .= $this->checkbox(l('Sticky'),            'sticky',  cfg('global', 
'dialog_ack_sticky'));
+        $s .= $this->checkbox(l('Send notification'), 'notify',  cfg('global', 
'dialog_ack_notify'));
+        $s .= $this->checkbox(l('Persist comment'),   'persist', cfg('global', 
'dialog_ack_persist'));
         $s .= $this->submit(l('Acknowledge'));
         $s .= $this->form_end();
 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to