using nation from the general prefs for new addresses

This commit is contained in:
Ralf Becker 2006-12-04 12:41:03 +00:00
parent 8c86a244c9
commit 46dfa3e3ff

View File

@ -1000,6 +1000,16 @@ class uicontacts extends bocontacts
{ {
$content = $this->read_org($state['org_view']); $content = $this->read_org($state['org_view']);
} }
elseif ($GLOBALS['egw_info']['user']['preferences']['common']['country'])
{
if (!is_object($GLOBALS['egw']->country))
{
require_once(EGW_API_INC.'/class.country.inc.php');
$GLOBALS['egw']->country =& new country;
}
$content['adr_one_countryname'] = $content['adr_two_countryname'] =
$GLOBALS['egw']->country->get_full_name($GLOBALS['egw_info']['user']['preferences']['common']['country']);
}
if (isset($_GET['owner']) && $_GET['owner'] !== '') if (isset($_GET['owner']) && $_GET['owner'] !== '')
{ {
$content['owner'] = $_GET['owner']; $content['owner'] = $_GET['owner'];
@ -1030,7 +1040,6 @@ class uicontacts extends bocontacts
$content['created'] = $this->now_su; $content['created'] = $this->now_su;
unset($state); unset($state);
} }
if($content && $_GET['makecp']) // copy the contact if($content && $_GET['makecp']) // copy the contact
{ {
$content['link_to']['to_id'] = 0; $content['link_to']['to_id'] = 0;