diff options
| author | Niklas Olmes <niklas@olmes.de> | 2026-04-24 19:30:00 +0200 |
|---|---|---|
| committer | Niklas Olmes <niklas@olmes.de> | 2026-04-24 19:30:00 +0200 |
| commit | cdea8caa5617f0cb77bcbc9803759abd2df50644 (patch) | |
| tree | 2f7f1bd3af3b2396baf5403ad1a7ad00bcb7fae9 /auto_common.php | |
Diffstat (limited to 'auto_common.php')
| -rw-r--r-- | auto_common.php | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/auto_common.php b/auto_common.php new file mode 100644 index 0000000..9b74adb --- /dev/null +++ b/auto_common.php @@ -0,0 +1,180 @@ +<?php +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +?> +<? +/* vim: set ts=4 sw=4 et : */ + +function getPii($pii = []) { + $pii_default = ['Vorname', 'Nachname', 'Name', 'name', 'Förderer', 'Organisation', 'Ort', 'Email', 'Email-Privat', 'Email-Uni', 'Email-Geschäftlich', 'Telefon', 'Handy', 'Kategorie', 'Event', 'Geburtsname', 'Geburtsort', 'PLZ', 'Straße', 'Adresszusatz', 'place', 'teaser', 'description', 'notes', 'host', 'category', 'Kontoinhaber', 'Bankname', 'IBAN', 'BIC', 'Ansprechpartner Stipendiaten', 'Zuständig']; + if (!is_array($pii)) + return $pii_default; + return array_merge($pii_default, $pii); +} + +function getLinks($links = []) { + $links_default = [ + 'PersID' => '/db/person/', + 'APID' => '/db/person/', + 'APZuwID' => '/db/person/', + 'ZustID' => '/db/person/', + 'StipID' => '/db/stip/', + 'FoerdID' => '/db/patron/', + 'VorhFoerdID' => '/db/patron/', + 'OrgaID' => '/db/orga/', + 'SuperOrgaID' => '/db/orga/', + 'SpendenID' => '/db/donation/', + 'SuperSpendenID' => '/db/donation/', + 'EventID' => '/db/event/', + 'SuperEventID' => '/db/event/', + 'EventCatID' => '/db/event/category/', + 'NotizID' => '/db/note/', + 'EmailID' => '/db/email/', + 'VertrID' => '/db/contract/', + 'KanbanID' => '/db/kanban/', + 'KanbanViewID' => '/db/kanban/view/', + 'KanbanBoardID' => '/db/kanban/board/', + 'ETID' => '/db/templates/email/', + 'PTID' => '/db/templates/pdf/', + 'AppNewsID' => '/db/main/news.php?id=', + 'AppSettingID' => '/db/main/appsetting.php?id=', + 'AppProfileID' => '/db/main/appprofile.php?id=', + 'AppCampaignID' => '/db/main/appcampaign.php?id=', + 'AppBillboardID' => '/db/main/appbillboard.php?id=', + 'AppNagscreenID' => '/db/main/appnagscreen.php?id=', + ]; + if (!is_array($links)) + return $links_default; + return array_merge($links_default, $links); +} + +function ajaxLinks() { +?> + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/person/' + data + '">' + data + '</a>'; + }, targets: ['at_col_persid', 'at_col_PersID', 'at_col_APID', 'at_col_APZuwID', 'at_col_ZustID'] + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/stip/' + data + '">' + data + '</a>'; + }, targets: 'at_col_StipID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/patron/' + data + '">' + data + '</a>'; + }, targets: ['at_col_FoerdID', 'at_col_VorhFoerdID'] + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/orga/' + data + '">' + data + '</a>'; + }, targets: ['at_col_OrgaID', 'at_col_SuperOrgaID'] + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/note/' + data + '">' + data + '</a>'; + }, targets: 'at_col_NotizID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/event/' + data + '">' + data + '</a>'; + }, targets: ['at_col_EventID', 'at_col_SuperEventID'] + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/event/category/' + data + '">' + data + '</a>'; + }, targets: 'at_col_EventCatID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/email/' + data + '">' + data + '</a>'; + }, targets: 'at_col_EmailID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/donation/' + data + '">' + data + '</a>'; + }, targets: ['at_col_SpendenID', 'at_col_SuperSpendenID'] + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/contract/' + data + '">' + data + '</a>'; + }, targets: 'at_col_VertrID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/kanban/' + data + '">' + data + '</a>'; + }, targets: 'at_col_KanbanID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/kanban/board/' + data + '">' + data + '</a>'; + }, targets: 'at_col_KanbanBoardID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/kanban/view/' + data + '">' + data + '</a>'; + }, targets: 'at_col_KanbanViewID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/main/news.php?id=' + data + '">' + data + '</a>'; + }, targets: 'at_col_AppNewsID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/main/appsetting.php?id=' + data + '">' + data + '</a>'; + }, targets: 'at_col_AppSettingID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/main/appprofile.php?id=' + data + '">' + data + '</a>'; + }, targets: 'at_col_AppProfileID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/main/appcampaign.php?id=' + data + '">' + data + '</a>'; + }, targets: 'at_col_AppCampaignID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/main/appbillboard.php?id=' + data + '">' + data + '</a>'; + }, targets: 'at_col_AppBillboardID' + }, + { + render: function (data, type, row, meta) { + if (data === "" || data == null) return data; + return '<a class="autolink" href="/db/main/appnagscreen.php?id=' + data + '">' + data + '</a>'; + }, targets: 'at_col_AppNagscreenID' + }, + + +<? +} +?> |
