From 089bb95715723ffd0ab8708e5716c0f2c0afa460 Mon Sep 17 00:00:00 2001 From: Thomas Hackl Date: Thu, 7 Oct 2021 09:19:02 +0000 Subject: TIC 11447 Freitext Raumbelegungsplan --- app/controllers/resources/admin.php | 4 ++++ app/controllers/resources/print.php | 4 ++++ app/views/resources/admin/configuration.php | 6 +++++ app/views/resources/print/clipboard_rooms.php | 6 +++++ db/migrations/20210421_freetext_in_room_export.php | 27 ++++++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 db/migrations/20210421_freetext_in_room_export.php diff --git a/app/controllers/resources/admin.php b/app/controllers/resources/admin.php index 0ce8d41..80a6c26 100644 --- a/app/controllers/resources/admin.php +++ b/app/controllers/resources/admin.php @@ -1209,6 +1209,10 @@ class Resources_AdminController extends AuthenticatedController 'RESOURCES_BOOKING_PLAN_END_HOUR', $this->resources_booking_plan_end_hour ); + $this->config->store( + 'RESOURCES_ADDITIONAL_TEXT_ROOM_EXPORT', + Studip\Markup::purifyHtml(Request::get('additional_text')) + ); $this->config->store( 'RESOURCES_EXPORT_BOOKINGTYPES_DEFAULT', diff --git a/app/controllers/resources/print.php b/app/controllers/resources/print.php index a21db5e..292f8b8 100644 --- a/app/controllers/resources/print.php +++ b/app/controllers/resources/print.php @@ -142,6 +142,10 @@ class Resources_PrintController extends AuthenticatedController 2 => _('Sperrbuchung'), 3 => _('Planungsbuchung') ]; + + // Get additional text to print + $this->additional_text = Config::get()->RESOURCES_ADDITIONAL_TEXT_ROOM_EXPORT; + if (!$this->clipboard_selected && !$this->print_schedules) { //We have to load all selectable clipboards of the current user: $this->available_clipboards = Clipboard::getClipboardsForUser( diff --git a/app/views/resources/admin/configuration.php b/app/views/resources/admin/configuration.php index 62c1d88..23ade8d 100644 --- a/app/views/resources/admin/configuration.php +++ b/app/views/resources/admin/configuration.php @@ -128,6 +128,12 @@ + diff --git a/app/views/resources/print/clipboard_rooms.php b/app/views/resources/print/clipboard_rooms.php index 0cba520..3202809 100644 --- a/app/views/resources/print/clipboard_rooms.php +++ b/app/views/resources/print/clipboard_rooms.php @@ -177,6 +177,12 @@ ], ['class' => 'resource-plan'] ) ?> + +
+
+ +
+ diff --git a/db/migrations/20210421_freetext_in_room_export.php b/db/migrations/20210421_freetext_in_room_export.php new file mode 100644 index 0000000..f978a23 --- /dev/null +++ b/db/migrations/20210421_freetext_in_room_export.php @@ -0,0 +1,27 @@ +exec($query); + } + + protected function down() + { + $query = "DELETE FROM `config` WHERE `field` = 'RESOURCES_ADDITIONAL_TEXT_ROOM_EXPORT'"; + DBManager::get()->exec($query); + $query = "DELETE FROM `config_values` WHERE `field` = 'RESOURCES_ADDITIONAL_TEXT_ROOM_EXPORT'"; + DBManager::get()->exec($query); + } +} -- cgit v1.0