Code

Updated Snapshot & Copy&Paste for FAI
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Dec 2007 07:53:33 +0000 (07:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Dec 2007 07:53:33 +0000 (07:53 +0000)
- 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

include/class_plugin.inc
plugins/admin/fai/class_divListFai.inc

index f18d7e7311be3d5c122f8b0d3076399f4212a401..97872d370aae87668b1f2464c7569962358fe7a3 100644 (file)
@@ -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));
     }
index f398438fb0cc20063764e466b67c6ab79967ac4a..eb189f2c730bd1ccc5344adf83217ff7f7899bed 100644 (file)
@@ -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 ="<a href='?plug=".$_GET['plug']."&amp;edit_entry=%KEY%' title='%TITLE%'>%NAME%</a>";
 
     /* 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 .= "<input class='center' type='image'
+           src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
+         $action.= "<input class='center' type='image'
+           src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
+       }
 
        if($value['FAIstate'] == "freeze"){
-         $action=  "<img src='images/closedlock.png' alt='F' class='center'><img src='images/empty.png' width='38' height='2' class='center' alt=''>";
+         $action.=  "<img src='images/closedlock.png' alt='F' class='center'><img src='images/empty.png' width='38' height='2' class='center' alt=''>";
          $action.= "<input class='center' type='image' src='images/edit.png'  alt='"._("edit")."'
            name='entry_edit_%KEY%' title='"._("Edit class")."'>";
        }else{
-         $action= "<input class='center' type='image' src='images/edit.png'  alt='"._("edit")."'
+         $action.= "<input class='center' type='image' src='images/edit.png'  alt='"._("edit")."'
            name='entry_edit_%KEY%' title='"._("Edit class")."'>";
 
-#         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.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
@@ -336,18 +346,6 @@ class divListFai extends MultiSelectWindow
          }
        }
 
-
-       /* Add copy & cut icons */
-       $ui = get_userinfo();
-       $acl_all = $ui->has_complete_category_acls($this->selectedBase,$this->module);
-       if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
-         $action .= "<input class='center' type='image'
-           src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
-         $action.= "<input class='center' type='image'
-           src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
-       }
-
-
        /* Cutted objects should be displayed in light grey */
        $display = $value['cn'].$desc;
        if($this->parent->CopyPasteHandler){