? location_addanother.patch
? location_foreach_problem.alternate.patch
? location_foreach_problem.patch
Index: location.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.module,v
retrieving revision 1.62.2.16
diff -u -p -r1.62.2.16 location.module
--- location.module	30 Jan 2007 02:46:26 -0000	1.62.2.16
+++ location.module	31 Jan 2007 17:23:00 -0000
@@ -558,6 +558,13 @@ function location_form_alter($form_id, &
       '#default_value' => variable_get('location_weight_'. $type, 9),
       '#description' => t('Weight of the location box in the input form. Lowest values will be displayed higher in the form.')
     );
+
+    $form['location']['location_addanother_'. $type] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Add another location from node view page'),
+      '#default_value' => variable_get('location_addanother_'. $type, 0),
+      '#description' => t('Check this if you wish to show the "Add another location" option on the node view page.')
+    );
     
     $form['location']['location_collapsible_'. $type] = array(
       '#type' => 'checkbox',
@@ -1036,7 +1049,7 @@ function location_nodeapi(&$node, $op, $
         }
       }
       
-      if (count($node->locations) < variable_get('location_maxnum_'. $node->type, 0) && !$teaser && node_access('update', $node) && !$is_preview) {
+      if (variable_get('location_addanother_'. $node->type, 0) && count($node->locations) < variable_get('location_maxnum_'. $node->type, 0) && !$teaser && node_access('update', $node) && !$is_preview) {
         $location_fields = array();
         $required_fields = array();
         foreach (array_keys(location_field_names()) as $field_name) {
