summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8a415f6)
raw | patch | inline | side by side (parent: 8a415f6)
| author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
| Thu, 7 Oct 2010 14:26:15 +0000 (14:26 +0000) | ||
| committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
| Thu, 7 Oct 2010 14:26:15 +0000 (14:26 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19940 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.xml b/gosa-plugins/groupware/personal/groupware/FolderWidget/FolderWidget-list.xml
index 6344097491c0faf0c7431c77fb4f406fb7f7b94e..66af0338957201411490d28143f123dcc45a05cb 100644 (file)
</column>
<column>
- <label>Description</label>
- <sortAttribute>description</sortAttribute>
+ <label>Type</label>
+ <sortAttribute>folderType</sortAttribute>
<sortType>string</sortType>
- <value>%{filter:link(row,dn,"%s",description)}</value>
+ <value>%{filter:link(row,dn,"%s",folderType)}</value>
<export>true</export>
</column>
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc
index 4a4541eeba9686dc828a883fde4129461c21953d..2f8e122f6c0b2e0a6c038c99562d3ac75437681e 100644 (file)
$this->FolderWidgetListing = new FolderWidgetListing($this->config, get_userinfo(), $this->rootBase);
$this->FolderWidgetListing->setBase($this->rootBase);
$this->FolderWidgetListing->setFolderRoot($this->rootBase);
+ }
-
+ function getFolderType($item)
+ {
+ if(preg_match("/^user\//", $item['path'])) return('userFolder');
+ if(preg_match("/^shared\//", $item['path'])) return('sharedFolder');
}
$data[$this->rootBase]['path'] = $this->rootName;
$data[$this->rootBase]['type'] = 'manual';
$data[$this->rootBase]['base'] = $this->rootBase;
+ $data[$this->rootBase]['parentPath'] = "";
$data[$this->rootBase]['children'] = array();
$ret['linear'][$this->rootBase] = &$data[$this->rootBase];
$current = &$base;
$pathSteps = preg_split("/".preg_quote($seperator,'/')."/", $path);
$entryPath = "";
+ $parentPath = "";
$entryBase = $this->rootBase;
foreach($pathSteps as $name){
+ $parentPath = $entryPath;
$entryPath = (empty($entryPath)) ? $name : "{$entryPath}{$seperator}{$name}";
$entryBase = trim("cn={$name},{$entryBase}", ' ,');
if(!isset($current[$entryPath])){
$current[$entryPath]['status'] = '';
$current[$entryPath]['type'] = 'manual';
$current[$entryPath]['base'] = $entryBase;
+ $current[$entryPath]['parentPath'] = $entryPath;
+ $current[$entryPath]['folderType'] = $this->getFolderType($current[$entryPath]);
+
$ret['linear'][$entryPath] = &$current[$entryPath];
$this->baseEntryMap[$entryBase] = $entryPath;
}
diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc
index 083df4fe5301fe79e4f1eb9feac81b1d16f927e8..37b6f1854a141edf27df34be188a3be05dcf5989 100644 (file)
foreach($data['linear'] as $item){
if($item['base'] == $base){
$items = $item['children'];
+ $parent = $item['parentPath'];
break;
}
- $parent = $item;
}
-
// Add entries
$ret = array();
- if($parent != NULL){
- $parent['name'] = '..';
- filterFolderWidget::addEntry($ret, $parent, FALSE, $filter);
+ if(isset($data['linear'][$parent])){
+ $item = $data['linear'][$parent];
+ $item['name'] = '.';
+ filterFolderWidget::addEntry($ret, $item, FALSE, $filter);
}
foreach($items as $item){
filterFolderWidget::addEntry($ret, $item, $scope == 'sub', $filter);
$entry[] = 'dn';
$entry['cn'] = array($item['name'], 'count' => 1);
$entry[] = 'cn';
- $entry['objectClass'] = array('FAKE_OC_GroupwareFolder','count' => 1);
+ $entry['folderType'] = array($item['folderType'], 'count' => 1);
+ $entry[] = 'folderType';
+ $entry['objectClass'] = array('FAKE_OC_Groupware_'.$item['folderType'],'count' => 1);
$entry[] = 'objectClass';
- $entry['count'] = 3;
+ $entry['count'] = 4;
$ret[] = $entry;
}