Email confirmation field added
This commit is contained in:
@@ -10,7 +10,7 @@ function _booking_paypal_post($data = array()) {
|
||||
return $post;
|
||||
}
|
||||
|
||||
|
||||
//see https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php for more details
|
||||
function _booking_paypal_ipn_verify($vars = array()) {
|
||||
|
||||
if (variable_get('booking_paypal_sandbox', 0)) {
|
||||
|
@@ -426,6 +426,17 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
||||
'#required' => TRUE,
|
||||
'#default_value' => !empty($data->booking_email) ? $data->booking_email : ''
|
||||
);
|
||||
|
||||
// Only confirm email address if the user is typing in their details
|
||||
if ($inserting == TRUE) {
|
||||
$form['contact-details']['booking_email_confirm'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Confirm e-mail address'),
|
||||
'#maxlength' => 100,
|
||||
'#required' => TRUE,
|
||||
'#default_value' => !empty($data->booking_email_confirm) ? $data->booking_email_confirm : ''
|
||||
);
|
||||
}
|
||||
|
||||
$form['contact-details']['booking_phone'] = array(
|
||||
'#type' => 'textfield',
|
||||
@@ -1119,6 +1130,15 @@ function _booking_validate($node, &$form_state) {
|
||||
$email = (isset($form_state['booking_email']) ? $form_state['booking_email'] : $node->booking_email);
|
||||
if (strlen(trim($email)) > 0 && !_valid_email_address($email))
|
||||
form_set_error('booking_email', t('You must enter a valid e-mail address. Please ensure you typed your email address correctly.'));
|
||||
|
||||
//make sure that the email confirmation field matches the first email address entry
|
||||
$email_confirm = (isset($form_state['booking_email_confirm']) ? $form_state['booking_email_confirm'] : $node->booking_email);
|
||||
$email = preg_replace( '/\s+/', '', $email );
|
||||
$email_confirm = preg_replace( '/\s+/', '', $email_confirm );
|
||||
if (strcasecmp($email, $email_confirm) !== 0)
|
||||
{
|
||||
form_set_error('booking_email', t('Your email address does not match. Please ensure you typed your email address correctly.'));
|
||||
}
|
||||
|
||||
//if DOB on form is more recent than DOB limit, display validation error
|
||||
if ($dob_check > _booking_max_dob_ts())
|
||||
@@ -1274,7 +1294,7 @@ function booking_form_submit($form, &$form_state) {
|
||||
$node->booking_country = $values['booking_country'];
|
||||
$node->booking_phone = $values['booking_phone'];
|
||||
$node->booking_mobile = $values['booking_mobile'];
|
||||
$node->booking_email = strtolower($values['booking_email']);
|
||||
$node->booking_email = strtolower(trim($values['booking_email']));
|
||||
$node->booking_ecclesia = ucwords($values['booking_ecclesia']);
|
||||
$node->booking_baptised = ($values['booking_baptised'] == 1 ? 'Y' : 'N');
|
||||
$node->booking_married = empty($values['booking_married']) ? 'N' : ($values['booking_married'] == 1 ? 'Y' : 'N');
|
||||
|
@@ -30,8 +30,6 @@ function booking_report_summary() {
|
||||
$committee_count = 0;
|
||||
|
||||
$stats_attributes = array('style' => 'max-width:30%');
|
||||
|
||||
//TODO: add count of welfare people, and number of people fully paid
|
||||
|
||||
//define sorting information with the header
|
||||
//as per http://www.drup-all.com/blog/table-sort-pagination-drupal-7
|
||||
@@ -443,9 +441,11 @@ function booking_coming_page() {
|
||||
$header = array('Name', 'State');
|
||||
}
|
||||
|
||||
//if configuration is set to show on lists even when no payment has been made, then include booking status of 0 (unpaid) or 1 (booked in)
|
||||
//also ensure any committee members always show
|
||||
if (variable_get('booking_auto_show_on_lists', 1) == 1)
|
||||
{
|
||||
$or = db_or()->condition('p.booking_status', 0)->condition('p.booking_status', 1);
|
||||
$or = db_or()->condition('p.booking_status', 0)->condition('p.booking_status', 1)>condition('p.booking_committee_member', 'Y');
|
||||
|
||||
$result = db_select('booking_person', 'p')
|
||||
->fields('p', array('booking_firstname', 'booking_lastname', 'booking_state', 'booking_readinggroup', 'booking_country'))
|
||||
@@ -460,33 +460,20 @@ function booking_coming_page() {
|
||||
}
|
||||
else
|
||||
{
|
||||
//payment must be made before someone will show up as booked in, but also include any committee member that might not have paid
|
||||
$or = db_or()->condition('p.booking_status', 1)->condition('p.booking_committee_member', 'Y');
|
||||
|
||||
$result = db_select('booking_person', 'p')
|
||||
->fields('p', array('booking_firstname', 'booking_lastname', 'booking_state', 'booking_readinggroup', 'booking_country'))
|
||||
->condition('p.booking_status', 1)
|
||||
->condition($or)
|
||||
->condition('p.booking_event_id', $event->eid, '=')
|
||||
->orderBy('booking_country')
|
||||
->orderBy('booking_state')
|
||||
->orderBy('booking_lastname')
|
||||
->orderBy('booking_firstname')
|
||||
->execute();
|
||||
|
||||
/*
|
||||
$result = db_query('SELECT booking_firstname, booking_lastname, booking_state, booking_readinggroup, booking_country
|
||||
FROM (
|
||||
SELECT booking_firstname, booking_lastname, booking_state, booking_readinggroup, booking_country
|
||||
FROM {booking_person}
|
||||
WHERE booking_status = 1 and booking_event_id = :eid
|
||||
) AS booking
|
||||
ORDER BY booking_state, booking_lastname, booking_firstname',
|
||||
array(':eid' => $event->eid));
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
//while ($booking = db_fetch_object($result)) {
|
||||
|
||||
//watchdog('booking', "Who's coming query: @info", array('@info' => var_export($result, TRUE)));
|
||||
|
||||
foreach ($result as $person)
|
||||
{
|
||||
$state = $person->booking_country === variable_get('booking_default_country') ? $person->booking_state : $person->booking_country;
|
||||
|
Reference in New Issue
Block a user