Merge pull request #23226 from MegaphoneJon/individual-employers
[civicrm-core.git] / CRM / Event / Form / ManageEvent / Conference.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
3bdf1f3a 19 * This class generates form components for Conference Slots.
6a488035
TO
20 */
21class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent {
22
23 /**
66f9e52b 24 * Page action.
90b461f1 25 * @var int
6a488035
TO
26 */
27 public $_action;
28
29 /**
3bdf1f3a 30 * Build quick form.
6a488035
TO
31 */
32 public function buildQuickForm() {
33 $slots = CRM_Core_OptionGroup::values('conference_slot');
34
35 $this->add('select',
36 'slot_label_id',
37 ts('Conference Slot'),
be2fb01f 38 [
28a04ea9 39 '' => ts('- select -'),
be2fb01f 40 ] + $slots,
6a488035
TO
41 FALSE
42 );
43
be2fb01f 44 $this->addEntityRef('parent_event_id', ts('Parent Event'), [
90b461f1
SL
45 'entity' => 'Event',
46 'placeholder' => ts('- any -'),
47 'select' => ['minimumInputLength' => 0],
48 ]);
6a488035
TO
49
50 parent::buildQuickForm();
51 }
52
3bdf1f3a 53 /**
54 * Post process form.
55 */
6a488035 56 public function postProcess() {
6a488035
TO
57 $params = $this->exportValues();
58
6a488035
TO
59 $params['id'] = $this->_id;
60 CRM_Event_BAO_Event::add($params);
61
62 parent::endPostProcess();
63 }
64
65 /**
3bdf1f3a 66 * Return a descriptive name for the page, used in wizard header.
6a488035
TO
67 *
68 * @return string
6a488035
TO
69 */
70 public function getTitle() {
71 return ts('Conference Slots');
72 }
96025800 73
6a488035 74}