Code

Added copy & paste for user mail
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Mar 2006 07:56:01 +0000 (07:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Mar 2006 07:56:01 +0000 (07:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2872 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/mail/class_mailAccount.inc
plugins/personal/mail/copypaste.tpl [new file with mode: 0644]

index ee74aafce87b44b068459c130e1363a256d166c7..13256a3cf56ddcb7a858c82e0b653cd5a9f7bbe4 100644 (file)
@@ -703,6 +703,7 @@ $ldap->modify ($this->attrs);
   /* Check formular input */
   function check()
   {
+    if(!$this->is_account) return(array());
     $ldap= $this->config->get_ldap_link();
 
     $message= array();
@@ -725,6 +726,7 @@ $ldap->modify ($this->attrs);
       }
     }
     $ldap->cd($this->config->current['BASE']);
+    echo "(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".$this->mail."))(!   (uid=".$this->uid."))(!(cn=".$this->uid.")))";
     $ldap->search ("(&(!(objectClass=gosaUserTemplate))(objectClass=gosaMailAccount)(|(mail=".$this->mail.")(gosaMailAlternateAddress=".$this->mail."))(!(uid=".$this->uid."))(!(cn=".$this->uid.")))", array("uid"));
     if ($ldap->count() != 0){
       $message[]= _("The primary address you've entered is already in use.");
@@ -859,6 +861,28 @@ $ldap->modify ($this->attrs);
     return ($name);
   }
 
+  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);
+    return($smarty->fetch(get_template_path("copypaste.tpl",TRUE, dirname(__FILE__))));
+  }
+
+  function saveCopyDialog()
+  {
+    if(!$this->is_account) return;  
+
+    /* Execute to save mailAlternateAddress && gosaMailForwardingAddress */
+    $this->execute();
+    
+    if(isset($_POST['mail'])){
+      $this->mail = $_POST['mail'];
+    }
+
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/personal/mail/copypaste.tpl b/plugins/personal/mail/copypaste.tpl
new file mode 100644 (file)
index 0000000..fdfca59
--- /dev/null
@@ -0,0 +1,51 @@
+<h2>{t}Mail settings{/t}</h2>
+<table style='width:100%;'>
+       <tr>
+               <td style='width:50%;vertical-align:top;'>
+                       <table>
+                               <tr>
+                                       <td><label for="mail">{t}Primary address{/t}</label>{$must}</td>
+                                       <td><input id="mail" name="mail" size=35 maxlength=65 value="{$mail}"></td>
+                               </tr>
+                               <tr>
+                                       <td colspan="2">
+                                                 <p style="margin-bottom:0px;">
+    <b><label for="forwarder_list">{t}Forward messages to{/t}</label></b>
+   </p>
+   <select id="gosaMailForwardingAddress" style="width:100%; height:100px;" name="forwarder_list[]" size=15 multiple >
+            {html_options values=$gosaMailForwardingAddress output=$gosaMailForwardingAddress}
+            <option disabled>&nbsp;</option>
+   </select>
+   <br>
+   <input name="forward_address" size=20 align="middle" maxlength=65   value="">
+   <input type="submit" value="{t}Add{/t}" name="add_forwarder"        >&nbsp;
+   <input type="submit" value="{t}Add local{/t}" name="add_local_forwarder"    >&nbsp;
+   <input type="submit" value="{t}Delete{/t}" name="delete_forwarder"  >
+
+                                       </td>
+                               </tr>
+                       </table>
+               </td>
+               <td style="vertical-algin:top;">
+                       <table>
+                               <tr>
+                                       <td style="vertical-align:top;">
+                                               <h2>
+                                                       <img class="center" alt="" align="middle" src="images/alternatemail.png" />
+                                                       <label for="alternates_list">{t}Alternative addresses{/t}</label>
+                                               </h2>
+                                               <select id="alternates_list" style="width:100%;height:100px;" name="alternates_list[]" size="15"
+                                                        multiple title="{t}List of alternative mail addresses{/t}"> 
+                                                               {html_options values=$gosaMailAlternateAddress output=$gosaMailAlternateAddress}
+                                                               <option disabled>&nbsp;</option>
+                                               </select>
+                                               <br/>
+                                               <input name="alternate_address" size="30" align="middle" maxlength="65" value="">
+                                               <input type=submit value="{t}Add{/t}" name="add_alternate">
+                                               <input type=submit value="{t}Delete{/t}" name="delete_alternate">
+                                       </td>
+                               </tr>
+                       </table>
+               </td>           
+       </tr>
+</table>