From 96c99f864955b1534a8236f4fabbf91721739b65 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Jan 2010 13:54:34 +0000 Subject: [PATCH] Updated mailAccount to use new dialogs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15378 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../mail/personal/mail/class_mailAccount.inc | 22 +++--- .../class_mailAddressSelect.inc | 64 +++++++++++++++++ .../selectMailAddress-filter.tpl | 33 +++++++++ .../selectMailAddress-filter.xml | 45 ++++++++++++ .../selectMailAddress-list.tpl | 39 ++++++++++ .../selectMailAddress-list.xml | 72 +++++++++++++++++++ 6 files changed, 264 insertions(+), 11 deletions(-) create mode 100644 gosa-plugins/mail/personal/mail/mailAddressSelect/class_mailAddressSelect.inc create mode 100644 gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.tpl create mode 100644 gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.xml create mode 100644 gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.tpl create mode 100644 gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.xml diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index 7ef9e4171..29f21b808 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -74,7 +74,7 @@ class mailAccount extends plugin var $sieveManagementUsed = FALSE; var $vacationTemplates = array(); var $sieve_management = NULL; - var $selectMailAddress = FALSE; + var $mailAddressSelect = FALSE; var $initial_uid = ""; var $mailDomainPart = ""; var $mailDomainParts = array(); @@ -281,18 +281,18 @@ class mailAccount extends plugin ****************/ if (isset($_POST['add_local_forwarder'])){ - $this->selectMailAddress= new selectMailAddress($this->config, get_userinfo()); + $this->mailAddressSelect= new mailAddressSelect($this->config, get_userinfo()); $this->dialog= TRUE; } - if (isset($_POST['selectMailAddress_cancel'])){ - $this->selectMailAddress= FALSE; + if (isset($_POST['mailAddressSelect_cancel'])){ + $this->mailAddressSelect= FALSE; $this->dialog= FALSE; } - if (isset($_POST['selectMailAddress_save']) && $this->selectMailAddress instanceOf selectMailAddress){ + if (isset($_POST['mailAddressSelect_save']) && $this->mailAddressSelect instanceOf mailAddressSelect){ if($this->acl_is_writeable("gosaMailForwardingAddress")){ - $list = $this->selectMailAddress->save(); + $list = $this->mailAddressSelect->save(); foreach ($list as $entry){ $val = $entry['mail'][0]; if (!in_array ($val, $this->gosaMailAlternateAddress) && $val != $this->mail){ @@ -300,18 +300,18 @@ class mailAccount extends plugin $this->is_modified= TRUE; } } - $this->selectMailAddress= FALSE; + $this->mailAddressSelect= FALSE; $this->dialog= FALSE; } else { msg_dialog::display(_("Error"), _("Please select an entry!"), ERROR_DIALOG); } } - if($this->selectMailAddress instanceOf selectMailAddress){ + if($this->mailAddressSelect instanceOf mailAddressSelect){ $used = array(); $used['mail'] = array_values($this->gosaMailAlternateAddress); $used['mail'][] = $this->mail; - return($this->selectMailAddress->execute()); + return($this->mailAddressSelect->execute()); } if (isset($_POST['add_forwarder'])){ @@ -344,9 +344,9 @@ class mailAccount extends plugin if (isset($_POST['delete_forwarder'])){ $this->delForwarder ($_POST['forwarder_list']); } - if ($this->selectMailAddress instanceOf selectMailAddress){ + if ($this->mailAddressSelect instanceOf mailAddressSelect){ - return($this->selectMailAddress->execute()); + return($this->mailAddressSelect->execute()); } diff --git a/gosa-plugins/mail/personal/mail/mailAddressSelect/class_mailAddressSelect.inc b/gosa-plugins/mail/personal/mail/mailAddressSelect/class_mailAddressSelect.inc new file mode 100644 index 000000000..31e92c53d --- /dev/null +++ b/gosa-plugins/mail/personal/mail/mailAddressSelect/class_mailAddressSelect.inc @@ -0,0 +1,64 @@ +config = $config; + $this->ui = $ui; + + $this->storagePoints = array(get_ou("userRDN")); + +# // Build filter +# if (session::global_is_set(get_class($this)."_filter")){ +# $filter= session::global_get(get_class($this)."_filter"); +# } else { + $filter = new filter(get_template_path("selectMailAddress-filter.xml", true, dirname(__FILE__))); + $filter->setObjectStorage($this->storagePoints); +# } + $this->setFilter($filter); + + // Build headpage + $headpage = new listing(get_template_path("selectMailAddress-list.xml", true, dirname(__FILE__))); + $headpage->setFilter($filter); + parent::__construct($config, $ui, "mail", $headpage); + } + + function save() + { + $act = $this->detectPostActions(); + $headpage = $this->getHeadpage(); + if(!isset($act['targets'])) return(array()); + $ret = array(); + foreach($act['targets'] as $dn){ + $ret[] = $headpage->getEntry($dn); + } + return($ret); + } +} +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.tpl b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.tpl new file mode 100644 index 000000000..ba7af5cde --- /dev/null +++ b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.tpl @@ -0,0 +1,33 @@ +
+

+ [F]{t}Filter{/t} +

+
+ +
+ +
+ + {$SCOPE} + + + + + + +
+ + + {$NAME} +
+ + + + + +
+ {$APPLY} +
+
diff --git a/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.xml b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.xml new file mode 100644 index 000000000..4ae62a454 --- /dev/null +++ b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-filter.xml @@ -0,0 +1,45 @@ + + + + + users + + true + + + + + LDAPBlacklist + (&(objectClass=gosaAccount)(mail=*)$NAME) + dn + objectClass + cn + description + mail + uid + sn + givenName + gotoHotplugDevice + + auto + + + + textfield + NAME + 20 + 60 + + + (|(cn=*$*)(description=*$*)(mail=*$*)) + true + + LDAPBlacklist + (&(objectClass=gosaAccount)(|(cn=*$NAME*)(description=*$NAME*)(mail=*$NAME*))) + cn + 0.5 + 3 + + + + diff --git a/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.tpl b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.tpl new file mode 100644 index 000000000..7a1c9209a --- /dev/null +++ b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.tpl @@ -0,0 +1,39 @@ + + + + + + + +
+
+

 {$HEADLINE} {$SIZELIMIT}

+
+ +
+
+ + +
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR} {t}Base{/t} {$BASE}  {$SEPARATOR}  {$ACTIONS}
+
+
+ +
+
+ + + + {$LIST} +
+ {$FILTER} +
+ + +

+ +   + +

+ + + diff --git a/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.xml b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.xml new file mode 100644 index 000000000..205ccff12 --- /dev/null +++ b/gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.xml @@ -0,0 +1,72 @@ + + + + + true + false + true + true + + + 1 + + + + gosaAccount + users + user + plugins/mail/images/envelope.png + + + + + + + |20px;c|||| + + + %{filter:objectType(dn,objectClass)} + + + + %{filter:departmentLink(row,dn,description)} + 2 + + + + %{filter:objectType(dn,objectClass)} + + + + + givenName + string + %{givenName} + true + + + + + sn + string + %{sn} + true + + + + + mail + string + %{mail} + true + + +
+ + + + + + + +
-- 2.30.2