From: hickert Date: Fri, 7 Dec 2007 07:53:33 +0000 (+0000) Subject: Updated Snapshot & Copy&Paste for FAI X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bcd695e56d57dbfa4087221d9a3054fda284d319;p=gosa.git Updated Snapshot & Copy&Paste for FAI - Snapshot is still not working because of the FAIstate attribute: git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8051 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_plugin.inc b/include/class_plugin.inc index f18d7e731..97872d370 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -1184,10 +1184,11 @@ class plugin /* Inset this new snapshot */ $ldap_to->cd($snapldapbase); + $ldap_to->create_missing_trees($snapldapbase); $ldap_to->create_missing_trees($new_base); $ldap_to->cd($new_dn); $ldap_to->add($target); - + show_ldap_error($ldap->get_error(), sprintf(_("Saving object snapshot with dn '%s' failed."),$new_base)); show_ldap_error($ldap_to->get_error(), sprintf(_("Saving object snapshot with dn '%s' failed."),$new_base)); } diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index f398438fb..eb189f2c7 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -54,9 +54,9 @@ class divListFai extends MultiSelectWindow $this->EnableSaveButton (false); /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 50; + $action_col_size = 80; if($this->parent->snapshotEnabled()){ - $action_col_size += 20; + $action_col_size += 32; } /* Toggle all selected / deselected */ @@ -241,13 +241,13 @@ class divListFai extends MultiSelectWindow } } -# /* Add snapshot icons, if we are allowed to write and create the complete fai module ($ui->has_complete_category_acls) */ -# if(preg_match("/(c.*w|w.*c)/",$acl_all)){ -# if($this->parent->snapshotEnabled()){ -# $s .= "..|---|\n"; -# $s .= $this->get_snapshot_header(TRUE); -# } -# } + /* Add snapshot icons, if we are allowed to write and create the complete fai module ($ui->has_complete_category_acls) */ + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + if($this->parent->snapshotEnabled()){ + $s .= "..|---|\n"; + $s .= $this->get_snapshot_header(TRUE); + } + } $this->SetDropDownHeaderMenu($s); $this->SetListHeader($listhead); @@ -279,9 +279,9 @@ class divListFai extends MultiSelectWindow $editlink ="%NAME%"; /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 50; + $action_col_size = 80; if($this->parent->snapshotEnabled()){ - $action_col_size += 20; + $action_col_size += 32; } /******************** @@ -317,18 +317,28 @@ class divListFai extends MultiSelectWindow $desc= ""; } + /* Add copy & cut icons */ + $ui = get_userinfo(); + $action =""; + $acl_all = $ui->has_complete_category_acls($this->selectedBase,$this->module); + if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){ + $action .= " "; + $action.= " "; + } if($value['FAIstate'] == "freeze"){ - $action= "F"; + $action.= "F"; $action.= ""; }else{ - $action= ""; -# if(preg_match("/(c)/",$value['acl']) && preg_match("/(w)/",$value['acl'])){ -# $action.= $this->GetSnapShotActions($value['dn']);; -# } + if(preg_match("/(c)/",$value['acl']) && preg_match("/(w)/",$value['acl'])){ + $action.= $this->GetSnapShotActions($value['dn']);; + } if(preg_match("/d/",$value['acl'])){ $action.= "has_complete_category_acls($this->selectedBase,$this->module); - if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){ - $action .= " "; - $action.= " "; - } - - /* Cutted objects should be displayed in light grey */ $display = $value['cn'].$desc; if($this->parent->CopyPasteHandler){