<#-- -- Check if the checkbox must be checked or not -- @param code the checkbox code -- @param referecen_list the default values list -- @return the String 'checked="checked" if the checkbox must be checked, an empty String otherwise --> <#function getChecked code reference_list> <#if reference_list?has_content> <#list reference_list as reference_item> <#if reference_item.code = code> <#if reference_item.checked> <#return true> <#else> <#return false> <#return false> <#-- -- Get the value of the parameter -- @param code the code of the parameter -- @param referecen_list the default values list -- @return the value of the parameter --> <#function getName code reference_list default=''> <#if reference_list?has_content> <#list reference_list as reference_item> <#if reference_item.code = code> <#return reference_item.name> <#return default> <#-- -- Get the field from a given title -- @param entry the entry -- @param fieldTitle the title -- @return the field --> <#function getField entry fieldTitle> <#if entry.fields?? && entry.fields?has_content> <#list entry.fields as field> <#if field?? && field.title?? && field.title == fieldTitle> <#return field> <#-- -- Get the field from a given code -- @param entry the entry -- @param fieldCode the code -- @return the field --> <#function getFieldByCode entry fieldCode> <#if entry.fields?? && entry.fields?has_content> <#list entry.fields as field> <#if field?? && field.code?? && field.code == fieldCode> <#return field> <#-- -- Get the field value from a given entry and a given title -- @param entry the entry -- @param fieldTitle the title -- @return the field --> <#function getFieldValue entry fieldTitle> <#if getField( entry, fieldTitle )??> <#assign field = getField( entry, fieldTitle )> <#return field.value> <#return ""> <#-- -- Get the field value from a given entry and a given title -- @param entry the entry -- @param fieldTitle the title -- @return the field --> <#function getFieldValueByCode entry fieldCode> <#if getFieldByCode( entry, fieldCode )??> <#assign field = getFieldByCode( entry, fieldCode )> <#return field.value> <#return ""> <#-- -- Get the response containing the field with the given title -- @param responses the list of responses -- @param the fieldCode the code -- @return the response --> <#function getResponseContainingTheFieldWithTitle responses fieldTitle> <#if responses??> <#list responses as response> <#if response.field?? && response.field.title?? && response.field.title == fieldTitle > <#return response /> <#-- -- Get the response containing the field with the given code -- @param responses the list of responses -- @param the fieldCode the code -- @return the response --> <#function getResponseContainingTheFieldWithCode responses fieldCode> <#if responses??> <#list responses as response> <#if response.field?? && response.field.code?? && response.field.code == fieldCode > <#return response /> <#-- -- Get the response from a given entry -- WARNING : use only if the entry has ONE response -- @param responses the list of responses -- @param entry the entry -- @return the response entry --> <#function getResponse responses entry> <#if responses??> <#list responses as response> <#if response.entry.idEntry == entry.idEntry> <#return response /> <#-- -- Get the response entry from a given entry -- @param responses the list of responses -- @param entry the entry -- @return the response entry --> <#function getResponseEntry responses entry> <#if responses??> <#list responses as response> <#if response.entry.idEntry == entry.idEntry> <#return response.entry /> <#-- -- Get the error for the given entry -- @param responses the list of responses -- @param entry the entry -- @return the error --> <#function getError responses entry> <#if getResponseEntry( responses, entry )??> <#assign responseEntry = getResponseEntry( responses, entry ) > <#return responseEntry.error /> <#-- -- Get the max files value of an entry -- @param entry the entry -- @return the number of max authorized uploaded files --> <#function getMaxFiles entry> <#assign fieldMaxFiles = getFieldValueByCode( entry, "max_files" )> <#if fieldMaxFiles?? && fieldMaxFiles != ""> <#return fieldMaxFiles> <#return "1"> <#-- -- Get the max size an uploaded file is authorized to have -- @param entry the entry -- @return the max size --> <#function getFileMaxSize entry> <#assign fieldFileMaxSize = getFieldValueByCode( entry, "file_max_size" )> <#if fieldFileMaxSize?? && fieldFileMaxSize != ""> <#return fieldFileMaxSize> <#else> <#if getField( entry, "option" )??> <#assign fieldFileMaxSize = getFieldByCode( entry, "option" )> <#return fieldFileMaxSize.width> <#return "5242880"> <#-- -- Check if the given entry must export the binary -- @param entry the entry -- @return true if it must export the binaries, false otherwise --> <#function exportBinary entry> <#assign field = getFieldValueByCode( entry, "export_binary" ) /> <#if field?? && field = "true"> <#return true /> <#return false /> <#-- -- Build the entry name -- @param entry the entry -- @param entry_iteration_number the iteration number -- @return the name --> <#function buildEntryName entry entry_iteration_number='' > <#assign name = 'attribute' + entry.idEntry> <#if entry_iteration_number?? && entry_iteration_number?has_content> <#assign name = 'nIt' + entry_iteration_number + '_attribute' + entry.idEntry> <#return name /> <#macro formEditor > <#include "/admin/util/editor/editor.html" /> <#assign cssFiles="editor.css, page_template_styles.css" /> <#assign editorLocale="" /> <#-- We only have the language pack for French (France) installed in webapp/js/editors/tinymce/langs --> <#-- Some lutece plugins pass locale.getLanguage() (="fr"), some pass the locale object (toString="fr_FR", or more complicated...) --> <#-- Force it here because if it is a wrong value, tinyMCE does not load --> <#if locale?? && (2 <= locale?string?length) && (locale?string?substring(0,2) == "fr")> <#assign editorLocale="fr_FR" /> <@initEditor cssFiles=cssFiles /> <#macro formsToastr infos=[] warnings=[] errors=[]> <#assign typeToast=''> <#assign messageToast=''> <#if errors??> <#if errors?size gt 0 > <#assign typeToast='danger'> <#list errors as error > <#if error.message??><#assign messageToast='${error.message!"#i18n{portal.util.message.titleError} "}'> <#if warnings??> <#if warnings?size gt 0 > <#assign typeToast='warning'> <#assign first = warnings[0] /> <#if first?is_string> <#list warnings as warning ><#assign messageToast='${warning!"#i18n{portal.util.message.titleWarning}"}'> <#else > <#list warnings as warning ><#if warning.message??><#assign messageToast='${warning.message!"#i18n{portal.util.message.titleWarning} "}'> <#if infos??> <#if infos?size gt 0 > <#assign typeToast='info'> <#assign first = infos[0] /> <#if first?is_string> <#list infos as info ><#assign messageToast='${info!"#i18n{portal.util.labelInfo} "}'> <#else> <#list infos as info ><#if info.message??><#assign messageToast='${info.message!"#i18n{portal.util.labelInfo} "}'> <#if typeToast?? && typeToast != ''><@initToast><@addToast content=messageToast class='bg-${typeToast} text-${typeToast}-fg' /> <#macro formBreadCrumb home='jsp/admin/plugins/forms/ManageForms.jsp' homeLabel=false> <@row> <@breadcrumbs id='breadforms' params=' style="margin-bottom:1em; background-color:transparent;"'> <@breadcrumbItem> <@link href=home title='#i18n{forms.form.returnPage} #i18n{forms.manageForm.title}'> <@icon style='home' /> <#if homeLabel>#i18n{forms.manageForm.title} <#nested> <#macro bottomFormFixedButtons> <#assign bottomParams>class="<#if commonsThemeCode='tabler'>fixed-bottom d-flex gap-2 justify-content-end bg-light bg-gradient left-0 w-100 d-flex justify-content-center py-3" style="--tblr-bg-opacity:.5;" <@div params=bottomParams> <#nested> <#macro headerButton name='view_manageForm' label='portal.admin.message.buttonCancel' validate=true> <#if validate> <#assign color = '' /> <#assign buttonIcon = 'check me-1' /> <#else> <#assign color = 'danger' /> <#assign buttonIcon = 'times me-1' /> <@button type='submit' name='${name}' title='#i18n{${label}}' cancel=!validate buttonIcon=buttonIcon color=color /> <#macro formsButton okAction='' viewAction='' rows=1> <@button type='submit' id='action_${okAction}' name='action_${okAction}' buttonIcon='check' title='#i18n{portal.admin.message.buttonValidate}' class='form-validation' /> <#nested> <#if viewAction !=''> <@button type='submit' name='view_${viewAction}' title='#i18n{portal.admin.message.buttonCancel}' cancel=true buttonIcon='times' class='form-validation' /> <#macro modalFrameScript formId actionId='action_modifyControl' title='#i18n{portal.util.labelModify}' modalId='pubModal' iframeId='modalIframe' modalHeight=70 > <#macro formModel type='update'> <#include "/admin/plugins/asynchronousupload/upload_commons.html" /> <@addRequiredBOJsFiles /> <@row> <@columns md=6 xl=4 > <@card> <@fieldSet legend='#i18n{forms.modify_form.labelDescription}'> <@formGroup labelKey='#i18n{forms.modify_form.labelTitle}' helpKey='#i18n{forms.modify_form.labelTitle.help}' mandatory=true rows=2> <@input type='text' name='title' value='${form.title!}' /> <@formGroup labelKey='#i18n{forms.modify_form.labelDescription}' helpKey='#i18n{forms.modify_form.labelDescription.help}' rows=2> <@input type='textarea' name='description'>${form.description!} <@formGroup labelKey='#i18n{forms.modify_form.labelCategory}' helpKey='#i18n{forms.modify_form.labelCategory.help}' rows=2> <@select name='id_category' items=categoryList default_value='${form.idCategory!}' /> <@formGroup labelKey='#i18n{forms.modify_form.labelLogo}' helpKey='#i18n{forms.modify_form.labelLogo.help}' rows=2> <@addFileBOInput fieldName="upload_logo" handler=uploadHandler submitBtnName='action_doSynchronousUploadDocument' cssClass='' multiple=true /> <#if !listFiles??><#assign listFiles = ''>
<@addBOUploadedFilesBox fieldName="upload_logo" handler=uploadHandler submitBtnName='action_doSynchronousUploadDocument' listFiles=listFiles />
<@fieldSet legend='#i18n{forms.create_form.display.label}'> <@row> <@columns> <@formGroup labelKey='#i18n{forms.modify_form.labelBreadcrumb}' helpKey='#i18n{forms.modify_form.labelBreadcrumb.help}' mandatory=true rows=2> <@select name='breadcrumbName' items=breadcrumbTypes default_value='${form.breadcrumbName!}' /> <@row> <@columns> <@formGroup labelKey='#i18n{forms.create_form.labelCountResponses}' helpKey='#i18n{forms.create_form.labelCountResponses.help}' hideLabel=['all'] rows=2> <@checkBox orientation='switch' labelFor='countResponses' labelKey='#i18n{forms.create_form.labelCountResponses}' name='countResponses' value='1' checked=(form?has_content && form.countResponses) /> <@columns md=6 xl=4 > <@card> <@fieldSet legend='#i18n{forms.create_form.labelDates}'> <@row> <@columns> <@formGroup labelKey='#i18n{forms.modify_form.labelStartDate}' rows=2> <@inputGroup> <#assign availabilityStartDatestr = ""><#if form.availabilityStartDate?? ><#assign availabilityStartDatestr = form.availabilityStartDate?iso_local_nz> <@input type='datetime' language=locale name='availabilityStartDate' id='availabilityStartDate' value='${availabilityStartDatestr}' /> <@inputGroupItem type='text'> <@icon style='calendar' /> <@row> <@columns> <@formGroup labelKey='#i18n{forms.modify_form.labelEndDate}' rows=2> <@inputGroup> <#assign availabilityEndDatestr = ""><#if form.availabilityEndDate?? ><#assign availabilityEndDatestr = form.availabilityEndDate?iso_local_nz> <@input type='datetime' language=locale name='availabilityEndDate' id='availabilityEndDate' value='${availabilityEndDatestr}' /> <@inputGroupItem type='text'> <@icon style='calendar' /> <@row> <@columns> <@formGroup labelKey='#i18n{forms.modify_form.labelUnavailableMessage}' helpKey='#i18n{forms.modify_form.labelUnavailableMessage.help}' rows=2> <@input type='textarea' name='unavailableMessage' richtext=true>${form.unavailableMessage!} <@card> <@fieldSet legend='#i18n{forms.create_form.display.labelRestrictions}'> <@row> <@columns lg=12 xl=6> <@formGroup labelFor='max_number_response' labelKey='#i18n{forms.create_form.labelMaxNumberResponse}' helpKey='#i18n{forms.create_form.labelMaxNumberResponseComment.help}' rows=2> <@input name='maxNumberResponse' id='maxNumberResponse' type='number' value=form.maxNumberResponse?string!'0' /> <@formGroup labelKey='#i18n{forms.create_form.labelAuthentificationNeeded}' helpKey='#i18n{forms.create_form.labelAuthentificationNeeded.help}' hideLabel=['all'] rows=2> <@checkBox orientation='switch' labelFor='authentificationNeeded' labelKey='#i18n{forms.create_form.labelAuthentificationNeeded}' name='authentificationNeeded' id='authentificationNeeded' value='1' checked=(form?has_content && form.authentificationNeeded) /> <@formGroup labelKey='#i18n{forms.create_form.labelAccessToResponsesByRole}' helpKey='#i18n{forms.create_form.labelAccessToResponsesByRole.help}' hideLabel=['all'] rows=2> <@checkBox orientation='switch' labelFor='accessToResponsesByRole' labelKey='#i18n{forms.create_form.labelAccessToResponsesByRole}' name='accessToResponsesByRole' id='accessToResponsesByRole' value='1' checked=(form?has_content && form.accessToResponsesByRole) /> <@columns lg=12 xl=6> <@formGroup labelKey='#i18n{forms.create_form.labelLimitNumberResponse}' helpKey='#i18n{forms.create_form.labelLimitNumberResponse.help}' hideLabel=['all'] rows=2> <@checkBox orientation='switch' labelFor='oneResponseByUser' labelKey='#i18n{forms.create_form.labelLimitNumberResponse}' name='oneResponseByUser' id='oneResponseByUser' value='1' checked=(form?has_content && form.oneResponseByUser) /> <@formGroup labelKey='#i18n{forms.create_form.labelBackupEnabled}' helpKey='#i18n{forms.create_form.labelBackupEnabled.help}' hideLabel=['all'] rows=2> <@checkBox orientation='switch' labelFor='backupEnabled' labelKey='#i18n{forms.create_form.labelBackupEnabled}' name='backupEnabled' id='backupEnabled' value='1' checked=(form?has_content && form.backupEnabled) /> <@row> <@columns lg=12 xl=6> <@formGroup id='backupStoragePeriodGroup' labelFor='backupStoragePeriod' labelKey='#i18n{forms.create_form.labelBackupStoragePeriod}' helpKey='#i18n{forms.create_form.labelBackupStoragePeriod.help}' rows=2> <@input type='number' min=-1 name='backupStoragePeriod' id='backupStoragePeriod' value=form.backupStoragePeriod?string!'-1' /> <@columns md=6 xl=4> <@card> <@fieldSet legend='#i18n{forms.create_form.labelDisplaySummary}'> <@formGroup labelKey='#i18n{forms.create_form.labelReturnUrl}' helpKey='#i18n{forms.create_form.labelReturnUrl.help}' rows=2> <@input type='text' name='returnUrl' value='${form.returnUrl!}' /> <@formGroup labelKey='#i18n{forms.create_form.labelLabelFinalButton}' rows=2> <@input type='text' name='labelFinalButton' value='${form.labelFinalButton!}' /> <@formGroup labelKey='#i18n{forms.create_form.labelDisplaySummary}' hideLabel=['all'] helpKey='#i18n{forms.create_form.labelDisplaySummary.help}' rows=2> <#if type='create'><#local isSummary=true ><#else><#local isSummary=(form?has_content && form.displaySummary)> <@checkBox orientation='switch' labelKey='#i18n{forms.create_form.labelDisplaySummary}' labelFor='displaySummary' name='displaySummary' id='displaySummary' value='1' checked=isSummary /> <@formGroup labelKey='#i18n{forms.create_form.labelEndMessageDisplay}' hideLabel=['all'] id='labelEndMessage' helpKey='#i18n{forms.create_form.labelEndMessageDisplay.help}' rows=2> <@checkBox orientation='switch' labelKey='#i18n{forms.create_form.labelEndMessageDisplay}' labelFor='endMessageDisplay' name='endMessageDisplay' id='endMessageDisplay' value='1' checked=(formMessage?has_content && formMessage.endMessageDisplay) /> <@formGroup labelKey='#i18n{forms.create_form.labelEndMessage}' id='endMessage' helpKey='#i18n{forms.create_form.labelEndMessage.help}' rows=2> <@input type='textarea' name='endMessage' richtext=true>${formMessage.endMessage!} <@formGroup labelKey='#i18n{forms.create_form.labelLabelEndMessageButton}' id='labelEndMessageButton' rows=2> <@input type='text' name='labelEndMessageButton' value='${formMessage.labelEndMessageButton!}' /> <@fieldSet legend='#i18n{forms.modify_form.workgroup.label}'> <@formGroup labelKey='#i18n{forms.modify_form.workgroup.label}' rows=2> <@select name='workgroup' items=workgroup_list default_value='${form.workgroup!workgroup_key_default_value}' /> <#if workflow_list?has_content && workflow_list?size gt 1> <@fieldSet legend='#i18n{forms.modify_form.workflow.label}'> <@formGroup labelKey='#i18n{forms.modify_form.workflow.label}' rows=2> <@select name='idWorkflow' items=workflow_list default_value='${form.idWorkflow!}' /> <#if accesscontrol_list?has_content && accesscontrol_list?size gt 1> <@fieldSet legend='#i18n{forms.modify_form.accesscontrol.label}'> <@formGroup labelKey='#i18n{forms.modify_form.accesscontrol.label}' rows=2> <@select name='id_accesscontrol' items=accesscontrol_list default_value='${accesscontrol_id!}' /> <#if is_active_captcha> <@fieldSet legend='#i18n{forms.modify_form.captcha.label}'> <@formGroup labelKey='#i18n{forms.modify_form.labelCaptchaStepInitial}' hideLabel=['all'] id='labelCaptchaStepInitial' helpKey='#i18n{forms.modify_form.labelCaptchaStepInitial.help}' rows=2> <@checkBox orientation='switch' labelKey='#i18n{forms.modify_form.labelCaptchaStepInitial}' labelFor='captchaStepInitial' name='captchaStepInitial' value='1' checked=(form?has_content && form.captchaStepInitial) /> <@formGroup labelKey='#i18n{forms.modify_form.labelCaptchaStepFinal}' hideLabel=['all'] id='labelCaptchaStepFinal' helpKey='#i18n{forms.modify_form.labelCaptchaStepFinal.help}' rows=2> <@checkBox orientation='switch' labelKey='#i18n{forms.modify_form.labelCaptchaStepFinal}' labelFor='captchaStepFinal' name='captchaStepFinal' value='1' checked=(form?has_content && form.captchaStepFinal) /> <@formGroup labelKey='#i18n{forms.modify_form.labelCaptchaRecap}' hideLabel=['all'] id='labelCaptchaRecap' helpKey='#i18n{forms.modify_form.labelCaptchaRecap.help}' rows=2> <@checkBox orientation='switch' labelKey='#i18n{forms.modify_form.labelCaptchaRecap}' labelFor='captchaRecap' name='captchaRecap' value='1' checked=(form?has_content && form.captchaRecap) /> <#macro dateFilterJs> <#macro headerSort field title jsp_url attribute id='' hide=[]> <#-- Element visibility --> <#local displayTitleClass = displaySettings(hide,'table-cell') /> <#if jsp_url?contains("?")><#assign sort_url = jsp_url + "&sorted_attribute_name=" + attribute + "&asc_sort=" /><#else><#assign sort_url = jsp_url + "?sorted_attribute_name=" + attribute + "&asc_sort=" /> <@th class='multiview-th bg-light ${displayTitleClass!}' id='sort${id!}_${attribute!}' params='data-field="${field}"' > <@div class='d-flex'> <@span class='text-truncate' params='data-bs-toggle="tooltip" title="${title}"'>${title} <@btnGroup params='aria-label="#i18n{portal.util.sort.label}"'> <@aButton hideTitle=['all'] color='' style='' class='btn-sort asc' href='${sort_url}true#sort${id!}_${attribute!}" title="#i18n{portal.util.sort.asc}' > <@icon style='arrow-up' /> <@aButton hideTitle=['all'] color='' style='' class='btn-sort desc' href='${sort_url}false#sort${id!}_${attribute!}" title="#i18n{portal.util.sort.desc}' > <@icon style='arrow-down' /> <#macro jsHeaderSort> <#macro comboOrders name default_value max > <@select name=name> <#list 1..max as i> <#if "${default_value}" == "${i}"> <#else>