Hello,

i started porting this module to drupal7 using the coder module +
manual fixing. I used the 6.x-2.x-dev version as basis.
I made a short test with 2 resources and 2 resource module enabled
contenttypes, 1 using datetimefield the other date field. it seems to work but
needs more testing. if this gets approved by the community and deviantintegral the maintainer,
a release for drupal 7 could be made available. The converted module is in the attached zip.
Please try it so we can have a release for drupal 7, thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deviantintegral’s picture

Status: Needs review » Needs work

Thanks for the work. Here's my feedback:

  • Instead of updating hook_update_5xxx() hooks, we can remove them outright from the install file. In fact, I'd be tempted to remove the 600x updates as well, and require that users use the latest 6.x version before updating to 7.x.
  • Remove resource_conflict_nodeapi_OLD
  • Line 12 in hook_node_validate(), why is the break commented? Shouldn't it be a return; now?

This is actually pretty close to being good enough for a 7.x-1.x-dev branch (though I haven't actually tested the code). What needs to happen before that:

  • Anywhere there is old code that has been updated but the old code is commented, it should be removed.
  • For places where code is commented but no functional D7 equivalent is done yet, I would suggest placing at the beginning of each block a TODO linking to an issue for that task. That way, it's easy to tell what needs to be done before doing a beta release.
  • I'm OK with creating a branch before having 6.x->7.x update code, so don't worry about that right away unless you need it.
agill’s picture

I just noticed that the References module now maintains the node_reference code of the cck project for
drupal7 until a more general solution like Relation is actually made usable. thats whats written on the
projectsite of References.
So i guess its a good idea to wait a little longer to see what module to use for references...
When these questions are solved i will post a corrected version of the Resource Conflict module
for drupal 7 again.

agill’s picture

FileSize
12.21 KB

How about this version? I cleaned it up.
It does not have update code from 6.x to 7.x, but it would be nice if you could
make a 7.x-1.x dev branch of the attached zip.
Thanks
Andreas

deviantintegral’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
deviantintegral’s picture

Status: Needs work » Needs review
FileSize
26.59 KB

I've created a 7.x-2.x branch, but haven't put in any commits yet. Here's a git format-patch against that branch. I split your changes into three different commits and set the author, and then added coder style fixes on top. In the future, please provide the output of git format-patch instead of zip files.

If this patch looks good, let me know and I'll commit them to the branch.

agill’s picture

FileSize
44.83 KB

Hello,
i applied the patch. I got two warnings about 2 lines added whitespace.
See attached screenshot. But the rest applied successfully, and the module
seems to work. I don´t know if i did everything right, still need to get used to git.
because of that i added the screenshot.

artatac’s picture

Category: task » bug

I have created a content type resource and another with a mandatory date field with from and to required. I created a node reference field linked to resource (projector1, projector2, projector3). It works fine when booking but ignores any conflicts. If you need more details of access please let me know

WilliamV’s picture

Is it possible to put reservations of resources on hold and provide later on dis/approval?

Grtz.

paulgemini’s picture

subbing

Anonymous’s picture

This worked for me after I removed the cck dependency from the .info file.

Only tested once so far - I created a content type called "booking" with a date field and a node reference to a "room" content type. I used the references module, although looks like Entity Reference might be replacing that as the way to go for referencing in the future.

As probably guessed I'm trying to create a meeting room booking system, doesn't seem to be any particular "best" way of doing this - last time I did similar was many years ago before my Drupal days and I used the Meeting Room Booking System (MRBS) on sourceforge. Would appreciate any pointers, but liking the look of this so far!

ohthehugemanatee’s picture

I patched the upgrade to D7, fixed the .info file, and it worked fine. But as stevepurkiss said, most people are using Entity Reference now. It's certainly a lot more flexible! I've attached two things here.

* patch from the D7 version of the module, to change from reference module to entityreference
* further patch to add Taxonomy term support on top of that

For anyone wanting to use these patches, the order is:
1) download the dev version of the module
2) apply patch from #5
3) apply entityreference patch
4) apply taxonomy patch (optional)

I'm not using the global entity items right yet... still hunting for the EID and title, specifically. This results in the occasional fatal when it can't find the property I'm looking for. Entity API can take care of this, so I'll tidy up the code and provide a better version tomorrow... but I thought I'd post my results here for now.

BTW, it looks like this module is abandoned. I'm happy to take it over. What I see as the future:

* removing event module cruft
* EntityReference integration
* configurable error messages
* Rules integration, so you can choose whether a conflict should throw an error on the form, fire a Rules action, or both

ohthehugemanatee’s picture

Simpler patch here. This patch applies to 7.x-2.x.dev (download from http://drupal.org/node/1144872 ) to make the following changes:

* use Entityreference instead of Reference
* permit taxonomy terms as a unique bookable object as well
* Remove old "event module" stuff which doesn't apply to D7

ohthehugemanatee’s picture

Cross posting: I rebuilt the module using Rules, so you can easily customize your conflict behaviors. Works great in D7, but I could use more testers. See http://drupal.org/node/177009/git-instructions/rules for instructions on how to download the Rules branch.

ohthehugemanatee’s picture

Status: Needs review » Closed (won't fix)

Released the dev version of 7.x-3.x today, completely rebuilt using Rules. Please note when updating that there is no upgrade path for conflict resources at present. Any content types you already had set for conflict detection will stay set, and it will remember the date field specified. But conflict resources will have to be redone in Rules.