code cleanup

This commit is contained in:
Nathan Coad
2019-09-10 19:08:26 +10:00
parent e8df551c94
commit a3472d6fb4
7 changed files with 20 additions and 23 deletions

View File

@@ -12,11 +12,8 @@ function booking_variety_admin() {
// tableselect with text fields http://drupal.stackexchange.com/questions/75950/tableselect-with-textfields/82763#82763
// inline edit buttons http://drupal.stackexchange.com/questions/31942/how-do-i-add-an-edit-button-on-each-row-of-a-tableselect-form-element
// tabledrag example http://dropbucket.org/node/204
$form = array ();
$options = array ();
//$result = db_query("SELECT * FROM {booking_variety_timeslots}");
//$result = db_query("SELECT * FROM {booking_variety_timeslots} WHERE booking_eventid = :eid",
// array(':eid' => $event->eid));
$form = array();
$options = array();
$query = db_select('booking_variety_timeslots', 't');
$query->leftJoin('booking_event', 'e', 't.booking_eventid = e.eid');
@@ -69,8 +66,8 @@ function booking_variety_admin() {
*/
function booking_variety_timeslot_form($node, &$form_state, $create, $editid = 0) {
global $event;
$form = array ();
$prefix = "<p>Add a new variety session timeslot for the bookings module.</p>";
$form = array();
$prefix = t("<p>Add a new variety session timeslot for !event variety sessions.</p>", array('!event' => $event->booking_eventname));
if ($create == true) {
$data = $node;
@@ -217,7 +214,7 @@ function booking_variety_timeslot_form_submit($form, &$form_state) {
*/
function booking_variety_create_session_form($node, &$form_state, $create = TRUE, $timeslot_id = 0, $session_id = 0) {
global $event;
$form = array ();
$form = array();
$prefix = "";
//add this to the form in a hidden field so we can update the right event
@@ -376,8 +373,8 @@ function booking_variety_create_session_form_submit($form, &$form_state) {
function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0)
{
global $event;
$form = array ();
$options = array ();
$form = array();
$options = array();
$data = $node;
//verify that $editid is a number