Code

Updated intial folder handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Oct 2010 08:15:20 +0000 (08:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Oct 2010 08:15:20 +0000 (08:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20015 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc

index d5f7b6a4db018da6f535e36dca478eab42bea821..232f24f43402969de27539ba407a2c3b861869df 100644 (file)
@@ -60,8 +60,6 @@ class GroupwareSharedFolder extends plugin
         }
         $this->orig_cn = $this->cn;
 
-        $this->folderPrefix = "shared/{$this->cn}";
-
         // Initialize the distribution list using the gosa-ng backend 
         $this->init();
     }
@@ -83,25 +81,17 @@ class GroupwareSharedFolder extends plugin
      */
     function init()
     {
-
-        $capabilities = array();
-
-
-        #FIXME
-        /* Not working at all, have to wait for backend funtions.
-         */
-    
-#       // Detect supported capabilities 
-#       $rpc = $this->config->getRpcHandle();
-#       $capabilities = $rpc->gwGetCapabilities();
-#       if(!$rpc->success()){
-#           $this->rpcError = TRUE;
-#           $this->rpcErrorMessage = $rpc->get_error();
-#           $message = sprintf(_("Failed to load supported capabilities from server! Error was: '%s'."), 
-#                   $rpc->get_error());
-#           msg_dialog::display(_("Error"),msgPool::rpcError($message), ERROR_DIALOG);
-#           return;
-#       }
+        // Detect supported capabilities 
+        $rpc = $this->config->getRpcHandle();
+        $capabilities = $rpc->gwGetCapabilities();
+        if(!$rpc->success()){
+            $this->rpcError = TRUE;
+            $this->rpcErrorMessage = $rpc->get_error();
+            $message = sprintf(_("Failed to load supported capabilities from server! Error was: '%s'."), 
+                    $rpc->get_error());
+            msg_dialog::display(_("Error"),msgPool::rpcError($message), ERROR_DIALOG);
+            return;
+        }
 
         // Detect features we can use
         $map['folder'] = array("folderList","folderAdd","folderDel","folderExists");
@@ -120,16 +110,19 @@ class GroupwareSharedFolder extends plugin
         if($this->cn == "" || $this->dn == "new"){
             $is_account = FALSE;
         }else{
-            
-            // Check if account exists
-            
+            // DETECT ACCOUNT STATE
         }
 
-        // If account exists then load further info
+
+        // Load list of folder, or in case of a new account set an initial folder list
         if($is_account){
-    
-            // Load further info
             
+            // Check if account exists
+            $this->folderPrefix = "shared/{$this->cn}";
+            $this->folderList = $this->getFolderList();
+        }else{
+            $this->folderPrefix = "shared/{%cn}";
+            $intialFolderEntry = array('name' => '{%cn}', 'status' => '', 'acls' => array());
         }
 
         // Store values as current and initial values (saved_attributes) 
@@ -146,7 +139,6 @@ class GroupwareSharedFolder extends plugin
     {
         plugin::execute();
 
-        $this->folderList = $this->getFolderList();
 
         // Initialization failed - Display a stripped template which allows 
         //  to retry initialization
@@ -257,6 +249,9 @@ class GroupwareSharedFolder extends plugin
      */  
     function save()
     {
+        print_a($this->folderList);
+        print_a($this->saved_attributes['folderList']);
+
     }