From 2067d06066294e5e470412739513d66da2b9eb8b Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 20 Apr 2022 14:37:30 +0200 Subject: [PATCH 1/9] Permissions and Roles, IT Contract WIP --- msp/msp/doctype/it_contract/it_contract.json | 47 ++++++++++++++++++- .../doctype/it_landscape/it_landscape.json | 25 +++++++++- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/msp/msp/doctype/it_contract/it_contract.json b/msp/msp/doctype/it_contract/it_contract.json index 49080ec..2006186 100644 --- a/msp/msp/doctype/it_contract/it_contract.json +++ b/msp/msp/doctype/it_contract/it_contract.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "ITCON-.#####", "creation": "2021-03-18 02:54:42.727620", "doctype": "DocType", @@ -8,7 +9,14 @@ "title", "customer", "it_landscape", - "it_contract_type" + "it_contract_type", + "sla_details_section", + "html_10", + "reaction_time_emergeny", + "reaction_time_urgent", + "reaction_time_issue", + "reaction_time_change", + "column_break_11" ], "fields": [ { @@ -33,9 +41,44 @@ "fieldtype": "Link", "label": "IT Contract Type", "options": "IT Contract Type" + }, + { + "fieldname": "sla_details_section", + "fieldtype": "Section Break", + "label": "SLA Details" + }, + { + "fieldname": "reaction_time_emergeny", + "fieldtype": "Data", + "label": "Reaction Time Emergeny" + }, + { + "fieldname": "reaction_time_urgent", + "fieldtype": "Data", + "label": "Reaction Time Urgent" + }, + { + "fieldname": "reaction_time_issue", + "fieldtype": "Data", + "label": "Reaction Time Issue" + }, + { + "fieldname": "reaction_time_change", + "fieldtype": "Data", + "label": "Reaction Time Change" + }, + { + "fieldname": "html_10", + "fieldtype": "HTML", + "options": "Reaktion Times May be written Hours like \"4H\" or in Business Days Like \"1BD\"" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" } ], - "modified": "2021-03-23 21:04:54.623670", + "links": [], + "modified": "2022-03-31 23:49:28.471609", "modified_by": "Administrator", "module": "MSP", "name": "IT Contract", diff --git a/msp/msp/doctype/it_landscape/it_landscape.json b/msp/msp/doctype/it_landscape/it_landscape.json index db390a0..3366f46 100644 --- a/msp/msp/doctype/it_landscape/it_landscape.json +++ b/msp/msp/doctype/it_landscape/it_landscape.json @@ -57,7 +57,7 @@ } ], "links": [], - "modified": "2022-01-27 23:36:00.711074", + "modified": "2022-04-20 14:36:03.078442", "modified_by": "Administrator", "module": "MSP", "name": "IT Landscape", @@ -74,6 +74,29 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, From f1cb58de3709a9bd616c1ab0240a2bcfbc4fb76a Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 13 Jun 2022 11:28:02 +0200 Subject: [PATCH 2/9] wip --- msp/hooks.py | 14 ++- msp/public/js/customer_quick_entry.js | 118 ++++++++++++++++++++++++++ msp/public/v | 0 3 files changed, 124 insertions(+), 8 deletions(-) create mode 100644 msp/public/js/customer_quick_entry.js create mode 100644 msp/public/v diff --git a/msp/hooks.py b/msp/hooks.py index c5f86e4..f0057f1 100644 --- a/msp/hooks.py +++ b/msp/hooks.py @@ -16,7 +16,7 @@ app_license = "GPLv3" # include js, css files in header of desk.html # app_include_css = "/assets/msp/css/msp.css" -# app_include_js = "/assets/msp/js/msp.js" +app_include_js = "/assets/msp/js/customer_quick_entry.js" # include js, css files in header of web template # web_include_css = "/assets/msp/css/msp.css" @@ -79,13 +79,11 @@ app_license = "GPLv3" # --------------- # Hook on document methods and events -# doc_events = { -# "*": { -# "on_update": "method", -# "on_cancel": "method", -# "on_trash": "method" -# } -# } +doc_events = { + "Customer": { + "on_update": "msp.msp.customer_quick_entry.custom_customer_info" + } +} # Scheduled Tasks # --------------- diff --git a/msp/public/js/customer_quick_entry.js b/msp/public/js/customer_quick_entry.js new file mode 100644 index 0000000..fc84bf2 --- /dev/null +++ b/msp/public/js/customer_quick_entry.js @@ -0,0 +1,118 @@ +frappe.provide('frappe.ui.form'); + +frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({ + init: function(doctype, after_insert, init_callback, doc, force) { + this._super(doctype, after_insert, init_callback, doc, force); + this.skip_redirect_on_error = true; + }, + + render_dialog: function() { + this.mandatory = this.mandatory.concat(this.get_variant_fields()); + this._super(); + console.log("hi") + let me = this + console.log(me) + me.dialog.fields_dict.customer_name.$input[0].onchange = function() { + me.inputHandler(this) + } + + }, + + inputHandler: function(obj) { + console.log("test") + console.log(obj.value) + }, + + + + get_variant_fields: function() { + var variant_fields = [{ + fieldtype: "Section Break", + label: __("Primary Contact Details"), + collapsible: 1 + }, + { + label: __("Salutation"), + fieldname: "contact_salutation", + fieldtype: "Link", + options: "Salutation" + }, + { + label: __("First Name"), + fieldname: "first_name", + fieldtype: "Data" + }, + { + label: __("Last Name"), + fieldname: "last_name", + fieldtype: "Data" + }, + { + fieldtype: "Column Break" + }, + { + label: __("Mobile Number"), + fieldname: "mobile_no", + fieldtype: "Data" + }, + { + label: __("Phone Number"), + fieldname: "phone", + fieldtype: "Data" + }, + { + label: __("Email Id"), + fieldname: "email_id", + fieldtype: "Data" + }, + { + fieldtype: "Section Break", + label: __("Primary Address Details"), + collapsible: 1 + }, + { + label: __("Address Line 1"), + fieldname: "address_line1", + fieldtype: "Data" + }, + { + label: __("Address Line 2"), + fieldname: "address_line2", + fieldtype: "Data" + }, + { + label: __("ZIP Code"), + fieldname: "pincode", + fieldtype: "Data" + }, + { + fieldtype: "Column Break" + }, + { + label: __("City"), + fieldname: "city", + fieldtype: "Data" + }, + { + label: __("State"), + fieldname: "state", + fieldtype: "Data", + hidden: 1 + }, + { + label: __("Country"), + fieldname: "country", + fieldtype: "Link", + options: "Country", + default: "Germany" + }, + { + label: __("Customer POS Id"), + fieldname: "customer_pos_id", + fieldtype: "Data", + hidden: 1 + }]; + + return variant_fields; + }, +}) diff --git a/msp/public/v b/msp/public/v new file mode 100644 index 0000000..e69de29 From 70b1e373d1f7eebf3f805848e0b5a9840e1956b1 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 11:35:53 +0200 Subject: [PATCH 3/9] Display Password --- .../doctype/it_user_account/it_user_account.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/msp/msp/doctype/it_user_account/it_user_account.js b/msp/msp/doctype/it_user_account/it_user_account.js index 65450a5..42f81f5 100644 --- a/msp/msp/doctype/it_user_account/it_user_account.js +++ b/msp/msp/doctype/it_user_account/it_user_account.js @@ -3,9 +3,20 @@ frappe.ui.form.on('IT User Account', { refresh: function(frm) { - frm.add_custom_button('Copy PW', () => frm.trigger('get_pw')); - frm.add_custom_button('Generate PW', () => frm.trigger('generate_new_pw')); - + frm.add_custom_button('Copy PW', () => frm.trigger('get_pw'),"Actions"); + frm.add_custom_button('Show PW', () => frm.trigger('show_pw'),"Actions"); + frm.add_custom_button('Generate PW', () => frm.trigger('generate_new_pw'),"Actions"); + + }, + show_pw: function(frm) { + frm.call('copy_pw', { + 'user_agent': navigator.userAgent, + 'platform': navigator.platform, + }, + (r) => { + frappe.msgprint(r.message) + } + ); }, get_pw: function(frm) { frm.call('copy_pw', { From 30ce33e2439ad505f4c47d8b15d453327192aa31 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 11:36:27 +0200 Subject: [PATCH 4/9] open Links to Monitoring and Ticket System --- msp/msp/doctype/it_landscape/it_landscape.js | 13 +++++ .../doctype/it_landscape/it_landscape.json | 53 +++++++++++++++++-- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/msp/msp/doctype/it_landscape/it_landscape.js b/msp/msp/doctype/it_landscape/it_landscape.js index fe0f7a1..80b7d49 100644 --- a/msp/msp/doctype/it_landscape/it_landscape.js +++ b/msp/msp/doctype/it_landscape/it_landscape.js @@ -4,7 +4,20 @@ frappe.ui.form.on('IT Landscape', { refresh: function(frm) { frm.add_custom_button('Copy SSH Keys', () => frm.trigger('copy_ssh_keys'), 'Actions'); + if (frm.doc.ticket_system_link != "") { + frm.add_custom_button('Open Ticket System', () => frm.trigger('open_ticket_system'), 'Actions'); + }; + if (frm.doc.monitoring_link != "") { + frm.add_custom_button('Open Monitoring', () => frm.trigger('open_monitoring'), 'Actions'); + } }, + open_ticket_system: function(frm) { + window.open(frm.doc.ticket_system_link, '_blank').focus(); + }, + open_monitoring: function(frm) { + window.open(frm.doc.monitoring_link, '_blank').focus(); + }, + copy_ssh_keys: function(frm) { frappe.call({ "method": "msp.whitelisted_tools.get_ssh_keys_for_landscape", diff --git a/msp/msp/doctype/it_landscape/it_landscape.json b/msp/msp/doctype/it_landscape/it_landscape.json index 3366f46..b37fb5e 100644 --- a/msp/msp/doctype/it_landscape/it_landscape.json +++ b/msp/msp/doctype/it_landscape/it_landscape.json @@ -8,11 +8,18 @@ "engine": "InnoDB", "field_order": [ "title", - "abbreviation", "customer", "customer_name", + "abbreviation", + "column_break_5", + "operating_mode", + "contract", + "description_section", "description", - "section_break_6" + "section_break_6", + "landscape_image", + "monitoring_link", + "ticket_system_link" ], "fields": [ { @@ -53,11 +60,49 @@ }, { "fieldname": "section_break_6", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "label": "Aditional Data" + }, + { + "fieldname": "landscape_image", + "fieldtype": "Attach Image", + "label": "Landscape Image" + }, + { + "fieldname": "column_break_5", + "fieldtype": "Column Break" + }, + { + "fieldname": "operating_mode", + "fieldtype": "Select", + "label": "Operating Mode", + "options": "\nSLA\nHosting\nown IT with Support Contract\nself maintained" + }, + { + "fieldname": "description_section", + "fieldtype": "Section Break", + "label": "Description" + }, + { + "fieldname": "contract", + "fieldtype": "Link", + "label": "Contract", + "options": "IT Contract" + }, + { + "fieldname": "monitoring_link", + "fieldtype": "Data", + "label": "Monitoring Link" + }, + { + "fieldname": "ticket_system_link", + "fieldtype": "Data", + "label": "Ticket System Link" } ], + "image_field": "landscape_image", "links": [], - "modified": "2022-04-20 14:36:03.078442", + "modified": "2022-06-17 11:04:02.866184", "modified_by": "Administrator", "module": "MSP", "name": "IT Landscape", From bea7f7c2fee6a61fc1f9d1a3dc02b9918211422e Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 11:36:40 +0200 Subject: [PATCH 5/9] permissions --- msp/msp/doctype/ip_address/ip_address.json | 28 ++++++++++++++++++- msp/msp/doctype/ip_network/ip_network.json | 28 ++++++++++++++++++- .../doctype/it_checklist/it_checklist.json | 28 ++++++++++++++++++- .../it_checklist_template.json | 26 ++++++++++++++++- msp/msp/doctype/it_contract/it_contract.json | 25 ++++++++++++++++- .../it_contract_type/it_contract_type.json | 26 ++++++++++++++++- msp/msp/doctype/it_object/it_object.json | 25 ++++++++++++++++- .../it_object_type/it_object_type.json | 27 +++++++++++++++++- .../it_user_account/it_user_account.json | 27 +++++++++++++++++- .../it_user_account_type.json | 26 ++++++++++++++++- .../ssh_public_key/ssh_public_key.json | 26 ++++++++++++++++- 11 files changed, 281 insertions(+), 11 deletions(-) diff --git a/msp/msp/doctype/ip_address/ip_address.json b/msp/msp/doctype/ip_address/ip_address.json index 551b4c5..4b1f6d1 100644 --- a/msp/msp/doctype/ip_address/ip_address.json +++ b/msp/msp/doctype/ip_address/ip_address.json @@ -1,4 +1,5 @@ { + "actions": [], "allow_rename": 1, "autoname": "format:IP-{ip_address}-{it_landscape}", "creation": "2021-03-18 03:15:11.235106", @@ -53,7 +54,8 @@ "reqd": 1 } ], - "modified": "2021-03-24 00:15:34.341218", + "links": [], + "modified": "2022-06-17 11:21:47.850521", "modified_by": "Administrator", "module": "MSP", "name": "IP Address", @@ -70,6 +72,30 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, diff --git a/msp/msp/doctype/ip_network/ip_network.json b/msp/msp/doctype/ip_network/ip_network.json index 48839f5..0396496 100644 --- a/msp/msp/doctype/ip_network/ip_network.json +++ b/msp/msp/doctype/ip_network/ip_network.json @@ -1,4 +1,5 @@ { + "actions": [], "allow_rename": 1, "autoname": "format:NET-{network_address}/{cidr_mask}-{it_landscape}", "creation": "2021-03-18 03:13:40.772882", @@ -147,7 +148,8 @@ "label": "Aditional Data" } ], - "modified": "2021-03-29 15:19:10.791248", + "links": [], + "modified": "2022-06-17 11:20:37.093173", "modified_by": "Administrator", "module": "MSP", "name": "IP Network", @@ -164,6 +166,30 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, diff --git a/msp/msp/doctype/it_checklist/it_checklist.json b/msp/msp/doctype/it_checklist/it_checklist.json index f157fcf..2c6695b 100644 --- a/msp/msp/doctype/it_checklist/it_checklist.json +++ b/msp/msp/doctype/it_checklist/it_checklist.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "ITCL-.#####", "creation": "2021-03-18 02:30:47.686842", "doctype": "DocType", @@ -34,7 +35,8 @@ "label": "Completed on" } ], - "modified": "2021-03-18 02:30:47.686842", + "links": [], + "modified": "2022-06-17 11:22:55.055154", "modified_by": "Administrator", "module": "MSP", "name": "IT Checklist", @@ -51,6 +53,30 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, diff --git a/msp/msp/doctype/it_checklist_template/it_checklist_template.json b/msp/msp/doctype/it_checklist_template/it_checklist_template.json index ff88258..a4902cd 100644 --- a/msp/msp/doctype/it_checklist_template/it_checklist_template.json +++ b/msp/msp/doctype/it_checklist_template/it_checklist_template.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "ITCLT-.###", "creation": "2021-03-18 02:27:40.328506", "doctype": "DocType", @@ -14,7 +15,8 @@ "label": "Title" } ], - "modified": "2021-03-18 02:27:40.328506", + "links": [], + "modified": "2022-06-17 11:21:13.492067", "modified_by": "Administrator", "module": "MSP", "name": "IT Checklist Template", @@ -31,6 +33,28 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1 } ], "sort_field": "modified", diff --git a/msp/msp/doctype/it_contract/it_contract.json b/msp/msp/doctype/it_contract/it_contract.json index 2006186..18e2d75 100644 --- a/msp/msp/doctype/it_contract/it_contract.json +++ b/msp/msp/doctype/it_contract/it_contract.json @@ -78,7 +78,7 @@ } ], "links": [], - "modified": "2022-03-31 23:49:28.471609", + "modified": "2022-06-17 11:19:34.968766", "modified_by": "Administrator", "module": "MSP", "name": "IT Contract", @@ -95,6 +95,29 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, diff --git a/msp/msp/doctype/it_contract_type/it_contract_type.json b/msp/msp/doctype/it_contract_type/it_contract_type.json index 491a741..40d0243 100644 --- a/msp/msp/doctype/it_contract_type/it_contract_type.json +++ b/msp/msp/doctype/it_contract_type/it_contract_type.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "field:title", "creation": "2021-03-23 21:03:02.275205", "doctype": "DocType", @@ -15,7 +16,8 @@ "unique": 1 } ], - "modified": "2021-03-23 21:03:02.275205", + "links": [], + "modified": "2022-06-17 11:20:18.380840", "modified_by": "Administrator", "module": "MSP", "name": "IT Contract Type", @@ -32,6 +34,28 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1 } ], "sort_field": "modified", diff --git a/msp/msp/doctype/it_object/it_object.json b/msp/msp/doctype/it_object/it_object.json index c3803d4..06704fa 100644 --- a/msp/msp/doctype/it_object/it_object.json +++ b/msp/msp/doctype/it_object/it_object.json @@ -122,7 +122,7 @@ ], "image_field": "image", "links": [], - "modified": "2022-01-27 22:39:21.190206", + "modified": "2022-06-17 11:18:55.707924", "modified_by": "Administrator", "module": "MSP", "name": "IT Object", @@ -139,6 +139,29 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, diff --git a/msp/msp/doctype/it_object_type/it_object_type.json b/msp/msp/doctype/it_object_type/it_object_type.json index c1ad76f..4183dc7 100644 --- a/msp/msp/doctype/it_object_type/it_object_type.json +++ b/msp/msp/doctype/it_object_type/it_object_type.json @@ -1,4 +1,5 @@ { + "actions": [], "allow_rename": 1, "autoname": "field:title", "creation": "2021-03-18 01:31:27.823964", @@ -30,7 +31,8 @@ "label": "Default Image" } ], - "modified": "2021-03-23 21:09:27.176989", + "links": [], + "modified": "2022-06-17 11:20:57.722192", "modified_by": "Administrator", "module": "MSP", "name": "IT Object Type", @@ -47,6 +49,29 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "sort_field": "modified", diff --git a/msp/msp/doctype/it_user_account/it_user_account.json b/msp/msp/doctype/it_user_account/it_user_account.json index 9b8f452..2106c29 100644 --- a/msp/msp/doctype/it_user_account/it_user_account.json +++ b/msp/msp/doctype/it_user_account/it_user_account.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "ITUACC-.#####", "creation": "2021-03-18 02:43:33.591837", "doctype": "DocType", @@ -54,7 +55,8 @@ "label": "UPN" } ], - "modified": "2021-03-24 13:31:10.543697", + "links": [], + "modified": "2022-06-17 11:22:18.100486", "modified_by": "Administrator", "module": "MSP", "name": "IT User Account", @@ -71,6 +73,29 @@ "role": "IT User Account Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 } ], "sort_field": "modified", diff --git a/msp/msp/doctype/it_user_account_type/it_user_account_type.json b/msp/msp/doctype/it_user_account_type/it_user_account_type.json index a8ad440..1a43ef1 100644 --- a/msp/msp/doctype/it_user_account_type/it_user_account_type.json +++ b/msp/msp/doctype/it_user_account_type/it_user_account_type.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "field:title", "creation": "2021-03-18 02:44:48.527444", "doctype": "DocType", @@ -15,7 +16,8 @@ "unique": 1 } ], - "modified": "2021-03-18 02:44:48.527444", + "links": [], + "modified": "2022-06-17 11:22:39.857595", "modified_by": "Administrator", "module": "MSP", "name": "IT User Account Type", @@ -32,6 +34,28 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "quick_entry": 1, diff --git a/msp/msp/doctype/ssh_public_key/ssh_public_key.json b/msp/msp/doctype/ssh_public_key/ssh_public_key.json index be0c331..582b0cd 100644 --- a/msp/msp/doctype/ssh_public_key/ssh_public_key.json +++ b/msp/msp/doctype/ssh_public_key/ssh_public_key.json @@ -87,7 +87,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2022-01-27 23:40:39.860991", + "modified": "2022-06-17 11:19:58.666409", "modified_by": "Administrator", "module": "MSP", "name": "SSH Public Key", @@ -104,6 +104,30 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP User", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "MSP Admin", + "share": 1, + "write": 1 } ], "sort_field": "modified", From 48ca998883a1ee3838834ab69f68d145d7016951 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 11:55:41 +0200 Subject: [PATCH 6/9] Admin Interface and monitoring links --- msp/msp/doctype/it_object/it_object.js | 18 +++++++++++++++--- msp/msp/doctype/it_object/it_object.json | 23 +++++++++++++++++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/msp/msp/doctype/it_object/it_object.js b/msp/msp/doctype/it_object/it_object.js index 0a8c304..2d576c8 100644 --- a/msp/msp/doctype/it_object/it_object.js +++ b/msp/msp/doctype/it_object/it_object.js @@ -2,7 +2,19 @@ // For license information, please see license.txt frappe.ui.form.on('IT Object', { - // refresh: function(frm) { - - // } + refresh: function(frm) { + if (frm.doc.admin_interface_link) { + frm.add_custom_button('Open Admin Interface', () => frm.trigger('open_admin_interface'), 'Actions'); + }; + if (frm.doc.monitoring_link) { + frm.add_custom_button('Open Monitoring', () => frm.trigger('open_monitoring'), 'Actions'); + }; + }, + open_admin_interface: function(frm) { + window.open(frm.doc.admin_interface_link, '_blank').focus(); + }, + open_monitoring: function(frm) { + window.open(frm.doc.monitoring_link, '_blank').focus(); + }, + }); diff --git a/msp/msp/doctype/it_object/it_object.json b/msp/msp/doctype/it_object/it_object.json index 06704fa..35f20f3 100644 --- a/msp/msp/doctype/it_object/it_object.json +++ b/msp/msp/doctype/it_object/it_object.json @@ -21,7 +21,10 @@ "description", "image", "network_config_section", - "ip_adresses" + "ip_adresses", + "external_links_section", + "monitoring_link", + "admin_interface_link" ], "fields": [ { @@ -118,11 +121,27 @@ "fieldtype": "Table", "label": "IP Adresses", "options": "IT Object IP Address" + }, + { + "collapsible": 1, + "fieldname": "external_links_section", + "fieldtype": "Section Break", + "label": "External Links" + }, + { + "fieldname": "monitoring_link", + "fieldtype": "Data", + "label": "Monitoring Link" + }, + { + "fieldname": "admin_interface_link", + "fieldtype": "Data", + "label": "Admin Interface Link" } ], "image_field": "image", "links": [], - "modified": "2022-06-17 11:18:55.707924", + "modified": "2022-06-17 11:43:07.550361", "modified_by": "Administrator", "module": "MSP", "name": "IT Object", From 981c6d683d5a1c3293145b0596274740f99a51fa Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 11:55:55 +0200 Subject: [PATCH 7/9] better checks for empty fields --- msp/msp/doctype/it_landscape/it_landscape.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msp/msp/doctype/it_landscape/it_landscape.js b/msp/msp/doctype/it_landscape/it_landscape.js index 80b7d49..edfc078 100644 --- a/msp/msp/doctype/it_landscape/it_landscape.js +++ b/msp/msp/doctype/it_landscape/it_landscape.js @@ -4,10 +4,10 @@ frappe.ui.form.on('IT Landscape', { refresh: function(frm) { frm.add_custom_button('Copy SSH Keys', () => frm.trigger('copy_ssh_keys'), 'Actions'); - if (frm.doc.ticket_system_link != "") { + if (frm.doc.ticket_system_link) { frm.add_custom_button('Open Ticket System', () => frm.trigger('open_ticket_system'), 'Actions'); }; - if (frm.doc.monitoring_link != "") { + if (frm.doc.monitoring_link) { frm.add_custom_button('Open Monitoring', () => frm.trigger('open_monitoring'), 'Actions'); } }, From 988a6c97c3104d45f8f4d4728e38988d6d2da287 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 12:56:05 +0200 Subject: [PATCH 8/9] additional status --- msp/msp/doctype/it_landscape/it_landscape.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msp/msp/doctype/it_landscape/it_landscape.json b/msp/msp/doctype/it_landscape/it_landscape.json index b37fb5e..a690bd8 100644 --- a/msp/msp/doctype/it_landscape/it_landscape.json +++ b/msp/msp/doctype/it_landscape/it_landscape.json @@ -76,7 +76,7 @@ "fieldname": "operating_mode", "fieldtype": "Select", "label": "Operating Mode", - "options": "\nSLA\nHosting\nown IT with Support Contract\nself maintained" + "options": "\nSLA\nHosting\nown IT with Support Contract\nself maintained\nneglected" }, { "fieldname": "description_section", @@ -102,7 +102,7 @@ ], "image_field": "landscape_image", "links": [], - "modified": "2022-06-17 11:04:02.866184", + "modified": "2022-06-17 12:03:50.957612", "modified_by": "Administrator", "module": "MSP", "name": "IT Landscape", From 63d78d2f18f1297ced85f8c02829ec3d68a25621 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 17 Jun 2022 12:56:22 +0200 Subject: [PATCH 9/9] Colors for Status --- msp/msp/doctype/it_object/it_object_list.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 msp/msp/doctype/it_object/it_object_list.js diff --git a/msp/msp/doctype/it_object/it_object_list.js b/msp/msp/doctype/it_object/it_object_list.js new file mode 100644 index 0000000..e14d671 --- /dev/null +++ b/msp/msp/doctype/it_object/it_object_list.js @@ -0,0 +1,19 @@ +frappe.listview_settings['IT Object'] = { + get_indicator: function (doc) { + if (doc.status === "in Production") { + return [__("in Production"), "green", "status,=,in Production"]; + } + else if (doc.status === "Implementation") { + return [__("Implementation"), "blue", "status,=,Implementation"]; + } + else if (doc.status === "in Maintenance") { + return [__("in Maintenance"), "orange", "status,=,in Maintenance"]; + } + else if (doc.status === "failed") { + return [__("failed"), "red", "status,=,failed"]; + } + else if (doc.status === "Decommissioned") { + return [__("Decommissioned"), "grey", "status,=,Decommissioned"]; + } + } +} \ No newline at end of file