Code

Updated FAI
[gosa.git] / gosa-plugins / systems / admin / systems / class_systemManagement.inc
1 <?php
2 /*
3  * This code is part of GOsa (http://www.gosa-project.org)
4  * Copyright (C) 2003-2008 GONICUS GmbH
5  *
6  * ID: $$Id$$
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
23 class systemManagement extends management
24 {
25   var $plHeadline     = "Systems";
26   var $plDescription  = "List of systems";
27   var $plIcon  = "plugins/systems/images/plugin.png";
29   // Tab definition 
30   protected $tabClass = "";
31   protected $tabType = "";
32   protected $aclCategory = "";
33   protected $aclPlugin   = "";
34   protected $objectName   = "";
36   protected $objectInfo = array();
38   protected $opsi = NULL;
40   function __construct($config,$ui)
41   {
42     $this->config = $config;
43     $this->ui = $ui;
45     // Set storage points 
46     $tD = $this->getObjectDefinitions(); 
47     $sP = array();
48     foreach($tD as $entry){
49       if(!empty($entry['RDN']))
50       $sP[] = $entry['RDN'];
51     }
52     $this->storagePoints = array_unique($sP);
54 #    // Build filter
55 #    if (session::global_is_set(get_class($this)."_filter")){
56 #      $filter= session::global_get(get_class($this)."_filter");
57 #    } else {
58       $filter = new filter(get_template_path("system-filter.xml", true));
59       $filter->setObjectStorage($this->storagePoints);
60 #    }
61     $this->setFilter($filter);
63     // Build headpage
64     $headpage = new listing(get_template_path("system-list.xml", true));
65     $headpage->setFilter($filter);
67     // Add copy&paste and snapshot handler.
68     if ($this->config->boolValueIsTrue("main", "copyPaste")){
69       $this->cpHandler = new CopyPasteHandler($this->config);
70     }
71     if($this->config->get_cfg_value("enableSnapshots") == "true"){
72       $this->snapHandler = new SnapshotHandler($this->config);
73     }
74     parent::__construct($config, $ui, "systems", $headpage);
75   }
78   
79  /*! \brief   Overridden render method of class mangement.
80   *            this allows us to add a release selection box.
81   */
82 function renderList()
83 {
84   $headpage = $this->getHeadpage();
85   $headpage->update();
87   $tD = $this->getObjectDefinitions();
88   $smarty = get_smarty();
89   foreach($tD as $name => $obj){
90     $smarty->assign("USE_".$name, (empty($obj['TABNAME']) || class_available($obj['TABNAME'])));
91   }
93   $display = $headpage->render();
94   return($this->getHeader().$display);
95 }
98   public function getObjectDefinitions()
99   {
100     $tabs = array(
101         "incoming"    => array(
102           "RDN"       => get_ou('systemIncomingRDN'),
103           "CLASS"     => "",
104           "TABNAME"   => "",
105           "TABCLASS"  => "",
106           "ACLC"      => "incoming",
107           "ACL"       => "incoming/systems"),
109         "ArpNewDevice"=> array(
110           "RDN"       => get_ou('systemIncomingRDN'),
111           "CLASS"     => "TERMTABS",
112           "TABNAME"   => "termgeneric" ,
113           "TABCLASS"  => "termtabs",
114           "ACLC"      => "incoming",
115           "ACL"       => "incoming/systems"),
117         "NewDevice"   => array(
118           "RDN"       => get_ou('systemIncomingRDN'),
119           "CLASS"     => "TERMTABS",
120           "TABNAME"   => "termgeneric",
121           "TABCLASS"  => "termtabs",
122           "ACLC"      => "incoming",
123           "ACL"       => "incoming/systems"),
125         "terminal"    => array(
126             "RDN"       => get_ou('terminalRDN'),
127             "CLASS"     => "TERMTABS",
128             "TABNAME"   => "termgeneric",
129             "TABCLASS"  => "termtabs",
130             "ACLC"      => "terminal",
131             "ACL"       => "terminal/termgeneric"),
133         "workstation" =>  array(
134             "RDN"       => get_ou('workstationRDN'),
135             "CLASS"   => "WORKTABS",
136             "TABNAME" => "workgeneric",
137             "TABCLASS"=> "worktabs",
138             "ACLC"    => "workstation",
139             "ACL"     => "workstation/workgeneric" ),
141         "server"      => array(
142             "RDN"       => get_ou('serverRDN'),
143             "CLASS"   => "SERVTABS",
144             "TABNAME" => "servgeneric",
145             "TABCLASS"=> "servtabs",
146             "ACLC"    => "server",
147             "ACL"     => "server/servgeneric"),
149         "printer"     => array(
150             "RDN"       => get_ou('printerRDN'),
151             "CLASS"   => "PRINTTABS",
152             "TABNAME" => "printgeneric",
153             "TABCLASS"=> "printtabs",
154             "ACLC"    => "printer",
155             "ACL"     => "printer/printgeneric"),
157         "phone"       => array(
158             "RDN"       => get_ou('phoneRDN'),
159             "CLASS"   => "PHONETABS",
160             "TABNAME" => "phoneGeneric",
161             "TABCLASS"=> "phonetabs",
162             "ACLC"    => "phone",
163             "ACL"     => "phone/phoneGeneric"),
165         "winstation"  => array(
166             "RDN"       => get_winstations_ou(),
167             "CLASS"   => "WINTABS",
168             "TABNAME" => "wingeneric",
169             "TABCLASS"=> "wintabs",
170             "ACLC"    => "winworkstation",
171             "ACL"     => "winworkstation/wingeneric"),
173         "component"   => array(
174             "RDN"       => get_ou('componentRDN'),
175             "CLASS"   => "COMPONENTTABS",
176             "TABNAME" => "componentGeneric",
177             "TABCLASS"=> "componenttabs",
178             "ACLC"    => "component",
179             "ACL"     => "component/componentGeneric"),
181         "opsi_client" => array(
182             "RDN"     => "",
183             "CLASS"   => "OPSITABS",
184             "TABNAME" => "opsiGeneric" ,
185             "TABCLASS"=> "opsi_tabs",
186             "ACLC"    => "opsi" ,
187             "ACL"     => "opsi/opsiGeneric"));
189     return($tabs);
190   }
193
194 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
195 ?>