@@ -, +, @@ displayed. modification screens confirm you can make the new field required or hidden already had 'firstname' in the field list return --- circ/ysearch.pl | 30 +++++++++++-------- .../prog/en/includes/js-patron-format.inc | 8 +++-- .../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 ++++++++-- 11 files changed, 65 insertions(+), 33 deletions(-) --- a/circ/ysearch.pl +++ a/circ/ysearch.pl @@ -74,26 +74,30 @@ 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', }, ); my @borrowers; while ( my $b = $borrowers_rs->next ) { + my $name = + $b->middle_name ? $b->firstname . ' ' . $b->middle_name : $b->firstname; 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 => $name // '', + 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/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/patron-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -61,7 +61,7 @@ + [% IF ( mandatorymiddle_name ) %] + Required + [% END %] + + [% END #/UNLESS nomiddle_name %] [% UNLESS nodateofbirth %]
  • [% IF ( mandatorydateofbirth ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt @@ -19,6 +19,7 @@ [% CASE 'branchcode' %]Home library (branchcode) [% CASE 'surname' %]Surname [% CASE 'firstname' %]First name +[% CASE 'middle_name' %]Middle name [% CASE 'title' %]Title [% CASE 'othernames' %]Other names [% CASE 'initials' %]Initials --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -85,12 +85,7 @@
    -

    - [% UNLESS ( I ) %] - [% patron.title | html %] [% patron.firstname | html %] - [% END %] - [% patron.surname | html %] ([% patron.cardnumber | html %]) -

    +

    [% INCLUDE 'patron-title.inc' no_html = 1 %]

    [% IF ( was_renewed ) %]
    --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/patron-title.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/patron-title.inc @@ -4,5 +4,5 @@ [%- IF patron.title -%] [% patron.title | html %] [%- END -%] - [% patron.firstname | html %] [% patron.surname | html %] + [% patron.firstname | html %] [% patron.middle_name | html %] [% patron.surname | html %] [%- END -%] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -176,7 +176,7 @@ Guaranteed by [% FOREACH gr IN patron.guarantor_relationships %] [% SET g = gr.guarantor %] - [% g.firstname | html %] [% g.surname | html %] + [% g.firstname | html %] [% g.middle_name | html %] [% g.surname | html %] [%- IF ! loop.last %], [% END %] [% END %] @@ -193,7 +193,7 @@
    - [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'dateofbirth' 'initials' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' ] %] + [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'middle_name' 'dateofbirth' 'initials' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' ] %] [% IF mandatory.defined( field ) %] [% SET required.$field = 'required' %] [% END %] @@ -300,7 +300,7 @@ [% END # / defined 'branchcode' %] [%# Following on one line for translatability %] - [% UNLESS hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') && hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') && hidden.defined('sex') %] + [% UNLESS hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') && hidden.defined('middle_name') && hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') && hidden.defined('sex') %]
    @@ -343,6 +343,15 @@
  • [% END %] + [% UNLESS hidden.defined('middle_name') %] +
  • + + + +
    Required
    +
  • + [% END %] + [% UNLESS hidden.defined('dateofbirth') %]
  • --