Code

Added copy & paste for groups
[gosa.git] / plugins / admin / groups / class_groupGeneric.inc
index 9d2145c63a80d66ed9b2ea0619631cfbe558a2bb..d009a6f1e49e965a11491ddb5c3b0821c9013e6b 100644 (file)
@@ -809,6 +809,59 @@ class group extends plugin
     }
   }
 
+  function getCopyDialog()
+  {
+    $vars = array("cn");
+  
+    if($this ->force_gid){
+      $used = " checked ";
+      $dis  = "";
+    }else{
+      $used = "";
+      $dis  = " disabled ";
+    }
+
+    $str =" <table>
+              <tr>
+                <td>".
+                  _("Group name").
+                "</td>
+                <td>
+                   <input id='cn' name='cn' size='35' maxlength='60'
+                    value='".$this->cn."'
+                    title='"._("Posix name of the group")."'>
+                </td>
+              </tr>
+              <tr>
+                <td colspan=2>
+                  <input type=checkbox name='force_gid' value='1' ".$used."   
+                      title='"._("Normally IDs are autogenerated, select to specify manually")."' 
+                        onclick='changeState(\"gidNumber\")'
+                  <LABEL for='gidNumber'>"._("Force GID")."</LABEL>
+                &nbsp;
+                <input name='gidNumber' size=5 maxlength=5 id='gidNumber' ".$dis."  
+                    value='".$this->gidNumber."' title='"._("Forced ID number")."'>
+               </td>
+              </tr>
+
+          </table>";
+
+    return($str);
+  }
+
+  function saveCopyDialog()
+  {
+    if(isset($_POST['cn'])){
+      $this->cn = $_POST['cn'];
+    }
+    if(isset($_POST['force_gid'])){
+      $this->force_gid  = true;
+      $this->gidNumber= $_POST['gidNumber'];
+    }else{
+      $this->force_gid  = false;
+      $this->gidNumber  = false;
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: