From 40f5b15e8ca02bda91c3109f4e07414bd5aa3108 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 13 Nov 2012 15:41:12 +0530 Subject: [PATCH 1/2] doctype field validation commonified and added to customize form view and custom fields and property setter save --- home/page/latest_updates/latest_updates.js | 4 +++- setup/doctype/email_digest/email_digest.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index ac08c5e2d2..a2d41a5cad 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,6 +1,8 @@ erpnext.updates = [ ["13th November 2012", [ - "Trial Balance (new): Feature to export Ledgers or Groups selectively. Indent Groups with spaces", + "Customize Form View: Validate correct 'Options' for Link and Table fields.", + "Report Builder (new): Added formatters for Date, Currency, Links etc.", + "Trial Balance (new): Feature to export Ledgers or Groups selectively. Indent Groups with spaces.", "General Ledger (new): Will show entries with 'Is Opening' as Opening.", "General Ledger (new): Show against account entries if filtered by account.", ]], diff --git a/setup/doctype/email_digest/email_digest.txt b/setup/doctype/email_digest/email_digest.txt index 7d3e157521..c39e8eef89 100644 --- a/setup/doctype/email_digest/email_digest.txt +++ b/setup/doctype/email_digest/email_digest.txt @@ -5,7 +5,7 @@ { u'creation': '2012-09-18 10:50:53', u'docstatus': 0, - u'modified': '2012-11-12 16:13:36', + u'modified': '2012-11-13 15:10:35', u'modified_by': u'Administrator', u'owner': u'Administrator' }, From 3684155f28e6aa985e6a50bd6a1519b56705f35e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 13 Nov 2012 16:44:27 +0530 Subject: [PATCH 2/2] deprecated breadcrumbs, titles are now selectable --- accounts/doctype/cost_center/cost_center.js | 8 -------- accounts/page/accounts_browser/accounts_browser.js | 6 ++---- public/js/modules.js | 10 +++++++++- selling/page/sales_browser/sales_browser.js | 8 +++----- setup/doctype/customer_group/customer_group.js | 8 -------- setup/doctype/item_group/item_group.js | 7 ------- setup/doctype/sales_person/sales_person.js | 7 ------- setup/doctype/territory/territory.js | 8 -------- utilities/page/question_view/question_view.js | 3 ++- 9 files changed, 16 insertions(+), 49 deletions(-) diff --git a/accounts/doctype/cost_center/cost_center.js b/accounts/doctype/cost_center/cost_center.js index 058ebfb631..08253837e7 100644 --- a/accounts/doctype/cost_center/cost_center.js +++ b/accounts/doctype/cost_center/cost_center.js @@ -14,14 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . - -cur_frm.cscript.set_breadcrumbs = function(barea) { - cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname); - cur_frm.frm_head.appframe.add_breadcrumb(' in \ - Chart of Cost Centers'); - cur_frm.frm_head.appframe.add_breadcrumb(' in Accounts'); -} - cur_frm.cscript.refresh = function(doc, cdt, cdn) { var intro_txt = ''; cur_frm.toggle_display('cost_center_name', doc.__islocal); diff --git a/accounts/page/accounts_browser/accounts_browser.js b/accounts/page/accounts_browser/accounts_browser.js index fb011ca624..e1b8048ff1 100644 --- a/accounts/page/accounts_browser/accounts_browser.js +++ b/accounts/page/accounts_browser/accounts_browser.js @@ -22,6 +22,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){ wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area')); + wrapper.appframe.add_module_tab("Accounts"); if (wn.boot.profile.can_create.indexOf("Company") !== -1) { wrapper.appframe.add_button('New Company', function() { newdoc('Company'); }, @@ -57,10 +58,7 @@ pscript['onshow_Accounts Browser'] = function(wrapper){ // set route var ctype = wn.get_route()[1] || 'Account'; - wrapper.appframe.clear_breadcrumbs(); - wrapper.appframe.add_breadcrumb('Chart of '+ctype+'s'); - document.title = 'Chart of '+ctype+'s'; - wrapper.appframe.add_breadcrumb(' in Accounts'); + wrapper.appframe.set_title('Chart of '+ctype+'s'); if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) { wrapper.$company_select.change(); diff --git a/public/js/modules.js b/public/js/modules.js index c668e1466c..9f0152eabb 100644 --- a/public/js/modules.js +++ b/public/js/modules.js @@ -32,7 +32,6 @@ erpnext.modules = { 'Knowledge Base': 'questions', } -// wn.modules is used in breadcrumbs for getting module home page wn.provide('wn.modules'); $.extend(wn.modules, erpnext.modules); wn.modules['Core'] = 'Setup'; @@ -75,6 +74,15 @@ wn.module_css_map = { 'Knowledge Base': 'ultra-dark-green' } +wn.get_module_color = function(module) { + try { + var color = wn.module_css_classes[wn.module_css_map[module]].middle; + } catch(e) { + var color = "#000"; + } + return color; +} + wn.provide('erpnext.module_page'); diff --git a/selling/page/sales_browser/sales_browser.js b/selling/page/sales_browser/sales_browser.js index 8dde63d003..df8149fcf3 100644 --- a/selling/page/sales_browser/sales_browser.js +++ b/selling/page/sales_browser/sales_browser.js @@ -16,6 +16,8 @@ pscript['onload_Sales Browser'] = function(wrapper){ wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area')); + wrapper.appframe.add_module_tab("Selling"); + wrapper.appframe.add_button('Refresh', function() { wrapper.make_tree(); }, 'icon-refresh'); @@ -32,11 +34,7 @@ pscript['onshow_Sales Browser'] = function(wrapper){ // set route var ctype = wn.get_route()[1] || 'Territory'; - wrapper.appframe.clear_breadcrumbs(); - wrapper.appframe.add_breadcrumb(ctype+' Tree') - document.title = ctype+' Tree'; - - wrapper.appframe.add_breadcrumb(' in Selling'); + wrapper.appframe.set_title(ctype+' Tree') if(erpnext.sales_chart && erpnext.sales_chart.ctype != ctype) { wrapper.make_tree(); diff --git a/setup/doctype/customer_group/customer_group.js b/setup/doctype/customer_group/customer_group.js index 531ff962f8..2b24c11efe 100644 --- a/setup/doctype/customer_group/customer_group.js +++ b/setup/doctype/customer_group/customer_group.js @@ -13,14 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . - -cur_frm.cscript.set_breadcrumbs = function(barea) { - cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname); - cur_frm.frm_head.appframe.add_breadcrumb(' in \ - Customer Group Tree'); - cur_frm.frm_head.appframe.add_breadcrumb(' in Selling'); -} - cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.set_root_readonly(doc); diff --git a/setup/doctype/item_group/item_group.js b/setup/doctype/item_group/item_group.js index e5e108a3dd..3869eec00b 100644 --- a/setup/doctype/item_group/item_group.js +++ b/setup/doctype/item_group/item_group.js @@ -14,13 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -cur_frm.cscript.set_breadcrumbs = function(barea) { - cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname); - cur_frm.frm_head.appframe.add_breadcrumb(' in \ - Item Group Tree'); - cur_frm.frm_head.appframe.add_breadcrumb(' in Selling'); -} - //get query select item group cur_frm.fields_dict['parent_item_group'].get_query = function(doc,cdt,cdn) { return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.`is_group` = "Yes" AND `tabItem Group`.`docstatus`!= 2 AND `tabItem Group`.`name` !="'+doc.item_group_name+'" AND `tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` ASC LIMIT 50'; diff --git a/setup/doctype/sales_person/sales_person.js b/setup/doctype/sales_person/sales_person.js index 1c7b13f500..008d30d00c 100644 --- a/setup/doctype/sales_person/sales_person.js +++ b/setup/doctype/sales_person/sales_person.js @@ -14,13 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -cur_frm.cscript.set_breadcrumbs = function(barea) { - cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname); - cur_frm.frm_head.appframe.add_breadcrumb(' in \ - Sales Person Tree'); - cur_frm.frm_head.appframe.add_breadcrumb(' in Selling'); -} - cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.set_root_readonly(doc); } diff --git a/setup/doctype/territory/territory.js b/setup/doctype/territory/territory.js index a52bb67f0e..a04bea384f 100644 --- a/setup/doctype/territory/territory.js +++ b/setup/doctype/territory/territory.js @@ -14,14 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . - -cur_frm.cscript.set_breadcrumbs = function(barea) { - cur_frm.frm_head.appframe.add_breadcrumb(cur_frm.docname); - cur_frm.frm_head.appframe.add_breadcrumb(' in \ - Territory Tree'); - cur_frm.frm_head.appframe.add_breadcrumb(' in Selling'); -} - cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.set_root_readonly(doc); } diff --git a/utilities/page/question_view/question_view.js b/utilities/page/question_view/question_view.js index 43710828d9..87a4422a18 100644 --- a/utilities/page/question_view/question_view.js +++ b/utilities/page/question_view/question_view.js @@ -16,7 +16,8 @@ pscript['onload_question-view'] = function(wrapper) { wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe')); - wrapper.appframe.title('Knowledge Base'); + wrapper.appframe.title('Question'); + wrapper.appframe.add_module_tab('Knowledge Base'); wrapper.add_answer_area = $('.add-answer-area').get(0); }