<input type="hidden" name="querybuilder" value="[{$querybuilder}]" id="querybuilder">
<input type="hidden" name="report_mode" value="" id="report_mode">
<div id="report-list" class="h100">
[{include file="content/bottom/content/object_table_list.tpl"}]
</div>
<script type="text/javascript">
    if ($('navbar_item_export')) {
        $('navbar_item_export').on('click', () => {
            const selectedReports = $('report-list').select('.mainTableHover input:checked');

            if (selectedReports.length) {
                document.location.href = '?' + Object.toQueryString({
                    '[{$smarty.const.C__GET__MODULE_ID}]': '[{$smarty.const.C__MODULE__REPORT}]',
                    'exportReportConfig': 1,
                    'reportIds': Object.toJSON(selectedReports.invoke('getValue'))
                });
            } else {
                idoit.Notify.error('[{isys type="lang" ident="LC__REPORT__POPUP__REPORT_DUPLICATE__NO_REPORT_SELECTED"}]', { life: 10 });
            }
        });
    }
</script>
