Code

Move to new lists .
[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, "roles", $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();
86     $tD = $this->getObjectDefinitions();
87     $smarty = get_smarty();
88     foreach($tD as $name => $obj){
89 #      $smarty->assign("USE_".$name, (empty($obj['CLASS']) || class_available($obj['CLASS'])));
90     }
92     $display = $headpage->render();
93     return($this->getHeader().$display);
94   }
97   public function getObjectDefinitions()
98   {
99     $tabs = array(
100         "incoming"    => array(
101           "RDN"       => get_ou('systemIncomingRDN'),
102           "CLASS"     => "",
103           "TABNAME"   => "",
104           "TABCLASS"  => "",
105           "ACLC"      => "incoming",
106           "ACL"       => "incoming/systems"),
108         "ArpNewDevice"=> array(
109           "RDN"       => get_ou('systemIncomingRDN'),
110           "CLASS"     => "TERMTABS",
111           "TABNAME"   => "termgeneric" ,
112           "TABCLASS"  => "termtabs",
113           "ACLC"      => "incoming",
114           "ACL"       => "incoming/systems"),
116         "NewDevice"   => array(
117           "RDN"       => get_ou('systemIncomingRDN'),
118           "CLASS"     => "TERMTABS",
119           "TABNAME"   => "termgeneric",
120           "TABCLASS"  => "termtabs",
121           "ACLC"      => "incoming",
122           "ACL"       => "incoming/systems"),
124         "terminal"    => array(
125             "RDN"       => get_ou('terminalRDN'),
126             "CLASS"     => "TERMTABS",
127             "TABNAME"   => "termgeneric",
128             "TABCLASS"  => "termtabs",
129             "ACLC"      => "terminal",
130             "ACL"       => "terminal/termgeneric"),
132         "workstation" =>  array(
133             "RDN"       => get_ou('workstationRDN'),
134             "CLASS"   => "WORKTABS",
135             "TABNAME" => "workgeneric",
136             "TABCLASS"=> "worktabs",
137             "ACLC"    => "workstation",
138             "ACL"     => "workstation/workgeneric" ),
140         "server"      => array(
141             "RDN"       => get_ou('serverRDN'),
142             "CLASS"   => "SERVTABS",
143             "TABNAME" => "servgeneric",
144             "TABCLASS"=> "servtabs",
145             "ACLC"    => "server",
146             "ACL"     => "server/servgeneric"),
148         "printer"     => array(
149             "RDN"       => get_ou('printerRDN'),
150             "CLASS"   => "PRINTTABS",
151             "TABNAME" => "printgeneric",
152             "TABCLASS"=> "printtabs",
153             "ACLC"    => "printer",
154             "ACL"     => "printer/printgeneric"),
156         "phone"       => array(
157             "RDN"       => get_ou('phoneRDN'),
158             "CLASS"   => "PHONETABS",
159             "TABNAME" => "phoneGeneric",
160             "TABCLASS"=> "phonetabs",
161             "ACLC"    => "phone",
162             "ACL"     => "phone/phoneGeneric"),
164         "winstation"  => array(
165             "RDN"       => get_winstations_ou(),
166             "CLASS"   => "WINTABS",
167             "TABNAME" => "wingeneric",
168             "TABCLASS"=> "wintabs",
169             "ACLC"    => "winworkstation",
170             "ACL"     => "winworkstation/wingeneric"),
172         "component"   => array(
173             "RDN"       => get_ou('componentRDN'),
174             "CLASS"   => "COMPONENTTABS",
175             "TABNAME" => "componentGeneric",
176             "TABCLASS"=> "componenttabs",
177             "ACLC"    => "component",
178             "ACL"     => "component/componentGeneric"));
180     if($this->opsi != NULL){
181       $tabs["opsi_client"] = array(
182           "RDN"       => "",
183           "CLASS"   => "OPSITABS",
184           "TABNAME" => "opsiGeneric" ,
185           "TABCLASS"=> "opsi_tabs",
186           "ACLC"    => "opsi" ,
187           "ACL"     => "opsi/opsiGeneric");
188     }
190     return($tabs);
191   }
194
195 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
196 ?>