fix logic errors
This commit is contained in:
@@ -491,7 +491,7 @@ function booking_variety_sessions_view_summary() {
|
|||||||
$newline[] = "";
|
$newline[] = "";
|
||||||
}
|
}
|
||||||
} //end iterate variety session timeslot list
|
} //end iterate variety session timeslot list
|
||||||
$newline[] = l('Edit', t('admin/config/booking/variety/!tid/csv', array('!tid' => $data->tid))),
|
$newline[] = l('Edit', t('admin/config/booking/variety/registration/!nid/edit', array('!nid' => $person->nid)));
|
||||||
|
|
||||||
//add the line to the array of rows
|
//add the line to the array of rows
|
||||||
$rows[] = $newline;
|
$rows[] = $newline;
|
||||||
@@ -617,34 +617,31 @@ function booking_varietysessions_csv_report($timeslot_id) {
|
|||||||
/**
|
/**
|
||||||
* Build the admin form for editing variety session registrations
|
* Build the admin form for editing variety session registrations
|
||||||
*/
|
*/
|
||||||
function booking_variety_regn_edit_form($node, &$form_state, $variety_regn_id)
|
function booking_variety_regn_edit_form($node, &$form_state, $nid)
|
||||||
{
|
{
|
||||||
global $event;
|
global $event;
|
||||||
$form = array();
|
$form = array();
|
||||||
$data = $node;
|
$data = $node;
|
||||||
$redirect_path = "admin/config/booking/variety/report";
|
$redirect_path = "admin/config/booking/variety/report";
|
||||||
$prefix = "<h3>Edit variety session registration for user</p>"
|
$prefix = "<h3>Edit variety session registration for user</p>";
|
||||||
|
|
||||||
//verify that $variety_regn_id is a number
|
//verify that $variety_regn_id is a number
|
||||||
if (! preg_match('/^[0-9]+$/', $variety_regn_id)) {
|
if (! preg_match('/^[0-9]+$/', $nid)) {
|
||||||
drupal_set_message("Error: Invalid variety session registration ID supplied. Unable to update variety session registration for user.", 'error', FALSE);
|
drupal_set_message("Error: Invalid variety session registration ID supplied. Unable to update variety session registration for user.", 'error', FALSE);
|
||||||
drupal_goto($redirect_path);
|
drupal_goto($redirect_path);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$variety_session_query = db_query("SELECT r.*, p.* FROM {booking_variety_regn} r
|
$person_query = db_query("SELECT * FROM {booking_person_view} WHERE nid = :nid",
|
||||||
inner join {booking_person} p on p.nid = r.booking_person_nid
|
array(':nid' => $nid))->fetchAllAssoc('nid');
|
||||||
WHERE p.booking_eventid = :eid AND r.booking_person_nid = :rid",
|
|
||||||
array(':eid' => $event->eid, ':rid' => $variety_regn_id));
|
|
||||||
$session_details = $variety_session_query->fetchAll();
|
|
||||||
|
|
||||||
if (! $session_details) {
|
if (! $person) {
|
||||||
drupal_set_message("Error: Unable to find matching variety session registration ID. Unable to update variety session registration for user.", 'error', FALSE);
|
drupal_set_message("Error: Could not find matching person. Unable to edit variety session registrations.", 'error', FALSE);
|
||||||
drupal_goto($redirect_path);
|
drupal_goto($redirect_path);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$session_ids = drupal_json_decode($session_details->booking_variety_ids);
|
$session_ids = drupal_json_decode($person_query->booking_variety_ids);
|
||||||
|
|
||||||
// Query the variety timeslot table so we know how many select elements to create
|
// Query the variety timeslot table so we know how many select elements to create
|
||||||
$timeslot_query = db_select('booking_variety_timeslots', 'v');
|
$timeslot_query = db_select('booking_variety_timeslots', 'v');
|
||||||
|
Reference in New Issue
Block a user