I'm trying to build a resources directory for a local youth service. They hold things like DVDs, booklets and leaflets, and other useful resources, and have maintained their own database which they print and hand out to youth workers. I'm using Drupal to allow the youth workers to book a resource online, rather than search through the massive doorstop of a catalogue. So far, I've used CCK to create a resources directory node, with fields for Title, Description, Quantity, etc.. Of course, CCK being what it is, that's the easy part. I now have the resources catalogued online, but need a way for the workers to book an item.
The best way would be to link the resource items to individual users - for example, a registered user keyword searches the list of resources online, finds something they want, then clicks the 'Book this item' button. I'd like CCK to automatically create an entry in a 'borrow resource' node, linking the user's ID with the resource node ID, as well as giving an option to put in a "return by" date. Is it possible to do this in CCK - ie, relate nodes to one another - or will I have to 'hard code' this one?
Any pointers would be appreciated. Thanks.
Comments
'Borrowing' from resource library update
Just thought I'd post an update to my original query. I found the ecommerce module 4.7 (as posted on the drupal rss feed) and have looked through the code. I think I can use this to create the type of module that meets these requirements. I'll keep adding to this post in case anyone finds it useful (I'm no pro-php coder, but if anyone's interested, I can publish the changes I make to the module as I go along.)
I'm very interested in it
Hi, I was today just looking for the same thing, but only for books. I found a very simple module called "loans", it's not listed in modules page but in the cvs: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/loans/
It just loans things (a text field) or money to people (another text field). I'd like to add the following features:
1. the person whom we loan is a registered user
2. the thing you loan is from a given node type
3. disable money loan via settings > loan
4. add support for a loan period and calculate the return date.
but before starting, let's hear about your advances customizing e-commerce :)
Thanks for the feedback on the idea
I checked out the Loans module, and I can see why it may be easier to customise e-commerce. So far, I've been doing a bodge job (British slang - sorry, best way of describing what I'm doing!) on the module code - hiding fields I don't need so that users only enter information that's required. I've been doing this for the price fields, and the other options that relate more to retail than they do to a lending system.
I'd much rather use a views type module to customise the e-commerce node entry form, but I can't find anything that allows me to do this. Obviously, if I end up changing lots of bits of core code in the e-commerce module folder, it will be very difficult to upgrade any of it when Drupal upgrades, so I'd much rather use another formatting module to get round this.
Any ideas whether this is possible, and if such a module exists? I also have another project I'm working on, and am wanting the same feature - hide some fields, show others (simplify the process of adding a node by showing only the fields deemed necessary).
I'll go on with loans module
Bodge job! what a expression! I used to say dirty hack for those things :)
I'll go on with loans module. I prefer to grow a little code adding my requirements than understanding a big piece as e-commerce. It's also my first time to code into drupal so I prefer to start with a little thing. Also I want to make an out of the box solution rather than a non exportable bodge job :)
resource library
Has there been any development with regard to the loans module, or hacking the ecommerce module for loans. It would be great to see any final products.
We are looking at creating an online loans system for booking our AV equipment at the university.
An update on developments would be appreciated
PJ
loan module
I also would like a progress update on the loan module. I am interested in using it in a micro loan site like http://www.kiva.org or prosper.com
Hi all - just to let you
Hi all - just to let you know that I haven't gotten any further with a loans database as that job has been on the back-burner for many months (higher priority work unfortunately) but I do have an idea as to how to approach the problem.
I've recently gotten into CCK and Views, and have had to create my own postcode parsing, Workflow automation and User creation modules, so have a better idea about how to create a Library-style feature on the site when I get round to it!
Basically, I think that using CCK is definitely the best way to go.
So to conclude, I think the entire process is possible using only CCK and Views. Thanks to the quick progression of the project, most of the questions I originally asked have now been answered - ie, relating one node to another can now be done using the node-reference field, available to both CCK and Views modules.
Once I start work on the project - shouldn't be too much longer now - I'll publish a complete example. I'd say your best bet is to download both CCK and Views modules and mess around with creating content types and creating templates using the Views wizard.
I've just re-read all that, and it may sound a little techie to a Drupal noob - please ask me any questions. I'm definitely no Drupal-pro, but will be happy to help where I can :)
sounds great!
I am trying to set up a very similar site. Have you made any progress? At the moment i have my site as a "library site" only. cck nodes for different resources, and users organized by buddylist.
i have tried to integrate borrowing items with workflow and workflow actions. this was the idea:
- change workflow of an item to "lent out" -> automatically redirect to a new user-to-resource-node (not possible with current modules)
- on item return: change workflow to "available" -> automatically unpublish user-to-resource node. (seems to be not possible either. actions.module?)
- pull the user-to-resource-node to display in a views block by all item nodes, if published
Some questions on your above statement:
- how would you use arguments in your views? I use only filters like "author is current user" or "author is buddy of". would you use arguments to make links in the theme template? how would you do it?
- db_query... apart from me not understanding any php (which makes my project quite difficult ): would there be a seperate inventory counter? or would you just look for a "user-to-resource" node with a field containing the resource?
- your point 5: wow, this would be perfect! we could have a date field in the user-to-resource-node that contains an optional due-date.
- how would you have users input returned items? one possibilty would be to connect it to workflow.module and unpublish the corresponding user-to-resource-node. it would also be handy to work with workflow for the resource node (to have it marked as "available" or not: great views filter!)
- would you have a permanent user-to-resource-node for every resource item or would it be created new on every borrowing event?
any help is very much appreciated!
Detailed instructions?
I'd really appreciate finding out more of the details on how to do this step by step using just CCK and Views please.
I read point 1 above and nodded my head, and then got to point 2 and thought - huh?
I have a 'Library_item' content type, that I want members to be able to add a review and rating (Fivestar) to; and also for there to be a way for the book to be marked as 'Issued' or 'Available' (which any assigned user with the right perms could do). After that it would be cool for the person who borrowed it to be reminded by email that the book is due for return in 'x' days.
TIA
Late reply, but suggestions nonetheless!
Hi Quartz
Apologies for the length of time it's taken me to re-read this thread. A lot has happened since then! I hope you're still checking out your 'track' tab on your account page, or at least check it more regularly than I do.
Anyway, I think the best way to achieve the above is now to use the Flag module in D6. It's pretty awesome, and can accomplish everything I originally set out to do. All you need to do is create flags for the specific nodes you'd use. You can set global flags for nodes (to mark them as borrowed) or user-specific flags (to mark them as requested for borrowing) and you can set rules and actions so that when items are flagged, emails are sent out, node content or status is changed etc.
Also, the voting API (Fivestar et al) will obviously help with the ratings of each node.
The nice thing about the flags and voting apis is that they remain separate from the fields in your content form - ie, the content only holds library item fields (info on the items themselves), and yet the flagging and voting information can be included in any views you may create (such as stock lists for admin users, or the main library browsing pages for visitors).
So, to summarise, you'd definitely need these modules: CCK and Views, along with Voting API (and your preferred rating module) and Flag.
Thanks...
...wayfarer_boy for getting back to me.
I will check out the Flags module. Only just heard about its intended use here on D.o but had no idea about its other applied uses. [ http://www.3281d.com/2009/03/27/death-to-subscribe-comments ]
Would be great to get this functionality working and automated.
Library
Has anyone got anything working for this? I am looking at the same thing for our small library at work. Any help would be great.
Interested too
I am also looking for something like this: for equipment check out.