This only does very basic adjustments: Allow to replace OCLC_NO by MARC21 035$a. Remove the (orgcode) prefix. Will open another bug to make C4::Output::parametrized_url a bit smarter.
Created attachment 134613 [details] [review] Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn We need to pass OCLC_NO as key to C4::Output::parametrized_url. We get it from MARC21 035$a and strip the organizational code. Test plan: Add e.g. 62385712 in 035$a in a record. Add e.g. following link to pref OPACSearchForTitleIn: <a href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a> Open that record on detail page. Click More searches. Follow that link. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 134614 [details] [review] Bug 30678: Adjust pref description Test plan: Look up pref OPACSearchForTitleIn. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
I don't think the name is a good fit, because 035$a is repeatable and not reserved for WorldCat numbers. It all depends on the prefix. I think if you want to keep the name, you should use the prefixes (I think there are multiple) to select the actual OCLC number. But I'd like it even better, if we could make the prefix configurable, maybe as an attribute or with a pipe in the placeholder? This would also help to deal with cases of multiple 035$a and make it useful for even more use cases. To give an example from one of our union catalog records: 035 _a(DE-627)1618146513 035 _a(DE-576)303474114 035 _a(DE-599)BSZ303474114 035 _a(OCoLC)611542131 2 are union catalog internal identifiers, one is German national library and one is WorldCat. It's also not clear which would be picked if there are multiple (first?)
Created attachment 134814 [details] [review] Bug 30678: (follow-up) Add oclc_number routine and friends As requested by QA, we should match the orgcode. Adding a few small routines in a Util module. Test plan: Run t/Koha/Util/MARC.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 134815 [details] [review] Bug 30678: (follow-up) Change call in opac scripts Test plan: See first patch. Add orgcode OCoLC. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Katrin Fischer from comment #3) > I don't think the name is a good fit, because 035$a is repeatable and not > reserved for WorldCat numbers. It all depends on the prefix. Good point. > I think if you want to keep the name, you should use the prefixes (I think > there are multiple) to select the actual OCLC number. The regex now covers all important ones: OCoLC with/without suffixes. > But I'd like it even better, if we could make the prefix configurable, maybe > as an attribute or with a pipe in the placeholder? This would also help to > deal with cases of multiple 035$a and make it useful for even more use cases. This requires more work. Part of it is reworking parametrized_url. Postponing this here to bug 30679. > It's also not clear which would be picked if there are multiple (first?) Currently the first one. But here also, 30679 could make improvements.
Created attachment 134844 [details] [review] Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn We need to pass OCLC_NO as key to C4::Output::parametrized_url. We get it from MARC21 035$a and strip the organizational code. Test plan: Add e.g. 62385712 in 035$a in a record. Add e.g. following link to pref OPACSearchForTitleIn: <a href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a> Open that record on detail page. Click More searches. Follow that link. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 134845 [details] [review] Bug 30678: Adjust pref description Test plan: Look up pref OPACSearchForTitleIn. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 134846 [details] [review] Bug 30678: (follow-up) Add oclc_number routine and friends As requested by QA, we should match the orgcode. Adding a few small routines in a Util module. Test plan: Run t/Koha/Util/MARC.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 134847 [details] [review] Bug 30678: (follow-up) Change call in opac scripts Test plan: See first patch. Add orgcode OCoLC. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Tetsing notes (koha-testing-docker): 1. Make tag 035 and subfields visible in the MARC editor for the BKS framework. 2. Add entry to 035$a = (OCoLC)62385712 3. Follow the rest of the test plan.
(In reply to David Nind from comment #10) > Signed-off-by: David Nind <david@davidnind.com> Thx David !
Patch does not apply, Kyle ?? Applying: Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn Applying: Bug 30678: Adjust pref description Applying: Bug 30678: (follow-up) Add oclc_number routine and friends Applying: Bug 30678: (follow-up) Change call in opac scripts Using index info to reconstruct a base tree... M opac/opac-ISBDdetail.pl M opac/opac-MARCdetail.pl M opac/opac-detail.pl Falling back to patching base and 3-way merge... Auto-merging opac/opac-detail.pl Auto-merging opac/opac-MARCdetail.pl Auto-merging opac/opac-ISBDdetail.pl
Created attachment 136222 [details] [review] Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn We need to pass OCLC_NO as key to C4::Output::parametrized_url. We get it from MARC21 035$a and strip the organizational code. Test plan: Add e.g. 62385712 in 035$a in a record. Add e.g. following link to pref OPACSearchForTitleIn: <a href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a> Open that record on detail page. Click More searches. Follow that link. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 136223 [details] [review] Bug 30678: Adjust pref description Test plan: Look up pref OPACSearchForTitleIn. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 136224 [details] [review] Bug 30678: (follow-up) Add oclc_number routine and friends As requested by QA, we should match the orgcode. Adding a few small routines in a Util module. Test plan: Run t/Koha/Util/MARC.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 136225 [details] [review] Bug 30678: (follow-up) Change call in opac scripts Test plan: See first patch. Add orgcode OCoLC. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 138046 [details] [review] Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn We need to pass OCLC_NO as key to C4::Output::parametrized_url. We get it from MARC21 035$a and strip the organizational code. Test plan: Add e.g. 62385712 in 035$a in a record. Add e.g. following link to pref OPACSearchForTitleIn: <a href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a> Open that record on detail page. Click More searches. Follow that link. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 138047 [details] [review] Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn We need to pass OCLC_NO as key to C4::Output::parametrized_url. We get it from MARC21 035$a and strip the organizational code. Test plan: Add e.g. 62385712 in 035$a in a record. Add e.g. following link to pref OPACSearchForTitleIn: <a href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a> Open that record on detail page. Click More searches. Follow that link. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 138048 [details] [review] Bug 30678: Adjust pref description Test plan: Look up pref OPACSearchForTitleIn. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 138049 [details] [review] Bug 30678: (follow-up) Add oclc_number routine and friends As requested by QA, we should match the orgcode. Adding a few small routines in a Util module. Test plan: Run t/Koha/Util/MARC.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 138050 [details] [review] Bug 30678: (follow-up) Change call in opac scripts Test plan: See first patch. Add orgcode OCoLC. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 22.11. Nice work everyone, thanks!
Enhancement will not be backported to 22.05.x series
Please don't forget about Needs Documenting.