Active
Project:
Signup
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2011 at 16:15 UTC
Updated:
31 May 2012 at 17:45 UTC
I need a help I need create a more fields on the enter a more information than defauld. I need add new fields for example first name, last name, phone number, pasport number, etc. It is possible create other fields than defaulds? thank and sorry for my bad english so i wery need your help.
regards,
Comments
Comment #1
flightrisk commentedI also want to know where these default fields come from (user name, email and phone) and how to add to them like "how many will attend" and "what food you will bring" for an event type node.
Comment #2
macmaci commentedI have the same issue. Is there a way that webform can be integrated so that an Admin can add these fields as well? Also there would need to be different signup forms based on the event.
Thanks so much for your help.
Comment #3
jordojuice commentedI think #2 is what needs to happen. But something like this would probably have to go into a separate module. There's an issue at #1405868: signup integration with webform about webform integration.
Comment #4
buddakid commentedI add comment here because I have partial answers to questions above, but need assistance for the coding.
I need to add additional fields to signup for employees, and include those additional fields to the email confirmation to the event author and the one who signs up. Those fields are more for a complete user profile, such as Department and Position. Therefore, those fields are best to be added to User Profile other than signup form. I’ve added those fields to the User Profile. And, Signup Profile module and Profile Token were installed. (The Webform module 6 x 3.17 and Webform Events 6 x 1.4 require at least Drupal core 6.16; and therefore, they are not compatible with my Drupal 6.14.)
Replacement pattern for the fields are [node:profile_dept], [node:profile_position]
I added those replacement patterns to the content of Confirmation Email in the Signup configuration. The email confirmation that sends to the user contains the input all right. However, the input is missing in the email confirmation that sends to the event author.
It looks like additional code has to be added to signup/theme/email.inc. The possible places to add are as follows. I"m not a Drupal coder. Can someone help me out with coding? Maybe new function is needed? Thanks much.
function theme_signup_email_token_custom_data($signup_data) {
return t('SIGNUP INFORMATION') ."\n\r". theme('signup_custom_data_email', $signup_data);
}
function theme_signup_custom_data_email($data) {
$output = '';
// Loop through each first level element.
foreach ($data as $key => $value) {
if (is_array($value)) {
// Element is nested, render it recursively.
// Instead of the overhead of theme(), just call ourself directly.
$output .= "\n\r". call_user_func(__FUNCTION__, $value) ."\n\r";
}
else {
$output .= theme('signup_custom_data_field_text', $key, $value) ."\n\r";
}
}
return $output;
}
Comment #5
dwwSee point #2 in the INSTALL.txt file that ships with the signup module. That describes the (totally lame) way that the D6 version of signup lets you customize this form.
#29568: Flexible number and type of fields was the ancient issue where this was discussed for years. There's an abandoned 6.x-2.x branch that tries to deal with that, but sadly the author of that code went on to other things and so I can't recommend you upgrade to 6.x-2.x since it's full of bugs and there will be no migration path.
In D7, see http://drupal.org/project/registration and #1285384: Entity based registration module for Drupal 7 which is closer to the "right way" to solve this problem.
Cheers,
-Derek
Comment #6
buddakid commentedThank you very much for taking time to give your precious advice, Derek.
I've switched the status to active to see if I can get more suggestions, if it's ok.
I see the way the registration form does in Signup 7. Though, it may not fulfill what I need.
1. The signup form is for classes that held regularly for employees in a company; therefore, it's not efficient to have user enter those user information per signup. That's why I add those fields into User Profile.
2. The input has to be enclosed in the email confirmation to the event author.
3. The signup summary has to be ordered by full name, not user name, so that the signup list can be exported to a spread sheet as a signup roster. Employees who attend the class will be required to sign on the roster; therefore, it’s imperative to let them find their last names quick.
The logic problems with adding add those fields to signup/theme/signup_form.inc:
function theme_signup_user_form($node) {
$form['signup_form_data']['#tree'] = TRUE;
// for example
$form['signup_form_data']['Department'] = array(
'#type' => 'textfield',
'#title' => t('Department'),
'#size' => 40, '#maxlength' => 64,
'#required' => TRUE,
);
The pros, those fields are enclosed to both email confirmations. The cons, those fields are stored as one field (as user additional info); therefore, they appear as a group under one column in signup summary. And, this column is not sortable.
It seems that I end up with the options:
1. Customize in the email.inc which is what I’m trying to do. (because input in User Profile in not enclosed in email confirmation.)
2. As instruction in install.txt, define own version of theme_signup_user_form() in my site's theme (e.g. as phptemplate_signup_user_form()), and hope those fields will be listed as one column per field in the signup summary.
I read the code provided by Michael_kirk in #20 https://drupal.org/node/29568 : add fields based on specific node signups or taxonomy terms. My feeling is that those fields will still end up as a group in one column as they are all coded as $form[signup_form_data]. The Signup module treats [signup_form_data] as one field no matter how many additional fields are added to the array.
I’ve read somewhere that instructs how to define own theme. I need to do more research on that, but I wish to be able to do it in the email.inc. It’s the most easy and efficient way in my case since I am able to have each field in one column when I extract input from User Profile in a customized signup summary generated by Views. Thanks.