From a1335e2feaa0340da50658e5761b668727ab0445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20K=C3=B6nig?= Date: Fri, 28 Jan 2022 11:12:02 +0100 Subject: [PATCH] RLPPTM: allow OrgGroupAdmins to filter by OrgID resp. facility code --- VERSION | 2 +- modules/templates/RLPPTM/customise/org.py | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index 7006a91592..f80cf68991 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -nursix-dev-5288-g8a3b71385 (2022-01-28 09:48:22) +nursix-dev-5291-g8fe017c00 (2022-01-28 11:12:02) diff --git a/modules/templates/RLPPTM/customise/org.py b/modules/templates/RLPPTM/customise/org.py index bcc8416914..1b3dacc85c 100644 --- a/modules/templates/RLPPTM/customise/org.py +++ b/modules/templates/RLPPTM/customise/org.py @@ -25,6 +25,11 @@ def add_org_tags(): "filterby": {"tag": "DELIVERY"}, "multiple": False, }, + {"name": "orgid", + "joinby": "organisation_id", + "filterby": {"tag": "OrgID"}, + "multiple": False, + }, ), ) @@ -222,7 +227,7 @@ def prep(r): # Filters text_fields = ["name", "acronym", "website", "phone"] if is_org_group_admin: - text_fields.append("email.value") + text_fields.extend(["email.value", "orgid.value"]) filter_widgets = [TextFilter(text_fields, label = T("Search"), ), @@ -777,13 +782,16 @@ def org_facility_resource(r, tablename): s3db.configure(tablename, list_fields=list_fields) # Custom filter widgets + text_fields = ["name", + "location_id$L2", + "location_id$L3", + "location_id$L4", + "location_id$addr_postcode", + ] + if is_org_group_admin: + text_fields.append("code") filter_widgets = [ - TextFilter(["name", - "location_id$L2", - "location_id$L3", - "location_id$L4", - "location_id$addr_postcode", - ], + TextFilter(text_fields, label = T("Search"), ), LocationFilter("location_id",