Are there any plans in the work to extend Resource Conflict to entities? For example, my use-case is Profile2 -- we're managing user offices and want to be able to detect when an office is in use (we assign them by term). I notice that it works only on node forms currently.

Comments

4kant’s picture

Would it work together with entity registration then?

As far as I see any booking stuff would be easy to configure using views, rules and of course calendar!
Without any preconfigured booking modules.

ohthehugemanatee’s picture

Yes, and in fact this should not be too difficult. It's even in the README's "to do" list! As much as possible in the 7.x rewrite, I tried to use generic entity functions... but it isn't quite there yet. Honestly my priority was a stable, rules-based rebuild, and extending it to ALL fieldable entities was a "let's see if this is possible as I rewrite it" kind of thing.

IIRC all it needs is replacing some node_loads, replacing the hook_node_validate implementation, and there are probably a few conditionals in there that assume a node form. I probably won't have time to work on this more until Drupalcon PDX without sponsorship. Patches welcome, though.

tmsimont’s picture

I have been working on a similar concept that is based around entities. Instead of using hook_node_validate I require the user to user entityreference fields, and then alter the field validation. by using field validation rather than, I've made it useable on all fieldable entities.

at this point, however, the configuration is a bit clunky, and the rules resolution bit leaves a lot to be desired:
http://drupal.org/sandbox/tmsimont/1931666

Renee S’s picture

Interesting, @tmsimont. My two cents is that I prefer the simplicity of Resource Conflict, it's nice and it's clean and has a lot of installs which helps with bug-catching and support. In terms of developer time, getting it entity-ified seems a more efficient use.

bkosborne’s picture

Issue summary: View changes

Seems to me that one of the sticking points would be: Where do you ask the user to "enable" resource conflict? Right now it's on the edit form for a content type, but we can't assume that any entity would have a similar form to alter to add the checkbox and dropdown for date field.

nikathone’s picture

@bkosborne I think the idea might be to create a general setting form (may be under structure) where available entity will be detected like in views and then from their enable resource conflict on them.

pq’s picture

Another use case for this would be commerce line items or similar, which could act then as bookings.

caldenjacobs’s picture

Priority: Normal » Major

Entity Construction Kit ( ECK ) support would be nice as well. When I get some time I'll have a look at what it would take to move administration under the Date Tools section. It doesn't make sense to relegate the opt-in option to NODE Content Type edit forms only.

Derimagia’s picture

Very much agreed with @caldenjacobs that ECK or Entities would be nice. I am looking to evaluate this module for a project, but I can't justify nodes at all for the "appointment" and "availability" entities I want to create. Was also looking at the BAT module.

There's a little bit of a discussion here on what I'm trying ot do: https://github.com/Roomify/bat_drupal/issues/21

@caldenjacobs any luck with this or did you not get the time?

joelpittet’s picture

Priority: Major » Normal

Good idea, but features aren't generally "major" priority unless the maintainer thinks it is.

afagioli’s picture

Closed for inactivity

The roomify code is forked into bat_batroomify
See https://www.drupal.org/project/bat/issues/3509323

afagioli’s picture

Status: Active » Closed (outdated)