diff --git a/CHANGELOG.md b/CHANGELOG.md index 74e45b0..8ef3363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,5 @@ # hitobito_kjv Changelog -## 0.4.1 - -- E-Mail-Kategorie „Vorstand“; bei Kursen und Anlässen ist von der Kontaktperson nur noch - die Vorstandsadresse sichtbar (Kursseite, Kalender-Feed, Teilnahmebestätigung, Mails) - ## 0.4.0 - Gruppen- und Rollenstruktur nach Satzung 2024: Vorstand mit Vorsitzendem, Stellvertreter, diff --git a/README.md b/README.md index 8505c56..aef9418 100644 --- a/README.md +++ b/README.md @@ -55,18 +55,6 @@ Rollentypen definiert dieser Wagon (`app/models/group/`, `app/models/role/`); (Präsident → Vorsitzender, Kassier → Schatzmeister, Aktivmitglied → Verbandsmitglied, Vorstandsmitglied/Sekretär → Vorstandsmitglied) und die Sortiertabellen neu befüllt. -## Vorstandsadresse bei Kursen und Anlässen - -Bei Kursen und Anlässen ist von der Kontaktperson öffentlich nur ihre **Vorstandsadresse** -sichtbar: eine weitere E-Mail mit der Kategorie „Vorstand“ (Profil bearbeiten → Weitere -E-Mails → Kategorie „Vorstand“, je Person höchstens eine). Die private Haupt-E-Mail und -andere weitere E-Mails erscheinen dort nicht. Hat die Kontaktperson keine Vorstandsadresse, -wird keine E-Mail angezeigt. - -Das gilt für Kursseite und externe Anmeldung, den öffentlichen Kalender-Feed (ICS), die -Teilnahmebestätigung (PDF), die Bestätigungs-Mails an Teilnehmende und die Antwortadresse -(falls `event.use_contact_as_reply_to` aktiv ist). Zentrale Stelle: `Kjv::VorstandEmail`. - ## Beitragsstatus und Mitgliedsausweis ### Gültigkeit und Beitrag @@ -257,9 +245,6 @@ Diese Stellen hängen an Interna des Cores und sollten bei Updates geprüft werd - `Kjv::PeopleHelper#sortable_grouped_person_attr`, `Kjv::CsvImportHelper`, `Kjv::CsvImportsController#field_mappings` und `Kjv::PersonFilterList` überschreiben Core-Methoden. -- Vorstandsadresse: `Kjv::EventDecorator#contact_emails` sowie die Kopien in - `Kjv::EventContactEmail` (ICS-Beschreibung, Teilnahmebestätigung, Mail-Anlassangaben, - Antwortadresse) überschreiben Core-Methoden; bei Updates mit dem Original abgleichen. - Mitgliedsausweis: kommt aus `hitobito_verifiable_pass`, das am Pass-System des Cores hängt. Bei Updates von Core oder diesem Wagon Prüfseite, „Mein Ausweis“ und Sammel-PDF kurz testen. Neue Commits von `hitobito_verifiable_pass` in `VERSIONS` eintragen. diff --git a/app/decorators/kjv/event_decorator.rb b/app/decorators/kjv/event_decorator.rb deleted file mode 100644 index 30cdeb7..0000000 --- a/app/decorators/kjv/event_decorator.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of -# hitobito_kjv and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory. - -# Kontaktperson bei Kursen und Anlässen: nur die Vorstandsadresse anzeigen, nicht die -# private Haupt-E-Mail und keine weiteren E-Mails (siehe Kjv::VorstandEmail). -module Kjv::EventDecorator - def contact_emails(icons: true) - email = Kjv::VorstandEmail.for(contact) - return if email.blank? - - icon = icons ? h.icon(:envelope, class: "me-1") : nil - h.content_tag(:p, h.safe_join([icon, h.mail_to(email)].compact, " ")) - end -end diff --git a/app/domain/kjv/event_contact_email.rb b/app/domain/kjv/event_contact_email.rb deleted file mode 100644 index d7acbf2..0000000 --- a/app/domain/kjv/event_contact_email.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of -# hitobito_kjv and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory. - -# Weitere Stellen, an denen der Core die E-Mail der Kontaktperson eines Anlasses ausgibt. -# Überall wird die Vorstandsadresse statt der privaten Haupt-E-Mail verwendet. -# Die Methoden sind Kopien der Core-Methoden mit ausgetauschter E-Mail; bei Core-Updates -# mit dem Original abgleichen. -module Kjv::EventContactEmail - # Export::Ics::Events: Beschreibung im (öffentlichen) Kalender-Feed - module IcsEvents - def event_description(event) - return event.description unless event.contact - - [ - event.description, "", - event.contact.person_name, - event.contact.phone_numbers.map { |pn| "#{pn.label}: #{pn.number}" if pn.public }, - Kjv::VorstandEmail.for(event.contact), "", - url(event) - ].flatten.compact.join("\n") - end - end - - # Export::Pdf::Participation::Confirmation: Teilnahmebestätigung - module ParticipationConfirmation - def render_contact_address - text(I18n.t("event.applied_to"), style: :bold) - - email = Kjv::VorstandEmail.for(contact) - pdf.bounding_box([10, cursor], width: bounds.width) do - if email - text(I18n.t("contactable.address_or_email", address: contact_address, email: email)) - else - text(contact_address) - end - end - move_down_line - end - end - - # Event::ParticipationMailer: Anlass-Angaben in Mails an Teilnehmende - module ParticipationMailer - def event_details # rubocop:disable Metrics/MethodLength,Metrics/AbcSize - infos = [] - infos << event.name - infos << labeled(:dates) { join_lines(event.dates.map(&:to_s)) } - infos << labeled(:motto) - infos << labeled(:cost) - infos << labeled(:description) { convert_newlines_to_breaks(event.description) } - infos << labeled(:location) { convert_newlines_to_breaks(event.location) } - infos << labeled(:contact) do - email = Kjv::VorstandEmail.for(event.contact) - email ? escape_html(event.contact) + br_tag + email : escape_html(event.contact) - end - infos << answers_details - infos << additional_information_details - infos << placeholder_participation_details - join_lines(infos.compact, br_tag * 2) - end - end - - # Event::ReplyToContact: Antwortadresse (nur wenn event.use_contact_as_reply_to aktiv) - module ReplyToContact - private - - def set_reply_to_from_event_contact - return unless Settings.event.use_contact_as_reply_to - - email = Kjv::VorstandEmail.for(event&.contact) - message.reply_to = email if email - end - end -end diff --git a/app/domain/kjv/vorstand_email.rb b/app/domain/kjv/vorstand_email.rb deleted file mode 100644 index 022af0f..0000000 --- a/app/domain/kjv/vorstand_email.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of -# hitobito_kjv and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory. - -# Öffentliche Vorstandsadresse einer Person: weitere E-Mail mit der Kategorie "Vorstand". -# -# Bei Kursen und Anlässen wird für die Kontaktperson ausschließlich diese Adresse -# angezeigt bzw. weitergegeben (Kursseite, externe Anmeldung, Kalender-Feed, -# Teilnahmebestätigung, Mails). Die private Haupt-E-Mail bleibt verborgen. Hat die -# Kontaktperson keine Vorstandsadresse, erscheint keine E-Mail. -module Kjv::VorstandEmail - CATEGORY_KEY = "vorstand" - - module_function - - def for(person) - return if person.nil? - - person = person.object if person.respond_to?(:object) # Decorator - person.additional_emails.includes(:category) - .find { |email| email.category&.key == CATEGORY_KEY }&.email.presence - end - - # Für Migration und Seed - def ensure_category! - ContactAccountCategory.find_or_create_by!( - key: CATEGORY_KEY, - contact_account_type: AdditionalEmail.sti_name, - contactable_type: Person.sti_name - ) do |category| - category.name = "Vorstand" - category.unique_per_contactable = true - category.position = ContactAccountCategory - .where(contact_account_type: AdditionalEmail.sti_name, contactable_type: Person.sti_name) - .maximum(:position).to_i + 1 - end - end -end diff --git a/db/migrate/20261009170000_add_vorstand_email_category.rb b/db/migrate/20261009170000_add_vorstand_email_category.rb deleted file mode 100644 index 858e524..0000000 --- a/db/migrate/20261009170000_add_vorstand_email_category.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of -# hitobito_kjv and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory. - -# Kategorie "Vorstand" für weitere E-Mails (öffentliche Vorstandsadresse, siehe -# Kjv::VorstandEmail). Nur in bestehenden Installationen; bei einer neuen Installation -# legt sie der Seed nach den Core-Kategorien an (der Core-Seeder läuft nur, solange noch -# keine Kategorie existiert). -class AddVorstandEmailCategory < ActiveRecord::Migration[8.0] - def up - return unless ContactAccountCategory.exists? - - Kjv::VorstandEmail.ensure_category! - end - - def down - # Kategorie bleibt bestehen, damit zugeordnete Adressen nicht ihre Kategorie verlieren - end -end diff --git a/db/seeds/vorstand_email_category.rb b/db/seeds/vorstand_email_category.rb deleted file mode 100644 index f7dea04..0000000 --- a/db/seeds/vorstand_email_category.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# Copyright (c) 2026, Kreisjagdverband Bautzen e.V. This file is part of -# hitobito_kjv and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory. - -# Kategorie "Vorstand" für weitere E-Mails (siehe Kjv::VorstandEmail) -Kjv::VorstandEmail.ensure_category! if ContactAccountCategory.exists? diff --git a/lib/hitobito_kjv/version.rb b/lib/hitobito_kjv/version.rb index 238ffdb..f7d6fa0 100644 --- a/lib/hitobito_kjv/version.rb +++ b/lib/hitobito_kjv/version.rb @@ -5,5 +5,5 @@ # or later. See the COPYING file at the top-level directory. module HitobitoKjv - VERSION = "0.4.1" + VERSION = "0.4.0" end diff --git a/lib/hitobito_kjv/wagon.rb b/lib/hitobito_kjv/wagon.rb index 1388da9..5fbe832 100644 --- a/lib/hitobito_kjv/wagon.rb +++ b/lib/hitobito_kjv/wagon.rb @@ -45,13 +45,6 @@ module HitobitoKjv StandardFormBuilder.prepend Kjv::StandardFormBuilder CsvImportHelper.prepend Kjv::CsvImportHelper PeopleHelper.prepend Kjv::PeopleHelper - EventDecorator.prepend Kjv::EventDecorator - - ### Kontaktperson bei Anlässen: nur Vorstandsadresse (Kjv::VorstandEmail) - Export::Ics::Events.prepend Kjv::EventContactEmail::IcsEvents - Export::Pdf::Participation::Confirmation.prepend Kjv::EventContactEmail::ParticipationConfirmation - Event::ParticipationMailer.prepend Kjv::EventContactEmail::ParticipationMailer - Event::ReplyToContact.prepend Kjv::EventContactEmail::ReplyToContact ### domain Export::Tabular::People::PeopleAddress.prepend Kjv::Export::Tabular::People::PeopleAddress