Code

Re-enabled schema checks
[gosa.git] / gosa-core / include / class_listing.inc
index b6b6162db9fa12144c6a2f86d9775d2e5161fe84..c2c0207488580a2194fbda192ca38537f2ada145 100644 (file)
@@ -266,7 +266,7 @@ class listing {
     $result= "<input type='hidden' value='$this->pid' name='PID'>\n";
     $height= 450;
     if ($this->height != 0) {
-      $result= "<input type='hidden' value='$this->height' id='d_height'>\n";
+      $result.= "<input type='hidden' value='$this->height' id='d_height'>\n";
       $height= $this->height;
     }
     
@@ -408,6 +408,7 @@ class listing {
     $result.= "</table></div>";
 
     $smarty= get_smarty();
+    $smarty->assign("usePrototype", "true");
     $smarty->assign("FILTER", $this->filter->render());
     $smarty->assign("SIZELIMIT", print_sizelimit_warning());
     $smarty->assign("LIST", $result);
@@ -467,7 +468,12 @@ class listing {
       if (preg_match('/^export.*$/', $_POST['act']) && isset($this->exporter[$_POST['act']])) {
         $exporter= $this->exporter[$_POST['act']];
         $userinfo= ", "._("created by")." ".$ui->cn." - ".strftime('%A, %d. %B %Y, %H:%M:%S');
-        $instance= new $exporter['class']($this->headline.$userinfo, $this->plainHeader, $this->entries, $this->exportColumns);
+        $entryIterator= new listingSortIterator($this->entries, $this->sortDirection[$this->sortColumn], "_sort".$this->sortColumn, $this->sortType);
+        $sortedEntries= array();
+        foreach ($entryIterator as $entry){
+          $sortedEntries[]= $entry;
+        }
+        $instance= new $exporter['class']($this->headline.$userinfo, $this->plainHeader, $sortedEntries, $this->exportColumns);
         $type= call_user_func(array($exporter['class'], "getInfo"));
         $type= $type[$_POST['act']];
         send_binary_content($instance->query(), $type['filename'], $type= $type['mime']);
@@ -767,9 +773,20 @@ class listing {
     foreach($actions as $action) {
       // Skip the entry completely if there's no permission to execute it
       if (!$this->hasActionPermission($action, $dn)) {
+        $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
         continue;
       }
 
+      // Skip entry if the pseudo filter does not fit
+      if (isset($action['filter']) && preg_match('/^[a-z0-9_]+=[a-z0-9_]+$/i', $action['filter'])) {
+        list($fa, $fv)= split('=', $action['filter']);
+        if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) {
+          $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+          continue;
+        }
+      }
+
+
       // If there's an objectclass definition and we don't have it
       // add an empty picture here.
       if (isset($action['objectclass'])){