From 11d84c8f8cc0522a025d95ab54b4b46096bfb223 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 6 Nov 2019 12:38:45 +0530 Subject: [PATCH] feat: members can see only their jobs in listing --- .../doctype/portal_job/portal_job.json | 287 ++---------------- .../doctype/portal_job/portal_job.py | 2 +- .../web_form/jobs/jobs.json | 33 +- 3 files changed, 48 insertions(+), 274 deletions(-) diff --git a/foundation/erpnext_foundation/doctype/portal_job/portal_job.json b/foundation/erpnext_foundation/doctype/portal_job/portal_job.json index f9aaa01b..bb597ccd 100644 --- a/foundation/erpnext_foundation/doctype/portal_job/portal_job.json +++ b/foundation/erpnext_foundation/doctype/portal_job/portal_job.json @@ -1,340 +1,97 @@ { - "allow_copy": 0, - "allow_guest_to_view": 1, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, "creation": "2017-02-24 12:06:02.509773", - "custom": 0, - "docstatus": 0, "doctype": "DocType", - "document_type": "", "editable_grid": 1, "engine": "InnoDB", + "field_order": [ + "title", + "company_name", + "status", + "description", + "contact_number", + "country", + "job_type", + "show_in_website", + "route" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "title", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Title", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Title" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "company_name", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Company Name", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Company Name" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "status", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Status", - "length": 0, - "no_copy": 0, - "options": "Open\nCompleted\nDeveloper Hired\nExpired\nWithdrawn", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "options": "Open\nCompleted\nDeveloper Hired\nExpired\nWithdrawn" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "description", "fieldtype": "Long Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Description" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "contact_number", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Contact Number", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Contact Number" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "country", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Country", - "length": 0, - "no_copy": 0, - "options": "Country", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "options": "Country" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "job_type", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Job Type", - "length": 0, - "no_copy": 0, - "options": "Setup\nImplementation\nTraining\nCustomization\nPrint Format\nIntegration\nFeature Development\nApp Development", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "options": "Setup\nImplementation\nTraining\nCustomization\nPrint Format\nIntegration\nFeature Development\nApp Development" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "1", "fieldname": "show_in_website", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show in Website", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Show in Website" }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "route", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Route", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "label": "Route" } ], "has_web_view": 1, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, "is_published_field": "show_in_website", - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2018-10-25 05:24:04.271224", + "modified": "2019-11-06 12:36:35.982037", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Portal Job", - "name_case": "", "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, "role": "System Manager", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 } ], "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, "route": "/erpnext-jobs-1", - "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", "title_field": "title", - "track_changes": 1, - "track_seen": 0 + "track_changes": 1 } \ No newline at end of file diff --git a/foundation/erpnext_foundation/doctype/portal_job/portal_job.py b/foundation/erpnext_foundation/doctype/portal_job/portal_job.py index 6b470952..b37a3bc7 100644 --- a/foundation/erpnext_foundation/doctype/portal_job/portal_job.py +++ b/foundation/erpnext_foundation/doctype/portal_job/portal_job.py @@ -23,7 +23,7 @@ class PortalJob(WebsiteGenerator): def get_list_context(context): - context.allow_guest = True + context.allow_guest = False context.no_cache = True context.title = 'ERPNext Jobs' context.no_breadcrumbs = True diff --git a/foundation/erpnext_foundation/web_form/jobs/jobs.json b/foundation/erpnext_foundation/web_form/jobs/jobs.json index 744f03d4..b5049195 100644 --- a/foundation/erpnext_foundation/web_form/jobs/jobs.json +++ b/foundation/erpnext_foundation/web_form/jobs/jobs.json @@ -17,7 +17,7 @@ "is_standard": 1, "login_required": 1, "max_attachment_size": 0, - "modified": "2018-07-16 15:08:08.555163", + "modified": "2019-11-06 12:31:16.600174", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "jobs", @@ -25,12 +25,16 @@ "payment_button_label": "Buy Now", "published": 1, "route": "my-jobs", + "route_to_success_link": 0, + "show_attachments": 0, + "show_in_grid": 1, "show_sidebar": 1, "sidebar_items": [], "success_url": "/erpnext-jobs", "title": "Jobs", "web_form_fields": [ { + "allow_read_on_all_link_options": 0, "fieldname": "title", "fieldtype": "Data", "hidden": 0, @@ -38,9 +42,11 @@ "max_length": 0, "max_value": 0, "read_only": 0, - "reqd": 1 + "reqd": 1, + "show_in_filter": 0 }, { + "allow_read_on_all_link_options": 0, "fieldname": "job_type", "fieldtype": "Select", "hidden": 0, @@ -49,9 +55,11 @@ "max_value": 0, "options": "Setup\nImplementation\nTraining\nCustomization\nPrint Format\nIntegration\nFeature Development\nApp Development", "read_only": 0, - "reqd": 0 + "reqd": 0, + "show_in_filter": 0 }, { + "allow_read_on_all_link_options": 0, "fieldname": "status", "fieldtype": "Select", "hidden": 0, @@ -60,9 +68,11 @@ "max_value": 0, "options": "Open\nCompleted\nDeveloper Hired\nExpired\nWithdrawn", "read_only": 0, - "reqd": 0 + "reqd": 0, + "show_in_filter": 0 }, { + "allow_read_on_all_link_options": 1, "fieldname": "country", "fieldtype": "Link", "hidden": 0, @@ -71,9 +81,11 @@ "max_value": 0, "options": "Country", "read_only": 0, - "reqd": 0 + "reqd": 0, + "show_in_filter": 0 }, { + "allow_read_on_all_link_options": 0, "fieldname": "company_name", "fieldtype": "Data", "hidden": 0, @@ -81,9 +93,11 @@ "max_length": 0, "max_value": 0, "read_only": 0, - "reqd": 0 + "reqd": 0, + "show_in_filter": 0 }, { + "allow_read_on_all_link_options": 0, "fieldname": "contact_number", "fieldtype": "Data", "hidden": 0, @@ -92,9 +106,11 @@ "max_value": 0, "options": "", "read_only": 0, - "reqd": 0 + "reqd": 0, + "show_in_filter": 0 }, { + "allow_read_on_all_link_options": 0, "fieldname": "description", "fieldtype": "Text", "hidden": 0, @@ -102,7 +118,8 @@ "max_length": 0, "max_value": 0, "read_only": 0, - "reqd": 0 + "reqd": 0, + "show_in_filter": 0 } ] } \ No newline at end of file