From d6f021ded4e5087bb6065b85bd98c01857ba92a3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Sat, 1 Dec 2012 18:18:06 +0530 Subject: [PATCH] removed old communication listing in a form --- core/doctype/communication/communication.js | 91 --------------------- 1 file changed, 91 deletions(-) diff --git a/core/doctype/communication/communication.js b/core/doctype/communication/communication.js index 04e6c804de..deb22ab3f6 100644 --- a/core/doctype/communication/communication.js +++ b/core/doctype/communication/communication.js @@ -32,92 +32,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } } - -cur_frm.cscript.make_communication_body = function() { - var communication_wrapper = cur_frm.fields_dict.communication_html.wrapper; - communication_wrapper.innerHTML = ''; - cur_frm.communication_html = $a(communication_wrapper, 'div'); - $(cur_frm.communication_html).css({ - 'min-height': '275px', - }); -} - -cur_frm.cscript.render_communication_list = function(doc, dt, dn) { - var ListView = wn.views.ListView.extend({ - init: function(doclistview) { - this._super(doclistview); - this.fields = this.fields.concat([ - "`tabCommunication`.communication_date", - "`tabCommunication`.category", - "`tabCommunication`.subject", - "`tabCommunication`.content" - ]); - this.order_by = "`tabCommunication`.communication_date desc"; - }, - - prepare_data: function(data) { - this._super(data); - this.prepare_when(data, data.creation); - - // escape double quote - data.content = cstr(data.subject).replace(/"/gi, '\"') - + " | " + cstr(data.content).replace(/"/gi, '\"'); - - if(data.content && data.content.length > 50) { - data.content = '' + - data.content.substr(0,50) + '...'; - } - - }, - - columns: [ - {width: '3%', content: 'docstatus'}, - {width: '15%', content: 'name'}, - {width: '15%', content: 'category'}, - {width: '55%', content: 'content'}, - {width: '12%', content:'when', - css: {'text-align': 'right', 'color':'#777'}} - ], - - }); - - cur_frm.cscript.render_list(doc, 'Communication', cur_frm.communication_html, - ListView, function(doctype) { - var new_doc = LocalDB.create(doctype); - new_doc = locals[doctype][new_doc]; - new_doc[doc.doctype.toLowerCase().replace(" ", "_")] = doc.name; - loaddoc(new_doc.doctype, new_doc.name); - }); -} - - -// Render List -cur_frm.cscript.render_list = function(doc, doctype, wrapper, ListView, make_new_doc) { - wn.model.with_doctype(doctype, function(r) { - if((r && r['403']) || wn.boot.profile.all_read.indexOf(doctype)===-1) { - return; - } - var RecordListView = wn.views.RecordListView.extend({ - default_docstatus: ['0', '1', '2'], - default_filters: [ - [doctype, doc.doctype.toLowerCase().replace(" ", "_"), '=', doc.name], - ], - }); - - if (make_new_doc) { - RecordListView = RecordListView.extend({ - make_new_doc: make_new_doc, - }); - } - - var record_list_view = new RecordListView(doctype, wrapper, ListView); - if (!cur_frm[doctype.toLowerCase().replace(" ", "_") + "_list"]) { - cur_frm[doctype.toLowerCase().replace(" ", "_") + "_list"] = record_list_view; - } - }); -} - - cur_frm.cscript.contact = function(doc, dt, dn) { if (doc.contact) { wn.call({ @@ -134,9 +48,4 @@ cur_frm.cscript.contact = function(doc, dt, dn) { }, }); } -} - -cur_frm.cscript.hide_dialog = function() { - if(cur_frm.communication_list) - cur_frm.communication_list.run(); } \ No newline at end of file