diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 3daec4e807..09c7644b13 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2070,22 +2070,24 @@ li { } #searchresults { - ul { - li { - clear: left; - font-size: 90%; - list-style: url("../img/item-bullet.svg"); - padding: .2em 0; + td { + ul { + li { + clear: left; + font-size: 90%; + list-style: url("../img/item-bullet.svg"); + padding: .2em 0; - &.result_itype_image { - list-style: none; - list-style-type: none; - } + &.result_itype_image { + list-style: none; + list-style-type: none; + } - img { - float: left; - margin: 3px 5px 3px -5px; - max-width: 25px; + img { + float: left; + margin: 3px 5px 3px -5px; + max-width: 25px; + } } } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index 6195367695..82089d992a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -45,7 +45,7 @@
[% IF CAN_user_tools_manage_patron_lists %] -
+
Added patrons to .
[% END %] @@ -72,38 +72,32 @@ [% IF CAN_user_tools_manage_patron_lists || CAN_user_borrowers_edit_borrowers %]
- Select all + Select all | - Clear all + Clear all [% IF CAN_user_tools_manage_patron_lists %] - | - - - - - - - - [% END %] - [% IF CAN_user_tools_manage_patron_lists && CAN_user_borrowers_edit_borrowers %] - | + [% IF CAN_user_tools_manage_patron_lists %] +
+ + +
[% END %] [% IF CAN_user_borrowers_edit_borrowers %] - + [% END %]
@@ -210,6 +204,32 @@
+ + + [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] @@ -229,101 +249,70 @@ $('#merge-patrons').prop('disabled', true); $('#memberresultst').on('change', 'input.selection', function() { if ( $('.selection:checked').length > 1 ) { - $('#merge-patrons').prop('disabled', false); + /* More than one checkbox has been checked */ + $('#merge-patrons').prop('disabled', false).removeClass("disabled"); + $("#patronlist-menu").removeClass("disabled").prop("disabled", false); + } else if ( $('.selection:checked').length == 1 ) { + /* At least one checkbox has been checked */ + $('#merge-patrons').prop('disabled', true).addClass("disabled"); + $("#patronlist-menu").removeClass("disabled").prop("disabled", false); } else { - $('#merge-patrons').prop('disabled', true); + /* No checkbox has been checked */ + $('#merge-patrons').prop('disabled', true).addClass("disabled"); + $("#patronlist-menu").addClass("disabled").prop("disabled", true); } }); + $('#merge-patrons').on('click', function() { var merge_patrons_url = 'merge-patrons.pl?' + $('.selection:checked') .map(function() { return "id=" + $(this).val() }).get().join('&'); - window.location.href = merge_patrons_url; }); - $('#add_to_patron_list_submit').prop('disabled', true); - $('#new_patron_list').hide(); - - $('#add_to_patron_list').change(function() { - var value = $('#add_to_patron_list').val(); - if ( value == 'new' ) { - $('#new_patron_list').val('') - $('#new_patron_list').show(); - $('#new_patron_list').focus(); - } else if ( value ) { - $('#new_patron_list').hide(); - $('#add_to_patron_list_submit').prop('disabled', false); - } else { - $('#new_patron_list').hide(); - $('#add_to_patron_list_submit').prop('disabled', true); - } - }); - - $('#new_patron_list').on('input', function() { - if ( $('#new_patron_list').val() ) { - $('#add_to_patron_list_submit').prop('disabled', false); - } else { - $('#add_to_patron_list_submit').prop('disabled', true); - } - }); - - $("#add_to_patron_list_submit").on('click', function(e){ - if ( $('#add_to_patron_list').val() == 'new' ) { - if ( $('#new_patron_list').val() ) { - $("#add_to_patron_list option").each(function() { - if ( $(this).text() == $('#new_patron_list').val() ) { - alert( _("You already have a list with that name!") ); - return false; - } - }); - } else { - alert( _("You must give your new patron list a name!") ); - return false; - } - } + $("#patronlist-dropdown").on("click", ".patron-list-add", function(e){ + e.preventDefault(); if ( $("#memberresultst input:checkbox:checked").length == 0 ) { alert( _("You have not selected any patrons to add to a list!") ); + $(".btn-group").removeClass("open"); /* Close button menu */ return false; } - var borrowernumbers = []; - $("#memberresultst").find("input:checkbox:checked").each(function(){ - borrowernumbers.push($(this).val()); - }); - var data = { - add_to_patron_list: $("#add_to_patron_list").val(), - new_patron_list: $("#new_patron_list").val(), - borrowernumbers: borrowernumbers - }; - $.ajax({ - data: data, - type: 'POST', - url: '/cgi-bin/koha/svc/members/add_to_list', - success: function(data) { - $("#patron_list_dialog").show(); - $("#patron_list_dialog > span.patrons-length").html(data.patrons_added_to_list); - $("#patron_list_dialog > a").attr("href", "/cgi-bin/koha/patron_lists/list.pl?patron_list_id=" + data.patron_list.patron_list_id); - $("#patron_list_dialog > a").html(data.patron_list.name); - if ( $('#add_to_patron_list').val() == 'new' ) { - var new_patron_list_added = $("