| Conditions | 4 |
| Paths | 8 |
| Total Lines | 49 |
| Code Lines | 30 |
| Lines | 14 |
| Ratio | 28.57 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 78 | public function updateCMSFields(FieldList $fields) |
||
| 79 | { |
||
| 80 | $ticketLabel = _t('TicketExtension.Tickets', 'Tickets'); |
||
| 81 | $fields->addFieldsToTab( |
||
| 82 | "Root.$ticketLabel", array( |
||
| 83 | GridField::create('Tickets', $ticketLabel, $this->owner->Tickets(), TicketsGridFieldConfig::create($this->canCreateTickets())), |
||
|
1 ignored issue
–
show
|
|||
| 84 | NumericField::create('Capacity', _t('TicketExtension.Capacity', 'Capacity')), |
||
| 85 | NumericField::create('OrderMin', _t('TicketExtension.OrderMin', 'Minimum amount of tickets required per reservation')), |
||
| 86 | NumericField::create('OrderMax', _t('TicketExtension.OrderMax', 'Maximum amount of tickets allowed per reservation')), |
||
| 87 | HtmlEditorField::create('SuccessMessage', _t('TicketExtension.SuccessMessage', 'Success message'))->setRows(4), |
||
| 88 | HtmlEditorField::create('SuccessMessageMail', _t('TicketExtension.MailMessage', 'Mail message'))->setRows(4) |
||
| 89 | )); |
||
| 90 | |||
| 91 | // Create Reservations tab |
||
| 92 | if ($this->owner->Reservations()->exists()) { |
||
| 93 | $reservationLabel = _t('TicketExtension.Reservations', 'Reservations'); |
||
| 94 | $fields->addFieldToTab( |
||
| 95 | "Root.$reservationLabel", |
||
| 96 | GridField::create('Reservations', $reservationLabel, $this->owner->Reservations(), GridFieldConfig_RecordEditor::create()) |
||
|
1 ignored issue
–
show
|
|||
| 97 | ); |
||
| 98 | } |
||
| 99 | |||
| 100 | // Create Attendees tab |
||
| 101 | View Code Duplication | if ($this->owner->Attendees()->exists()) { |
|
|
1 ignored issue
–
show
|
|||
| 102 | $guestListLabel = _t('TicketExtension.GuestList', 'GuestList'); |
||
| 103 | $fields->addFieldToTab( |
||
| 104 | "Root.$guestListLabel", |
||
| 105 | GridField::create('Attendees', $guestListLabel, $this->owner->Attendees(), GuestListGridFieldConfig::create($this->owner)) |
||
|
1 ignored issue
–
show
|
|||
| 106 | ); |
||
| 107 | } |
||
| 108 | |||
| 109 | // Create WaitingList tab |
||
| 110 | View Code Duplication | if ($this->owner->WaitingList()->exists()) { |
|
|
1 ignored issue
–
show
|
|||
| 111 | $waitingListLabel = _t('TicketExtension.WaitingList', 'WaitingList'); |
||
| 112 | $fields->addFieldToTab( |
||
| 113 | "Root.$waitingListLabel", |
||
| 114 | GridField::create('WaitingList', $waitingListLabel, $this->owner->WaitingList(), GridFieldConfig_RecordEditor::create()) |
||
|
1 ignored issue
–
show
|
|||
| 115 | ); |
||
| 116 | } |
||
| 117 | |||
| 118 | // Create Fields tab |
||
| 119 | $extraFieldsLabel = _t('TicketExtension.ExtraFields', 'Attendee fields'); |
||
| 120 | $fields->addFieldToTab( |
||
| 121 | "Root.$extraFieldsLabel", |
||
| 122 | GridField::create('ExtraFields', $extraFieldsLabel, $this->owner->Fields(), UserFieldsGridFieldConfig::create()) |
||
|
1 ignored issue
–
show
|
|||
| 123 | ); |
||
| 124 | |||
| 125 | $this->owner->extend('updateTicketExtensionFields', $fields); |
||
| 126 | } |
||
| 127 | |||
| 276 |
This check marks private properties in classes that are never used. Those properties can be removed.