Here's a module I've worked on that ties Drupal nodes to CiviCRM Organization Contacts
It creates Drupal content types for each organization group.
You create Drupal nodes of any of those types, and a CiviCRM Organization Contact is automatically created.
The CiviCRM fields can be set to appear on the Drupal node edit form.

Would you be interested in including this in CiviNode, or is it best if I upload this as a new Drupal project?

Comments

bigjim’s picture

any idea if you are going to make this a separate module?

also, know what it would take to port it to D6/CiviCRM2.1?

joachim’s picture

The file as it stands is a separate module, but as far as making it a separate project, I think it might be best to include it with civinode if the maintainer agrees and it's compatible.
I've no plans to port it to D6/Civi 2.1.

bigjim’s picture

Cool, thanks for responding

I ran it through coder last night doesn't look like there is much to change, I'll see if I can get it going on D6/C2.1 and post my results here.

joachim’s picture

The CiviCRM API may have changed -- they ripped out quite a bit of functionality for 2.0 and may have made further changes for 2.1.

bigjim’s picture

StatusFileSize
new5.78 KB

I changed a little, but for the most part your code worked flawlessly,

Besides updates to Drupal hooks (hook_theme, hook_node_access, and hook_menu) and updates to the info and install files I changed two things. In the code calls to civicrm_groups_get() are now civicrm_group_get(), not sure if that is an api change or not. Also, the form_values array changed so $form_state['checkboxes'] is now $form_state['values']['checkboxes'], line 185 in the original code.

I've attached the files here, it is tested and works on
Drupal 6.5
CiviCRM 2.1 beta6

I need the list of fields to be configurable by a client without going into module file and allow them to use custom fields. Hence, I'm going to change the ways the the list of fields appears to allow users to change available fields. Going to try getting the list of available fields from a profile.

I'll post that code back here as a patch.

joachim’s picture

> I need the list of fields to be configurable by a client without going into module file and allow them to use custom fields. Hence, I'm going to change the ways the the list of fields appears to allow users to change available fields. Going to try getting the list of available fields from a profile.

I'd suggest you make an admin page for the module, where you provide checkboxes for all those fields, and store the array currently hardcoded in _civi_organization_node_civi_fields as a drupal variable.