示例#1
0
 function process()
 {
     $edit = $_POST['edit'];
     $this->template_name = 'pages/event/edit.tpl';
     $this->smarty->assign('event_types', $this->event_types);
     $this->smarty->assign('currency_codes', getCurrencyCodes());
     $this->smarty->assign('time_choices', getOptionsFromTimeRange(00, 2400, 30));
     $this->smarty->assign('yes_no', array('No', 'Yes'));
     $this->smarty->assign('seasons', getOptionsFromQuery("SELECT id AS theKey, display_name AS theValue FROM season ORDER BY year, id"));
     if ($edit['step'] == 'perform') {
         $errors = $this->check_input_errors($edit);
         if (count($errors) > 0) {
             $this->smarty->assign('edit', $edit);
             $this->smarty->assign('formErrors', $errors);
             return true;
         }
         $this->perform($edit);
         local_redirect(url("event/view/" . $this->event->registration_id));
     } else {
         # Smarty form auto-fill can't handle booleans directly,
         # so we substitute:
         $this->event->multiple = $this->event->multiple ? 1 : 0;
         $this->event->anonymous = $this->event->anonymous ? 1 : 0;
         $this->smarty->assign('edit', (array) $this->event);
     }
     return true;
 }
示例#2
0
 function generateForm($datestamp)
 {
     $this->smarty->assign('field', $this->field);
     $this->smarty->assign('start_date', $datestamp);
     // TODO: replace getOptionsFromTimeRange with smarty plugin
     // TODO: implement for each field a usual_start_time to use as the start_time value
     $this->smarty->assign('start_time', '18:30');
     $this->smarty->assign('end_time', '---');
     $this->smarty->assign('start_end_times', getOptionsFromTimeRange(00, 2400, 5));
     $weekday = strftime("%A", $datestamp);
     $sth = League::query(array('_day' => $weekday, 'status' => 'open', '_order' => 'l.league_id'));
     $leagues = array();
     while ($league = $sth->fetchObject('League', array(LOAD_OBJECT_ONLY))) {
         $leagues[$league->league_id] = "({$league->season_name}) {$league->fullname}";
     }
     $this->smarty->assign('leagues', $leagues);
     // TODO: perhaps have a repeat_until date instead?
     $this->smarty->assign('repeat_options', getOptionsFromRange(1, 24));
     return true;
 }
示例#3
0
 function generateForm($datestamp)
 {
     $this->smarty->assign('field', $this->field);
     $this->smarty->assign('start_date', $datestamp);
     $this->smarty->assign('start_time', '18:30');
     $this->smarty->assign('end_time', '---');
     $this->smarty->assign('start_end_times', getOptionsFromTimeRange(00, 2400, 5));
     $weekday = strftime("%A", $datestamp);
     $leagues = array();
     $sth = League::query(array('_day' => $weekday, 'status' => 'open'));
     $leagues = array();
     while ($league = $sth->fetchObject('League', array(LOAD_OBJECT_ONLY))) {
         $leagues[$league->league_id] = "{$league->season_name} - {$league->fullname}";
     }
     $this->smarty->assign('leagues', $leagues);
     $this->smarty->assign('repeat_options', getOptionsFromRange(1, 24));
     return true;
 }