Plugin personal filter, don't see the parameters of the operator

Added by Stéphane CHÂTEAU almost 2 years ago

I create a plugin to be able to find an issue state change between two dates.
The plugin works, I know how to request in database (looking into the journal tables).

In issue_query_patch.rb I add avalaible filter like:
#
# initialize_available_filters
#
def initialize_available_filters_with_state_change_to
initialize_available_filters_without_state_change_to

# Ajouter entre sinon on ne peut pas mettre 3 paramètres
operators["state_changed_between"] = :label_between
operators_by_filter_type[:state_change_to] = ["state_changed_between"]

# Ajouter le filtre state_change_to de type state_change_to
add_available_filter('state_change_to', type: :state_change_to)
end

I know how to decode values, create html fields, pass args between javascript and ruby.

but... (I think the reply is really simple !)
How to tell to redmine / ruby how many parameters are used with the filter / operator?
I should have 3 parameters: date begin / date end / status and I only see one.

If I use '><' operator (between) I can see the 3 parameters but when I uncheck filter, only the 2 first parameters are hidden not the last. And when it decode, the order is not the same (it compute with status / date begin / date end) giving bad error messages if some parameters are not filled (or bad filled).

What is the link between filters / operators / and parameter's operators and id into the HTML (values_xxxx_id_1 / values_xxxx_id_2 / values_xxxx_id_3 / ...)
I read the source code, I didn't understand.

Please help me, 2 days lots just for this thing!

Best regards.

GeoMaps.zip - Plugin (9.4 KB)

Replies (1)

RE: Plugin personal filter, don't see the parameters of the operator - Added by Stéphane CHÂTEAU almost 2 years ago

SOS, please help me, I think it's not so difficult for peaple who know how this framework work.
Thanks.

(1-1/1)