From: hickert Date: Fri, 15 Jun 2007 08:43:59 +0000 (+0000) Subject: iUpdated copy & paste X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7726d129d02c0b57f54f5ce04faf48820d55240e;p=gosa.git iUpdated copy & paste git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6601 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 20bb0c098..90614de98 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -280,7 +280,39 @@ class componentGeneric extends plugin )); } + /* Display generic part for server copy & paste */ + function getCopyDialog() + { + $vars = array("cn"); + $smarty = get_smarty(); + $smarty->assign("cn" ,$this->cn); + $smarty->assign("object","component"); + $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE)); + $ret = array(); + $ret['string'] = $str; + $ret['status'] = ""; + return($ret); + } + + + function saveCopyDialog() + { + if(isset($_POST['cn'])){ + $this->cn = $_POST['cn']; + } + } + + function PrepareForCopyPaste($source) + { + plugin::PrepareForCopyPaste($source); + if(isset($source['macAddress'][0])){ + $this->netConfigDNS->macAddress = $source['macAddress'][0]; + } + if(isset($source['ipHostNumber'][0])){ + $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index c5d35fe87..103f536e6 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -362,7 +362,7 @@ class phoneGeneric extends plugin /* only to define which attrs to save*/ - $mode = $this->attrs['selected_categorie']; + $mode = $this->selected_categorie; /* Remove all unwanted attrs */ foreach($this->attributes as $att){ @@ -430,6 +430,44 @@ class phoneGeneric extends plugin } + /* Display generic part for server copy & paste */ + function getCopyDialog() + { + $vars = array("cn"); + $smarty = get_smarty(); + $smarty->assign("cn" ,$this->cn); + $smarty->assign("object","phone"); + $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE)); + $ret = array(); + $ret['string'] = $str; + $ret['status'] = ""; + return($ret); + } + + + function saveCopyDialog() + { + if(isset($_POST['cn'])){ + $this->cn = $_POST['cn']; + } + } + + + function PrepareForCopyPaste($source) + { + plugin::PrepareForCopyPaste($source); + if(isset($source['macAddress'][0])){ + $this->netConfigDNS->macAddress = $source['macAddress'][0]; + } + if(isset($source['ipHostNumber'][0])){ + $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0]; + } + + $source_o = new phonegeneric($this->config, $source['dn']); + $this->selected_categorie = $source_o->selected_categorie; + } + + /* Return plugin informations for acl handling #FIXME FAIscript seams to ununsed within this class... */ function plInfo() diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 344c3b930..70d3dfce9 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -343,7 +343,7 @@ class workgeneric extends plugin show_ldap_error($ldap->get_error(), sprintf(_("Removing of system workstation/generic with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ - $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS-ipHostNumber)); + $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); diff --git a/plugins/admin/systems/paste_generic.tpl b/plugins/admin/systems/paste_generic.tpl index 56fd5d733..b15920aee 100644 --- a/plugins/admin/systems/paste_generic.tpl +++ b/plugins/admin/systems/paste_generic.tpl @@ -11,7 +11,7 @@ {if $object == "workstation"} - + @@ -21,7 +21,7 @@ {if $object == "terminal"}
{$must}{$must}
- + @@ -31,7 +31,27 @@ {if $object == "printer"}
{$must}{$must}
- + + + +
{$must}{$must} + +
+{/if} +{if $object == "phone"} + + + + + +
{$must} + +
+{/if} +{if $object == "component"} + + +
{$must}