// Copyright (c) 2019, JINGROW
// For license information, please see license.txt

jingrow.ui.form.on("Access Log", {
	show_document: function (frm) {
		jingrow.set_route("Form", frm.pg.export_from, frm.pg.reference_document);
	},

	show_report: function (frm) {
		if (frm.pg.report_name.includes("/")) {
			jingrow.set_route(frm.pg.report_name);
		} else {
			let filters = frm.pg.filters ? JSON.parse(frm.pg.filters) : {};
			jingrow.set_route("query-report", frm.pg.report_name, filters);
		}
	},
});
