From 2449f20d1df825f42879cb27ef212c1b4e5b0117 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 31 Aug 2010 10:14:50 +0000 Subject: [PATCH] We are now able to deactivate certain options git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19504 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_groupware.inc | 31 ++ .../groupware/personal/groupware/generic.tpl | 306 ++++++++++-------- 2 files changed, 204 insertions(+), 133 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_groupware.inc b/gosa-plugins/groupware/personal/groupware/class_groupware.inc index 78ef1b2c0..c2d6d5384 100644 --- a/gosa-plugins/groupware/personal/groupware/class_groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_groupware.inc @@ -29,6 +29,21 @@ class groupware extends plugin "dropOwnMails" ); + var $enabledFeatures = array( + "quotaUsage" => FALSE, + "quotaSize" => FALSE, + "mailFilter" => FALSE, + "alternateAddresses" => FALSE, + "forwardingAddresses" => FALSE, + "vacationMessage" => FALSE, + "mailBoxWarnLimit" => FALSE, + "mailBoxSendSizelimit" => FALSE, + "alternateAddresses" => FALSE, + "mailBoxHardSizelimit" => FALSE, + "mailBoxAutomaticRemoval" => FALSE, + "localDeliveryOnly" => FALSE, + "dropOwnMails" => FALSE); + var $flagAttrinutes = array("vacationEnabled","mailBoxWarnLimitEnabled","mailBoxSendSizelimitEnabled", "mailBoxHardSizelimitEnabled","mailBoxAutomaticRemovalEnabled","localDeliveryOnly","dropOwnMails"); @@ -81,6 +96,19 @@ class groupware extends plugin function execute() { + $this->enabledFeatures = array( + "quotaUsage" => TRUE, + "quotaSize" => TRUE, + "mailFilter" => TRUE, + "alternateAddresses" => TRUE, + "forwardingAddresses" => TRUE, + "vacationMessage" => TRUE, + "mailBoxWarnLimit" => TRUE, + "mailBoxSendSizelimit" => TRUE, + "mailBoxHardSizelimit" => TRUE, + "mailBoxAutomaticRemoval" => TRUE, + "localDeliveryOnly" => TRUE, + "dropOwnMails" => TRUE); // Register plugin execution $display = plugin::execute(); @@ -253,6 +281,9 @@ class groupware extends plugin foreach($plInfo['plProvidedAcls'] as $acl => $name){ $smarty->assign($acl."ACL", $this->getacl($acl)); } + foreach($this->enabledFeatures as $feature => $state){ + $smarty->assign($feature."_isActive", $state); + } $smarty->assign("mailLocations", array("tester")); if (count($this->vacationTemplates)){ diff --git a/gosa-plugins/groupware/personal/groupware/generic.tpl b/gosa-plugins/groupware/personal/groupware/generic.tpl index 447b377c3..42770a92c 100644 --- a/gosa-plugins/groupware/personal/groupware/generic.tpl +++ b/gosa-plugins/groupware/personal/groupware/generic.tpl @@ -23,6 +23,7 @@ {/render} + {if $quotaUsage_isActive} @@ -31,6 +32,8 @@ {/render} + {/if} + {if $quotaSize_isActive} @@ -39,6 +42,8 @@ {/render} + {/if} + {if $mailFilter_isActive} @@ -47,156 +52,179 @@ {/render} + {/if} -   - -

- {render acl=$alternateAddressesACL} - -
- {/render} - {render acl=$alternateAddressesACL} - - {/render} - {render acl=$alternateAddressesACL} - - {/render} - {render acl=$alternateAddressesACL} - - {/render} - + + {if !$alternateAddresses_isActive} + + {else} +   + +

+ {render acl=$alternateAddressesACL} + +
+ {/render} + {render acl=$alternateAddressesACL} + + {/render} + {render acl=$alternateAddressesACL} + + {/render} + {render acl=$alternateAddressesACL} + + {/render} + + {/if} -
- - - + {if !$forwardingAddresses_isActive} + + {else} + + + {/if} + +
+{if $vacationMessage_isActive || $forwardingAddresses_isActive} +
+ + + - - - -
-

+ {if $vacationMessage_isActive} +

- - - - - - - - - - - - - - + +
- {render acl=$vacationEnabledACL} - - {/render} - - {t}Activate vacation message{/t} -
 {t}from{/t} - {render acl=$vacationStartACL} - - {/render} - {if $vacationStartACL|regex_replace:"/[cdmr]/":"" == "w"} - - {/if} - {t}till{/t} - {render acl=$vacationStartACL} - - {/render} - {if $vacationStopACL|regex_replace:"/[cdmr]/":"" == "w"} - - {/if} -
- {render acl=$vacationMessageACL} - - {/render} -
- {if $displayTemplateSelector eq "true"} - {render acl=$vacationMessageACL} - + + + + + + + + + + + + + + - -
+ {render acl=$vacationEnabledACL} + + {/render} + + {t}Activate vacation message{/t} +
 {t}from{/t} + {render acl=$vacationStartACL} + + {/render} + {if $vacationStartACL|regex_replace:"/[cdmr]/":"" == "w"} + + {/if} + {t}till{/t} + {render acl=$vacationStartACL} + {/render} + {if $vacationStopACL|regex_replace:"/[cdmr]/":"" == "w"} + + {/if} +
{render acl=$vacationMessageACL} - + {/render} - {/if} -
+
+ {if $displayTemplateSelector eq "true"} + {render acl=$vacationMessageACL} + + {/render} + {render acl=$vacationMessageACL} + + {/render} + {/if} +
-
  -

- {render acl=$forwardingAddressesACL} - - {/render} -
- {render acl=$forwardingAddressesACL} - - {/render} - {render acl=$forwardingAddressesACL} -   - {/render} - {render acl=$forwardingAddressesACL} -   - {/render} - {render acl=$forwardingAddressesACL} - - {/render} + {/if} -
+
  +

+ {render acl=$forwardingAddressesACL} + + {/render} +
+ {render acl=$forwardingAddressesACL} + + {/render} + {render acl=$forwardingAddressesACL} +   + {/render} + {render acl=$forwardingAddressesACL} +   + {/render} + {render acl=$forwardingAddressesACL} + + {/render} +
+{/if} -
+{* Do not render the Flag list while there are none! *} +{if $mailBoxWarnLimit_isActive || $mailBoxSendSizelimit_isActive || + $mailBoxHardSizelimit_isActive || $mailBoxAutomaticRemoval_isActive || + $localDeliveryOnly_isActive || $dropOwnMails_isActive} +

{t}Mailbox options{/t}

+ {if $mailBoxWarnLimit_isActive} + {/if} + {if $mailBoxSendSizelimit_isActive} + {/if} + {if $mailBoxHardSizelimit_isActive} + {/if} + {if $mailBoxAutomaticRemoval_isActive} + {/if} + {if $localDeliveryOnly_isActive} + {/if} + {if $dropOwnMails_isActive} + {/if}
{render acl=$mailBoxWarnLimitACL} @@ -210,6 +238,8 @@ {/render}
{render acl=$mailBoxSendSizelimitACL} @@ -223,6 +253,8 @@ {/render}
{render acl=$mailBoxHardSizelimitACL} @@ -236,6 +268,8 @@ {/render}
{render acl=$mailBoxAutomaticRemovalACL} @@ -249,6 +283,8 @@ {/render}
{render acl=$localDeliveryOnlyACL} @@ -259,6 +295,8 @@ {t}User is only allowed to send and receive local mails{/t}
{render acl=$dropOwnMailsACL} @@ -269,7 +307,9 @@ {t}No delivery to own mailbox{/t}
+{/if} -- 2.30.2