Code

Added check for num of entries, removed page reload if checkbox was checked
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Feb 2006 06:07:01 +0000 (06:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Feb 2006 06:07:01 +0000 (06:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2650 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiPackageEntry.inc
plugins/admin/fai/faiPackageEntry.tpl

index e4049b865d39893db9dd519b11bf619d0884245c..2d1d52e17d84fb2aa41857ea4f74203b62a924be 100644 (file)
@@ -77,7 +77,12 @@ class faiPackageEntry extends plugin
       } 
     }
 
-        @ksort($this->categories);
+    $this->searchStrPKG = preg_replace("/^\+/","",$this->searchStrPKG);
+    if(empty($this->searchStrPKG)){
+      $this->searchStrPKG = "*";
+    }
+
+    @ksort($this->categories);
 
 $CHKS = "<input type='hidden' value='chkchange' name='chkchange'><table summary=''><tr>";
     $i = 0;
@@ -115,6 +120,10 @@ $CHKS = "<input type='hidden' value='chkchange' name='chkchange'><table summary=
 
     $cnt = 0; 
     foreach($pkgs as $pkg){
+      if($cnt > 200) {
+        print_red(sprintf(_("Your specified search string '%s' returned too many results. Only the first 200 entries are shown, to keep the memory usage low."),$this->searchStrPKG));
+        break;
+      }
       if((preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[0]))||
          (preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[3]))){
         if($this->categories[$pkg[2]]){
@@ -124,7 +133,7 @@ $CHKS = "<input type='hidden' value='chkchange' name='chkchange'><table summary=
             $check = "";
           }
           $cnt ++ ;
-          $chkbox = "<input type='checkbox' value='1' name='use_".base64_encode($pkg[0])."' ".$check." onclick='document.mainform.submit()'>
+          $chkbox = "<input type='checkbox' value='1' name='use_".base64_encode($pkg[0])."' ".$check.">
                    <input type='hidden' value='1' name='wasonpage_".base64_encode($pkg[0])."'>";
           $divlist->AddEntry(array(array("string"=>$chkbox, "attach" => "style='text-align:center;width:20px;'"),
                                array("string"=>$pkg[0], "attach" => "style='width:180px;'"),
index 927b2b7649dc6afb34386e822eea9d2a329ed02c..dcd448596db472dcfc968a0a596256854d729bd9 100644 (file)
                                {t}Filters{/t}
                        </p>
                </div>
-               <div class="contentboxb">
-               <table summary="" style="width:100%;border-top:1px solid #B0B0B0;">
-                       {$alphabet}
-               </table>
-               </div>
                <div class="contentboxb"> 
                        {$CHKS}
                </div>