From c78e4bedbc6eb68617398fe493978c270b2bd0a8 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 18 Mar 2015 10:54:28 +1100 Subject: [PATCH] Clarify email definitions; split out registration form and node --- .DS_Store | Bin 0 -> 6148 bytes booking.admin.inc | 23 +- booking.emails.inc | 6 +- booking.module | 4 +- booking.node.inc | 829 ++++++++++++++++++ booking.register.inc => booking.regn_form.inc | 29 +- booking.tokens.inc | 48 +- 7 files changed, 902 insertions(+), 37 deletions(-) create mode 100644 .DS_Store create mode 100644 booking.node.inc rename booking.register.inc => booking.regn_form.inc (98%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..556a339970fde6dbbc6c04acaf294a5a7c8ecf43 GIT binary patch literal 6148 zcmeHKJ5Iw;5Znb9k!VsWOwtcssRL&=iTgi>= z-u(fZ~t`mOphN>x0V+TRP72ufp}-C6#39f>9SA-G0PQ#44c9(P0E;Dnb>a|+3`~Ox465dcp+QH! zWL=#&1O{C+hY!s=YfdQYcgOj~%SG!zMk+uB#tK}K zG;6$4_SVVES+6bd2l$Vn*2@vR6$8B$V_~iM`mC#>1%5+; EZ$%m?WdHyG literal 0 HcmV?d00001 diff --git a/booking.admin.inc b/booking.admin.inc index 01db167..fd4b744 100644 --- a/booking.admin.inc +++ b/booking.admin.inc @@ -241,10 +241,17 @@ function booking_admin() { $form['regn_options']['booking_enable_medicare'] = array ( '#type' => 'radios', '#title' => t('Enable Medicare requirement?'), - '#description' => t('Select whether to require bookings to enter medicare details.'), + '#description' => t('Select whether to include medicare details on registration form.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_medicare', 1), ); + $form['regn_options']['booking_enforce_medicare_verification'] = array ( + '#type' => 'radios', + '#title' => t('Force Medicare verification?'), + '#description' => t('Prevent people from registering if they do not enter a valid medicare card? (Only applies if medicare details are enabled).'), + '#options' => array (0 => t('No'), t('Yes')), + '#default_value' => variable_get('booking_enforce_medicare_verification', 1), + ); $form['regn_options']['booking_tshirts_text_definition'] = array ( '#type' => 'textfield', '#title' => t('Clothes Sizing Text Definition'), @@ -361,13 +368,13 @@ function booking_manual_email() $group_text = ""; $prefix = t("

Send a manual email to people registered for this event.

"); $email_options_array = array(); - $email_options_array['registration'] = 'Manual Registration'; - $email_options_array['travelrequired'] = 'Manual Travel Form Required'; - $email_options_array['balance'] = 'Manual Balance Outstanding'; - $email_options_array['complete'] = 'Manual Payment Complete'; - $email_options_array['travelcomplete'] = 'Manual Travel Form Complete'; - $email_options_array['withdrawal'] = 'Manual Withdrawal Processed'; - $email_options_array['missedpayment'] = 'Manual Missed Payment Email'; + $email_options_array['registration'] = 'Registration Successful Email'; + $email_options_array['balance'] = 'Balance Outstanding Email'; + $email_options_array['complete'] = 'Payment Complete Email'; + $email_options_array['withdrawal'] = 'Withdrawal Processed Email'; + $email_options_array['missedpayment'] = 'Missed Payment Email'; + $email_options_array['travelrequired'] = 'Travel Form Required Email'; + $email_options_array['travelcomplete'] = 'Travel Form Complete Email'; //add in the custom email types for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++) diff --git a/booking.emails.inc b/booking.emails.inc index 99d2f9f..99f9690 100644 --- a/booking.emails.inc +++ b/booking.emails.inc @@ -146,8 +146,10 @@ function _booking_balance_payment_email($nid) //calculate the remaining parameters $to = $node->booking_email; - $subject = t('!event Payment Required', array('!event' => $event->booking_eventname)); - $params['subject'] = $subject; + //$subject = t('!event Payment Required', array('!event' => $event->booking_eventname)); + //$params['subject'] = $subject; + $params['subject'] = token_replace(variable_get('booking_email_paymentoutstanding_subject', + t('!event Payment Required', array('!event' => $event->booking_eventname))), $tokens); $params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); //retrieve the body of the email for a married couple only if we're combining pricing for couples diff --git a/booking.module b/booking.module index 74bdd14..c050612 100644 --- a/booking.module +++ b/booking.module @@ -29,7 +29,9 @@ module_load_include('inc', 'booking', 'booking.constants'); // Load the include for admin defined text blocks module_load_include('inc', 'booking', 'booking.tokens'); // Load the include that contains the user registration form -module_load_include('inc', 'booking', 'booking.register'); +module_load_include('inc', 'booking', 'booking.regn_form'); +// Load the include that processes booking nodes +module_load_include('inc', 'booking', 'booking.node'); // Load the include that contains the registration confirmation page module_load_include('inc', 'booking', 'booking.confirm'); // Load the include that contains the registration balance payment page diff --git a/booking.node.inc b/booking.node.inc new file mode 100644 index 0000000..e5b19b7 --- /dev/null +++ b/booking.node.inc @@ -0,0 +1,829 @@ +join('booking_price', 'pr', 'p.booking_payment_id = pr.pid'); + //add travel form info if it exists + $query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid'); + + //add the joins for room allocation info if enabled + if (variable_get('booking_enable_roomallocations', 0) == 1) + { + $query->leftJoin('booking_room_mapping', 'rm', 'p.nid = rm.booking_nodeid'); + $query->leftJoin('booking_room_definition', 'r', 'rm.booking_roomid = r.rid'); + $query->leftJoin('booking_room_locations', 'l', 'l.lid = r.booking_room_location_id'); + } + + //add the joins to flatten out study groups into columns + if (variable_get('booking_enable_studygroups', 0) == 1) + { + for ($i = 1; $i <= $studygroup_count; $i++) + { + $query->leftJoin('booking_studygroup_mapping', 's' . $i, + 'p.nid = s' . $i . '.booking_node_id and s' . $i . '.booking_studygroup_id = ' . $i); + } + } + + //filter the results either by specific nodes if passed as a parameter or by all nodes matching the event id + if (! is_null($node_ids)) + { + $query->condition('p.nid', $node_ids, 'IN'); + } + else + { + $query->condition('p.booking_event_id', $event->eid, '='); + } + + //add the database fields we always want to retrieve + $query->fields('p') + ->fields('t') + ->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price')); + + if (variable_get('booking_enable_roomallocations', 0) == 1) + { + $query->fields('rm', array('booking_room_bedtype')) + ->fields('r', array('rid', 'booking_room_location_id', 'booking_room_number')) + ->fields('l'); + } + + //now add the study group fields if applicable + if (variable_get('booking_enable_studygroups', 0) == 1) + { + for ($i = 1; $i <= $studygroup_count; $i++) + { + //$label = "Group_" . $studygroups[$i]->booking_studygroup_descrip; + $query->addField('s' . $i, 'booking_session_id', 'session' . $i); + $query->addField('s' . $i, 'booking_studygroup_role', 'session' . $i . '_role'); + + //$query->addField('s' . $i, 'booking_is_leader', 'session' . $i . '_leader'); + //$query->addField('s' . $i, 'booking_is_reserveleader', 'session' . $i . '_reserveleader'); + //$query->addField('s' . $i, 'booking_is_helper', 'session' . $i . '_helper'); + } + } + + //get the query result as either an associative array + if ($fetchAssoc == TRUE) + { + $result = $query->execute()->fetchAllAssoc('nid'); + } + else + { + $result = $query->execute(); + } + + //watchdog('booking', "
Loading node query output:\n@info
", array('@info' => print_r( $result, true))); + return $result; +} + +function booking_load($nodes) { + global $event; + + $result = booking_load_query(array_keys($nodes)); + + //add that data to the array of node references + foreach ($result as $record) + { + //watchdog('booking', "
Loading node:\n@info
", array('@info' => print_r( $record, true))); + // run through each result row and add in the needed attributes + foreach ($record as $key => $value) + { + $nodes[$record->nid]->$key = $value; + } + } + + //watchdog('booking', 'Final loaded node: @info', array('@info' => var_export($nodes, TRUE))); + // no return necessary since $nodes array members reference objects global to this function +} + +function _booking_insert($node) { + //watchdog('booking', 'Inserting node: @info', array('@info' => var_export($node, TRUE))); + + //TODO: Generalise this by using the keys from $node instead of hard coding everything + + db_insert('booking_person') + ->fields(array( + 'nid' => $node->nid, + 'booking_event_id' => $node->booking_event_id, + 'booking_firstname' => $node->booking_firstname, + 'booking_lastname' => $node->booking_lastname, + 'booking_dob' => $node->booking_dob, + 'booking_barcode' => $node->booking_barcode, + 'booking_luckynum' => $node->booking_luckynum, + 'booking_passport_num' => $node->booking_passport_num, + 'booking_passport_issue_location' => $node->booking_passport_issue_location, + 'booking_passport_issue_name' => $node->booking_passport_issue_name, + 'booking_passport_expiry_date' => $node->booking_passport_expiry_date, + 'booking_destination_country' => $node->booking_destination_country, + 'booking_travel_insurance' => $node->booking_travel_insurance, + 'booking_outflight_bookingnum' => $node->booking_outflight_bookingnum, + 'booking_outflight_flightnum' => $node->booking_outflight_flightnum, + 'booking_outflight_bookingnum' => $node->booking_outflight_bookingnum, + 'booking_outflight_origin' => $node->booking_outflight_origin, + 'booking_outflight_origin_ts' => $node->booking_outflight_origin_ts, + 'booking_outflight_connecting_flightnum' => $node->booking_outflight_connecting_flightnum, + 'booking_outflight_destination' => $node->booking_outflight_destination, + 'booking_outflight_destination_ts' => $node->booking_outflight_destination_ts, + 'booking_rtrnflight_bookingnum' => $node->booking_rtrnflight_bookingnum, + 'booking_rtrnflight_flightnum' => $node->booking_rtrnflight_flightnum, + 'booking_rtrnflight_origin' => $node->booking_rtrnflight_origin, + 'booking_rtrnflight_origin_ts' => $node->booking_rtrnflight_origin_ts, + 'booking_rtrnflight_connecting_flightnum' => $node->booking_rtrnflight_connecting_flightnum, + 'booking_rtrnflight_destination' => $node->booking_rtrnflight_destination, + 'booking_rtrnflight_destination_ts' => $node->booking_rtrnflight_destination_ts, + 'booking_gender' => $node->booking_gender, + 'booking_street' => $node->booking_street, + 'booking_suburb' => $node->booking_suburb, + 'booking_postcode' => $node->booking_postcode, + 'booking_state' => $node->booking_state, + 'booking_country' => $node->booking_country, + 'booking_phone' => $node->booking_phone, + 'booking_mobile' => $node->booking_mobile, + 'booking_email' => $node->booking_email, + 'booking_timestamp' => $node->booking_timestamp, + 'booking_ecclesia' => $node->booking_ecclesia, + 'booking_baptised' => $node->booking_baptised, + 'booking_married' => $node->booking_married, + 'booking_partner_name' => $node->booking_partner_name, + 'booking_partner_id' => $node->booking_partner_id, + 'booking_bf_gf_nid' => $node->booking_bf_gf_nid == '' ? 0 : $node->booking_bf_gf_nid, + 'booking_room_mate1' => $node->booking_room_mate1, + 'booking_room_mate2' => $node->booking_room_mate2, + 'booking_shirt_size' => empty($node->booking_shirt_size) ? 'N/A' : $node->booking_shirt_size, + 'booking_help_music' => $node->booking_help_music, + 'booking_help_praying' => $node->booking_help_praying, + 'booking_help_meditations' => $node->booking_help_meditations, + 'booking_help_reading' => $node->booking_help_reading, + 'booking_help_chairing' => $node->booking_help_chairing, + 'booking_help_readgroup_lead' => $node->booking_help_readgroup_lead, + 'booking_help_discussgroup_lead' => $node->booking_help_discussgroup_lead, + 'booking_readinggroup' => $node->booking_readinggroup, + 'booking_tempid' => $node->booking_tempid, + 'booking_payment_id' => $node->booking_payment_id, + 'booking_amount_paid' => $node->booking_amount_paid, + 'booking_total_pay_reqd' => $node->booking_total_pay_reqd, + 'booking_guardian_name' => $node->booking_guardian_name, + 'booking_guardian_type' => $node->booking_guardian_type, + 'booking_guardian_phone' => $node->booking_guardian_phone, + 'booking_guardian_phone_alt' => $node->booking_guardian_phone_alt, + 'booking_medicare' => empty($node->booking_medicare) ? '' : $node->booking_medicare, + 'booking_lifesaver' => $node->booking_lifesaver, + 'booking_firstaid' => $node->booking_firstaid, + 'booking_nurse' => $node->booking_nurse, + 'booking_doctor' => $node->booking_doctor, + 'booking_dietary' => $node->booking_dietary, + 'booking_medical_conditions' => $node->booking_medical_conditions, + 'booking_has_mission_experience' => $node->booking_has_mission_experience, + 'booking_mission_experience_details' => $node->booking_mission_experience_details, + 'booking_skills_builder' => $node->booking_skills_builder, + 'booking_skills_cooking' => $node->booking_skills_cooking, + 'booking_skills_childminding' => $node->booking_skills_childminding, + 'booking_skills_language' => $node->booking_skills_language, + 'booking_skills_language_details' => $node->booking_skills_language_details, + 'booking_skills_other' => $node->booking_skills_other, + 'booking_skills_other_details' => $node->booking_skills_other_details, + 'booking_status' => $node->booking_status, + 'booking_welfare_required' => $node->booking_welfare_required, + 'booking_payment_complete' => $node->booking_payment_complete, + 'booking_refund_due' => $node->booking_refund_due, + 'booking_refund_processed' => $node->booking_refund_processed, + 'booking_committee_member' => $node->booking_committee_member, + )) + ->execute(); +} + +/** + * Convert $node attribute values (from form) into appropriate formats for persistence + * + * @param $node from form submission + * @return nothing + */ +function _booking_update($node) { + global $event; + + //before we update this user, check what their previous registration status was + $previous_status = db_query("SELECT booking_status, booking_payment_id, booking_total_pay_reqd, booking_amount_paid FROM {booking_person} where nid = :nid", array( + ':nid' => $node->nid)) + ->fetchObject(); + + //watchdog('booking', 'Updating node: @info', array('@info' => var_export($node, TRUE))); + db_update('booking_person') + ->fields(array ( + 'booking_firstname' => $node->booking_firstname, + 'booking_lastname' => $node->booking_lastname, + 'booking_dob' => _date_to_ts($node->booking_dob), + 'booking_barcode' => $node->booking_barcode, + 'booking_luckynum' => $node->booking_luckynum == '' ? 0 : $node->booking_luckynum, + 'booking_passport_num' => $node->booking_passport_num, + 'booking_passport_issue_location' => $node->booking_passport_issue_location, + 'booking_passport_issue_name' => $node->booking_passport_issue_name, + 'booking_passport_expiry_date' => _date_to_ts($node->booking_passport_expiry_date), + 'booking_destination_country' => $node->booking_destination_country, + 'booking_travel_insurance' => $node->booking_travel_insurance, + 'booking_outflight_bookingnum' => $node->booking_outflight_bookingnum, + 'booking_outflight_flightnum' => $node->booking_outflight_flightnum, + 'booking_outflight_bookingnum' => $node->booking_outflight_bookingnum, + 'booking_outflight_origin' => $node->booking_outflight_origin, + 'booking_outflight_origin_ts' => _datetime_to_ts($node->booking_outflight_origin_ts), + 'booking_outflight_connecting_flightnum' => $node->booking_outflight_connecting_flightnum, + 'booking_outflight_destination' => $node->booking_outflight_destination, + 'booking_outflight_destination_ts' => _datetime_to_ts($node->booking_outflight_destination_ts), + 'booking_rtrnflight_bookingnum' => $node->booking_rtrnflight_bookingnum, + 'booking_rtrnflight_flightnum' => $node->booking_rtrnflight_flightnum, + 'booking_rtrnflight_origin' => $node->booking_rtrnflight_origin, + 'booking_rtrnflight_origin_ts' => _datetime_to_ts($node->booking_rtrnflight_origin_ts), + 'booking_rtrnflight_connecting_flightnum' => $node->booking_rtrnflight_connecting_flightnum, + 'booking_rtrnflight_destination' => $node->booking_rtrnflight_destination, + 'booking_rtrnflight_destination_ts' => _datetime_to_ts($node->booking_rtrnflight_destination_ts), + 'booking_gender' => $node->booking_gender, + 'booking_street' => $node->booking_street, + 'booking_suburb' => $node->booking_suburb, + 'booking_postcode' => $node->booking_postcode, + 'booking_state' => $node->booking_state, + 'booking_country' => $node->booking_country, + 'booking_phone' => $node->booking_phone, + 'booking_mobile' => $node->booking_mobile, + 'booking_email' => $node->booking_email, + 'booking_timestamp' => $node->booking_timestamp, + 'booking_ecclesia' => $node->booking_ecclesia, + 'booking_baptised' => ($node->booking_baptised == 1 ? 'Y' : 'N'), + 'booking_married' => ($node->booking_married == 1 ? 'Y' : 'N'), + 'booking_partner_name' => $node->booking_partner_name, + 'booking_partner_id' => $node->booking_partner_id, + 'booking_bf_gf_nid' => $node->booking_bf_gf_nid == '' ? 0 : $node->booking_bf_gf_nid, + 'booking_room_mate1' => $node->booking_room_mate1, + 'booking_room_mate2' => $node->booking_room_mate2, + 'booking_shirt_size' => $node->booking_shirt_size, + 'booking_help_music' => $node->booking_help_music, + 'booking_help_praying' => ($node->booking_help_praying == 1 ? 'Y' : 'N'), + 'booking_help_meditations' => ($node->booking_help_meditations == 1 ? 'Y' : 'N'), + 'booking_help_reading' => ($node->booking_help_reading == 1 ? 'Y' : 'N'), + 'booking_help_chairing' => ($node->booking_help_chairing == 1 ? 'Y' : 'N'), + 'booking_help_readgroup_lead' => ($node->booking_help_readgroup_lead == 1 ? 'Y' : 'N'), + 'booking_help_discussgroup_lead' => ($node->booking_help_discussgroup_lead == 1 ? 'Y' : 'N'), + 'booking_readinggroup' => $node->booking_readinggroup, + 'booking_tempid' => $node->booking_tempid, + 'booking_payment_id' => $node->booking_payment_id, + 'booking_total_pay_reqd' => $node->booking_total_pay_reqd, + 'booking_amount_paid' => $node->booking_amount_paid, + 'booking_refund_due' => $node->booking_refund_due == '' ? 0 : $node->booking_refund_due, + 'booking_guardian_name' => $node->booking_guardian_name, + 'booking_guardian_type' => $node->booking_guardian_type, + 'booking_guardian_phone' => $node->booking_guardian_phone, + 'booking_guardian_phone_alt' => $node->booking_guardian_phone_alt, + 'booking_medicare' => $node->booking_medicare, + 'booking_lifesaver' => ($node->booking_lifesaver == 1 ? 'Y' : 'N'), + 'booking_firstaid' => ($node->booking_firstaid == 1 ? 'Y' : 'N'), + 'booking_nurse' => ($node->booking_nurse == 1 ? 'Y' : 'N'), + 'booking_doctor' => ($node->booking_doctor == 1 ? 'Y' : 'N'), + 'booking_dietary' => $node->booking_dietary, + 'booking_medical_conditions' => $node->booking_medical_conditions, + 'booking_has_mission_experience' => ($node->booking_has_mission_experience == 1 ? 'Y' : 'N'), + 'booking_mission_experience_details' => $node->booking_mission_experience_details, + 'booking_skills_builder' => ($node->booking_skills_builder == 1 ? 'Y' : 'N'), + 'booking_skills_cooking' => ($node->booking_skills_cooking == 1 ? 'Y' : 'N'), + 'booking_skills_childminding' => ($node->booking_skills_childminding == 1 ? 'Y' : 'N'), + 'booking_skills_language' => ($node->booking_skills_language == 1 ? 'Y' : 'N'), + 'booking_skills_language_details' => $node->booking_skills_language_details, + 'booking_skills_other' => ($node->booking_skills_other == 1 ? 'Y' : 'N'), + 'booking_skills_other_details' => $node->booking_skills_other_details, + 'booking_welfare_required' => ($node->booking_welfare_required == 1 ? 'Y' : 'N'), + 'booking_payment_complete' => ($node->booking_payment_complete == 1 ? 'Y' : 'N'), + 'booking_refund_processed' => ($node->booking_refund_processed == 1 ? 'Y' : 'N'), + 'booking_committee_member' => ($node->booking_committee_member == 1 ? 'Y' : 'N'), + 'booking_status' => $node->booking_status, + + )) + ->condition('nid', $node->nid) + ->execute(); + + //***now process some post-update triggers*** + + //if booking_partner_id is set, make sure the nid it refers to has this node as its booking_partner_id + if ($node->booking_partner_id != 0) + { + $partner = db_query("Select booking_partner_id from {booking_person} where nid = :nid", + array(':nid' => $node->booking_partner_id)) + ->fetchObject(); + if ($partner->booking_partner_id == 0) + { + watchdog('booking', 'Updating partner node !partner to refer to this node !nid', + array('!partner' => $node->booking_partner_id, '!nid' => $node->nid)); + //update the partner id of the partner to refer to this node + db_update('booking_person') + ->fields(array( + 'booking_partner_id' => $node->nid, + )) + ->condition('nid', $node->booking_partner_id) + ->execute(); + } + } + + //status change triggers start here + + //check if someone has moved to not-coming list from the booked-in list + if ($previous_status->booking_status == 1 && $node->booking_status == 3) + { + watchdog('booking', 'Detected person moving from Booked In list to No Longer Coming'); + + //let this person know their request has been processed + _booking_demoted_to_notcoming_email($node->nid); + + //Calculate refund + $refund = _booking_process_refund($node); + drupal_set_message(t('Refund calculated for !first !last is $!refund.', + array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname, '!refund' => $refund))); + + //Remove from any study groups + _booking_person_studygroups_cleanup($node->nid); + + //Remove from any rooms allocated + _booking_person_rooms_cleanup($node->nid); + + //check if there is room on the booked-in list + if (_booking_check_bookings_full() == False) + { + watchdog('booking', 'Looks like there was room on the booked in list, so lets tell the next person'); + //find the first person on the waiting list + $temp_nid = _booking_get_waitinglist_top(); + + if ($temp_nid != -1) //-1 means there was no one on the waiting list + { + //update their registration status + _booking_change_status($temp_nid,1); + + //send them an email + _booking_promoted_from_waitinglist_email($temp_nid); + } + } + else + watchdog('booking', 'Still no room on the booked in list though.'); + } + //check if someone has moved to booked-in list from waiting-list + elseif ($previous_status->booking_status == 2 && $node->booking_status == 1) + { + watchdog('booking', 'Detected person moving from Waiting list to Booked In'); + + //send them an email + _booking_promoted_from_waitinglist_email($node->nid); + + //see if there are others to process also + $waitinglist_nid = _booking_get_waitinglist_top(); + + //check if there is room on the booked-in list + while (_booking_check_bookings_full() == False && $waitinglist_nid > 0) + { + watchdog('booking', 'There is room on the booked in list, so process the next person on the waiting list, who has a node id of ' . $waitinglist_nid); + + //update their registration status + _booking_change_status($waitinglist_nid, 1); + + //send them an email + _booking_promoted_from_waitinglist_email($waitinglist_nid); + + $waitinglist_nid = _booking_get_waitinglist_top(); + } + + } + //check if someone has been demoted to the "missed payment deadline" status from being booked-in + elseif ($previous_status->booking_status == 1 && $node->booking_status == 4) + { + watchdog('booking', 'Detected person moving from Booked In list to Missed Payment Deadline list.'); + + //let this person know they're no longer "booked in" + _booking_missedpayment_email($node->nid); + + //Remove from any study groups + _booking_person_studygroups_cleanup($node->nid); + + //Remove from any rooms allocated + _booking_person_rooms_cleanup($node->nid); + + //check if there is room on the booked-in list + if (_booking_check_bookings_full() == False) + { + watchdog('booking', 'Position available, so lets tell the next person'); + //find the first person on the waiting list + $temp_nid = _booking_get_waitinglist_top(); + + if ($temp_nid != -1) //-1 means there was no one on the waiting list + { + //update their registration status + _booking_change_status($temp_nid,1); + + //send them an email + _booking_promoted_from_waitinglist_email($temp_nid); + } + } + else + { + watchdog('booking', 'Still no room on the booked in list.'); + } + } + //if someone is moving to the not-coming list from the waiting list + elseif ($previous_status->booking_status == 2 && $node->booking_status == 3) + { + watchdog('booking', 'Detected person moving from waiting list to No Longer Coming'); + //let this person know their request has been processed + _booking_demoted_to_notcoming_email($node->nid); + + //Calculate refund + $refund = _booking_process_refund($node); + drupal_set_message(t('Refund calculated for !first !last is $!refund.', + array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname, '!refund' => $refund))); + + //Remove from any study groups + _booking_person_studygroups_cleanup($node->nid); + } + //if we're not automatically sending emails on registration + //and someone moved from not-paid to booked-in (ie, manual payment process) + elseif (variable_get('booking_auto_confirm_email', 0) == 0 && $previous_status->booking_status == 0 && $node->booking_status == 1) + { + watchdog('booking', 'Detected person moving from Not Paid list to Booked In list'); + + //make sure the booked in list isn't full + if (_booking_check_bookings_full() == False) + { + watchdog('booking', 'Confirmed room on the booked in list'); + //send them an email + _booking_registration_email($node->nid, FALSE, FALSE); + //_booking_promoted_from_waitinglist_email($node->nid); + } + } + //if someone moved from the not-paid list to waiting list by manual update + elseif ($previous_status->booking_status == 0 && $node->booking_status == 2) + { + watchdog('booking', 'Detected person moving from Not Paid list to Waiting List'); + + + //create a manual payment entry of zero dollars + //so things like the waiting list report work + $result = db_insert('booking_payment') + ->fields(array( + 'booking_person_nid' => $node->nid, + 'booking_eventid' => $event->eid, + 'booking_mc_gross' => '0.00', + 'booking_mc_currency' => 'AUD', + 'booking_mc_fee' => '0.00', + 'booking_quantity' => 1, + 'booking_invoice' => 'ManualPayment', + 'booking_payer_id' => '', + 'booking_payment_date' => REQUEST_TIME, + 'booking_payment_status' => '', + 'booking_first_name' => $node->booking_firstname, + 'booking_last_name' => $node->booking_lastname, + 'booking_buyer_email' => '', + 'booking_payer_status' => '', + 'booking_item_name' => '', + 'booking_ipn_track_id' => '', + )) + ->execute(); + + //send them an email + _booking_registration_email($node->nid, FALSE, FALSE); + } + + //if the payment ID has changed then update the total pay required + if ($previous_status->booking_payment_id != $node->booking_payment_id) + { + $total_due = 0; + watchdog('booking', 'Detected payment type change for attendee'); + + //look up the total pay required for the new payment id + $price = db_select('booking_price', 'p') + ->condition('p.pid', $node->booking_payment_id,'=') + ->fields('p', array('booking_price', 'booking_late_price')) + ->execute() + ->fetchObject(); + + /* + //check for early bird rate or full rate + if (_booking_is_earlybird() == TRUE) + $total_due = $price->booking_price; + else + $total_due = $price->booking_late_price; + */ + + //always set the payment required to the "early" price, since the late price is calculated dynamically if required + + + //update the person with the new total pay required + db_update('booking_person') + ->fields(array( + 'booking_total_pay_reqd' => $price->booking_price, + )) + ->condition('nid', $node->nid) + ->execute(); + } + //end trigger processing +} + +function _booking_delete($node) { + + $last = $node->booking_lastname; + $first = $node->booking_firstname; + + //clean up other tables first + _booking_person_rooms_cleanup($node->nid); + _booking_person_studygroups_cleanup($node->nid); + + //then clean up primary table + $num_deleted = db_delete('booking_person') + ->condition('nid', $node->nid) + ->execute(); + + $message = t("Successfully deleted !num row(s), corresponding to '!last, !first'", + array('!num' => $num_deleted, '!last' => $last, '!first' => $first)); + + drupal_set_message($message, $type = 'status'); + +} + + +function booking_view($node, $view_mode) { + global $event; + $rows = array(); + $travel_rows = array(); + + //calculate the price owed by this person + //if (_booking_is_earlybird() == true || _booking_amount_owing($node->nid) == 0) + if (_booking_is_earlybird() == true || _booking_amount_owing($node) == 0 || $node->booking_committee_member == 'Y' || $node->booking_welfare_required == 'Y') + { + $price = $node->booking_price; + } + else + $price = $node->booking_late_price; + //include the price description to display with this view + $payment_type = $node->booking_price_descrip . ' ($' . $price . ')'; + + //look up the actual name for a linked partner + if ($node->booking_partner_id != 0) + { + $query = db_query("Select booking_firstname, booking_lastname from {booking_person} where nid = :nid", + array(':nid' => $node->booking_partner_id)) + ->fetchObject(); + $partner_name = $query->booking_firstname . " " . $query->booking_lastname; + } + else + $partner_name = "N/A"; + + //also look up the actual name if a boyfriend/girlfriend is defined + if ($node->booking_bf_gf_nid != 0) + { + $query = db_query("Select booking_firstname, booking_lastname from {booking_person} where nid = :nid", + array(':nid' => $node->booking_bf_gf_nid)) + ->fetchObject(); + $bf_gf = $query->booking_firstname . " " . $query->booking_lastname; + } + else + $bf_gf = "N/A"; + + //define column widths along with the header + $header = array( + array('data' => t('Attribute'), 'width' => '40%'), + array('data' => t('Value'), 'width' => '60%'), + ); + + //now populate the table + $rows[] = array(t('Date/Time registered:'), t('!timestamp', array('!timestamp' => format_date($node->booking_timestamp, 'custom', 'd/m/Y H:i')))); + $rows[] = array(t('Name:'), t('!first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname))); + $rows[] = array(t('Gender:'), t('!gender', array('!gender' => $node->booking_gender == 'M' ? 'Male' : 'Female'))); + $rows[] = array(t('Status:'), t('!status', array('!status' => _booking_status_generate($node->booking_status)))); + $rows[] = array(t('Committee Member:'), t('!ans', array('!ans' => ($node->booking_committee_member == 'Y' ? 'Yes' : 'No')))); + $rows[] = array(t('Welfare Required:'), $node->booking_welfare_required == 'Y' ? 'Yes' : 'No'); + $rows[] = array(t('Barcode:'), t('!id', array('!id' => $node->booking_barcode))); + $rows[] = array(t('Date of birth:'), t('!dob', array('!dob' => format_date($node->booking_dob, 'custom', 'd/m/Y')))); + $rows[] = array(t('Email address:'), t('!email', array('!email' => $node->booking_email))); + + if (variable_get('booking_enable_passport', 1) == 1) + { + $rows[] = array(t('Passport Number:'), $node->booking_passport_num); + $rows[] = array(t('Passport Expiry:'), t('!timestamp', array('!timestamp' => _booking_convert_ts($node->booking_passport_expiry_date)->format('d/m/Y')))); + $rows[] = array(t('Passport Exact Issued Name:'), $node->booking_passport_issue_name); + $rows[] = array(t('Passport Issue Location:'), $node->booking_passport_issue_location); + $rows[] = array(t('Destination Country:'), $node->booking_destination_country); + $rows[] = array(t('Travel Insurance details:'), $node->booking_travel_insurance); + + //outbound flight + $flight_rows[] = array(t('Internal Flight Booking Reference:'), $node->booking_outflight_bookingnum); + $flight_rows[] = array(t('Internal Flight Number:'), $node->booking_outflight_flightnum); + $flight_rows[] = array(t('Internal Flight Origin to Destination:'), $node->booking_outflight_origin); + $flight_rows[] = array(t('Internal Flight Departure Time:'), + $node->booking_outflight_origin_ts == 0 ? '' : format_date($node->booking_outflight_origin_ts, 'custom', 'd/m/Y H:i') ); + $flight_rows[] = array(t('Connecting Flight Number:'), $node->booking_outflight_connecting_flightnum); + $flight_rows[] = array(t('Connecting Flight Origin to Destination:'), $node->booking_outflight_destination); + $flight_rows[] = array(t('Internal Flight Arrival Time:'), + $node->booking_outflight_destination_ts == 0 ? '' : format_date($node->booking_outflight_destination_ts, 'custom', 'd/m/Y H:i') ); + //return flight + $flight_rows[] = array(t('Return Internal Flight Booking Reference:'), $node->booking_rtrnflight_bookingnum); + $flight_rows[] = array(t('Return Internal Flight Number:'), $node->booking_rtrnflight_flightnum); + $flight_rows[] = array(t('Return Internal Flight Origin to Destination:'), $node->booking_rtrnflight_origin); + $flight_rows[] = array(t('Return Internal Flight Departure Time:'), + $node->booking_rtrnflight_origin_ts == 0 ? '' : format_date($node->booking_rtrnflight_origin_ts, 'custom', 'd/m/Y H:i') ); + $flight_rows[] = array(t('Connecting Flight Number:'), $node->booking_rtrnflight_connecting_flightnum); + $flight_rows[] = array(t('Connecting Flight Origin to Destination:'), $node->booking_rtrnflight_destination); + $flight_rows[] = array(t('Return Internal Flight Arrival Time:'), + $node->booking_rtrnflight_destination_ts == 0 ? '' : format_date($node->booking_rtrnflight_destination_ts, 'custom', 'd/m/Y H:i') ); + + //add the flight info to a new section + $flight_heading = t("

Internal Flight Details

"); + $node->content['flight-heading'] = array( + '#markup' => $flight_heading, + '#weight' => 2, + ); + $node->content['flight-details'] = array( + '#markup' => theme('table', array('header' => $header, 'rows' => $flight_rows)), + '#weight' => 3, + ); + } + + $rows[] = array(t('Payment Type Selected:'), t('!amount_paid', array('!amount_paid' => $payment_type))); + $rows[] = array(t('Amount Paid:'), t('!amount_paid', array('!amount_paid' => $node->booking_amount_paid))); + $rows[] = array(t('Payment Complete Flag:'), t('!ans', array('!ans' => $node->booking_payment_complete == 'Y' ? 'Yes' : 'No'))); + $rows[] = array(t('Total Amount Due:'), t('!amount_paid', array('!amount_paid' => $node->booking_total_pay_reqd))); + $rows[] = array(t('Refund Due:'), t('!amount_due', array('!amount_due' => $node->booking_refund_due))); + $rows[] = array(t('Refund Processed:'), t('!ans', array('!ans' => ($node->booking_refund_processed == 'Y' ? 'Yes' : 'No')))); + $rows[] = array(t('Reading Group:'), t('!group', array('!group' => $node->booking_readinggroup))); + + if (variable_get('booking_enable_tshirts', 0) == 1) + { + $rows[] = array(t('Hoodie Size:'), $node->booking_shirt_size); + } + + $rows[] = array(t('Home Phone Number:'), t('!home', array('!home' => $node->booking_phone))); + $rows[] = array(t('Mobile Phone Number:'), t('!mob', array('!mob' => $node->booking_mobile))); + $rows[] = array(t('Postal Address:'), t('!street
!suburb !state !code
!country', + array('!street' => $node->booking_street, '!suburb' => $node->booking_suburb, + '!state' => ($node->booking_state == 'N/A' ? '' : $node->booking_state), + '!code' => $node->booking_postcode, + '!country' => $node->booking_country))); + $rows[] = array(t('Ecclesia:'), t('!ecclesia', array('!ecclesia' => $node->booking_ecclesia))); + $rows[] = array(t('Baptised:'), t('!ans', array('!ans' => ($node->booking_baptised == 'Y' ? 'Yes' : 'No')))); + $rows[] = array(t('Married:'), t('!ans', array('!ans' => ($node->booking_married == 'Y' ? 'Yes' : 'No')))); + + $rows[] = array(t('Linked Partner:'), t($partner_name)); + $rows[] = array(t('Linked Boyfriend/Girlfriend:'), t($bf_gf)); + $rows[] = array(t('Emergency Contact Name:'), $node->booking_guardian_name); + $rows[] = array(t('Emergency Contact Relationship:'), $node->booking_guardian_type); + $rows[] = array(t('Emergency Contact Phone:'), $node->booking_guardian_phone); + $rows[] = array(t('Emergency Contact Alternate Phone:'), $node->booking_guardian_phone_alt); + if (variable_get('booking_enable_medicare', 1) == 1) + $rows[] = array(t('Medicare Number:'), $node->booking_medicare); + + $rows[] = array(t('Special Dietary Requirements:'), $node->booking_dietary); + $rows[] = array(t('Special Medical Conditions:'), $node->booking_medical_conditions); + + if (variable_get('booking_enable_roommate', 0) == 1) + { + $rows[] = array(t('Preferred room-mates:'), t('!room', array('!room' => $node->booking_room_mate1 . ' ' . $node->booking_room_mate2))); + } + + if (variable_get('booking_enable_helpareas', 1) == 1) + { + $rows[] = array(t('Qualified Life Saver:'), $node->booking_lifesaver == 'Y' ? 'Yes' : 'No'); + $rows[] = array(t('Qualified First Aider:'), $node->booking_firstaid == 'Y' ? 'Yes' : 'No'); + $rows[] = array(t('Qualified Nurse:'), $node->booking_nurse == 'Y' ? 'Yes' : 'No'); + $rows[] = array(t('Qualified Doctor:'), $node->booking_doctor == 'Y' ? 'Yes' : 'No'); + $help_areas = ''; + if ($node->booking_help_music) + $help_areas .= 'music: ' . $node->booking_help_music . ', '; + if ($node->booking_help_reading == 'Y') + $help_areas .= 'reading, '; + if ($node->booking_help_chairing == 'Y') + $help_areas .= 'chairing, '; + if ($node->booking_help_readgroup_lead == 'Y') + $help_areas .= 'reading group leading, '; + if ($node->booking_help_discussgroup_lead == 'Y') + $help_areas .= 'discussion group leading, '; + if ($node->booking_help_praying == 'Y') + $help_areas .= 'praying, '; + if ($node->booking_help_meditations == 'Y') + $help_areas .= 'meditations, '; + + $rows[] = array(t('Help areas:'), t('!help', array('!help' => $help_areas))); + } + + if (variable_get('booking_enable_skills', 1) == 1) + { + $skill_areas = ''; + if ($node->booking_skills_builder == 'Y') + $skill_areas .= 'builder, '; + if ($node->booking_skills_cooking == 'Y') + $skill_areas .= 'cook, '; + if ($node->booking_skills_childminding == 'Y') + $skill_areas .= 'child minding, '; + if ($node->booking_skills_language == 'Y') + $skill_areas .= 'speaks languages: ' . $node->booking_skills_language_details . ', '; + if ($node->booking_skills_other == 'Y') + $skill_areas .= 'other skills: ' . $node->booking_skills_other_details . ', '; + $rows[] = array(t('Mission related skills:'), t('!value', array('!value' => $skill_areas))); + $rows[] = array(t('Previous Mission Experience:'), $node->booking_mission_experience_details); + } + $rows[] = array(t('Temporary UUID:'), $node->booking_tempid); + $rows[] = array(t('Lanyard lucky number:'), $node->booking_luckynum); + + //display room allocation data if enabled + if (variable_get('booking_enable_roomallocations', 0) == 1) + { + $room_heading = t("

Room Allocation

!link

", + array('!link' => l(t('Edit Room Allocation'), t('admin/booking/!id/edit-room', array('!id' => $node->nid)), array('query' => drupal_get_destination()) ) + )); + $room_rows = array(); + //$room_rows[] = array(t('Room Location'), _booking_room_location_lookup($node->booking_room_location_id)); + $room_rows[] = array(t('Room Location'), $node->booking_roomlocation_descrip); + $room_rows[] = array(t('Room Number'), $node->booking_room_number); + $room_rows[] = array(t('Bed Type'), _booking_room_bedtype_lookup($node->booking_room_bedtype)); + + $node->content['room-heading'] = array( + '#markup' => $room_heading, + '#weight' => 4, + ); + + $node->content['room-details'] = array( + '#markup' => theme('table', array('header' => $header, 'rows' => $room_rows)), + '#weight' => 5, + ); + } + + //add the travel info if it has been defined for this attendee + if (! empty($node->tid)) + { + $travel_heading = t("

Travel Details

!link

", + array('!link' => l(t('Edit Travel Details'), t('node/!id/edit', array('!id' => $node->tid))) + )); + + $travel_rows[] = array(t('Transport Type:'), $node->booking_transport_type); + $travel_rows[] = array(t('Catching the train to Study Week:'), $node->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No'); + $travel_rows[] = array(t('Inbound Flight Number:'), $node->booking_flightnum_inbound == '' ? 'N/A' : $node->booking_flightnum_inbound); + $travel_rows[] = array(t('Flight Arrival:'), t('!date', + array('!date' => $node->booking_flight_datetime_inbound == 0 ? 'N/A' : format_date($node->booking_flight_datetime_inbound, 'custom', 'd/m/Y H:i')))); + $travel_rows[] = array(t('Outbound Flight Number:'), $node->booking_flightnum_outbound == '' ? 'N/A' : $node->booking_flightnum_outbound); + $travel_rows[] = array(t('Flight Departure:'), t('!date', + array('!date' => $node->booking_flight_datetime_outbound == 0 ? 'N/A' : format_date($node->booking_flight_datetime_outbound, 'custom', 'd/m/Y H:i')))); + $travel_rows[] = array(t('Accommodation before Study Week Required:'), $node->booking_accom_before_reqd == 1 ? 'Yes' : 'No'); + $travel_rows[] = array(t('Accommodation after Study Week Required:'), $node->booking_accom_after_reqd == 1 ? 'Yes' : 'No'); + + $node->content['travel-heading'] = array( + '#markup' => $travel_heading, + '#weight' => 6, + ); + + $node->content['travel-details'] = array( + '#markup' => theme('table', array('header' => $header, 'rows' => $travel_rows)), + '#weight' => 7, + ); + } + + //display study session data if enabled + if (variable_get('booking_enable_studygroups', 0) == 1) + { + $studygroup_heading = t("

Study Groups

!link

", + array('!link' => l(t('Edit Groups'), t('admin/booking/!id/edit-studygroup-membership', array('!id' => $node->nid))) + )); + + //look up the titles of the study groups + $studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid", + array(':eid' => $event->eid)); + $studygroups = $studygroups_query->fetchAllAssoc('sid'); + + //watchdog('booking', "
Displaying node studygroups query output:\n@info
", array('@info' => print_r( $studygroups, true))); + + for ($i = 1; $i <= variable_get('booking_studygroup_count','0'); $i++) + { + //calculate the session references + $sessionid = "session" . $i; + $roleid = $sessionid . "_role"; + + $group_rows[] = array(t('' . $studygroups[$i]->booking_studygroup_descrip . ' group number'), $node->$sessionid); + $group_rows[] = array(t('Role'), _booking_studygroup_role_lookup($node->$roleid)); + } + + $node->content['group-heading'] = array( + '#markup' => $studygroup_heading, + '#weight' => 8, + ); + + $node->content['group-details'] = array( + '#markup' => theme('table', array('header' => $header, 'rows' => $group_rows)), + '#weight' => 9, + ); + } + + $node->content['details'] = array( + '#markup' => theme('table', array('header' => $header, 'rows' => $rows)), + '#weight' => 1, + ); + + //all finished, let's render this mess + return $node; +} \ No newline at end of file diff --git a/booking.register.inc b/booking.regn_form.inc similarity index 98% rename from booking.register.inc rename to booking.regn_form.inc index 894bcf1..8217ab9 100644 --- a/booking.register.inc +++ b/booking.regn_form.inc @@ -531,7 +531,7 @@ function booking_form($node, &$form_state, $inserting = FALSE) { '#title' => t('Your Medicare Number'), '#maxlength' => 15, '#size' => 15, - '#required' => FALSE, + '#required' => variable_get('booking_enforce_medicare_verification', 1) == 1 ? TRUE : FALSE, '#default_value' => empty($data->booking_medicare) ? '' : $data->booking_medicare ); } @@ -844,7 +844,7 @@ if (variable_get('booking_enable_passport', 0) == 1) { $form['misc-areas']['booking_dietary_check'] = array( '#type' => 'checkbox', - '#title' => t('Special dietary requirements'), + '#title' => t('I have special dietary requirements'), '#default_value' => (!empty($data->booking_dietary) && $data->booking_dietary == 'Y') ? 1 : 0 ); @@ -879,7 +879,7 @@ if (variable_get('booking_enable_passport', 0) == 1) $form['misc-areas']['booking_medical_conditions_check'] = array( '#type' => 'checkbox', - '#title' => t('Special medical conditions'), + '#title' => t('I have special medical condition(s)'), '#default_value' => (!empty($data->booking_medical_conditions) && $data->booking_medical_conditions == 'Y') ? 1 : 0 ); $form['misc-areas']['booking_medical_conditions'] = array( @@ -1027,11 +1027,24 @@ function _booking_validate($node, &$form_state) { //proper validation routine at http://dyball.wordpress.com/2007/12/05/validation-of-medicare-numbers/ if (! _valid_medicare_number($form_state['booking_medicare'])) { - form_set_error('booking_medicare', - t('You have entered an invalid medicare number. Please check your medicare card and re-enter the number. ' . - 'If you believe this to be incorrect, please !contact.', - array('!contact' => l('send us an email', 'mailto:' . variable_get('booking_contact_email') . '?subject=Invalid Medicare Number'))) - ); + if (variable_get('booking_enforce_medicare_verification', 1) == 1) { + form_set_error('booking_medicare', + t('You have entered an invalid medicare number. Please check your medicare card and re-enter the number. ' . + 'If you believe this to be incorrect, please !contact.', + array('!contact' => l('send us an email', 'mailto:' . variable_get('booking_contact_email') . + '?subject=Invalid Medicare Number')) + ) + ); + } + else { + drupal_set_message( + t('You have entered an invalid medicare number. Please ensure you check your medicare card' . + ' and send us the correct information via !contact.', + array('!contact' => l('email', 'mailto:' . variable_get('booking_contact_email') . + '?subject=Invalid Medicare Number')) + ), 'error', FALSE + ); + } } } diff --git a/booking.tokens.inc b/booking.tokens.inc index 8dd51d1..b0361c5 100644 --- a/booking.tokens.inc +++ b/booking.tokens.inc @@ -333,24 +333,24 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text '#collapsed' => TRUE, ); $form['emails']['booking_email_notification_text'] = array( - '#title' => t('Email to send to the notification email address (defined in general configuration) when a person has registered'), + '#title' => t('Notification Email'), '#type' => 'textarea', //'#format' => 'full_html', - '#description' => t(''), + '#description' => t('Email to send to the notification email address (defined in general configuration) when a person has registered'), '#default_value' => variable_get('booking_email_notification_text', '[booking:regn-summary]'), ); $form['emails']['booking_email_bookedin_text'] = array( - '#title' => t('Text to use in an email indicating the person has booked in and is not on the waiting list'), + '#title' => t('Registration Successful Email'), '#type' => 'textarea', //'#format' => 'full_html', - '#description' => t(''), + '#description' => t('Text to use in an email indicating the person has booked in and is not on the waiting list'), '#default_value' => variable_get('booking_email_bookedin_text', $default_email_text), ); $form['emails']['booking_email_regn_complete_text'] = array( - '#title' => t('Email text to indicate a person has completed the payment for their booking'), + '#title' => t('Payment Complete Email'), '#type' => 'textarea', //'#format' => 'full_html', - '#description' => t(''), + '#description' => t('Email text to indicate a person has completed the payment for their booking'), '#default_value' => variable_get('booking_email_regn_complete_text', $booking_email_regn_complete_text), ); $form['emails']['booking_email_partialpayment_received_text'] = array( @@ -367,11 +367,19 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text '#description' => t(''), '#default_value' => variable_get('booking_email_waitinglist_text', $booking_email_waitinglist_text), ); + $form['emails']['booking_email_paymentoutstanding_subject'] = array ( + '#type' => 'textfield', + '#title' => t('Balance Outstanding Email Subject'), + '#description' => t('Subject line for email advising attendee they missed the payment deadline'), + '#size' => 150, + '#maxlength' => 300, + '#default_value' => variable_get('booking_email_paymentoutstanding_subject','[booking:eventname] payment required'), + ); $form['emails']['booking_email_paymentoutstanding_text'] = array( - '#title' => t('Email text to send a person reminding them of how much they owe'), + '#description' => t('Email text to send a person reminding them of how much they owe'), '#type' => 'textarea', //'#format' => 'full_html', - '#description' => t(''), + '#title' => t('Balance Outstanding Email Text'), '#default_value' => variable_get('booking_email_paymentoutstanding_text', $booking_email_paymentoutstanding_text), ); @@ -390,7 +398,8 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text ); $form['emails']['booking_email_notcoming_demotion_subject'] = array ( '#type' => 'textfield', - '#title' => t('Subject line for email advising attendee their withdrawal has been processed'), + '#title' => t('Withdrawal Processed Email'), + '#description' => t('Subject line for email advising attendee their withdrawal has been processed'), '#size' => 150, '#maxlength' => 300, '#default_value' => variable_get('booking_email_notcoming_demotion_subject','[booking:eventname] withdrawal processed'), @@ -403,40 +412,43 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text ); $form['emails']['booking_email_missedpayment_subject'] = array ( '#type' => 'textfield', - '#title' => t('Subject line for email advising attendee they missed the payment deadline'), + '#title' => t('Missed Payment Email Subject'), + '#description' => t('Subject line for email advising attendee they missed the payment deadline'), '#size' => 150, '#maxlength' => 300, '#default_value' => variable_get('booking_email_missedpayment_subject','[booking:eventname] payment deadline missed'), ); $form['emails']['booking_email_missedpayment'] = array( - '#title' => t('Email text to send a person who missed the payment deadline'), + '#title' => t('Missed Payment Email Text'), '#type' => 'textarea', - '#description' => t(''), + '#description' => t('Email text to send a person who missed the payment deadline'), '#default_value' => variable_get('booking_email_missedpayment', ''), ); $form['emails']['booking_email_travel_required_subject'] = array ( '#type' => 'textfield', - '#title' => t('Subject line for email requesting attendee to complete the travel form'), + '#title' => t('Travel Form Required Subject'), + '#description' => t('Subject line for email requesting attendee to complete the travel form'), '#size' => 150, '#maxlength' => 300, '#default_value' => variable_get('booking_email_travel_required_subject','[booking:eventname] Travel Details Required'), ); $form['emails']['booking_email_travel_required_text'] = array( - '#title' => t('Email text requesting attendee to complete the travel form.'), - '#description' => t('This email will be sent from the !email email address', array('!email' => variable_get('booking_logistics_email'))), + '#title' => t('Travel Form Required Text'), + '#description' => t('Email text requesting attendee to complete the travel form. This email will be sent from the !email email address', array('!email' => variable_get('booking_logistics_email'))), '#type' => 'textarea', '#default_value' => variable_get('booking_email_travel_required_text', ''), ); $form['emails']['booking_email_travel_complete_subject'] = array ( '#type' => 'textfield', - '#title' => t('Subject line for email indicating a person has completed the travel form'), + '#title' => t('Travel Form Complete Subject'), + '#description' => t('Subject line for email indicating a person has completed the travel form'), '#size' => 150, '#maxlength' => 300, '#default_value' => variable_get('booking_email_travel_complete_subject','[booking:eventname] Travel Details Received'), ); $form['emails']['booking_email_travel_complete_text'] = array( - '#title' => t('Email text to indicate a person has completed the travel form.'), - '#description' => t('This email will be sent from the !email email address', array('!email' => variable_get('booking_logistics_email'))), + '#title' => t('Travel Form Complete Text'), + '#description' => t('Email text to indicate a person has completed the travel form. This email will be sent from the !email email address', array('!email' => variable_get('booking_logistics_email'))), '#type' => 'textarea', '#default_value' => variable_get('booking_email_travel_complete_text', ''), );