Skip to content

Commit 75b6d96

Browse files
refactor(reservation): Replace jsPDF + jspdf-autotable + Lodash + jQuery with pdfmake and
native browser APIs for generating reservation PDFs - Remove global `allAttributes` variable; attribute data now flows as an explicit parameter through LoadCustomAttributesData() → BuildReservationPdfDefinition() - Replace $.ajax and jQuery event binding with async/await, fetch, URLSearchParams and addEventListener - Extract section builder functions: buildHeader(), buildDetails(), buildAttributes() - Fix invalid Smarty modifier escape:'json' → |json_encode - Replace magic number '5' (DATETIME) with $CustomAttributeTypeDateTime constant exposed from ReservationAttributesPrintPage::PageLoad() - Expose DayNamesFull to templates for repeat weekday names in PDF
1 parent ccb5d3d commit 75b6d96

8 files changed

Lines changed: 609 additions & 315 deletions

File tree

Pages/Ajax/ReservationAttributesPrintPage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function PageLoad()
5151
$userSession = ServiceLocator::GetServer()->GetUserSession();
5252
$this->presenter->PageLoad($userSession);
5353
$this->Set('ReadOnly', BooleanConverter::ConvertValue($this->GetIsReadOnly()));
54+
$this->Set('CustomAttributeTypeDateTime', CustomAttributeTypes::DATETIME);
5455
$this->Display('Ajax/reservation/reservation_attributes_print.tpl');
5556
}
5657

Pages/Reservation/ReservationPage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ public function PageLoad()
233233
6 => 'DaySaturdayAbbr',
234234
]
235235
);
236+
$this->Set(
237+
'DayNamesFull',
238+
Resources::GetInstance()->GetDays('full')
239+
);
236240

237241
$this->Set('TitleRequired', $config->GetKey(ConfigKeys::RESERVATION_TITLE_REQUIRED, new BooleanConverter()));
238242
$this->Set('DescriptionRequired', $config->GetKey(ConfigKeys::RESERVATION_DESCRIPTION_REQUIRED, new BooleanConverter()));

0 commit comments

Comments
 (0)