Bug 30568

Summary: Make patron name fields more flexible
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrewfh, gmcharlt, kyle.m.hall, lucas, nick, sally.healey, sbcornell
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28633
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26146
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21978
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 30617    
Bug Blocks: 7680    

Description Martin Renvoize 2022-04-20 08:47:42 UTC
We've had a number of bugs around patron name fields..

* Requests for additional fields
* Requests for changes in display order
* Requests for improved duplicate finding
* Requests for improved table sorting

I intend to collect opinions here and try to come up with a solution that suits more options.
Comment 1 Martin Renvoize 2022-04-20 09:01:25 UTC
In bug 21978 comment 9 Christopher Brannon suggests

>What if we could just get away from the name structures, and have 5 or 6 generic >name fields (i.e. Name1, Name2, Name3 etc.), and we can label them in the editor >for whatever purpose we need, and on screens they appear in the order that they >are used.  For example, Name1 is used as Surname, Name2 is First Name, Name3 is >Middle Name, and so on.  Sort will always sort in order of the fields (Name1 >first, Name2 next, and so on), and would display similar to how they appear now:
>
>In results:
>Name1, Name2 [Name3] [Name4] [Name5] [Name6]
>
>On patron account:
>Name2 [Name3] [Name4] [Name5] [Name6] Name1
>

I think this approach could work well, but it needs a little thought as to how it would work with de-duplicating and sorting and we may still need to implement display templating on top as currently you can call the patron-title include with various options for different displays in different places.

I wonder if we could refine our display to a couple of more formal options.. 'short' and 'long' form perhaps.. right now we have various combinations of options in the template.. like including title or not, othernames, inverse ordering, cardnumber, linking.. etc etc
Comment 2 Martin Renvoize 2022-04-20 09:26:30 UTC
patron-title.inc currently allows for the following output formats

* surname (othernames)
* <span class="patron-title">title</span> surname, firstname (othernames) 
* <span class="patron-title">title</span> firtname (othernames) surname
* title surname, firstname (othernames)
* title firstname (othernames) surname
* surname (othernames) (cardnumber)
* <span class="patron-title">title</span> surname, firstname (othernames) (cardnumber)
* <span class="patron-title">title</span> firtname (othernames) surname (cardnumber)
* title surname, firstname (othernames) (cardnumber)
* title firstname (othernames) surname (cardnumber)
* cardnumber
* <span>A patron from library [% Branches.GetName( patron.branchcode ) | html -%]</span>
Comment 3 Martin Renvoize 2022-04-27 06:56:03 UTC
*** Bug 24710 has been marked as a duplicate of this bug. ***
Comment 4 Martin Renvoize 2022-04-27 06:59:04 UTC
There was a try at doing this by surrounding name fields by spans, bug 24710, in the template includes, but it became clear that wasn't an option as the no_html option on the includes, used for title elements, precludes us from using said spans.
Comment 5 Katrin Fischer 2022-11-17 12:54:01 UTC
(In reply to Martin Renvoize from comment #2)
> patron-title.inc currently allows for the following output formats
> 
> * surname (othernames)
> * <span class="patron-title">title</span> surname, firstname (othernames) 
> * <span class="patron-title">title</span> firtname (othernames) surname
> * title surname, firstname (othernames)
> * title firstname (othernames) surname
> * surname (othernames) (cardnumber)
> * <span class="patron-title">title</span> surname, firstname (othernames)
> (cardnumber)
> * <span class="patron-title">title</span> firtname (othernames) surname
> (cardnumber)
> * title surname, firstname (othernames) (cardnumber)
> * title firstname (othernames) surname (cardnumber)
> * cardnumber
> * <span>A patron from library [% Branches.GetName( patron.branchcode ) |
> html -%]</span>

I like the idea of having clearer definitions on when to use what. 

Long, short, anonymous? 

The versions with span and without are for use in the title tag. 
And you'd probably still want title/no title. 

Probably would be nice to see how often each is used to see if we could replace one or another or if there is a good reason for them to be needed.
Comment 6 Sarah Cornell 2022-11-19 15:53:35 UTC
Here are some formats that would be appropriate for us:

firstname surname 

firstname (other names) surname

firstname (othernames) surname (cardnumber)


As I look at it now, we really just want to be able to output names in a variety of formats without the title.  (e.g. including "title" in the item status field in item detail.pl. is too much.)

We are also an outlier in that we have repurposed the title field for pronouns.  So this would also be desirable for us:

firstname surname (title)

I hope I'm answering the right question here.  ;)
Comment 7 Katrin Fischer 2022-11-19 18:07:52 UTC
Hi Sarah, thx for weighing in. Just a note: 22.11 will have 2 new fields: pronouns and middle name.  So you will be able to move from title to pronouns if you'd like.