Code

Updated FAI
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Jan 2010 15:17:18 +0000 (15:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Jan 2010 15:17:18 +0000 (15:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15110 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/system-filter.tpl [new file with mode: 0644]
gosa-plugins/systems/admin/systems/system-filter.xml [new file with mode: 0644]
gosa-plugins/systems/admin/systems/system-list.tpl [new file with mode: 0644]
gosa-plugins/systems/admin/systems/system-list.xml [new file with mode: 0644]

index 5f40cfe1bbf9f08a2c0f48da2bffaec4da4bd803..5128ca66d96eb19131f0b147542d4db779bd2c96 100644 (file)
@@ -71,28 +71,29 @@ class systemManagement extends management
     if($this->config->get_cfg_value("enableSnapshots") == "true"){
       $this->snapHandler = new SnapshotHandler($this->config);
     }
-    parent::__construct($config, $ui, "roles", $headpage);
+    parent::__construct($config, $ui, "systems", $headpage);
   }
 
 
   
-  /*! \brief   Overridden render method of class mangement.
-   *            this allows us to add a release selection box.
-   */
-  function renderList()
-  {
-    $headpage = $this->getHeadpage();
-
-    $tD = $this->getObjectDefinitions();
-    $smarty = get_smarty();
-    foreach($tD as $name => $obj){
-#      $smarty->assign("USE_".$name, (empty($obj['CLASS']) || class_available($obj['CLASS'])));
-    }
+ /*! \brief   Overridden render method of class mangement.
+  *            this allows us to add a release selection box.
+  */
+function renderList()
+{
+  $headpage = $this->getHeadpage();
+  $headpage->update();
 
-    $display = $headpage->render();
-    return($this->getHeader().$display);
+  $tD = $this->getObjectDefinitions();
+  $smarty = get_smarty();
+  foreach($tD as $name => $obj){
+    $smarty->assign("USE_".$name, (empty($obj['TABNAME']) || class_available($obj['TABNAME'])));
   }
 
+  $display = $headpage->render();
+  return($this->getHeader().$display);
+}
+
 
   public function getObjectDefinitions()
   {
@@ -175,17 +176,15 @@ class systemManagement extends management
             "TABNAME" => "componentGeneric",
             "TABCLASS"=> "componenttabs",
             "ACLC"    => "component",
-            "ACL"     => "component/componentGeneric"));
-
-    if($this->opsi != NULL){
-      $tabs["opsi_client"] = array(
-          "RDN"       => "",
-          "CLASS"   => "OPSITABS",
-          "TABNAME" => "opsiGeneric" ,
-          "TABCLASS"=> "opsi_tabs",
-          "ACLC"    => "opsi" ,
-          "ACL"     => "opsi/opsiGeneric");
-    }
+            "ACL"     => "component/componentGeneric"),
+
+        "opsi_client" => array(
+            "RDN"     => "",
+            "CLASS"   => "OPSITABS",
+            "TABNAME" => "opsiGeneric" ,
+            "TABCLASS"=> "opsi_tabs",
+            "ACLC"    => "opsi" ,
+            "ACL"     => "opsi/opsiGeneric"));
 
     return($tabs);
   }
diff --git a/gosa-plugins/systems/admin/systems/system-filter.tpl b/gosa-plugins/systems/admin/systems/system-filter.tpl
new file mode 100644 (file)
index 0000000..4586cb3
--- /dev/null
@@ -0,0 +1,62 @@
+<div class="contentboxh">
+ <p class="contentboxh">
+  <img src="images/launch.png" align="right" alt="[F]">{t}Filter{/t}
+ </p>
+</div>
+
+<div class="contentboxb">
+  <div style="border-top:1px solid #AAAAAA"></div>
+
+  {if $USE_server}
+  {$SERVER}&nbsp;{t}Show servers{/t}<br>
+  {/if}
+  {if $USE_workstation}
+  {$WORKSTATION}&nbsp;{t}Show workstations{/t}<br>
+  {/if}
+  {if $USE_terminal}
+  {$TERMINAL}&nbsp;{t}Show terminals{/t}<br>
+  {/if}
+  {if $USE_printer}
+  {$PRINTER}&nbsp;{t}Show printer{/t}<br>
+  {/if}
+  {if $USE_phone}
+  {$PHONE}&nbsp;{t}Show phones{/t}<br>
+  {/if}
+  {if $USE_winstation}
+  {$WINSTATION}&nbsp;{t}Show windows workstations{/t}<br>
+  {/if}
+  {if $USE_component}
+  {$COMPONENT}&nbsp;{t}Show network devices{/t}<br>
+  {/if}
+  {if $USE_incoming}
+  {$INCOMING}&nbsp;{t}Show incoming devices{/t}<br>
+  {/if}
+  {if $USE_opsi_client}
+  {$OPSI}&nbsp;{t}Show opsi hosts{/t}<br>
+  {/if}
+
+  <div style="border-top:1px solid #AAAAAA"></div>
+
+ {$SCOPE}
+
+ <table summary="" style="width:100%;border-top:1px solid #B0B0B0;">
+  <tr>
+   <td>
+    <label for="NAME">
+     <img src="images/lists/search.png" align=middle>&nbsp;Name
+    </label>
+   </td>
+   <td>
+    {$NAME}
+   </td>
+  </tr>
+ </table>
+
+ <table summary=""  width="100%"  style="background:#EEEEEE;border-top:1px solid #B0B0B0;">
+  <tr>
+   <td width="100%" align="right">
+    {$APPLY}
+   </td>
+  </tr>
+ </table>
+</div>
diff --git a/gosa-plugins/systems/admin/systems/system-filter.xml b/gosa-plugins/systems/admin/systems/system-filter.xml
new file mode 100644 (file)
index 0000000..d1e73ab
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<filterdef>
+  <definition>
+    <category>roles</category>
+    <template>system-filter.tpl</template>
+    <initial>true</initial>
+  </definition>
+
+  <search>
+    <query>
+      <backend>LDAP</backend>
+      <filter>(&amp;(|$SERVER(objectClass=goServer))$NAME)</filter>
+      <attribute>dn</attribute>
+      <attribute>objectClass</attribute>
+      <attribute>cn</attribute>
+      <attribute>description</attribute>
+    </query>
+    <scope>auto</scope>
+  </search>
+
+  <element>
+    <type>checkbox</type>
+    <tag>SERVER</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goServer)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>WORKSTATION</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>TERMINAL</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>PRINTER</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>PHONE</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>WINSTATION</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>COMPONENT</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>checkbox</type>
+    <tag>INCOMING</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+
+  <element>
+    <type>checkbox</type>
+    <tag>OPSI</tag>
+    <default>true</default>
+    <unset></unset>
+    <set>(objectClass=goWorkstation)</set>
+  </element>
+
+  <element>
+    <type>textfield</type>
+    <tag>NAME</tag>
+    <size>20</size>
+    <maxlength>60</maxlength>
+    <default></default>
+    <unset></unset>
+    <set>(cn=*$*)</set>
+    <alphabet>false</alphabet>
+    <autocomplete>
+      <backend>LDAP</backend>
+      <filter>(&amp;(objectClass=organizationalRole)(cn=*$NAME*))</filter>
+      <attribute>cn</attribute>
+      <frequency>0.5</frequency>
+      <characters>3</characters>
+    </autocomplete>
+  </element>
+
+</filterdef>
diff --git a/gosa-plugins/systems/admin/systems/system-list.tpl b/gosa-plugins/systems/admin/systems/system-list.tpl
new file mode 100644 (file)
index 0000000..b233c58
--- /dev/null
@@ -0,0 +1,31 @@
+<input type='image' src='images/empty.png' name='no_action_posted' value='do_nothing' alt='' style='width:2px;height:2px;'>
+
+<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=2>
+  <tr>
+    <td style="vertical-align:top; width:50%;">
+      <div class="contentboxh">
+        <p class="contentboxh">&nbsp;{$HEADLINE}&nbsp;{$SIZELIMIT}</p>
+      </div>
+      
+      <div class="contentboxb">
+       <div style='background:white;padding:0px;padding:3px;'>
+        <table><tr>
+          <td>{$ROOT}&nbsp;</td><td>{$BACK}&nbsp;</td><td>{$HOME}&nbsp;</td><td>{$RELOAD}&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td>{t}Base{/t} {$BASE}&nbsp;<input class='center' type='image' src='images/lists/submit.png' align='middle' title='{t}Update{/t}' name='submit_department' alt='{t}Submit{/t}'>&nbsp;</td><td>{$SEPARATOR}&nbsp;</td><td><img src='images/rocket.png' alt='' class='center'></td><td> {$ACTIONS}</td>
+        </tr></table>
+       </div>
+      </div>
+      
+      <div style='height:4px;'>
+      </div>
+      
+      <input type="hidden" id="d_save" value="450">
+      <input type="hidden" id="d_space" value="760">
+      {$LIST}
+    </td>
+    <td style='vertical-align:top'>
+      {$FILTER}
+    </td>
+  </tr>
+</table>
+
+<input type="hidden" name="ignore">
diff --git a/gosa-plugins/systems/admin/systems/system-list.xml b/gosa-plugins/systems/admin/systems/system-list.xml
new file mode 100644 (file)
index 0000000..121afa2
--- /dev/null
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<list>
+  <definition>
+    <departmentBrowser>true</departmentBrowser>
+    <departmentRootVisible>false</departmentRootVisible>
+    <baseMode>true</baseMode>
+    <multiSelect>true</multiSelect>
+    <template>system-list.tpl</template>
+    <module>roles</module>
+    <label>List of systems</label>
+    <defaultSortColumn>1</defaultSortColumn>
+
+    <objectType>
+      <label>Role</label>
+      <objectClass>organizationalRole</objectClass>
+      <category>roles</category>
+      <class>role</class>
+      <image>plugins/rolemanagement/images/role.png</image>
+    </objectType>
+
+  </definition>
+
+  <table>
+    <layout>|20px;c||250px|170px;r|</layout>
+
+    <department>
+      <value>%{filter:objectType(dn,objectClass)}</value>
+    </department>
+
+    <department>
+      <value>%{filter:departmentLink(row,dn,description)}</value>
+      <span>2</span>
+    </department>
+
+    <column>
+      <value>%{filter:objectType(dn,objectClass)}</value>
+    </column>
+
+    <column>
+      <label>Name</label>
+      <sortAttribute>cn</sortAttribute>
+      <sortType>string</sortType>
+      <value>%{filter:link(row,dn,"%s",cn)}</value>
+      <export>true</export>
+    </column>
+
+    <column>
+      <label>Description</label>
+      <sortAttribute>description</sortAttribute>
+      <sortType>string</sortType>
+      <value>%{filter:link(row,dn,"%s",description)}</value>
+      <export>true</export>
+    </column>
+
+    <column>
+      <label>Actions</label>
+      <value>%{filter:actions(dn,row,objectClass)}</value>
+    </column>
+
+  </table>
+
+  <actionmenu>
+
+    <action>
+     <type>sub</type>
+     <image>images/lists/new.png</image>
+     <label>Create</label>
+
+     <action>
+      <name>new</name>
+      <type>entry</type>
+      <image>plugins/rolemanagement/images/new.png</image>
+      <label>Role</label>
+     </action>
+    </action>
+
+    <action>
+      <type>separator</type>
+    </action>
+
+    <action>
+      <name>edit</name>
+      <type>entry</type>
+      <image>images/lists/edit.png</image>
+      <label>Edit</label>
+    </action>
+
+    <action>
+      <name>remove</name>
+      <type>entry</type>
+      <image>images/lists/trash.png</image>
+      <label>Remove</label>
+    </action>
+
+    <action>
+      <type>exporter</type>
+    </action>
+
+    <action>
+      <type>separator</type>
+    </action>
+
+    <action>
+      <type>copypaste</type>
+    </action>
+
+    <action>
+      <type>snapshot</type>
+    </action>
+
+  </actionmenu>
+
+  <actiontriggers snapshot="true" copypaste="true">
+
+    <action>
+      <name>cp</name>
+      <type>copypaste</type>
+    </action>
+
+    <action>
+      <name>edit</name>
+      <type>entry</type>
+      <image>images/lists/edit.png</image>
+      <label>Edit role</label>
+    </action>
+
+    <action>
+      <name>snapshot</name>
+      <type>snapshot</type>
+    </action>
+
+    <action>
+      <name>remove</name>
+      <type>entry</type>
+      <image>images/lists/trash.png</image>
+      <acl>roles/role[d]</acl>
+      <label>Remove role</label>
+    </action>
+
+  </actiontriggers>
+
+</list>