diff --git a/resource_conflict.module b/resource_conflict.module index 533def3..7d1b089 100644 --- a/resource_conflict.module +++ b/resource_conflict.module @@ -17,10 +17,10 @@ function resource_conflict_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { } // Find the date field to use for time overlapping_node_ids detection. - $date_field = variable_get('rc_date_field_' . $type, FALSE); + $date_fields = variable_get('rc_date_field_' . $type, FALSE); $overlapping_node_ids = array(); - + foreach ( $date_fields as $date_field ) { if (strpos($date_field, 'field_', 0) === 0) { // Get the start and end Date of the current node $start = $node->{$date_field}[0]['value']; @@ -40,7 +40,8 @@ function resource_conflict_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { else { // If we got here, someone broke the requirements, so turn off // resource conflict for this type and notify an admin - _resource_conflict_disable($type); + continue; + //_resource_conflict_disable($type); } } if (!empty($node->event_start)) { @@ -61,6 +62,7 @@ function resource_conflict_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { // Display conflict errors _resource_conflict_display_conflict_errors($node, $conflicting_nodes); break; + } } } @@ -218,12 +220,11 @@ function resource_conflict_form_alter(&$form, $form_state, $form_id) { ); $form['resource_conflict_set']['rc_date_field'] = array( - '#type' => 'select', + '#type' => 'checkboxes', '#title' => t('Field to use as the date for conflict checks'), '#options' => $date_fields, - '#multiple' => FALSE, - '#default_value' => variable_get('rc_date_field_' . $type, FALSE), - '#description' => t("Select the date field to use to check for resource conflicts."), + '#default_value' => variable_get('rc_date_field_' . $type, array()), + '#description' => t("Select the date fields to use to check for resource conflicts."), ); $form['resource_conflict_set']['rc_reference_fields'] = array(