Skip to content

Commit

Permalink
Expose service locations on tab in RW
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Nov 12, 2015
1 parent e968f51 commit 01e6ee7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
nursix-1.1.0-devel-3072-gcd5da74 (2015-11-12 13:11:03)
nursix-1.1.0-devel-3073-ge968f51 (2015-11-12 13:11:05)
6 changes: 6 additions & 0 deletions modules/s3cfg.py
Expand Up @@ -3163,6 +3163,12 @@ def get_org_services_hierarchical(self):
"""
return self.org.get("services_hierarchical", False)

def get_org_service_locations(self):
"""
Whether to expose the service locations tab for organisations
"""
return self.__lazy("org", "service_locations", default=False)

def get_org_site_code_len(self):
"""
Length of auto-generated Codes for Facilities (org_site)
Expand Down
10 changes: 7 additions & 3 deletions modules/s3db/org.py
Expand Up @@ -675,6 +675,8 @@ def model(self):
"key": "service_id",
"actuate": "hide",
},
# Service Locations
org_service_location = "organisation_id",
# Format for filter_widget
org_service_organisation = "organisation_id",
# Assets
Expand Down Expand Up @@ -2647,7 +2649,7 @@ def model(self):
"status",
"comments",
)

# List fields
list_fields = ["organisation_id",
"site_id",
Expand Down Expand Up @@ -2684,7 +2686,7 @@ def model(self):
"org_service_location.id",
),
)


# ---------------------------------------------------------------------
# Service types at service location
Expand All @@ -2696,7 +2698,7 @@ def model(self):
#s3_comments(),
*s3_meta_fields()
)

# ---------------------------------------------------------------------
# Pass names back to global scope (s3.*)
#
Expand Down Expand Up @@ -5725,6 +5727,8 @@ def org_rheader(r, tabs=[]):
append_tab((T("Tags"), "tag"))
if settings.get_org_resources_tab():
tabs.insert(-1, (T("Resources"), "resource"))
if settings.get_org_service_locations():
tabs.insert(-1, (T("Service Locations"), "service_location"))

if settings.get_L10n_translate_org_organisation():
tabs.insert(1, (T("Local Names"), "name"))
Expand Down
2 changes: 2 additions & 0 deletions modules/templates/RW/config.py
Expand Up @@ -141,6 +141,7 @@ def config(settings):
# -------------------------------------------------------------------------
# Organisations
settings.org.tags = True
settings.org.service_locations = True

# -------------------------------------------------------------------------
# Project Module
Expand Down Expand Up @@ -422,6 +423,7 @@ def customise_org_organisation_resource(r, tablename):
def customise_org_organisation_controller(**attr):

tabs = [(T("Basic Details"), None),
(T("Service Locations"), "service_location"),
(T("Needs"), "needs"),
(T("Facilities"), "facility"),
(T("Warehouses"), "warehouse"),
Expand Down

0 comments on commit 01e6ee7

Please sign in to comment.