Download & Extend

Inventory field

This is a CCK field that lets you take inventory of a list of items. At node creation time, each of those items has a select box with numbers letting you say how many of that item you have, or a textfield to specify an arbitrary value.
Note: Changes in 2.x-dev version of this module change the internal database representation for table inventory_fields, so check the "Release Notes" before updating!

The item list source can be specified as:

  • plain text using the format "itemkey|item name"
  • php code to be executed and should return a hash of values
  • sql query
  • nodes from specific content types

Database representation

The above field is stored in the db like this:

mysql> select * from inventory_items;
+-----+-----+--------------------+----------+-------+
| nid | vid | fieldset           | itemkey  | count |
+-----+-----+--------------------+----------+-------+
|  37 |  37 | field_article_piro | CARR001  |    11 |
|  37 |  37 | field_article_piro | CARR007  |    23 |
|  37 |  37 | field_article_piro | CARRVM07 |     5 |
+-----+-----+--------------------+----------+-------+

Development Plans

I've been thinking a while on how to improve this module for a better CCK integration (e.g: use the multiple values feature) and upgrading to Drupal 6.
The desireable behaviour for a better inventory field would be something like CCK's "Add more"+AHAH forms with autocompletion textfields (like nodereference's), but first attempts to find out a good solution for this meant a big rewrite of the module implementation.
Another crazy idea would be switching to a new "multiple value" field group instead. The problem is that I didn't see a way to do this in a propper way in CCK.
(See http://drupal.org/node/119102 for more discussion about this last idea)

Feel free to send me any suggestions, please ;)

Downloads

Version Downloads Date Links
5.x-2.x-dev tar.gz (9.4 KB) | zip (10.13 KB) 2010-Jul-11 Notes
5.x-1.x-dev tar.gz (8.17 KB) | zip (8.89 KB) 2010-Jul-11 Notes

Project Information


Maintainers for Inventory field

  • quimrovira - 1 commit
    last: 3 years ago, first: 3 years ago

Issues for Inventory field

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports