Code

Removed inherit everything button from startup und service plugins.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jul 2007 07:22:39 +0000 (07:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jul 2007 07:22:39 +0000 (07:22 +0000)
Added Inherit button to workstationGeneric

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

plugins/admin/systems/class_workstationGeneric.inc
plugins/admin/systems/class_workstationService.inc
plugins/admin/systems/class_workstationStartup.inc
plugins/admin/systems/workstation.tpl
plugins/admin/systems/workstationService.tpl
plugins/admin/systems/workstationStartup.tpl

index c9414bf70b5952f13be74dcefddc2ae221749d02..42029b61323b95cd24544e5772370e5b47ad14cd 100644 (file)
@@ -58,6 +58,8 @@ class workgeneric extends plugin
 
   var $fai_activated = FALSE;
 
+  var $member_of_ogroup = FALSE;
+
   function workgeneric ($config, $dn= NULL, $parent= NULL)
   {
     /* Check if FAI is activated */
@@ -67,6 +69,14 @@ class workgeneric extends plugin
     }
 
     plugin::plugin ($config, $dn, $parent);
+
+    if(!isset($this->parent->by_object['ogroup'])){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd ($this->config->current['BASE']);
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
+      $this->member_of_ogroup = $ldap->count() >= 1;
+    }
+
     $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
     $this->netConfigDNS->acl = $this->acl;
 
@@ -284,9 +294,13 @@ class workgeneric extends plugin
     $this->netConfigDNS->cn= $this->cn;
     $smarty->assign("netconfig", $this->netConfigDNS->execute());
     $smarty->assign("fai_activated",$this->fai_activated);
+
+    $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
+  
     return($smarty->fetch (get_template_path('workstation.tpl', TRUE)));
   }
 
+
   function remove_from_parent()
   {
     $this->netConfigDNS->acl = $this->acl;
@@ -314,6 +328,10 @@ class workgeneric extends plugin
   {
     plugin::save_object();
 
+    if(isset($_POST["inheritAll"])){
+      $this->set_everything_to_inherited();
+    }
+
     /* Save base, since this is no LDAP attribute */
     if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
       $this->base= $_POST['base'];
@@ -478,7 +496,23 @@ class workgeneric extends plugin
     show_ldap_error($ldap->get_error(), _("Saving workstation failed"));
   }
 
-}
+  function set_everything_to_inherited()
+  {
+    /* Set workstation service attributes to inherited */
+    if($this->member_of_ogroup && isset($this->parent->by_object['workservice'])){
+      foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant",
+            "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseType") as $name){
+        $this->parent->by_object['workservice']->$name = "default"; 
+      }
+    }
 
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+    /* Set workstation startup attributes to inherited */
+    if($this->member_of_ogroup && isset($this->parent->by_object['workstartup'])){
+      $this->parent->by_object['workstartup']->gotoBootKernel = "default-inherited";
+      $this->parent->by_object['workstartup']->gotoLdapServer = "default-inherited";
+      $this->parent->by_object['workstartup']->FAIdebianMirror= "inherited";
+    }
+  }
+}
+  // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index a12ac099244755167392beb14dd4f5e2062d83a7..54af9393d7f4567a411d4a39d24d587c35b5c3a4 100644 (file)
@@ -53,19 +53,10 @@ class workservice extends plugin
   var $XKbLayouts       =array();
   var $XKbVariants      =array();
 
-  var $member_of_ogroup = FALSE;
-
   function workservice ($config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
 
-    if(!isset($this->parent->by_object['ogroup'])){
-      $ldap = $this->config->get_ldap_link();
-      $ldap->cd ($this->config->current['BASE']);
-      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
-      $this->member_of_ogroup = $ldap->count() >= 1;
-    }
-
     $this->XResolutions= array( 
         "640x480"   =>  "640x480",
         "800x600"   =>  "800x600",
@@ -331,8 +322,6 @@ class workservice extends plugin
       $smarty->assign("hiddenState","");
     }
 
-    $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
-
     /* Show main page */
     return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__))));
   }
@@ -347,10 +336,6 @@ class workservice extends plugin
   {
     plugin::save_object();
 
-    if(isset($_POST["inheritAll"])){
-      $this->set_everything_to_inherited();
-    }
-
     if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){
       if(isset($_POST['AutoSync'])){
         $this->AutoSync = true;
@@ -444,19 +429,6 @@ class workservice extends plugin
     $this->handle_post_events("modify");
   }
 
-  
-  function set_everything_to_inherited()
-  {
-      $this->gotoXKbLayout = "default";
-      $this->gotoXKbModel = "default";
-      $this->gotoXKbVariant = "default";      
-
-      $this->gotoXDriver ="default";
-      $this->gotoXResolution ="default";
-      $this->gotoXColordepth ="default";
-      $this->gotoXMouseType ="default";
-      $this->gotoXMouseport ="default";
-  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 837920e3ea4e5a669bc9f03dd01789623809df36..be645996ff75d16e02a3f86fc9d94eb84cca98f3 100644 (file)
@@ -32,7 +32,6 @@ class workstartup extends plugin
   var $customParameters   = "";
   var $orig_dn            = "";
   var $ignore_account     = TRUE;
-  var $member_of_ogroup   = FALSE;
  
   /* FAI class selection */ 
   var $FAIclass           = array();
@@ -66,13 +65,6 @@ class workstartup extends plugin
 
     plugin::plugin ($config, $dn, $parent);
 
-    if(!isset($this->parent->by_object['ogroup'])){
-      $ldap = $this->config->get_ldap_link();
-      $ldap->cd ($this->config->current['BASE']);
-      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
-      $this->member_of_ogroup = $ldap->count() >= 1;
-    }
-
     /* Creating a list of valid Mirrors 
      * none will not be saved to ldap.
      */
@@ -800,8 +792,6 @@ class workstartup extends plugin
       $smarty->assign($value."ACL", chkacl($this->acl, "$value"));
     }
 
-    $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
-
     /* Show main page */
     return($smarty->fetch (get_template_path('workstationStartup.tpl', TRUE,dirname(__FILE__))));
   }
@@ -940,9 +930,6 @@ class workstartup extends plugin
       $this->customParameters= $_POST["customParameters"];
     }
 
-    if(isset($_POST["inheritAll"])){
-      $this->set_everything_to_inherited();
-    }
   }
 
 
@@ -1158,13 +1145,6 @@ class workstartup extends plugin
     return($ret);
   }
 
-
-  function set_everything_to_inherited()
-  {
-    $this->gotoBootKernel = "default-inherited";
-    $this->gotoLdapServer = "default-inherited";
-    $this->FAIdebianMirror= "inherited";
-  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 9d6b9f85d0d3078e06be2f20dfd9e779e0a260fa..0a8f0fd06b5eef39f84fdefb1e58376b426c240d 100644 (file)
             <img src="images/folder_gray.png" class="center" title="{t}Select a base{/t}">
         {/if}
     </tr>
+{if $member_of_ogroup}
+       <tr>
+               <td>
+                       {t}Inheritance{/t}
+               </td>
+               <td>
+       <input type='submit' name='inheritAll' value='{t}Inherit all{/t}'>
+               </td>
+       </tr>
+{/if}
+
    </table>
   </td>
   <td  style="vertical-align:top;border-left:1px solid #A0A0A0;">
index fe10a2efe7efabe8318a98035fa005d007088000..3cc0357c35fcdbc221d1a772b5a583c9a5939694 100644 (file)
@@ -1,6 +1,3 @@
-{if $member_of_ogroup}
-<input type='submit' name='inheritAll' value='{t}Inherit all{/t}'>
-{/if}
 <table style="width:100%;" summary="">
  <tr>
   <td style="width:33%; vertical-align:top;">
index 446d7475f9239f45c10611a9bad09e8fba77c478..23878411926656b40f3a40f0cf43921637f92d59 100644 (file)
@@ -1,7 +1,3 @@
-{if $member_of_ogroup}
-<input type='submit' name='inheritAll' value='{t}Inherit all{/t}'>
-{/if}
-
 <table summary="" style="width:100%;">
  <tr>
   <td style="width:50%; vertical-align:top;">