start work on admin page for early access codes
This commit is contained in:
41
booking.earlyaccess_admin.inc
Normal file
41
booking.earlyaccess_admin.inc
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Admin pages for managing early access codes
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to summarise information about early access codes
|
||||||
|
*/
|
||||||
|
function booking_earlyaccess_admin() {
|
||||||
|
|
||||||
|
global $event;
|
||||||
|
$output = "";
|
||||||
|
$header = array('Study Group', 'Session Count', 'Reading Group?', 'Edit Definition');
|
||||||
|
$rows = array();
|
||||||
|
$attributes = array('style' => 'max-width:60%');
|
||||||
|
//$attributes = array();
|
||||||
|
|
||||||
|
//get study groups
|
||||||
|
$query = db_select('booking_studygroup_list', 's')
|
||||||
|
->fields('s')
|
||||||
|
->condition('s.booking_eventid', $event->eid, '=');
|
||||||
|
$result = $query->execute();
|
||||||
|
|
||||||
|
foreach ($result as $group) {
|
||||||
|
$rows[] = array(
|
||||||
|
$group->booking_studygroup_descrip,
|
||||||
|
$group->booking_num_group_sessions,
|
||||||
|
$group->booking_is_readinggroup == 'Y' ? 'Yes' : 'No',
|
||||||
|
l(t('Edit Group Definition', array('!id' => $group->sid)), t('admin/config/booking/studygroups/!id/edit', array('!id' => $group->sid))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//output everything
|
||||||
|
$output .= t("<h3>!event Study Groups</h3>", array('!event' => $event->booking_eventname));
|
||||||
|
$output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes));
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
@@ -707,7 +707,17 @@ function booking_menu() {
|
|||||||
'page arguments' => array('booking_event_form', false, 4),
|
'page arguments' => array('booking_event_form', false, 4),
|
||||||
'access arguments' => array('access administration pages'),
|
'access arguments' => array('access administration pages'),
|
||||||
'type' => MENU_CALLBACK,
|
'type' => MENU_CALLBACK,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//manage early access codes
|
||||||
|
$items['admin/config/booking/earlyaccess'] = array(
|
||||||
|
'title' => 'Booking module Early Access Codes',
|
||||||
|
'description' => 'Define and configure Early Access Codes for the Booking module',
|
||||||
|
'page callback' => 'booking_earlyaccess_admin',
|
||||||
|
'access arguments' => array('administer site configuration'),
|
||||||
|
'file' => 'booking.earlyaccess_admin.inc',
|
||||||
|
'type' => MENU_NORMAL_ITEM,
|
||||||
|
);
|
||||||
|
|
||||||
//the paypal IPN
|
//the paypal IPN
|
||||||
$items[BOOKING_PAYPAL_IPN_PATH] = array(
|
$items[BOOKING_PAYPAL_IPN_PATH] = array(
|
||||||
|
@@ -113,9 +113,9 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
|
|||||||
);
|
);
|
||||||
$form['early-access']['booking_earlyaccess_explanation'] = array(
|
$form['early-access']['booking_earlyaccess_explanation'] = array(
|
||||||
'#type' => 'container',
|
'#type' => 'container',
|
||||||
'#children' => t("If you have been given an early-access code for registration, please enter it below." .
|
'#children' => t("<p>If you have been given an early-access code for registration, please enter it below. " .
|
||||||
"Without this code, your registration will not be accepted. " .
|
"Without this code, your registration will not be accepted.</p>" .
|
||||||
"<br /><strong>NOTE: each early-access code can only be used once, so don't pass it along to your friends!</strong>"),
|
"<p><strong>NOTE: each early-access code can only be used once, so don't pass it along to your friends!</strong></p>"),
|
||||||
);
|
);
|
||||||
$form['early-access']['booking_regn_earlyaccess_code'] = array(
|
$form['early-access']['booking_regn_earlyaccess_code'] = array(
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
|
@@ -718,6 +718,7 @@ function booking_csv_report() {
|
|||||||
$nullToMysqlNull = true;
|
$nullToMysqlNull = true;
|
||||||
$delimiter_esc = preg_quote($delimiter, '/');
|
$delimiter_esc = preg_quote($delimiter, '/');
|
||||||
$enclosure_esc = preg_quote($enclosure, '/');
|
$enclosure_esc = preg_quote($enclosure, '/');
|
||||||
|
$readinggroup_id = "";
|
||||||
|
|
||||||
//$readinggroup = "session" . variable_get('booking_readinggroup_id','7');
|
//$readinggroup = "session" . variable_get('booking_readinggroup_id','7');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user