@@ -, +, @@ displayed. modification screens `SelfModificationBorrowerUnwantedField`, `PatronSelfModificationMandatoryField`, `PatronSelfRegistrationBorrowerMandatoryField` and `PatronSelfRegistrationBorrowerUnwantedField` to confirm you can make the new field required or hidden. already had 'firstname' in the field list return --- Koha/Database/Columns.pm | 1 + circ/ysearch.pl | 35 ++++++++++--------- .../intranet-tmpl/js/autocomplete/patrons.js | 4 +-- .../prog/en/includes/js-patron-format.inc | 8 +++-- .../prog/en/includes/js_includes.inc | 7 +++- .../prog/en/includes/patron-search-header.inc | 2 +- .../prog/en/includes/patron-search.inc | 8 ++--- .../prog/en/includes/patron-title.inc | 7 ++-- .../prog/en/includes/patronfields.inc | 1 + .../en/modules/admin/preferences/patrons.pref | 2 +- .../prog/en/modules/members/memberentrygen.tt | 17 ++++++++- .../prog/en/modules/members/members-update.tt | 1 + .../prog/en/modules/members/moremember.tt | 7 +--- .../bootstrap/en/includes/patron-title.inc | 2 +- .../bootstrap/en/modules/opac-memberentry.tt | 15 ++++++-- 15 files changed, 77 insertions(+), 40 deletions(-) --- a/Koha/Database/Columns.pm +++ a/Koha/Database/Columns.pm @@ -63,6 +63,7 @@ sub columns { "title" => __("Salutation"), "surname" => __("Surname"), "firstname" => __("First name"), + "middle_name" => __("Middle name"), "dateofbirth" => __("Date of birth"), "initials" => __("Initials"), "othernames" => __("Other name"), --- a/circ/ysearch.pl +++ a/circ/ysearch.pl @@ -59,9 +59,10 @@ foreach my $p (@parts) { push( @params, -or => [ - surname => { -like => "%$p%" }, - firstname => { -like => "%$p%" }, - cardnumber => { -like => "$p%" }, + surname => { -like => "%$p%" }, + firstname => { -like => "%$p%" }, + middle_name => { -like => "%$p%" }, + cardnumber => { -like => "$p%" }, ] ); } @@ -74,7 +75,7 @@ my $borrowers_rs = Koha::Patrons->search_limited( # Get the first 10 results page => 1, rows => 10, - order_by => [ 'surname', 'firstname' ], + order_by => [ 'surname', 'firstname', 'middle_name' ], prefetch => 'branchcode', }, ); @@ -82,18 +83,20 @@ my $borrowers_rs = Koha::Patrons->search_limited( my @borrowers; while ( my $b = $borrowers_rs->next ) { push @borrowers, - { borrowernumber => $b->borrowernumber, - surname => $b->surname // '', - firstname => $b->firstname // '', - cardnumber => $b->cardnumber // '', - dateofbirth => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '', - age => $b->get_age // '', - address => $b->address // '', - city => $b->city // '', - zipcode => $b->zipcode // '', - country => $b->country // '', - branchcode => $b->branchcode // '', - branchname => $b->library->branchname // '', + { + borrowernumber => $b->borrowernumber, + surname => $b->surname // '', + firstname => $b->firstname // '', + middle_name => $b->middle_name // '', + cardnumber => $b->cardnumber // '', + dateofbirth => format_sqldatetime( $b->dateofbirth, undef, undef, 1 ) // '', + age => $b->get_age // '', + address => $b->address // '', + city => $b->city // '', + zipcode => $b->zipcode // '', + country => $b->country // '', + branchcode => $b->branchcode // '', + branchname => $b->library->branchname // '', }; } --- a/koha-tmpl/intranet-tmpl/js/autocomplete/patrons.js +++ a/koha-tmpl/intranet-tmpl/js/autocomplete/patrons.js @@ -12,7 +12,7 @@ function patron_autocomplete(params) { if ( field_to_retrieve == 'borrowernumber' ) { field = ui.item.borrowernumber; } - AddPatron( ui.item.firstname + " " + ui.item.surname, field, patron_container, patron_input_name ); + AddPatron( ui.item.firstname + " " + ui.item.middle_name + " " + ui.item.surname, field, patron_container, patron_input_name ); input_autocomplete.val('').focus(); return false; } @@ -20,7 +20,7 @@ function patron_autocomplete(params) { .data( "ui-autocomplete" )._renderItem = function( ul, item ) { return $( "
" ) .data( "ui-autocomplete-item", item ) - .append( "" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) + .append( "" + item.surname + ", " + item.firstname + " " + item.middle_name + " (" + item.cardnumber + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) .appendTo( ul ); }; --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc @@ -19,8 +19,12 @@ } var name; - var firstname = escape_str(patron.firstname); - var surname = escape_str(patron.surname); + var firstname = escape_str(patron.firstname); + var surname = escape_str(patron.surname); + + if ( patron.middle_name != null && patron.middle_name != '' ) { + firstname += ' ' + escape_str(patron.middle_name); + } if ( patron.other_name != null && patron.other_name != '' ) { firstname += ' (' + escape_str(patron.other_name) + ')'; --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -87,7 +87,11 @@ // Display card number in parentheses if it exists cardnumber = " (" + item.cardnumber + ") "; } - var itemString = "" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + cardnumber.escapeHtml() + " "; + var itemString = "" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + + ( item.firstname ? item.firstname.escapeHtml() : "" ) + + ( item.middle_name ? " " + item.middle_name.escapeHtml() : "" ) + + cardnumber.escapeHtml() + + " "; if( item.branchcode == loggedInLibrary ){ loggedInClass = "ac-currentlibrary"; @@ -150,6 +154,7 @@ .append( "" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + + ( item.middle_name ? " " + item.middle_name.escapeHtml() : "" ) + cardnumber.escapeHtml() + " " + ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) + " " --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc @@ -23,7 +23,7 @@