From db52734dd161d86577260b69c5fcd5a55d37de76 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 10 Oct 2008 11:25:35 +0000 Subject: [PATCH] default format for fileas --- addressbook/inc/class.addressbook_bo.inc.php | 5 +++-- addressbook/inc/class.addressbook_hooks.inc.php | 9 +++++++++ addressbook/inc/class.addressbook_ui.inc.php | 10 +++++++--- addressbook/setup/egw_de.lang | 2 ++ addressbook/setup/egw_en.lang | 2 ++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index d92c1987fb..dbdf580022 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -42,6 +42,7 @@ class addressbook_bo extends addressbook_so 'org_name: n_given n_family', 'org_name: n_fn', 'n_family, n_given: org_name', + 'n_family, n_given (org_name)', 'n_family, n_prefix: org_name', 'n_given n_family: org_name', 'n_prefix n_family: org_name', @@ -255,7 +256,7 @@ class addressbook_bo extends addressbook_so function fileas($contact,$type=null) { if (is_null($type)) $type = $contact['fileas_type']; - if (!$type) $type = $this->fileas_types[0]; + if (!$type) $type = $this->prefs['fileas_default'] ? $this->prefs['fileas_default'] : $this->fileas_types[0]; if (strpos($type,'n_fn') !== false) $contact['n_fn'] = $this->fullname($contact); @@ -293,7 +294,7 @@ class addressbook_bo extends addressbook_so } } } - return $this->fileas_types[0]; + return $this->prefs['fileas_default'] ? $this->prefs['fileas_default'] : $this->fileas_types[0]; } /** diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index d188f07ab0..e6b592653b 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -202,6 +202,15 @@ class addressbook_hooks 'xmlrpc' => True, 'admin' => false, ); + $GLOBALS['settings']['fileas_default'] = array( + 'type' => 'select', + 'label' => 'Default file as format', + 'name' => 'fileas_default', + 'values' => ExecMethod('addressbook.addressbook_bo.fileas_options'), + 'help' => 'Default format for fileas, eg. for new entries.', + 'xmlrpc' => True, + 'admin' => false, + ); $GLOBALS['settings']['hide_accounts'] = array( 'type' => 'check', 'label' => 'Hide accounts from addressbook', diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index d42d219889..4c57470406 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -1326,10 +1326,14 @@ class addressbook_ui extends addressbook_bo { $content = $this->read_org($state['org_view']); } - elseif ($GLOBALS['egw_info']['user']['preferences']['common']['country']) + else { - $content['adr_one_countryname'] = - $GLOBALS['egw']->country->get_full_name($GLOBALS['egw_info']['user']['preferences']['common']['country']); + if ($GLOBALS['egw_info']['user']['preferences']['common']['country']) + { + $content['adr_one_countryname'] = + $GLOBALS['egw']->country->get_full_name($GLOBALS['egw_info']['user']['preferences']['common']['country']); + } + if ($this->prefs['fileas_default']) $content['fileas_type'] = $this->prefs['fileas_default']; } if (isset($_GET['owner']) && $_GET['owner'] !== '') { diff --git a/addressbook/setup/egw_de.lang b/addressbook/setup/egw_de.lang index d95ad9841a..d191a5600d 100644 --- a/addressbook/setup/egw_de.lang +++ b/addressbook/setup/egw_de.lang @@ -122,7 +122,9 @@ default addressbook de Standard default address format addressbook de Vorgabe für Format der Adresse default addressbook for adding contacts addressbook de Vorgabe Adressbuch beim Hinzufügen von Kontakten default document to insert contacts addressbook de Standarddokument zum Einfügen von Kontakten +default file as format addressbook de Vorgage für eigene Sortierung default filter addressbook de Standardfilter +default format for fileas, eg. for new entries. addressbook de Vorgegebenes Format für eigene Sortierung, z.B. für neue Einträge defines which email address (business or home) to use as the preferred one for distribution lists in mail. addressbook de Legt fest, welche E-Mailadresse (geschäftlich oder privat) für Verteilerlisten in Mail bevorzugt benutzt werden soll. delete a single entry by passing the id. addressbook de Löscht einen einzelnen Eintrag durch Übergabe seiner ID. delete selected distribution list! addressbook de Löscht die ausgewählten Verteilerliste! diff --git a/addressbook/setup/egw_en.lang b/addressbook/setup/egw_en.lang index 94759b02c5..f8ba233217 100644 --- a/addressbook/setup/egw_en.lang +++ b/addressbook/setup/egw_en.lang @@ -122,7 +122,9 @@ default addressbook en default default address format addressbook en Default address format default addressbook for adding contacts addressbook en Default addressbook for adding contacts default document to insert contacts addressbook en Default document to insert contacts +default file as format addressbook en Default file as format default filter addressbook en Default Filter +default format for fileas, eg. for new entries. addressbook en Default format for fileas, eg. for new entries. defines which email address (business or home) to use as the preferred one for distribution lists in mail. addressbook en Defines which email address (business or home) to use as the preferred one for distribution lists in mail. delete a single entry by passing the id. addressbook en Delete a single entry by passing the id. delete selected distribution list! addressbook en Delete selected distribution list!