more tweaks
This commit is contained in:
@@ -108,6 +108,7 @@ function booking_roomallocations_view_summary() {
|
||||
|
||||
/**
|
||||
* Function for manually assigning study group sessions for a person
|
||||
* @see http://drupal.stackexchange.com/questions/10112/dynamic-select-list-in-the-form-dependent-dropdown
|
||||
*/
|
||||
function booking_room_edit_form($node, &$form_state, $nid) {
|
||||
global $event;
|
||||
@@ -279,6 +280,8 @@ function _booking_get_roomedit_bedtype_options($location_id, $room_num) {
|
||||
* Validate the submission to update allocated room and bed for a person
|
||||
*/
|
||||
function booking_room_edit_form_validate($form, &$form_state) {
|
||||
//TODO: turn this into a generalised helper function, and use it for validating booking_rooms_allocate_form() also
|
||||
|
||||
global $event;
|
||||
$values = $form_state['input'];
|
||||
$bed_inputs = array(
|
||||
@@ -295,8 +298,8 @@ function booking_room_edit_form_validate($form, &$form_state) {
|
||||
$mappings = db_query("SELECT count(*) as num FROM {booking_room_mapping} WHERE booking_eventid = :eid AND booking_roomid = :rid AND booking_room_bedtype = :type",
|
||||
array(':eid' => $event->eid, ':rid' => $details->rid, ':type' => $values['booking_room_bedtype']))->fetchObject();
|
||||
|
||||
watchdog('booking', "<pre>Max beds of type !type for this room:\n@info</pre>",
|
||||
array('!type' => $bed_inputs[$values['booking_room_bedtype']], '@info' => print_r( $mappings, true)));
|
||||
//watchdog('booking', "<pre>Max beds of type !type for this room:\n@info</pre>",
|
||||
// array('!type' => $bed_inputs[$values['booking_room_bedtype']], '@info' => print_r( $mappings, true)));
|
||||
|
||||
//make sure the value exists before validating it
|
||||
if (!empty($values['booking_room_bedtype']))
|
||||
|
@@ -562,7 +562,11 @@ function booking_token_info() {
|
||||
);
|
||||
$info['tokens']['booking']['room-allocation'] = array(
|
||||
'name' => t('Room Allocation'),
|
||||
'description' => t('Listing of room allocated to attendee.')
|
||||
'description' => t('Details of room allocated to attendee.')
|
||||
);
|
||||
$info['tokens']['booking']['bed-type'] = array(
|
||||
'name' => t('Bed Type'),
|
||||
'description' => t('The bed type allocated to attendee.')
|
||||
);
|
||||
$info['tokens']['booking']['travel-link'] = array(
|
||||
'name' => t('Travel form Link'),
|
||||
@@ -686,6 +690,7 @@ function booking_define_personspecific_tokens($node)
|
||||
$tokens['travel-summary'] = _booking_travelform_email_summary($node);
|
||||
$tokens['studygroup-summary'] = _booking_studygroup_email_summary($node);
|
||||
$tokens['room-allocation'] = _booking_room_email_summary($node);
|
||||
$tokens['bed-type'] = _booking_room_bedtype_lookup($node->booking_room_bedtype);
|
||||
|
||||
return $tokens;
|
||||
}
|
Reference in New Issue
Block a user