From c31f276632f930d03a22662d41874ddf74145e2a Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 22 Jan 2010 15:19:20 +0000 Subject: [PATCH] Updated Server service -Not finished yet git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15266 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_filterServerService.inc | 28 ++ .../admin/systems/class_serverService.inc | 83 +++-- .../admin/systems/serverService-filter.tpl | 8 + .../admin/systems/serverService-filter.xml | 22 ++ .../admin/systems/serverService-list.tpl | 31 ++ .../admin/systems/serverService-list.xml | 323 ++++++++++++++++++ 6 files changed, 464 insertions(+), 31 deletions(-) create mode 100644 gosa-plugins/systems/admin/systems/class_filterServerService.inc create mode 100644 gosa-plugins/systems/admin/systems/serverService-filter.tpl create mode 100644 gosa-plugins/systems/admin/systems/serverService-filter.xml create mode 100644 gosa-plugins/systems/admin/systems/serverService-list.tpl create mode 100644 gosa-plugins/systems/admin/systems/serverService-list.xml diff --git a/gosa-plugins/systems/admin/systems/class_filterServerService.inc b/gosa-plugins/systems/admin/systems/class_filterServerService.inc new file mode 100644 index 000000000..dd5e0da91 --- /dev/null +++ b/gosa-plugins/systems/admin/systems/class_filterServerService.inc @@ -0,0 +1,28 @@ + $obj){ + if($obj->is_account){ + $data = $plugins[$name]->getListEntry(); + $data['objectClass'] = array('FAKE_OC_ServerService'); + $data['name'] = $name; + foreach($data as $key => $value){ + if(!is_array($data[$key])) $data[$key] = array($data[$key]); + $list[$name][] = $key; + $list[$name][$key] = $data[$key]; + $list[$name][$key]['count'] = count($data[$key]); + $list[$name]['count'] = count($data); + $list[$name]['dn'] = $key; + } + } + } + return($list); + } +} + +?> diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc index 4bd58ed18..9a69e433c 100644 --- a/gosa-plugins/systems/admin/systems/class_serverService.inc +++ b/gosa-plugins/systems/admin/systems/class_serverService.inc @@ -30,37 +30,58 @@ define("SERVICE_RESTARTED",_("Restart")); define("ALL_SERVICES",100); -class ServerService extends plugin +class ServerService extends management { /* attribute list for save action */ var $ignore_account = TRUE; var $attributes = array(); var $objectclasses = array(); - + var $skipFooter = TRUE; + var $skipHeader = TRUE; var $divList = NULL; var $plugins = array(); var $pluign_names = array(); var $current = ""; + var $dialog = FALSE; var $backup = NULL; var $acl ; var $cn; var $parent ; - function ServerService (&$config, $dn,$parent) + var $pl_notify = FALSE; + + function __construct (&$config, $dn,$parent) { - plugin::plugin($config); + $this->config = $config; $this->parent = $parent; + $this->ui = get_userinfo(); $this->dn= $dn; - - /* Adapt parent attributes */ if(isset($this->parent->attrs)){ $this->attrs = $this->parent->attrs; } - foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){ + // Set storage points - We do not have any - We just create a fake list which lists all services + $this->storagePoints = array(); + +# // Build filter + # if (session::global_is_set(get_class($this)."_filter")){ + # $filter= session::global_get(get_class($this)."_filter"); + # } else { + $filter = new filter(get_template_path("serverService-filter.xml", true)); + $filter->setObjectStorage($this->storagePoints); + #} + $this->setFilter($filter); + + // Build headpage + $headpage = new listing(get_template_path("serverService-list.xml", true)); + $headpage->setFilter($filter); + + + // Initialize list of used and useable services. + foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){ if(class_available($plug['CLASS'])){ $name= $plug['CLASS']; @@ -82,25 +103,17 @@ class ServerService extends plugin #trigger_error("Service class missing: ".$plug['CLASS']); } } - $this->divList = new divListSystemService($config,$this); + + parent::__construct($config, $ui, "systems", $headpage); } - function set_acl_base($base) - { - plugin::set_acl_base($base); - foreach($this->plugins as $name => $obj){ - $this->plugins[$name]->set_acl_base($base); - } - } - function set_acl_category($category) - { - plugin::set_acl_category($category); - foreach($this->plugins as $name => $obj){ - $this->plugins[$name]->set_acl_category($category); - } + static function getServiceList() + { + return(session::get('ServerService')); } + function execute() { /* Variable initialisation */ @@ -269,16 +282,8 @@ class ServerService extends plugin /* Dispaly services overview */ - $this->divList->execute(); - $list = array(); - - foreach($this->plugins as $name => $obj){ - if($obj->is_account){ - $list[$name] = $this->plugins[$name]->getListEntry(); - } - } - $this->divList -> setEntries($list); - return("
".$this->divList->Draw()."
"); + session::set('ServerService', $this->plugins); + return(management::execute()); } @@ -480,6 +485,22 @@ class ServerService extends plugin } } + + // Forward plugin ACLs + function set_acl_base($base) + { + foreach($this->plugins as $name => $obj){ + $this->plugins[$name]->set_acl_base($base); + } + } + + // Forward plugin ACLs + function set_acl_category($category) + { + foreach($this->plugins as $name => $obj){ + $this->plugins[$name]->set_acl_category($category); + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/systems/admin/systems/serverService-filter.tpl b/gosa-plugins/systems/admin/systems/serverService-filter.tpl new file mode 100644 index 000000000..16ddf733c --- /dev/null +++ b/gosa-plugins/systems/admin/systems/serverService-filter.tpl @@ -0,0 +1,8 @@ +
+

+ [F]{t}Filter{/t} +

+
+ +
+
diff --git a/gosa-plugins/systems/admin/systems/serverService-filter.xml b/gosa-plugins/systems/admin/systems/serverService-filter.xml new file mode 100644 index 000000000..5f848146e --- /dev/null +++ b/gosa-plugins/systems/admin/systems/serverService-filter.xml @@ -0,0 +1,22 @@ + + + + + server + + true + + + + + ServerService + ... + dn + objectClass + name + Message + + auto + + + diff --git a/gosa-plugins/systems/admin/systems/serverService-list.tpl b/gosa-plugins/systems/admin/systems/serverService-list.tpl new file mode 100644 index 000000000..b233c5874 --- /dev/null +++ b/gosa-plugins/systems/admin/systems/serverService-list.tpl @@ -0,0 +1,31 @@ + + + + + + + +
+
+

 {$HEADLINE} {$SIZELIMIT}

+
+ +
+
+ + +
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR} {t}Base{/t} {$BASE}  {$SEPARATOR}  {$ACTIONS}
+
+
+ +
+
+ + + + {$LIST} +
+ {$FILTER} +
+ + diff --git a/gosa-plugins/systems/admin/systems/serverService-list.xml b/gosa-plugins/systems/admin/systems/serverService-list.xml new file mode 100644 index 000000000..f93d44e97 --- /dev/null +++ b/gosa-plugins/systems/admin/systems/serverService-list.xml @@ -0,0 +1,323 @@ + + + + + false + false + false + true + + + 1 + + + + FAKE_OC_ServerService + server + ServerService + images/lits/new.png + + + + + + ||250px|170px;r| + + + + Message + string + %{filter:link(row,dn,"%s",Message)} + true + + + + + %{filter:actions(dn,row,objectClass)} + + +
+ + + + + sub + images/lists/new.png + + + + new_goServer + entry + plugins/systems/images/select_server.png + + servgeneric + + + + new_gotoWorkstation + entry + plugins/systems/images/select_workstation.png + + workgeneric + + + + new_gotoTerminal + entry + plugins/systems/images/select_terminal.png + + termgeneric + + + + new_gotoPrinter + entry + plugins/systems/images/select_printer.png + + printgeneric + + + + new_goFonHardware + entry + plugins/systems/images/select_phone.png + + phoneGeneric + + + + new_ieee802Device + entry + plugins/systems/images/select_component.png + + componentGeneric + + + + new_FAKE_OC_OpsiHost + entry + plugins/systems/images/select_winstation.png + + opsi + + + + + separator + + + + sub + images/rocket.png + + + + T_DaemonEvent_halt + DaemonEvent_halt + entry + images/lists/reload.png + + + + + T_DaemonEvent_reboot + DaemonEvent_reboot + entry + images/lists/reload.png + + + + + T_DaemonEvent_wakeup + DaemonEvent_wakeup + entry + images/lists/on.png + + + + + T_DaemonEvent_update + DaemonEvent_update + entry + plugins/goto/images/update.png + + + + + T_DaemonEvent_lock + DaemonEvent_lock + entry + images/lists/locked.png + + + + + T_DaemonEvent_activate + DaemonEvent_activate + entry + images/lists/unlocked.png + + + + + T_DaemonEvent_reinstall + DaemonEvent_reinstall + entry + plugins/goto/images/reinstall.png + + + + + + + + + + sub + plugins/systems/images/clock.png + + + + S_DaemonEvent_halt + DaemonEvent_halt + entry + images/lists/off.png + + + + + S_DaemonEvent_reboot + DaemonEvent_reboot + entry + images/lists/reload.png + + + + + S_DaemonEvent_wakeup + DaemonEvent_wakeup + entry + images/lists/on.png + + + + + S_DaemonEvent_update + DaemonEvent_update + entry + plugins/goto/images/update.png + + + + + S_DaemonEvent_lock + DaemonEvent_lock + entry + images/lists/locked.png + + + + + S_DaemonEvent_activate + DaemonEvent_activate + entry + images/lists/unlocked.png + + + + + S_DaemonEvent_reinstall + DaemonEvent_reinstall + entry + plugins/goto/images/reinstall.png + + + + + + + separator + + + + activateMultiple + DaemonEvent_activate + entry + images/lists/unlocked.png + + + + + remove + entry + images/lists/trash.png + + + + + exporter + + + + separator + + + + copypaste + + + + snapshot + + + + + + + + setPassword + entry + FAKE_OC_PWD_changeAble + images/lists/key.png + + + + + + createISO + entry + gotoWorkstation + FAIobject + plugins/systems/images/cdrom.png + workstation/workgeneric[createFAICD:w] + + + + + cp + copypaste + + + + edit + entry + images/lists/edit.png + + + + + snapshot + snapshot + + + + remove + entry + images/lists/trash.png + %acl[d] + + + + + +
-- 2.30.2