Code

Updated multiple user edit
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Oct 2007 10:10:38 +0000 (10:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Oct 2007 10:10:38 +0000 (10:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7591 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_location.inc
include/class_tabs.inc
plugins/admin/users/class_userManagement.inc
plugins/personal/generic/class_user.inc
plugins/personal/generic/multiple_generic.tpl

index 359a25d150cf629b72212566279714af0bb1af88..7b86a797914d0e489df6e922674effac4494ca39 100644 (file)
@@ -245,9 +245,10 @@ $class_mapping= array(
                 "passwordMethod" => "include/class_password-methods.inc",
                 "mailMethodGolab" => "include/class_mail-methods-golab.inc",
                 "pgre_sql" => "include/class_pgsql_opengw.inc",
-                "msg_dialog" => "include/class_msg_dialog.inc",
+                "passwordMethodheimdal" => "include/class_password-methods-heimdal.inc",
                 "mailMethodKolab" => "include/class_mail-methods-kolab.inc",
                 "passwordMethodsha" => "include/class_password-methods-sha.inc",
+                "msg_dialog" => "include/class_msg_dialog.inc",
                 "passwordMethodkerberos" => "include/class_password-methods-kerberos.inc",
                 "parseXml" => "include/functions_helpviewer.inc",
                 "divlist" => "include/class_divlist.inc",
@@ -258,7 +259,6 @@ $class_mapping= array(
                 "tabs" => "include/class_tabs.inc",
                 "Print_a_class" => "include/functions_debug.inc",
                 "divSelectBox" => "include/class_divSelectBox.inc",
-                "dhcpPlugin" => "include/class_dhcpPlugin.inc",
                 "passwordMethodssha" => "include/class_password-methods-ssha.inc",
                 "ogw" => "include/class_opengw.inc",
                 "acl" => "include/class_acl.inc",
@@ -271,7 +271,7 @@ $class_mapping= array(
                 "mailMethodSendmailCyrus" => "include/class_mail-methods-sendmail-cyrus.inc",
                 "LDAP" => "include/class_ldap.inc",
                 "log" => "include/class_log.inc",
-                "passwordMethodheimdal" => "include/class_password-methods-heimdal.inc",
+                "dhcpPlugin" => "include/class_dhcpPlugin.inc",
                 "Step_Ldap" => "setup/class_setupStep_Ldap.inc",
                 "Step_Finish" => "setup/class_setupStep_Finish.inc",
                 "setup_step" => "setup/class_setupStep.inc",
index 036d42d42e2153562092da86756f0e8b9fd47ed5..059e477002fec37f0c6f4dfdc1071a256d95926f 100644 (file)
@@ -270,8 +270,11 @@ class tabs
   function save($ignore_account= FALSE)
   {
     if($this->multiple_entries){
-      echo "Save is not supported for multiple entries yet";
-
+      foreach ($this->by_object as $key => &$obj){
+        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
+            $key, "Saving");
+        $obj->save();
+      }
     }else{
       /* Save all plugins */
       foreach ($this->by_object as $key => &$obj){
index 1f12ef09915f27b0c2e1d73c44cf61769e2f9ecf..77cd106fe4a9f0d2e5250cd6ff80601196113665 100644 (file)
@@ -304,8 +304,14 @@ class userManagement extends plugin
         $this->usertab->current = $s_tab;
 
         /* Set ACL and move DN to the headline */
-#        $this->usertab->set_acl_base($this->dn);
-         $_SESSION['objectinfo']= _("Multiple edit");
+        if(count($this->dn) == 1){  
+          reset($this->dn) ;
+          $dn = current($this->dn);
+          $this->usertab->set_acl_base($dn);
+          $_SESSION['objectinfo'] = $dn;
+        }else{
+          $_SESSION['objectinfo']= _("Multiple edit");
+        }
       }
     }
 
index 3e8e1e3d778965a5d318fc0e56bfe06261c4fd3f..4a31c21f44572e5a1d46c6a9f2460033e2e73903 100644 (file)
@@ -107,7 +107,8 @@ class user extends plugin
 
   var $multiple_support = TRUE;
   var $multiple_handle  = FALSE;
-
+  var $attrs_to_update  = array();
+  var $multiple_user_handles  = array();
   /* constructor, if 'dn' is set, the node loads the given
      'dn' from LDAP */
   function user (&$config, $dn= NULL)
@@ -229,22 +230,37 @@ class user extends plugin
   function construct_multiple()
   {
     /* Configuration is fine, allways */
-    $this->multiple_attrs = array();
+    $this->multiple_user_handles = array();
     foreach($this->dn as $dn){
-      $this->multiple_attrs[] = new user($this->config,$dn);
+      $this->multiple_user_handles[] = new user($this->config,$dn);
     } 
   }
 
+  function save_object_multiple()
+  {
+    foreach(array("pw_storage","base","edit_cert") as $attr){
+      if(isset($_POST["use_".$attr])){
+        $this->attrs_to_update[$attr] = TRUE;
+      }else{
+        $this->attrs_to_update[$attr] = FALSE;
+      }
+    }
+    foreach($this->attributes as $attr){
+      if(isset($_POST["use_".$attr])){
+        $this->attrs_to_update[$attr] = TRUE;
+      }else{
+        $this->attrs_to_update[$attr] = FALSE;
+      }
+    } 
+  }
   
   function execute_multiple()
   {
     $smarty =get_smarty(); 
-
     $u_attrs = array();
     $d_attrs = array();
     foreach($this->attributes as $attr){
-      foreach($this->multiple_attrs as $class){
+      foreach($this->multiple_user_handles as $class){
         if(!isset($u_attrs[$attr]) && !empty($class->$attr)){
           $u_attrs[$attr] = $class->$attr;
         }elseif(isset($u_attrs[$attr]) && !empty($class->$attr)){
@@ -252,13 +268,55 @@ class user extends plugin
         }
       }
     }
-    print_a(array($u_attrs,$d_attrs));
+    $language= array_merge(array(0 => "&nbsp;") ,get_languages(TRUE));
+    $smarty->assign("preferredLanguage_list", $language);
+    @$smarty->assign("bases", $this->allowedBasesToMoveTo());
+    $smarty->assign("base_select",      $this->base);
+
+    /* Save government mode attributes */
+    if (isset($this->config->current['GOVERNMENTMODE']) &&
+        preg_match('/true/i', $this->config->current['GOVERNMENTMODE'])){
+      $smarty->assign("governmentmode", "true");
+      $ivbbmodes= array("nein", "ivbv", "testa", "ivbv,testa", "internet",
+          "internet,ivbv", "internet,testa", "internet,ivbv,testa");
+      $smarty->assign("ivbbmodes", $ivbbmodes);
+      foreach ($this->govattrs as $val){
+        $smarty->assign("$val", $this->$val);
+        $smarty->assign("$val"."ACL", $this->getacl($val,(!is_object($this->parent) && !isset($_SESSION['edit']))));
+      }
+    } else {
+      $smarty->assign("governmentmode", "false");
+    }
+
+    $temp= passwordMethod::get_available_methods();
+    $hashes = $temp['name'];
+    $test= new $temp[$this->pw_storage]($this->config);
+    $is_configurable= $test->is_configurable();
+    $smarty->assign("pwmode", $hashes);
+    $smarty->assign("pwmode_select", $this->pw_storage);
+    $smarty->assign("pw_configurable", $is_configurable);
+
     foreach($this->attributes as $attr){
-      if(!isset($u_attrs[$attr])){
-        $u_attrs[$attr] = "empty";
+#      if(!isset($u_attrs[$attr])){
+#        $u_attrs[$attr] = "empty";
+#      }
+      
+      if(isset($this->attrs_to_update[$attr]) && $this->attrs_to_update[$attr] == TRUE){
+        $smarty->assign("use_".$attr,TRUE);
+      }else{
+        $smarty->assign("use_".$attr,FALSE);
+      }
+      $smarty->assign($attr,$this->$attr);
+    }
+    foreach(array("pw_storage","base","edit_cert") as $attr){
+      if(isset($this->attrs_to_update[$attr]) && $this->attrs_to_update[$attr] == TRUE){
+        $smarty->assign("use_".$attr,TRUE);
+      }else{
+        $smarty->assign("use_".$attr,FALSE);
       }
-      $smarty->assign($attr,$u_attrs[$attr]);
     }
+
+
     return($smarty->fetch (get_template_path('multiple_generic.tpl', TRUE, dirname(__FILE__))));
   }
 
@@ -695,7 +753,10 @@ class user extends plugin
   /* Save data to object */
   function save_object()
   {
-    if (isset($_POST['generic'])){
+    if (isset($_POST['multiple_user_posted'])){
+      $this->save_object_multiple();
+    }
+    if(isset($_POST['generic']) || isset($_POST['multiple_user_posted'])){
 
       /* Make a backup of the current selected base */
       $base_tmp = $this->base;
@@ -770,16 +831,34 @@ class user extends plugin
     }
   }
 
+  
+  function multiple_save()
+  {
+    foreach($this->multiple_user_handles as $handle){
+      foreach($this->attributes as $attr){
+        if(isset($this->attrs_to_update[$attr]) && $this->attrs_to_update[$attr] == TRUE){
+          $handle->$attr = $this->$attr;         
+        }
+      }
+      $handle->save();
+    }
+  }
+
+
+
   /* Save data to LDAP, depending on is_account we save or delete */
   function save()
   {
+    if($this->multiple_handle){
+      return($this->multiple_save());
+    }
     /* Only force save of changes .... 
        If this attributes aren't changed, avoid saving.
      */
     if($this->gender=="0") $this->gender ="";
     if($this->preferredLanguage=="0") $this->preferredLanguage ="";
     
     /* First use parents methods to do some basic fillup in $this->attrs */
     plugin::save ();
 
@@ -1164,7 +1243,8 @@ class user extends plugin
   /* Indicate whether a password change is needed or not */
   function password_change_needed()
   {
-    return ($this->pw_storage != $this->last_pw_storage);
+    
+    return (!$this->multiple_handle && $this->pw_storage != $this->last_pw_storage);
   }
 
 
index ce2e24246f4337239fbfad27d1fc127ff4477371..a9c3143fe5e05bf3396de5e154e772e81148bdcb 100644 (file)
@@ -1,12 +1,12 @@
 <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding="4" border="0">
  <tr>
   <td colspan="4">
-   <h2><img alt="" align="middle" src="images/head.png" class="center"> {t}Personal information{/t}</h2>
+    <img alt="" align="middle" src="images/head.png" class="center">
+       <h2>{t}Personal information{/t}</h2>
   </td>
  </tr>
  <tr>
   <td style="vertical-align:top">
-
    <table>
     <tr>
      <td width="147" height="200" bgcolor="gray">
      </td>
     </tr>
    </table>
-
   </td>
   <td style="vertical-align:top;">
-
    <table>
     <tr>
      <td>
-      <label for="academicTitle">{t}Academic title{/t}</label>
+      <label for="academicTitle">
+      {t}Academic title{/t}</label>
      </td>
      <td>
+       <input type="checkbox" name="use_academicTitle" value="1" {if $use_academicTitle} checked {/if}>
       <input id="academicTitle" name="academicTitle" size=25 maxlength=60 value="{$academicTitle}">
      </td>
     </tr>
     <tr>
      <td>
-      <label for="preferredLanguage">{t}Preferred langage{/t}</label>
+      <label for="preferredLanguage">
+      {t}Preferred langage{/t}</label>
      </td>
      <td>
+       <input type="checkbox" name="use_preferredLanguage" value="1" {if $use_preferredLanguage} checked {/if}>
       <select size="1" id="preferredLanguage" name="preferredLanguage">
        {html_options options=$preferredLanguage_list selected=$preferredLanguage}
       </select>
     </tr>
     <tr>
      <td>
-      <div style="height:10px;"></div>
-      <label for="base">{t}Base{/t}</label>
+      <div style="height:10px;">
+      </div>
+      <label for="base">
+      {t}Base{/t}</label>
      </td>
      <td>
-      <div style="height:10px;"></div>
-               <select id="base" size="1" name="base" title="{t}Choose subtree to place user in{/t}">
-                       {html_options options=$bases selected=$base_select}
-               </select>
-               <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
+      <div style="height:10px;">
+      </div>
+       <input type="checkbox" name="use_base" value="1" {if $use_base} checked {/if}>
+      <select id="base" size="1" name="base" title="{t}Choose subtree to place user in{/t}">
+       {html_options options=$bases selected=$base_select}
+      </select>
+      <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
      </td>
     </tr>
    </table>
-
   </td>
   <td style="vertical-align:top;">
-
    <!-- Address, ... -->
-   <table summary="" style="width:100%"> 
+   <table summary="" style="width:100%">
     <tr>
-     <td style="vertical-align:top;"><label for="homePostalAddress">{t}Address{/t}</label></td>
-      <td>
-            <textarea id="homePostalAddress" name="homePostalAddress" rows="3" style="width:100%">{$homePostalAddress}</textarea>
+     <td style="vertical-align:top;">
+      <label for="homePostalAddress">
+      {t}Address{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_homePostalAddress" value="1" {if $use_homePostalAddress} checked {/if}>
+      <textarea id="homePostalAddress" name="homePostalAddress" rows="3" style="width:100%">
+      {$homePostalAddress}</textarea>
      </td>
     </tr>
     <tr>
-     <td><label for="homePhone">{t}Private phone{/t}</label>
-     </td><td>
-            <input id="homePhone" name="homePhone" size=25 maxlength=60 value="{$homePhone}">
+     <td>
+      <label for="homePhone">
+      {t}Private phone{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_homePhone" value="1" {if $use_homePhone} checked {/if}>
+      <input id="homePhone" name="homePhone" size=25 maxlength=60 value="{$homePhone}">
      </td>
     </tr>
     <tr>
-     <td><label for="labeledURI">{t}Homepage{/t}</label></td>
      <td>
-               <input id="labeledURI" name="labeledURI" size=25 maxlength=60 value="{$labeledURI}">
+      <label for="labeledURI">
+      {t}Homepage{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_labeledURI" value="1" {if $use_labeledURI} checked {/if}>
+      <input id="labeledURI" name="labeledURI" size=25 maxlength=60 value="{$labeledURI}">
      </td>
     </tr>
     <tr>
      <td colspan=2>
-      <div style="height:20px;"></div>
+      <div style="height:20px;">
+      </div>
      </td>
     </tr>
     <tr>
-     <td><label for="pw_storage">{t}Password storage{/t}</label></td>
      <td>
-             <select size="1" id="pw_storage" name="pw_storage" onchange='document.mainform.submit()'>
-              {html_options values=$pwmode output=$pwmode selected=$pwmode_select}
-             </select>
-       {if $pw_configurable eq "true"}
-             &nbsp; <input id="edit_pw_method" type="submit" name="edit_pw_method" value="{t}Configure{/t}...">
-       {/if}
+      <label for="pw_storage">
+      {t}Password storage{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_pw_storage" value="1" {if $use_pw_storage} checked {/if}>
+      <select size="1" id="pw_storage" name="pw_storage" onchange='document.mainform.submit()'>
+       {html_options values=$pwmode output=$pwmode selected=$pwmode_select}
+      </select>
      </td>
     </tr>
-
-    {if $is_template ne "true"}
     <tr>
-     <td><label for="edit_cert">{t}Certificates{/t}</label></td>
      <td>
-               <input id="edit_cert" type="submit" name="edit_cert" value="{t}Edit certificates{/t}...">
+      <label for="edit_cert">
+      {t}Certificates{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_edit_cert" value="1" {if $use_edit_cert} checked {/if}>
+      <input id="edit_cert" type="submit" name="edit_cert" value="{t}Edit certificates{/t}...">
      </td>
     </tr>
-    {/if}
-
    </table>
   </td>
  </tr>
 </table>
-
-<p class="seperator">&nbsp;</p>
-
+<p class="seperator">
+&nbsp;</p>
 <table summary="" class="line" style="width:100%; vertical-align:top; text-align:left;" cellpadding="4" border="0">
-
  <!-- Headline container -->
  <tr>
   <td colspan="3">
-   <h2><img alt="" align="middle" src="images/house.png" class="center">&nbsp;{t}Organizational information{/t}</h2>
+   <h2>
+    <img alt="" align="middle" src="images/house.png" class="center">
+   &nbsp;{t}Organizational information{/t}</h2>
   </td>
  </tr>
-
  <!-- Base 2 container -->
  <tr>
-
   {if $governmentmode ne "true"}
   <!-- Company, ... -->
   <td style="vertical-align:top;">
-   <table summary=""> 
+   <table summary="">
     <tr>
-     <td><label for="o">{t}Organization{/t}</label></td>
-     <td>      
-               <input id="o" name="o" size=22 maxlength=60 value="{$o}">
+     <td>
+      <label for="o">
+      {t}Organization{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_o" value="1" {if $use_o} checked {/if}>
+      <input id="o" name="o" size=22 maxlength=60 value="{$o}">
      </td>
     </tr>
     <tr>
-     <td><label for="ou">{t}Department{/t}</label></td>
      <td>
-               <input id="ou" name="ou" size=22 maxlength=60 value="{$ou}">
+      <label for="ou">
+      {t}Department{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_ou" value="1" {if $use_ou} checked {/if}>
+      <input id="ou" name="ou" size=22 maxlength=60 value="{$ou}">
      </td>
     </tr>
     <tr>
-     <td><label for="departmentNumber">{t}Department No.{/t}</label></td>
      <td>
-             <input id="departmentNumber" name="departmentNumber" size=22 maxlength=60 value="{$departmentNumber}">
+      <label for="departmentNumber">
+      {t}Department No.{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_departmentNumber" value="1" {if $use_departmentNumber} checked {/if}>
+      <input id="departmentNumber" name="departmentNumber" size=22 maxlength=60 value="{$departmentNumber}">
      </td>
     </tr>
     <tr>
-     <td><label for="employeeNumber">{t}Employee No.{/t}</label></td>
      <td>
-               <input id="employeeNumber" name="employeeNumber" size=22 maxlength=60 value="{$employeeNumber}">
+      <label for="employeeNumber">
+      {t}Employee No.{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_employeeNumber" value="1" {if $use_employeeNumber} checked {/if}>
+      <input id="employeeNumber" name="employeeNumber" size=22 maxlength=60 value="{$employeeNumber}">
      </td>
     </tr>
     <tr>
-     <td><label for="employeeType">{t}Employee type{/t}</label></td>
      <td>
-               <input id="employeeType" name="employeeType" size=22 maxlength=60 value="{$employeeType}">
+      <label for="employeeType">
+      {t}Employee type{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_employeeType" value="1" {if $use_employeeType} checked {/if}>
+      <input id="employeeType" name="employeeType" size=22 maxlength=60 value="{$employeeType}">
      </td>
     </tr>
    </table>
   </td>
-   
   <td style="border-left:1px solid #A0A0A0">
    &nbsp;
   </td>
-
   <!-- Phone, ... -->
   <td style="vertical-align:top;">
-   <table summary=""> 
+   <table summary="">
     <tr>
-     <td><label for="roomNumber">{t}Room No.{/t}</label></td>
      <td>
-               <input id="roomNumber" name="roomNumber" size=22 maxlength=60 value="{$roomNumber}">
+      <label for="roomNumber">
+      {t}Room No.{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_roomNumber" value="1" {if $use_roomNumber} checked {/if}>
+      <input id="roomNumber" name="roomNumber" size=22 maxlength=60 value="{$roomNumber}">
      </td>
     </tr>
-    {if $has_phoneaccount ne "true"}
     <tr>
-     <td><label for="telephoneNumber">{t}Phone{/t}</label></td>
      <td>
-               <input id="telephoneNumber" name="telephoneNumber" size=22 maxlength=60 value="{$telephoneNumber}">
+      <label for="telephoneNumber">
+      {t}Phone{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_telephoneNumber" value="1" {if $use_telephoneNumber} checked {/if}>
+      <input id="telephoneNumber" name="telephoneNumber" size=22 maxlength=60 value="{$telephoneNumber}">
      </td>
     </tr>
-    {/if}
     <tr>
-     <td><label for="mobile">{t}Mobile{/t}</label></td>
      <td>
-               <input id="mobile" name="mobile" size=22 maxlength=60 value="{$mobile}">
+      <label for="mobile">
+      {t}Mobile{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_mobile" value="1" {if $use_mobile} checked {/if}>
+      <input id="mobile" name="mobile" size=22 maxlength=60 value="{$mobile}">
      </td>
     </tr>
     <tr>
-     <td><label for="pager">{t}Pager{/t}</label></td>
      <td>
-               <input id="pager" name="pager" size=22 maxlength=60 value="{$pager}">
+      <label for="pager">
+      {t}Pager{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_pager" value="1" {if $use_pager} checked {/if}>
+      <input id="pager" name="pager" size=22 maxlength=60 value="{$pager}">
      </td>
     </tr>
     <tr>
-     <td><label for="facsimileTelephoneNumber">{t}Fax{/t}</label></td>
      <td>
-               <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" size=22 maxlength=60 value="{$facsimileTelephoneNumber}">
+      <label for="facsimileTelephoneNumber">
+      {t}Fax{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_facsimileTelephoneNumber" value="1" {if $use_facsimileTelephoneNumber} checked {/if}>
+      <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" size=22 maxlength=60 value="{$facsimileTelephoneNumber}">
      </td>
     </tr>
    </table>
   </td>
-
   <td style="border-left:1px solid #A0A0A0">
    &nbsp;
   </td>
-
   <!-- Location, ... -->
   <td style="vertical-align:top;">
-   <table summary="" style="width:100%"> 
+   <table summary="" style="width:100%">
     <tr>
-     <td><label for="l">{t}Location{/t}</label></td>
      <td>
-               <input id="l" name="l" size=22 maxlength=60 value="{$l}">
+      <label for="l">
+      {t}Location{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_l" value="1" {if $use_l} checked {/if}>
+      <input id="l" name="l" size=22 maxlength=60 value="{$l}">
      </td>
     </tr>
     <tr>
-     <td><label for="st">{t}State{/t}</label></td>
      <td>
-               <input id="st" name="st" size=22 maxlength=60 value="{$st}">
+      <label for="st">
+      {t}State{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_st" value="1" {if $use_st} checked {/if}>
+      <input id="st" name="st" size=22 maxlength=60 value="{$st}">
      </td>
     </tr>
     <tr>
-     <td style="vertical-align:top;"><label for="postalAddress">{t}Address{/t}</label></td>
+     <td style="vertical-align:top;">
+      <label for="postalAddress">
+      {t}Address{/t}</label>
+     </td>
      <td>
-               <textarea id="postalAddress" name="postalAddress" rows=3 style="width:100%">{$postalAddress}</textarea>
+       <input type="checkbox" name="use_postalAddress" value="1" {if $use_postalAddress} checked {/if}>
+      <textarea id="postalAddress" name="postalAddress" rows=3 style="width:100%">
+      {$postalAddress}</textarea>
      </td>
     </tr>
    </table>
   </td>
-
   {else} 
-
   <!-- Beschreibung, ... -->
   <td style="vertical-align:top;border-right:1px solid #b0b0b0">
-   <table summary=""> 
+   <table summary="">
     <tr>
-     <td><label for="vocation">{t}Vocation{/t}</label></td>
      <td>
-               <input id="vocation" name="vocation" size=22 maxlength=60 value="{$vocation}">
+      <label for="vocation">
+      {t}Vocation{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_vocation" value="1" {if $use_vocation} checked {/if}>
+      <input id="vocation" name="vocation" size=22 maxlength=60 value="{$vocation}">
      </td>
     </tr>
     <tr>
-     <td><label for="gouvernmentOrganizationalUnitDescription">{t}Unit description{/t}</label></td>
      <td>
-               <input id="gouvernmentOrganizationalUnitDescription" name="gouvernmentOrganizationalUnitDescription" size=22 maxlength=60
-               value="{$gouvernmentOrganizationalUnitDescription}">
+      <label for="gouvernmentOrganizationalUnitDescription">
+      {t}Unit description{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_gouvernmentOrganizationalUnitDescription" value="1" {if $use_gouvernmentOrganizationalUnitDescription} checked {/if}>
+      <input id="gouvernmentOrganizationalUnitDescription" name="gouvernmentOrganizationalUnitDescription" size=22 maxlength=60
+      value="{$gouvernmentOrganizationalUnitDescription}">
      </td>
     </tr>
     <tr>
-     <td><label for="gouvernmentOrganizationalUnitSubjectArea">{t}Subject area{/t}</label></td>
      <td>
-               <input id="gouvernmentOrganizationalUnitSubjectArea" name="gouvernmentOrganizationalUnitSubjectArea" size=22 maxlength=60
-               value="{$gouvernmentOrganizationalUnitSubjectArea}">
+      <label for="gouvernmentOrganizationalUnitSubjectArea">
+      {t}Subject area{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_gouvernmentOrganizationalUnitSubjectArea" value="1" {if $use_gouvernmentOrganizationalUnitSubjectArea} checked {/if}>
+      <input id="gouvernmentOrganizationalUnitSubjectArea" name="gouvernmentOrganizationalUnitSubjectArea" size=22 maxlength=60
+      value="{$gouvernmentOrganizationalUnitSubjectArea}">
      </td>
     </tr>
     <tr>
-     <td><label for="functionalTitle">{t}Functional title{/t}</label></td>
      <td>
-               <input name="functionalTitle" id="functionalTitle"  size=22 maxlength=60
-               value="{$functionalTitle}">
+      <label for="functionalTitle">
+      {t}Functional title{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_functionalTitle" value="1" {if $use_functionalTitle} checked {/if}>
+      <input name="functionalTitle" id="functionalTitle"  size=22 maxlength=60
+      value="{$functionalTitle}">
      </td>
     </tr>
     <tr>
-     <td><label for="role">{t}Role{/t}</label></td>
      <td>
-               <input id="role" name="role" size=22 maxlength=60 value="{$role}">
+      <label for="role">
+      {t}Role{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_role" value="1" {if $use_role} checked {/if}>
+      <input id="role" name="role" size=22 maxlength=60 value="{$role}">
      </td>
     </tr>
    </table>
   </td>
-  
   <!-- Phone, ... -->
   <td style="vertical-align:top;border-right:1px solid #b0b0b0">
-   <table summary=""> 
+   <table summary="">
     <tr>
-     <td><label for="gouvernmentOrganizationalPersonLocality">{t}Person locality{/t}</label></td>
      <td>
-               <input id="gouvernmentOrganizationalPersonLocality" name="gouvernmentOrganizationalPersonLocality" size=22 maxlength=60
-                value="{$gouvernmentOrganizationalPersonLocality}">
+      <label for="gouvernmentOrganizationalPersonLocality">
+      {t}Person locality{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_gouvernmentOrganizationalPersonLocality" value="1" {if $use_gouvernmentOrganizationalPersonLocality} checked {/if}>
+      <input id="gouvernmentOrganizationalPersonLocality" name="gouvernmentOrganizationalPersonLocality" size=22 maxlength=60
+      value="{$gouvernmentOrganizationalPersonLocality}">
      </td>
     </tr>
     <tr>
-     <td><label for="gouvernmentOrganizationalUnit">{t}Unit{/t}</label></td>
      <td>
-               <input id="gouvernmentOrganizationalUnit" name="gouvernmentOrganizationalUnit" size=22 maxlength=60 
-               value="{$gouvernmentOrganizationalUnit}">
+      <label for="gouvernmentOrganizationalUnit">
+      {t}Unit{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_gouvernmentOrganizationalUnit" value="1" {if $use_gouvernmentOrganizationalUnit} checked {/if}>
+      <input id="gouvernmentOrganizationalUnit" name="gouvernmentOrganizationalUnit" size=22 maxlength=60 
+      value="{$gouvernmentOrganizationalUnit}">
      </td>
     </tr>
     <tr>
-     <td><label for="street">{t}Street{/t}</label></td>
      <td>
-               <input name="street" id="street" size=22 maxlength=60 value="{$street}">
+      <label for="street">
+      {t}Street{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_street" value="1" {if $use_street} checked {/if}>
+      <input name="street" id="street" size=22 maxlength=60 value="{$street}">
      </td>
     </tr>
     <tr>
-     <td><label for="postalCode">{t}Postal code{/t}</label></td>
-     <td> 
-               <input name="postalCode" id="postalCode" size=22 maxlength=60 value="{$postalCode}">
+     <td>
+      <label for="postalCode">
+      {t}Postal code{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_postalCode" value="1" {if $use_postalCode} checked {/if}>
+      <input name="postalCode" id="postalCode" size=22 maxlength=60 value="{$postalCode}">
      </td>
     </tr>
     <tr>
-     <td><label for="houseIdentifier">{t}House identifier{/t}</label></td>
      <td>
-               <input id="houseIdentifier" name="houseIdentifier" size=22 maxlength=60
-               value="{$houseIdentifier}">
+      <label for="houseIdentifier">
+      {t}House identifier{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_houseIdentifier" value="1" {if $use_houseIdentifier} checked {/if}>
+      <input id="houseIdentifier" name="houseIdentifier" size=22 maxlength=60
+      value="{$houseIdentifier}">
      </td>
     </tr>
    </table>
   </td>
-
   <!-- Location, ... -->
   <td style="vertical-align:top;">
-   <table summary=""> 
+   <table summary="">
     <tr>
-     <td><label for="roomNumber">{t}Room No.{/t}</label></td>
      <td>
-               <input id="roomNumber" name="roomNumber" size=22 maxlength=60 value="{$roomNumber}">
+      <label for="roomNumber">
+      {t}Room No.{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_roomNumber" value="1" {if $use_roomNumber} checked {/if}>
+      <input id="roomNumber" name="roomNumber" size=22 maxlength=60 value="{$roomNumber}">
      </td>
     </tr>
     <tr>
-     <td><label for="telephoneNumber">{t}Phone{/t}</label></td>
      <td>
-             {if $has_phoneaccount ne "true"}
-                       <input id="telephoneNumber" name="telephoneNumber" size=22 maxlength=60 value="{$telephoneNumber}">
-             {else}
-                       <i>{t}Please use the phone tab{/t}</i>
-             {/if}
+      <label for="telephoneNumber">
+      {t}Phone{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_telephoneNumber" value="1" {if $use_telephoneNumber} checked {/if}>
+      <input id="telephoneNumber" name="telephoneNumber" size=22 maxlength=60 value="{$telephoneNumber}">
      </td>
     </tr>
     <tr>
-     <td><label for="facsimileTelephoneNumber">{t}Fax{/t}</label></td>
      <td>
-               <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" size=22 maxlength=60 
-                value="{$facsimileTelephoneNumber}">
+      <label for="facsimileTelephoneNumber">
+      {t}Fax{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_facsimileTelephoneNumber" value="1" {if $use_facsimileTelephoneNumber} checked {/if}>
+      <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" size=22 maxlength=60 
+      value="{$facsimileTelephoneNumber}">
      </td>
     </tr>
     <tr>
-     <td><label for="ivbbLastDeliveryCollective">{t}Last delivery{/t}</label></td>
      <td>
-               <input name="ivbbLastDeliveryCollective" size=22 maxlength=60 id="ivbbLastDeliveryCollective" 
-               value="{$ivbbLastDeliveryCollective}">
+      <label for="ivbbLastDeliveryCollective">
+      {t}Last delivery{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_ivbbLastDeliveryCollective" value="1" {if $use_ivbbLastDeliveryCollective} checked {/if}>
+      <input name="ivbbLastDeliveryCollective" size=22 maxlength=60 id="ivbbLastDeliveryCollective" 
+      value="{$ivbbLastDeliveryCollective}">
      </td>
     </tr>
     <tr>
-     <td><label for="publicVisible">{t}Public visible{/t}</label></td>
      <td>
-             <select size="1" id="publicVisible" name="publicVisible">
-              {html_options values=$ivbbmodes output=$ivbbmodes selected=$publicVisible}
-             </select>
+      <label for="publicVisible">
+      {t}Public visible{/t}</label>
+     </td>
+     <td>
+       <input type="checkbox" name="use_publicVisible" value="1" {if $use_publicVisible} checked {/if}>
+      <select size="1" id="publicVisible" name="publicVisible">
+       {html_options values=$ivbbmodes output=$ivbbmodes selected=$publicVisible}
+      </select>
      </td>
     </tr>
    </table>
   </td>
- {/if} 
 {/if} 
  </tr>
 </table>
-
-<input type=hidden name="generic">
-
+<input type=hidden name="multiple_user_posted" value="1">
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
-  <!-- // First input field on page
-       focus_field('sn');
-       if (document.mainform.yearSel != "")
-                               populate(document.mainform,document.mainform.dateOfBirth);
-  -->
+<!-- // First input field on page
+focus_field('academicTitle');
+if (document.mainform.yearSel != "")
+populate(document.mainform,document.mainform.dateOfBirth);
+-->
 </script>