Slight changes

This commit is contained in:
2014-12-01 22:53:45 +11:00
parent e5b825b837
commit 7a0220aa86
12 changed files with 56 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ function booking_balance_page() {
$paypal_form = ""; $paypal_form = "";
//verify that arg(1) is a uuid //verify that arg(1) is a uuid
if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid session ID supplied to the balance payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid session ID supplied to the balance payment page. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('<front>'); drupal_goto('<front>');

View File

@@ -12,7 +12,7 @@ function booking_confirm_page() {
$paypal_form = ""; $paypal_form = "";
//verify that arg(1) is a uuid //verify that arg(1) is a uuid
if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid session ID supplied to the registration confirmation page. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid session ID supplied to the registration confirmation page. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('<front>'); drupal_goto('<front>');
@@ -106,7 +106,7 @@ function booking_confirm_page() {
$form_action = variable_get('booking_paypal_sandbox', 0) ? BOOKING_PAYPAL_SUBMIT_URL_SANDBOX : BOOKING_PAYPAL_SUBMIT_URL; $form_action = variable_get('booking_paypal_sandbox', 0) ? BOOKING_PAYPAL_SUBMIT_URL_SANDBOX : BOOKING_PAYPAL_SUBMIT_URL;
//verify that arg(1) is a uuid //verify that arg(1) is a uuid
if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE);
return ""; return "";
@@ -142,7 +142,7 @@ function booking_confirm_page() {
array('!fee' => $person->booking_price)); array('!fee' => $person->booking_price));
//watchdog('booking', 'Partner name "@info"', array ('@info' => var_export($person->booking_partner_name, TRUE))); //watchdog('booking', 'Partner name "@info"', array ('@info' => var_export($person->booking_partner_name, TRUE)));
if (preg_match('/^(\w*?)\s+(\w*)/', $person->booking_partner_name, $matches)) if (('/^(\w*?)\s+(\w*)/', $person->booking_partner_name, $matches))
{ {
watchdog('booking', 'Spouse checking. Firstname: "!first", surname "!last"', watchdog('booking', 'Spouse checking. Firstname: "!first", surname "!last"',
array ('!first' => $matches[1], '!last' => $matches[2])); array ('!first' => $matches[1], '!last' => $matches[2]));

View File

@@ -115,7 +115,7 @@ function booking_event_form($node, &$form_state, $create, $editid = 0)
else else
{ {
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $editid)) { if (! ('/^[0-9]+$/', $editid)) {
drupal_set_message("Error: Invalid event ID supplied. Unable to update event information.", 'error', FALSE); drupal_set_message("Error: Invalid event ID supplied. Unable to update event information.", 'error', FALSE);
drupal_goto('admin/config/booking/events'); drupal_goto('admin/config/booking/events');
return ""; return "";
@@ -255,7 +255,7 @@ function booking_event_form_submit($form, &$form_state) {
elseif ($form_state['values']['op'] == 'Delete') elseif ($form_state['values']['op'] == 'Delete')
{ {
//verify that booking_eid is a number //verify that booking_eid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_eid'])) { if (! ('/^[0-9]+$/', $values['booking_eid'])) {
drupal_set_message("Error: Invalid event ID supplied. Unable to delete event entry.", 'error', FALSE); drupal_set_message("Error: Invalid event ID supplied. Unable to delete event entry.", 'error', FALSE);
return ""; return "";
} }
@@ -271,7 +271,7 @@ function booking_event_form_submit($form, &$form_state) {
else else
{ {
//verify that booking_eid is a number //verify that booking_eid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_eid'])) { if (! ('/^[0-9]+$/', $values['booking_eid'])) {
drupal_set_message("Error: Invalid event ID supplied. Unable to update event entry.", 'error', FALSE); drupal_set_message("Error: Invalid event ID supplied. Unable to update event entry.", 'error', FALSE);
return ""; return "";
} }

View File

@@ -14,7 +14,7 @@ function booking_partial_balance_page() {
$partial_amount = arg(2); $partial_amount = arg(2);
//verify that arg(1) is a uuid //verify that arg(1) is a uuid
if (! preg_match('/^[0-9A-Fa-f\-]+$/', $temp_id)) { if (! ('/^[0-9A-Fa-f\-]+$/', $temp_id)) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid session ID supplied to the partial payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid session ID supplied to the partial payment page. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('<front>'); drupal_goto('<front>');
@@ -22,7 +22,7 @@ function booking_partial_balance_page() {
} }
//verify that arg(2) is a number //verify that arg(2) is a number
if (! preg_match('/^[0-9]+$/', $partial_amount)) { if (! ('/^[0-9]+$/', $partial_amount)) {
drupal_set_message("Error: Invalid payment amount supplied to the partial payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid payment amount supplied to the partial payment page. Please use the contact us form to let us know.", 'error', FALSE);
drupal_goto('<front>'); drupal_goto('<front>');
return ""; return "";

View File

@@ -115,7 +115,7 @@ function booking_price_form($node, &$form_state, $create, $editid = 0)
else else
{ {
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $editid)) { if (! ('/^[0-9]+$/', $editid)) {
drupal_set_message("Error: Invalid price ID supplied. Unable to update price entry.", 'error', FALSE); drupal_set_message("Error: Invalid price ID supplied. Unable to update price entry.", 'error', FALSE);
drupal_goto('admin/config/booking/prices'); drupal_goto('admin/config/booking/prices');
return ""; return "";
@@ -240,7 +240,7 @@ function booking_price_form_submit($form, &$form_state) {
elseif ($form_state['values']['op'] == 'Delete') elseif ($form_state['values']['op'] == 'Delete')
{ {
//verify that booking_pid is a number //verify that booking_pid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_pid'])) { if (! ('/^[0-9]+$/', $values['booking_pid'])) {
drupal_set_message("Error: Invalid price ID supplied. Unable to delete price entry.", 'error', FALSE); drupal_set_message("Error: Invalid price ID supplied. Unable to delete price entry.", 'error', FALSE);
return ""; return "";
} }
@@ -259,7 +259,7 @@ function booking_price_form_submit($form, &$form_state) {
} else { } else {
//verify that booking_pid is a number //verify that booking_pid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_pid'])) { if (! ('/^[0-9]+$/', $values['booking_pid'])) {
drupal_set_message("Error: Invalid price ID supplied. Unable to update price entry.", 'error', FALSE); drupal_set_message("Error: Invalid price ID supplied. Unable to update price entry.", 'error', FALSE);
return ""; return "";
} }

View File

@@ -129,9 +129,9 @@ function booking_report_summary() {
} }
//define the row for this person //define the row for this person
$this_row[] = l(t('View !id', array('!id' => $person->nid)), t('node/!id', array('!id' => $person->nid))); $this_row[] = l(t('Edit !id', array('!id' => $person->nid)), t('node/!id/edit', array('!id' => $person->nid)));
$this_row[] = l(t('!first !last', array('!first' => ucwords($person->booking_firstname), '!last' => ucwords($person->booking_lastname))), $this_row[] = l(t('!first !last', array('!first' => ucwords($person->booking_firstname), '!last' => ucwords($person->booking_lastname))),
t('node/!id/edit', array('!id' => $person->nid)) t('node/!id', array('!id' => $person->nid))
); );
$this_row[] = _booking_status_generate($person->booking_status); $this_row[] = _booking_status_generate($person->booking_status);
@@ -586,7 +586,7 @@ function booking_csv_report() {
global $event; global $event;
$name = 'bookings-' . format_date(time(), 'custom', 'Y-m-d-His'); $name = 'bookings-' . format_date(time(), 'custom', 'Y-m-d-His');
$filename = file_directory_temp() . '/' . $name; $filename = file_directory_temp() . '/' . $name;
$csv = '';
$delimiter = ','; $delimiter = ',';
$enclosure = '"'; $enclosure = '"';
$encloseAll = true; $encloseAll = true;
@@ -641,7 +641,7 @@ function booking_csv_report() {
//watchdog('booking', "CSV raw data: @info", array('@info' => var_export($result, TRUE))); //watchdog('booking', "CSV raw data: @info", array('@info' => var_export($result, TRUE)));
//open the filehandle //open the filehandle
$handle = @fopen($filename, 'w'); //$handle = @fopen($filename, 'w');
//write the header based on the first result //write the header based on the first result
$header_array = array(); $header_array = array();
@@ -660,8 +660,8 @@ function booking_csv_report() {
$header = implode( $delimiter, $header_array ); $header = implode( $delimiter, $header_array );
//watchdog('booking', "CSV header: @info", array('@info' => var_export($header_array, TRUE))); //watchdog('booking', "CSV header: @info", array('@info' => var_export($header_array, TRUE)));
@fwrite($handle, $header . "\n"); //@fwrite($handle, $header . "\n");
$csv .= $header . "\n";
//each record //each record
foreach ($result as $record) { foreach ($result as $record) {
@@ -754,16 +754,27 @@ function booking_csv_report() {
$row = implode($delimiter, $output) . "\n"; $row = implode($delimiter, $output) . "\n";
@fwrite($handle, $row); //@fwrite($handle, $row);
$csv .= $row;
//$index++; //$index++;
} }
@fclose($handle); //@fclose($handle);
//see http://stackoverflow.com/questions/4348802/how-can-i-output-a-utf-8-csv-in-php-that-excel-will-read-properly
// but none of these options seem to work
drupal_add_http_header("Content-type", "application/octet-stream; charset=utf-8"); drupal_add_http_header("Content-type", "application/octet-stream; charset=utf-8");
//drupal_add_http_header("Content-type", "application/octet-stream; charset=UTF-16LE");
//drupal_add_http_header("Content-Type: application/vnd.ms-excel");
drupal_add_http_header("Content-Disposition", "attachment; filename=" . $name . ".csv"); drupal_add_http_header("Content-Disposition", "attachment; filename=" . $name . ".csv");
@readfile($filename); // @readfile($filename);
@unlink($filename); //print chr(255) . chr(254);
//print 'sep=,' . "\n";
print $csv;
//print mb_convert_encoding($csv, 'UTF-16LE', 'UTF-8');
//@unlink($filename);
exit(0); exit(0);
} }

View File

@@ -130,7 +130,7 @@ function booking_room_edit_form($node, &$form_state, $nid) {
$location_options[] = "--"; $location_options[] = "--";
//verify that $nid is a number //verify that $nid is a number
if (! preg_match('/^[0-9]+$/', $nid)) { if (! ('/^[0-9]+$/', $nid)) {
drupal_set_message("Error: Invalid registration ID '" . $nid . "' supplied. Unable to edit study group sessions.", 'error', FALSE); drupal_set_message("Error: Invalid registration ID '" . $nid . "' supplied. Unable to edit study group sessions.", 'error', FALSE);
drupal_goto('admin/booking/rooms'); drupal_goto('admin/booking/rooms');
return ""; return "";
@@ -449,7 +449,7 @@ function booking_rooms_allocate_form($node, &$form_state, $location_id) {
$counter = 0; $counter = 0;
//verify that $location_id is a number //verify that $location_id is a number
if (! preg_match('/^[0-9]+$/', $location_id)) { if (! ('/^[0-9]+$/', $location_id)) {
drupal_set_message("Error: Invalid room location ID '" . $location_id . "' supplied. Unable to allocate rooms.", 'error', FALSE); drupal_set_message("Error: Invalid room location ID '" . $location_id . "' supplied. Unable to allocate rooms.", 'error', FALSE);
drupal_goto('admin/booking/rooms'); drupal_goto('admin/booking/rooms');
return ""; return "";
@@ -817,7 +817,7 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
$form = array(); $form = array();
//verify that $location_id is a number //verify that $location_id is a number
if (! preg_match('/^[0-9]+$/', $location_id)) { if (! ('/^[0-9]+$/', $location_id)) {
drupal_set_message("Error: Invalid room location ID '" . $location_id . "' supplied. Unable to allocate rooms.", drupal_set_message("Error: Invalid room location ID '" . $location_id . "' supplied. Unable to allocate rooms.",
'error', FALSE); 'error', FALSE);
drupal_goto('admin/booking/rooms'); drupal_goto('admin/booking/rooms');

View File

@@ -64,7 +64,7 @@ function booking_roomlocation_define_form($node, &$form_state, $create, $editid
{ {
drupal_set_title('Edit Room Location'); drupal_set_title('Edit Room Location');
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $editid)) { if (! ('/^[0-9]+$/', $editid)) {
drupal_set_message("Error: Invalid room location ID supplied. Unable to edit room location definition.", 'error', FALSE); drupal_set_message("Error: Invalid room location ID supplied. Unable to edit room location definition.", 'error', FALSE);
drupal_goto('admin/config/booking/rooms'); drupal_goto('admin/config/booking/rooms');
return ""; return "";
@@ -177,7 +177,7 @@ function booking_roomlocation_define_form_submit($form, &$form_state) {
elseif ($form_state['values']['op'] == 'Delete') elseif ($form_state['values']['op'] == 'Delete')
{ {
//verify that booking_lid is a number //verify that booking_lid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_lid'])) { if (! ('/^[0-9]+$/', $values['booking_lid'])) {
drupal_set_message("Error: Invalid room location ID supplied. Unable to delete entry.", 'error', FALSE); drupal_set_message("Error: Invalid room location ID supplied. Unable to delete entry.", 'error', FALSE);
return ""; return "";
} }
@@ -192,7 +192,7 @@ function booking_roomlocation_define_form_submit($form, &$form_state) {
{ {
//verify that booking_sid is a number //verify that booking_sid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_lid'])) { if (! ('/^[0-9]+$/', $values['booking_lid'])) {
drupal_set_message("Error: Invalid room location ID supplied. Unable to update room location definition.", 'error', FALSE); drupal_set_message("Error: Invalid room location ID supplied. Unable to update room location definition.", 'error', FALSE);
return ""; return "";
} }
@@ -335,7 +335,7 @@ function booking_rooms_definition_form($node, &$form_state, $create, $room_id =
else else
{ {
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $room_id)) { if (! ('/^[0-9]+$/', $room_id)) {
drupal_set_message("Error: Invalid room ID supplied. Unable to update room definition.", 'error', FALSE); drupal_set_message("Error: Invalid room ID supplied. Unable to update room definition.", 'error', FALSE);
drupal_goto('admin/config/booking/rooms'); drupal_goto('admin/config/booking/rooms');
return ""; return "";

View File

@@ -26,7 +26,7 @@ function booking_available_leadhelp_select_form($node, &$form_state, $group_id)
); );
//verify that $group_id is a number //verify that $group_id is a number
if (! preg_match('/^[0-9]+$/', $group_id)) { if (! ('/^[0-9]+$/', $group_id)) {
drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to edit group leaders and helpers.", 'error', FALSE); drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to edit group leaders and helpers.", 'error', FALSE);
drupal_goto('admin/booking/studygroups'); drupal_goto('admin/booking/studygroups');
return ""; return "";
@@ -383,7 +383,7 @@ function booking_studygroups_edit_form($node, &$form_state, $nid) {
$readinggroup_options[0] = ''; $readinggroup_options[0] = '';
//verify that $nid is a number //verify that $nid is a number
if (! preg_match('/^[0-9]+$/', $nid)) { if (! ('/^[0-9]+$/', $nid)) {
drupal_set_message("Error: Invalid registration ID '" . $nid . "' supplied. Unable to edit study group sessions.", 'error', FALSE); drupal_set_message("Error: Invalid registration ID '" . $nid . "' supplied. Unable to edit study group sessions.", 'error', FALSE);
drupal_goto('admin/booking/studygroups'); drupal_goto('admin/booking/studygroups');
return ""; return "";
@@ -522,7 +522,7 @@ function booking_studygroups_edit_form_submit($form, &$form_state) {
$values = $form_state['input']; $values = $form_state['input'];
//check that $values['personid'] is a number //check that $values['personid'] is a number
if (! preg_match('/^[0-9]+$/', $values['personid'])) { if (! ('/^[0-9]+$/', $values['personid'])) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid form data supplied. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid form data supplied. Please use the contact us form to let us know.", 'error', FALSE);
return ""; return "";
@@ -979,7 +979,7 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
$inserts_to_confirm = array(); $inserts_to_confirm = array();
//verify that $nid is a number //verify that $nid is a number
if (! preg_match('/^[0-9]+$/', $sid)) { if (! ('/^[0-9]+$/', $sid)) {
drupal_set_message("Error: Invalid group ID '" . $sid . "' supplied. Unable to update study group session.", 'error', FALSE); drupal_set_message("Error: Invalid group ID '" . $sid . "' supplied. Unable to update study group session.", 'error', FALSE);
drupal_goto('admin/booking/studygroups'); drupal_goto('admin/booking/studygroups');
return ""; return "";
@@ -1484,7 +1484,7 @@ function booking_studygroups_printview_form($node, &$form_state, $group_id) {
//verify that $group_id is a number //verify that $group_id is a number
if (! preg_match('/^[0-9]+$/', $group_id)) { if (! ('/^[0-9]+$/', $group_id)) {
drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to view group membership.", 'error', FALSE); drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to view group membership.", 'error', FALSE);
drupal_goto('admin/config/booking'); drupal_goto('admin/config/booking');
return ""; return "";
@@ -1612,7 +1612,7 @@ function booking_studygroups_view_form($node, &$form_state, $group_id) {
); );
*/ */
//verify that $group_id is a number //verify that $group_id is a number
if (! preg_match('/^[0-9]+$/', $group_id)) { if (! ('/^[0-9]+$/', $group_id)) {
drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to view group membership.", 'error', FALSE); drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to view group membership.", 'error', FALSE);
drupal_goto('admin/config/booking'); drupal_goto('admin/config/booking');
return ""; return "";

View File

@@ -96,7 +96,7 @@ function booking_studygroups_define_form($node, &$form_state, $create, $editid =
{ {
drupal_set_title('Edit Study Group'); drupal_set_title('Edit Study Group');
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $editid)) { if (! ('/^[0-9]+$/', $editid)) {
drupal_set_message("Error: Invalid study group ID supplied. Unable to edit study group definition.", 'error', FALSE); drupal_set_message("Error: Invalid study group ID supplied. Unable to edit study group definition.", 'error', FALSE);
drupal_goto('admin/booking/config/studygroups'); drupal_goto('admin/booking/config/studygroups');
return ""; return "";
@@ -220,7 +220,7 @@ function booking_studygroups_define_form_submit($form, &$form_state) {
elseif ($form_state['values']['op'] == 'Delete Study Group Definition') elseif ($form_state['values']['op'] == 'Delete Study Group Definition')
{ {
//verify that booking_pid is a number //verify that booking_pid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_sid'])) { if (! ('/^[0-9]+$/', $values['booking_sid'])) {
drupal_set_message("Error: Invalid studygroup ID supplied. Unable to delete entry.", 'error', FALSE); drupal_set_message("Error: Invalid studygroup ID supplied. Unable to delete entry.", 'error', FALSE);
return ""; return "";
} }
@@ -238,7 +238,7 @@ function booking_studygroups_define_form_submit($form, &$form_state) {
{ {
//verify that booking_sid is a number //verify that booking_sid is a number
if (! preg_match('/^[0-9]+$/', $values['booking_sid'])) { if (! ('/^[0-9]+$/', $values['booking_sid'])) {
drupal_set_message("Error: Invalid studygroup ID supplied. Unable to update study group.", 'error', FALSE); drupal_set_message("Error: Invalid studygroup ID supplied. Unable to update study group.", 'error', FALSE);
return ""; return "";
} }

View File

@@ -9,7 +9,7 @@ function booking_travel_page() {
$return_array = array(); $return_array = array();
//verify that arg(1) is a uuid //verify that arg(1) is a uuid
if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE);
return ""; return "";
@@ -418,7 +418,7 @@ function travel_form_submit($form, &$form_state) {
//watchdog('booking', 'Submitting travel form: @info', array('@info' => var_export($values, TRUE))); //watchdog('booking', 'Submitting travel form: @info', array('@info' => var_export($values, TRUE)));
//check that $values['personid'] is a number //check that $values['personid'] is a number
if (! preg_match('/^[0-9]+$/', $values['personid'])) { if (! ('/^[0-9]+$/', $values['personid'])) {
//parameter from url is not what we were expecting //parameter from url is not what we were expecting
drupal_set_message("Error: Invalid form data supplied. Please use the contact us form to let us know.", 'error', FALSE); drupal_set_message("Error: Invalid form data supplied. Please use the contact us form to let us know.", 'error', FALSE);
return ""; return "";

View File

@@ -76,7 +76,7 @@ function booking_variety_timeslot_form($node, &$form_state, $create, $editid = 0
else else
{ {
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $editid)) { if (! ('/^[0-9]+$/', $editid)) {
drupal_set_message("Error: Invalid variety ID supplied. Unable to update variety session information.", 'error', FALSE); drupal_set_message("Error: Invalid variety ID supplied. Unable to update variety session information.", 'error', FALSE);
drupal_goto('admin/config/booking/variety'); drupal_goto('admin/config/booking/variety');
return ""; return "";
@@ -177,7 +177,7 @@ function booking_variety_timeslot_form_submit($form, &$form_state) {
elseif ($form_state['values']['op'] == 'Delete') elseif ($form_state['values']['op'] == 'Delete')
{ {
//verify that tid is a number //verify that tid is a number
if (! preg_match('/^[0-9]+$/', $values['tid'])) { if (! ('/^[0-9]+$/', $values['tid'])) {
drupal_set_message("Error: Invalid variety timeslot ID supplied. Unable to delete entry.", 'error', FALSE); drupal_set_message("Error: Invalid variety timeslot ID supplied. Unable to delete entry.", 'error', FALSE);
return ""; return "";
} }
@@ -193,7 +193,7 @@ function booking_variety_timeslot_form_submit($form, &$form_state) {
else else
{ {
//verify that booking_eid is a number //verify that booking_eid is a number
if (! preg_match('/^[0-9]+$/', $values['tid'])) { if (! ('/^[0-9]+$/', $values['tid'])) {
drupal_set_message("Error: Invalid variety session timeslot ID supplied. Unable to update entry.", 'error', FALSE); drupal_set_message("Error: Invalid variety session timeslot ID supplied. Unable to update entry.", 'error', FALSE);
return ""; return "";
} }
@@ -222,7 +222,7 @@ function booking_variety_create_session_form($node, &$form_state, $timeslot_id =
$data = $node; $data = $node;
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $timeslot_id)) { if (! ('/^[0-9]+$/', $timeslot_id)) {
drupal_set_message("Error: Invalid variety ID supplied. Unable to update variety session information.", 'error', FALSE); drupal_set_message("Error: Invalid variety ID supplied. Unable to update variety session information.", 'error', FALSE);
drupal_goto('admin/config/booking/variety'); drupal_goto('admin/config/booking/variety');
return ""; return "";
@@ -307,7 +307,7 @@ function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0
$data = $node; $data = $node;
//verify that $editid is a number //verify that $editid is a number
if (! preg_match('/^[0-9]+$/', $timeslot_id)) { if (! ('/^[0-9]+$/', $timeslot_id)) {
drupal_set_message("Error: Invalid variety ID supplied. Unable to select variety session information.", 'error', FALSE); drupal_set_message("Error: Invalid variety ID supplied. Unable to select variety session information.", 'error', FALSE);
drupal_goto('admin/config/booking/variety'); drupal_goto('admin/config/booking/variety');
return ""; return "";