Flexible number and type of fields

birken@drupal.t... - August 24, 2005 - 18:09
Project:Signup
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'd like to see the ability to choose for each signup which fields to ask for from the user.

For instance, sometimes a phone number would come in handy, while other times gender would be helpful (e.g. if making room plans for an extended conference).

I have no idea if this is possible with the current database configuration. Just dreaming out loud here :-)

#1

hunmonk - September 25, 2005 - 18:14

something like this is currently planned for the 4.7 version of signup--stay tuned!

#2

hunmonk - February 2, 2006 - 06:22
Status:active» postponed

i'm looking at the ever-growing amount of feature requests for this module, and two things are becoming apparent:

  1. there are lots of use cases for it, and lots of people interested in using it
  2. it's poised to become a spaghetti mess of code if we don't come up w/ a solid core/plugin approach

thus, i'm postponing the addition of any new features until i've had a chance to think this through and talk w/ some other developers. i've scheduled a meeting at the upcoming conference w/ the co-creator of signup module, and hopefully we can hash most of this out soon.

#3

liquidcms - November 23, 2006 - 10:45

seems like a pretty old post.. but not sure headway on this.. i pretty sure it must be most important feature request for signup - "what singup info do we need?"

if this discussion has moved somewhere else; maybe some can point me to it

thanks,

#4

leoklein - November 23, 2006 - 16:40

Well, since we're on the subject...

Integration with a chosen CiviCRM profile would be my dream solution. 'Volunteer' does it that way.

During the election, we were carpooling to various campaign offices from two different locations (Chicago & Evanston). So as part of our sign-up process we had to know what "pick-up" point the person preferred and whether they had a car. That's two radio option groups right there. Then a box for comments.

#5

hunmonk - November 24, 2006 - 03:13

keep in mind that the current form for signup module can be quite flexible, if you're willing to dig into the code a bit.

#6

nschelly - November 20, 2007 - 02:28

I'd still like see a feature like this, so if it happens, I'm subscribed to the thread...
-N

#7

mdowsett - February 1, 2008 - 21:24
Version:4.6.x-1.x-dev» 5.x-2.3

Changing the theme isn't too bad, easier than I thought with my limited coding abilities. But it'd be nice to empower the node owner with the ability to change their form as they seem fit rather than having one blanket form for all events on the site.

And the necessity to have it configurable within the Drupal interface is key.

If you can use the power of the forms module to give the user the option to add fields would be ideal.

#8

dww - February 1, 2008 - 21:35

Right. Esteemed Drupalist starbow hacked signup.module to use forms.module at one point for the BADCamp site. He's told me privately he's planning to clean up his hack and submit it as a patch so I can include it in the "upstream" version...

#9

mdowsett - February 2, 2008 - 17:02

That would be sweeeet. I still find it amazing the possabilities Drupal allows with it's flexibility.

I look forward to this integration and use the theming for not to get me by

#10

pelicani - April 11, 2008 - 20:58
Status:postponed» active

I'd like to suggest we make this a bit more active.

If starbow is following, and has that code, please post it or contact me.
I'm going to begin researching how to do the do you did.
; )

This feature is something we want to get rolling on.
We would event consider working on the CiviCRM piece, we actually already have that hacked together.

There is a themable function that controls the form displayed on screen.
If you add elements to this form, the serialized data will be updated.
My desire, would be to get that form data into any admin form, so it can be modified within drupal.
Once I start to play with the themable function, I'd like to build a module to handle the customization of this form.

Please post any comments/concerns.

#11

duellj - July 25, 2008 - 18:25

@ dww:

Bummer that forms.module is no longer supported. Maybe there's another way. There's always the signup-as-a-CCK-node approach I outlined here: http://groups.drupal.org/node/3430

I had thought about using CCK to accomplish this problem, using fields with multiples enabled and somehow mapping each users response to these fields for each Signup node. I see a couple problems with this, though:

-How do you associate certain CCK fields to the signup form, while maintaining others for just the node? This could maybe be accomplished by defining a new CCK field type that's essentially a fieldset that you could then add additional fields to (not sure if this is possible with CCK). But would this then allow users to create multiple signups per node?

-How to go about associating a user with a signup node, and all of the user submitted fields? Since CCK stores multiple fields in a separate table, and only uses nid to reference back to the main node, would it be enough to create a hidden user reference fields, and use the position of the user field (delta) to associate that user to the corresponding signup fields? What if a user doesn't fill out one of the fields?

Another approach could be the way Webform solved a similar problem: creating custom form components that are added directly in the node edit area, the results of which are stored in a one-to-many table for each submission of the webform. It would be too bad to repeat ourselves, but I think this would be the easiest way to get the functionality.

#12

starbow - July 26, 2008 - 09:11

Well, I remember trying and failling to embed webform 1.x into the signup process, but I will give the 2.x branch a look to see if it is more embedable.

#13

duellj - August 1, 2008 - 01:27

@starbow:

Any luck with webform 2.x? I might have a little time to look into this, but I don't want us to repeat ourselves. Were you looking into having webform as a dependency of Signup? Or were you looking into borrowing the code from webform to integrate directly into the signup module?

#14

starbow - August 1, 2008 - 17:07

If you've got the time, go for it. It is half way down my todo list, so I don't know when I will have a chance myself.
It would be better to have a dependence on webform vs snagging their code, in terms of long term maintenance.

#15

obsidiandesign - August 2, 2008 - 16:49

Subscribing
@duellj - I'm looking to do the same thing; experimenting a bit here myself as I'm on a time crunch. If you'd like to collaborate, drop me a line.

#16

obsidiandesign - August 3, 2008 - 03:53

While it's currently kind of hacked into the signup code, I am able to report that signup 5.x-2.4 + webform 5.x-2.1.2 can be used together. I need to clean things up a bit & make the webform selectable through the administrative interface, but it does submit, verify, and enter the database correctly. I also need to work on displaying the webform output when examining signup records. I'll be in touch with duellj next week, and I'll see what we can get towards a patch.

#17

PatFrat - August 21, 2008 - 17:47

obsidiandesign,
Any progress in integrating signup&webform ?

This would be very helpful !

#18

twirlingsky - September 9, 2008 - 12:06
Version:5.x-2.3» 5.x-2.4

I need to add form fields to the signup module to collect addresses. Any idea about how to go about this?
I have sign up and sign up pay installed.

#19

dww - September 9, 2008 - 17:34
Version:5.x-2.4» 5.x-2.x-dev

@twirlingsky: Read the INSTALL.txt file shipped with the module. ;) You can already customize the signup fields, the only problem is that it's currently handled site-wide. This issue is specifically for working out a new feature of having flexible signup fields per node or node-type -- it's not meant as a support forum for everyone trying to customize signup for their own site. Thanks.

#20

jklsemicolon - September 19, 2008 - 16:57

A less rigorous, but simple solution, I've made a patch against HEAD (signup.module 1.144 and signup.theme version 1.13) so that the theme callback is passed the node including the signup form. In this way you can have a combination of fields used in every form, extra fields per node, and other things like extra fields per taxonomy term. This isn't as robust as webform, as we're still using the serialized array paradigm for storing all the user data.

After applying the patch, I can write a theme function looks like this:

<?php
function my_theme_signup_user_form($node = NULL) {

  global
$user;
 
$form = array();

 
// If this function is providing any extra fields at all, the following
  // line is required for form form to work -- DO NOT EDIT OR REMOVE.
 
$form['signup_form_data']['#tree'] = TRUE;

 
//these first two fields are for all signup forms
 
$form['signup_form_data']['Name'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Name'),
   
'#size' => 40, '#maxlength' => 64,
   
'#required' => true,
  );
 
 
$form['signup_form_data']['Phone'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Phone'),
   
'#size' => 40, '#maxlength' => 64,
  );

 
// If the user is logged in, fill in their name by default.
 
if ($user->uid) {
   
$form['signup_form_data']['Name']['#default_value'] = $user->name;
  }

 
//add fields to specific node signups
 
switch($node->nid){
    case
'2335':
     
$form['signup_form_data']['Age'] =  array(
       
'#type' => 'textfield',
       
'#title' => t('Age'),
       
'#size' => 3,
       
'#maxlength' => 3,
       
'#required' => TRUE,
      );
 
  }
 
 
 
//add fields based on other node properties, like taxonomy terms.
 
  //taxonomy term id for event nodes where food is served
 
define('FOOD_SERVED_TID', 2 );
 
 
//if we're serving food, gather dietary restrictions
 
if(isset($node->taxonomy[FOOD_SERVED_TID]) ){
   
$form['signup_form_data']['Food Restrictions'] = array(
     
'#type' => 'checkboxes',
     
'#title' => t('Dietary Restrictions'),
     
'#options' => array(
       
'vegetarian' => t('Vegetarian'),
       
'vegan' => t('Vegan'),
       
'diabetic' => t('Diabetic'),
       
'glutenfree' => t('No gluten'),
       
'halal' => t('Halal')
      ),
     
'#description' => t('Check any dietary restrictions, and we will do our best to accomodate you.'),
    );
  }
}
?>

AttachmentSize
signup_per_node.patch764 bytes

#21

pauldawg - October 1, 2008 - 05:21

Very interested in this feature and a port to d6

 
 

Drupal is a registered trademark of Dries Buytaert.