disable variety timeslots of non-active event
This commit is contained in:
@@ -317,7 +317,14 @@ function booking_variety_create_session_form_submit($form, &$form_state) {
|
||||
global $event;
|
||||
$values = $form_state['input'];
|
||||
$timeslot_id = $values['tid'];
|
||||
$redirect_path = "admin/booking/variety/$timeslot_id/session/list";
|
||||
|
||||
//verify that $timeslot_id is a number
|
||||
if (! preg_match('/^[0-9]+$/', $timeslot_id)) {
|
||||
$redirect_path = "admin/booking/variety";
|
||||
}
|
||||
else {
|
||||
$redirect_path = "admin/booking/variety/$timeslot_id/session/list";
|
||||
}
|
||||
|
||||
//if we're deleting, add the confirmation to the form if it hasn't been defined yet
|
||||
if($form_state['values']['op'] == 'Delete Session' && (!isset($form_state['storage']['confirm']))) {
|
||||
@@ -385,7 +392,7 @@ function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0
|
||||
}
|
||||
|
||||
$prefix = t("<p>!link</p>",
|
||||
array ('!link' => l('Add New Variety Session', "admin/booking/variety/$timeslot_id/session/create")));
|
||||
array('!link' => l('Add New Variety Session', "admin/booking/variety/$timeslot_id/session/create")));
|
||||
|
||||
$query = db_select ('booking_variety_sessions', 'v');
|
||||
$query->join('booking_variety_timeslots', 't', 'v.booking_variety_timeslot_id = t.tid');
|
||||
@@ -528,7 +535,7 @@ function booking_varietysessions_csv_report($timeslot_id) {
|
||||
|
||||
//retrieve the sessions for the specified timeslot
|
||||
$db_and = db_and();
|
||||
$db_and->condition('v.booking_eventid', $event->eid, '=');
|
||||
//$db_and->condition('v.booking_eventid', $event->eid, '=');
|
||||
$db_and->condition('v.booking_variety_timeslot_id', $timeslot_id, '=');
|
||||
$variety_sessions = db_select('booking_variety_sessions', 'v')
|
||||
->condition($db_and)
|
||||
|
Reference in New Issue
Block a user