diff --git a/frappe/core/doctype/communication/communication.json b/frappe/core/doctype/communication/communication.json index 6888affa23..f706f1ea77 100644 --- a/frappe/core/doctype/communication/communication.json +++ b/frappe/core/doctype/communication/communication.json @@ -1411,7 +1411,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-03-28 16:05:32.976002", + "modified": "2017-03-29 23:06:16.469149", "modified_by": "Administrator", "module": "Core", "name": "Communication", @@ -1462,7 +1462,7 @@ "apply_user_permissions": 1, "cancel": 0, "create": 0, - "delete": 0, + "delete": 1, "email": 1, "export": 0, "if_owner": 1, diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index a883f9fb36..19426ee173 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -56,7 +56,7 @@ frappe.views.ListSidebar = Class.extend({ if(this.current_view === 'Kanban') { this.kanban_board = route[3]; } else if (this.current_view === 'Inbox') { - this.email_account = route[3] || frappe.boot.all_accounts; + this.email_account = route[3]; } } @@ -279,7 +279,8 @@ frappe.views.ListSidebar = Class.extend({ accounts = frappe.boot.email_accounts; accounts.forEach(function(account) { - var route = ["List", "Communication", "Inbox", account.email_account].join('/'); + email_account = (account.email_id == "All Accounts")? "All Accounts": account.email_account; + var route = ["List", "Communication", "Inbox", email_account].join('/'); if(!divider) { $('').appendTo($dropdown); divider = true; diff --git a/frappe/public/js/frappe/views/inbox/inbox_no_result.html b/frappe/public/js/frappe/views/inbox/inbox_no_result.html index af6566c379..0251d68365 100644 --- a/frappe/public/js/frappe/views/inbox/inbox_no_result.html +++ b/frappe/public/js/frappe/views/inbox/inbox_no_result.html @@ -1,14 +1,12 @@ -
-
- {% if(!frappe.model.can_create(doctype) && doctype == "Email Account") { %} -

{{ __("No Email Accounts Assigned") }}

- {% } else { %} -

{{ msg }}

-

- -

- {% } %} -
+
+ {% if(!frappe.model.can_create(doctype) && doctype == "Email Account") { %} +

{{ __("No Email Accounts Assigned") }}

+ {% } else { %} +

{{ msg }}

+

+ +

+ {% } %}
\ No newline at end of file diff --git a/frappe/public/js/frappe/views/inbox/inbox_view.js b/frappe/public/js/frappe/views/inbox/inbox_view.js index 38938eb439..15a8af013f 100644 --- a/frappe/public/js/frappe/views/inbox/inbox_view.js +++ b/frappe/public/js/frappe/views/inbox/inbox_view.js @@ -47,7 +47,6 @@ frappe.views.InboxView = frappe.views.ListRenderer.extend({ init_settings: function() { this._super(); - // this.show_no_result = false; this.filters = this.get_inbox_filters(); }, should_refresh: function() { @@ -86,9 +85,15 @@ frappe.views.InboxView = frappe.views.ListRenderer.extend({ ]) } else { + var op = "=" + if (email_account == "All Accounts") { + op = "in"; + email_account = frappe.boot.all_accounts + } + filters = default_filters.concat([ ["Communication", "sent_or_received", "=", "Received", true], - ["Communication", "email_account", "=", email_account, true], + ["Communication", "email_account", op, email_account, true], ["Communication", "email_status", "not in", "Spam,Trash", true], ]) } @@ -110,8 +115,14 @@ frappe.views.InboxView = frappe.views.ListRenderer.extend({ get_current_email_account: function() { var route = frappe.get_route(); if(!route[3] && frappe.boot.email_accounts.length) { - frappe.set_route("List", "Communication", "Inbox", frappe.boot.email_accounts[0].email_account); - } else if(route[3] && !frappe.boot.email_accounts.find(b => b.email_account === route[3])) { + if(frappe.boot.email_accounts[0].email_id == "All Accounts") { + email_account = "All Accounts" + } else { + email_account = frappe.boot.email_accounts[0].email_account + } + frappe.set_route("List", "Communication", "Inbox", email_account); + } else if(route[3] && route[3] != "All Accounts" && + !frappe.boot.email_accounts.find(b => b.email_account === route[3])) { // frappe.throw(__(`Email Account ${route[3] || ''} not found`)); return '' }