diff --git a/.distignore b/.distignore index 44cee3b58..01f67b837 100644 --- a/.distignore +++ b/.distignore @@ -21,4 +21,5 @@ phpunit project.json README.md tsconfig.* -webpack.config.js \ No newline at end of file +webpack.config.js +phpstan.neon \ No newline at end of file diff --git a/commonsbooking.php b/commonsbooking.php index cb962aa83..9786bfe47 100644 --- a/commonsbooking.php +++ b/commonsbooking.php @@ -2,7 +2,7 @@ /** * Plugin Name: Commons Booking - * Version: 2.9.4 + * Version: 2.10 * Requires at least: 5.2 * Requires PHP: 7.4 * Plugin URI: https://commonsbooking.org @@ -18,8 +18,8 @@ use CommonsBooking\Plugin; defined('ABSPATH') or die("Thanks for visiting"); -define('COMMONSBOOKING_VERSION', '2.9.4'); -define('COMMONSBOOKING_VERSION_COMMENT', 'master'); // Empty for release - Used to mark development versions +define('COMMONSBOOKING_VERSION', '2.10'); +define('COMMONSBOOKING_VERSION_COMMENT', ''); // Empty for release - Used to mark development versions define('COMMONSBOOKING_PLUGIN_SLUG', 'commonsbooking'); define('COMMONSBOOKING_MENU_SLUG', COMMONSBOOKING_PLUGIN_SLUG . '-menu'); define('COMMONSBOOKING_PLUGIN_DIR', wp_normalize_path( plugin_dir_path(__FILE__))); diff --git a/languages/commonsbooking-de_DE.mo b/languages/commonsbooking-de_DE.mo index 652aec490..3be6a19b5 100644 Binary files a/languages/commonsbooking-de_DE.mo and b/languages/commonsbooking-de_DE.mo differ diff --git a/languages/commonsbooking-de_DE.po b/languages/commonsbooking-de_DE.po index b5fd04131..a9ba31882 100644 --- a/languages/commonsbooking-de_DE.po +++ b/languages/commonsbooking-de_DE.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/commonsbooking\n" "POT-Creation-Date: 2023-09-15T04:04:14+02:00\n" -"PO-Revision-Date: 2024-12-12 16:01+0100\n" +"PO-Revision-Date: 2025-01-06 18:35+0100\n" "Last-Translator: Christian Wenzel \n" "Language-Team: English \n" "Language: de_DE\n" @@ -850,7 +850,7 @@ msgstr "Buchungen auf neue Version migrieren" msgid "Migrate bookings to new format so that they are listed at bookings menu item.
This function is only for special cases during migration. Please use it only in case of problems with migration." msgstr "Migriere Buchungen in ein neues Format, sodass diese unter dem Menüpunkt Buchungen aufgelistet werden.
Diese Funktion gilt nur für Sonderfälle während der Migration. Bitte nur bei Problemen währen der Migration verwenden. " -#: includes/OptionsArray.php:1125 src/View/MassOperations.php:110 +#: includes/OptionsArray.php:1125 src/View/MassOperations.php:109 #: src/View/Migration.php:107 msgid "Migrate bookings" msgstr "Buchungen migrieren" @@ -1401,14 +1401,14 @@ msgstr "iCalendar Link:" msgid "Not available" msgstr "Nicht verfügbar" -#: src/View/Booking.php:193 src/View/MassOperations.php:39 +#: src/View/Booking.php:193 src/View/MassOperations.php:38 #: src/Wordpress/CustomPostType/Booking.php:441 #: src/Wordpress/CustomPostType/Timeframe.php:99 #: templates/shortcode-bookings.php:73 msgid "User" msgstr "Nutzende*r" -#: src/View/Booking.php:197 src/View/MassOperations.php:43 +#: src/View/Booking.php:197 src/View/MassOperations.php:42 #: src/Wordpress/CustomPostType/Booking.php:959 #: src/Wordpress/CustomPostType/Restriction.php:472 msgid "Status" @@ -1525,7 +1525,7 @@ msgstr " Optionen aktualisiert / gespeichert" msgid "migration in process .. please wait ...
This could take several minutes. Do not close this browser tab" msgstr "Migration wird durchgeführt .. Bitte warten...
Dies kann einige Minuten dauern. Browserfenster bitte nicht schließen" -#: src/View/MassOperations.php:100 src/View/Migration.php:53 +#: src/View/MassOperations.php:99 src/View/Migration.php:53 #: src/View/Migration.php:98 msgid "Migration finished" msgstr "Migration beendet" @@ -1538,11 +1538,11 @@ msgstr "Abrufen von Standort-Geokoordinaten." msgid "If this option is enabled, CommonsBooking will try to derive the matching geo-coordinates from the address data of the locations during import. We use an interface to a GeoCoder service (Nominatim) for this task. This service allows only one query per second, so the runtime of the migration is increased by 1 second per location. The geo-coordinates are needed to use the location map integrated in CommonsBooking." msgstr "Wenn diese Option aktiviert ist, versucht CommonsBooking beim Import die passenden Geo-Koordinaten aus den Adressdaten der Standorte abzuleiten. Für diese Aufgabe verwenden wir eine Schnittstelle zu einem GeoCoder-Dienst (Nominatim). Dieser Dienst erlaubt nur eine Abfrage pro Sekunde, so dass sich die Laufzeit der Migration um 1 Sekunde pro Standort erhöht. Die Geokoordinaten werden benötigt, um die in CommonsBooking integrierte Standortkarte zu nutzen." -#: src/View/MassOperations.php:95 src/View/Migration.php:93 +#: src/View/MassOperations.php:94 src/View/Migration.php:93 msgid "migration in process .. please wait ..." msgstr "Migration wird durchgeführt … bitte warten ..." -#: src/View/MassOperations.php:105 src/View/Migration.php:103 +#: src/View/MassOperations.php:104 src/View/Migration.php:103 msgid "Migration failed" msgstr "Migration fehlgeschlagen" @@ -1562,7 +1562,7 @@ msgstr "CSV Herunterladen" msgid "Download Export" msgstr "Download Export" -#: src/Model/Booking.php:1027 src/Service/TimeframeExport.php:523 +#: src/Model/Booking.php:1028 src/Service/TimeframeExport.php:523 #: src/Service/TimeframeExport.php:533 src/Service/TimeframeExport.php:539 #: src/Service/TimeframeExport.php:549 src/Service/TimeframeExport.php:559 msgid "Unknown" @@ -2258,7 +2258,7 @@ msgstr "Benachrichtigungs-E-Mails an Nutzende senden" #: src/Wordpress/CustomPostType/Restriction.php:486 msgid "Important: Please save this restriction before clicking the send-button. Dependent of the status of the restriction, the appropriate notifications are sent to all affected users and location admins. You can configure the e-mail templates via Options -> Commonsbooking -> Tab Restrictions" -msgstr "Wichtig: Bitte speicher diese Einschränkung, bevor du auf den Senden-Button klickst. Abhängig vom Status der Einschränkung werden die entsprechenden Benachrichtigungen an alle betroffenen Nutzenden und Standortadministratrierende gesendet. Du kannst die E-Mail-Vorlagen über Optionen -> Commonsbooking -> Tab-Einschränkungen konfigurieren" +msgstr "Wichtig: Bitte speichere diese Einschränkung, bevor du auf den Senden-Button klickst. Abhängig vom Status der Einschränkung werden die entsprechenden Benachrichtigungen an alle betroffenen Nutzenden und Standortadministrierenden gesendet. Du kannst die E-Mail-Vorlagen über Optionen -> CommonsBooking -> Einschränkungen konfigurieren" #: src/Wordpress/CustomPostType/Restriction.php:504 msgid "Total breakdown" @@ -3138,7 +3138,7 @@ msgstr "Buchungen sind auf maximal %1$s Tage im Voraus beschränkt." msgid "It is not possible to access this timeframe on frontend. Please edit timeframe in backend. If you want to check the result of your timeframe settings visit the item or location in frontend to see the booking calender" msgstr "Es ist nicht möglich, diesen Zeitrahmen im Frontend abzurufen. Bitte bearbeite den Zeitrahmen im Backend. Wenn du das Ergebnis deiner Zeitrahmeneinstellungen überprüfen möchtest, rufe den Artikel oder Standort im Frontend auf, um den Buchungskalender zu sehen" -#: src/Model/Booking.php:1025 +#: src/Model/Booking.php:1026 msgid "Cancelled" msgstr "Storniert" @@ -4084,27 +4084,27 @@ msgstr "Keine Buchungen zum Umzug ausgewählt." msgid "All selected orphaned bookings have been migrated." msgstr "Alle ausgewählten verwaisten Buchungen sind migriert worden." -#: src/View/MassOperations.php:38 +#: src/View/MassOperations.php:37 msgid "ID" msgstr "ID" -#: src/View/MassOperations.php:40 +#: src/View/MassOperations.php:39 msgid "Item name" msgstr "Artikelname" -#: src/View/MassOperations.php:41 +#: src/View/MassOperations.php:40 msgid "Start-date" msgstr "Startdatum" -#: src/View/MassOperations.php:42 +#: src/View/MassOperations.php:41 msgid "End-date" msgstr "Enddatum" -#: src/View/MassOperations.php:44 +#: src/View/MassOperations.php:43 msgid "Location name" msgstr "Standortname" -#: src/View/MassOperations.php:45 +#: src/View/MassOperations.php:44 msgid "New location name" msgstr "Name des neuen Standorts" @@ -4116,8 +4116,7 @@ msgstr "Verwaiste Buchungen gefunden, können migriert werden. \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2025-01-03T11:53:49+00:00\n" +"POT-Creation-Date: 2025-01-06T17:27:47+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.11.0\n" "X-Domain: commonsbooking\n" @@ -996,7 +996,7 @@ msgid "Migrate bookings to new format so that they are listed at bookings menu i msgstr "" #: includes/OptionsArray.php:1125 -#: src/View/MassOperations.php:110 +#: src/View/MassOperations.php:109 #: src/View/Migration.php:107 msgid "Migrate bookings" msgstr "" @@ -1959,7 +1959,7 @@ msgid "Not available" msgstr "" #: src/View/Booking.php:193 -#: src/View/MassOperations.php:39 +#: src/View/MassOperations.php:38 #: src/Wordpress/CustomPostType/Booking.php:441 #: src/Wordpress/CustomPostType/Timeframe.php:99 #: templates/shortcode-bookings.php:73 @@ -1967,7 +1967,7 @@ msgid "User" msgstr "" #: src/View/Booking.php:197 -#: src/View/MassOperations.php:43 +#: src/View/MassOperations.php:42 #: src/Wordpress/CustomPostType/Booking.php:959 #: src/Wordpress/CustomPostType/Restriction.php:472 msgid "Status" @@ -2140,42 +2140,42 @@ msgstr "" msgid "No GPS data could be found for the address entered.
Please check if the address is written correctly.
Alternatively, you can enter the GPS data manually into the corresponding fields." msgstr "" -#: src/View/MassOperations.php:38 +#: src/View/MassOperations.php:37 msgid "ID" msgstr "" -#: src/View/MassOperations.php:40 +#: src/View/MassOperations.php:39 msgid "Item name" msgstr "" -#: src/View/MassOperations.php:41 +#: src/View/MassOperations.php:40 msgid "Start-date" msgstr "" -#: src/View/MassOperations.php:42 +#: src/View/MassOperations.php:41 msgid "End-date" msgstr "" -#: src/View/MassOperations.php:44 +#: src/View/MassOperations.php:43 msgid "Location name" msgstr "" -#: src/View/MassOperations.php:45 +#: src/View/MassOperations.php:44 msgid "New location name" msgstr "" -#: src/View/MassOperations.php:95 +#: src/View/MassOperations.php:94 #: src/View/Migration.php:93 msgid "migration in process .. please wait ..." msgstr "" -#: src/View/MassOperations.php:100 +#: src/View/MassOperations.php:99 #: src/View/Migration.php:53 #: src/View/Migration.php:98 msgid "Migration finished" msgstr "" -#: src/View/MassOperations.php:105 +#: src/View/MassOperations.php:104 #: src/View/Migration.php:103 msgid "Migration failed" msgstr "" diff --git a/readme.txt b/readme.txt index 6cf3dedc8..bb550372a 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.wielebenwir.de/verein/unterstutzen Tags: booking, calendar, sharing, commoning, open-source Requires at least: 5.9 Tested up to: 6.7 -Stable Tag: 2.9.4 +Stable Tag: 2.10 Requires PHP: 7.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -80,6 +80,23 @@ CommonsBooking was developed for the ["Commons Cargobike" movement](http://commo ## Changelog +### 2.10 (09.01.2025) +ADDED: When changing the location of an item you will now be given the option to move the bookings to the new location. +ENHANCED: Export of timeframes no longer time out. +ENHANCED: Total breakdowns cancelling all bookings can now be disabled. +ENHANCED: Map filter groups are now easier to configure. +ENHANCED: Loading the map should now be significantly faster. +ENHANCED: Greatly simplified booking codes; they will also not be generated for the past anymore. (thx @nelarsen) +ENHANCED: Show past bookings in [cb_bookings] overview. +FIXED: Booking codes now truly random. (thx @nelarsen) +FIXED: Map sometimes not rendering on certain aspects ratios. (thx @kmohrf) +FIXED: Saving posts should now be faster. +FIXED: Cache warmup not working in some cases. +FIXED: In certain overlapping timeframe configurations timeframes were not shown as bookable. (thx @nelarsen) +FIXED: Disabled restriction creation for all items / locations because of a missing permission check. +UPDATED: Dependencies + + ### 2.9.4 (17.07.2024) FIXED: Plugin not usable in multisite mode diff --git a/src/View/MassOperations.php b/src/View/MassOperations.php index 1b1ef63a6..f9d25b115 100644 --- a/src/View/MassOperations.php +++ b/src/View/MassOperations.php @@ -2,11 +2,10 @@ namespace CommonsBooking\View; -class MassOperations -{ +class MassOperations { public static function index() { global $templateData; - $templateData = []; + $templateData = []; $templateData["orphanedBookings"] = \CommonsBooking\Repository\Booking::getOrphaned(); ob_start(); @@ -19,15 +18,15 @@ public static function index() { * * @return void */ - public static function renderBookingViewTable (array $bookings){ + public static function renderBookingViewTable( array $bookings ) { + + if ( empty( $bookings ) ) { + echo '

' . esc_html__( 'No bookings found.' ) . '

'; - if (empty($bookings)) { - echo '

No bookings found.

'; return; } - $tableString = ''; - $tableString .= ' + $tableString = ' @@ -35,52 +34,52 @@ public static function renderBookingViewTable (array $bookings){ - - - - - - - + + + + + + + '; - foreach ($bookings as $booking): - try { - $itemTitle = $booking->getItem()->post_title; - } catch ( \Exception $e ) { - $itemTitle = 'Item not found'; - } + foreach ( $bookings as $booking ): + try { + $itemTitle = $booking->getItem()->post_title; + } catch ( \Exception $e ) { + $itemTitle = esc_html__( 'Item not found' ); + } - try { - $locationTitle = $booking->getLocation()->post_title; - } catch ( \Exception $e ) { - $locationTitle = 'Location not found'; - } + try { + $locationTitle = $booking->getLocation()->post_title; + } catch ( \Exception $e ) { + $locationTitle = esc_html__( 'Location not found' ); + } - try { - $newLocationTitle = $booking->getMoveableLocation()->post_title; - } catch ( \Exception $e ) { - $newLocationTitle = 'New Location not found'; - } + try { + $newLocationTitle = $booking->getMoveableLocation()->post_title; + } catch ( \Exception $e ) { + $newLocationTitle = esc_html__( 'New Location not found' ); + } - $tableString .= ' - + $tableString .= ' + - + - - - - - - + + + + + + '; - endforeach; - $tableString .= ' + endforeach; + $tableString .= '
' . esc_html__("ID",'commonsbooking') . '' . esc_html__("User",'commonsbooking') . '' . esc_html__("Item name",'commonsbooking') . ' - ' . esc_html__("Start-date",'commonsbooking') . '' . esc_html__("End-date",'commonsbooking') . '' . esc_html__("Status",'commonsbooking') . '' . esc_html__("Location name",'commonsbooking') . '' . esc_html__("New location name",'commonsbooking') . '' . esc_html__( "ID", 'commonsbooking' ) . '' . esc_html__( "User", 'commonsbooking' ) . '' . esc_html__( "Item name", 'commonsbooking' ) . ' + ' . esc_html__( "Start-date", 'commonsbooking' ) . '' . esc_html__( "End-date", 'commonsbooking' ) . '' . esc_html__( "Status", 'commonsbooking' ) . '' . esc_html__( "Location name", 'commonsbooking' ) . '' . esc_html__( "New location name", 'commonsbooking' ) . '
- + ' . $booking->ID .'' . $booking->ID . ' ' . $booking->getUserData()->user_nicename . '' . $itemTitle . '' . $booking->getFormattedStartDate() . '' . $booking->getFormattedEndDate() . '' . $booking->post_status . '' . $locationTitle . '' . $newLocationTitle . '' . $itemTitle . '' . $booking->getFormattedStartDate() . '' . $booking->getFormattedEndDate() . '' . $booking->post_status . '' . $locationTitle . '' . $newLocationTitle . '
';