Is it possible to see who invited a given user and who was invited by that user?

Comments

smk-ka’s picture

If you mean an admin page showing all invites then no, that's not implemented (yet). Would you be able to do it?
--
Stefan Kudwien
unleashed mind

ola90@drupal.ru’s picture

Unfortunately, I would not (yet). I'm a beginner.

smk-ka’s picture

Title: Tracking invites » Invite admin overviews/tracking invites
Component: Miscellaneous » Code
Category: support » feature
Status: Active » Postponed

A note for myself: evaluate if this can be done through Views support.

jcruz’s picture

I would be interested in this as well.

smk-ka’s picture

Status: Postponed » Active
smk-ka’s picture

Version: 5.x-1.x-dev » 5.x-2.x-dev
Assigned: Unassigned » smk-ka
icecreamyou’s picture

I'm interested in this too. Doing it with views would be most flexible for administrators, but hardcoding it would allow for a "View all invitations" permission (of course, now that I think about it, individual views can be restricted to certain permission levels too). It doesn't seem to me that it would be difficult to add a hardcoded page--it would just be a few DB calls, and I think the code for this is already mostly existent anyway because each user already has their "Pending" page.

Fixer-1’s picture

I've tried using views. I don't see the fields available to create a query on invitations. Am I missing something?

ekrispin’s picture

Meanwhile you can browse the table "invite" in the database and see who invited whom.

"email" field is the invitee. "uid" is the user id of the inviter.

icecreamyou’s picture

Good call, ekrispin, I should have thought of that earlier. Knowing that though it seems like it wouldn't be a big deal to just use some PHP on a page to show what's in the database... can we come up with that code here for a better temporary solution?

icecreamyou’s picture

It looks like this module does what we're asking for: http://drupal.org/project/invite_site_report

I haven't tested it though.

If you just want a simple block to tell you accepted/pending/expired/total invites though, you can use this:

  $sql = "SELECT * FROM {invite} WHERE received = 1";
  $result = db_num_rows(db_query($sql));
  $accepted = "<strong>Accepted Invitations:</strong> $result";

  $xtimex = time();
  $sql = "SELECT * FROM {invite} WHERE expiry > $xtimex && received = 0";
  $result = db_num_rows(db_query($sql));
  $pending = "<strong>Pending Invitations:</strong> $result";

  $sql = "SELECT * FROM {invite} WHERE expiry < $xtimex && received = 0";
  $result = db_num_rows(db_query($sql));
  $expired = "<strong>Expired Invitations:</strong> $result";

  $sql = "SELECT * FROM {invite} WHERE 1";
  $result = db_num_rows(db_query($sql));
  $total = "<strong>Total Invitations:</strong> $result";

  echo "$accepted<br />$pending<br />$expired<br />$total";

Looking at this code now I suppose you could optimize it by just echo-ing your results instead of storing them to variables and displaying them later. Oh well--you get the idea.

ckng’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Cleaning out old issues.