From 052b7e4049f91a205eed43c273d3bb63bf520fd1 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 13 Mar 2012 15:19:06 +0530 Subject: [PATCH] fixed list->new->onload hooks --- css/all-app.css | 10 +- erpnext/projects/doctype/project/help.md | 5 + .../selling/Module Def/Selling/Selling.txt | 335 --------- erpnext/setup/Module Def/Setup/Setup.txt | 652 ------------------ .../Role/System Manager/System Manager.txt | 26 - erpnext/setup/__init__.py | 3 + .../setup/page/modules_setup/modules_setup.js | 2 +- .../Module Def/Utilities/Utilities.txt | 28 - js/all-app.js | 78 +-- js/all-web.js | 14 +- version.num | 2 +- 11 files changed, 61 insertions(+), 1094 deletions(-) create mode 100644 erpnext/projects/doctype/project/help.md delete mode 100644 erpnext/selling/Module Def/Selling/Selling.txt delete mode 100644 erpnext/setup/Module Def/Setup/Setup.txt delete mode 100644 erpnext/setup/Role/System Manager/System Manager.txt delete mode 100644 erpnext/utilities/Module Def/Utilities/Utilities.txt diff --git a/css/all-app.css b/css/all-app.css index fad5701120..095b7df6df 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -302,15 +302,15 @@ div.notice { */ /* FORMS */ -div.form-section-break { +div.form-section-head { margin: 15px 0px 3px 0px; } -div.form-section-break h3 { +div.form-section-head h3 { line-height: 20px; } -div.form-section-break hr { +div.form-section-head hr { margin: 9px 0px; } @@ -462,6 +462,10 @@ div.time_field select{ color: #888; } +.help ol { + padding-left: 19px; +} + .field_description_top { margin-bottom: 3px; } diff --git a/erpnext/projects/doctype/project/help.md b/erpnext/projects/doctype/project/help.md new file mode 100644 index 0000000000..0043f04625 --- /dev/null +++ b/erpnext/projects/doctype/project/help.md @@ -0,0 +1,5 @@ +You can use projects to: + +1. Track budgets (Purchase Orders, Invoices). +2. Track material consumption. +3. Create and assign tasks (and view them on a Gantt Chart). \ No newline at end of file diff --git a/erpnext/selling/Module Def/Selling/Selling.txt b/erpnext/selling/Module Def/Selling/Selling.txt deleted file mode 100644 index 42c8449fd1..0000000000 --- a/erpnext/selling/Module Def/Selling/Selling.txt +++ /dev/null @@ -1,335 +0,0 @@ -# Module Def, Selling -[ - - # These values are common in all dictionaries - { - 'creation': '2011-07-01 17:39:08', - 'docstatus': 0, - 'modified': '2012-01-23 18:25:58', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Module Def Role - { - 'doctype': 'Module Def Role', - 'name': '__common__', - 'parent': 'Selling', - 'parentfield': 'roles', - 'parenttype': 'Module Def' - }, - - # These values are common for all Module Def Item - { - 'doctype': 'Module Def Item', - 'name': '__common__', - 'parent': 'Selling', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - - # These values are common for all Module Def - { - 'disabled': 'No', - 'doctype': u'Module Def', - 'doctype_list': 'Print Format, Sales Order\nPrint Format, Quotation Format\nPrint Format, Delivery Note Format', - 'file_list': 'crm.gif,FileData/00208', - 'is_hidden': 'No', - 'module_desc': 'Manage you sales team, with your leads, customers, quotes, orders etc.', - 'module_icon': 'Selling.gif', - 'module_label': 'Selling', - 'module_name': 'Selling', - 'module_seq': 3, - 'name': '__common__' - }, - - # Module Def, Selling - { - 'doctype': u'Module Def', - 'name': 'Selling' - }, - - # Module Def Item - { - 'description': 'Database of potential customers you need to keep in touch with', - 'display_name': 'Lead', - 'doc_name': 'Lead', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\nlead_owner\nlead_name\ncontact_no\ncontact_by\ncontact_date\nexpected_month' - }, - - # Module Def Item - { - 'description': 'Your Customer Database', - 'display_name': 'Customer', - 'doc_name': 'Customer', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'customer_group\ncountry' - }, - - # Module Def Item - { - 'description': 'Specific requirements from a Lead / Customer', - 'display_name': 'Enquiry', - 'doc_name': 'Enquiry', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\ntransaction_date\ncustomer\ncontact_person\ncost_center\ncompany' - }, - - # Module Def Item - { - 'description': 'Offers you have made to your customers', - 'display_name': 'Quotation', - 'doc_name': 'Quotation', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\ntransaction_date\ncustomer\ncontact_person\ncost_center\ngrand_total\ncompany' - }, - - # Module Def Item - { - 'description': 'Database of confirmed Sale Orders from your Customers', - 'display_name': 'Sales Order', - 'doc_name': 'Sales Order', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\ntransaction_date\ncustomer\ncost_center\ngrand_total\nper_delivered\nper_billed\ncompany' - }, - - # Module Def Item - { - 'display_name': 'Sales Dashboard', - 'doc_name': 'Sales Dashboard', - 'doc_type': 'Pages', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'doc_name': 'Reports', - 'doc_type': 'Separator', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'doc_name': 'Reports', - 'doc_type': 'Separator', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Gross Profit', - 'doc_name': 'Delivery Note Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Territory, Item Group wise GP', - 'doc_name': 'Delivery Note', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Itemwise Sales Details', - 'doc_name': 'Sales Order Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Itemwise Delivery Details', - 'doc_name': 'Delivery Note Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Sales Personwise Transaction Summary', - 'doc_name': 'Sales Person', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Total Target Variance Report', - 'doc_name': 'Target Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Sales Persons Target Variance (Item Group wise)', - 'doc_name': 'Target Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Territories Target Variance (Item Group wise)', - 'doc_name': 'Target Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Sales Order Pending Items', - 'doc_name': 'Sales Order Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Sales Orderwise Booking & Delivery Summary', - 'doc_name': 'Sales Order Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Sales Orderwise Pending Qty To Deliver', - 'doc_name': 'Sales Order Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Sales Orderwise Pending Amount To Bill', - 'doc_name': 'Sales Order Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Delivered Items to be Install', - 'doc_name': 'Delivery Note Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Itemwise Price List', - 'doc_name': 'Ref Rate Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Follow-up Report', - 'doc_name': 'Follow up', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'description': 'Ledger details of your debtors', - 'display_name': "Debtor's Ledger", - 'doc_name': 'GL Entry', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'description': 'Report displaying Customer, Primary Address Details & Primary Contact Details', - 'display_name': 'Customer Address Contact', - 'doc_name': 'Customer', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'description': 'Customer Category', - 'display_name': 'Customer Group', - 'doc_name': 'Customer Group', - 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'fields': 'id\ndescription' - }, - - # Module Def Item - { - 'description': 'Sales person details', - 'display_name': 'Sales Person', - 'doc_name': 'Sales Person', - 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'fields': 'id\nterritory\ndepartment\nmobile_no\nemail_id' - }, - - # Module Def Item - { - 'description': 'Item master', - 'display_name': 'Item', - 'doc_name': 'Item', - 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'fields': 'name\nitem_group\ndescription' - }, - - # Module Def Item - { - 'description': 'Sales partner details', - 'display_name': 'Sales Partner', - 'doc_name': 'Sales Partner', - 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'fields': 'id\npartner_type\nmobile\nemail\nterritory' - }, - - # Module Def Item - { - 'description': 'Business campaigns', - 'display_name': 'Campaign', - 'doc_name': 'Campaign', - 'doc_type': 'Setup Forms', - 'doctype': 'Module Def Item', - 'fields': 'id\ncampaign_name\ndescription' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Administrator' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Sales Manager' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Sales User' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Sales Master Manager' - } -] \ No newline at end of file diff --git a/erpnext/setup/Module Def/Setup/Setup.txt b/erpnext/setup/Module Def/Setup/Setup.txt deleted file mode 100644 index 5a0dcf724a..0000000000 --- a/erpnext/setup/Module Def/Setup/Setup.txt +++ /dev/null @@ -1,652 +0,0 @@ -[ - { - '_last_update': None, - 'creation': '2010-11-30 22:43:08', - 'disabled': 'No', - 'docstatus': 0, - 'doctype': 'Module Def', - 'doctype_list': None, - 'file_list': None, - 'idx': None, - 'is_hidden': 'No', - 'last_updated_date': '2011-03-21 12:13:39', - 'modified': '2010-09-25 00:00:00', - 'modified_by': 'Administrator', - 'module_desc': None, - 'module_icon': 'wired.png', - 'module_label': 'Setup', - 'module_name': 'Setup', - 'module_page': 'Setup', - 'module_seq': 1, - 'name': 'Setup', - 'owner': 'Administrator', - 'parent': None, - 'parentfield': None, - 'parenttype': None, - 'trash_reason': None, - 'widget_code': None - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'All important setup items in one place', - 'display_name': 'Setup Wizard', - 'doc_name': 'Setup Wizard', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'lightbulb.gif', - 'idx': 1, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00221', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Personalize settings like company banner, date format, print format header etc.', - 'display_name': 'Personalize', - 'doc_name': 'Personalize Page', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'star.gif', - 'idx': 2, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00222', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Enable / Disable users. Set user roles.', - 'display_name': 'Manage Users', - 'doc_name': 'Manage Users', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'group.gif', - 'idx': 3, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00223', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Set global default values and account settings', - 'display_name': 'Setup Defaults', - 'doc_name': 'Manage Account', - 'doc_type': 'Single DocType', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'folder.gif', - 'idx': 4, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00224', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'General Masters', - 'display_name': 'Setup Masters', - 'doc_name': 'Setup Masters', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'wrench.gif', - 'idx': 5, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00225', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': None, - 'display_name': 'Sales Browser', - 'doc_name': 'Sales Browser', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 6, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00226', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': None, - 'doc_name': None, - 'doc_type': 'Separator', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 7, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003107', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': "Import data like Customers, Items etc in 'CSV' format", - 'display_name': 'Import Data', - 'doc_name': 'Import Data', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'disk.gif', - 'idx': 8, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00228', - 'owner': 'nabin@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Set series prefix for transactions', - 'display_name': 'Setup Series', - 'doc_name': 'Naming Series', - 'doc_type': 'Single DocType', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': 'paperclip.gif', - 'idx': 9, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00229', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Set approval rights for transactions based on grand total and discount.', - 'display_name': 'Authorization Rule', - 'doc_name': 'Authorization Rule', - 'doc_type': 'Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': 'transaction\nbased_on\nmaster_name\nsystem_user\nsystem_role\napproving_role\napproving_user\nvalue', - 'hide': None, - 'icon': 'accept.gif', - 'idx': 10, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00230', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Add fields in transactions, masters...', - 'display_name': 'Custom Field', - 'doc_name': 'Custom Field', - 'doc_type': 'Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': 'dt\nlabel\nfieldtype\noptions', - 'hide': None, - 'icon': 'paperclip.gif', - 'idx': 11, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00231', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:43:08', - 'description': 'Contains records that you have trashed.', - 'display_name': 'Trash', - 'doc_name': 'Trash', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 12, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': 'MDI00232', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Price List', - 'doc_name': 'Price List', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 13, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003108', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Warehouse Type', - 'doc_name': 'Warehouse Type', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 14, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003109', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Warehouse', - 'doc_name': 'Warehouse', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 15, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003110', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'UOM', - 'doc_name': 'UOM', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 16, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003111', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Term', - 'doc_name': 'Term', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 17, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003112', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Taxes and Charges', - 'doc_name': 'Other Charges', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 18, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003113', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Business Letter Type', - 'doc_name': 'Business Letter Type', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 19, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003114', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Business Letter Template', - 'doc_name': 'Business Letter Template', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 20, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003115', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2011-03-24 15:04:47', - 'description': None, - 'display_name': 'Mode of Payment', - 'doc_name': 'Mode of Payment', - 'doc_type': 'Setup Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': 21, - 'modified': '2011-03-24 15:04:47', - 'modified_by': 'Administrator', - 'name': '000003116', - 'owner': 'harshada@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 1, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00042', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Administrator' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 2, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00043', - 'owner': 'Administrator', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'System Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 3, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00044', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Sales User' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 4, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00045', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Sales Master Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 5, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00046', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Sales Master Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 6, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00047', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Purchase User' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 7, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00048', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Purchase Master Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 8, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00049', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Purchase Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 9, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00050', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Material User' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 10, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00051', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Material Master Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 11, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00052', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Material Manager' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 12, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00053', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Accounts User' - }, - { - 'creation': '2010-11-30 22:43:08', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 13, - 'modified': '2010-11-30 22:43:08', - 'modified_by': 'Administrator', - 'name': 'MDR00054', - 'owner': 'saumil@webnotestech.com', - 'parent': 'Setup', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Accounts Manager' - } -] \ No newline at end of file diff --git a/erpnext/setup/Role/System Manager/System Manager.txt b/erpnext/setup/Role/System Manager/System Manager.txt deleted file mode 100644 index 0918bc4f8c..0000000000 --- a/erpnext/setup/Role/System Manager/System Manager.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Role, System Manager -[ - - # These values are common in all dictionaries - { - 'creation': '2010-08-08 17:08:51', - 'docstatus': 0, - 'modified': '2009-07-07 17:00:24', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Role - { - 'doctype': 'Role', - 'module': 'Setup', - 'name': '__common__', - 'role_name': 'System Manager' - }, - - # Role, System Manager - { - 'doctype': 'Role', - 'name': 'System Manager' - } -] \ No newline at end of file diff --git a/erpnext/setup/__init__.py b/erpnext/setup/__init__.py index e69de29bb2..dad187308d 100644 --- a/erpnext/setup/__init__.py +++ b/erpnext/setup/__init__.py @@ -0,0 +1,3 @@ +install_docs = [ + {'doctype':'Role', 'name': 'System Manager'} +] \ No newline at end of file diff --git a/erpnext/setup/page/modules_setup/modules_setup.js b/erpnext/setup/page/modules_setup/modules_setup.js index af7522f4ae..c7f80fcf9e 100644 --- a/erpnext/setup/page/modules_setup/modules_setup.js +++ b/erpnext/setup/page/modules_setup/modules_setup.js @@ -1,4 +1,4 @@ -wn.require('lib/js/lib/jquery-ui-sortable.min.js'); +wn.require('lib/js/lib/jquery/jquery.ui.sortable.js'); $.extend(wn.pages.modules_setup, { modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Production', 'Projects', diff --git a/erpnext/utilities/Module Def/Utilities/Utilities.txt b/erpnext/utilities/Module Def/Utilities/Utilities.txt deleted file mode 100644 index 98b4d0f526..0000000000 --- a/erpnext/utilities/Module Def/Utilities/Utilities.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Module Def, Utilities -[ - - # These values are common in all dictionaries - { - 'creation': '2011-07-01 17:46:25', - 'docstatus': 0, - 'modified': '2011-07-01 17:47:34', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Module Def - { - 'disabled': 'No', - 'doctype': 'Module Def', - 'is_hidden': 'No', - 'module_label': 'Utilities', - 'module_name': 'Utilities', - 'name': '__common__' - }, - - # Module Def, Utilities - { - 'doctype': 'Module Def', - 'name': 'Utilities' - } -] \ No newline at end of file diff --git a/js/all-app.js b/js/all-app.js index 815a3db524..2a9ee8ab1f 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -542,7 +542,7 @@ Field.prototype.set_description=function(){if(this.df.description){var p=in_list if(in_list(['Text Editor','Code'],this.df.fieldtype)) $(this.desc_area).addClass('field_description_top');}} Field.prototype.get_status=function(){if(this.in_filter)this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} -var fn=this.df.fieldname?this.df.fieldname:this.df.label;this.df=get_field(this.doctype,fn,this.docname);if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') +if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) ret='None';if(ret=='Write'&&cint(cur_frm.doc.docstatus)>0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}} if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';} @@ -884,7 +884,7 @@ Layout.prototype.setcolour=function(col){$bg(cc,col);} Layout.prototype.show=function(){$ds(this.wrapper);} Layout.prototype.hide=function(){$dh(this.wrapper);} Layout.prototype.close_borders=function(){if(this.with_border){this.myrows[this.myrows.length-1].wrapper.style.borderBottom='1px solid #000';}} -function LayoutRow(layout,parent){this.layout=layout;this.wrapper=$a(parent,'div');this.main_head=$a(this.wrapper,'div');this.main_body=$a(this.wrapper,'div');if(layout.with_border){this.wrapper.style.border='1px solid #000';this.wrapper.style.borderBottom='0px';} +function LayoutRow(layout,parent){this.layout=layout;this.wrapper=$a(parent,'div','form-layout-row');this.main_head=$a(this.wrapper,'div');this.main_body=$a(this.wrapper,'div');if(layout.with_border){this.wrapper.style.border='1px solid #000';this.wrapper.style.borderBottom='0px';} this.header=$a(this.main_body,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.body=$a(this.main_body,'div');this.table=$a(this.body,'table','',{width:'100%',borderCollapse:'collapse'});this.row=this.table.insertRow(0);this.mycells=[];} LayoutRow.prototype.hide=function(){$dh(this.wrapper);} LayoutRow.prototype.show=function(){$ds(this.wrapper);} @@ -1111,8 +1111,6 @@ if(get_local('Page',page_name)||wn.pages[page_name]) fn();else{args=get_url_dict();args.name=page_name;$c('webnotes.widgets.page.getpage',args,fn);}} pscript.update_page_history=function(page_name,no_history){var arg=null;var t=null;if(window.location.hash){var t=nav_obj.get_page(window.location.hash)}else if(get_url_arg('page')){var t=nav_obj.get_page(get_url_arg('page'))} if(t&&t[1]==page_name)arg=t[2];nav_obj.open_notify('Page',page_name,arg,no_history);} -function loadscript(src,call_back){set_loading();var script=$a('head','script');script.type='text/javascript';script.src=src;script.onload=function(){if(call_back)call_back();hide_loading();} -script.onreadystatechange=function(){if(this.readyState=='complete'||this.readyState=='loaded'){hide_loading();call_back();}}} var doc_browser_page;function loaddocbrowser(dt,label,fields){wn.require('lib/js/legacy/webpage/docbrowser.js');dt=get_label_doctype(dt);if(!doc_browser_page) doc_browser_page=new ItemBrowserPage();doc_browser_page.show(dt,label,fields);nav_obj.open_notify('List',dt,'');} function loaddocbrowser2(dt,label,fields){wn.pages.doclistview.show(dt);return;} @@ -1386,7 +1384,7 @@ Field.prototype.set_description=function(){if(this.df.description){var p=in_list if(in_list(['Text Editor','Code'],this.df.fieldtype)) $(this.desc_area).addClass('field_description_top');}} Field.prototype.get_status=function(){if(this.in_filter)this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} -var fn=this.df.fieldname?this.df.fieldname:this.df.label;this.df=get_field(this.doctype,fn,this.docname);if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') +if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) ret='None';if(ret=='Write'&&cint(cur_frm.doc.docstatus)>0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}} if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';} @@ -1633,17 +1631,14 @@ this.dn_area.innerHTML=f.docname;var doc=locals[f.doctype][f.docname];var sl=thi wn.provide('_f');_f.edit_record=function(dt,dn){d=_f.frm_dialog;var show_dialog=function(){var f=frms[dt];if(f.meta.istable){f.parent_doctype=cur_frm.doctype;f.parent_docname=cur_frm.docname;} d.cur_frm=f;d.dn=dn;d.table_form=f.meta.istable;f.refresh(dn);} if(!frms[dt]){_f.add_frm(dt,show_dialog,null);}else{show_dialog();}} -_f.Frm=function(doctype,parent){this.docname='';this.doctype=doctype;this.display=0;var me=this;this.is_editable={};this.opendocs={};this.cur_section={};this.sections=[];this.sections_by_label={};this.section_count;this.grids=[];this.cscript={};this.pformat={};this.fetch_dict={};this.parent=parent;this.tinymce_id_list=[];frms[doctype]=this;this.setup_meta(doctype);rename_observers.push(this);} +_f.Frm=function(doctype,parent){this.docname='';this.doctype=doctype;this.display=0;var me=this;this.is_editable={};this.opendocs={};this.sections=[];this.sections_by_label={};this.section_count;this.grids=[];this.cscript={};this.pformat={};this.fetch_dict={};this.parent=parent;this.tinymce_id_list=[];frms[doctype]=this;this.setup_meta(doctype);rename_observers.push(this);} _f.Frm.prototype.setup=function(){var me=this;this.fields=[];this.fields_dict={};this.wrapper=$a(this.parent.body,'div');this.setup_print_layout();this.saved_wrapper=$a(this.wrapper,'div');this.setup_std_layout();this.setup_client_script();this.setup_done=true;} _f.Frm.prototype.setup_print_layout=function(){this.print_wrapper=$a(this.wrapper,'div');this.print_head=$a(this.print_wrapper,'div');this.print_body=$a(this.print_wrapper,'div','layout_wrapper',{padding:'23px'});var t=make_table(this.print_head,1,2,'100%',[],{padding:'6px'});this.view_btn_wrapper=$a($td(t,0,0),'span','green_buttons');this.view_btn=$btn(this.view_btn_wrapper,'View Details',function(){cur_frm.edit_doc()},{marginRight:'4px'},'green');this.print_btn=$btn($td(t,0,0),'Print',function(){cur_frm.print_doc()});$y($td(t,0,1),{textAlign:'right'});this.print_close_btn=$btn($td(t,0,1),'Close',function(){nav_obj.show_last_open();});} _f.Frm.prototype.onhide=function(){if(_f.cur_grid_cell)_f.cur_grid_cell.grid.cell_deselect();} _f.Frm.prototype.setup_std_layout=function(){this.page_layout=new wn.PageLayout({parent:this.wrapper,main_width:this.in_dialog?'100%':'75%',sidebar_width:this.in_dialog?'0%':'25%'}) this.meta.section_style='Simple';this.layout=new Layout(this.page_layout.body,'100%');if(this.in_dialog){$(this.page_layout.wrapper).removeClass('layout-wrapper-background');$(this.page_layout.main).removeClass('layout-main-section');$(this.page_layout.sidebar_area).toggle(false);}else{this.setup_sidebar();} this.setup_footer();if(!(this.meta.istable||user=='Guest'))this.frm_head=new _f.FrmHeader(this.page_layout.head,this);if(this.frm_head&&this.meta.in_dialog)$dh(this.frm_head.page_head.close_btn);if(this.meta.colour) -this.layout.wrapper.style.backgroundColor='#'+this.meta.colour.split(':')[1];this.setup_fields_std();if(this.meta.description) -this.add_description();} -_f.Frm.prototype.add_description=function(){if(!wn.md2html){wn.require('lib/js/lib/showdown.js');wn.md2html=new Showdown.converter();} -this.description_wrapper=$a(this.page_layout.footer.help_area,'div','well',{marginTop:'11px'},wn.md2html.makeHtml('#### Help\n\n'+this.meta.description));} +this.layout.wrapper.style.backgroundColor='#'+this.meta.colour.split(':')[1];this.setup_fields_std();} _f.Frm.prototype.setup_print=function(){var fl=getchildren('DocFormat',this.meta.name,'formats','DocType');var l=[];this.default_format='Standard';if(fl.length){this.default_format=fl[0].format;for(var i=0;i=0;i--){var f=me.fields[i];f.guardian_has_value=true;if(f.df.depends_on){var v=doc[f.df.depends_on];if(f.df.depends_on.substr(0,5)=='eval:'){f.guardian_has_value=eval(f.df.depends_on.substr(5));}else if(f.df.depends_on.substr(0,3)=='fn:'){f.guardian_has_value=me.runclientscript(f.df.depends_on.substr(3),me.doctype,me.docname);}else{if(v||(v==0&&!v.substr)){}else{f.guardian_has_value=false;}} if(f.guardian_has_value){if(f.grid)f.grid.show();else $ds(f.wrapper);}else{if(f.grid)f.grid.hide();else $dh(f.wrapper);}}}} _f.Frm.prototype.setnewdoc=function(docname){if(this.opendocs[docname]){this.docname=docname;return;} -Meta.make_local_dt(this.doctype,docname);this.docname=docname;var me=this;var viewname=docname;if(this.meta.issingle)viewname=this.doctype;this.runclientscript('onload',this.doctype,this.docname);this.is_editable[docname]=1;if(this.meta.read_only_onload)this.is_editable[docname]=0;if(this.meta.section_style=='Tray'||this.meta.section_style=='Tabbed'){this.cur_section[docname]=0;} -this.opendocs[docname]=true;} +Meta.make_local_dt(this.doctype,docname);this.docname=docname;var me=this;var viewname=docname;if(this.meta.issingle)viewname=this.doctype;this.runclientscript('onload',this.doctype,this.docname);this.is_editable[docname]=1;if(this.meta.read_only_onload)this.is_editable[docname]=0;this.opendocs[docname]=true;} _f.Frm.prototype.edit_doc=function(){this.is_editable[this.docname]=true;this.refresh();} _f.Frm.prototype.show_doc=function(dn){this.refresh(dn);} var validated;_f.Frm.prototype.save=function(save_action,call_back){if(!save_action)save_action='Save';var me=this;if(this.savingflag){msgprint("Document is currently saving....");return;} @@ -1780,23 +1772,27 @@ cur_frm.comments.list.dt=cur_frm.doctype;cur_frm.comments.list.dn=cur_frm.docnam _f.ColumnBreak=function(){this.set_input=function(){};} _f.ColumnBreak.prototype.make_body=function(){if((!this.perm[this.df.permlevel])||(!this.perm[this.df.permlevel][READ])||this.df.hidden){return;} this.cell=this.frm.layout.addcell(this.df.width);$y(this.cell.wrapper,{padding:'8px'});_f.cur_col_break_width=this.df.width;var fn=this.df.fieldname?this.df.fieldname:this.df.label;if(this.df&&this.df.label){this.label=$a(this.cell.wrapper,'div','','',this.df.label);}} -_f.ColumnBreak.prototype.refresh=function(layout){if(!this.cell)return;var fn=this.df.fieldname?this.df.fieldname:this.df.label;if(fn){this.df=get_field(this.doctype,fn,this.docname);if(this.set_hidden!=this.df.hidden){if(this.df.hidden) +_f.ColumnBreak.prototype.refresh=function(layout){if(!this.cell)return;if(this.set_hidden!=this.df.hidden){if(this.df.hidden) this.cell.hide();else -this.cell.show();this.set_hidden=this.df.hidden;}}} -_f.SectionBreak=function(){this.set_input=function(){};} -_f.SectionBreak.prototype.make_row=function(){this.row=this.df.label?this.frm.layout.addrow():this.frm.layout.addsubrow();} -_f.SectionBreak.prototype.add_to_sections=function(){this.sec_id=this.frm.sections.length;this.frm.sections[this.sec_id]=this;this.frm.sections_by_label[this.df.label]=this;} -_f.cur_sec_header=null;_f.SectionBreak.prototype.make_body=function(){if((!this.perm[this.df.permlevel])||(!this.perm[this.df.permlevel][READ])||this.df.hidden){return;} -this.make_row();this.wrapper=$a(this.row.main_head,'div');if(this.df.label){if(!this.df.description)this.df.description='';$(this.wrapper).html(repl('
\ -

%(label)s

\ -
%(description)s
\ -
',this.df));}else{$(this.wrapper).html('
');} +this.cell.show();this.set_hidden=this.df.hidden;}} +_f.SectionBreak=function(){this.fields=[];this.set_input=function(){};this.make_row=function(){this.row=this.df.label?this.frm.layout.addrow():this.frm.layout.addsubrow();}} +_f.SectionBreak.prototype.make_body=function(){var me=this;if((!this.perm[this.df.permlevel])||(!this.perm[this.df.permlevel][READ])||this.df.hidden){return;} +this.make_row();if(this.df.label){if(!this.df.description) +this.df.description='';$(this.row.main_head).html(repl('
\ +
%(label)s\ +
%(description)s
\ +
',this.df));this.$expand=$(this.row.main_head).find('.form-section-head').click(function(){if($(me.row.main_head).find('h3').length){me.section_collapse();}else{me.section_expand();} +return false;});this.collapsible=true;}else{$(this.wrapper).html('
');} +this.section_collapse=function(){$(me.row.main_head).find('.head').html(' \ + Show "'+me.df.label+'"');$(me.row.main_body).toggle(false);} +this.section_expand=function(){$(me.row.main_head).find('.head').html('

' ++me.df.label+'

');$(me.row.main_body).slideDown();} $y(this.row.body,{marginLeft:'17px'});} -_f.SectionBreak.prototype.refresh=function(layout){var fn=this.df.fieldname?this.df.fieldname:this.df.label;if(fn) -this.df=get_field(this.doctype,fn,this.docname);if(this.set_hidden!=this.df.hidden){if(this.df.hidden){if(this.frm.meta.section_style=='Tabbed'){$dh(this.mytab);}else if(this.tray_item) -this.tray_item.hide();if(this.row)this.row.hide();}else{if(this.frm.meta.section_style=='Tabbed'){$di(this.mytab);}else if(this.tray_item) -this.tray_item.show();if(this.expanded)this.row.show();} -this.set_hidden=this.df.hidden;}} +_f.SectionBreak.prototype.has_data=function(){var me=this;for(var i in me.fields){var f=me.fields[i];var v=f.df.get_value?f.df.get_value():null;defaultval=f.df['default']||sys_defaults[f.fieldname]||user_defaults[f.fieldname];if(v&&v!=defaultval){return true;} +if(!v&&f.df.reqd){return true;} +if(f.df.fieldtype=='Table'){if(f.grid.get_children.length||f.df.reqd){return true;}}} +return false;} +_f.SectionBreak.prototype.refresh=function(layout){if(this.df.hidden){if(this.row)this.row.hide();}else{if(this.collapsible){if(this.has_data()){this.section_expand();}else{this.section_collapse();}}}} _f.ImageField=function(){this.images={};} _f.ImageField.prototype=new Field();_f.ImageField.prototype.onmake=function(){this.no_img=$a(this.wrapper,'div','no_img');this.no_img.innerHTML="No Image";$dh(this.no_img);} _f.ImageField.prototype.get_image_src=function(doc){if(doc.file_list){file=doc.file_list.split(',');extn=file[0].split('.');extn=extn[extn.length-1].toLowerCase();var img_extn_list=['gif','jpg','bmp','jpeg','jp2','cgm','ief','jpm','jpx','png','tiff','jpe','tif'];if(in_list(img_extn_list,extn)){var src=wn.request.url+"?cmd=downloadfile&file_id="+file[1];}}else{var src="";} @@ -1896,7 +1892,8 @@ this.btns[i].isactive=true;} _f.FormGrid.prototype.make_columns=function(){var gl=fields_list[this.field.df.options];if(!gl){alert('Table details not found "'+this.field.df.options+'"');} gl.sort(function(a,b){return a.idx-b.idx});var p=this.field.perm;for(var i=0;i'+label+'
';c.cur_label=label;break;}}} -_f.FormGrid.prototype.refresh=function(){var docset=getchildren(this.doctype,this.field.frm.docname,this.field.df.fieldname,this.field.frm.doctype);var data=[];for(var i=0;i0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}} if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';} @@ -726,11 +726,11 @@ $.extend(this,this.opts);this.prepare_opts();$(this.parent).html(repl('\ \ \ ',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});this.$w.find('.btn-list').click(function(){me.show_view($(this),me.$w.find('.result-list'),me.$w.find('.btn-grid'),me.$w.find('.result-grid'))});this.$w.find('.btn-grid').click(function(){me.show_view($(this),me.$w.find('.result-grid'),me.$w.find('.btn-list'),me.$w.find('.result-list'))});if(this.title){this.$w.find('h3').html(this.title).toggle(true);} -if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').toggle(false).attr('hidden','hidden');} -if(!me.show_filters){this.$w.find('.btn-filter').toggle(false).attr('hidden','hidden');} -if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').toggle(false).attr('hidden','hidden');} +if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype,me.new_doc_onload,true,me.new_doc_onsave);})}else{this.$w.find('.btn-new').remove();} +if(!me.show_filters){this.$w.find('.btn-filter').remove();} +if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} if(this.show_grid){this.$w.find('.select-view').toggle(true);} -if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length>1){this.$w.find('.list-toolbar').addClass('btn-group')} +if(this.$w.find('.list-toolbar a').length>1){this.$w.find('.list-toolbar').addClass('btn-group')} if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function') this.onrun=a0;if(a0&&a0.callback) this.onrun=a0.callback;if(!a1&&!(a0&&a0.append)) @@ -784,7 +784,7 @@ Layout.prototype.setcolour=function(col){$bg(cc,col);} Layout.prototype.show=function(){$ds(this.wrapper);} Layout.prototype.hide=function(){$dh(this.wrapper);} Layout.prototype.close_borders=function(){if(this.with_border){this.myrows[this.myrows.length-1].wrapper.style.borderBottom='1px solid #000';}} -function LayoutRow(layout,parent){this.layout=layout;this.wrapper=$a(parent,'div');this.main_head=$a(this.wrapper,'div');this.main_body=$a(this.wrapper,'div');if(layout.with_border){this.wrapper.style.border='1px solid #000';this.wrapper.style.borderBottom='0px';} +function LayoutRow(layout,parent){this.layout=layout;this.wrapper=$a(parent,'div','form-layout-row');this.main_head=$a(this.wrapper,'div');this.main_body=$a(this.wrapper,'div');if(layout.with_border){this.wrapper.style.border='1px solid #000';this.wrapper.style.borderBottom='0px';} this.header=$a(this.main_body,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.body=$a(this.main_body,'div');this.table=$a(this.body,'table','',{width:'100%',borderCollapse:'collapse'});this.row=this.table.insertRow(0);this.mycells=[];} LayoutRow.prototype.hide=function(){$dh(this.wrapper);} LayoutRow.prototype.show=function(){$ds(this.wrapper);} @@ -920,8 +920,6 @@ if(get_local('Page',page_name)||wn.pages[page_name]) fn();else{args=get_url_dict();args.name=page_name;$c('webnotes.widgets.page.getpage',args,fn);}} pscript.update_page_history=function(page_name,no_history){var arg=null;var t=null;if(window.location.hash){var t=nav_obj.get_page(window.location.hash)}else if(get_url_arg('page')){var t=nav_obj.get_page(get_url_arg('page'))} if(t&&t[1]==page_name)arg=t[2];nav_obj.open_notify('Page',page_name,arg,no_history);} -function loadscript(src,call_back){set_loading();var script=$a('head','script');script.type='text/javascript';script.src=src;script.onload=function(){if(call_back)call_back();hide_loading();} -script.onreadystatechange=function(){if(this.readyState=='complete'||this.readyState=='loaded'){hide_loading();call_back();}}} var doc_browser_page;function loaddocbrowser(dt,label,fields){wn.require('lib/js/legacy/webpage/docbrowser.js');dt=get_label_doctype(dt);if(!doc_browser_page) doc_browser_page=new ItemBrowserPage();doc_browser_page.show(dt,label,fields);nav_obj.open_notify('List',dt,'');} function loaddocbrowser2(dt,label,fields){wn.pages.doclistview.show(dt);return;} diff --git a/version.num b/version.num index e57d8dfad6..2478c955ec 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -965 \ No newline at end of file +1003 \ No newline at end of file