summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d410e8)
raw | patch | inline | side by side (parent: 6d410e8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Oct 2010 09:16:07 +0000 (09:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Oct 2010 09:16:07 +0000 (09:16 +0000) |
-Added gwFolderList
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20021 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20021 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc | patch | blob | history |
diff --git a/gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc b/gosa-plugins/groupware/admin/groups/GroupwareSharedFolder/class_GroupwareSharedFolder.inc
index 232f24f43402969de27539ba407a2c3b861869df..88c6311e3fb6ea4e503229e8ae22c1f98f326228 100644 (file)
if($this->cn == "" || $this->dn == "new"){
$is_account = FALSE;
}else{
- // DETECT ACCOUNT STATE
- }
-
- // Load list of folder, or in case of a new account set an initial folder list
- if($is_account){
-
- // Check if account exists
+ // Load folders for the given folderPrefix
$this->folderPrefix = "shared/{$this->cn}";
- $this->folderList = $this->getFolderList();
- }else{
+ $folders = $rpc->gwFolderList($this->folderPrefix);
+ if(!$rpc->success()){
+ $this->rpcError = TRUE;
+ $this->rpcErrorMessage = $rpc->get_error();
+ $message = sprintf(_("Failed to folder list! Error was: '%s'."),
+ $rpc->get_error());
+ msg_dialog::display(_("Error"),msgPool::rpcError($message), ERROR_DIALOG);
+ return;
+ }
+
+ // We've avalid account, if we've received at least one matching folder.
+ $is_account = count($folders) != 0;
+
+ // Prepare folders to be used in the folderWidget
+ if($is_account){
+ $folderList = array();
+ foreach($folders as $path){
+ $name = preg_replace("/^.*\//","",$path);
+ $entry = array();
+ $entry['name'] = $name;
+ $entry['status'] = '';
+ $entry['acls'] = array();
+ $folderList[$path] = $entry;
+ }
+ }
+ }
+
+ // We do not have a valid account, use an initial set of folders
+ // to be able to use the folderWidget.
+ // {%cn} will be replaced by the groups cn when save() is called.
+ if(!$is_account){
$this->folderPrefix = "shared/{%cn}";
$intialFolderEntry = array('name' => '{%cn}', 'status' => '', 'acls' => array());
+ $folderList = array();
+ $folderList[$this->folderPrefix] = $intialFolderEntry;
}
+ print_a(array("--------" => $folderList));
+
// Store values as current and initial values (saved_attributes)
// to be able to keep track och changes.
$this->is_account = $this->initially_was_account = $is_account;