// Copyright (c) 2021, SolutionERP LLC and contributors
// For license information, please see license.txt

xhiveframework.ui.form.on('Campaign', {
	refresh: function(frm) {
		xhiveerp.toggle_naming_series();

		if (frm.is_new()) {
			frm.toggle_display("naming_series", xhiveframework.boot.sysdefaults.campaign_naming_by=="Naming Series");
		} else {
			cur_frm.add_custom_button(__("View Leads"), function() {
				xhiveframework.route_options = {"source": "Campaign", "campaign_name": frm.doc.name};
				xhiveframework.set_route("List", "Lead");
			}, "fa fa-list", true);
		}
	}
});
