Add custom counts to admin page

This commit is contained in:
2014-05-14 19:06:42 +10:00
parent 6e2354efe6
commit c07605ab73
5 changed files with 20 additions and 8 deletions

View File

@@ -57,6 +57,15 @@ function booking_admin() {
'#required' => TRUE, '#required' => TRUE,
'#default_value' => variable_get('booking_logistics_email',variable_get('site_mail', ini_get('sendmail_from'))), '#default_value' => variable_get('booking_logistics_email',variable_get('site_mail', ini_get('sendmail_from'))),
); );
$form['email']['booking_custom_email_count'] = array (
'#type' => 'textfield',
'#title' => t('Number of custom email definitions'),
'#description' => t("Set to the number of custom email definitions to use."),
'#size' => 3,
'#maxlength' => 3,
'#default_value' => variable_get('booking_custom_email_count','5'),
);
$form['attendee'] = array ( $form['attendee'] = array (
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => 'Attendee restrictions', '#title' => 'Attendee restrictions',
@@ -211,7 +220,7 @@ function booking_admin() {
$form['misc']['booking_studygroup_count'] = array ( $form['misc']['booking_studygroup_count'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Number of study groups'), '#title' => t('Number of study groups'),
'#description' => t("Total number of study groups in use."), '#description' => t("Total number of study groups in use. Make sure this matches the actual number defined."),
'#size' => 3, '#size' => 3,
'#maxlength' => 3, '#maxlength' => 3,
'#default_value' => variable_get('booking_studygroup_count','0'), '#default_value' => variable_get('booking_studygroup_count','0'),
@@ -273,7 +282,7 @@ function booking_manual_email()
$email_options_array['travelcomplete'] = 'Manual Travel Form Complete'; $email_options_array['travelcomplete'] = 'Manual Travel Form Complete';
//add in the custom email types //add in the custom email types
for ($i = 1; $i <= CUSTOM_EMAIL_COUNT; $i++) for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++)
{ {
$email_options_array['custom' . $i] = variable_get('booking_email_subject_custom' . $i, $event->booking_eventname . ' custom ' . $i); $email_options_array['custom' . $i] = variable_get('booking_email_subject_custom' . $i, $event->booking_eventname . ' custom ' . $i);
} }

View File

@@ -21,8 +21,8 @@ define('BOOKING_PAYPAL_SUBMIT_URL_SANDBOX', 'https://www.sandbox.paypal.com/cgi-
define('BOOKING_PAYPAL_IPN_PATH', 'system/booking_paypal/ipn'); define('BOOKING_PAYPAL_IPN_PATH', 'system/booking_paypal/ipn');
define('TIMEZONE', 'Australia/Sydney'); define('TIMEZONE', 'Australia/Sydney');
define('BOOKING_DEFAULT_STATE', 'NSW'); define('BOOKING_DEFAULT_STATE', 'NSW');
define('CUSTOM_EMAIL_COUNT', 10); //define('CUSTOM_EMAIL_COUNT', 10);
define('STUDYGROUP_COUNT', 7); //define('STUDYGROUP_COUNT', 7);
// Load the include for various constants // Load the include for various constants
module_load_include('inc', 'booking', 'booking.constants'); module_load_include('inc', 'booking', 'booking.constants');

View File

@@ -1538,6 +1538,7 @@ function booking_view($node, $view_mode) {
$rows[] = array(t('Name:'), t('!first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname))); $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('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('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' ? '<b>Yes</b>' : 'No'))));
$rows[] = array(t('Welfare Required:'), $node->booking_welfare_required == '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('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('Date of birth:'), t('!dob', array('!dob' => format_date($node->booking_dob, 'custom', 'd/m/Y'))));
@@ -1550,7 +1551,7 @@ function booking_view($node, $view_mode) {
$rows[] = array(t('Passport Exact Issued Name:'), $node->booking_passport_issue_name); $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('Passport Issue Location:'), $node->booking_passport_issue_location);
} }
$rows[] = array(t('Committee Member:'), t('!ans', array('!ans' => ($node->booking_committee_member == 'Y' ? 'Yes' : 'No'))));
$rows[] = array(t('Payment Type Selected:'), t('!amount_paid', array('!amount_paid' => $payment_type))); $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('Amount Paid:'), t('!amount_paid', array('!amount_paid' => $node->booking_amount_paid)));
$rows[] = array(t('Total Amount Due:'), t('!amount_paid', array('!amount_paid' => $node->booking_total_pay_reqd))); $rows[] = array(t('Total Amount Due:'), t('!amount_paid', array('!amount_paid' => $node->booking_total_pay_reqd)));
@@ -1670,7 +1671,7 @@ function booking_view($node, $view_mode) {
//watchdog('booking', "<pre>Displaying node studygroups query output:\n@info</pre>", array('@info' => print_r( $studygroups, true))); //watchdog('booking', "<pre>Displaying node studygroups query output:\n@info</pre>", array('@info' => print_r( $studygroups, true)));
for ($i = 1; $i <= STUDYGROUP_COUNT; $i++) for ($i = 1; $i <= variable_get('booking_studygroup_count','0'); $i++)
{ {
$role = ""; $role = "";

View File

@@ -510,6 +510,8 @@ function booking_csv_report() {
//each record //each record
foreach ($result as $record) { foreach ($result as $record) {
//watchdog('booking', "CSV raw data entry: @info", array('@info' => var_export($record, TRUE)));
$output = array(); $output = array();
//each keypair in the record //each keypair in the record
@@ -558,7 +560,7 @@ function booking_csv_report() {
$output[] = $value; $output[] = $value;
//this is really hacky since it does another database query for each person //this is really hacky since it does another database query for each person
//$output[] = _booking_amount_owing($value, 0, FALSE); //$output[] = _booking_amount_owing($value, 0, FALSE);
//$output[] = _booking_amount_owing($value); $output[] = _booking_amount_owing($record);
continue; continue;
} }

View File

@@ -398,7 +398,7 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text
//add a bunch of custom emails //add a bunch of custom emails
for ($i = 1; $i <= CUSTOM_EMAIL_COUNT; $i++) for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++)
{ {
$subject_fieldname = 'booking_email_subject_custom' . $i; $subject_fieldname = 'booking_email_subject_custom' . $i;
$body_fieldname = 'booking_email_custom' . $i; $body_fieldname = 'booking_email_custom' . $i;