[email] remove communicationlist #561

This commit is contained in:
Rushabh Mehta 2014-09-12 13:09:41 +05:30
parent ce00772ac0
commit e10cf021d9
12 changed files with 482 additions and 549 deletions

View File

@ -10,6 +10,8 @@ frappe.provide("erpnext.buying");
frappe.require("assets/erpnext/js/transaction.js"); frappe.require("assets/erpnext/js/transaction.js");
{% include "public/js/controllers/accounts.js" %} {% include "public/js/controllers/accounts.js" %}
cur_frm.email_field = "contact_email";
erpnext.buying.BuyingController = erpnext.TransactionController.extend({ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
onload: function() { onload: function() {
this.setup_queries(); this.setup_queries();

View File

@ -20,12 +20,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
// make lists // make lists
cur_frm.cscript.make_address(doc,dt,dn); cur_frm.cscript.make_address(doc,dt,dn);
cur_frm.cscript.make_contact(doc,dt,dn); cur_frm.cscript.make_contact(doc,dt,dn);
cur_frm.communication_view = new frappe.views.CommunicationList({
list: frappe.get_list("Communication", {"supplier": doc.name}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc
})
} }
} }

View File

@ -83,22 +83,6 @@
"permlevel": 0, "permlevel": 0,
"read_only": 1 "read_only": 1
}, },
{
"depends_on": "eval:!doc.__islocal",
"fieldname": "communication_history",
"fieldtype": "Section Break",
"label": "Communication History",
"options": "icon-comments",
"permlevel": 0,
"print_hide": 1
},
{
"fieldname": "communication_html",
"fieldtype": "HTML",
"label": "Communication HTML",
"permlevel": 0,
"print_hide": 1
},
{ {
"fieldname": "more_info", "fieldname": "more_info",
"fieldtype": "Section Break", "fieldtype": "Section Break",
@ -186,7 +170,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-09-10 17:53:09.286715", "modified": "2014-09-12 12:26:37.606976",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier", "name": "Supplier",

View File

@ -3,16 +3,9 @@
// For license information, please see license.txt // For license information, please see license.txt
// for communication
cur_frm.email_field = "email_id";
cur_frm.cscript = { cur_frm.cscript = {
refresh: function(doc) { refresh: function(doc) {
cur_frm.cscript.make_listing(doc);
},
make_listing: function(doc) {
cur_frm.communication_view = new frappe.views.CommunicationList({
list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Job Applicant"}),
parent: cur_frm.fields_dict['thread_html'].wrapper,
doc: doc,
recipients: doc.email_id
})
}, },
} }

View File

@ -34,11 +34,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
// make lists // make lists
cur_frm.cscript.make_address(doc, dt, dn); cur_frm.cscript.make_address(doc, dt, dn);
cur_frm.cscript.make_contact(doc, dt, dn); cur_frm.cscript.make_contact(doc, dt, dn);
cur_frm.communication_view = new frappe.views.CommunicationList({
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
});
} }
} }

View File

@ -129,22 +129,6 @@
"permlevel": 0, "permlevel": 0,
"read_only": 1 "read_only": 1
}, },
{
"depends_on": "eval:!doc.__islocal",
"fieldname": "communication_history",
"fieldtype": "Section Break",
"label": "Communication History",
"options": "icon-comments",
"permlevel": 0,
"print_hide": 1
},
{
"fieldname": "communication_html",
"fieldtype": "HTML",
"label": "Communication HTML",
"permlevel": 0,
"print_hide": 1
},
{ {
"fieldname": "more_info", "fieldname": "more_info",
"fieldtype": "Section Break", "fieldtype": "Section Break",
@ -282,7 +266,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2014-09-10 16:41:07.553182", "modified": "2014-09-12 12:26:47.480965",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Customer", "name": "Customer",

View File

@ -4,6 +4,8 @@
{% include 'setup/doctype/contact_control/contact_control.js' %}; {% include 'setup/doctype/contact_control/contact_control.js' %};
frappe.provide("erpnext"); frappe.provide("erpnext");
cur_frm.email_field = "email_id";
erpnext.LeadController = frappe.ui.form.Controller.extend({ erpnext.LeadController = frappe.ui.form.Controller.extend({
setup: function() { setup: function() {
this.frm.fields_dict.customer.get_query = function(doc, cdt, cdn) { this.frm.fields_dict.customer.get_query = function(doc, cdt, cdn) {

View File

@ -8,6 +8,8 @@ frappe.ui.form.on_change("Opportunity", "contact_person", erpnext.utils.get_cont
frappe.provide("erpnext.selling"); frappe.provide("erpnext.selling");
cur_frm.email_field = "contact_email";
// TODO commonify this code // TODO commonify this code
erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
onload: function() { onload: function() {
@ -26,15 +28,6 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
set_multiple(cdt, cdn, { fiscal_year:sys_defaults.fiscal_year }); set_multiple(cdt, cdn, { fiscal_year:sys_defaults.fiscal_year });
if(!this.frm.doc.__islocal) {
cur_frm.communication_view = new frappe.views.CommunicationList({
list: frappe.get_list("Communication", {"parent": this.frm.doc.name, "parenttype": "Opportunity"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: this.frm.doc,
recipients: this.frm.doc.contact_email
});
}
if(this.frm.doc.customer && !this.frm.doc.customer_name) cur_frm.cscript.customer(this.frm.doc); if(this.frm.doc.customer && !this.frm.doc.customer_name) cur_frm.cscript.customer(this.frm.doc);
this.setup_queries(); this.setup_queries();

View File

@ -53,15 +53,6 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
}, "icon-download", "btn-default"); }, "icon-download", "btn-default");
} }
if (!doc.__islocal) {
cur_frm.communication_view = new frappe.views.CommunicationList({
list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Quotation"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
recipients: doc.contact_email
});
}
this.toggle_reqd_lead_customer(); this.toggle_reqd_lead_customer();
}, },

View File

@ -13,6 +13,8 @@ frappe.require("assets/erpnext/js/transaction.js");
{% include "public/js/controllers/accounts.js" %} {% include "public/js/controllers/accounts.js" %}
cur_frm.email_field = "contact_email";
erpnext.selling.SellingController = erpnext.TransactionController.extend({ erpnext.selling.SellingController = erpnext.TransactionController.extend({
onload: function() { onload: function() {
this._super(); this._super();

View File

@ -7,6 +7,7 @@ cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
frappe.provide("erpnext.support"); frappe.provide("erpnext.support");
cur_frm.add_fetch("customer", "customer_name", "customer_name") cur_frm.add_fetch("customer", "customer_name", "customer_name")
cur_frm.email_field = "raised_by";
$.extend(cur_frm.cscript, { $.extend(cur_frm.cscript, {
refresh: function(doc) { refresh: function(doc) {

View File

@ -3,15 +3,7 @@
{% include 'controllers/js/contact_address_common.js' %}; {% include 'controllers/js/contact_address_common.js' %};
cur_frm.cscript.refresh = function(doc) { cur_frm.email_field = "email_id";
cur_frm.communication_view = new frappe.views.CommunicationList({
list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Contact"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
recipients: doc.email_id
});
}
cur_frm.cscript.hide_dialog = function() { cur_frm.cscript.hide_dialog = function() {
if(cur_frm.contact_list) if(cur_frm.contact_list)
cur_frm.contact_list.run(); cur_frm.contact_list.run();