Anand Doshi | 885e074 | 2015-03-03 14:55:30 +0530 | [diff] [blame] | 1 | // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
Rushabh Mehta | e67d1fb | 2013-08-05 14:59:54 +0530 | [diff] [blame] | 2 | // License: GNU General Public License v3. See license.txt |
| 3 | |
Rushabh Mehta | 793ba6b | 2014-02-14 15:47:51 +0530 | [diff] [blame] | 4 | frappe.provide('erpnext'); |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 5 | |
Rushabh Mehta | a920943 | 2012-05-07 18:00:57 +0530 | [diff] [blame] | 6 | // add toolbar icon |
Rushabh Mehta | 8c309be | 2012-01-20 13:47:16 +0530 | [diff] [blame] | 7 | $(document).bind('toolbar_setup', function() { |
Rushabh Mehta | 793ba6b | 2014-02-14 15:47:51 +0530 | [diff] [blame] | 8 | frappe.app.name = "ERPNext"; |
Rushabh Mehta | 8a40c13 | 2014-04-15 16:30:55 +0530 | [diff] [blame] | 9 | |
Anand Doshi | 5e849ae | 2015-07-13 16:56:37 +0530 | [diff] [blame] | 10 | frappe.help_feedback_link = '<p><a class="text-muted" \ |
| 11 | href="https://discuss.erpnext.com">Feedback</a></p>' |
| 12 | |
| 13 | |
scmmishra | f2d0be7 | 2019-01-21 19:35:46 +0530 | [diff] [blame] | 14 | $('[data-link="docs"]').attr("href", "https://erpnext.com/docs") |
Neil Trini Lasrado | 728d019 | 2016-05-02 18:37:47 +0530 | [diff] [blame] | 15 | $('[data-link="issues"]').attr("href", "https://github.com/frappe/erpnext/issues") |
Rushabh Mehta | 3d93ddc | 2016-08-22 18:47:35 +0530 | [diff] [blame] | 16 | |
| 17 | |
| 18 | // default documentation goes to erpnext |
Rushabh Mehta | 547dff5 | 2016-08-24 12:44:32 +0530 | [diff] [blame] | 19 | // $('[data-link-type="documentation"]').attr('data-path', '/erpnext/manual/index'); |
Rushabh Mehta | 3d93ddc | 2016-08-22 18:47:35 +0530 | [diff] [blame] | 20 | |
| 21 | // additional help links for erpnext |
| 22 | var $help_menu = $('.dropdown-help ul .documentation-links'); |
scmmishra | 3f9b231 | 2019-01-25 12:56:27 +0530 | [diff] [blame] | 23 | $('<li><a data-link-type="forum" href="https://erpnext.com/docs/user/manual" \ |
scmmishra | f2d0be7 | 2019-01-21 19:35:46 +0530 | [diff] [blame] | 24 | target="_blank">'+__('Documentation')+'</a></li>').insertBefore($help_menu); |
Rushabh Mehta | 3d93ddc | 2016-08-22 18:47:35 +0530 | [diff] [blame] | 25 | $('<li><a data-link-type="forum" href="https://discuss.erpnext.com" \ |
| 26 | target="_blank">'+__('User Forum')+'</a></li>').insertBefore($help_menu); |
Rushabh Mehta | 3d93ddc | 2016-08-22 18:47:35 +0530 | [diff] [blame] | 27 | $('<li><a href="https://github.com/frappe/erpnext/issues" \ |
| 28 | target="_blank">'+__('Report an Issue')+'</a></li>').insertBefore($help_menu); |
| 29 | |
Anand Doshi | 859cb72 | 2012-04-10 11:35:19 +0530 | [diff] [blame] | 30 | }); |
Rushabh Mehta | 4c36d73 | 2015-01-01 15:59:34 +0530 | [diff] [blame] | 31 | |
Rushabh Mehta | 3d93ddc | 2016-08-22 18:47:35 +0530 | [diff] [blame] | 32 | |
| 33 | |
Rushabh Mehta | 4c36d73 | 2015-01-01 15:59:34 +0530 | [diff] [blame] | 34 | // doctypes created via tree |
Rushabh Mehta | f5f0d5a | 2015-03-09 15:47:15 +0530 | [diff] [blame] | 35 | $.extend(frappe.create_routes, { |
Saurabh | 1702273 | 2016-06-21 13:19:17 +0530 | [diff] [blame] | 36 | "Customer Group": "Tree/Customer Group", |
| 37 | "Territory": "Tree/Territory", |
| 38 | "Item Group": "Tree/Item Group", |
| 39 | "Sales Person": "Tree/Sales Person", |
| 40 | "Account": "Tree/Account", |
Mangesh-Khairnar | 3b60fac | 2019-06-27 11:41:17 +0530 | [diff] [blame] | 41 | "Cost Center": "Tree/Cost Center", |
| 42 | "Department": "Tree/Department", |
Rushabh Mehta | f5f0d5a | 2015-03-09 15:47:15 +0530 | [diff] [blame] | 43 | }); |
| 44 | |
| 45 | // preferred modules for breadcrumbs |
| 46 | $.extend(frappe.breadcrumbs.preferred, { |
| 47 | "Item Group": "Stock", |
| 48 | "Customer Group": "Selling", |
Zlash65 | 2e08098 | 2018-04-19 18:37:53 +0530 | [diff] [blame] | 49 | "Supplier Group": "Buying", |
Rushabh Mehta | f5f0d5a | 2015-03-09 15:47:15 +0530 | [diff] [blame] | 50 | "Territory": "Selling", |
| 51 | "Sales Person": "Selling", |
| 52 | "Sales Partner": "Selling", |
| 53 | "Brand": "Selling" |
| 54 | }); |
Faris Ansari | ab46f0f | 2019-07-10 18:49:41 +0530 | [diff] [blame] | 55 | |
| 56 | $.extend(frappe.breadcrumbs.module_map, { |
| 57 | 'ERPNext Integrations': 'Integrations', |
| 58 | 'Geo': 'Settings', |
| 59 | 'Accounts': 'Accounting', |
| 60 | 'Portal': 'Website', |
Faris Ansari | a7a6987 | 2019-07-10 19:22:16 +0530 | [diff] [blame] | 61 | 'Utilities': 'Settings', |
| 62 | 'Shopping Cart': 'Website', |
| 63 | 'Contacts': 'CRM' |
Suraj Shetty | 7837fbe | 2019-07-10 19:39:40 +0530 | [diff] [blame] | 64 | }); |