Code

iUpdated copy & paste
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Jun 2007 08:43:59 +0000 (08:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Jun 2007 08:43:59 +0000 (08:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6601 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_componentGeneric.inc
plugins/admin/systems/class_phoneGeneric.inc
plugins/admin/systems/class_workstationGeneric.inc
plugins/admin/systems/paste_generic.tpl

index 20bb0c09805f92307c139dce6d79f96e99224833..90614de98bfdf32fd4e2a000fee0e9b6388fe02f 100644 (file)
@@ -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:
index c5d35fe8702223ee7dbf8ad7ec2ab180bcd51494..103f536e6869957c04eec5cb636680511ba7f6ec 100644 (file)
@@ -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()
index 344c3b93096461aed5149452ad42a73f21f52a20..70d3dfce9d7e84239e9941a513f856b38de3edd5 100644 (file)
@@ -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']);
index 56fd5d73356e9d653c89f110556c39b6bfbdf0be..b15920aeef07deaacf1ff73ace2cb17392c915c3 100644 (file)
@@ -11,7 +11,7 @@
 {if $object == "workstation"}
     <table summary="">
      <tr>
-      <td><LABEL for="cn">{t}Server name{/t}</LABEL>{$must}</td>
+      <td><LABEL for="cn">{t}workstation name{/t}</LABEL>{$must}</td>
       <td>
        <input name="cn" id="cn" size=20 maxlength=60 value="{$cn}">
       </td>
@@ -21,7 +21,7 @@
 {if $object == "terminal"}
     <table summary="">
      <tr>
-      <td><LABEL for="cn">{t}Server name{/t}</LABEL>{$must}</td>
+      <td><LABEL for="cn">{t}Terminal name{/t}</LABEL>{$must}</td>
       <td>
        <input name="cn" id="cn" size=20 maxlength=60 value="{$cn}">
       </td>
 {if $object == "printer"}
     <table summary="">
      <tr>
-      <td><LABEL for="cn">{t}Server name{/t}</LABEL>{$must}</td>
+      <td><LABEL for="cn">{t}Printer name{/t}</LABEL>{$must}</td>
+      <td>
+       <input name="cn" id="cn" size=20 maxlength=60 value="{$cn}">
+      </td>
+     </tr>
+       </table>
+{/if}
+{if $object == "phone"}
+    <table summary="">
+     <tr>
+      <td><LABEL for="cn">{t}Phone name{/t}</LABEL>{$must}</td>
+      <td>
+       <input name="cn" id="cn" size=20 maxlength=60 value="{$cn}">
+      </td>
+     </tr>
+       </table>
+{/if}
+{if $object == "component"}
+    <table summary="">
+     <tr>
+      <td><LABEL for="cn">{t}Component name{/t}</LABEL>{$must}</td>
       <td>
        <input name="cn" id="cn" size=20 maxlength=60 value="{$cn}">
       </td>