Skip to content

Commit

Permalink
RLPPTM: allow OrgGroupAdmins to filter by OrgID resp. facility code
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Jan 28, 2022
1 parent 8fe017c commit a1335e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nursix-dev-5288-g8a3b71385 (2022-01-28 09:48:22)
nursix-dev-5291-g8fe017c00 (2022-01-28 11:12:02)
22 changes: 15 additions & 7 deletions modules/templates/RLPPTM/customise/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def add_org_tags():
"filterby": {"tag": "DELIVERY"},
"multiple": False,
},
{"name": "orgid",
"joinby": "organisation_id",
"filterby": {"tag": "OrgID"},
"multiple": False,
},
),
)

Expand Down Expand Up @@ -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"),
),
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit a1335e2

Please sign in to comment.