zenario__user_forms:
    panels:
        form_fields_gui:
            title: Form fields
            panel_type: form_builder
            priv: _PRIV_MANAGE_FORMS
            
            form_page_details:
                tabs:
                    details:
                        label: Details
                        fields:
                            name:
                                hidden: true
                            visibility: &visibility
                                label: 'Visibility:'
                                type: select
                                value: visible
                                values:
                                    visible:
                                        label: Visible
                                    hidden:
                                        label: Hidden
                                    visible_on_condition:
                                        label: Visible on condition...
                                format_onchange: true
                            visible_condition_field_id: &visible_condition_field_id
                                indent: 1
                                visible_if: |
                                    item.visibility == 'visible_on_condition'
                                label: 'Visible on condition field:'
                                type: select
                                empty_value: -- Select --
                                values: conditional_fields
                                format_onchange: true
                            visible_condition_field_type: &visible_condition_field_type
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.visible_condition_field_id
                                type: select
                                values:
                                    visible_if:
                                        label: Visible if...
                                    visible_if_not:
                                        label: Visible if not...
                                format_onchange: true
                            visible_condition_field_value: &visible_condition_field_value
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.visible_condition_field_id
                                type: select
                                empty_value: -- Select --
                                values:
                                    checked:
                                        label: Checked
                                    unchecked:
                                        label: Unchecked
                            visible_condition_checkboxes_operator: &visible_condition_checkboxes_operator
                                indent: 2
                                hidden: true
                                type: select
                                values:
                                    AND:
                                        label: All options below are checked
                                    OR:
                                        label: Any option below is checked
                            visible_condition_checkboxes_field_value: &visible_condition_checkboxes_field_value
                                indent: 2
                                hidden: true
                                type: checkboxes
                                values: field_lov
                            
                            next_button_text:
                                label: '"Next" button text:'
                                type: text
                                value: Next
                                maxlength: 250
                            previous_button_text:
                                label: '"Back" button text:'
                                type: text
                                value: Previous
                                maxlength: 250
                            hide_in_page_switcher:
                                label: Hide in step switcher
                                type: checkbox
                            show_in_summary: &show_in_summary
                                label: Show in summary
                                type: checkbox
                                note_below: Show this step in the form summary step, and when viewing form responses.
            
            form_field_details:
                tabs:
                    details:
                        label: Details
                        fields:
                            field_is_used_as_email_destination_in_form_setting: &field_is_used_as_email_destination_in_form_setting
                                pre_field_html: <div class="form_warning">
                                snippet:
                                    html: |
                                        <p>The destination email address(es) of the form depend upon this select list. It may not be edited. If you need to make changes, first deselect it in the form settings.</p>
                                post_field_html: </div>
                                visible_if: item.field_is_used_as_email_destination_in_form_setting
                            name:
                                hidden: true
                            label:
                                visible_if: |
                                    item.type != 'section_spacer'
                                label: 'Label:'
                                type: text
                                maxlength: 250
                                is_phrase: true
                            subheading_tag:
                                visible_if: |
                                    item.type == 'section_description'
                                label: 'Subheading tag:'
                                type: select
                                values:
                                    h1:
                                        label: <h1>
                                    h2:
                                        label: <h2>
                                    h3:
                                        label: <h3>
                                    h4:
                                        label: <h4>
                                    h5:
                                        label: <h5>
                                    h6:
                                        label: <h6>
                                    p:
                                        label: <p>
                                value: p
                            text_above_left_group:
                                visible_if: |
                                    item.type == 'sortable_selection'
                                label: 'Text above left group:'
                                type: text
                                maxlength: 250
                                note_below: Text above the left group as seen by the user/visitor.
                                is_phrase: true
                            text_above_right_group:
                                visible_if: |
                                    item.type == 'sortable_selection'
                                label: 'Text above right group:'
                                type: text
                                maxlength: 250
                                note_below: Text above the right group as seen by the user/visitor.
                                is_phrase: true
                            description:
                                visible_if: |
                                    item.type == 'section_description'
                                label: 'Further information (HTML):'
                                type: textarea
                                is_phrase: true
                            values_source:
                                visible_if: |
                                    item.type == 'centralised_radios' || item.type == 'centralised_select'
                                label: 'Source:'
                                type: select
                                empty_value: -- Select --
                                values: centralised_lists
                                readonly: true
                            values_source_filter:
                                indent: 1
                                hide_with_previous_field: true
                                visible_if: |
                                    item.values_source
                                label: ''
                                type: text
                                maxlength: 250
                                note_below: Set a filter for the source.
                            
                            filter_on_field:
                                visible_if: |
                                    item.type == 'centralised_radios' || item.type == 'centralised_select'
                                label: 'Filter on field (advanced):'
                                type: select
                                empty_value: -- Select --
                                values: centralised_list_filter_fields
                                note_below: Filter the possible choices based on the value of another field. (See field source module code for details.)
                            
                            visibility: *visibility
                            visible_condition_field_id: *visible_condition_field_id
                            #Possible error messages
                            visible_condition_field_is_not_in_the_same_repeating_section:
                                indent: 2
                                hidden: true
                                pre_field_html: <div class="form_warning">
                                snippet:
                                    html: |
                                        <p>Visibility should only be conditional on another field in this repeating section.</p>
                                post_field_html: </div>
                            visible_condition_field_is_at_a_different_step:
                                indent: 2
                                hidden: true
                                pre_field_html: <div class="form_warning">
                                snippet:
                                    html: |
                                        <p>Visibility should only be conditional on another field on this step.</p>
                                post_field_html: </div>
                            visible_condition_field_is_after_the_current_field:
                                indent: 2
                                hidden: true
                                pre_field_html: <div class="form_warning">
                                snippet:
                                    html: |
                                        <p>Visibility should only be conditional on a previous field.</p>
                                post_field_html: </div>
                            visible_condition_field_type: *visible_condition_field_type
                            visible_condition_field_value: *visible_condition_field_value
                            visible_condition_checkboxes_operator: *visible_condition_checkboxes_operator
                            visible_condition_checkboxes_field_value: *visible_condition_checkboxes_field_value
                            
                            min_rows:
                                visible_if: |
                                    item.type == 'repeat_start'
                                label: 'Minimum rows:'
                                type: text
                                value: 1
                                maxlength: 250
                                note_below: The number of rows that are always shown and cannot be deleted.
                            max_rows:
                                hide_with_previous_field: true
                                label: 'Maximum rows:'
                                type: text
                                value: 5
                                maxlength: 250
                                note_below: The maximum number of rows that can be added.
                            add_row_label:
                                hide_with_previous_field: true
                                label: 'Add row label:'
                                type: text
                                value: Add +
                                maxlength: 250
                            
                            readonly_or_mandatory:
                                visible_if: |
                                    ['section_description', 'section_spacer', 'repeat_start', 'restatement', 'calculated'].indexOf(item.type) == -1
                                label: 'Mandatory / Read-only:'
                                type: select
                                values:
                                    none:
                                        label: None
                                    mandatory:
                                        label: Mandatory
                                    #mandatory_all_values_required:
#                                        label: Mandatory (select all values)
                                    readonly:
                                        label: Read-only
                                    conditional_mandatory:
                                        label: Mandatory on condition...
                                    mandatory_if_visible:
                                        label: Mandatory if visible
                                format_onchange: true
                                note_below: Whether the field is mandatory or read-only.
                            mandatory_condition_field_id:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                   item.readonly_or_mandatory == 'conditional_mandatory'
                                label: 'Mandatory on condition field:'
                                type: select
                                empty_value: -- Select --
                                values: conditional_fields
                                format_onchange: true
                                note_below: |
                                    Select a field that this field will depend on (field types supported: checkbox, checkboxes, radios, select, centralised radios, centralised select)
                            mandatory_condition_field_type:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.mandatory_condition_field_id
                                type: select
                                values:
                                    mandatory_if:
                                        label: Mandatory if...
                                    mandatory_if_not:
                                        label: Mandatory if not...
                                format_onchange: true
                            mandatory_condition_field_value:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.mandatory_condition_field_id
                                type: select
                                empty_value: -- Select --
                                values:
                                    checked:
                                        label: Checked
                                    unchecked:
                                        label: Unchecked
                            mandatory_condition_checkboxes_operator:
                                indent: 2
                                hidden: true
                                type: select
                                values:
                                    AND:
                                        label: ALL options are checked...
                                    OR:
                                        label: ANY options are checked...
                            mandatory_condition_checkboxes_field_value:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.mandatory_condition_field_id
                                type: checkboxes
                                values: field_lov
                            required_error_message:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    ['mandatory', 'conditional_mandatory', 'mandatory_if_visible'].indexOf(item.readonly_or_mandatory) != -1
                                label: 'Error message if not completed:'
                                type: text
                                maxlength: 250
                                value: This field is required.
                                note_below: Error message when the mandatory field is not completed.
                                is_phrase: true
                                
                            field_validation:
                                visible_if: |
                                    item.type == 'text' || item.type == 'url'
                                label: 'Validation:'
                                type: select
                                format_onchange: true
                                values:
                                    none:
                                        label: None
                                    name:
                                        label: Name
                                        visible_if: |
                                            item.type == 'text' 
                                    email: 
                                        label: Email
                                        visible_if: |
                                            item.type == 'text' 
                                    URL:
                                        label: URL
                                    number:
                                        label: Number
                                        visible_if: |
                                            item.type == 'text' 
                                    phone_number:
                                        label: Phone number
                                        visible_if: |
                                            item.type == 'text' 
                                    integer:
                                        label: Integer
                                        visible_if: |
                                            item.type == 'text' 
                                    floating_point:
                                        label: Floating point
                                        visible_if: |
                                            item.type == 'text' 
                                value: none
                            field_validation_error_message:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.field_validation && item.field_validation != 'none'
                                label: 'Validation error message:'
                                type: text
                                maxlength: 250
                                is_phrase: true
                                db_column: validation_error_message
                            show_field_twice_for_confirmation:
                                hide_with_previous_outdented_field: true
                                format_onchange: true
                                label: 'Show field twice for confirmation'
                                indent: 1
                                type: checkbox
                                visible_if: |
                                    item.field_validation && item.field_validation == 'email'
                            confirmation_field_label:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.field_validation && item.field_validation == 'email' && item.show_field_twice_for_confirmation
                                label: 'Confirmation field label:'
                                type: text
                                maxlength: 250
                                is_phrase: true
                                db_column: confirmation_field_label
                            confirmation_field_error_message:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.field_validation && item.field_validation == 'email' && item.show_field_twice_for_confirmation
                                label: 'Error message when contents do not match:'
                                type: text
                                maxlength: 250
                                is_phrase: true
                                db_column: confirmation_field_error_message
                            placeholder:
                                visible_if: |
                                    item.type == 'text' || item.type == 'textarea'
                                label: 'Placeholder:'
                                type: text
                                maxlength: 250
                                note_below: Value to be shown in the field initially.
                                is_phrase: true
                            show_month_year_selectors:
                                visible_if: |
                                    item.type == 'date'
                                label: Show month and year selectors
                                type: checkbox
                            no_past_dates:
                                hide_with_previous_field: true
                                label: No past dates
                                type: checkbox
                            no_future_dates:
                                hide_with_previous_field: true
                                label: No future dates
                                type: checkbox
                            disable_manual_input:
                                hide_with_previous_field: true
                                label: Disable manual input
                                type: checkbox
                            
                            combined_filename:
                                visible_if: |
                                    item.type == 'document_upload'
                                label: 'Default combined filename:'
                                type: text
                                maxlength: 250
                                note_below: A filename for the combined file.
                            stop_user_editing_filename:
                                hide_with_previous_field: true
                                label: 'Stop user editing filename'
                                type: checkbox
                            
                            show_in_summary: *show_in_summary
                                visible_if: |
                                    item.type == 'section_description' || item.type == 'section_spacer'
                                
                            calculation_code:
                                type: calculation_code
                                format_onchange: true
                                label: 'Calculation:'
                                visible_if: |
                                    item.type == 'calculated'
                            value_prefix:
                                hide_with_previous_field: true
                                label: 'Prefix before value:'
                                type: text
                                maxlength: 250
                            value_postfix:
                                hide_with_previous_field: true
                                label: 'Suffix after value:'
                                type: text
                                maxlength: 250
                            
                            restatement_field:
                                visible_if: |
                                    item.type == 'restatement'
                                label: 'Field to mirror:'
                                type: select
                                empty_value: -- Select --
                                values: mirror_fields
                                note_below: You can mirror text, calculated, select lists and centralised select lists.
                            
                            note_to_user:
                                visible_if: |
                                    ['section_description', 'section_spacer', 'repeat_start'].indexOf(item.type) == -1
                                label: 'Note below field (HTML):'
                                type: textarea
                                maxlength: 250
                                note_below: Note to be shown below the field.
                                is_phrase: true
                    
                    values:
                        label: Values
                        visible_if: |
                            ['select', 'radios', 'checkboxes', 'sortable_selection', 'text'].indexOf(item.type) != -1 && ['first_name', 'last_name', 'email'].indexOf(item.db_column) == -1
                        fields:
                            field_is_used_as_email_destination_in_form_setting: *field_is_used_as_email_destination_in_form_setting
                            enable_suggested_values:
                                visible_if: |
                                    item.type == 'text'
                                label: Enable suggested values
                                type: checkbox
                                format_onchange: true
                            
                            force_suggested_values:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.enable_suggested_values
                                label: 'Force suggested values'
                                type: checkbox
                                note_below: The user must enter one of the values in the suggested list.
                            
                            suggested_values:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.enable_suggested_values
                                type: radios
                                values:
                                    custom:
                                        label: Custom
                                    pre_defined:
                                        label: Pre-defined list
                                value: custom
                                format_onchange: true
                            
                            suggested_values_source:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.suggested_values == 'pre_defined'
                                label: 'Source:'
                                type: select
                                empty_value: -- Select --
                                values: centralised_lists
                                format_onchange: true
                            suggested_values_filter_on_field:
                                indent: 2
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.suggested_values == 'pre_defined'
                                label: 'Filter on field:'
                                type: select
                                empty_value: -- Select --
                                values: centralised_list_filter_fields
                                format_onchange: true
                                note_below: Filter an autocomplete list based on the value of another field.
                            filter_placeholder:
                                indent: 3
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.suggested_values_filter_on_field
                                label: 'No filter placeholder:'
                                type: text
                                maxlength: 250
                                note_below: Show a placeholder message if there are no values in the list after being filtered.
                             
                            values:
                                type: values_list
                                visible_if: |
                                    item.type != "text" || item.enable_suggested_values && item.suggested_values == 'custom'
                    advanced:
                        label: Advanced
                        fields:
                            field_is_used_as_email_destination_in_form_setting: *field_is_used_as_email_destination_in_form_setting
                            merge_name:
                                visible_if: |
                                    item.type != 'section_description' && item.type != 'section_spacer' && item.type != 'restatement' && item.type != 'repeat_start'
                                snippet:
                                    html: ''
                            custom_code_name:
                                visible_if: |
                                    item.type != 'section_description' && item.type != 'section_spacer'
                                label: 'Custom field code name:'
                                type: text
                                maxlength: 250
                                note_below: This is used so a developer can reference the field in a module without having to know the ID. It may also be used in email templates. Unique per form.
                            preload_dataset_field_user_data:
                                visible_if: |
                                    item.dataset_field_id
                                label: Pre-populate with logged-in user's data
                                type: checkbox
                            split_first_name_last_name:
                                label: Contains first and last name
                                note_below: Text entered here will be split on the first space, and inserted into first name and last name fields respectively.
                                type: checkbox
                                visible_if: |
                                    item.db_column == 'first_name' || item.db_column == 'last_name'
                            invert_dataset_result:
                                visible_if: |
                                    item.dataset_field_id && (item.type == 'checkbox' || item.type == 'group')
                                label: Invert value when updating the user's data
                                type: checkbox
                            default_value_options:
                                visible_if: |
                                    !item.dataset_field_id && (['checkboxes', 'section_description', 'section_spacer', 'repeat_start', 'attachment', 'restatement', 'document_upload', 'calculated'].indexOf(item.type) == -1)
                                label: 'Pre-populate field:'
                                type: radios
                                format_onchange: true
                                value: none
                                values:
                                    none:
                                        label: Don't pre-populate
                                    value:
                                        label: Pre-populate with value
                                    method:
                                        label: Call a module's static method to get the value
                            default_value_lov:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.default_value_options == 'value' && (['radios', 'centralised_radios', 'select', 'centralised_select', 'checkbox', 'group'].indexOf(item.type) != -1)
                                label: 'Default value:'
                                type: select
                                values:
                                    checked:
                                        label: Checked
                                    unchecked:
                                        label: Unchecked
                                note_below: Select a value to pre-populate the field.
                            default_value_text:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                    item.default_value_options == 'value' && (['radios', 'centralised_radios', 'select', 'centralised_select', 'checkbox', 'group'].indexOf(item.type) == -1)
                                label: 'Default value:'
                                type: text
                                maxlength: 250
                                note_below: Value that should pre-populate the field.
                                
                            default_value_class_name:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                     item.default_value_options == 'method'
                                label: 'Module class name:'
                                type: text
                                maxlength: 250
                            default_value_method_name:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                     item.default_value_options == 'method'
                                label: 'Static method name:'
                                type: text
                                maxlength: 250
                            default_value_param_1:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                     item.default_value_options == 'method'
                                label: 'Parameter 1:'
                                type: text
                                maxlength: 250
                            default_value_param_2:
                                indent: 1
                                hide_with_previous_outdented_field: true
                                visible_if: |
                                     item.default_value_options == 'method'
                                label: 'Parameter 2:'
                                type: text
                                maxlength: 250
                            value_field_columns:
                                visible_if: |
                                    item.type == 'checkboxes' || item.type == 'radios'
                                label: 'Space values into equal columns:'
                                type: select
                                values:
                                    1:
                                        label: single column
                                    2:
                                        label: 2 columns
                                    3:
                                        label: 3 columns
                                    4:
                                        label: 4 columns
                                    5:
                                        label: 5 columns
                                    6:
                                        label: 6 columns
                            word_count_min:
                                visible_if: |
                                    item.type == 'textarea'
                                label: 'Word count (min):'
                                type: text
                            word_count_max:
                                hide_with_previous_field: true
                                label: 'Word count (max):'
                                type: text
                            rows:
                                visible_if: |
                                    item.type == 'textarea'
                                label: 'Rows:'
                                type: text
                                value: 4
                            css_classes:
                                label: 'CSS classes:'
                                type: text
                                maxlength: 250
                                note_below: CSS classes to apply to the field, separated by spaces.
                            div_wrap_class:
                                label: 'Wrapper div CSS class:'
                                type: text
                                maxlength: 250
                                note_below: CSS class for a wrapper div around the field. Fields above/below this one with the same wrapper div class will be put within the same div.
                                                                
                            invalid_responses:
                                visible_if: |
                                    (['checkboxes', 'select', 'radios'].indexOf(item.type) != -1) && !item.dataset_field_id
                                label: 'Invalid responses:'
                                type: checkboxes
                                values: field_lov
                                format_onchange: true
                                note_below: If you want the form to offer possible responses in the list, but want some of them to generate an error if chosen, select those responses above.
                            invalid_field_value_error_message:
                                indent: 1
                                hide_with_previous_field: true
                                visible_if: |
                                    item.invalid_responses && item.invalid_responses.length && !item.dataset_field_id
                                label: 'Invalid response error message:'
                                type: text
                                maxlength: 250
                            
                    translations:
                        label: Translations
                        visible_if: |
                            zenarioO.pi.tuix.show_translation_tab
                        fields:
                            field_is_used_as_email_destination_in_form_setting: *field_is_used_as_email_destination_in_form_setting
                            translations:
                                type: translations
                                
                    crm:
                        label: CRM
                        visible_if: |
                            zenarioO.pi.tuix.crm_enabled && (['section_description', 'repeat_start', 'attachment', 'file_picker', 'document_upload', 'restatement'].indexOf(item.type) == -1)
                        fields:
                            field_is_used_as_email_destination_in_form_setting: *field_is_used_as_email_destination_in_form_setting
                            send_to_crm:
                                label: Send to CRM
                                type: checkbox
                                format_onchange: true
                            crm_send_condition:
                                type: radios
                                indent: 1
                                values:
                                    always_send:
                                        ord: 1
                                        label: 'Always send'
                                    send_only_if_visible:
                                        ord: 2
                                        label: 'Send only if visible'
                                value: always_send
                                visible_if: |
                                    item.send_to_crm
                            crm_validate_test:
                                visible_if: |
                                    item.send_to_crm
                                type: button
                                value: Validate against Salesforce
                            field_crm_name:
                                visible_if: |
                                    item.send_to_crm
                                label: 'CRM field name:'
                                type: text
                                maxlength: 250
                                note_below: This is used to identify the field in the CRM
                            centralised_crm_buttons:
                                visible_if: |
                                    item.send_to_crm && (['centralised_select', 'centralised_radios'].indexOf(item.type) != -1)
                                type: centralised_crm_buttons
                            crm_values:
                                visible_if: |
                                    item.send_to_crm && (['select', 'radios', 'checkboxes', 'centralised_select', 'centralised_radios', 'checkbox', 'group'].indexOf(item.type) != -1)
                                type: crm_values