From fbeb46890421b11736794f52ce96018d77f37595 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 21 Jan 2011 12:41:05 -0500
Subject: [PATCH] Better grouping of contact information

---
 program/steps/addressbook/edit.inc    |   13 +++++++++----
 program/steps/addressbook/func.inc    |    2 +-
 program/localization/en_US/labels.inc |    1 +
 program/steps/addressbook/show.inc    |   19 ++++++++++++-------
 skins/default/addressbook.css         |    7 ++++++-
 5 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 59e396f..66f47f0 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -279,6 +279,7 @@
 $labels['editcontact'] = 'Edit contact';
 $labels['contacts'] = 'Contacts';
 $labels['contactproperties'] = 'Contact properties';
+$labels['personalinfo'] = 'Personal information';
 
 $labels['edit']   = 'Edit';
 $labels['cancel'] = 'Cancel';
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index 747e12a..0042679 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -95,15 +95,20 @@
         'info' => array(
             'name'    => rcube_label('contactproperties'),
             'content' => array(
-                'gender' => array('visible' => false),
-                'maidenname' => array('size' => $i_size),
                 'email' => array('size' => $i_size, 'visible' => true),
                 'phone' => array('size' => $i_size, 'visible' => true),
                 'address' => array('visible' => true),
-                'birthday' => array('size' => 12),
-                'anniversary' => array('size' => $i_size),
                 'website' => array('size' => $i_size),
                 'im' => array('size' => $i_size),
+            ),
+        ),
+        'personal' => array(
+            'name'    => rcube_label('personalinfo'),
+            'content' => array(
+                'gender' => array('visible' => true),
+                'maidenname' => array('size' => $i_size),
+                'birthday' => array('visible' => true),
+                'anniversary' => array('size' => $i_size),
                 'manager' => array('size' => $i_size),
                 'assistant' => array('size' => $i_size),
                 'spouse' => array('size' => $i_size),
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index e9b3dc8..900d4a8 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -497,7 +497,7 @@
                 }
                 
                 // wrap rows in fieldgroup container
-                $content .= html::tag('fieldset', array('class' => 'contactfieldgroup contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')),
+                $content .= html::tag('fieldset', array('class' => 'contactfieldgroup ' . ($colprop['subtypes'] ? 'contactfieldgroupmulti ' : '') . 'contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')),
                   ($colprop['subtypes'] ? html::tag('legend', null, Q($colprop['label'])) : ' ') .
                   $rows);
             }
diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc
index eb26450..4823707 100644
--- a/program/steps/addressbook/show.inc
+++ b/program/steps/addressbook/show.inc
@@ -93,18 +93,23 @@
         'info' => array(
             'name'    => rcube_label('contactproperties'),
             'content' => array(
-              'gender' => array('size' => $i_size),
-              'maidenname' => array('size' => $i_size),
               'email' => array('size' => $i_size, 'render_func' => 'rcmail_render_email_value'),
               'phone' => array('size' => $i_size),
               'address' => array(),
-              'birthday' => array('size' => $i_size),
-              'anniversary' => array('size' => $i_size),
               'website' => array('size' => $i_size, 'render_func' => 'rcmail_render_url_value'),
               'im' => array('size' => $i_size),
-              'manager' => array('size' => $i_size),
-              'assistant' => array('size' => $i_size),
-              'spouse' => array('size' => $i_size),
+            ),
+        ),
+        'personal' => array(
+            'name'    => rcube_label('personalinfo'),
+            'content' => array(
+                'gender' => array('size' => $i_size),
+                'maidenname' => array('size' => $i_size),
+                'birthday' => array('size' => $i_size),
+                'anniversary' => array('size' => $i_size),
+                'manager' => array('size' => $i_size),
+                'assistant' => array('size' => $i_size),
+                'spouse' => array('size' => $i_size),
             ),
         ),
     );
diff --git a/skins/default/addressbook.css b/skins/default/addressbook.css
index 6e07281..ca92cd5 100644
--- a/skins/default/addressbook.css
+++ b/skins/default/addressbook.css
@@ -311,6 +311,11 @@
 {
 	border: 0;
 	margin: 0.5em 0;
+	padding: 0.2em 2px;
+}
+
+fieldset.contactfieldgroupmulti
+{
 	padding: 0.5em 2px;
 }
 
@@ -322,7 +327,7 @@
 .contactfieldgroup .row
 {
 	position: relative;
-	margin-bottom: 0.4em;
+	margin: 0.2em 0;
 }
 
 .contactfieldgroup .contactfieldlabel

--
Gitblit v1.9.1