Index: views/rsvp.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rsvp/views/Attic/rsvp.views.inc,v
retrieving revision 1.1.2.7
diff -u -p -r1.1.2.7 rsvp.views.inc
--- rsvp.views.inc	1 Jun 2009 23:20:31 -0000	1.1.2.7
+++ rsvp.views.inc	21 Sep 2009 13:41:50 -0000
@@ -82,6 +82,24 @@ function rsvp_views_data() {
     ),
   );
   
+  $data['rsvp']['rsvp_manage_page'] = array(
+    'title' => t('RSVP manage page'),
+    'help' => t('Provide a link to the RSVP send/manage page.'),
+    'real field' => 'rid',
+    'field' => array(
+      'handler' => 'rsvp_views_handler_field_rsvp_rsvp_manage_page',
+    ),
+  );
+  
+  $data['rsvp']['rsvp_send_message'] = array(
+    'title' => t('RSVP send group message page'),
+    'help' => t('Provide a link to the RSVP send group message page.'),
+    'real field' => 'rid',
+    'field' => array(
+      'handler' => 'rsvp_views_handler_field_rsvp_rsvp_send_message',
+    ),
+  );
+  
   $data['rsvp']['uid'] = array(
     'title' => t('Organizer Id'),
     'help' => t('The user Id of the organizer who created the invitation.'),
@@ -186,12 +204,12 @@ function rsvp_views_data() {
     ),
   );
   
-/*  
+/*
   $data['rsvp']['total_rsvps'] = array(
     'title' => t(' Total Invitations'),
     'help' => t('Display total number of Invitations for the node.'),
     'field' => array(
-      'handler' => 'rsvp_views_handler_field_rsvp_total_rsvps',
+      'handler' => 'rsvp_views_handler_field_rsvp_invite_total_invites',
       'click sortable' => true,
     ),
 //          'sort' => array(
@@ -200,7 +218,7 @@ function rsvp_views_data() {
 //        ),
         
   );  
-*/  
+*/ 
   
   
   
@@ -221,6 +239,11 @@ function rsvp_views_data() {
       'numeric' => TRUE,
       'validate type' => 'rid',
     ),
+    'relationship' => array(
+      'base' => 'rsvp',
+      'handler' => 'views_handler_relationship',
+      'label' => t('rid'),
+    ),
 /*
     'filter' => array(
       'handler' => 'views_handler_filter_numeric',
@@ -262,6 +285,16 @@ function rsvp_views_data() {
       'help' => t('Email address of the user who received an invitation.') .' <strong>'. t('WARNING: only expose this data in a view that is restricted to users whom you can trust with such sensitive information.') .'</strong>',
     ),
   );
+  
+  $data['rsvp_invite']['email_prefix'] = array(
+    'real field' => 'email',
+    'title' => t('Invitee email address prefix'),
+    'help' => t('The section of the invitee email before the @ symbol, rendered with punctuation removed.'),
+    'field' => array(
+      'handler' => 'rsvp_views_handler_field_user_mail_prefix',
+      'help' => t('The section of the invitee email before the @ symbol, rendered for human display.'),
+    ),
+  );
 
   $data['rsvp_invite']['hash'] = array(
     'title' => t('Invitee hash'),
@@ -269,6 +302,32 @@ function rsvp_views_data() {
       'handler' => 'rsvp_views_handler_field_rsvp_invite_hash_link',
       'help' => t('Hash of the user who received an invitation.'),
     ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+      'field' => 'hash', // the field to use.
+      'name table' => 'rsvp', // the table to display in the summary.
+      'name field' => 'name', // the field to display in the summary.
+      'validate type' => 'hash',
+      'help' => t('Hash of the user who received an invitation, can be used to filter on invitation pages.'),
+    ),
+  );
+  
+  $data['rsvp_invite']['invitee_remove'] = array(
+    'title' => t('Remove invitee link'),
+    'real field' => 'hash',
+    'field' => array(
+      'handler' => 'rsvp_views_handler_field_rsvp_invite_remove_link',
+      'help' => t('Provide a link to remove the invitee from the event.'),
+    ),
+  );
+  
+  $data['rsvp_invite']['invitee_message'] = array(
+    'title' => t('Message invitee link'),
+    'real field' => 'hash',
+    'field' => array(
+      'handler' => 'rsvp_views_handler_field_rsvp_invite_message_link',
+      'help' => t('Provide a link to send a message to the invitee.'),
+    ),
   );
   
   $data['rsvp_invite']['rsvp_user_invited'] = array(
@@ -293,8 +352,75 @@ function rsvp_views_data() {
       'label' => t('Response:'),
     ),
   );
+  
+  $data['rsvp_invite']['timestamp'] = array(
+    'title' => t('Invitation timestamp'),
+    'help' => t('The last time this invitation was updated by either creator or invitee.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+      'help' => t('The last time this invitation was updated by either creator or invitee.'),
+      'label' => t('Invitation timestamp'),
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+      'help' => t('Sort by the last time this invitation was updated by either creator or invitee.'),
+    ),
+  );
+  
+  $data['rsvp_invite']['time_sent'] = array(
+    'title' => t('Invite send date'),
+    'help' => t('Date when the invitation was sent.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+      'help' => t('Date when the invitation was sent.'),
+      'label' => t('Invite send date'),
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+      'help' => t('Sort by when the invitation was sent.'),
+    ),
+  );
+  
+  $data['rsvp_invite']['time_respond'] = array(
+    'title' => t('Invitee response time'),
+    'help' => t('Date when the invitee last responded.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+      'help' => t('Date when the invitee last responded'),
+      'label' => t('Invitee response time'),
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+      'help' => t('Sort by when the invitee last responded.'),
+    ),
+  );
+  
+  $data['rsvp_invite']['mailing_list'] = array(
+    'title' => t('Mailing List'),
+    'help' => t('Whether the invitee signed up for the mailing list.'),
+    'field' => array(
+      'handler' => 'views_handler_field_boolean',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_boolean_operator',
+      'help' => t('Whether the invitee signed up for the mailing list.'),
+      'label' => t('Mailing List'),
+    ),
+  );
 
-/*  
+/* 
   $data['rsvp_invite']['total_invites'] = array(
     'title' => t('Total number of guests'),
     'help' => t('Display total number of guests for all invitations on the node.'),
@@ -307,7 +433,7 @@ function rsvp_views_data() {
 //          ),
 
   );    
-*/  
+*/
 
  
   return $data;
@@ -341,13 +467,27 @@ function rsvp_views_handlers() {
       'rsvp_views_handler_field_rsvp_rid' => array(
         'parent' => 'views_handler_field',
       ),
+      'rsvp_views_handler_field_user_mail_prefix' => array(
+        'parent' => 'views_handler_field',
+      ),
+      'rsvp_views_handler_field_rsvp_invite_remove_link' => array(
+        'parent' => 'views_handler_field',
+      ),
+      'rsvp_views_handler_field_rsvp_invite_message_link' => array(
+        'parent' => 'views_handler_field',
+      ),
+      'rsvp_views_handler_field_rsvp_rsvp_manage_page' => array(
+        'parent' => 'views_handler_field',
+      ),
+      'rsvp_views_handler_field_rsvp_rsvp_send_message' => array(
+        'parent' => 'views_handler_field',
+      ),
       
 /*      'rsvp_views_handler_field_rsvp_total_rsvps' => array(
         'parent' => 'views_handler_field',
       ),
-*/
             
-/*      'rsvp_handler_field_rsvp_invite_total_invites' => array(
+      'rsvp_views_handler_field_rsvp_invite_total_invites' => array(
         'parent' => 'views_handler_field',
       ),
       'rsvp_handler_field_rsvp_invite_total_invites' => array(
Index: views/rsvp_views_handler_field_rsvp_invite_message_link.inc
===================================================================
RCS file: rsvp_views_handler_field_rsvp_invite_message_link.inc
diff -N rsvp_views_handler_field_rsvp_invite_message_link.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rsvp_views_handler_field_rsvp_invite_message_link.inc	21 Sep 2009 13:41:50 -0000
@@ -0,0 +1,20 @@
+<?php
+
+class rsvp_views_handler_field_rsvp_invite_message_link extends views_handler_field {
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $form['link_text'] = array(
+      '#title' => t('Text for link'),
+      '#type' => 'textfield',
+      '#default_value' => isset($this->options['link_text']) ? $this->options['link_text'] : 'Send Message',
+    );
+  }
+  
+  function render($values) {
+    $value = $values->{$this->field_alias};
+    $rid = $values->rid;
+    return l($this->options['link_text'], 'rsvp/'. $rid .'/message/'. $value);
+  }
+
+}
\ No newline at end of file
Index: views/rsvp_views_handler_field_rsvp_invite_remove_link.inc
===================================================================
RCS file: rsvp_views_handler_field_rsvp_invite_remove_link.inc
diff -N rsvp_views_handler_field_rsvp_invite_remove_link.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rsvp_views_handler_field_rsvp_invite_remove_link.inc	21 Sep 2009 13:41:50 -0000
@@ -0,0 +1,20 @@
+<?php
+
+class rsvp_views_handler_field_rsvp_invite_remove_link extends views_handler_field {
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $form['link_text'] = array(
+      '#title' => t('Text for link'),
+      '#type' => 'textfield',
+      '#default_value' => isset($this->options['link_text']) ? $this->options['link_text'] : 'Remove',
+    );
+  }
+
+  function render($values) {
+    $value = $values->{$this->field_alias};
+    $rid = $values->rid;
+    return l($this->options['link_text'], 'rsvp/'. $rid .'/attendees/remove/'. $value);
+  }
+
+}
\ No newline at end of file
Index: views/rsvp_views_handler_field_rsvp_rsvp_manage_page.inc
===================================================================
RCS file: rsvp_views_handler_field_rsvp_rsvp_manage_page.inc
diff -N rsvp_views_handler_field_rsvp_rsvp_manage_page.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rsvp_views_handler_field_rsvp_rsvp_manage_page.inc	21 Sep 2009 13:41:50 -0000
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Field handler to provide a link to the RSVP send/manage page for a certain RSVP id
+ *
+ * @ingroup views_field_handlers
+ */
+class rsvp_views_handler_field_rsvp_rsvp_manage_page extends views_handler_field {
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['link_text'] = array('default' => '');
+
+    return $options;
+  }
+
+  /**
+   * Provide link text.
+   */
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $form['link_text'] = array(
+      '#title' => t('Link Text'),
+      '#type' => 'textfield',
+      '#default_value' => $this->options['link_text'],
+    );
+  }
+
+  function render($values) {
+    $value = 'rsvp/'. $values->{$this->field_alias} .'/attendees';
+    if (!empty($values->{$this->field_alias})) {
+      return l($this->options['link_text'], $value, array('html' => TRUE));
+      
+    }
+  }
+}
\ No newline at end of file
Index: views/rsvp_views_handler_field_rsvp_rsvp_send_message.inc
===================================================================
RCS file: rsvp_views_handler_field_rsvp_rsvp_send_message.inc
diff -N rsvp_views_handler_field_rsvp_rsvp_send_message.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rsvp_views_handler_field_rsvp_rsvp_send_message.inc	21 Sep 2009 13:41:50 -0000
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Field handler to provide a link to the RSVP send/manage page for a certain RSVP id
+ *
+ * @ingroup views_field_handlers
+ */
+class rsvp_views_handler_field_rsvp_rsvp_send_message extends views_handler_field {
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['link_text'] = array('default' => '');
+
+    return $options;
+  }
+
+  /**
+   * Provide link text.
+   */
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $form['link_text'] = array(
+      '#title' => t('Link Text'),
+      '#type' => 'textfield',
+      '#default_value' => $this->options['link_text'],
+    );
+  }
+
+  function render($values) {
+    $value = 'rsvp/'. $values->{$this->field_alias} .'/message';
+    if (!empty($values->{$this->field_alias})) {
+      return l($this->options['link_text'], $value, array('html' => TRUE));
+      
+    }
+  }
+}
\ No newline at end of file
Index: views/rsvp_views_handler_field_user_mail_prefix.inc
===================================================================
RCS file: rsvp_views_handler_field_user_mail_prefix.inc
diff -N rsvp_views_handler_field_user_mail_prefix.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rsvp_views_handler_field_user_mail_prefix.inc	21 Sep 2009 13:41:50 -0000
@@ -0,0 +1,28 @@
+<?php
+// $Id: views_handler_field_user_mail.inc,v 1.1 2008/09/03 19:21:30 merlinofchaos Exp $
+/**
+ * Field handler to provide acess control for the email field
+ */
+class rsvp_views_handler_field_user_mail_prefix extends views_handler_field {
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $form['remove_punctuation'] = array(
+      '#title' => t('Replace punctuation with spaces'),
+      '#type' => 'checkbox',
+      '#default_value' => $this->options['remove_punctuation'],
+    );
+  }
+
+  function render($values) {
+    $punct_chars = array('.', '-', '_');
+    $email = $values->{$this->field_alias};
+    $pos = strpos($email, '@');
+    $prefix = substr($email, 0, $pos);
+    $prefix_nopunc = str_replace($punct_chars, ' ', $prefix);
+    if ($this->options['remove_punctuation']) {
+      return $prefix_nopunc;
+    }
+    return $prefix;
+  }
+}
\ No newline at end of file
