View | Details | Raw Unified | Return to bug 34479
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (-23 / +4 lines)
Lines 155-160 Link Here
155
                    <div class="modal-footer">
155
                    <div class="modal-footer">
156
                        <button type="submit" id="add_to_patron_list_submit" class="btn btn-default approve">Submit</button>
156
                        <button type="submit" id="add_to_patron_list_submit" class="btn btn-default approve">Submit</button>
157
                        <button type="button" class="btn btn-default deny" data-dismiss="modal">Cancel</button>
157
                        <button type="button" class="btn btn-default deny" data-dismiss="modal">Cancel</button>
158
                        [% PROCESS 'members-patron-selections.inc' id="new-patron-list_form" %]
158
                    </div> <!-- /.modal-footer -->
159
                    </div> <!-- /.modal-footer -->
159
                </form> <!-- /#new-patron-list_form -->
160
                </form> <!-- /#new-patron-list_form -->
160
            </div> <!-- /.modal-content -->
161
            </div> <!-- /.modal-content -->
Lines 166-177 Link Here
166
    [% INCLUDE 'columns_settings.inc' %]
167
    [% INCLUDE 'columns_settings.inc' %]
167
    [% INCLUDE 'str/members-menu.inc' %]
168
    [% INCLUDE 'str/members-menu.inc' %]
168
    [% Asset.js("js/members-menu.js") | $raw %]
169
    [% Asset.js("js/members-menu.js") | $raw %]
170
    [% Asset.js("js/members-patron-selections.js") | $raw %]
169
    [% INCLUDE 'select2.inc' %]
171
    [% INCLUDE 'select2.inc' %]
170
    <script>
172
    <script>
171
        function showPatronSelections( number ){
172
            $("#table_search_selections").show().find("span").text(_("Patrons selected: " + number ) );
173
        }
174
175
        $(document).ready(function() {
173
        $(document).ready(function() {
176
            $('#merge-patrons, #batch-mod-patrons').prop('disabled', true);
174
            $('#merge-patrons, #batch-mod-patrons').prop('disabled', true);
177
            $('#memberresultst').on('change', 'input.selection', function() {
175
            $('#memberresultst').on('change', 'input.selection', function() {
Lines 335-340 Link Here
335
                            /* Add a new entry to the menu */
333
                            /* Add a new entry to the menu */
336
                            $("#patronlist-dropdown .divider").before('<li><a class="patron-list-add" href="#" data-listid="' + data.patron_list.patron_list_id + '">' + data.patron_list.name + '</li>');
334
                            $("#patronlist-dropdown .divider").before('<li><a class="patron-list-add" href="#" data-listid="' + data.patron_list.patron_list_id + '">' + data.patron_list.name + '</li>');
337
                        }
335
                        }
336
                        persistPatronSelections('new-patron-list_form');
337
                        prepSelections();
338
                    },
338
                    },
339
                    error: function() {
339
                    error: function() {
340
                        alert( _("An error occurred. Patron list could not be updated.") );
340
                        alert( _("An error occurred. Patron list could not be updated.") );
Lines 347-371 Link Here
347
            }
347
            }
348
        }
348
        }
349
349
350
        function prepSelections(){
351
            var selected_patrons = JSON.parse( localStorage.getItem("patron_search_selections") );
352
            if( selected_patrons && selected_patrons.length > 0 ){
353
                showPatronSelections( selected_patrons.length );
354
355
                $('#merge-patrons').prop('disabled', true);
356
                $("input.selection").each(function(){
357
                    var cardnumber = $(this).val();
358
                    if( selected_patrons.indexOf( cardnumber ) >= 0 ){
359
                        $(this).prop("checked", true );
360
                    }
361
                });
362
363
                if( selected_patrons.length > 1 ){
364
                    $('#batch-mod-patrons, #merge-patrons, #patronlist-menu').removeClass("disabled").prop('disabled', false);
365
                }
366
            }
367
        }
368
369
        $('#memberresultst tbody').on('click','td',function(e){
350
        $('#memberresultst tbody').on('click','td',function(e){
370
            var $checkbox = $(this).find("input[type=checkbox]");
351
            var $checkbox = $(this).find("input[type=checkbox]");
371
            if (e.target.type != "checkbox") {
352
            if (e.target.type != "checkbox") {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt (+2 lines)
Lines 158-163 Link Here
158
                            [% END %]
158
                            [% END %]
159
                            <input type="hidden" name="action" value="merge" />
159
                            <input type="hidden" name="action" value="merge" />
160
                            <input type="submit" id="merge-patrons" class="btn btn-primary" value="Merge patrons" />
160
                            <input type="submit" id="merge-patrons" class="btn btn-primary" value="Merge patrons" />
161
                            [% PROCESS 'members-patron-selections.inc' id="patron-merge-form" %]
161
                        </fieldset>
162
                        </fieldset>
162
163
163
                    [% ELSE %]
164
                    [% ELSE %]
Lines 296-301 Link Here
296
[% MACRO jsinclude BLOCK %]
297
[% MACRO jsinclude BLOCK %]
297
    [% INCLUDE 'str/members-menu.inc' %]
298
    [% INCLUDE 'str/members-menu.inc' %]
298
    [% Asset.js("js/members-menu.js") | $raw %]
299
    [% Asset.js("js/members-menu.js") | $raw %]
300
    [% Asset.js("js/members-patron-selections.js") | $raw %]
299
    [% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %]
301
    [% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %]
300
    <script>
302
    <script>
301
    $(document).ready(function() {
303
    $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-2 / +3 lines)
Lines 219-225 Link Here
219
                    [% END %]
219
                    [% END %]
220
220
221
                    [% IF ( op == 'show' ) %]
221
                    [% IF ( op == 'show' ) %]
222
                    <form name="f" action="modborrowers.pl" method="post">
222
                    <form name="f" action="modborrowers.pl" method="post" id="batchmod-borrowers-form">
223
                        <input type="hidden" name="op" value="do" />
223
                        <input type="hidden" name="op" value="do" />
224
                        [% IF ( borrowers ) %]
224
                        [% IF ( borrowers ) %]
225
                            <div class="btn-toolbar selections-toolbar"><a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-times"></i> Clear all</a></div>
225
                            <div class="btn-toolbar selections-toolbar"><a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-times"></i> Clear all</a></div>
Lines 409-414 Link Here
409
                                <fieldset class="action">
409
                                <fieldset class="action">
410
                                    <input type="submit" name="mainformsubmit" class="btn btn-primary" value="Save" />
410
                                    <input type="submit" name="mainformsubmit" class="btn btn-primary" value="Save" />
411
                                    <a href="/cgi-bin/koha/tools/modborrowers.pl" class="cancel">Cancel</a>
411
                                    <a href="/cgi-bin/koha/tools/modborrowers.pl" class="cancel">Cancel</a>
412
                                    [% PROCESS 'members-patron-selections.inc' id="batchmod-borrowers-form" %]
412
                                </fieldset>
413
                                </fieldset>
413
                            </div>
414
                            </div>
414
                        </form>
415
                        </form>
Lines 436-441 Link Here
436
    [% INCLUDE 'datatables.inc' %]
437
    [% INCLUDE 'datatables.inc' %]
437
    [% INCLUDE 'columns_settings.inc' %]
438
    [% INCLUDE 'columns_settings.inc' %]
438
    [% Asset.js("js/tools-menu.js") | $raw %]
439
    [% Asset.js("js/tools-menu.js") | $raw %]
440
    [% Asset.js("js/members-patron-selections.js") | $raw %]
439
    <script>
441
    <script>
440
        var patron_attributes_lib = new Array();
442
        var patron_attributes_lib = new Array();
441
        var patron_attributes_values = new Array();
443
        var patron_attributes_values = new Array();
442
- 

Return to bug 34479