Automatic Attend

Mark_Watson27 - June 12, 2009 - 19:35
Project:RSVP
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:ulf1
Status:active
Description

Hello,

Fantastic module by the way I'm using it on our Jersey Round Table website (www.jerseyroundtable.com). In Round Table people just have to respond if they can't make an event. So I just wondered if it would be relatively easy to automatically mark the guests as attending but still give them the option to not attend via the usual methods.

I've spotted the following in _rsvp_function_add_guests
              if (db_query('INSERT INTO {rsvp_invite} (rid, inviteehash, email, hash, timestamp, response, comment, totalguests) VALUES (%d, \'%s\', \'%s\', \'%s\', %d, \'%s\', \'%s\', %d)', $rid, $owner_hash, $string, $hash, time(), 'none', '', 1)) {

Would it just be a matter of changing 'none' to 'yes'. I realise this would be hard-coding the response but don't know enough to create an default option for this.

Many Thanks

Mark Watson

#1

ulf1 - June 12, 2009 - 21:06
Assigned to:Anonymous» ulf1

Hi Mark,

Glad you like the module.

You are right on track. Changing the value from 'none' to 'yes' will preset all guests that you add as attendants.
Be careful. _rsvp_function_add_guests contains two!! INSERT statements. Make sure you change the value for both.

Those guests with yes as reply should still show up in the list of guests that you need to send an invitation to, which you probably want.

I will consider this topic as a feature for a future release.

Thanks,
Ulf

#2

Mark_Watson27 - June 12, 2009 - 21:21

Hello Ulf,

I've altered the code already and tested, seems to work fine, although I did get a minor problem when I deleted the invitation.
I'll do some further testing and let you know of any problems. I changed the second statement only as I'd like guests to have to mark attending but users to be automatically set as attending.

If I ever use your module for a website that isn't not-for-profit then I'm certain I'll be paypal'ing a donation.

Thanks again

Mark

#3

Mark_Watson27 - September 21, 2009 - 20:48

Hello Ulf,

It's been a while :)

I altered the DB structure for rsvp table to include a response_default field of varchar(128).
I then altered the form to include a select list of Yes/No/Maybe/None for the response_default and altered the rsvp_addedit_form_submit to pass this on to the rsvp_function_update_rsvp and rsvp_function_create_rsvp via the $rsvp to store in the database.
Then I altered the _rsvp_function_add_guests to get the response_default from the $rsvp and used this in the INSERTs as the response.

Although not fully tested it seems to works for me, so if you're interested I'll grep the differences and post a patch.

Thanks
Mark

 
 

Drupal is a registered trademark of Dries Buytaert.