From d8393cec18f857853ba58ffb91fc3fc425a699de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20K=C3=B6nig?= Date: Mon, 27 May 2019 21:42:28 +0200 Subject: [PATCH] DRKCM: option to filter response actions by staff member --- VERSION | 2 +- languages/de.py | 3 ++- modules/templates/DRKCM/config.py | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 5bdde1e0ee..4dbcda6d98 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -nursix-dev-2871-g78c4892 (2019-05-23 20:27:37) +nursix-dev-2872-g8f0b3ca (2019-05-27 21:42:28) diff --git a/languages/de.py b/languages/de.py index fc0041a5a8..940d345e51 100644 --- a/languages/de.py +++ b/languages/de.py @@ -871,6 +871,7 @@ 'City': 'Ort/Stadt', 'Civil Emergency': 'Ziviler Notfall', 'Cladding, glazing': 'Verkleidung, Verglasung', +'Clear All': 'Alle entfernen', 'Clear Filter': 'Filter zurücksetzen', 'Clear': 'Löschen', 'Click on the link %(url)s to reset your password': 'Klicken sie auf den Link %(url)s um ihr Kennwort zurückzusetzen', @@ -4442,7 +4443,7 @@ 'Seized Item updated': 'Beschlagnahmung aktualisiert', 'Seized Items': 'Beschlagnahmte Gegenstände', 'Select %(location)s': 'Auswahl %(location)s', -'Select All': 'Alles auswählen', +'Select All': 'Alle auswählen', 'Select Items from the Request': 'Wählen sie Artikel aus der Anfrage', 'Select Items from this Inventory': 'Wählen sie Artikel aus diesem Bestand', 'Select Land': 'Land auswählen', diff --git a/modules/templates/DRKCM/config.py b/modules/templates/DRKCM/config.py index 1f178b0399..be0c7980b0 100644 --- a/modules/templates/DRKCM/config.py +++ b/modules/templates/DRKCM/config.py @@ -2787,6 +2787,11 @@ def customise_dvr_response_action_resource(r, tablename): field.default = current.auth.s3_logged_in_human_resource() field.represent = s3db.hrm_HumanResourceRepresent(show_link=False) field.widget = None + # Use field options as filter options + try: + hr_filter_opts = field.requires.options() + except AttributeError: + hr_filter_opts = False # Require explicit unit in hours-widget above 4 hours from s3 import S3HoursWidget @@ -2950,6 +2955,7 @@ def customise_dvr_response_action_resource(r, tablename): S3DateFilter("date", hidden=not is_report), S3OptionsFilter( "response_theme_ids", + header = True, hidden = True, options = lambda: \ s3_get_filter_opts("dvr_response_theme", @@ -2968,8 +2974,16 @@ def customise_dvr_response_action_resource(r, tablename): if use_due_date: filter_widgets.insert(3, S3DateFilter("date_due", - hidden=is_report, + hidden = is_report, )) + if hr_filter_opts: + hr_filter_opts = dict(hr_filter_opts) + hr_filter_opts.pop('', None) + filter_widgets.insert(-2, S3OptionsFilter("human_resource_id", + hidden = True, + options = dict(hr_filter_opts), + header = True, + )) if multiple_orgs: # Add case organisation filter