2a6a3de7c4
Add Font Awesome Icons to section Patrons and circulation in Tools module. Also correct a error dialog in JQuery functions To test: -Apply patch -Goto Tools -> Patron list -> my_list_saved -> Add patrons -> Remove selected patrons, Clear all, Select all. -Add new patron list and add some patrons, notice about the trash icon. -Make some comments in some bib records and goto Tools->Comments you will presented with two tabs "Approved comments" and "Comments awaiting moderation". See the three new buttons: Approve, Delete, Unapprove. -Set syspref TagsModeration to Require. This will show all pending tags to review. -Make some tags in bib records and goto Tools -> Tags. -Notice about the new look. -In the new screen look the icons in buttons "Apply filter(s)", "Test", "Approved", "Reject". Notice about the new header bar above the DataTable with options: Select all, Clear all, Select all pending. -Play with filters; Check if terms exist or not in appoved/rejected lists -Play with Terms summary and see if DataTable is working as expected -Click in some term tag with multiple titles -A table with titles tagged with the term is presented -See the new button 'Remove' -Verify if you can remove tag from a selected title. -Verify that all tools work as expected NOTE: The Tag and Comments tools has been revised to fit with others interfaces in Koha. Bug ammended according with QA comment 5 Bug rebased because bug 16005 Test plan amended for clarity Clock icon for "Select all pending" removed (QA comment 23). Fix some forbidden patterns (tab char) in review.tt according by IRC comment by Marc Veron Followed test plan, looks and works as expected Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
48 lines
2 KiB
JavaScript
48 lines
2 KiB
JavaScript
function patron_autocomplete(params) {
|
|
var patron_container = params.patron_container;
|
|
var input_autocomplete = params.input_autocomplete;
|
|
var patron_input_name = params.patron_input_name || 'cardnumber';
|
|
var field_to_retrieve = params.field_to_retrieve || 'cardnumber';
|
|
|
|
$( input_autocomplete ).autocomplete({
|
|
source: "/cgi-bin/koha/circ/ysearch.pl",
|
|
minLength: 3,
|
|
select: function( event, ui ) {
|
|
var field = ui.item.cardnumber;
|
|
if ( field_to_retrieve == 'borrowernumber' ) {
|
|
field = ui.item.borrowernumber;
|
|
}
|
|
AddPatron( ui.item.firstname + " " + ui.item.surname, field, patron_container, patron_input_name );
|
|
input_autocomplete.val('').focus();
|
|
return false;
|
|
}
|
|
})
|
|
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
|
return $( "<li></li>" )
|
|
.data( "ui-autocomplete-item", item )
|
|
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
|
|
.appendTo( ul );
|
|
};
|
|
|
|
$("body").on("click",".removePatron",function(e){
|
|
e.preventDefault();
|
|
var divid = $(this).parent().attr("id");
|
|
var cardnumber = divid.replace("borrower_","");
|
|
RemovePatron(cardnumber, patron_container);
|
|
});
|
|
}
|
|
|
|
function AddPatron( patron_name, value, container, input_name ) {
|
|
div = "<div id='borrower_" + value + "'>" + patron_name + " ( <a href='#' class='removePatron'><i class='fa fa-trash' aria-hidden='true'></i> " + MSG_REMOVE_PATRON + " </a> ) <input type='hidden' name='" + input_name + "' value='" + value + "' /></div>";
|
|
$(container).append( div );
|
|
|
|
$(container).parent().show( 800 );
|
|
}
|
|
|
|
function RemovePatron( cardnumber, container ) {
|
|
$( '#borrower_' + cardnumber ).remove();
|
|
|
|
if ( ! $(container).html() ) {
|
|
$(container).parent().hide( 800 );
|
|
}
|
|
}
|