Hello, sorry if this is a question with an obvious answer...

I am creating a site in which I would like to enable group owners to add or remove their own contact form.

The only way I could find to create/remove the form, however, seems to be in the "OG Contact form" admin page; that page can only be accessed via the "administer og contact form" permission, but that enables people to change all contact forms site-wide, which is too much.

It would be most excellent if there was a "Manage contact form" line in the OG block, appearing for the group owner (if the "administer group contact form" is set), linking to a similar "Edit contact form" page as now, but with an additional option to add or remove the form was added.

Maybe there is a different way to accomplish that right now, however... but I couldn't find how. Thanks for any comments!!

Comments

gnat’s picture

Category: support » feature

I'm changing this to "feature request" because what you want to do is currently not supported by the module. However, I think that the module should do what you are trying to do, or something close.

I'm torn between two basic options, perhaps your feedback can help point me in a direction. Option one looks something like this: Very little change is made to the module, if "administer group contact form" is set there is a delete button on the bottom of the edit page, and if there is not contact form an "add contact form" link where the edit page should be.

Option two: Instead of adding and deleting the form, group admins could enable/disable the form, but keeping the record in the database. This would require adding a status field to the db table, and add a whole layer of complexity that doesn't currently exist. However it will add a bunch of flexibility in that contact forms could both be in the db, but turned off (sort of like an unpublished node).

Option one is certainly easier (for me anyway), but I have the nagging feeling like its not the best design choice. Option two would certainly break up that difference between the group admins and the site admins, and keep group admins from accidentally blowing away their contact form. It could also allow site admins to temporarily turn off contact forms without losing that form's data.

As far as putting links in the OG block, that may very well be possible - I need to look in to doing that, I'm just not sure.

Anyway, let me know if either of these options sound good. If you are a coder, I'm happy to take patches once we've figured out the right model for this change. Thanks for the request.

rismondo’s picture

Hello gnat,
Thank you for considering this feature!

Adding further flags and layers might be a bit overkill, in general I would expect people to enable or disable their form only occasionally. Further, even if the contact form content was lost, the contect can be easily recreated. So, I would say that simply creating/removing the form would be appropriate.

Adding a link to the OG block can be done quite easily (the module "OG Forum" does something similar). In this case it would look like:

function og_contact_og_create_links($group) { 
  global $user;
  $links = array();
  // Add management link for the group managers
  if (og_contact_can_edit_group_settings($group)) { 
    $links['manage_og_contact'] = l(t('Manage contact form'), 'node/' . $group->nid . '/contact/edit', array('attributes' => array('title' => t('Lets you add, edit, or remove the group\'s contact form.'))));
  }
  return $links;
} // function og_contact_og_create_links()

except that the link should point to a page asking for creation if the form doesn't exist. Once that is in place, it is sufficient to add a "delete" button on the edit page; the link to the edit page on the contact form proper is then no longer necessary.
Hope this helps! Thanks

gnat’s picture

Status: Active » Postponed

I still think this is a good idea, but won't be making it to a D6 release ever.

However, it may likely make it into the upcoming D7 release, but probably not in the first round of porting.

gnat’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Given the new permissions model in OG, this feature seems much easier to deliver, as we can now scope permissions to a particular group.

There are several D7 issues that need to be solved first, but this is definitely a feature OG Contact needs.