From: hickert Date: Tue, 27 Apr 2010 11:49:32 +0000 (+0000) Subject: Updated copy & paste for mail accounts X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1b2d3a6b1bd5c0afd5c9031e85257f5735c93a70;p=gosa.git Updated copy & paste for mail accounts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17880 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index b0c2024ca..b57a751ea 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -1134,42 +1134,65 @@ class mailAccount extends plugin */ function getCopyDialog() { - if(!$this->is_account) return(""); - $smarty = get_smarty(); - $smarty->assign("mail",$this->mail); - $smarty->assign("gosaMailAlternateAddress",$this->gosaMailAlternateAddress); - $smarty->assign("gosaMailForwardingAddress",$this->gosaMailForwardingAddress); - $str = $smarty->fetch(get_template_path("copypaste.tpl",TRUE, dirname(__FILE__))); - - $ret = array(); - $ret['status'] = ""; - $ret['string'] = $str; - return($ret); + if(!$this->is_account) return(""); + $smarty = get_smarty(); + $smarty->assign("mail",$this->mail); + $smarty->assign("gosaMailAlternateAddress",$this->gosaMailAlternateAddress); + $smarty->assign("gosaMailForwardingAddress",$this->gosaMailForwardingAddress); + + $smarty->assign("domainSelectionEnabled", $this->mailMethod->domainSelectionEnabled()); + $smarty->assign("MailDomains", $this->mailDomainParts); + $smarty->assign("MailDomain" , $this->mailDomainPart); + $smarty->assign("MailServers", $this->mailMethod->getMailServers()); + $smarty->assign("isModifyableMail" , $this->mailMethod->isModifyableMail()); + + $str = $smarty->fetch(get_template_path("copypaste.tpl",TRUE, dirname(__FILE__))); + + $ret = array(); + $ret['status'] = ""; + $ret['string'] = $str; + return($ret); } - + /*! \brief save_object for copy&paste vars */ function saveCopyDialog() { - if(!$this->is_account) return; + if(!$this->is_account) return; - /* Execute to save mailAlternateAddress && gosaMailForwardingAddress */ - $this->execute(); - if(isset($_POST['mail'])){ - $this->mail = $_POST['mail']; - } + /* Execute to save mailAlternateAddress && gosaMailForwardingAddress */ + $this->execute(); + if(isset($_POST['mail'])){ + $this->mail = $_POST['mail']; + } } - + /*! \brief Prepare this account to be copied */ function PrepareForCopyPaste($source) { - plugin::PrepareForCopyPaste($source); + plugin::PrepareForCopyPaste($source); + + /* Reset alternate mail addresses */ + $this->gosaMailAlternateAddress = array(); + + + /* If the doamin part is selectable, we have to split the mail address + */ + if($this->mailMethod->domainSelectionEnabled()){ + $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail); + $this->mail = preg_replace("/@.*$/","\\1",$this->mail); + if(!in_array($this->mailDomainPart,$this->mailDomainParts)){ + $this->mailDomainParts[] = $this->mailDomainPart; + } + } - /* Reset alternate mail addresses */ - $this->gosaMailAlternateAddress = array(); + /* Convert start/stop dates */ +#TODO: use date format + $this->gosaVacationStart= date('d.m.Y', $this->gosaVacationStart); + $this->gosaVacationStop= date('d.m.Y', $this->gosaVacationStop); } diff --git a/gosa-plugins/mail/personal/mail/copypaste.tpl b/gosa-plugins/mail/personal/mail/copypaste.tpl index 8ae2a947c..8e89a38eb 100644 --- a/gosa-plugins/mail/personal/mail/copypaste.tpl +++ b/gosa-plugins/mail/personal/mail/copypaste.tpl @@ -1,9 +1,24 @@

{t}Mail settings{/t}

- {$must} - + + + +
{$must} + {if !$isModifyableMail && $initially_was_account} + + {else} + {if $domainSelectionEnabled} + + @ + {else} + + {/if} + {/if} +