I'd like to use drupal for a gear checkin /checkout system for the climbing gym I work for.

I've been using CCK field modules and Views for the most part to accomplish my goal, but I'm having trouble with one thing.

CCK allows me to reference another node, but what I really would like to be able to do is reference specific feild information inside of another node based on which node I choose. For example, I might want to reference a node that represents a customer at the wall. Upon referencing that user, I would want other fields in the node I am currently creating filled in from information in the referenced customer node.

I toyed with the CCK computed field but was unsuccessful and wondered if any of you guys had any suggestions.

Comments

nevets’s picture

It would be possible that "Upon referencing that user, I would want other fields in the node I am currently creating filled in from information in the referenced customer node." But it would require a little programming. You would need a module that implements the nodeapi and when a node (equipment?) is submit the code would look to see if their is a customer reference node and if so copy the approriate data over.

In general though I would try to avoid the copy, instead I would go with say 3 content types, the node you are creating, the customer node and node that represents what needs to be copied. That way both content types 1 and 2 can reference content type 3.

If you care to provide more detail on what you are tring to do, I can flesh that out as I suspect it is a little vague.

mooffie’s picture

lacitpo,
I too would like to hear the details of what you're trying to do.

lacitpo’s picture

Ok, so here is the structure.

Customer Profiles as a Node containing this information

  • Name
  • ID number
  • Some information about which waivers they have signed
  • You get the picture. A few fields using the CCK modules.

Then anytime equipment was rented, it would create a new node for that rental. Here is a method I believe might be possible.

  1. Search, or use a View to find the customer in our database. (add the customer if they dont' exist.
  2. Upon bringing up the node, have a button on their profile that brings me to a node creation screen for creating the checkin/checkout node. I believe this is the point that the user information should be passed to the new node being created. I also believe there is a CCK module for adding a button to a node but I don't know much about it or what the button could be used for.
  3. The new checkin/checkout node would be filled in with what equipment was being rented and added to the system

Now, if the button CCK module has the functionality I hope it does, the next part of this should work too.

Use a View to monitor what equipment is checked out and to whom. When someone comes to check gear back in we use that view to bring up the checkin/checkout node and hopefully have a button(cck module) that could flip the node field representing the status of the checked out gear.

Hope that is clear enough...

lacitpo’s picture

Button module isn't really seeming to be all I hoped it might be. Looks like computed field is gonna be the way I'd need to go but the code needed is sorta beyond me. Anyone got any starting help?

nevets’s picture

From my perspective you have two content types, a customer and equipement. In addition I would use a content type to track rental history,

So I would make this third content type, rental history have information like
Customer (I would use a node reference for this and 'Add Node' or 'Add and Reference')
Equipment (a node reference to a piece of equipment, I would also use a view for this to get a list of equipment not checked out)
State (checked out, checkin)
Other possible fields
Check out date/time
Check in date/time
Other?

Then someone checking something out would bring up this form
Select the customer (or add a new one)
Select the piece of equipement
Set the state to checkout
Set other information as needed.

Handle check in pretty much the way you described but consider the editablefields module