show the waiting list form when the event is sold out

@return WaitingListRegistrationForm
967023
public function WaitingListRegistrationForm()
    {
        if (
            $this->owner->Tickets()->count()
            && $this->owner->getTicketsSoldOut()
            && !$this->owner->getEventExpired()
        ) {
            return new WaitingListRegistrationForm($this->owner, 'WaitingListRegistrationForm');
        } else {
            return null;
        }
    }
1228513
private function done(){
		$rtn = $this->form_endpoint->render(
			'form_delete_done.html',
			array(
				'href_backto'=>$this->form_endpoint->generate_url($this->table_name),
			)
		);

		$rtn = $this->form_endpoint->wrap_theme($rtn);
		return $rtn;
	}
913810
public function ItemEditForm() {
        $list=$this->gridField->getList();
        
        if(empty($this->record)) {
            $controller=$this->getToplevelController();
            $noActionURL=$controller->removeAction($_REQUEST['url']);
            
            $controller->getResponse()->removeHeader('Location');   //clear the existing redirect
            
            return $controller->redirect($noActionURL, 302);
        }

        $canView=$this->record->canView();
        $canEdit=$this->record->canEdit();
        $canDelete=$this->record->canDelete();
        $canCreate=$this->record->canCreate();

        if(!$canView) {
            return $this->getToplevelController()->httpError(403);
        }
        
        $actions=new FieldList();
        if($this->record->ID!==0) {
            if($canEdit) {
                $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Save', 'Save'))
                                                ->setUseButtonTag(true)
                                                ->addExtraClass('ss-ui-action-constructive')
                                                ->setAttribute('data-icon', 'accept'));
            }
            
            if($canDelete) {
                $actions->push(FormAction::create('doDelete', _t('GridFieldDetailForm.Delete', 'Delete'))
                                                ->setUseButtonTag(true)
                                                ->addExtraClass('ss-ui-action-destructive action-delete'));
            }
        }else { // adding new record
            //Change the Save label to 'Create'
            $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Create', 'Create'))
                                            ->setUseButtonTag(true)
                                            ->addExtraClass('ss-ui-action-constructive')
                                            ->setAttribute('data-icon', 'add'));
            
            // Add a Cancel link which is a button-like link and link back to one level up.
            $curmbs = $this->Breadcrumbs();
            if($curmbs && $curmbs->count()>=2){
                $one_level_up = $curmbs->offsetGet($curmbs->count()-2);
                $text=sprintf(
                    "<a class=\"%s\" href=\"%s\">%s</a>",
                    "crumb ss-ui-button ss-ui-action-destructive cms-panel-link ui-corner-all", // CSS classes
                    $one_level_up->Link, // url
                    _t('GridFieldDetailForm.CancelBtn', 'Cancel') // label
                );
                
                $actions->push(new LiteralField('cancelbutton', $text));
            }
        }
        
        // If we are creating a new record in a has-many list, then
        // pre-populate the record's foreign key.
        if($list instanceof HasManyList && !$this->record->isInDB()) {
            $key=$list->getForeignKey();
            $id=$list->getForeignID();
            $this->record->$key=$id;
        }
        
        $fields=$this->component->getFields();
        if(!$fields) {
            $fields=($this->record->hasMethod('getFrontEndFields') ? $this->record->getFrontEndFields():$this->record->getCMSFields());
        }
        
        // If we are creating a new record in a has-many list, then
        // Disable the form field as it has no effect.
        if($list instanceof HasManyList) {
            $key=$list->getForeignKey();
            
            if($field=$fields->dataFieldByName($key)) {
                $fields->makeFieldReadonly($field);
            }
        }
        
        // this pushes the current page ID in as a hidden field
        // this means the request will have the current page ID in it
        // rather than relying on session which can have been rewritten
        // by the user having another tab open
        // see LeftAndMain::currentPageID
        if($this->controller->hasMethod('currentPageID') && $this->controller->currentPageID()) {
            $fields->push(new HiddenField('CMSMainCurrentPageID', null, $this->controller->currentPageID()));
        }
        
        // Caution: API violation. Form expects a Controller, but we are giving it a RequestHandler instead.
        // Thanks to this however, we are able to nest GridFields, and also access the initial Controller by
        // dereferencing GridFieldDetailForm_ItemRequest->getController() multiple times. See getToplevelController
        // below.
        $form=new Form(
            $this,
            'ItemEditForm',
            $fields,
            $actions,
            $this->component->getValidator()
        );
        
        $form->loadDataFrom($this->record, ($this->record->ID==0 ? Form::MERGE_IGNORE_FALSEISH:Form::MERGE_DEFAULT));
        
        if($this->record->ID && !$canEdit) {
            // Restrict editing of existing records
            $form->makeReadonly();
            
            // Hack to re-enable delete button if user can delete
            if($canDelete) {
                $form->Actions()->fieldByName('action_doDelete')->setReadonly(false);
            }
        }else if(!$this->record->ID && !$canCreate) {
            // Restrict creation of new records
            $form->makeReadonly();
        }
        
        // Load many_many extraData for record.
        // Fields with the correct 'ManyMany' namespace need to be added manually through getCMSFields().
        if($list instanceof ManyManyList) {
            $extraData=$list->getExtraData('', $this->record->ID);
            $form->loadDataFrom(array('ManyMany' => $extraData));
        }
        
        $cb=$this->component->getItemEditFormCallback();
        if($cb) {
            $cb($form, $this);
        }
        
        $this->extend("updateItemEditForm", $form);
        return $form;
    }
437166
public function form() {
		if(is_null($this->registration_form)) {
			$this->registration_form = new Form();
			$this->registration_form->registerTemplate();
			$this->registerFeature('jabber:iq:register');
		}
		return $this->registration_form;
	}
65026
public synchronized RegistrationPoint getOldestRegistrationPoint() {
        return registrationPoints.size() == 0 ? null : registrationPoints.values().iterator().next().get(0);
    }
342654
public function indexAction()
    {
        $visibilityService = $this->getVisibilityService();
        $options = $visibilityService->getOptions();

        $widgetId = $options->getWidgetId();
        if (! $widgetId) {
            $this->flashMessenger()->addMessage(
                $this->scTranslate('The widget identifier was not specified.')
            );
            return $this->redirect()
                ->toRoute('sc-admin/layout')
                ->setStatusCode(303);
        }

        $widget = $this->deriveWidget($widgetId);
        if (empty($widget)) {
            return $this->getResponse();
        }
        if ($this->getRequest()->isPost()) {
            $event = $this->request->getPost('suboperation');
            if (! empty($event)) {
                $events = $this->getEventManager();
                $params = $this->getRequest()->getPost();
                $params['widget_id'] = $widget->getId();
                $result = $events->trigger($event, $this, $params);
                if ($result->last() instanceof Response) {
                    return $result->last();
                }
            }
        }

        $view = new ViewModel;
        $view->options = $options;
        $view->widget = $widget;

        $moduleOptions = $this->getModuleOptions();
        $view->config = $moduleOptions->getWidgetByName($widget->getName());

        $view->list = $visibilityService->getContentList();
        $visibilityService->saveOptions();

        return $view;
    }
138259
public function get_search_form()
    {
        $data = [];

        if (\function_exists('random_int')) {
            try {
                $data['searchform_id'] = 'search_' . \random_int(1000, 8000);
            } catch (\Exception $e) {
                // Fail silently.
            }
        }

        if (! isset($data['searchform_id'])) {
            $data = [
                'searchform_id' => \uniqid('search_', true),
            ];
        }

        \ob_start();
        View::partial('searchform', $data);
        $form = \ob_get_clean();

        return $form;
    }
960666
private function getEditableTickets()
    {
        $tickets = ArrayList::create();
        foreach ($this->getTickets() as $ticket) {
            /** @var Ticket $ticket */
            $fieldName = $this->name . "[{$ticket->ID}][Amount]";
            $range = range($ticket->OrderMin, $ticket->OrderMax);

            $ticket->AmountField = DropdownField::create($fieldName, 'Amount', array_combine($range, $range))
                ->setHasEmptyDefault(true)
                ->setEmptyString(_t('TicketsField.EMPTY', 'Tickets'));

            // Set the first to hold the minimum
            if ($this->getTickets()->count() === 1) {
                $ticket->AmountField->setValue($ticket->OrderMin);
            }

            $availability = $ticket->Event()->getAvailability();
            if ($availability < $ticket->OrderMax) {
                $disabled = range($availability + 1, $ticket->OrderMax);
                $ticket->AmountField->setDisabledItems(array_combine($disabled, $disabled));
            }

            if (!$ticket->getAvailable()) {
                $ticket->AmountField->setDisabled(true);
            }

            $tickets->push($ticket);
        }
        return $tickets;
    }
514259
protected function _prepareForm()
    {
        $form = $this->formFactory->create();
        $this->setForm($form);

        /** @var \Mirasvit\Blog\Model\Post $post */
        $post = $this->registry->registry('current_model');

        $fieldset = $form->addFieldset('publish_fieldset', [
            'class'  => 'blog__post-fieldset',
            'legend' => __('Publish'),
        ]);

        $fieldset->addField('status', 'select', [
            'label'  => __('Status'),
            'name'   => 'post[status]',
            'value'  => $post->getStatus(),
            'values' => $this->status->toOptionArray(),
        ]);

        $fieldset->addField('created_at', 'date', [
            'label'       => __('Published on'),
            'name'        => 'post[created_at]',
            'value'       => $post->getCreatedAt(),
            'date_format' => 'MMM d, y',
            'time_format' => 'h:mm a',
        ]);

        $fieldset->addField('is_pinned', 'checkbox', [
            'label'   => __('Pin post at the top'),
            'name'    => 'post[is_pinned]',
            'value'   => 1,
            'checked' => $post->getIsPinned(),
        ]);

        return parent::_prepareForm();
    }
1142916
public function getEventRecentAdded(){
        $select = $this->tableGateway->getSql()->select();
        $select->join('melis_core_user', 'melis_core_user.usr_id = melis_calendar.cal_created_by');
        $select->limit(10);
        $select->order('cal_id DESC');
        $dataCalendar = $this->tableGateway->selectWith($select);
        
        return $dataCalendar;
    }
12500
public function display()
    {
        $options = $this->getOptions();

        if (!$this->visible || $options === null) {
            return;
        }

        SwatWidget::display();

        // add a hidden field so we can check if this list was submitted on
        // the process step
        $this->getForm()->addHiddenField($this->id . '_submitted', 1);

        if ($this->show_blank) {
            $options = array_merge(
                array(new SwatOption(null, $this->blank_title)),
                $options
            );
        }

        $table_tag = new SwatHtmlTag('table');
        $table_tag->id = $this->id;
        $table_tag->class = $this->getCSSClassString();
        $table_tag->open();

        foreach ($options as $index => $option) {
            $this->displayRadioTableOption($option, $index);
        }

        $table_tag->close();
    }
75391
public function listAnnouncementsAction()
    {
        $this->checkStaticTemplateIsIncluded();
        $this->checkSettings();

        $this->slotExtendedAssignMultiple([
            self::VIEW_VARIABLE_ASSOCIATION_ID => $this->settings[self::SETTINGS_ASSOCIATION_ID],
            self::VIEW_VARIABLE_FILTER => $this->getAnnouncementsFilter(),
        ], __CLASS__, __FUNCTION__);

        return $this->view->render();
    }
52928
public function onApplySetup()
    {
        if (($visibleColumns = post('visible_columns')) && is_array($visibleColumns)) {
            $this->columnOverride = $visibleColumns;
            $this->putSession('visible', $this->columnOverride);
        }

        $this->recordsPerPage = post('records_per_page', $this->recordsPerPage);
        $this->putSession('order', post('column_order'));
        $this->putSession('per_page', $this->recordsPerPage);
        return $this->onRefresh();
    }
23045
protected function onRegister() {
        global $PAGE;

        if (empty($this->consumer)) {
            $this->ok = false;
            $this->message = get_string('invalidtoolconsumer', 'enrol_lti');
            return;
        }

        if (empty($this->returnUrl)) {
            $this->ok = false;
            $this->message = get_string('returnurlnotset', 'enrol_lti');
            return;
        }

        if ($this->doToolProxyService()) {
            // Map tool consumer and published tool, if necessary.
            $this->map_tool_to_consumer();

            // Indicate successful processing in message.
            $this->message = get_string('successfulregistration', 'enrol_lti');

            // Prepare response.
            $returnurl = new moodle_url($this->returnUrl);
            $returnurl->param('lti_msg', get_string("successfulregistration", "enrol_lti"));
            $returnurl->param('status', 'success');
            $guid = $this->consumer->getKey();
            $returnurl->param('tool_proxy_guid', $guid);

            $returnurlout = $returnurl->out(false);

            $registration = new registration($returnurlout);
            $output = $PAGE->get_renderer('enrol_lti');
            echo $output->render($registration);

        } else {
            // Tell the consumer that the registration failed.
            $this->ok = false;
            $this->message = get_string('couldnotestablishproxy', 'enrol_lti');
        }
    }
370676
protected function getListTrigger()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->trigger->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('store')) {
            return $this->trigger->getList(array('store_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->trigger->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
784548
public function getBetterButtonsActions()
    {
        /** @var FieldList $fields */
        $fields = parent::getBetterButtonsActions();
        if ($this->TicketFile()->exists() && !empty($this->getEmail())) {
            $fields->push(BetterButtonCustomAction::create('sendTicket', _t('Attendee.SEND', 'Send the ticket')));
        }

        if (!empty($this->getName()) && !empty($this->getEmail())) {
            $fields->push(BetterButtonCustomAction::create('createTicketFile', _t('Attendee.CREATE_TICKET', 'Create the ticket')));
        }

        return $fields;
    }
227535
public function CartForm()
    {
        $fields = new FieldList();

        $actions = new FieldList(
            FormAction::create('doUpdate', _t('Checkout.UpdateCart', 'Update Cart'))
                ->addExtraClass('btn')
                ->addExtraClass('btn-blue btn-info')
        );

        $form = Form::create($this, "CartForm", $fields, $actions)
            ->addExtraClass("forms")
            ->setTemplate("ShoppingCartForm");

        $this->extend("updateCartForm", $form);

        return $form;
    }