diff --git a/gosa-plugins/fai/admin/fai/class_faiGroupHandle.inc b/gosa-plugins/fai/admin/fai/class_faiGroupHandle.inc
index 999b692332725ff4d8518c80bd4ef2e6fcea89de..eb31295ad968ea011760147a6dde4dedeccd5daf 100644 (file)
public function __construct($FAI_group, $Action)
{
- if(in_array($Action,array("edit","remove"))){
+ if(in_array($Action,array("edit","remove","copy","cut"))){
$this->mode = $Action;
}else{
trigger_error("Wrong action type '".$Action."'.");
}
/* Preset required values */
+ $select_set = FALSE;
foreach($FAI_group as $type => $data){
$FAI_group[$type]['selected'] = FALSE;
$FAI_group[$type]['freezed'] = isset($data['FAIstate']) && preg_match("/freeze/",$data['FAIstate']);
- if($this->mode == "edit" && !$FAI_group[$type]['freezed']){
+ if(!$select_set && ($this->mode == "cut" || $this->mode == "edit") && !$FAI_group[$type]['freezed']){
$FAI_group[$type]['selected'] = TRUE;
+ $select_set =TRUE;
}
}
$this->FAI_group = $FAI_group;
function save_object()
{
if(isset($_POST['faiGroupHandle'])){
- if($this->mode == "remove"){
+ if(in_array($this->mode,array("copy","cut","remove"))){
foreach($this->FAI_group as $key => $group){
if(isset($_POST[$this->mode."_".$key])){
$this->FAI_group[$key]['selected'] = TRUE;