# You must use a tab-size of 4 spaces to edit this file.
---
zenario_job:
    priv: _PRIV_VIEW_SCHEDULED_TASK
    key:
        id: ""
        manager_class_name: ""
    identifier:
        css_class: zenario_scheduled_task_manager__task
        label: Scheduled Task ID
    tabs:
        time_and_day:
            ord: 20
            edit_mode:
                enabled: true
                priv: _PRIV_MANAGE_SCHEDULED_TASK
            label: Time and Days
            fields:
                desc:
                    full_width: true
                    snippet:
                        html: |
                            Use this tab to determine when the task will run.
                
                old_format_warning:
                    pre_field_html: <div class="zenario_fbWarning">
                    snippet:
                        html: |
                            The settings saved for frequency and time appear to be in an old format and may not be properly represented in the options below. Before saving, please make sure
                            the settings are correct for this task.
                    post_field_html: </div>
                    hidden: true
                frequency:
                    label: 'Run once every:'
                    type: select
                start_at_hours:
                    label: 'At (time):'
                    type: select
                    post_field_html: ':'
                start_at_minutes:
                    type: select
                    same_row: true
                
                days_desc:
                    full_width: true
                    snippet:
                        html: '<b>On (days):</b>'
                mon:
                    label: 'Monday'
                    type: checkbox
                tue:
                    label: 'Tuesday'
                    type: checkbox
                wed:
                    label: 'Wednesday'
                    type: checkbox
                thr:
                    label: 'Thursday'
                    type: checkbox
                fri:
                    label: 'Friday'
                    type: checkbox
                sat:
                    label: 'Saturday'
                    type: checkbox
                sun:
                    label: 'Sunday'
                    type: checkbox
            show_errors_after_field: desc
        month:
            ord: 30
            edit_mode:
                enabled: true
                priv: _PRIV_MANAGE_SCHEDULED_TASK
            label: Months
            fields:
                desc:
                    full_width: true
                    snippet:
                        html: |
                            Use this tab to set on which months of the year, and on which days of those months, this task will run. The task will run.
                jan:
                    label: 'January'
                    type: checkbox
                feb:
                    label: 'Feburary'
                    type: checkbox
                mar:
                    label: 'March'
                    type: checkbox
                apr:
                    label: 'April'
                    type: checkbox
                may:
                    label: 'May'
                    type: checkbox
                jun:
                    label: 'June'
                    type: checkbox
                jul:
                    label: 'July'
                    type: checkbox
                aug:
                    label: 'August'
                    type: checkbox
                sep:
                    label: 'September'
                    type: checkbox
                oct:
                    label: 'October'
                    type: checkbox
                nov:
                    label: 'November'
                    type: checkbox
                dec:
                    label: 'December'
                    type: checkbox
                first_n_days_of_month:
                    label: 'Days of the month:'
                    type: select
                    note_below: |
                        Combine this with time and days on the previous tab; for example you can run a task on the first Monday of every month.
            show_errors_after_field: desc
        reporting:
            ord: 10
            edit_mode:
                enabled: true
                priv: _PRIV_MANAGE_SCHEDULED_TASK
            label: Reporting
            fields:
                desc:
                    full_width: true
                    snippet:
                        html: |
                            When the scheduled task runs, it may: run successfully and perform some action; fail with an error; or run but find nothing to do.
                log_on_action:
                    label: 'On successful run with action, write log entry'
                    type: checkbox
                email_on_action:
                    label: 'On successful run with action, send email'
                    type: checkbox
                    redraw_onchange: true
                log_on_no_action:
                    label: 'On successful run with no action, write log entry'
                    type: checkbox
                email_address_on_action:
                    indent: 1
                    hide_if_previous_outdented_value_isnt: 1
                    label: 'Email address:'
                    type: text
                    maxlength: "200"
                log_on_error:
                    label: 'If task fails with an error, write log entry'
                    type: checkbox
                    readonly: true
                    value: "1"
                email_on_error:
                    label: 'If task fails with an error, send email'
                    type: checkbox
                    readonly: true
                    value: "1"
                email_address_on_error:
                    indent: 1
                    label: 'Additional email address:'
                    type: text
                    maxlength: "200"
                    note_below: |
                        Error notifications will always be sent to the support email address ([[email]], as specified in your zenario_siteconfig.php file). Enter an email address above if additional people should be informed.
            show_errors_after_field: desc
        last_run:
            ord: 40
            edit_mode:
                enabled: true
                priv: _PRIV_MANAGE_SCHEDULED_TASK
            label: Last run
            fields:
                last_run_started:
                    label: |
                        Last run started:
                    type: datetime
                    readonly: true
                last_run_finished:
                    label: |
                        Last run finished:
                    type: datetime
                    readonly: true
                last_successful_run:
                    label: |
                        Last run without an error:
                    type: datetime
                    readonly: true
                last_action: 
                    label: |
                        Last run with an action:
                    type: datetime
                    readonly: true
