From 44c1447b602267ce29e0ba8aab60ad241cbc6696 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 9 Jul 2013 10:42:10 +0530 Subject: [PATCH] [setup] added icons, links, fixed single --- .../doctype/email_settings/email_settings.txt | 11 ++---- setup/page/setup/setup.js | 34 +++++++++++++------ setup/page/setup/setup.py | 5 ++- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/setup/doctype/email_settings/email_settings.txt b/setup/doctype/email_settings/email_settings.txt index b063b7eb9ea..292b853b73c 100644 --- a/setup/doctype/email_settings/email_settings.txt +++ b/setup/doctype/email_settings/email_settings.txt @@ -2,7 +2,7 @@ { "creation": "2013-03-25 17:53:21", "docstatus": 0, - "modified": "2013-07-09 10:28:29", + "modified": "2013-07-09 10:41:38", "modified_by": "Administrator", "owner": "Administrator" }, @@ -108,19 +108,12 @@ "fieldtype": "Check", "label": "Send Print in Body and Attachment" }, - { - "description": "Set the POP3 email settings to pull emails directly from a mailbox and create Support Tickets", - "doctype": "DocField", - "fieldname": "support_ticket_mail_settings", - "fieldtype": "Section Break", - "label": "Support Ticket Mail Settings" - }, { "description": "To automatically create Support Tickets from your incoming mail, set your POP3 settings here. You must ideally create a separate email id for the erp system so that all emails will be synced into the system from that mail id. If you are not sure, please contact your EMail Provider.", "doctype": "DocField", "fieldname": "section_break0", "fieldtype": "Section Break", - "label": "Incoming Mail Setting" + "label": "Incoming / Support Mail Setting" }, { "description": "Check this to pull emails from your mailbox", diff --git a/setup/page/setup/setup.js b/setup/page/setup/setup.js index 908718815cd..1f5132c2549 100644 --- a/setup/page/setup/setup.js +++ b/setup/page/setup/setup.js @@ -67,10 +67,15 @@ wn.pages['Setup'].onload = function(wrapper) { +item.title+'').appendTo(row); } else { - var col = $('
\ - '+ item.count +''+ - ' ' + (item.title || item.doctype) + '' - +'
') + var col = $(repl('
\ + %(count)s\ + \ + %(title)s\ +
', { + count: item.count, + title: wn._(item.title || item.doctype), + icon: wn.boot.doctype_icons[item.doctype] + })) .appendTo(row); col.find(".badge") @@ -91,12 +96,19 @@ wn.pages['Setup'].onload = function(wrapper) { $('
').appendTo(row); if(item.doctype) { - col.find(".badge") + var badge = col.find(".badge, .data-link") .attr("data-doctype", item.doctype) .css({"cursor": "pointer"}) - .click(function() { + + if(item.single) { + badge.click(function() { + wn.set_route("Form", $(this).attr("data-doctype")) + }) + } else { + badge.click(function() { wn.set_route(item.tree || "List", $(this).attr("data-doctype")) }) + } } // tree @@ -108,11 +120,13 @@ wn.pages['Setup'].onload = function(wrapper) { Import') .appendTo($links) - $links.find(".view-link") + var mylink = $links.find(".view-link") .attr("data-doctype", item.doctype) - .click(function() { - wn.set_route(item.tree, item.doctype); - }) + + mylink.click(function() { + wn.set_route(item.tree, item.doctype); + }) + } else if(item.single) { $(' Edit') .appendTo($links) diff --git a/setup/page/setup/setup.py b/setup/page/setup/setup.py index baee676ca6f..2ca870de030 100644 --- a/setup/page/setup/setup.py +++ b/setup/page/setup/setup.py @@ -93,6 +93,8 @@ items = [ { "doctype": "Purchase Taxes and Charges Master" }, { "doctype": "Shipping Rule" }, { "doctype": "Currency Exchange" }, + { "title": "Accounts Settings", + "route": "Form/Accounts Settings", "type": "Link", "icon": "icon-cog" }, { "type": "Section", "title": "Opening Accounts and Stock", @@ -146,7 +148,8 @@ items = [ "query": "select count(*) from tabSingles where doctype='Email Settings' and field='outgoing_mail_server'" }, { - "doctype": "Support Email Settings", + "title": "Support Email Settings", + "doctype": "Email Settings", "single": 1, "query": "select count(*) from tabSingles where doctype='Email Settings' and field='support_host'" },