Code

Updated application listing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Mar 2010 08:06:47 +0000 (08:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Mar 2010 08:06:47 +0000 (08:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17420 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/applications/application-filter-release.xml
gosa-plugins/goto/admin/applications/application-list-release.tpl
gosa-plugins/goto/admin/applications/class_applicationManagement.inc

index 53591c8eff133be638d528e43decc81587e2a547..35702f59adc3124a226ad845c3038f373960e8d1 100644 (file)
@@ -3,46 +3,31 @@
 <filterdef>
   <definition>
     <category>application</category>
-    <template>application-filter-release.tpl</template>
     <initial>true</initial>
+
+    <attribute>dn</attribute>
+    <attribute>objectClass</attribute>
+    <attribute>cn</attribute>
+    <attribute>description</attribute>
+  
+    <scope>auto</scope>
+    <default>default</default>
+
   </definition>
 
   <search>
+    <tag>default</tag>
+    <label>Default filter</label>
     <query>
       <backend>LDAP</backend>
-      <filter>(&amp;(objectClass=gosaApplication)$NAME)</filter>
-      <attribute>dn</attribute>
-      <attribute>objectClass</attribute>
-      <attribute>cn</attribute>
-      <attribute>description</attribute>
+      <filter>(&amp;(objectClass=gosaApplication)(|(cn=$)(description=$)))</filter>
     </query>
-    <scope>auto</scope>
-  </search>
-
-  <element>
-    <tag>RELEASE</tag>
-    <type>combobox</type>
-    <value>Loading.</value>
-    <value>Loading..</value>
-    <value>Loading...</value>
-  </element>
-
-  <element>
-    <type>textfield</type>
-    <tag>NAME</tag>
-    <size>20</size>
-    <maxlength>60</maxlength>
-    <default></default>
-    <unset></unset>
-    <set>(|(cn=*$*)(description=*$*))</set>
-    <alphabet>true</alphabet>
     <autocomplete>
       <backend>LDAP</backend>
-      <filter>(&amp;(objectClass=gosaApplication)(|(cn=*$NAME*)(description=*$NAME*)))</filter>
       <attribute>cn</attribute>
       <frequency>0.5</frequency>
       <characters>3</characters>
     </autocomplete>
-  </element>
+  </search>
 
 </filterdef>
index dcc71691abcbc33ec5c8e9af4fb8b81b6563fb6a..e406e1d449a24fae968477218d457bf4a76eaedf 100644 (file)
@@ -5,11 +5,8 @@
    <div class="mainlist-nav">
     <table summary="{$HEADLINE}">
      <tr>
-      <td>{$ROOT}</td>
-      <td>{$BACK}</td>
-      <td>{$HOME}</td>
       <td>{$RELOAD}</td>
-      <td class="left-border">{t}Base{/t} {$BASE}</td>
+      <td class="left-border">{t}Release{/t} {$RELEASE}</td>
       <td class="left-border">{$ACTIONS}</td>
       <td class="left-border">{$FILTER}</td>
      </tr>
index 43ec0c5bbd1921be09c5bf4030b47bd07970fc18..aec27779e8660a9311ee619697e4b3c640170e5f 100644 (file)
@@ -27,6 +27,7 @@ class applicationManagement extends management
   var $plIcon  = "plugins/goto/images/application.png";
 
   var $app_release = ""; // The currently selected release while in release management mode!
+  var $app_base = ""; // The currently selected release while in release management mode!
 
   // Tab definition 
   protected $tabClass = "apptabs";
@@ -35,16 +36,21 @@ class applicationManagement extends management
   protected $aclPlugin   = "application";
   protected $objectName   = "application";
 
+  var $releaseSelector = NULL;
+
   function __construct($config,$ui)
   {
     $this->config = $config;
     $this->ui = $ui;
+    $this->app_base    = get_ou('applicationRDN').$this->config->current['BASE'];
+    $this->app_release = get_ou('applicationRDN').$this->config->current['BASE'];
 
     if($this->IsReleaseManagementActivated()){
-      $this->app_release = get_ou('applicationRDN').$this->config->current['BASE'];
       $filter_xml = "application-filter-release.xml";
       $list_xml = "application-list-release.xml";
       $this->storagePoints= array("");
+      $releases = faiManagement::getReleaseStates($this->config,$this->app_base);
+      $this->releaseSelector = new releaseSelector($releases, $this->app_release, $this->app_release);
     }else{
       $filter_xml = "application-filter.xml";
       $list_xml = "application-list.xml";
@@ -79,24 +85,27 @@ class applicationManagement extends management
     $this->registerAction("edit_mailapplication","editEntry");
   }
 
+
+  /*! \brief   Overridden render method of class mangement.
+   *            this allows us to add a release selection box.
+   */
   function renderList()
   {
+    $smarty = get_smarty();
     $filter = $this->getFilter();
     $headpage = $this->getHeadpage();
-    if($this->IsReleaseManagementActivated()){    
-      $filter->setComboBoxOptions("RELEASE",$this->getReleaseList());
 
-      if(isset($_POST['RELEASE'])){
-        $this->app_release = get_post('RELEASE');
-      }
-      $headpage->setBase($this->app_release);
-    }
+    $this->releaseSelector->update();
+    $this->app_release = $this->releaseSelector->getBase();
 
+    $headpage->setBase($this->app_release);
     $headpage->update();
+    $smarty->assign("RELEASE", $this->releaseSelector->render());
     $display = $headpage->render();
     return($this->getHeader().$display);
   }
 
+
   function getReleaseList($base = "", $prefix ="")
   {
     $list = array();