Code

Fixed pakage list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jan 2006 10:01:45 +0000 (10:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jan 2006 10:01:45 +0000 (10:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2552 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiPackageNew.inc
plugins/admin/fai/faiPackageNew.tpl

index 60aea4affc4de21ac220217f7108bd6d8316a869..ebe1393fb8d904ea10225f5ab1eb0a6d9a70e027 100644 (file)
@@ -70,6 +70,7 @@ class faiPackageNew extends plugin
         }else{
           $str .= "<input ".$rel." type='checkbox' value='".$section."' name='section_".$section."'>".$section."<br>";
         }
+        $str .="<input type='hidden' name='wasOnPage_".$section."'>";
       }
     }
     return($str); 
@@ -104,17 +105,25 @@ class faiPackageNew extends plugin
   function save_object()
   {
     /* Post handling for Section, Release  Setup */
-    if((isset($_POST['FAIdebianReleaseS']))&&(!empty($_POST['FAIdebianReleaseS']))){
-      $this->FAIdebianRelease = $_POST['FAIdebianReleaseS'];
-    }
+    if(isset($_POST['YesItIsPostedPackages'])){
 
-    /* Get Sections */
-    foreach($_POST as $name => $value){
-      if(preg_match("/^section_/",$name)){
-        $this->FAIdebianSection[$value] = $value;
+      if((isset($_POST['FAIdebianReleaseS']))&&(!empty($_POST['FAIdebianReleaseS']))){
+        $this->FAIdebianRelease = $_POST['FAIdebianReleaseS'];
+      }
+        
+      foreach($_POST as $name => $value){
+        if(preg_match("/wasOnPage_/",$name)){
+          $nm = preg_replace("/wasOnPage_/","",$name);
+          if(isset($_POST['section_'.$nm])){
+            $this->FAIdebianSection[$nm] = $nm; 
+          }else{
+            if(isset($this->FAIdebianSection[$nm])){
+              unset($this->FAIdebianSection[$nm]);
+            }
+          }
+        }
       }
     }
-
     /* Remove all section that are not available at the currently selected server */ 
     $atr = $this->getServerInfos();
     foreach($this->FAIdebianSection as $section){
index 6c254b32b3d74e5a1a939d52e9f2b43ebc2da1dd..c23e489d80883686ad477d1a38483bdd9853394e 100644 (file)
@@ -36,6 +36,7 @@
        </td>
 </tr>
 </table>
+<input type="hidden" name="YesItIsPostedPackages" value="1">
 <p class="seperator">&nbsp;
 </p>