CVS edit link for Jakob Stoeck

Hi,

The Organic Group module lets you invite other users to a group. Sadly, those invites are not saved in the database.

This module saves OG invitations persistently in a database and lets you use them for messages like "You have 3 pending group invites".

The module is fully working and is activated on http://www.balanceonline.org/. In the future I plan to add German translations and block/view support.

This functionality is not in any other module of which I know. An issue I created in the OG project: http://drupal.org/node/771138 (the code in this issue is old, please review the new code).

Best, Jakob

CommentFileSizeAuthor
#1 og_invite.zip9.28 KBJakob Stoeck

Comments

Jakob Stoeck’s picture

StatusFileSize
new9.28 KB

og_invite

  • og_invite.info
  • og_invite.install
  • og_invite.module
  • README.txt

Usage

After installation of the Organic Groups and OG Invite module use og_invite_load_pending() to get all invitations for the current user.

Example

// og/all page view needs to be extended for multiple arguments
if($og_invites = og_invite_load_pending()) {
  $link = l(format_plural(count($og_invites), '1 new group invite', '@count new group invites'), 'og/all/' . implode(',', array_keys($og_invites)));
}

print $link;
Jakob Stoeck’s picture

Status: Postponed (maintainer needs more info) » Needs review
sun’s picture

Shouldn't this rather be added to http://drupal.org/project/invite ?

avpaderno’s picture

Reading the Invite module page, I notice there is a reference to a branch that would contain a module called OG invite (I know; the development is not done on Drupal.org). Would not be possible to cooperate with that?

avpaderno’s picture

Status: Needs review » Needs work

I am changing status as per previous comments.

Jakob Stoeck’s picture

@kiamlaluno: In the thread you are speaking of, there is only a patch to og which was put to won't fix http://drupal.org/node/170332#comment-2423346 because there should be a module.

@sun: Isn't the Invite module for this use case: a registered user invites an unregistered one to a drupal website.
The OG Invite module is for organic group invites, not the website. I don't think they should depend on each other.

avpaderno’s picture

@Jakob Stoeck: I was referring to the project page of the Invite module.

Jakob Stoeck’s picture

Would you give me a hint? The only mention on the Invite module page I see is the aforementioned thread which is on won't fix.

avpaderno’s picture

There is an experimental 3.x version on GitHub, aiming at splitting the module to allow for pluggable invite sub-systems

I am sorry; I was referring to that part. I take the link was placed just to make an example of possible sub-module that could be created.

Jakob Stoeck’s picture

Could you please elaborate why this plug in should use the Invite module? The version on Github http://github.com/smk/invite is only for site invites. This is a completely different use case.

Invite module:
You can invite someone to register for your website. (with the new branch on Github you get hooks for that event)

OG Invite module:
You invite a registered (or unregistered) user to an organic group.

The OG Invite module is used to get Facebook-like messages when you log in, e.g. a message on the frontpage: "You have been invited to the Example Group". That's completely different to the purpose of the Invite module which sends an email to an unregistered user. I don't see an advantage in combining those modules but I'll open an issue there asking for a possible collaboration.

avpaderno’s picture

Status: Needs work » Needs review
Issue tags: +Module review

The OG Invite module is used to get Facebook-like messages when you log in, e.g. a message on the frontpage: "You have been invited to the Example Group".

That makes clearer what is the difference between the proposed module, and the Invite module.

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.

avpaderno’s picture

Status: Needs review » Fixed

Schema descriptions are not passed to t().

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

YK85’s picture

Status: Closed (fixed) » Needs work

I'm guessing #14 was suppose to be 'needs review'=>'needs work'?
I hope OG Invite module is added. Many thanks!

avpaderno’s picture

Status: Needs work » Fixed

I apologize for not being explicit: The status is the correct one, as I have already approved the CVS account. What I reported is what it needs to be changed, but it isn't an application stopper.

avpaderno’s picture

Status: Fixed » Closed (fixed)

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

charles.holtzkampf’s picture

Hi,

Wonder if anyone can offer some advice, if installed the module and enabeld it.

I then created a block containing the code as specified in the README:

<?php
if(module_exists('og_invite')) {
  // gets invites to a group
  // og/all page view needs to be extended for multiple arguments
  if($og_invites = og_invite_load_pending()) {
  $approve[] = l(format_plural(count($og_invites), '1 new group invite', '@count new group invites'), 'og/all/' . implode(',', array_keys($og_invites)));
  }
}
?>

I added that block to the profile page. However it nevers displays any invitations ? Im not sure what im doing wrong, im not a programmer, bu would really like to implement this on my site.

Any advice anyone can offer wold be greatly appreciated.

Isostar’s picture

Charles, you need to add the following line:

print theme('item_list', $approve);

Isostar’s picture

Will this module be further developed?

There is still missing/broken functionality.

To add notice for users that were not user on the time of invitation the query should be:

$invitations = db_query('SELECT * FROM {og_invite} WHERE invitee = %s OR (invitee=0 AND email= "%s") AND response = "none"', $uid,$user->mail);

It's not possible to deny invitations, og_invite_set_response($gid, 'no') is not triggered anywhere in the code.

timoguic’s picture

Component: Miscellaneous » miscellaneous

Interested to see the development of this module too!

avpaderno’s picture

Component: miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

I am giving credits to the users who actively participated in this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.