Project

General

Profile

Revision adb0e63f

IDadb0e63f95b878d4c10d1a77e1402d1cb8aefba2
Parent 916e4b79
Child b8e1cd40

Added by Francois POIROTTE about 13 years ago

Pb de navigation après recherche sur priorité.

Corrige un problème dans la navigation lorsqu'on effectue une recherche sur la priorité de l'événement.

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@6676 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigiboard/controllers/root.py
154 154
        for plugin, instance in config.get('columns_plugins', []):
155 155
            instance.handle_search_fields(aggregates, search)
156 156

  
157
        # Certains arguments sont réservés dans url_for().
157
        # Certains arguments sont réservés dans routes.util.url_for().
158 158
        # On effectue les substitutions adéquates.
159 159
        # Par exemple: "host" devient "host_".
160
        reserved = ('host', )
161
        copy = search.copy()
162
        for column in copy:
160
        reserved = ('host', 'anchor', 'protocol', 'qualified')
161
        for column in search.copy():
163 162
            if column in reserved:
164 163
                search[column + '_'] = search[column]
165 164
                del search[column]
166 165

  
166
        # On ne garde que les champs effectivement renseignés.
167
        for column in search.copy():
168
            if not search[column]:
169
                del search[column]
170

  
171
        # On sérialise les champs de type dict.
172
        def serialize_dict(dct, key):
173
            if isinstance(dct[key], dict):
174
                for subkey in dct[key]:
175
                    serialize_dict(dct[key], subkey)
176
                    dct[key+'.'+subkey] = dct[key][subkey]
177
                del dct[key]
178
        fixed_search = search.copy()
179
        for column in fixed_search.copy():
180
            serialize_dict(fixed_search, column)
181

  
167 182
        # Pagination des résultats
168 183
        aggregates.generate_request()
169 184
        items_per_page = int(config['vigiboard_items_per_page'])
......
197 212
            event_edit_status_options = edit_event_status_options,
198 213
            search_form = create_search_form,
199 214
            search = search,
215
            fixed_search = fixed_search,
200 216
        )
201 217

  
202 218

  
......
276 292
            page = page,
277 293
            search_form = create_search_form,
278 294
            search = {},
295
            fixed_search = {},
279 296
        )
280 297

  
281 298

  
......
338 355
            page = page,
339 356
            search_form = create_search_form,
340 357
            search = {},
358
            fixed_search = {},
341 359
        )
342 360

  
343 361

  
......
410 428
            event_edit_status_options = edit_event_status_options,
411 429
            search_form = create_search_form,
412 430
            search = {},
431
            fixed_search = {},
413 432
        )
414 433

  
415 434

  

Also available in: Unified diff