summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4edea51)
raw | patch | inline | side by side (parent: 4edea51)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 18 Apr 2011 13:20:25 +0000 (13:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 18 Apr 2011 13:20:25 +0000 (13:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20739 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_sortableListing.inc | patch | blob | history |
diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc
index 22d7a18df155707ea590a84e436a23fcc79feb94..8e03f08b1841922311b6e90ace97f82a6863e228 100644 (file)
// Render table body if we've read permission
$result.= " <tbody id='".$this->id."'>\n";
$reorderable= $this->reorderable?"":" style='cursor:default'";
+
if (strpos($this->acl, 'r') !== false) {
foreach ($this->mapping as $nr => $row) {
$editable= $this->editable?" onClick='$(\"edit_".$this->id."_$nr\").click()'":"";
// Remove mapping
$index= array_search($id, $this->mapping);
if ($index !== false) {
+ $target = $this->mapping[$index];
unset($this->mapping[$index]);
+ if(isset($this->displayData[$target])){
+ unset($this->displayData[$target]);
+ unset($this->data[$target]);
+ unset($this->keys[$target]);
+ }
$this->mapping= array_values($this->mapping);
$this->modified= true;
}
// Extract data
$tmp= array();
- foreach($this->displayData as $item) {
+ foreach($this->displayData as $key => $item) {
if (isset($item[$this->sortColumn])){
- $tmp[]= $item[$this->sortColumn];
+ $tmp[$key]= $item[$this->sortColumn];
} else {
- $tmp[]= "";
+ $tmp[$key]= "";
}
}
}
// Append to data and mapping
+ $this->displayData[]= $displayEntry['data'];
+ $this->mapping[]= max(array_keys($this->displayData));
+ $this->modified= true;
if ($key) {
$this->data[$key]= $entry;
$this->keys[]= $key;
} else {
$this->data[]= $entry;
- $this->keys[]= count($this->mapping);
+ $this->keys[]= max(array_keys($this->displayData));
}
- $this->displayData[]= $displayEntry['data'];
- $this->mapping[]= count($this->mapping);
- $this->modified= true;
-
// Find the number of coluns
reset($this->displayData);
$first= current($this->displayData);