Skip to content

Commit 9faad19

Browse files
Contact/Contactgroup: Remove usage of color column (#203)
resolves #200 blocked by #183 blocked by Icinga/icinga-notifications#218
2 parents 817e282 + c599b22 commit 9faad19

File tree

6 files changed

+3
-24
lines changed

6 files changed

+3
-24
lines changed

application/forms/ContactGroupForm.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,7 @@ public function addGroup(): int
173173

174174
$this->db->beginTransaction();
175175

176-
$this->db->insert(
177-
'contactgroup',
178-
[
179-
'name' => trim($data['group_name']),
180-
'color' => '#000000'
181-
]
182-
);
176+
$this->db->insert('contactgroup', ['name' => trim($data['group_name'])]);
183177

184178
$groupIdentifier = $this->db->lastInsertId();
185179

library/Notifications/Model/Contact.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function getColumns(): array
2626
return [
2727
'full_name',
2828
'username',
29-
'color',
3029
'default_channel_id'
3130
];
3231
}
@@ -35,8 +34,7 @@ public function getColumnDefinitions()
3534
{
3635
return [
3736
'full_name' => t('Full Name'),
38-
'username' => t('Username'),
39-
'color' => t('Color')
37+
'username' => t('Username')
4038
];
4139
}
4240

library/Notifications/Model/Contactgroup.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*
1414
* @param int $id
1515
* @param string $name
16-
* @param string $color
1716
*
1817
* @property Query | Contact $contact
1918
* @property Query | RuleEscalationRecipient $rule_escalation_recipient
@@ -34,8 +33,7 @@ public function getKeyName(): string
3433
public function getColumns(): array
3534
{
3635
return [
37-
'name',
38-
'color'
36+
'name'
3937
];
4038
}
4139

library/Notifications/Web/Form/ContactForm.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ protected function assemble()
110110
return true;
111111
})]
112112
]
113-
)->addElement(
114-
'color',
115-
'color',
116-
[
117-
'label' => $this->translate('Color'),
118-
'required' => true
119-
]
120113
)->addElement(
121114
'select',
122115
'default_channel_id',
@@ -165,7 +158,6 @@ public function populate($values)
165158
'contact' => [
166159
'full_name' => $values->full_name,
167160
'username' => $values->username,
168-
'color' => $values->color,
169161
'default_channel_id' => $values->default_channel_id
170162
]
171163
];

library/Notifications/Widget/MemberSuggestions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ protected function assemble(): void
103103
'value' => $contact->full_name,
104104
'data-label' => $contact->full_name,
105105
'data-search' => $contact->id,
106-
'data-color' => $contact->color,
107106
'data-class' => 'contact'
108107
])
109108
)

library/Notifications/Widget/RecipientSuggestions.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ protected function assemble()
119119
'value' => $contact->full_name,
120120
'data-label' => $contact->full_name,
121121
'data-search' => 'contact:' . $contact->id,
122-
'data-color' => $contact->color,
123122
'data-class' => 'contact'
124123
])
125124
)
@@ -137,7 +136,6 @@ protected function assemble()
137136
'value' => $group->name,
138137
'data-label' => $group->name,
139138
'data-search' => 'group:' . $group->id,
140-
'data-color' => $group->color,
141139
'data-class' => 'group'
142140
])
143141
)

0 commit comments

Comments
 (0)