From b6b25edc93f63be561a7d5311ed1a73055cae4f6 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 15 Nov 2006 10:01:27 +0000 Subject: [PATCH] Some ogroup fixes for copy & paste git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5122 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_mailogroup.inc | 19 +++++++++++-------- .../admin/ogroups/class_ogroupManagement.inc | 5 +++++ plugins/admin/ogroups/paste_generic.tpl | 10 ++++++++++ plugins/admin/ogroups/paste_mail.tpl | 10 ++++++++++ plugins/admin/ogroups/tabs_ogroups.inc | 9 +++++---- 5 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 plugins/admin/ogroups/paste_generic.tpl create mode 100644 plugins/admin/ogroups/paste_mail.tpl diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc index ed9d9ed6d..560e4653c 100644 --- a/plugins/admin/ogroups/class_mailogroup.inc +++ b/plugins/admin/ogroups/class_mailogroup.inc @@ -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 .= " "; - 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'])){ diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index d6021660e..09fba6b17 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -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 index 000000000..8daafc6a2 --- /dev/null +++ b/plugins/admin/ogroups/paste_generic.tpl @@ -0,0 +1,10 @@ + + + + + +
+ {$must} + + +
diff --git a/plugins/admin/ogroups/paste_mail.tpl b/plugins/admin/ogroups/paste_mail.tpl new file mode 100644 index 000000000..1930c44c8 --- /dev/null +++ b/plugins/admin/ogroups/paste_mail.tpl @@ -0,0 +1,10 @@ + + + + + +
+ {$must} + + +
diff --git a/plugins/admin/ogroups/tabs_ogroups.inc b/plugins/admin/ogroups/tabs_ogroups.inc index 5364185c1..b1a1d1ffe 100644 --- a/plugins/admin/ogroups/tabs_ogroups.inc +++ b/plugins/admin/ogroups/tabs_ogroups.inc @@ -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; } -- 2.30.2