Code

* Added traffic lights for fai installations
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 May 2006 14:43:49 +0000 (14:43 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 May 2006 14:43:49 +0000 (14:43 +0000)
* Prepared hack to adapt texts if we want to remove objects

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

TODO
ihtml/themes/default/islocked.tpl
include/functions.inc
plugins/admin/systems/class_systemManagement.inc

diff --git a/TODO b/TODO
index f55504667a2a6de28413d2995a83114ac9cf53de..f5be5bc5f59ee94281bcc2247906b4d7049947bc 100644 (file)
--- a/TODO
+++ b/TODO
@@ -27,8 +27,6 @@ Target for 2.4.1:
 * Auto-Resize for subdialogs
 
 
-* Create a status-bar/-display for FAI installations 
-
 * Fix fai objects to generate tags if needed (sub objects)
 
 * What about unitTag's when moving objects?
@@ -40,16 +38,10 @@ Target for 2.5:
 * Asterisk : Create entry like this #309,1,PickupChan(SIP/rainer), 
                         to allow others to pickup the phone by pressing # and number of the phone.
 
-* Rework group->application assignment.
-
 * Evaluate patches for certificate generation
 
 * Bug submitter
 
-* Fix translation mode
-
-* Gofon -Asterisk-database name should be defined in database tab, currently this setting is hard coded in class_config.inc
-
 * Complete PHP5 compliance and optimization
 
 * Simplify plugins by providing a schema parser
@@ -99,5 +91,3 @@ Target for 2.5:
 
 * Try RDN style for unique names
 
-* Object Groups should have member tabs depending of the grouped object types
-
index ec6f7ff5b2ce5a6dba90ece9bac6df7b0d30f461..93e40ce70bae1275e5fb9c7216ba628d15e03a6c 100644 (file)
@@ -10,7 +10,7 @@
 </p>
 
 <p class="plugbottom">
-  <input type="submit" name="delete_lock" value="{t}Edit anyway{/t}">
+  <input type="submit" name="delete_lock" value="{$action}">
   &nbsp;
   <input type="submit" name="cancel_lock" value="{t}Cancel{/t}">
 </p>
index 92f858105b100df5da3fa5d1566d106180e78b63..8529427616bfb13d32406439ab6a2ca4e02501be 100644 (file)
@@ -1001,6 +1001,8 @@ function gen_locked_message($user, $dn)
   $ldap->cat ($user);
   $attrs= $ldap->fetch();
   $uid= $attrs["uid"][0];
+  $cn= $attrs["cn"][0];
+  $remove= false;
 
   //  print_a($_POST);
   //  print_a($_GET);
@@ -1028,7 +1030,12 @@ function gen_locked_message($user, $dn)
   /* Prepare and show template */
   $smarty= get_smarty();
   $smarty->assign ("dn", $dn);
-  $smarty->assign ("message", sprintf(_("You're going to edit the LDAP entry '%s' which appears to be used by '%s'. Please contact the person in order to clarify proceedings."), $dn, "<a href=\"main.php?plug=0&amp;viewid=$uid\">$uid</a>"));
+  if ($remove){
+    $smarty->assign ("action", _("Continue anyway"));
+  } else {
+    $smarty->assign ("action", _("Edit anyway"));
+  }
+  $smarty->assign ("message", sprintf(_("You're going to edit the LDAP entry '%s' which appears to be used by '%s'. Please contact the person in order to clarify proceedings."), "<b>".$dn."</b>", "<b><a href=\"main.php?plug=0&amp;viewid=$uid\">$cn</a></b>"));
 
   return ($smarty->fetch (get_template_path('islocked.tpl')));
 }
index c3ee3c88dd65c38d54b4795a70e49b31fa5b597a..ad8910dd40bea4622894cc269d38c20cdf5267cf 100644 (file)
@@ -580,7 +580,7 @@ class systems extends plugin
         if($oc['CLASS'] != ""){
           $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))";
           $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base,
-                array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), GL_NONE));
+                array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE));
         }
       } 
     }
@@ -639,12 +639,18 @@ class systems extends plugin
             $terminal['location'] = array_search($tmp, $this->config->departments);
             $terminal['message']  = _("Workstation template for");
           }
+          if (isset($value["FAIstate"][0])){
+            $terminal['type']= $this->getState($terminal['type'], $value["FAIstate"][0]);
+          }
         } elseif (in_array('gotoPrinter', $value["objectClass"])){
           $terminal             = $value;
           $terminal['type']     = "P";
         } elseif (in_array('goServer', $value["objectClass"])){
           $terminal             = $value;
           $terminal['type']     = "S";
+          if (isset($value["FAIstate"][0])){
+            $terminal['type']= $this->getState($terminal['type'], $value["FAIstate"][0]);
+          }
         } elseif (in_array('goFonHardware', $value["objectClass"])){
           $terminal             = $value;
           $terminal['type']     = "F";
@@ -723,8 +729,14 @@ class systems extends plugin
         "D" => array("select_default.png",_("Template")),
         "T" => array("select_terminal.png",_("Terminal")),
         "L" => array("select_workstation.png",_("Workstation")),
+        "GL" => array("select_workstation_green.png",_("Workstation is installing")),
+        "YL" => array("select_workstation_yellow.png",_("Workstation is waiting for action")),
+        "RL" => array("select_workstation_red.png",_("Workstation installation failed")),
         "F" => array("select_phone.png",_("Phone")),
         "S" => array("select_server.png",_("Server")),
+        "GS" => array("select_server_green.png",_("Server is installing")),
+        "YS" => array("select_server_yellow.png",_("Server is waiting for action")),
+        "RS" => array("select_server_red.png",_("Server installation failed")),
         "W" => array("select_winstation.png",_("Winstation")),
         "C" => array("select_component.png",_("Network Device")),
         "NT"=> array("select_new_terminal.png",_("New Terminal")),
@@ -743,6 +755,31 @@ class systems extends plugin
     }
   }
 
+  
+  function getState($type, $state)
+  {
+    switch (preg_replace('/:.*$/', '', $state)) {
+      case 'installing':
+                $type= 'G'.$type;
+                break;
+      case 'error':
+                $type= 'R'.$type;
+                break;
+      case 'install':
+                $type= 'Y'.$type;
+                break;
+      case 'sysinfo':
+                $type= 'Y'.$type;
+                break;
+      case 'softupdate':
+                $type= 'Y'.$type;
+                break;
+    }
+
+
+    return ($type);
+  }
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: