Skip to content

BookCal: prevent double booking, add mail templates & confirm/cancel actions#38110

Open
ElaaxMarketing wants to merge 5 commits intoDolibarr:developfrom
ElaaxMarketing:fix/elaax-bookcal-hardening
Open

BookCal: prevent double booking, add mail templates & confirm/cancel actions#38110
ElaaxMarketing wants to merge 5 commits intoDolibarr:developfrom
ElaaxMarketing:fix/elaax-bookcal-hardening

Conversation

@ElaaxMarketing
Copy link
Copy Markdown

@ElaaxMarketing ElaaxMarketing commented May 6, 2026

Summary

Fixes several issues in BookCal’s public booking flow and internal booking list:

Prevents double bookings by creating public bookings inside a database transaction with a row lock.
Adds the BookCal email template type (bookcal_send) to the admin email templates UI.
Allows bookings to be confirmed or canceled from the booking list, with customer notifications sent via email templates.
Handles missing BookCal document model directories when generating availability documents.
Notes

Email content can be customized with email templates using type_template=bookcal_send.

Suggested labels used by the code:

BookCalBookingAcknowledgement
BookCalBookingConfirmed
BookCalBookingCanceled

Also adds translation keys for booking-slot errors and booking status messages in English and French.

@hregis
Copy link
Copy Markdown
Contributor

hregis commented May 6, 2026

@ElaaxMarketing use develop branch for this PR please...
And remove this double comment

* Copyright (C) 2026 ELAAX IT-Service (https://www.elaax.de)

@ElaaxMarketing ElaaxMarketing changed the base branch from 23.0 to develop May 6, 2026 13:16
} elseif ((int) $obj->percent === 100 || (string) $obj->answer_status === '1') {
print '<span class="badge badge-status4">Bestaetigt</span>';
} else {
print '<span class="badge badge-status1">Offen</span>';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must use $langs->trans("KeyInEnglish") and add the key=value into en_US/agenda.lang file

$elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject'));
}
if (isModEnabled('bookcal')) {
$elementList['bookcal_send'] = img_picto('', 'calendar', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('BookingCalendar'));
Copy link
Copy Markdown
Member

@eldy eldy May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entry BookingCalendar does not exists in any en_US/*.lang file.
Must be added in one file with english translation.

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants