From c599b2214edf142bf2a29160d1c9dec3c97678a9 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 12 Jun 2024 11:11:13 +0200 Subject: [PATCH] Contact/Contactgroup: Remove usage of color column This column is no longer required --- application/forms/ContactGroupForm.php | 8 +------- library/Notifications/Model/Contact.php | 4 +--- library/Notifications/Model/Contactgroup.php | 4 +--- library/Notifications/Web/Form/ContactForm.php | 8 -------- library/Notifications/Widget/MemberSuggestions.php | 1 - library/Notifications/Widget/RecipientSuggestions.php | 2 -- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/application/forms/ContactGroupForm.php b/application/forms/ContactGroupForm.php index ddca3a39..42369d9a 100644 --- a/application/forms/ContactGroupForm.php +++ b/application/forms/ContactGroupForm.php @@ -173,13 +173,7 @@ public function addGroup(): int $this->db->beginTransaction(); - $this->db->insert( - 'contactgroup', - [ - 'name' => trim($data['group_name']), - 'color' => '#000000' - ] - ); + $this->db->insert('contactgroup', ['name' => trim($data['group_name'])]); $groupIdentifier = $this->db->lastInsertId(); diff --git a/library/Notifications/Model/Contact.php b/library/Notifications/Model/Contact.php index 62d90071..5db9ef41 100644 --- a/library/Notifications/Model/Contact.php +++ b/library/Notifications/Model/Contact.php @@ -26,7 +26,6 @@ public function getColumns(): array return [ 'full_name', 'username', - 'color', 'default_channel_id' ]; } @@ -35,8 +34,7 @@ public function getColumnDefinitions() { return [ 'full_name' => t('Full Name'), - 'username' => t('Username'), - 'color' => t('Color') + 'username' => t('Username') ]; } diff --git a/library/Notifications/Model/Contactgroup.php b/library/Notifications/Model/Contactgroup.php index f4e487b7..f37e8c80 100644 --- a/library/Notifications/Model/Contactgroup.php +++ b/library/Notifications/Model/Contactgroup.php @@ -13,7 +13,6 @@ * * @param int $id * @param string $name - * @param string $color * * @property Query | Contact $contact * @property Query | RuleEscalationRecipient $rule_escalation_recipient @@ -34,8 +33,7 @@ public function getKeyName(): string public function getColumns(): array { return [ - 'name', - 'color' + 'name' ]; } diff --git a/library/Notifications/Web/Form/ContactForm.php b/library/Notifications/Web/Form/ContactForm.php index 46b638dc..bd2037fd 100644 --- a/library/Notifications/Web/Form/ContactForm.php +++ b/library/Notifications/Web/Form/ContactForm.php @@ -110,13 +110,6 @@ protected function assemble() return true; })] ] - )->addElement( - 'color', - 'color', - [ - 'label' => $this->translate('Color'), - 'required' => true - ] )->addElement( 'select', 'default_channel_id', @@ -165,7 +158,6 @@ public function populate($values) 'contact' => [ 'full_name' => $values->full_name, 'username' => $values->username, - 'color' => $values->color, 'default_channel_id' => $values->default_channel_id ] ]; diff --git a/library/Notifications/Widget/MemberSuggestions.php b/library/Notifications/Widget/MemberSuggestions.php index c035747b..983e41b7 100644 --- a/library/Notifications/Widget/MemberSuggestions.php +++ b/library/Notifications/Widget/MemberSuggestions.php @@ -103,7 +103,6 @@ protected function assemble(): void 'value' => $contact->full_name, 'data-label' => $contact->full_name, 'data-search' => $contact->id, - 'data-color' => $contact->color, 'data-class' => 'contact' ]) ) diff --git a/library/Notifications/Widget/RecipientSuggestions.php b/library/Notifications/Widget/RecipientSuggestions.php index 7ff4f2f8..803618d0 100644 --- a/library/Notifications/Widget/RecipientSuggestions.php +++ b/library/Notifications/Widget/RecipientSuggestions.php @@ -119,7 +119,6 @@ protected function assemble() 'value' => $contact->full_name, 'data-label' => $contact->full_name, 'data-search' => 'contact:' . $contact->id, - 'data-color' => $contact->color, 'data-class' => 'contact' ]) ) @@ -137,7 +136,6 @@ protected function assemble() 'value' => $group->name, 'data-label' => $group->name, 'data-search' => 'group:' . $group->id, - 'data-color' => $group->color, 'data-class' => 'group' ]) )