Index: civinode/contrib/civicrmdata/civicrmdata.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/civinode/contrib/civicrmdata/civicrmdata.module,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 civicrmdata.module
--- civinode/contrib/civicrmdata/civicrmdata.module	11 Jul 2006 14:18:34 -0000	1.6.2.1
+++ civinode/contrib/civicrmdata/civicrmdata.module	12 Dec 2006 16:27:05 -0000
@@ -279,20 +279,58 @@
         $form[$field['field_name']] = array('#tree' => TRUE);
 
 
-				//Support restriction by GID:
-				$default_group = isset($field['group_id']) ? $field['group_id'] : 0;
-				$ac_key = $default_group ? 'gid' : 'any';
-				$ac_val = $default_group ? $default_group : 'any';
-        $widget = 
+        //Support restriction by GID:
+        $default_group = isset($field['group_id']) ? $field['group_id'] : 0;
+        $ac_key = $default_group ? 'gid' : 'any';
+        $ac_val = $default_group ? $default_group : 'any';
+        
+        if ($field['multiple']) {
+          $form[$field['field_name']]['#type'] = 'fieldset';
+          $form[$field['field_name']]['#title'] = t($field['widget']['label']);
+          $form[$field['field_name']]['#description'] = $field['widget']['description'];
+          $delta = 0;
+          foreach ($node_field as $item) {
+            //print_r($item);
+            if($item['crmid']){
+              $widget = 
+              civinode_contact_auto_selector($field['widget']['label'],
+                                         $field['widget']['description'],
+                                         'civinode/autocomplete/contact',
+										 $ac_key, $ac_val);
+
+              $widget['#default_value'] = $item['full_contact_name'];
+              $widget['#required'] = ($delta == 0) ? $field['required'] : FALSE;
+              $form[$field['field_name']][$delta]['full_contact_name'] = $widget; 
+              $delta++;
+            }
+          }
+          foreach (range($delta, $delta + 2) as $delta) {
+            $widget = 
+            civinode_contact_auto_selector($field['widget']['label'],
+                                         $field['widget']['description'],
+                                         'civinode/autocomplete/contact',
+										 $ac_key, $ac_val);
+
+            $widget['#default_value'] = '';
+            $widget['#required'] = ($delta == 0) ? $field['required'] : FALSE;
+            $form[$field['field_name']][$delta]['full_contact_name'] = $widget; 
+          }
+        }
+        else {
+          $widget = 
           civinode_contact_auto_selector($field['widget']['label'],
                                          $field['widget']['description'],
                                          'civinode/autocomplete/contact',
-																				 $ac_key, $ac_val);
+										 $ac_key, $ac_val);
 
-        $widget['#default_value'] = $node_field[0]['full_contact_name'];
-        $widget['#required'] = $field['required'];
-        $form[$field['field_name']][0]['full_contact_name'] = $widget; 
-          /**
+          $widget['#default_value'] = $node_field[0]['full_contact_name'];
+          $widget['#required'] = $field['required'];
+          $form[$field['field_name']][0]['full_contact_name'] = $widget; 
+        }
+        
+        
+        
+        /**
          array(
            '#type' => 'textfield',
            '#title' => t($field['widget']['label']),
