Code

Updated opsi host
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Mar 2010 10:04:51 +0000 (10:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Mar 2010 10:04:51 +0000 (10:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17017 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
gosa-plugins/opsi/admin/opsi/generic.tpl
gosa-plugins/opsi/admin/opsi/opsiware.tpl
gosa-plugins/opsi/admin/opsi/properties.tpl

index a2b081fb6f5740bb09ff218a4bde9a978e5b69d1..96993fd770daa8dfbfa2b168c4d2465591014c4b 100644 (file)
@@ -316,7 +316,7 @@ class opsiGeneric extends plugin
     foreach($this->a_availableLocalProducts as $name => $data){
       if(isset($this->a_selectedLocalProducts[$name])) continue;
 
-      $add_tab  = array("string"   => "<input type='image' src='images/back.png' name='add_lp_".$name."'>");
+      $add_tab  = array("string"   => image('images/back.png','add_lp_'.$name));
       $name_tab = array("string"   => $name);
       $desc_tab = array("string"   => "<div style='height: 14px;overflow:hidden;'>".$data['DESC']."</div>",
           "attach"   => "title='".$data['DESC']."' style='border-right:0px;'");
@@ -341,11 +341,11 @@ class opsiGeneric extends plugin
 
         /* Only display edit button, if there is something to edit 
          */
-        $edit = "<img src='images/empty.png' alt=' '>";
+        $edit = image('images/empty.png');
         if(count($data['CFG'])){
-          $edit = "<input type='image' src='images/lists/edit.png' name='edit_lp_".$name."'>";
+          $edit = image('images/lists/edit.png','edit_lp_'.$name);
         }
-        $del  = "<input type='image' src='images/lists/trash.png' name='del_lp_".$name."'>";  
+        $del = image('images/lists/trash.png','del_lp_'.$name);
 
         $opt_tab  = array("string" => $edit.$del,
             "attach" => "style='border-right:0px; width: 40px; text-align:right;'");
@@ -666,7 +666,7 @@ class opsiGeneric extends plugin
         /* Add product 
          */
         if(preg_match("/^add_lp_/",$name) && $this->acl_is_writeable("localProduct")){
-          $product = preg_replace("/^add_lp_(.*)_.$/","\\1",$name);
+          $product = preg_replace("/^add_lp_(.*)$/","\\1",$name);
           if(isset($this->a_availableLocalProducts[$product]) && !isset($this->a_selectedLocalProducts[$product])){
             $this->a_selectedLocalProducts[$product] = $this->a_availableLocalProducts[$product];
             $CFG = $this->opsi->get_product_properties($product);
@@ -682,7 +682,7 @@ class opsiGeneric extends plugin
         /* Delete product 
          */
         if(preg_match("/^del_lp_/",$name) && $this->acl_is_writeable("localProduct")){
-          $product = preg_replace("/^del_lp_(.*)_.$/","\\1",$name);
+          $product = preg_replace("/^del_lp_(.*)$/","\\1",$name);
           if(isset($this->a_selectedLocalProducts[$product])){
             unset($this->a_selectedLocalProducts[$product]);
           }
@@ -692,7 +692,7 @@ class opsiGeneric extends plugin
         /* Edit a product  
          */
         if(preg_match("/^edit_lp_/",$name) && $this->acl_is_readable("localProduct")){
-          $product = preg_replace("/^edit_lp_(.*)_.$/","\\1",$name);
+          $product = preg_replace("/^edit_lp_(.*)$/","\\1",$name);
           $this->dialog = new opsiProperties($this->config,
               $product,$this->a_selectedLocalProducts[$product]['CFG'],$this->hostId);
           break;
index 99641a1f62099152243b7fb8107b39043e9cc6cf..6b544c19cad681a5150dcdd32ea318bf6ac8e80d 100644 (file)
 
 <h3>{t}OPSI host{/t}</h3>
 
-{if $init_failed}
+{if $init_failed}<font style='color: #FF0000;'>
 
-<font style='color: #FF0000;'>{msgPool type=siError p=$message}</font>
+ {msgPool type=siError p=$message}</font>
+ <button type='submit' name='reinit'>{t}Retry{/t}</button>
 
-<button type='submit' name='reinit'>{t}Retry{/t}</button>
+{else}
 
+ <table style="width: 100%;" summary="{t}OPSI host{/t}">
+  <tr>
+   <td style="width:50%;" class="right-border">
+    <table summary="{t}Generic{/t}">
+     
+     {if $standalone}
+      <tr>
+       <td>{t}Name{/t}{$must}</td>
+       <td>
+        {render acl=$hostIdACL}
+         <input style='width:300px;' type='text' name='hostId' value='{$hostId}'>
+        {/render}
+       </td>
+      </tr>
 
-{else}
+      {else}
+
+      <tr>
+       <td>{t}Name{/t}</td>
+       <td>
+        {render acl=$hostIdACL}
+         <input style='width:300px;' type='text' disabled value="{$hostId}">
+        {/render}
+       </td>
+      </tr>
+      
+     {/if}
+     <tr>
+      <td>{t}Netboot product{/t}</td>
+      <td>
+
+       {render acl=$netbootProductACL}
+        <select name="opsi_netboot_product" onChange="document.mainform.submit();" size=1>
+         {foreach from=$ANP item=item key=key}
+          <option {if $key == $SNP} selected {/if} value="{$key}">{$key}</option>
+         {/foreach}
+        </select>
+       {/render}
+       
+       {if $netboot_configurable}
+        {image path="images/lists/edit.png" action="configure_netboot" title="{t}Configure product{/t}"}
+       {/if}
+      </td>
+     </tr>
+    </table>
+
+   </td>
+   <td>
+
+    <table summary="{t}Generic{/t}">
+     <tr>
+      <td>{t}Description{/t}</td>
+      <td>
+       {render acl=$descriptionACL}
+        <input type='text' name='description' value='{$description}'>
+       {/render}
+      </td>
+     </tr>
+     <tr>
+      <td>{t}Notes{/t}</td>
+      <td>
+       {render acl=$descriptionACL}
+        <input type='text' name='note' value='{$note}'>
+       {/render}
+      </td>
+     </tr>
+    </table>
+   </td>
+  </tr>
+ </table>
 
-<table style="width: 100%;">
- <tr>
-  <td>
-   <table>
-    {if $standalone}
-    <tr>
-     <td>{t}Name{/t}{$must}</td>
-     <td>
-{render acl=$hostIdACL}
-               <input style='width:300px;' type='text' name='hostId' value='{$hostId}'>
-{/render}
-        </td>
-    </tr>
-<!--
-    <tr>
-     <td>{t}MAC address{/t}{$must}</td>
-     <td>
-{render acl=$macACL}
-               <input type='text' name="dummy" value="{$mac}" disabled>
-{/render}
-        </td>
-       </tr>
--->
-       {else}
-    <tr>
-     <td>{t}Name{/t}</td>
-     <td>
-{render acl=$hostIdACL}
-               <input style='width:300px;' type='text' disabled value="{$hostId}">
-{/render}
-        </td>
-    </tr>
-<!--
-    <tr>
-     <td>{t}MAC address{/t}{$must}</td>
-     <td>
-{render acl=$macACL}
-               <input type='text' name="mac" value="{$mac}">
-{/render}
-        </td>
-    </tr>
--->
+ <hr>
+
+ <table width="100%" summary="{t}Package settings{/t}">
+  <tr>
+   <td style="width:50%;" class="right-border">
+    <h3>{t}Installed products{/t}</h3>
+    {render acl=$localProductACL}
+     {$divSLP}
+    {/render}
+   </td>
+   <td style="width:50%;">
+    <h3>{t}Available products{/t}</h3>
+    {render acl=$localProductACL}
+     {$divALP}
+    {/render}
+   </td>
+  </tr>
+ </table>
+    
+ {if $standalone}
+
+  <hr> 
+
+  <h3>{t}Action{/t}</h3>
+  <select name='opsi_action' size=1>
+   <option>&nbsp;</option>
+    {if $is_installed}
+     <option value="install">{t}Reinstall{/t}</option>
+    {else}
+     <option value="install">{t}Install{/t}</option>
     {/if}
-    <tr>
-     <td>{t}Netboot product{/t}</td>
-     <td>
-{render acl=$netbootProductACL}
-      <select name="opsi_netboot_product" onChange="document.mainform.submit();" size=1>
-               {foreach from=$ANP item=item key=key}
-                       <option {if $key == $SNP} selected {/if} value="{$key}">{$key}</option>
-               {/foreach}
-      </select>
-{/render}
-      &nbsp;
-      {if $netboot_configurable}
-                 {image path="images/lists/edit.png" action="configure_netboot" title="{t}Configure product{/t}"}
-      {else}
-<!--             <input type='image' name='dummy_10' src='images/lists/edit_gray.png'
-                       title='{t}Configure product{/t}' class='center'>-->
-      {/if}
-     </td>
-    </tr>
-   </table>
-  </td>
-  <td>
-
-   <table>
-    <tr>
-     <td>{t}Description{/t}</td>
-     <td>
-{render acl=$descriptionACL}
-               <input type='text' name='description' value='{$description}'>
-{/render}
-        </td>
-    </tr>
-    <tr>
-     <td>{t}Notes{/t}</td>
-     <td>
-{render acl=$descriptionACL}
-               <input type='text' name='note' value='{$note}'>
-{/render}
-        </td>
-    </tr>
-   </table>
-  </td>
- </tr>
- <tr>
-  <td colspan="2">
-   <hr>
-  </td>
- </tr>
- <tr>
-  <td style="width:50%;"><h3>{image path="plugins/opsi/images/product.png"}&nbsp;{t}Installed products{/t}</h3>
-{render acl=$localProductACL}
-       {$divSLP}
-{/render}
-  </td>
-  <td style="width:50%;"><h3>{t}Available products{/t}</h3>
-{render acl=$localProductACL}
-       {$divALP}
-{/render}
-  </td>
- </tr>
- <tr>
-  <td colspan="2">
-   <hr><br>
-   {if $standalone}
-    <h3>{t}Action{/t}</h3>
-       <select name='opsi_action' size=1>
-               <option>&nbsp;</option>
-               {if $is_installed}
-               <option value="install">{t}Reinstall{/t}</option>
-               {else}
-               <option value="install">{t}Install{/t}</option>
-               {/if}
-               <option value="wake">{t}Wake{/t}</option>
-       </select>
-{render acl=$triggerActionACL}
-       <button type='submit' name='opsi_trigger_action'>{t}Execute{/t}</button>
-
-{/render}
-   {/if}
-  </td>
- </tr>
-</table> 
-<hr>
-
-{$netconfig}
-
-<input type='hidden' name='opsiGeneric_posted' value='1'>
+    <option value="wake">{t}Wake{/t}</option>
+   </select>
+
+   {render acl=$triggerActionACL}
+    <button type='submit' name='opsi_trigger_action'>{t}Execute{/t}</button>
+   {/render}
+ {/if}
+
+ <hr>
+ {$netconfig}
+ <input type='hidden' name='opsiGeneric_posted' value='1'>
 {/if}
index 3077f54efaec516e103604f2143ce04658ac41a3..eb21b7ef0fe60be90eb68599a69bcee9fb6d23f2 100644 (file)
@@ -1,24 +1,33 @@
-{if $init_failed}
-       <h3>{t}Information{/t}</h3>
-       <font style='color: #FF0000;'>{msgPool type=siError p=$message}</font>
-       <button type='submit' name='reinit'>{t}Retry{/t}</button>
 
-{else}
-       {if $type == 0}
-               <h3>{t}Hardware information{/t}</h3>
-       {else}
-               <h3>{t}Software information{/t}</h3>
-       {/if}
 
-       {foreach from=$info item=item key=key}
-       <div style='background-color: #E8E8E8; width: 100%; border: 2px dotted #CCCCCC;'>
-       <h3>{t}Device{/t} {$key+1}</h3>
-               {foreach from=$item key=name item=value}
-                       <div style="text-transform:lowercase;width:30%; float: left; ">{$name}:&nbsp;</div> 
-                       <div style="width:70%; float: right;background-color: #DADADA;">{$value.0.VALUE}&nbsp;</div>
-                       <div style='clear: both;'></div>
-               {/foreach}
-       </div>
-       <br>
-       {/foreach}
-{/if}
+{if $init_failed}
+ <h3>{t}Information{/t}
+ </h3><font style='color: #FF0000;'>
+ {msgPool type=siError p=$message}</font>
+ <button type='submit' name='reinit'>{t}Retry{/t}</button>
+ {else}
+ {if $type == 0}
+  <h3>{t}Hardware information{/t}
+  </h3>
+  {else}
+  <h3>{t}Software information{/t}
+  </h3>
+  
+ {/if}{foreach from=$info item=item key=key}
+ <div style='background-color: #E8E8E8; width: 100%; border: 2px dotted #CCCCCC;'>
+  <h3>{t}Device{/t}
+   {$key+1}
+  </h3>{foreach from=$item key=name item=value}
+  <div style="text-transform:lowercase;width:30%; float: left; ">
+   {$name}:&nbsp;
+  </div>
+  <div style="width:70%; float: right;background-color: #DADADA;">
+   {$value.0.VALUE}&nbsp;
+  </div>
+  <div style='clear: both;'>
+  </div>{/foreach}
+ </div>
+ <br>{/foreach}
+{/if}
\ No newline at end of file
index 2980b56cdc1ea49bc30570be5043a6fa3f7ef2f3..cffab278872512234a565edba1afb0323f4a5508 100644 (file)
@@ -1,41 +1,43 @@
-<h3>{t}OPSI product properties{/t}</h3>
 
+<h3>{t}OPSI product properties{/t}
+</h3>
 
 {if $cfg_count == 0}
-<br>
-<b>{t}This OPSI product has no options.{/t}</b>
-<br>
-<br>
-
-{else}
-
-<table>
-{foreach from=$cfg item=item key=key}
-       <tr>
-               <td>{$key}</td>
-               <td>
-{render acl=$ACL}
-                       {if isset($item.VALUE_CNT)}
-                               <select name="value_{$key}" style='width:180px;' size=1>
-                               {foreach from=$item.VALUE key=k item=i}
-                                       <option {if $item.CURRENT == $i} selected {/if} value="{$i}">{$i}</option>
-                               {/foreach}
-                               </select>
-                       {else}
-                               <input type='input' name='value_{$key}' value="{$item.CURRENT}" style='width:280px;'>
-                       {/if}
-{/render}
-               </td>
-       </tr>
-{/foreach}
-</table>
-
+ <br>
+ <b>{t}This OPSI product has no options.{/t}</b>
+ <br>
+ <br>
+ {else}
+ <table>{foreach from=$cfg item=item key=key}
+  <tr>
+   <td>
+    {$key}
+   </td>
+   <td>
+    {render acl=$ACL}
+     
+     {if isset($item.VALUE_CNT)}
+      
+      <select name="value_{$key}" style='width:180px;' size=1>{foreach from=$item.VALUE key=k item=i}
+       
+       
+       <option {if $item.CURRENT == $i} selected {/if} value="{$i}">
+       {$i}</option>{/foreach}
+      </select>
+      {else}
+      <input type='input' name='value_{$key}' value="{$item.CURRENT}" style='width:280px;'>
+      
+     {/if}
+    {/render}
+   </td>
+  </tr>{/foreach}
+ </table>
 {/if}
 <hr>
 <div style='width:100%; text-align: right; padding:3px;'>
      <button type='submit' name='save_properties'>{msgPool type=saveButton}</button>
-
-       &nbsp;
      <button type='submit' name='cancel_properties'>{msgPool type=cancelButton}</button>
-
-</div>
<button type='submit' name='save_properties'>
+ {msgPool type=saveButton}</button>&nbsp;
+ <button type='submit' name='cancel_properties'>
+ {msgPool type=cancelButton}</button>
+</div>
\ No newline at end of file