From: hickert Date: Tue, 8 Jan 2008 13:43:32 +0000 (+0000) Subject: First checkin for group multi edit X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e975536725958c4500ca21b2d0dc1449eab0971e;p=gosa.git First checkin for group multi edit git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8249 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc index 7bfb23137..162788e35 100644 --- a/gosa-core/plugins/admin/groups/class_groupGeneric.inc +++ b/gosa-core/plugins/admin/groups/class_groupGeneric.inc @@ -49,6 +49,8 @@ class group extends plugin var $CopyPasteVars = array("force_gid","fon_group","smbgroup","groupType","sambaSID","sambaDomainName","SID","nagios_group","sambaGroupType"); + var $multiple_support = TRUE; + function group (&$config, $dn= NULL) { /* Set rfc2307bis flag */ @@ -391,6 +393,26 @@ class group extends plugin $smarty->assign("launchimage", get_template_path('images/small_filter.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); $smarty->assign("deplist", $this->config->idepartments); + + /* Multiple edit handling */ + $smarty->assign("multiple_support",$this->multiple_support_active); + + + foreach($this->attributes as $val){ + if(in_array($val,$this->multi_boxes)){ + $smarty->assign("use_".$val,TRUE); + }else{ + $smarty->assign("use_".$val,FALSE); + } + } + foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group") as $val){ + if(in_array($val,$this->multi_boxes)){ + $smarty->assign("use_".$val,TRUE); + }else{ + $smarty->assign("use_".$val,FALSE); + } + } + return($smarty->fetch (get_template_path('generic.tpl', TRUE))); } @@ -969,6 +991,78 @@ class group extends plugin "sambaSID" => _("Samba SID")) )); } + + + function multiple_save_object() + { + if(isset($_POST['group_mulitple_edit'])){ + + /* Create a base backup and reset the + base directly after calling plugin::save_object(); + Base will be set seperatly a few lines below */ + $base_tmp = $this->base; + plugin::multiple_save_object(); + plugin::save_object(); + $this->base = $base_tmp; + + foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group") as $attr){ + if(isset($_POST['use_'.$attr])){ + $this->multi_boxes[] = $attr; + } + } + + /* Get base selection */ + if(isset($_POST['base'])){ + $tmp = $this->get_allowed_bases(); + if(isset($tmp[$_POST['base']])){ + $this->base = $_POST['base']; + } + } + + foreach (array( "smbgroup" => "sambaGroupType") as $val => $aclname) { + if ($this->acl_is_writeable($aclname)){ + if(isset($_POST["$val"])){ + $this->$val= TRUE; + }else{ + $this->$val= FALSE; + } + } + } + + /* Save sambaDomain attribute */ + if ($this->acl_is_writeable("sambaDomainName") && $this->samba3 && isset ($_POST['sambaDomainName'])){ + $this->sambaDomainName= $_POST['sambaDomainName']; + $this->groupType= $_POST['groupType']; + } + + /* Save fon attribute */ + if ($this->acl_is_writeable("fon_group")){ + if (isset ($_POST['fon_group'])){ + $this->fon_group= TRUE; + } else { + $this->fon_group= FALSE; + } + } + } + } + + + function get_multi_edit_values() + { + $ret = plugin::get_multi_edit_values(); + + foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group") as $attr){ + if(in_array($attr,$this->multi_boxes)){ + $ret[$attr] = $this->$attr; + } + } + return($ret); + } + + function multiple_execute() + { + return($this->execute()); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc index 05828222e..ef379f35c 100644 --- a/gosa-core/plugins/admin/groups/class_groupManagement.inc +++ b/gosa-core/plugins/admin/groups/class_groupManagement.inc @@ -239,7 +239,7 @@ class groupManagement extends plugin } $tmp->lock_entries($this->ui->dn); if($tmp->multiple_available()){ - $this->usertab = $tmp; + $this->grouptab = $tmp; session::set('objectinfo',$this->usertab->get_object_info()); } } diff --git a/gosa-core/plugins/admin/groups/generic.tpl b/gosa-core/plugins/admin/groups/generic.tpl index 4d67c8665..5c716d99e 100644 --- a/gosa-core/plugins/admin/groups/generic.tpl +++ b/gosa-core/plugins/admin/groups/generic.tpl @@ -1,3 +1,8 @@ +{if $multiple_support} + +{/if } + + @@ -15,7 +24,7 @@ @@ -30,7 +39,7 @@ {$must} +{if $multiple_support} + +{else} +{/if} - {if $samba3 ne ""} +{if $samba3 ne ""} + +{if $multiple_support} + + + + + + + +{else} {/if} +{/if} + {if $pickupGroup == "true"} @@ -92,8 +136,8 @@
@@ -5,9 +10,13 @@
{$must} +{if $multiple_support} + +{else} {render acl=$cnACL} {/render} +{/if}
-{render acl=$descriptionACL} +{render acl=$descriptionACL checkbox=$multiple_support checked=$use_description} {/render} -{render acl=$baseACL} +{render acl=$baseACL checkbox=$multiple_support checked=$use_base} @@ -47,6 +56,9 @@
{render acl=$gidNumberACL} @@ -60,8 +72,38 @@ {/render}
+ {render acl=$sambaGroupTypeACL checkbox=$multiple_support checked=$use_smbgroup} + {t}Select to create a samba conform group{/t} + {/render} +
+ {render acl=$sambaGroupTypeACL checkbox=$multiple_support checked=$use_groupType} + + {/render} +   + +   + + {render acl=$sambaDomainNameACL checkbox=$multiple_support checked=$use_sambaDomainName} + + {/render} +
{render acl=$sambaGroupTypeACL} @@ -83,6 +125,8 @@
-{render acl=$fonGroupACL} - {t}Members are in a phone pickup group{/t} +{render acl=$fonGroupACL checkbox=$multiple_support checked=$use_fon_group} + {t}Members are in a phone pickup group{/t} {/render}