Code

Group Application
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Feb 2008 09:16:06 +0000 (09:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Feb 2008 09:16:06 +0000 (09:16 +0000)
-Mark those releases with configured menu structure.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8849 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/groups/apps/app_list.tpl
gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc

index 1ac482c128e9163911c62bc25382e0939c3a0805..044c21df903c5364639cd53bfa33b544822827f9 100644 (file)
@@ -5,7 +5,11 @@
                        {t}Release{/t}
                        <select name="FAIrelease" onChange="document.mainform.submit();">
                        {foreach from=$releases item=item key=key}
-                               <option value="{$key}" {if $key == $FAIrelease} selected {/if}>{$item.name}</option>
+                               {if $item.found}
+                               <option value="{$key}" {if $key == $FAIrelease} selected {/if}>{$item.name} </option>
+                               {else}
+                               <option style="color: #999999;" value="{$key}" {if $key == $FAIrelease} selected {/if}>{$item.name} </option>
+                               {/if}
                        {/foreach}
                        </select>
                </td>
index 0877b855fb5dfb6b1851057bc14c5e3080792bd3..33231aacdd12d92e1137df72ea2db8c7fd3e5acf 100644 (file)
@@ -93,7 +93,7 @@ class appgroup extends plugin
     */
   function getReleases()
   {
-    $ret =array("/" => array("name" => "/" , "parts" => array(),"suffix" => get_ou('applicationou')));
+    $ret =array("/" => array("name" => "/", "found" => TRUE , "parts" => array(),"suffix" => get_ou('applicationou')));
     if($this->enableReleaseManagement){
 
       /* Only display those releases that we are able to read */
@@ -125,7 +125,18 @@ class appgroup extends plugin
             $FAIstate = $attrs['FAIstate'][0];
           }
 
+          $all = $this->_get_all_entries();
+          $found = FALSE;
+          foreach($all as $entry){
+            if(isset($entry['DN']) && preg_match("/^".normalizePreg($bb)."/",$entry['DN'])){
+              $found =TRUE;
+              break;
+            }
+          }
+
+          $cnt = 0;
           $ret[$name] = array("name"     => $name, 
+              "found"    => $found,
               "FAIstate" => $FAIstate,
               "dn"       => $attrs['dn'], 
               "parts"    => $parts,"suffix" => $bb.get_ou('applicationou'));