This module allows for users to book resources for use during events. For example, a student can book a microscope for use within their lab. The D7 version detects overlapping dates and conflicts between nodes, and lets you respond using Rules.
Resource Conflict has been rebuilt around Rules and Entities for Drupal 7. The D7 version of the module simply detects conflicts/overlaps between two date-enabled nodes, and lets you respond with Rules. By default, this module throws a form error for every overlapping date it finds among conflict-enabled nodes. It is intended to be customized using Rules, for example to only throw errors when certain field values are identical. It integrates with the rules_forms module to let you set a form error, or you can handle the conflicts another way if you like.
- Create a content type with a date field.
- On the Content Type Edit page, enable Conflict Checking for this Content Type. Select the date field which should be used for conflict checking, and save the form.
- Create two nodes with overlapping dates to see the default Rule in action. Or
create your own Rule.
- EVENT: A Resource Conflict Node Form is Validated: This rule fires during node form validation on Resource Conflict enabled content types. You should use this event if you want to set form errors, or if you want to interact with Rules_forms module. It provides both a node object of the node being created/edited and a form object for use with rules_forms. This is the event trigger for the default Rule.
- CONDITION: Contains a Resource Conflict Evaluate a node object for conflicts. Returns TRUE if there are conflicts for the node.
- ACTION: Load a List of Conflicting Nodes: Creates a list of nodes that conflict with the given node.
- ACTION: Set a Form Validation Error: Stores a form validation error to be fired the next time a validation hook is called on a conflict-enabled node. This is intended for use with the "A Resource Conflict Node Form is Validated" Event.
Check the README.txt file for more information
Handbook pages have been added to describe how to set up this module. As Resource Conflict is very flexible in addressing different use cases, please consider adding your own setup to the documentation for the benefit of new users. I've added a basic guide for Booking rooms for events which should act both as a template for other guides and as a good introduction to new users.
Resource Conflict requires three things to be set up within a content type.
- The content type must have at least one nodereference (from CCK project) field.
- The content type must be event-enabled or have an associated CCK date field.
- The resource conflict option must be enabled, and at least one nodereference field must be selected. These will be the resources which will be checked for conflicts.
If there is a pre-existing event which conflicts in both time and resource, a form error is set and the user is forced to either book a different resource or change the event times.