Skip to content

Commit

Permalink
DRKCM: option to filter response actions by staff member
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed May 27, 2019
1 parent 8f0b3ca commit d8393ce
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nursix-dev-2871-g78c4892 (2019-05-23 20:27:37)
nursix-dev-2872-g8f0b3ca (2019-05-27 21:42:28)
3 changes: 2 additions & 1 deletion languages/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
16 changes: 15 additions & 1 deletion modules/templates/DRKCM/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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
Expand Down

0 comments on commit d8393ce

Please sign in to comment.