diff --git a/church/church_people/doctype/church_person/church_person.json b/church/church_people/doctype/church_person/church_person.json index e8afa0a..bcbd074 100644 --- a/church/church_people/doctype/church_person/church_person.json +++ b/church/church_people/doctype/church_person/church_person.json @@ -18,6 +18,7 @@ "photo", "birthday", "alergies", + "app_user", "church_records_section", "is_member", "membership_date", @@ -293,6 +294,12 @@ "label": "Letters to the Church", "options": "Church Letter", "print_hide": 1 + }, + { + "fieldname": "app_user", + "fieldtype": "Link", + "label": "App User", + "options": "User" } ], "grid_page_length": 50, @@ -320,7 +327,7 @@ "link_fieldname": "recipient" } ], - "modified": "2025-11-18 23:43:11.668299", + "modified": "2025-12-18 23:37:10.065945", "modified_by": "Administrator", "module": "Church People", "name": "Church Person", @@ -352,9 +359,15 @@ "select": 1, "share": 1, "write": 1 + }, + { + "read": 1, + "role": "Church User", + "write": 1 } ], "quick_entry": 1, + "route": "church-personz", "row_format": "Dynamic", "search_fields": "last_name, first_name", "show_preview_popup": 1, diff --git a/church/church_people/doctype/church_person/church_person.py b/church/church_people/doctype/church_person/church_person.py index d2b6ef4..d770497 100644 --- a/church/church_people/doctype/church_person/church_person.py +++ b/church/church_people/doctype/church_person/church_person.py @@ -90,3 +90,11 @@ class ChurchPerson(Document): role.is_current_role = 1 else: role.is_current_role = 0 + + +def get_list_context(context): + # Only show documents related to the active user + context.filters = {"app_user": frappe.session.user} + # Sort the portal list view by status descending + context.order_by = "modified desc" + return context diff --git a/church/church_people/web_form/__init__.py b/church/church_people/web_form/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/church/church_people/web_form/personal_details/__init__.py b/church/church_people/web_form/personal_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/church/church_people/web_form/personal_details/personal_details.js b/church/church_people/web_form/personal_details/personal_details.js new file mode 100644 index 0000000..699703c --- /dev/null +++ b/church/church_people/web_form/personal_details/personal_details.js @@ -0,0 +1,3 @@ +frappe.ready(function() { + // bind events here +}) \ No newline at end of file diff --git a/church/church_people/web_form/personal_details/personal_details.json b/church/church_people/web_form/personal_details/personal_details.json new file mode 100644 index 0000000..02adb74 --- /dev/null +++ b/church/church_people/web_form/personal_details/personal_details.json @@ -0,0 +1,352 @@ +{ + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 1, + "anonymous": 0, + "apply_document_permissions": 1, + "button_label": "Save", + "condition_json": "[]", + "creation": "2025-11-19 00:10:47.226042", + "doc_type": "Church Person", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "is_standard": 1, + "list_columns": [ + { + "fieldname": "first_name", + "fieldtype": "Data", + "label": "First Name" + }, + { + "fieldname": "last_name", + "fieldtype": "Data", + "label": "Last Name" + }, + { + "fieldname": "gender", + "fieldtype": "Select", + "label": "Gender" + }, + { + "fieldname": "birthday", + "fieldtype": "Date", + "label": "Birthday" + }, + { + "fieldname": "photo", + "fieldtype": "Attach Image", + "label": "Photo" + }, + { + "fieldname": "alergies", + "fieldtype": "Data", + "label": "Alergies" + }, + { + "fieldname": "primary_phone", + "fieldtype": "Phone", + "label": "Primary Phone" + }, + { + "fieldname": "email", + "fieldtype": "Data", + "label": "Email" + }, + { + "fieldname": "home_address", + "fieldtype": "Link", + "label": "Home Address" + }, + { + "fieldname": "mailing_address", + "fieldtype": "Link", + "label": "Mailing Address" + } + ], + "list_title": "Your Personal Information", + "login_required": 1, + "max_attachment_size": 0, + "modified": "2025-12-18 23:45:41.183820", + "modified_by": "Administrator", + "module": "Church People", + "name": "personal-details", + "owner": "Administrator", + "published": 1, + "route": "personal-details", + "show_attachments": 0, + "show_list": 1, + "show_sidebar": 0, + "title": "Personal Details", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "fieldname": "personal_information_section", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Personal Information", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "First Name", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "last_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Last Name", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "Unknown", + "fieldname": "gender", + "fieldtype": "Select", + "hidden": 0, + "label": "Gender", + "max_length": 0, + "max_value": 0, + "options": "Female\nMale\nUnknown", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "column_break_agva", + "fieldtype": "Column Break", + "hidden": 0, + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "photo", + "fieldtype": "Attach Image", + "hidden": 0, + "label": "Photo", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "birthday", + "fieldtype": "Date", + "hidden": 0, + "label": "Birthday", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "alergies", + "fieldtype": "Data", + "hidden": 0, + "label": "Alergies", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "contact_information_section", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Contact Information", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "home_address", + "fieldtype": "Link", + "hidden": 0, + "label": "Home Address", + "max_length": 0, + "max_value": 0, + "options": "Address", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "mailing_address", + "fieldtype": "Link", + "hidden": 0, + "label": "Mailing Address", + "max_length": 0, + "max_value": 0, + "options": "Address", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "column_break_vzrz", + "fieldtype": "Column Break", + "hidden": 0, + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "primary_phone", + "fieldtype": "Phone", + "hidden": 0, + "label": "Primary Phone", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "email", + "fieldtype": "Data", + "hidden": 0, + "label": "Email", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "section_break_eqre", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Family Information", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "column_break_gwhd", + "fieldtype": "Column Break", + "hidden": 0, + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "is_married", + "fieldtype": "Check", + "hidden": 0, + "label": "Is Married", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "eval:doc.is_married;", + "fieldname": "anniversary", + "fieldtype": "Date", + "hidden": 0, + "label": "Anniversary", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "eval:doc.is_married;", + "fieldname": "spouse", + "fieldtype": "Link", + "hidden": 0, + "label": "Spouse", + "max_length": 0, + "max_value": 0, + "options": "Church Person", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "relationships", + "fieldtype": "Table", + "hidden": 0, + "label": "Notable Relationships", + "max_length": 0, + "max_value": 0, + "options": "Church Person Relation", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + } + ] +} \ No newline at end of file diff --git a/church/church_people/web_form/personal_details/personal_details.py b/church/church_people/web_form/personal_details/personal_details.py new file mode 100644 index 0000000..e1ada61 --- /dev/null +++ b/church/church_people/web_form/personal_details/personal_details.py @@ -0,0 +1,5 @@ +import frappe + +def get_context(context): + # do your magic here + pass diff --git a/church/church_prayers/web_form/prayer_request/prayer_request.json b/church/church_prayers/web_form/prayer_request/prayer_request.json index 173c30a..bc521ce 100644 --- a/church/church_prayers/web_form/prayer_request/prayer_request.json +++ b/church/church_prayers/web_form/prayer_request/prayer_request.json @@ -1,173 +1,174 @@ { - "allow_comments": 1, - "allow_delete": 1, - "allow_edit": 1, - "allow_incomplete": 0, - "allow_multiple": 1, - "allow_print": 1, - "anonymous": 0, - "apply_document_permissions": 0, - "button_label": "Save", - "condition_json": "[]", - "creation": "2025-09-13 22:28:01.939717", - "doc_type": "Church Prayer Request", - "docstatus": 0, - "doctype": "Web Form", - "idx": 0, - "introduction_text": "
Be anxious for nothing, but in everything, by prayer and petition, with thanksgiving, present your requests to God.
~ Philipians 4:6 (BSB)
Be anxious for nothing, but in everything, by prayer and petition, with thanksgiving, present your requests to God.
~ Philipians 4:6 (BSB)