Code

Some ogroup fixes for copy & paste
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Nov 2006 10:01:27 +0000 (10:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Nov 2006 10:01:27 +0000 (10:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5122 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_mailogroup.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/ogroups/paste_generic.tpl [new file with mode: 0644]
plugins/admin/ogroups/paste_mail.tpl [new file with mode: 0644]
plugins/admin/ogroups/tabs_ogroups.inc

index ed9d9ed6d3aed3bb6c9e494cb5be2084c5b48b08..560e4653ca0dba81d43432618fb468505491b251 100644 (file)
@@ -26,8 +26,8 @@ class mailogroup extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
 
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
@@ -73,7 +73,7 @@ class mailogroup extends plugin
 
       /* Check if mail address is already in use */
       $ldap->cd($this->config->current['BASE']);
-      $ldap->search ("(&(!(objectClass=gosaUserTemplate))(|(mail=".$this->mail.         ")(gosaMailAlternateAddress=".$this->mail."))(!(cn=".$this->cn.")))", array("uid"));
+      $ldap->search ("(&(!(objectClass=gosaUserTemplate))(|(mail=".$this->mail.")(gosaMailAlternateAddress=".$this->mail."))(!(cn=".$this->cn.")))", array("uid"));
       if ($ldap->count() != 0){
         $message[]= _("The primary address you've entered is already in use.");
       }
@@ -134,13 +134,16 @@ class mailogroup extends plugin
 
   function getCopyDialog()
   {
-    $str  = "";
-    $str .= _("Phone number");
-    $str .= "&nbsp;<input type='text' name='mail' value='".$this->mail."'>";
-    return($str);
+    $str = "";
+    $smarty = get_smarty();
+    $smarty->assign("mail",     $this->mail);
+    $str = $smarty->fetch(get_template_path("paste_mail.tpl",TRUE,dirname(__FILE__)));
+    $ret = array();
+    $ret['string'] = $str;
+    $ret['status'] = "";
+    return($ret);
   }
 
-
   function saveCopyDialog()
   {
     if(isset($_POST['mail'])){
index d6021660e2c1c41db1597ddde45c4dab61ab4a81..09fba6b173dcf135311ce696315d78d20da52384 100644 (file)
@@ -453,6 +453,11 @@ class ogroupManagement extends plugin
         $dn       =   $this->ogrouplist[$s_entry]['dn'];
         $obj      =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn);
         $objNew   =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new");
+
+        $types_of_tabs = $obj->by_object['ogroup']->gosaGroupObjects;
+        $objNew->by_object['ogroup']->gosaGroupObjects = $types_of_tabs;    
+        $objNew->reload($types_of_tabs);
+
         $this->CopyPasteHandler->Copy($obj,$objNew);
       }
 
diff --git a/plugins/admin/ogroups/paste_generic.tpl b/plugins/admin/ogroups/paste_generic.tpl
new file mode 100644 (file)
index 0000000..8daafc6
--- /dev/null
@@ -0,0 +1,10 @@
+<table width='100%'>
+       <tr>
+               <td width='120'>
+                       <LABEL for="cn">{t}Group name{/t}</LABEL>{$must}
+               </td>
+               <td>
+                       <input type='text' id='cn' name='cn' value='{$cn}' size='40' title='{t}Please enter the new object group name{/t}'> 
+               </td>
+       </tr>
+</table>
diff --git a/plugins/admin/ogroups/paste_mail.tpl b/plugins/admin/ogroups/paste_mail.tpl
new file mode 100644 (file)
index 0000000..1930c44
--- /dev/null
@@ -0,0 +1,10 @@
+<table width='100%'>
+        <tr>
+                <td width='120'>
+                       <LABEL for="cn">{t}Mail{/t}</LABEL>{$must}
+               </td>
+               <td>
+                       <input type='text' id='main' name='mail' value='{$mail}' size='40' title='{t}Please enter a mail address{/t}'> 
+               </td>
+       </tr>
+</table>
index 5364185c103d5721f84fbe6f5fef697ca0bfc9dd..b1a1d1ffee5871150610447df08e729057edd78d 100644 (file)
@@ -200,10 +200,11 @@ class ogrouptabs extends tabs
 
       /* Don't touch base object */
       if ($name != 'ogroup'){
-        $obj->parent= &$this;
-        $obj->uid= $baseobject->uid;
-        $obj->sn= $baseobject->uid;
-        $obj->givenName= $baseobject->uid;
+        $obj->parent    = &$this;
+        $obj->uid       = $baseobject->uid;
+        $obj->cn        = $baseobject->cn;
+        $obj->sn        = $baseobject->uid;
+        $obj->givenName = $baseobject->uid;
         $this->by_object[$name]= $obj;
       }