Code

Release is selectable, and problems will be displayed
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Apr 2006 08:09:48 +0000 (08:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Apr 2006 08:09:48 +0000 (08:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3003 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc

index dd7c8ca6ce40fbf0026fc2c7a9f1ed7f93a2328c..087a0ef86a2826aae3a64feb275672e1620c08e1 100644 (file)
@@ -31,6 +31,7 @@ class appgroup extends plugin
   var $Releases                 = array();
   var $enableReleaseManagement  = false;
 
+  var $AllAppsForRelease        = array();
 
   function appgroup ($config, $dn= NULL)
   {
@@ -632,12 +633,26 @@ class appgroup extends plugin
 
     if(isset($this->gosaMemberApplication[$this->curCatDir])){
       foreach($this->gosaMemberApplication[$this->curCatDir] as $cat => $entry){
+
+        
+
         if(preg_match("/__SEPARATOR__/",$entry['App'])){
           $div2 ->AddEntry(array(array("string"=>$separator),
                 array("string"=>preg_replace("/\%s/",htmlentities($entry['App']),$upudown),"attach"=>"align='right' style='border-right:0px;'")));
         }else{
+
+          $broken = "";
+          if(!in_array($entry['App'],$this->AllAppsForRelease)){
+            if(!$this->enableReleaseManagement){
+              $broken = "<img src='images/false.png' title='"._("This application is no longer available.")."'>&nbsp;";
+            }else{
+              $broken = "<img src='images/false.png' title='".sprintf(_("This application is not available in any release named %s."),$this->Release)."'>&nbsp;";
+            }
+          }
+          
           $div2 ->AddEntry(array(array("string"=>sprintf($app,$entry['App'])),
-                array("string"=>preg_replace("/\%s/",htmlentities($entry['App']),$sep.$edit.$upudown),"attach"=>"align='right' style='border-right:0px;'")));
+                                 array("string"=>$broken,"attach"=>"style='width:28px;'"),
+                array("string"=>preg_replace("/\%s/",htmlentities($entry['App']),$sep.$edit.$upudown),"attach"=>"align='right' style='width:100px;border-right:0px;'")));
         }
       }
     }
@@ -658,6 +673,7 @@ class appgroup extends plugin
         $smarty->assign("ReleaseSelectAble", true);
       }
     }
+        $smarty->assign("ReleaseSelectAble", true);
 
     /* Show main page */
     if ($this->dialog){
@@ -828,6 +844,30 @@ $ldap->modify ($this->attrs);
           $attrs["cn"][0];
       }
     }
+
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("objectClass=gosaApplication",array("cn"));
+    $tmp = search_config($this->config->data,"faiManagement","CLASS");
+    $this->AllAppsForRelease = array();
+    if(!empty($tmp)){
+
+      $tmp = array_flip($this->Releases);
+
+      while($attrs = $ldap->fetch()){
+        $testdn = preg_replace("/ou=apps,.*$/","ou=apps",$attrs['dn']);
+        $testdn = preg_replace("/^[^,]+/","",$testdn);
+        $testdn = preg_replace("/^,/","",$testdn);
+
+        if($testdn == preg_replace("/ou=apps,.*$/","ou=apps",$tmp[$this->Release])){
+          $this->AllAppsForRelease[$attrs['dn']] = $attrs['cn'][0];
+        }
+      }
+    }else{
+      while($attrs = $ldap->fetch()){
+        $this->AllAppsForRelease[$attrs['dn']] = $attrs['cn'][0];
+      }
+    }
+
     natcasesort ($this->apps);
     reset ($this->apps);