summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1e5cc49)
raw | patch | inline | side by side (parent: 1e5cc49)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 Jan 2010 09:17:15 +0000 (09:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 7 Jan 2010 09:17:15 +0000 (09:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15096 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiManagement.inc | patch | blob | history | |
gosa-plugins/fai/admin/fai/faiGroupHandle.tpl | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 5d8d114500b8c562a1b0fdc2b0f4d57ace24cb23..e3de7caaac3daa2241ee61d7eea795013c78ac4d 100644 (file)
// Collect real dns, the listed objects are grouped by their cn
$headpage = $this->getHeadpage();
if($action == "copy"){
- foreach($target as $t){
- $entry = $headpage->getEntry($t);
- // Check for valid FAI objects
- if(in_array('FAKE_OC_FAI', $entry['objectClass'])){
- foreach($entry['GROUPS'] as $g){
- $type = $this->get_type($g);
- $this->cpHandler->add_to_queue($g['dn'],"copy",$type[0],$type[2],'fai',$this);
- @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$dn,"Entry copied!");
+ if(count($target) == 1){
+
+ // We just want to copy a single FAI object, let the user choose entries from the FAI-Group
+ $entry = $headpage->getEntry($target[0]);
+ if(count($entry['GROUPS']) == 1){
+ $data = array_pop($entry['GROUPS']);
+ $type = $this->get_type($data);
+ $this->cpHandler->add_to_queue($g['dn'],"copy",$type[0],$type[2],'fai',$this);
+ @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$g['dn'],"Entry copied!");
+ }else{
+ $this->dialogObject = new faiGroupHandle($entry['GROUPS'],"copy");
+ }
+
+ }else{
+
+ // More than one group was selected, expect that the user wants to copy the complete groups.
+ foreach($target as $t){
+ $entry = $headpage->getEntry($t);
+
+ // Check for valid FAI objects
+ if(in_array('FAKE_OC_FAI', $entry['objectClass'])){
+ foreach($entry['GROUPS'] as $g){
+ $type = $this->get_type($g);
+ $this->cpHandler->add_to_queue($g['dn'],"copy",$type[0],$type[2],'fai',$this);
+ @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$g['dn'],"Entry copied!");
+ }
}
}
}
}elseif($this->dialogObject instanceOf faiGroupHandle && $this->dialogObject->get_mode() == "remove"){
$this->dialogObject->save_object();
$to_delete = $entry = $this->dialogObject->get_selected();
+ if(count($to_delete)) $this->closeDialogs();
return($this->removeFAIObjects($to_delete));
+ }elseif($this->dialogObject instanceOf faiGroupHandle && $this->dialogObject->get_mode() == "copy"){
+ $this->dialogObject->save_object();
+ $entries = $entry = $this->dialogObject->get_selected();
+ if(count($entries)){
+ foreach($entries as $entry){
+ $type = $this->get_type($entry);
+ $this->cpHandler->add_to_queue($entry['dn'],"copy",$type[0],$type[2],'fai',$this);
+ @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$entry['dn'],"Entry copied!");
+ }
+ $this->closeDialogs();
+ }
}
}
diff --git a/gosa-plugins/fai/admin/fai/faiGroupHandle.tpl b/gosa-plugins/fai/admin/fai/faiGroupHandle.tpl
index 7410399e4dc612fb67fbfac49a869238cd7114db..80a16f07536da0176c8d1a1142d2d7173e9e8ef7 100644 (file)
class='center'>
</td>
<td style='width:150px;'>{$types.$key.NAME}</td>
- <td><i>({$item.description})</i>
+ <td><i>({$item.description.0})</i>
</td>
</tr>
{/foreach}
</table>
-{elseif $mode == "cut"}
-
-<b>{t}Select the object you want to cut:{/t}</b>
-<br>
-<br>
-<table>
-{foreach from=$FAI_group item=item key=key}
- <tr>
- <td>
- {if $item.freezed}
- <img src="images/lists/locked.png" class='center'>
- {else}
- <input type='checkbox' name='{$mode}_{$key}'
- {if $item.selected} checked {/if}>
- {/if}
- </td>
- <td>
- <img src='{$types.$key.IMG}' alt='{$types.$key.KZL}' title='{$types.$key.NAME}'
- class='center'>
- </td>
- <td style='width:150px;'>{$types.$key.NAME}</td>
- <td><i>({$item.description})</i> </td>
- </tr>
-{/foreach}
-</table>
{/if}
<br>
<br>