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