summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb97578)
raw | patch | inline | side by side (parent: fb97578)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Sep 2010 07:10:55 +0000 (07:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Sep 2010 07:10:55 +0000 (07:10 +0000) |
-Added option to copy and paste do avoid copying the members
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19654 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19654 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/ogroups/class_ogroup.inc | patch | blob | history | |
gosa-core/plugins/admin/ogroups/paste_generic.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc
index 69b32e23faa4985ddd01dbe0675214ac70f167b1..aff73709dda51298096d1d3d94a7f573b22919e7 100644 (file)
var $objectSelect= FALSE;
var $view_logged = FALSE;
+ var $copyMembers = TRUE;
+
var $baseSelector;
/* Already assigned Workstations. Will be hidden in selection.
{
plugin::save();
+ // Do not save members if we don't want to.
+ // This may be the case if we've copied an ogroup containing systems!
+ if(!$this->copyMembers) $this->member = array();
+
/* Move members to target array */
$this->attrs['member'] =array();
foreach ($this->member as $key => $desc){
{
plugin::PrepareForCopyPaste($source);
+ // Preselect "Copy members" state.
+ // If we've terminals, workstations or servers in our members list,
+ // then disable this option by default, to avoid problems with
+ // inheritance of ogroup values.
+ if (preg_match("/[STW]/", $this->gosaGroupObjects) || !isset($source['member'])) {
+ $this->copyMembers = FALSE;
+ } else {
+ $this->copyMembers = TRUE;
+ }
+
/* Reload tabs */
$this->parent->reload($this->gosaGroupObjects );
{
$smarty = get_smarty();
$smarty->assign("cn", set_post($this->cn));
+ $smarty->assign("copyMembers", $this->copyMembers);
$str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
$ret = array();
$ret['string'] = $str;
if(isset($_POST['cn'])){
$this->cn = get_post('cn');
}
+ $this->copyMembers = isset($_POST['copyMembers']);
}
diff --git a/gosa-core/plugins/admin/ogroups/paste_generic.tpl b/gosa-core/plugins/admin/ogroups/paste_generic.tpl
index 5086e4a2c6e1636e7b2beda640fa774ad2cf6888..32495d82d18d9be25ff71bd0b402dfe1a15cc786 100644 (file)
</tr>
</table>
+
+
+<input type='checkbox' value='1' name='copyMembers' {if $copyMembers} checked {/if} id='copyMembers'>
+<LABEL for='copyMembers'>
+ {t}Copy members. Be careful with this option, systems can only inherit from a single object group!{/t}
+</LABEL>
<script language="JavaScript" type="text/javascript">
focus_field('cn');
</script>