Index: branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php
===================================================================
--- branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php	(revision 3234)
+++ branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php	(revision 3299)
@@ -63,5 +63,5 @@
 			{
 				/* jakjr: using justthese with ldap_search */
-				$justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile");
+				$justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile","homephone");
 				$sri = @ldap_search($this->ds, $this->user_context, ("(&(uidnumber=" . (int)$this->account_id.")(phpgwaccounttype=u))"), $justthese);
 			}
@@ -91,4 +91,5 @@
 				$this->data['telephonenumber']   = $allValues[0]['telephonenumber'][0];
 				$this->data['mobile']   = $allValues[0]['mobile'][0];
+				$this->data['homephone']   = $allValues[0]['homephone'][0];				
 				/* jakjr: this is not used for expressoLivre */
 				/*
Index: branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php
===================================================================
--- branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php	(revision 3251)
+++ branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php	(revision 3299)
@@ -855,8 +855,12 @@
 			// Com restrição apenas na edição do Tel. Celular		=> $acl=2;
 			// Com restrição na edição do Tel. Comercial e Celular	=> $acl=3;			
+			// Com restricao apenas na edicao do Tel. Residencial	=> $acl=4;
+			// ....
+			// Com restricao de edição em todos os campos pessoais	=> $acl=7;
 			
 			$personal_data_fields = array(	
 					array("text" => lang("%1 telephone number", lang("Commercial"))	, "acl" => 1),
-					array("text" => lang("%1 telephone number", lang("Mobile"))		, "acl" => 2));
+					array("text" => lang("%1 telephone number", lang("Mobile"))		, "acl" => 2),
+					array("text" => lang("%1 telephone number", lang("Home"))		, "acl" => 4));
 			$list_personal_data = "<tr>";
 						
Index: branches/2.2/preferences/changepersonaldata.php
===================================================================
--- branches/2.2/preferences/changepersonaldata.php	(revision 3234)
+++ branches/2.2/preferences/changepersonaldata.php	(revision 3299)
@@ -42,4 +42,5 @@
 	lang('Observation') . ': ' . lang('This telephone number will apear in searches for your name, and it will be visible for all ExpressoLivre Users') . '.');
 	$GLOBALS['phpgw']->template->set_var('lang_mobile_telephonenumber',lang('%1 telephone number',lang('Mobile')));
+	$GLOBALS['phpgw']->template->set_var('lang_homephone_telephonenumber',lang('%1 telephone number',lang('Home')));
 	$GLOBALS['phpgw']->template->set_var('lang_change',lang('Change'));
 	$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
@@ -48,5 +49,5 @@
 	/* Get telephone number from ldap or from post */
 	$ldap_conn = $GLOBALS['phpgw']->common->ldapConnect();
-	$result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile'));
+	$result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile','homephone'));
 	$entrie = ldap_get_entries($ldap_conn, $result);
 
@@ -54,5 +55,5 @@
 	$disabledTelephoneNumber = false;
 	$disabledMobile = false;
-	 
+	$disabledHomePhone = false;
 	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',1)) {
 		$disabledTelephoneNumber = '"disabled=true"';
@@ -61,8 +62,13 @@
 		$disabledMobile = '"disabled=true"';
 	}
+	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',4)) {
+		$disabledHomePhone = '"disabled=true"';
+	}
 	/* END ACL Check for Personal Data Fields.*/
 	
 	$GLOBALS['phpgw']->template->set_var('telephonenumber',($_POST['telephonenumber'] ? $_POST['telephonenumber'] : $entrie[0]['telephonenumber'][0]).$disabledTelephoneNumber);
 	$GLOBALS['phpgw']->template->set_var('mobile',($_POST['mobile'] ? $_POST['mobile'] : $entrie[0]['mobile'][0]).$disabledMobile);
+	$GLOBALS['phpgw']->template->set_var('homephone',($_POST['homephone'] ? $_POST['homephone'] : $entrie[0]['homephone'][0]).$disabledHomePhone);
+	
 
 	ldap_close($ldap_conn);
@@ -75,5 +81,6 @@
 	if ($_POST['change'])
 	{
-		if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile'])
+		if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile']
+		 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'])
 		{
 			$pattern = '/\([0-9]{2,3}\)[0-9]{4}-[0-9]{4}$/';
@@ -85,4 +92,8 @@
 			{
 				$errors[] = lang('Format of %1 telephone number is invalid.', lang("Mobile"));
+			}
+			if ((strlen($_POST['homephone']) != 0) && (!preg_match($pattern, $_POST['homephone'])))
+			{
+				$errors[] = lang('Format of %1 telephone number is invalid.', lang("Home"));
 			}
 			if(!is_array($errors))
@@ -132,4 +143,20 @@
 						$result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
 					}
+					unset($info['mobile']);
+				}
+				if (!$disabledHomePhone && ($_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'])) {
+					if (strlen($_POST['homephone']) == 0) {
+						$info['homephone'] = $GLOBALS['phpgw_info']['user']['homephone'];
+						$result = @ldap_mod_del($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					elseif(strlen($GLOBALS['phpgw_info']['user']['homephone']) == 0) {
+						$info['homephone'] = $_POST['homephone'];
+						$result = @ldap_mod_add($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					else {
+						$info['homephone'] = $_POST['homephone'];
+						$result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					unset($info['homephone']);
 				}
 				ldap_close($ldap_conn);	
Index: branches/2.2/preferences/templates/default/changepersonaldata.tpl
===================================================================
--- branches/2.2/preferences/templates/default/changepersonaldata.tpl	(revision 3234)
+++ branches/2.2/preferences/templates/default/changepersonaldata.tpl	(revision 3299)
@@ -28,4 +28,14 @@
      </tr>
      <tr>
+       <td>
+        {lang_homephone_telephonenumber}:
+       </td>
+       <td>
+        <input type="input" autocomplete="off" name="homephone" size=12 value="{homephone}" maxlength="13" onkeyUp="FormatTelephoneNumber(event, this);">&nbsp;(xx)xxxx-xxxx
+       </td>
+     </tr>
+	<tr><td colspan=2 height="20px"></td></tr>
+     
+     <tr>
        <td colspan="3">
         <table cellspacing="0"><tr><br>
