From cd31046e2412348a5ea8992c4f5474be13ac3433 Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Thu, 16 Nov 2017 20:56:51 +0000 Subject: [PATCH] lp1642337 Boolean Filters in Reporter - Add condition check to see if filter is boolean, and if so, substitute a confirm dialog for the default prompt, repalcing the text input with buttons for True/False values. Signed-off-by: Kyle Huckins Signed-off-by: Jason Boyer Signed-off-by: Galen Charlton Signed-off-by: Dawn Dale --- .../ui/default/staff/reporter/template/app.js | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/reporter/template/app.js b/Open-ILS/web/js/ui/default/staff/reporter/template/app.js index c79a54bf37..4aeef637f8 100644 --- a/Open-ILS/web/js/ui/default/staff/reporter/template/app.js +++ b/Open-ILS/web/js/ui/default/staff/reporter/template/app.js @@ -497,11 +497,23 @@ function($scope , $q , $routeParams , $location , $timeout , $window, egCore , $scope.changeFilterValue = function (items) { items.forEach(function(item) { var l = null; - egPromptDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, item.value || '', - {ok : function(value) { - if (value) egReportTemplateSvc.filter_fields[item.index].value = value; - }} - ); + console.log(item); + if (item.datatype == "bool") { + egConfirmDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, item.value || '', + {ok : function() { + egReportTemplateSvc.filter_fields[item.index].value = true; + }, + cancel : function() { + egReportTemplateSvc.filter_fields[item.index].value = false; + }}, egCore.strings.TEMPLATE_CONF_TRUE, egCore.strings.TEMPLATE_CONF_FALSE + ); + } else { + egPromptDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, item.value || '', + {ok : function(value) { + if (value) egReportTemplateSvc.filter_fields[item.index].value = value; + }} + ); + } }); fgrid.refresh(); } -- 2.43.2