From a171bdb141494a27d3cc1a011918bc182ea8de8b Mon Sep 17 00:00:00 2001
From: acouch acinternets@gmail.com
Date: Fri, 25 Feb 2011 22:34:09 -0500
Subject: [PATCH 1/2] #1010314 add option for no name

---
 addressfield.module |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/addressfield.module b/addressfield.module
index 55b8c05..6ad3251 100644
--- a/addressfield.module
+++ b/addressfield.module
@@ -247,6 +247,7 @@ function addressfield_field_widget_settings_form($field, $instance) {
         'first_last' => t('First and last name text fields'),
         'name_line_organisation' => t('Full name text field with an optional company text field'),
         'first_last_organisation' => t('First and last name textfields with an optional company text field'),
+        'no_name' => t('Do not use name or organization field.'),
       ),
       '#default_value' => $settings['name_format'],
     );
-- 
1.7.0.4


From 9e7c841692e884856282a91a545dba2f171707e8 Mon Sep 17 00:00:00 2001
From: acouch acinternets@gmail.com
Date: Fri, 25 Feb 2011 23:09:57 -0500
Subject: [PATCH 2/2] #1010314 add option for no name

---
 addressfield.module                      |    4 ++++
 theme/addressfield-formatter--BR.tpl.php |    3 ++-
 theme/addressfield-formatter--GB.tpl.php |    3 ++-
 theme/addressfield-formatter--US.tpl.php |    3 ++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/addressfield.module b/addressfield.module
index 6ad3251..21a3938 100644
--- a/addressfield.module
+++ b/addressfield.module
@@ -703,6 +703,10 @@ function template_preprocess_addressfield_formatter(&$variables) {
   // Encode the address elements.
   $variables['address'] = array_map('check_plain', $variables['address']);
 
+  // Format first and last name.
+  $variables['address']['last_name'] ? $variables['address']['last_name'] = ' ' .  $variables['address']['last_name'] : '';
+  $variables['address']['full_name'] = $variables['address']['first_name'] . $variables['address']['last_name'];
+
   // Add the country name to the address.
   include_once DRUPAL_ROOT . '/includes/locale.inc';
   $countries = country_get_list();
diff --git a/theme/addressfield-formatter--BR.tpl.php b/theme/addressfield-formatter--BR.tpl.php
index e4c8406..c7b0ac8 100644
--- a/theme/addressfield-formatter--BR.tpl.php
+++ b/theme/addressfield-formatter--BR.tpl.php
@@ -9,7 +9,8 @@
   <div class="street-address">
     <?php
     print implode('<br />', array_filter(array(
-      !empty($address['name_line']) ? $address['name_line'] : $address['first_name'] . ' ' . $address['last_name'],
+      $address['name_line'],
+      $address['full_name'],
       $address['organisation_name'],
       $address['thoroughfare'] . ', ' . $address['premise'],
       $address['sub_premise'],
diff --git a/theme/addressfield-formatter--GB.tpl.php b/theme/addressfield-formatter--GB.tpl.php
index 1255ba2..1fb4554 100644
--- a/theme/addressfield-formatter--GB.tpl.php
+++ b/theme/addressfield-formatter--GB.tpl.php
@@ -9,7 +9,8 @@
   <div class="street-address">
     <?php
     print implode('<br />', array_filter(array(
-      !empty($address['name_line']) ? $address['name_line'] : $address['first_name'] . ' ' . $address['last_name'],
+      $address['name_line'],
+      $address['full_name'],
       $address['organisation_name'],
       $address['thoroughfare'],
       $address['premise'],
diff --git a/theme/addressfield-formatter--US.tpl.php b/theme/addressfield-formatter--US.tpl.php
index ffe4c77..7c7ab61 100644
--- a/theme/addressfield-formatter--US.tpl.php
+++ b/theme/addressfield-formatter--US.tpl.php
@@ -9,7 +9,8 @@
   <div class="street-address">
     <?php
     print implode('<br />', array_filter(array(
-      !empty($address['name_line']) ? $address['name_line'] : $address['first_name'] . ' ' . $address['last_name'],
+      $address['name_line'],
+      $address['full_name'],
       $address['organisation_name'],
       $address['thoroughfare'],
       $address['premise'],
-- 
1.7.0.4

