<#-- -- 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 > <#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" /> <#macro toastr infos warnings errors msg='' msgType='info'> <#macro formBreadCrumb > <#macro formModal id='pubModal' title=''> <#macro headerButton name='view_manageForm' label='portal.admin.message.buttonCancel' validate=true > <#macro formsButton okAction='' viewAction='' >
<#nested> <#if viewAction !=''>
<#macro formModel > <@row> <@columns xs=12 sm=7>
#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!}
#i18n{forms.create_form.labelDates} <@row> <@columns xs=12 sm=6> <@formGroup labelKey='#i18n{forms.modify_form.labelStartDate}' rows=2> <@inputGroup> <@input type='text' name='availabilityStartDate' id='availabilityStartDate' value='${form.availabilityStartDate!}' /> <@inputGroupItem type='addon'> <@icon style='calendar' /> <@columns xs=12 sm=6> <@formGroup labelKey='#i18n{forms.modify_form.labelEndDate}' rows=2> <@inputGroup> <@input type='text' name='availabilityEndDate' id='availabilityEndDate' value='${form.availabilityEndDate!}' /> <@inputGroupItem type='addon'> <@icon style='calendar' />
#i18n{forms.create_form.display.labelRestrictions} <@row> <@columns xs=12 sm=4> <@formGroup labelFor='max_number_response' labelKey='#i18n{forms.createForm.labelMaxNumberResponse}' helpKey='#i18n{forms.create_form.labelMaxNumberResponseComment.help}' rows=2> <@input name='maxNumberResponse' id='maxNumberResponse' type='number' value=form.maxNumberResponse?string!'0' /> <@columns xs=12 sm=3> <@formGroup labelKey='#i18n{forms.create_form.labelAuthentificationNeeded}' helpKey='#i18n{forms.create_form.labelAuthentificationNeeded.help}' showLabel=false rows=2> <@checkBox labelKey='#i18n{forms.create_form.labelAuthentificationNeeded}' labelFor='authentificationNeeded' name='authentificationNeeded' id='authentificationNeeded' value='1' checked=(form?has_content && form.authentificationNeeded) /> <@columns xs=12 sm=4> <@formGroup labelKey='#i18n{forms.create_form.labelLimitNumberResponse}' helpKey='#i18n{forms.create_form.labelLimitNumberResponse.help}' showLabel=false rows=2> <@checkBox labelKey='#i18n{forms.create_form.labelLimitNumberResponse}' name='oneResponseByUser' id='oneResponseByUser' value='1' checked=(form?has_content && form.oneResponseByUser) labelFor='oneResponseByUser' />
#i18n{forms.create_form.display.label} <@columns xs=12 sm=6> <@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!}' />
<@columns xs=12 sm=5>
#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.labelDisplaySummary}' helpKey='#i18n{forms.create_form.labelDisplaySummary.help}' showLabel=false rows=2> <@checkBox labelKey='#i18n{forms.create_form.labelDisplaySummary}' labelFor='displaySummary' name='displaySummary' id='displaySummary' value='1' checked=(form?has_content && form.displaySummary) /> <@formGroup labelKey='#i18n{forms.create_form.labelEndMessageDisplay}' id='labelEndMessage' helpKey='#i18n{forms.create_form.labelEndMessageDisplay.help}' showLabel=false rows=2> <@checkBox 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!}
<#if workflow_list?has_content && workflow_list?size gt 1>
#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!}' />
<#macro formVisualize> <#macro dateFilterJs> <#macro scrollTopBtn> <#macro headerSort field title jsp_url attribute id='' > <#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=" /> ${title}
<#-- INPUT TEXT/TEXTAREA/SEARCH/PASSWORD/EMAIL/FILE --> <#-- type : text/textarea/password/email/file/number. Default is text --> <#-- size: input-xs/input-sm/input-lg --> <#-- incoming Bootstrap 4 size: form-control-sm/form-control-lg or empty for the normal size --> <#-- pattern: [A-F][0-9]{5} --> <#macro input name type='text' value='' class='' size='' inputSize=0 maxlength=0 placeHolder='' rows=4 cols=40 richtext=false tabIndex='' id='' mandatory=mandatory disabled=false readonly=false pattern='' params='' title='' min=0 max=0> <#if type='textarea'> <#elseif type='text' || type='search' || type='password' || type='email' || type='file' || type='number'> tabindex="${tabIndex}"<#if placeHolder!=''> placeholder="${placeHolder}"<#if title!=''> title="${title}"<#if maxlength > 0> maxlength="${maxlength}"<#if inputSize!=0> size="${inputSize}"<#if disabled> disabled<#if readonly> readonly<#if id!=''> id="${id}"<#if params!=''> ${params}<#if pattern!=''>pattern=${pattern}<#if min!=0> min="${min}"<#if max!=0> max="${max}"<#if mandatory> required<#if labelFor!='' && helpKey!=''> aria-describedby="${labelFor}_help" /> <#else><@icon style='warning' />Type not supported <#macro jsHeaderSort>