From: hickert Date: Thu, 16 Sep 2010 08:27:38 +0000 (+0000) Subject: Renamed classes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=02668a8a602d4608564d01673e960d655c507c4f;p=gosa.git Renamed classes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19696 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/devices/DeviceTab.inc b/gosa-plugins/goto/admin/systems/goto/devices/DeviceTab.inc new file mode 100644 index 000000000..fa902b0dd --- /dev/null +++ b/gosa-plugins/goto/admin/systems/goto/devices/DeviceTab.inc @@ -0,0 +1,34 @@ +by_object['registeredDevice']; + $cn = preg_replace('/,/', '\,', $baseobject->cn); + $cn = preg_replace('/"/', '\"', $cn); + $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base; + $baseobject->dn= $this->dn; + + // Object moved? + if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){ + $baseobject->update_acls($baseobject->orig_dn,$this->dn); + $baseobject->move($baseobject->orig_dn,$this->dn); + } + + // Populate values + foreach ($this->by_object as $key => $obj){ + $this->by_object[$key]->dn= $this->dn; + $this->by_object[$key]->cn= $baseobject->cn; + } + + // Save now + tabs::save(TRUE); + } +} + +?> diff --git a/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc index c295d888e..4c2014102 100644 --- a/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/devices/class_Device.inc @@ -1,15 +1,16 @@ array('macAddress'), + 'registeredDevice' => array('deviceStatus','deviceUUID'), 'ipHost' => array('ipHostNumber')); public $cn = ""; @@ -44,7 +45,7 @@ class registeredDevice extends plugin foreach($this->attributes as $attr){ $smarty->assign($attr, $this->$attr); } - return($smarty->fetch(get_template_path('goto/devices/registeredDevice.tpl', TRUE))); + return($smarty->fetch(get_template_path('goto/devices/Device.tpl', TRUE))); } @@ -82,14 +83,15 @@ class registeredDevice extends plugin { return (array( "plShortName" => _("Device"), - "plDescription" => _("Registered device"), + "plDescription" => _("Device"), "plSelfModify" => FALSE, "plDepends" => array(), "plPriority" => 1, "plSection" => array("administration"), "plCategory" => array( - "registeredDevice" => array( "description" => _("Registered device"), - "objectClass" => "registeredDevice")), + "Device" => array( + "description" => _("Device"), + "objectClass" => "Device")), "plProvidedAcls" => array( "cn" => _("Name"), "serialNumber" => _("Serial number"), diff --git a/gosa-plugins/goto/admin/systems/goto/devices/registeredDeviceTab.inc b/gosa-plugins/goto/admin/systems/goto/devices/registeredDeviceTab.inc deleted file mode 100644 index fa902b0dd..000000000 --- a/gosa-plugins/goto/admin/systems/goto/devices/registeredDeviceTab.inc +++ /dev/null @@ -1,34 +0,0 @@ -by_object['registeredDevice']; - $cn = preg_replace('/,/', '\,', $baseobject->cn); - $cn = preg_replace('/"/', '\"', $cn); - $this->dn= "cn=".$cn.",ou=systems,".$baseobject->base; - $baseobject->dn= $this->dn; - - // Object moved? - if($this->dn != $baseobject->orig_dn && $baseobject->orig_dn != "new"){ - $baseobject->update_acls($baseobject->orig_dn,$this->dn); - $baseobject->move($baseobject->orig_dn,$this->dn); - } - - // Populate values - foreach ($this->by_object as $key => $obj){ - $this->by_object[$key]->dn= $this->dn; - $this->by_object[$key]->cn= $baseobject->cn; - } - - // Save now - tabs::save(TRUE); - } -} - -?>