[Kolab-devel] [issue3862] kronolith: new config option to hide 'save_as_new' button

Soenke Schwardt-Krummrich issues at kolab.org
Fri Sep 11 17:29:00 CEST 2009


New submission from Soenke Schwardt-Krummrich <schwardt at univention.de>:

This patch adds a new config option that is able to hide the
'save_as_new' button when editing events.

----------
files: t_kronolith_HK_UV_optionalSaveAsNewButton.diff
keyword: web client
messages: 21655
nosy: schwardt
status: unread
title: kronolith: new config option to hide 'save_as_new' button

______________________________________
Kolab issue tracker <issues at kolab.org>
<https://issues.kolab.org/issue3862>
______________________________________
-------------- next part --------------
Patch by schwardt at univention.de (Fri Sep 11 16:11:09 2009 +0200):

kronolith: new config option to hide 'save_as_new' button

This patch adds a new config option that is able to hide the
'save_as_new' button when editing events.


--- a/horde-webmail/kronolith/config/conf.php
+++ b/horde-webmail/kronolith/config/conf.php
@@ -4,6 +4,7 @@
 $conf['calendar']['driver'] = 'kolab';
 $conf['calendar']['day']['inline_time'] = false;
 $conf['calendar']['week']['inline_time'] = false;
+$conf['calendar']['edit']['save_as_new'] = true;
 $conf['storage']['driver'] = 'kolab';
 $conf['storage']['default_domain'] = '';
 $conf['storage']['freebusy']['protocol'] = 'https';
--- a/horde-webmail/kronolith/config/conf.xml
+++ b/horde-webmail/kronolith/config/conf.xml
@@ -17,6 +17,12 @@
    <case name="kolab" desc="Kolab" />
   </configswitch>
 
+  <configsection name="edit">
+   <configheader>Display Settings For Events Edit Dialog</configheader>
+   <configboolean name="save_as_new" desc="Should we display a 'save_as_new' button when modifying events?">true</configboolean>
+  </configsection>
+
+
   <configsection name="week">
    <configheader>Display Settings For Week View</configheader>
    <configboolean name="inline_time" desc="Should we display time range of each event in week view?">false</configboolean>
--- a/horde-webmail/kronolith/lib/Views/EditEvent.php
+++ b/horde-webmail/kronolith/lib/Views/EditEvent.php
@@ -36,6 +36,7 @@ class Kronolith_View_EditEvent {
 
     function html($active = true)
     {
+        global $conf;
         require_once 'Horde/Identity.php';
         $identity = &Identity::singleton();
 
@@ -76,7 +77,9 @@ class Kronolith_View_EditEvent {
             (!empty($GLOBALS['conf']['hooks']['permsdenied']) ||
              Kronolith::hasPermission('max_events') === true ||
              Kronolith::hasPermission('max_events') > Kronolith::countEvents())) {
-            $buttons[] = '<input type="submit" class="button" name="saveAsNew" value="' . _("Save As New") . '" onclick="return checkCategory();" />';
+             if ( isset($conf['calendar']['edit']['save_as_new']) ? $conf['calendar']['edit']['save_as_new'] : true ) {
+                $buttons[] = '<input type="submit" class="button" name="saveAsNew" value="' . _("Save As New") . '" onclick="return checkCategory();" />';
+             }
         } else {
             if (!$this->event->isRemote()) {
                 $buttons[] = '<input type="submit" class="button" name="save" value="' . _("Save Event") . '" onclick="return checkCategory();" />';
@@ -86,7 +89,9 @@ class Kronolith_View_EditEvent {
                     (!empty($conf['hooks']['permsdenied']) ||
                      Kronolith::hasPermission('max_events') === true ||
                      Kronolith::hasPermission('max_events') > Kronolith::countEvents())) {
-                    $buttons[] = '<input type="submit" class="button" name="saveAsNew" value="' . _("Save As New") . '" onclick="return checkCategory();" />';
+                    if ( isset($conf['calendar']['edit']['save_as_new']) ? $conf['calendar']['edit']['save_as_new'] : true ) {
+                        $buttons[] = '<input type="submit" class="button" name="saveAsNew" value="' . _("Save As New") . '" onclick="return checkCategory();" />';
+                    }
                 }
             }
         }


More information about the devel mailing list