Project

General

Profile

Souhaits #907 » advanced_search.tpl.diff

Alain Castera, 03/12/2019 05:12 PM

View differences:

advanced_search.tpl 2019-03-11 21:21:40.000000000 +0100
25 25
                            {html_options options=$filter_accounts_options selected=$filters->account_status_filter}
26 26
                        </select>
27 27
                    </p>
28
{** modification for multiple groups search : no needs for a single group search
28 29
                    <p>
29 30
                        <label class="bline" for="group_filter">{_T string="Member of group"}</label>
30 31
                        <select name="group_filter">
......
33 34
                            <option value="{$group->getId()}"{if $filters->group_filter eq $group->getId()} selected="selected"{/if}>{$group->getName()}</option>
34 35
{/foreach}
35 36
                        </select>
37
*}
36 38
                    <p>
37 39
                        <span class="bline">{_T string="With mail:"}</span>
38 40
                        <input type="radio" name="email_filter" id="filter_dc_email" value="{Galette\Repository\Members::FILTER_DC_EMAIL}"{if $filters->email_filter eq constant('Galette\Repository\Members::FILTER_DC_EMAIL')} checked="checked"{/if}>
......
44 46
                    </p>
45 47
                </div>
46 48
            </fieldset>
49
{** modification for multiple groups search *}
50
            <fieldset class="cssform large">
51
                <legend class="ui-state-active ui-corner-top">{_T string="Groups search"}
52
                    <a
53
                        href="#"
54
                        id="addbutton_g"
55
                        class="tab-button tooltip"
56
                    >
57
                        <i class="fas fa-plus-square"></i>
58
                        <span class="sr-only">{_T string="Add new group search criteria"}</span>
59
                    </a>
60
                </legend>
61
                <select name="groups_logical_operator" class="operator_selector">
62
                  <option value="{Galette\Filters\AdvancedMembersList::OP_AND}"{if $filters->groups_search_log_op eq constant('Galette\Filters\AdvancedMembersList::OP_AND')} selected="selected"{/if}>{_T string="Dans TOUS ces groupes"}</option>
63
                  <option value="{Galette\Filters\AdvancedMembersList::OP_OR}"{if $filters->groups_search_log_op eq constant('Galette\Filters\AdvancedMembersList::OP_OR')} selected="selected"{/if}>{_T string="Dans au moins un de ces groupes"}</option>
64
                </select>
65
                <ul id="gs_sortable" class="fields_list connectedSortable">
66
                {foreach from=$filters->groups_search item=gs}
67
                         <li>
68
                                <select name="groups_search[]" >
69
                                        <option value="">{_T string="Select a group"}</option>
70
                                        {foreach from=$filter_groups_options item=group}
71
                                        <option value="{$group->getId()}"{if $gs.group eq $group->getId()} selected="selected"{/if}>{$group->getName()}</option>
72
                                        {/foreach}
73
                                </select>
74
                        <a
75
                            href="#"
76
                            class="fright tooltip delete delcriteria"
77
                        >
78
                            <i class="fas fa-trash-alt"></i>
79
                            <span class="sr-only">{_T string="Remove criteria"}</span>
80
                        </a>
81
                        </li>
82
                 {/foreach}
83
                 </ul>
84

  
85
            </fieldset>	
86
{** end multiple groups search *}
47 87
            <fieldset class="cssform large">
48 88
                <legend class="ui-state-active ui-corner-top">{_T string="Advanced search"}</legend>
49 89
                <div>
......
382 422
                    return false;
383 423
                });
384 424

  
425
{** modification for multiple groups search *}
426
               $('#addbutton_g').click(function(){
427
                    var _ul = $('#gs_sortable');
428
                    var _new = _ul.find('li').last().clone(true);
429
                    _newFilter(_new);
430
                    _rmFilter(_new);
431
                    _ul.append(_new);
432
                    _fieldsInSortable();
433
                    return false;
434
                });
435
{** end of modification for multiple groups search *}
436

  
385 437
                $('.field_selector').change(function () {
386 438
                    var _field_id = $(this).val();
387 439
                    var _field    = _fields[_field_id];
(9-9/11)