// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt // for license information please see license.txt wn.provide("wn.ui.form") wn.ui.form.LinkedWith = Class.extend({ init: function(opts) { var me = this; $.extend(this, opts); }, show: function() { if(!this.dialog) this.make_dialog(); this.dialog.show(); }, make_dialog: function() { var me = this; this.linked_with = this.frm.meta.__linked_with; var links = []; $.each(this.linked_with, function(doctype, tmp) { if(wn.model.can_get_report(doctype)) { links.push({label: wn._(doctype), value: doctype}); } }); links = wn.utils.sort(links, "label"); this.dialog = new wn.ui.Dialog({ width: 700, hide_on_page_refresh: true, title: wn._("Linked With"), fields: [ { fieldtype: "HTML", label: "list" } ] }); if(!links) { this.dialog.fields_dict.list.$wrapper.html("