Compare commits

..

2 Commits

Author SHA1 Message Date
6d80cca241 Bump version to 1.0.2.0
All checks were successful
Test / Run tests (push) Successful in 1m44s
Deploy / Build and Deploy (push) Successful in 1m36s
2025-11-10 00:15:46 +01:00
9dc225d3e4 Export/VCard: Add Escape method
All checks were successful
Test / Run tests (push) Successful in 1m54s
2025-11-10 00:13:53 +01:00
4 changed files with 30 additions and 9 deletions

View File

@@ -2,6 +2,23 @@
Changelog Changelog
========= =========
[v1.0.2.0][v1.0.2.0] (2025-11-10) {#v1.0.2.0}
---------------------------------------------
### Neue Funktionen {#v1.0.2.0-features}
* Im Mitglieder-Fenster (`MemberAdminWindow`) können Kontaktdaten der Mitglieder als .vcf-Datei exportiert werden. (01f4480a08, 9dc225d3e4)
### Sonstiges {#v1.0.2.0-misc}
* Wenn ein Serial-/COM-Port-USB-Adapter an- oder abgesteckt wird, wird das nun automatisch erkannt. (e6367da286)
* Abhängigkeiten aktualisiert. (b10c744bf9, 0d513f7bff)
[v1.0.2.0]: https://git.necronda.net/winzer/elwig/releases/tag/v1.0.2.0
[v1.0.1.5][v1.0.1.5] (2025-10-29) {#v1.0.1.5} [v1.0.1.5][v1.0.1.5] (2025-10-29) {#v1.0.1.5}
--------------------------------------------- ---------------------------------------------

View File

@@ -7,7 +7,7 @@
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon> <ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
<Version>1.0.1.5</Version> <Version>1.0.2.0</Version>
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages> <SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>

View File

@@ -34,20 +34,20 @@ namespace Elwig.Helpers.Export {
int count = data.Count() + 1, i = 0; int count = data.Count() + 1, i = 0;
foreach (var row in data) { foreach (var row in data) {
var billingAddr = row.BillingAddress != null ? $"ADR;TYPE=work;LANGUAGE=de;LABEL=\"{row.BillingAddress.FullName}\\n{row.BillingAddress.Address}\\n{row.BillingAddress.PostalDest.AtPlz?.Plz} {row.BillingAddress.PostalDest.AtPlz?.Ort.Name}\\nÖsterreich\":;;{row.BillingAddress.Address};{row.BillingAddress.PostalDest.AtPlz?.Ort.Name};;{row.BillingAddress.PostalDest.AtPlz?.Plz};Österreich\r\n" : null; var billingAddr = row.BillingAddress != null ? $"ADR;TYPE=work;LANGUAGE=de;LABEL=\"{Escape(row.BillingAddress.FullName)}\\n{Escape(row.BillingAddress.Address)}\\n{row.BillingAddress.PostalDest.AtPlz?.Plz} {Escape(row.BillingAddress.PostalDest.AtPlz?.Ort.Name)}\\nÖsterreich\":;;{Escape(row.BillingAddress.Address)};{Escape(row.BillingAddress.PostalDest.AtPlz?.Ort.Name)};;{row.BillingAddress.PostalDest.AtPlz?.Plz};Österreich\r\n" : null;
var tel = string.Join("", row.TelephoneNumbers var tel = string.Join("", row.TelephoneNumbers
.Where(n => n.Type != "fax") .Where(n => n.Type != "fax")
.Select(n => $"TEL;TYPE={(n.Type == "mobile" ? "cell" : "voice")}:{n.Number}\r\n")); .Select(n => $"TEL;TYPE={(n.Type == "mobile" ? "cell" : "voice")}:{Escape(n.Number)}\r\n"));
var email = string.Join("", row.EmailAddresses.Select(a => $"EMAIL:{a.Address}\r\n")); var email = string.Join("", row.EmailAddresses.Select(a => $"EMAIL:{Escape(a.Address)}\r\n"));
await _writer.WriteLineAsync($""" await _writer.WriteLineAsync($"""
BEGIN:VCARD BEGIN:VCARD
VERSION:4.0 VERSION:4.0
UID:mg{row.MgNr}@{App.Client.NameToken.ToLower()}.elwig.at UID:mg{row.MgNr}@{App.Client.NameToken.ToLower()}.elwig.at
NOTE:MgNr. {row.MgNr} NOTE:MgNr. {row.MgNr}
FN:{row.AdministrativeName} FN:{Escape(row.AdministrativeName)}
N:{row.Name};{row.GivenName};{row.MiddleName};{row.Prefix};{row.Suffix} N:{Escape(row.Name)};{Escape(row.GivenName)};{Escape(row.MiddleName)};{Escape(row.Prefix)};{Escape(row.Suffix)}
KIND:{(row.IsJuridicalPerson ? "org" : "individual")} KIND:{(row.IsJuridicalPerson ? "org" : "individual")}
ADR{(billingAddr == null ? "" : ";TYPE=home")};LANGUAGE=de;LABEL="{row.Address}\n{row.PostalDest.AtPlz?.Plz} {row.PostalDest.AtPlz?.Ort.Name}\nÖsterreich":;;{row.Address};{row.PostalDest.AtPlz?.Ort.Name};;{row.PostalDest.AtPlz?.Plz};Österreich ADR{(billingAddr == null ? "" : ";TYPE=home")};LANGUAGE=de;LABEL="{Escape(row.Address)}\n{row.PostalDest.AtPlz?.Plz} {Escape(row.PostalDest.AtPlz?.Ort.Name)}\nÖsterreich":;;{Escape(row.Address)};{Escape(row.PostalDest.AtPlz?.Ort.Name)};;{row.PostalDest.AtPlz?.Plz};Österreich
{billingAddr}{tel}{email}REV:{row.ModifiedAt.ToUniversalTime():yyyyMMdd\THHmmss\Z} {billingAddr}{tel}{email}REV:{row.ModifiedAt.ToUniversalTime():yyyyMMdd\THHmmss\Z}
END:VCARD END:VCARD
"""); """);
@@ -61,5 +61,9 @@ namespace Elwig.Helpers.Export {
public void Export(IEnumerable<Member> data, IProgress<double>? progress = null) { public void Export(IEnumerable<Member> data, IProgress<double>? progress = null) {
ExportAsync(data, progress).GetAwaiter().GetResult(); ExportAsync(data, progress).GetAwaiter().GetResult();
} }
private static string? Escape(string? text) {
return text?.Replace("\\", "\\\\").Replace(",", "\\,").Replace(";", "\\;").Replace("\n", "\\n").Replace("\r", "");
}
} }
} }

View File

@@ -13,7 +13,7 @@ About
**Product:** Elwig **Product:** Elwig
**Description:** Electronic Management for Vintners' Cooperatives **Description:** Electronic Management for Vintners' Cooperatives
**Type:** ERP system **Type:** ERP system
**Version:** 1.0.1.5 ([Changelog](./CHANGELOG.md)) **Version:** 1.0.2.0 ([Changelog](./CHANGELOG.md))
**License:** [GNU General Public License 3.0 (GPLv3)](./LICENSE) **License:** [GNU General Public License 3.0 (GPLv3)](./LICENSE)
**Website:** https://elwig.at/ **Website:** https://elwig.at/
**Source code:** https://git.necronda.net/winzer/elwig **Source code:** https://git.necronda.net/winzer/elwig
@@ -33,7 +33,7 @@ Packaging: [WiX Toolset](https://www.firegiant.com/wixtoolset/)
**Produkt:** Elwig **Produkt:** Elwig
**Beschreibung:** Elektronische Winzergenossenschaftsverwaltung **Beschreibung:** Elektronische Winzergenossenschaftsverwaltung
**Typ:** Warenwirtschaftssystem (ERP-System) **Typ:** Warenwirtschaftssystem (ERP-System)
**Version:** 1.0.1.5 ([Änderungsprotokoll](./CHANGELOG.md)) **Version:** 1.0.2.0 ([Änderungsprotokoll](./CHANGELOG.md))
**Lizenz:** [GNU General Public License 3.0 (GPLv3)](./LICENSE) **Lizenz:** [GNU General Public License 3.0 (GPLv3)](./LICENSE)
**Website:** https://elwig.at/ **Website:** https://elwig.at/
**Quellcode:** https://git.necronda.net/winzer/elwig **Quellcode:** https://git.necronda.net/winzer/elwig