diff --git a/church/church_foundations/workspace/manual:_website/manual:_website.json b/church/church_foundations/workspace/manual:_website/manual:_website.json
index 7caeeec..2811ea1 100644
--- a/church/church_foundations/workspace/manual:_website/manual:_website.json
+++ b/church/church_foundations/workspace/manual:_website/manual:_website.json
@@ -1,6 +1,6 @@
{
"charts": [],
- "content": "[{\"id\":\"nnvMTG5Sl5\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83c\udf10Website Manual\",\"col\":12}},{\"id\":\"B-CtTCmVDX\",\"type\":\"paragraph\",\"data\":{\"text\":\"The website module manages and configures a public facing website for the church using data from other modules (i.e. Foundations, Missions, Ministries, etc).\",\"col\":12}},{\"id\":\"8qBfIl0adi\",\"type\":\"paragraph\",\"data\":{\"text\":\"Various information in the system (i.e. Beliefs, Missionaries, Ministries, etc), may be used to populate the public facing website.\",\"col\":12}},{\"id\":\"kHbqzTGDhX\",\"type\":\"paragraph\",\"data\":{\"text\":\"The website 'feature' has not been fully developed but is on the roadmap.\",\"col\":12}}]",
+ "content": "[{\"id\":\"nnvMTG5Sl5\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83c\udf10Website Manual\",\"col\":12}},{\"id\":\"B-CtTCmVDX\",\"type\":\"paragraph\",\"data\":{\"text\":\"The website module consists of two main features: a public website, and a user portal.\",\"col\":12}},{\"id\":\"kHbqzTGDhX\",\"type\":\"paragraph\",\"data\":{\"text\":\"\u26a0\ufe0f The website and portal 'features' have not been fully developed but the features are on the roadmap.\",\"col\":12}},{\"id\":\"fAFxFk8rny\",\"type\":\"header\",\"data\":{\"text\":\"\ud83c\udf0eWebsite\",\"col\":12}},{\"id\":\"WCW6FzkHwB\",\"type\":\"paragraph\",\"data\":{\"text\":\"The public facing website is accessible by anyone and can be dynamically updated based on information in the Church App (i.e. Beliefs, Missionaries, Ministries, etc).
User accounts with \\\"Church Manager\\\" permissions can modify the website.
No user account is required to view the website - anyone with an internet connection and a web browser can view the public website.\",\"col\":12}},{\"id\":\"nZdduTPzRH\",\"type\":\"header\",\"data\":{\"text\":\"\ud83d\udc64User Portal\",\"col\":12}},{\"id\":\"8qBfIl0adi\",\"type\":\"paragraph\",\"data\":{\"text\":\"The user portal requires login credentials and provides users a personalized interface for accessing church information (i.e. Personal Profile, Prayer Requests, Alms Requests, etc).
Portal users cannot access all information in the Church App, they can only access information related to their 'Church Person', or information shared with them (i.e. non-private prayer requests).\",\"col\":12}}]",
"creation": "2025-10-26 22:57:00.373845",
"custom_blocks": [],
"docstatus": 0,
@@ -13,7 +13,7 @@
"is_hidden": 0,
"label": "Manual: Website",
"links": [],
- "modified": "2025-11-02 01:31:42.840957",
+ "modified": "2026-02-02 23:18:28.432425",
"modified_by": "Administrator",
"module": "Church Foundations",
"name": "Manual: Website",
diff --git a/church/church_people/doctype/church_person/church_person.js b/church/church_people/doctype/church_person/church_person.js
index 80e4084..6c0c536 100644
--- a/church/church_people/doctype/church_person/church_person.js
+++ b/church/church_people/doctype/church_person/church_person.js
@@ -8,11 +8,20 @@ frappe.ui.form.on("Church Person", {
frm.add_custom_button(__('New Family From Person'), function () {
frm.call("new_family_from_person")
})
- };
+ }
+
+ // Add 'Invite to Portal' button if email is provided and no Portal User is linked
+ if (frm.doc.email && !frm.doc.portal_user) {
+ frm.add_custom_button(__('Invite to Portal'), function () {
+ frm.call("invite_to_portal")
+ });
+ }
+
// Add 'Church Person Tour' button
frm.add_custom_button(__('Tutorial'), function () {
frm.tour.init("Church Person").then(() => frm.tour.start());
});
+
},
after_save(frm) {
@@ -20,5 +29,3 @@ frappe.ui.form.on("Church Person", {
},
});
-
-
diff --git a/church/church_people/doctype/church_person/church_person.json b/church/church_people/doctype/church_person/church_person.json
index bcbd074..4cad6f4 100644
--- a/church/church_people/doctype/church_person/church_person.json
+++ b/church/church_people/doctype/church_person/church_person.json
@@ -18,7 +18,7 @@
"photo",
"birthday",
"alergies",
- "app_user",
+ "portal_user",
"church_records_section",
"is_member",
"membership_date",
@@ -296,9 +296,9 @@
"print_hide": 1
},
{
- "fieldname": "app_user",
+ "fieldname": "portal_user",
"fieldtype": "Link",
- "label": "App User",
+ "label": "Portal User",
"options": "User"
}
],
@@ -327,7 +327,7 @@
"link_fieldname": "recipient"
}
],
- "modified": "2025-12-18 23:37:10.065945",
+ "modified": "2026-02-02 22:55:22.764479",
"modified_by": "Administrator",
"module": "Church People",
"name": "Church Person",
diff --git a/church/church_people/doctype/church_person/church_person.py b/church/church_people/doctype/church_person/church_person.py
index 8b36da3..45ea7d3 100644
--- a/church/church_people/doctype/church_person/church_person.py
+++ b/church/church_people/doctype/church_person/church_person.py
@@ -122,10 +122,41 @@ class ChurchPerson(Document):
else:
role.is_current_role = 0
+ @frappe.whitelist()
+ def invite_to_portal(self):
+ # Check if user already exists with this email
+ user = frappe.db.exists("User", {"email": self.email})
+
+ if not user:
+ # Create a new portal user
+ new_user = frappe.new_doc("User")
+ new_user.email = self.email
+ new_user.first_name = self.first_name
+ new_user.last_name = self.last_name
+ new_user.send_welcome_email = 1
+ new_user.enabled = 1
+ new_user.role_profile_name = "Church User"
+ new_user.save(ignore_permissions=True)
+
+ # Update Church Person to mark as portal user
+ self.portal_user = new_user.name
+ self.save(ignore_permissions=True)
+
+ frappe.msgprint(
+ f"👤 Portal user created and linked: {self.full_name}"
+ )
+ else:
+ # User already exists, just update the portal_user field
+ self.portal_user = user
+ self.save(ignore_permissions=True)
+ frappe.msgprint(
+ f"⚠️ Portal user {user} already exists. User is now linked to this person."
+ )
+
def get_list_context(context):
# Only show documents related to the active user
- context.filters = {"app_user": frappe.session.user}
+ context.filters = {"portal_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/workspace/manual:_people/manual:_people.json b/church/church_people/workspace/manual:_people/manual:_people.json
index abaaeb9..19d3c8a 100644
--- a/church/church_people/workspace/manual:_people/manual:_people.json
+++ b/church/church_people/workspace/manual:_people/manual:_people.json
@@ -1,6 +1,6 @@
{
"charts": [],
- "content": "[{\"id\":\"nnvMTG5Sl5\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83d\udc65People Manual\",\"col\":12}},{\"id\":\"B-CtTCmVDX\",\"type\":\"paragraph\",\"data\":{\"text\":\"The people module contains features relating to the people of the church (i.e. Members, Families, Leadership. etc).\",\"col\":12}},{\"id\":\"Htx875Wd1w\",\"type\":\"paragraph\",\"data\":{\"text\":\"The People workspace contains number cards and graphs indicating the current count of people/families/members. there are also links to various reports (Birthdays, Roles, Letters, etc).\",\"col\":12}},{\"id\":\"qI9ZNpJJX4\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83d\udc64Person\",\"col\":12}},{\"id\":\"RZThk3_x4O\",\"type\":\"paragraph\",\"data\":{\"text\":\"Church people include guests, members, leadership, and other people who interact or are associated with the church.\",\"col\":12}},{\"id\":\"UJEDTpYJIM\",\"type\":\"paragraph\",\"data\":{\"text\":\"When adding a person, note the following:
- Church membership and baptism status can be indicated.
- If needed, additional member status types can be created.
- If the person has any roles in the church, they should be indicated in the 'Church Roles' section.
- If a role type does not exist, you can create new role types as needed.
- Photos should be added for members. The photos will be used in a member directory in a future versions.
- Letters from this person can be added in the 'Contact' tab
- If a family has been selected, the person will be displayed in the \\\"Family Members\\\" section on the `Church Family` form.
- Family relationships can be defined in the 'Family' tab.
- When a spouse is added, the spouse's document will also be updated accordingly.
- Additional relationships can be defined in the 'Notable Relationships' section - these relationships are not auto-updated on the other person's document.
- A Family can be automatically created from a person by clicking the 'New Family From Person' button. This requires a 'Last Name' to be set, and will set the person as the Family's head-of-household.\",\"col\":12}},{\"id\":\"0a0Yfbfao3\",\"type\":\"paragraph\",\"data\":{\"text\":\"Person/Member Directory\",\"col\":12}},{\"id\":\"aIL5EgTGiJ\",\"type\":\"paragraph\",\"data\":{\"text\":\"To generate a Church Directory:
1. Navigate to the church person list.
2. (Optionally) Check the Is Member filter to only show members.
3. Select all the people by checking the top left checkbox in the list.
4. Click the Actions button and choose Print.
5. Select your print options and click Print to generate a member directory pdf file.
- Tip: To make each person page smaller when printing the pdf, you can use the print multiple pages per sheet option in your system print dialog (if your system supports this feature).\",\"col\":12}},{\"id\":\"A37CU_rUFj\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66Family\",\"col\":12}},{\"id\":\"_wxytNqTX4\",\"type\":\"paragraph\",\"data\":{\"text\":\"Families are groups of people who are related.\",\"col\":12}},{\"id\":\"qQr_8PsoeH\",\"type\":\"paragraph\",\"data\":{\"text\":\"When adding a family, note the following:
- After adding a family, you may want to link people to the family. When a person is linked to a family, that person will be displayed in the \\\"Family Members\\\" list.
- Only one person can be set as the head of household. To set the head-of-household, go to the person's document and check 'Is Head of Household' on the 'Family' tab.
\",\"col\":12}}]",
+ "content": "[{\"id\":\"nnvMTG5Sl5\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83d\udc65People Manual\",\"col\":12}},{\"id\":\"B-CtTCmVDX\",\"type\":\"paragraph\",\"data\":{\"text\":\"The people module contains features relating to the people of the church (i.e. Members, Families, Leadership. etc).\",\"col\":12}},{\"id\":\"Htx875Wd1w\",\"type\":\"paragraph\",\"data\":{\"text\":\"The People workspace contains number cards and graphs indicating the current count of people/families/members. there are also links to various reports (Birthdays, Roles, Letters, etc).\",\"col\":12}},{\"id\":\"qI9ZNpJJX4\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83d\udc64Person\",\"col\":12}},{\"id\":\"RZThk3_x4O\",\"type\":\"paragraph\",\"data\":{\"text\":\"Church people include guests, members, leadership, and other people who interact or are associated with the church.\",\"col\":12}},{\"id\":\"UJEDTpYJIM\",\"type\":\"paragraph\",\"data\":{\"text\":\"When adding a person, note the following:
- Church membership and baptism status can be indicated.
- If needed, additional member status types can be created.
- If the person has any roles in the church, they should be indicated in the 'Church Roles' section.
- If a role type does not exist, you can create new role types as needed.
- Photos should be added for members. The photos will be used in a member directory in a future versions.
- Letters from this person can be added in the 'Contact' tab
- If a family has been selected, the person will be displayed in the \\\"Family Members\\\" section on the `Church Family` form.
- Family relationships can be defined in the 'Family' tab.
- When a spouse is added, the spouse's document will also be updated accordingly.
- Additional relationships can be defined in the 'Notable Relationships' section - these relationships are not auto-updated on the other person's document.
- A Family can be automatically created from a person by clicking the 'New Family From Person' button. This requires a 'Last Name' to be set, and will set the person as the Family's head-of-household.\",\"col\":12}},{\"id\":\"IqJm62Jfo2\",\"type\":\"paragraph\",\"data\":{\"text\":\"To give a person access to the Church App Portal, the church person must have an associated email address.
Click the \\\"Invite to Portal\\\" button on the 'Church Person' form to create and associate a new user with the 'Church Person'.
- The user will be created with 'Church User' permissions and linked with the 'Church Person' (This should give the user access to their own information as well as information that is shared with them).
- The user should receive an invitation/welcome email (assuming email settings have been setup correctly).\",\"col\":12}},{\"id\":\"0a0Yfbfao3\",\"type\":\"paragraph\",\"data\":{\"text\":\"Person/Member Directory\",\"col\":12}},{\"id\":\"aIL5EgTGiJ\",\"type\":\"paragraph\",\"data\":{\"text\":\"To generate a Church Directory:
1. Navigate to the church person list.
2. (Optionally) Check the Is Member filter to only show members.
3. Select all the people by checking the top left checkbox in the list.
4. Click the Actions button and choose Print.
5. Select your print options and click Print to generate a member directory pdf file.
- Tip: To make each person page smaller when printing the pdf, you can use the print multiple pages per sheet option in your system print dialog (if your system supports this feature).\",\"col\":12}},{\"id\":\"A37CU_rUFj\",\"type\":\"paragraph\",\"data\":{\"text\":\"\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66Family\",\"col\":12}},{\"id\":\"_wxytNqTX4\",\"type\":\"paragraph\",\"data\":{\"text\":\"Families are groups of people who are related.\",\"col\":12}},{\"id\":\"qQr_8PsoeH\",\"type\":\"paragraph\",\"data\":{\"text\":\"When adding a family, note the following:
- After adding a family, you may want to link people to the family. When a person is linked to a family, that person will be displayed in the \\\"Family Members\\\" list.
- Only one person can be set as the head of household. To set the head-of-household, go to the person's document and check 'Is Head of Household' on the 'Family' tab.
\",\"col\":12}}]",
"creation": "2025-10-26 22:59:15.251142",
"custom_blocks": [],
"docstatus": 0,
@@ -13,7 +13,7 @@
"is_hidden": 0,
"label": "Manual: People",
"links": [],
- "modified": "2025-12-20 01:52:41.918887",
+ "modified": "2026-02-02 23:53:05.514800",
"modified_by": "Administrator",
"module": "Church People",
"name": "Manual: People",