Bug 42915: Add patron names to data in column def in holds table
This patch adds the patron firstname and surname to the searchable data in the patron column definition for the holds table and removes unnecessary code from the render function. This enables searching holds by patron names. To test: 1. Have holds on a bib for different patrons and pickup locations 2. Try filtering by a patron name 3. See 'No matching records found' 4. Apply patch and repeat step 2 5. Filtering by patron name works! 6. Confirm filtering by cardnumber still works too 7. Set system preference HidePatronName to 'Don't show' 8. Confirm searching by patron names doesn't work ;) Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
43701c3ab1
commit
f3f6ba601a
|
|
@ -1541,24 +1541,17 @@ async function load_patron_holds_table(biblio_id, split_data) {
|
|||
},
|
||||
},
|
||||
{
|
||||
data: "patron.cardnumber",
|
||||
data: HidePatronName
|
||||
? "patron.cardnumber"
|
||||
: "patron.surname:patron.firstname:patron.cardnumber",
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
render: function (data, type, row, meta) {
|
||||
if (data == null) {
|
||||
let library = libraries.find(
|
||||
library => library._id == row.pickup_library_id
|
||||
);
|
||||
return __("A patron from library %s").format(
|
||||
library.name
|
||||
);
|
||||
} else {
|
||||
return $patron_to_html(row.patron, {
|
||||
url: true,
|
||||
display_cardnumber: true,
|
||||
hide_patron_name: HidePatronName,
|
||||
});
|
||||
}
|
||||
return $patron_to_html(row.patron, {
|
||||
url: true,
|
||||
display_cardnumber: true,
|
||||
hide_patron_name: HidePatronName,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue