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;
|
global $event;
|
||||||
$values = $form_state['input'];
|
$values = $form_state['input'];
|
||||||
$timeslot_id = $values['tid'];
|
$timeslot_id = $values['tid'];
|
||||||
|
|
||||||
|
//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";
|
$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 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']))) {
|
if($form_state['values']['op'] == 'Delete Session' && (!isset($form_state['storage']['confirm']))) {
|
||||||
@@ -528,7 +535,7 @@ function booking_varietysessions_csv_report($timeslot_id) {
|
|||||||
|
|
||||||
//retrieve the sessions for the specified timeslot
|
//retrieve the sessions for the specified timeslot
|
||||||
$db_and = db_and();
|
$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, '=');
|
$db_and->condition('v.booking_variety_timeslot_id', $timeslot_id, '=');
|
||||||
$variety_sessions = db_select('booking_variety_sessions', 'v')
|
$variety_sessions = db_select('booking_variety_sessions', 'v')
|
||||||
->condition($db_and)
|
->condition($db_and)
|
||||||
|
Reference in New Issue
Block a user