#assign hasSuggestPOI = false />
<#attempt>
<#include "/admin/plugins/address/modules/autocomplete/include/suggestPOI.html" />
<#assign hasSuggestPOI = true />
<#recover>
#attempt>
<#assign hasMap = hasSuggestPOI && (isLeafletInstalled!false) />
<@commonsAppJS />
<@pageContainer>
<@pageColumn>
<@tform id='formid' method='post' action='jsp/admin/plugins/appointment/ManageAppointmentForms.jsp' enctype='multipart/form-data'>
<@pageHeader title='#i18n{appointment.createAppointmentForm.title}' >
<@button type='submit' buttonIcon='check' title='#i18n{portal.util.labelCreate}' />
<@aButton href='jsp/admin/plugins/appointment/ManageAppointmentForms.jsp' buttonIcon='times' title='#i18n{portal.util.labelCancel}' color='light' />
@pageHeader>
<@input type='hidden' id='id_form' name='id_form' />
<@messages errors=errors />
<@row>
<@columns xs=12 md=6>
<@box>
<@boxHeader title='#i18n{appointment.manageAppointments.columnFormTitle}' />
<@boxBody>
<@formGroup labelFor='title' labelKey='#i18n{appointment.createAppointmentForm.labelTitle}' mandatory=true>
<@input type='text' name='title' id='title' value='${appointmentform.title!\'\'}' maxlength=255 />
@formGroup>
<@formGroup labelFor='idCategory' labelKey='#i18n{appointment.createAppointmentForm.labelCategory}'>
<@select name='idCategory' id='idCategory' items=listCategories default_value='${appointmentform.idCategory!}' />
@formGroup>
<@formGroup labelFor='description' labelKey='#i18n{appointment.labelDescription}' mandatory=true>
<@input type='textarea' name='description' id='description' maxlength=255 >${appointmentform.description!}@input>
@formGroup>
<@row>
<@columns xs=12 md=6>
<@formGroup labelFor='display_title_fo' labelKey='#i18n{appointment.label.displayTitleFo}' helpKey='#i18n{appointment.label.displayTitleFo.help}' hideLabel=['all']>
<@checkBox orientation='switch' labelKey='#i18n{appointment.label.displayTitleFo}' name='display_title_fo' id='display_title_fo' value='true' checked=appointmentform.displayTitleFo!false />
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='is_displayed_on_portlet' labelKey='#i18n{appointment.label.displayOnPortlet}' helpKey='#i18n{appointment.label.displayOnPortlet.help}' hideLabel=['all']>
<@checkBox orientation='switch' labelKey='#i18n{appointment.label.displayOnPortlet}' name='is_displayed_on_portlet' id='is_displayed_on_portlet' value='true' checked=appointmentform.isDisplayedOnPortlet!false />
@formGroup>
@columns>
@row>
<@row>
<@columns xs=12 md=6>
<@formGroup labelFor='date_start_validity' labelKey='#i18n{appointment.createAppointmentForm.labelDateStartValidity}' helpKey='#i18n{appointment.createAppointmentForm.labelDateStartValidity.help}'>
<@input type='date' name='date_start_validity' id='date_start_validity' value='${appointmentform.dateStartValidity!\'\'}' />
@formGroup>
<@formGroup labelFor='bo_overbooking' labelKey='#i18n{appointment.label.BoOverbooking}' helpKey='#i18n{appointment.label.BoOverbooking.help}' hideLabel=['all']>
<@checkBox orientation='switch' labelKey='#i18n{appointment.label.BoOverbooking}' name='bo_overbooking' id='bo_overbooking' value='true' checked=appointmentform.boOverbooking!false />
@formGroup>
<@formGroup labelFor='nb_consecutive_slots' labelKey='#i18n{appointment.label.nbConsecutiveSlots}' helpKey='#i18n{appointment.label.nbConsecutiveSlots.help}' mandatory=true >
<@input type='number' name='nb_consecutive_slots' id='nb_consecutive_slots' value=appointmentform.nb_consecutive_slots!'1' params='onkeypress="return validateQty(event);"' maxlength=2 />
@formGroup>
<@formGroup labelFor='nb_weeks_to_display' labelKey='#i18n{appointment.label.nbWeeksToDisplay}' helpKey='#i18n{appointment.label.nbWeeksToDisplay.help}' mandatory=true>
<@input type='number' name='nb_weeks_to_display' id='nb_weeks_to_display' value=appointmentform.nbWeeksToDisplay!'' params='onkeypress="return validateQty(event);"' maxlength=2 />
@formGroup>
<@formGroup labelFor='nb_days_before_new_appointment' labelKey='#i18n{appointment.createAppointmentForm.labelNbDaysBeforeNewAppointment}' helpKey='#i18n{appointment.createAppointmentForm.labelNbDaysBeforeNewAppointment.help}' mandatory=true>
<@input type='number' name='nb_days_before_new_appointment' id='nb_days_before_new_appointment' value=appointmentform.nbDaysBeforeNewAppointment!'' params='onkeypress="return validateQty(event);"' maxlength=2 />
@formGroup>
<@formGroup labelFor='nb_max_appointments_per_user' labelKey='#i18n{appointment.createAppointmentForm.labelNbMaxAppointments}' helpKey='#i18n{appointment.createAppointmentForm.labelNbMaxAppointments.help}' mandatory=true>
<@input type='number' name='nb_max_appointments_per_user' id='nb_max_appointments_per_user' value=appointmentform.nbMaxAppointmentsPerUser!'' params='onkeypress="return validateQty(event);"' maxlength=2 />
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='date_end_validity' labelKey='#i18n{appointment.createAppointmentForm.labelDateEndValidity}' helpKey='#i18n{appointment.createAppointmentForm.labelDateEndValidity.help}'>
<@input type='date' name='date_end_validity' id='date_end_validity' value='${appointmentform.dateEndValidity!\'\'}' />
@formGroup>
<@formGroup labelFor='is_multislot_appointment' labelKey='#i18n{appointment.label.isMultislotAppointment}' helpKey='#i18n{appointment.label.isMultislotAppointment.help}' hideLabel=['all']>
<@checkBox orientation='switch' name='is_multislot_appointment' id='is_multislot_appointment' labelKey='#i18n{appointment.label.isMultislotAppointment}' value='true' checked=appointmentform.isMultislotAppointment!false params='onchange="javascript:toggleConsecutiveSlots();"' />
@formGroup>
<@formGroup labelFor='nb_days_for_max_appointments_per_user' labelKey='#i18n{appointment.createAppointmentForm.labelNbDaysForMaxAppointments}' helpKey='#i18n{appointment.createAppointmentForm.labelNbDaysForMaxAppointments.help}' mandatory=true>
<@input type='number' name='nb_days_for_max_appointments_per_user' id='nb_days_for_max_appointments_per_user' value=appointmentform.nbDaysForMaxAppointmentsPerUser!'' params='onkeypress="return validateQty(event);"' maxlength=2 />
@formGroup>
<@formGroup labelFor='min_time_before_appointment' labelKey='#i18n{appointment.createAppointmentForm.labelMinTimeBeforeAppointment}' helpKey='#i18n{appointment.createAppointmentForm.labelMinTimeBeforeAppointment.help}' mandatory=true>
<@input type='number' name='min_time_before_appointment' id='min_time_before_appointment' value=appointmentform.minTimeBeforeAppointment!'' params='onkeypress="return validateQty(event);"' maxlength=3 />
@formGroup>
<@formGroup labelFor='reference' labelKey='#i18n{appointment.createAppointmentForm.labelReference}' helpKey='#i18n{appointment.createAppointmentForm.labelReference.help}'>
<@input type='text' name='reference' id='reference' value=appointmentform.reference!'' maxlength=10 />
@formGroup>
<@formGroup labelFor='capacity_per_slot' labelKey='#i18n{appointment.createAppointmentForm.labelCapacityPerSlot}' helpKey='#i18n{appointment.createAppointmentForm.labelCapacityPerSlot.help}'>
<@input type='number' name='capacity_per_slot' id='capacity_per_slot' value=appointmentform.capacityPerSlot!'1' maxlength=4 />
@formGroup>
@columns>
@row>
@boxBody>
@box>
@columns>
<@columns xs=12 md=6>
<@box>
<@boxHeader title='#i18n{appointment.createAppointmentForm.labelWeekType}' />
<@boxBody>
<@formGroup labelFor='name' labelKey='#i18n{appointment.createAppointmentForm.labelName}' mandatory=true>
<@input type='text' name='name' id='name' value='${appointmentform.name!\'\'}' maxlength=50 />
@formGroup>
<@formGroup labelFor='descriptionRule' labelKey='#i18n{appointment.createAppointmentForm.labelDescriptionRule}' mandatory=true>
<@input type='textarea' name='description_rule' id='description_rule' maxlength=255 >${appointmentform.descriptionRule!}@input>
@formGroup>
<@row>
<@columns xs=12 md=6>
<@formGroup labelFor='color' labelKey='#i18n{appointment.createAppointmentForm.labelColor}'>
<@input type='color' name='color' class='p-2' id='color' value='${appointmentform.color!"#1AF355"}' params='style="width:50px; height:50px; "' />
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='max_people_per_appointment' labelKey='#i18n{appointment.createAppointmentForm.labelMaxPeoplePerAppointment}' helpKey='#i18n{appointment.createAppointmentForm.labelMaxPeoplePerAppointment.help}' mandatory=true>
<@input type='number' name='max_people_per_appointment' id='max_people_per_appointment' value=appointmentform.maxPeoplePerAppointment!'' params='onkeypress="return validateQty(event);"' maxlength=3 />
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='duration_appointments' labelKey='#i18n{appointment.createAppointmentForm.labelDurationAppointments}' helpKey='#i18n{appointment.createAppointmentForm.labelDurationAppointments.help}' mandatory=true>
<@input type='number' name='duration_appointments' id='duration_appointments' value=appointmentform.durationAppointments!'' params='onkeypress="return validateQty(event);"' maxlength=3 min=0 max=60 step=5 />
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='max_capacity_per_slot' labelKey='#i18n{appointment.createAppointmentForm.labelMaxCapacityPerSlot}' helpKey='#i18n{appointment.createAppointmentForm.labelMaxCapacityPerSlot.help}' mandatory=true>
<@input type='number' name='max_capacity_per_slot' id='max_capacity_per_slot' value=appointmentform.maxCapacityPerSlot!'' params='onkeypress="return validateQty(event);"' maxlength=3 />
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='time_start' labelKey='#i18n{appointment.createAppointmentForm.labelTimeStart}' helpKey='#i18n{appointment.createAppointmentForm.labelTimeStart.help}' mandatory=true>
<@inputGroup>
<@input type='time' name='time_start' id='time_start' value=appointmentform.timeStart!'' />
<@inputGroupItem type='text'><@icon style='clock' />@inputGroupItem>
@inputGroup>
@formGroup>
@columns>
<@columns xs=12 md=6>
<@formGroup labelFor='time_end' labelKey='#i18n{appointment.createAppointmentForm.labelTimeEnd}' helpKey='#i18n{appointment.createAppointmentForm.labelTimeEnd.help}' mandatory=true>
<@inputGroup>
<@input type='time' name='time_end' id='time_end' value=appointmentform.timeEnd!'' />
<@inputGroupItem type='text'><@icon style='clock' />@inputGroupItem>
@inputGroup>
@formGroup>
@columns>
@row>
@boxBody>
@box>
<@box>
<@boxHeader title='#i18n{appointment.modifyAppointmentForm.titleAlterablesParameters}' />
<@boxBody>
<@fieldSet legend='#i18n{appointment.createAppointmentForm.labelTitleDaysOpen}'>
<@formGroup>
<@checkBox orientation='switch' name='is_open_monday' id='is_open_monday' value='true' checked=appointmentform.isOpenMonday!false labelKey='#i18n{appointment.label.OpenMonday}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='is_open_tuesday' id='is_open_tuesday' value='true' checked=appointmentform.isOpenTuesday!false labelKey='#i18n{appointment.label.OpenTuesday}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='is_open_wednesday' id='is_open_wednesday' value='true' checked=appointmentform.isOpenWednesday!false labelKey='#i18n{appointment.label.OpenWednesday}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='is_open_thursday' id='is_open_thursday' value='true' checked=appointmentform.isOpenThursday!false labelKey='#i18n{appointment.label.OpenThursday}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='is_open_friday' id='is_open_friday' value='true' checked=appointmentform.isOpenFriday!false labelKey='#i18n{appointment.label.OpenFriday}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='is_open_saturday' id='is_open_saturday' value='true' checked=appointmentform.isOpenSaturday!false labelKey='#i18n{appointment.label.OpenSaturday}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='is_open_sunday' id='is_open_sunday' value='true' checked=appointmentform.isOpenSunday!false labelKey='#i18n{appointment.label.OpenSunday}' />
@formGroup>
@fieldSet>
<#if listWorkflows??>
<@formGroup labelFor='idWorkflow' labelKey='#i18n{appointment.createAppointmentForm.labelWorkflow}'>
<@select name='idWorkflow' id='idWorkflow' items=listWorkflows default_value='${appointmentform.idWorkflow!}' />
@formGroup>
#if>
<@formGroup labelFor='workgroup' labelKey='#i18n{appointment.createAppointmentForm.labelWorkgroup}'>
<@select name='workgroup' id='workgroup' items=user_workgroup_list default_value='${appointmentform.workgroup!}' />
@formGroup>
<@formGroup labelFor='calendarTemplateId' labelKey='#i18n{appointment.createAppointmentForm.labelCalendarTemplate}' mandatory=true>
<@select name='calendarTemplateId' id='calendarTemplateId' items=refListCalendarTemplates default_value='${appointmentform.calendarTemplateId!}' />
@formGroup>
<#if accesscontrol_list?has_content && accesscontrol_list?size gt 1>
<@formGroup labelFor='id_accesscontrol' labelKey='#i18n{appointment.createAppointmentForm.accesscontrol.label}' helpKey='#i18n{appointment.createAppointmentForm.accesscontrol.label.help}'>
<@select name='id_accesscontrol' id='id_accesscontrol' items=accesscontrol_list default_value='${accesscontrol_id!}' />
@formGroup>
#if>
<#if isCaptchaEnabled>
<@formGroup>
<@checkBox orientation='switch' name='enableCaptcha' id='enableCaptcha' value='true' checked=appointmentform.enableCaptcha!false labelKey='#i18n{appointment.createAppointmentForm.labelEnableCaptcha}' />
@formGroup>
#if>
<@formGroup>
<@checkBox orientation='switch' name='enableMandatoryEmail' id='enableMandatoryEmail' value='true' checked=appointmentform.enableMandatoryEmail!false labelKey='#i18n{appointment.createAppointmentForm.labelEnableMandatoryEmail}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' name='activeAuthentication' id='activeAuthentication' value='true' checked=appointmentform.activeAuthentication!false labelKey='#i18n{appointment.createAppointmentForm.labelActiveAuthentication}' />
@formGroup>
<@formGroup>
<@checkBox orientation='switch' labelKey='#i18n{appointment.createAppointmentForm.labelAnonymizable}' name='anonymizable' id='anonymizable' value='true' checked=appointmentform.anonymizable!false params='onchange="javascript:changeVisilityAnonymizePattern();"'/>
@formGroup>
<@div id="anonymization_pattern_group">
<@formGroup labelFor='anonymization_pattern' labelKey='#i18n{appointment.createAppointmentForm.labelAnonymizePattern}' helpKey='#i18n{appointment.createAppointmentForm.labelAnonymizePattern.help}' >
<#assign pattern = appointmentform.anonymizationPattern!'' />
<@select name='anonymization_pattern' id='anonymization_pattern'>
<#list [['%f','formId'],['%g','guid'],['%n','number']] as p><@option value=p[0] label='#i18n{appointment.createAppointmentForm.anonymizePattern.'+p[1]+'}' selected=(pattern == p[0]) />#list>
<#if pattern?has_content && !['%f','%g','%n']?seq_contains(pattern)><@option value=pattern label=pattern selected=true />#if>
@select>
@formGroup>
@div>
<@formGroup labelFor='role' labelKey='#i18n{appointment.createAppointmentForm.labelRole}'>
<@select name='role' id='role' items=refListRoles default_value='${appointmentform.role!}' />
@formGroup>
<@formGroup labelFor='icon' labelKey='#i18n{appointment.createAppointmentForm.labelIconForm}' helpKey='#i18n{appointment.modifyAppointmentForm.helpFormatIcon}'>
<@inputGroup>
<@input type='file' id='image_resource' name='image_resource' params='accept="image/*"' />
<@button color='light' params='onclick="document.getElementById(\'image_resource\').value=\'\'"' buttonIcon='x' title='#i18n{appointment.label.clearFile}' size='' hideTitle=['xs','sm','md'] />
@inputGroup>
@formGroup>
<@formGroup labelFor='address_address-input' labelKey='#i18n{appointment.label.formAddress}' helpKey='#i18n{appointment.help.formAddress}'>
<@input type='hidden' name='geoloc_longitude' id='geoloc_longitude' value='${(appointmentform.longitude?c)!}' />
<@input type='hidden' name='geoloc_latitude' id='geoloc_latitude' value='${(appointmentform.latitude?c)!}' />
<@input type='hidden' name='hidden_address' id='hidden_address' />
<@input type=hasSuggestPOI?then('hidden','text') name='geoloc_address' id='geoloc_address' value='${(appointmentform.address?html)!}' />
<#if hasSuggestPOI>
<@suggestPOIInput id="address_address" name="address_address" currentValue="${(appointmentform.address?html)!}" />
#if>
<#if hasMap><@div id='map_address' class='mt-3 position-relative w-100' params='style="min-height: 300px;"' />#if>
@formGroup>
@boxBody>
@box>
@columns>
@row>
<@row>
<@columns class='d-flex justify-content-end'>
<@input type='hidden' name='action_createAppointmentForm' value='' />
<@button type='submit' buttonIcon='check' title='#i18n{portal.util.labelCreate}' />
<@aButton href='jsp/admin/plugins/appointment/ManageAppointmentForms.jsp' buttonIcon='times' title='#i18n{portal.util.labelCancel}' color='light' />
@columns>
@row>
@tform>
@pageColumn>
@pageContainer>
<#if hasMap>
#if>
<#if hasSuggestPOI><@setupSuggestPOI />#if>