Bug 11674 - Configuration for MARC field doc URLs
Summary: Configuration for MARC field doc URLs
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Whiteboard:
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2014-02-04 09:27 UTC by paxed
Modified: 2018-05-22 10:03 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Add syspref MarcFieldDocURL to config the MARC format documentation URL for marc edit (6.36 KB, patch)
2014-04-08 10:00 UTC, paxed
Details | Diff | Splinter Review
(rebased) Config for MARC field doc URLs (5.54 KB, patch)
2015-06-20 14:51 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(rebased) Config for MARC field doc URLs (5.55 KB, patch)
2015-06-20 14:52 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(qa fix) sysprefs order and TT plugin access (3.19 KB, patch)
2015-06-23 04:32 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(rebased) Config for MARC field doc URLs (5.65 KB, patch)
2015-06-23 10:18 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(rebased) Config for MARC field doc URLs (5.61 KB, patch)
2015-06-23 10:21 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(qa fix) sysprefs order and TT plugin access (3.23 KB, patch)
2015-06-23 10:29 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(qa followup) added missing IGNORE to INSERT (1.35 KB, patch)
2015-06-23 11:28 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(qa fix) sysprefs order and TT plugin access (3.19 KB, patch)
2015-06-23 19:54 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(qa followup) added missing IGNORE to INSERT (1.35 KB, patch)
2015-06-23 19:57 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(rebased) Config for MARC field doc URLs (5.61 KB, patch)
2015-06-24 21:27 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(squashed commits) qa fix and followup (4.27 KB, patch)
2015-06-24 21:27 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
(followup) removed C4::Context->preference (828 bytes, patch)
2015-06-25 14:36 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Add a new system preference MarcFieldDocURL (6.00 KB, patch)
2018-02-01 10:48 UTC, paxed
Details | Diff | Splinter Review
Bug 11674: Configuration for MARC field doc URLs (6.02 KB, patch)
2018-04-04 02:04 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 11674: Configuration for MARC field doc URLs (6.08 KB, patch)
2018-04-16 06:03 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-02-04 09:27:27 UTC
When adding a MARC record, the MARC21 field documentation is hard-coded to go to www.loc.gov - The URL(s) should be configurable, to allow non-English documentation.

Same applies to UNIMARC field docs.
Comment 1 paxed 2014-04-08 10:00:11 UTC Comment hidden (obsolete)
Comment 2 paxed 2014-04-08 10:15:41 UTC
Add a new system preference MarcFieldDocURL. Setting it to some URL
will make all the MARC documentation links point to that in
the MARC edit UI. Leaving the value empty will use the old defaults
(http://loc.gov for MARC21 and http://archive.ifla.org for UNIMARC).

There are some possible substitutions usable in the URL:
 - {MARC} is replaced with either "MARC21" or "UNIMARC"
 - {FIELD} is replaced by the MARC field number, eg. "000", "048", ...
 - {LANG} is replaced by the UI language, eg. "en", or "fi-FI"

To test:

1) Install Koha
2) Go to Cataloguing > New record
3) Clicking on the question mark links in the MARC edit will
   open a window to either loc.gov or archive.ifla.org
4) Install patch
5) Redo parts 1, 2, and 3.
6) Set the value of MarcFieldDocURL to
   http://example.com/?field={FIELD}&marc={MARC}&lang={LANG}
7) Redo parts 1 and 2
8) Clicking on the question mark links in the MARC edit will
   open a window to example.com, with the proper substitutions
   in the URL for the field, marc flavour and language.
Comment 3 Pablo AB 2014-05-13 14:47:45 UTC
There is another parameter asociated with MARC documentation links: If the user want to see concise or full version (please see bug #10940). So we could add to {MARC}, {FIELD} and {LANG}:
 - {FLAVOR} is replaced by the MARC "flavor" of the manual, either "concise" or "full"

BTW, we have too much sysprefs, perhaps we need to consider something like Firefox's "about:config" to all the less used ones... or perhaps (also) wizards.
Comment 4 Indranil Das Gupta 2015-06-20 14:51:04 UTC Comment hidden (obsolete)
Comment 5 Indranil Das Gupta 2015-06-20 14:52:03 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-06-22 16:22:13 UTC
2 small things found:
1/ sysprefs.sql should be kept ordered
2/ You can use the TT plugin to access the syspref value
Comment 7 Indranil Das Gupta 2015-06-23 04:32:55 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-06-23 09:05:23 UTC
Indranil, could you please recreate the first patch and let the authorship to paxed?
Comment 9 Indranil Das Gupta 2015-06-23 10:18:14 UTC Comment hidden (obsolete)
Comment 10 Indranil Das Gupta 2015-06-23 10:21:22 UTC Comment hidden (obsolete)
Comment 11 Indranil Das Gupta 2015-06-23 10:29:05 UTC Comment hidden (obsolete)
Comment 12 Indranil Das Gupta 2015-06-23 11:28:02 UTC Comment hidden (obsolete)
Comment 13 Indranil Das Gupta 2015-06-23 19:54:13 UTC Comment hidden (obsolete)
Comment 14 Indranil Das Gupta 2015-06-23 19:57:30 UTC Comment hidden (obsolete)
Comment 15 Indranil Das Gupta 2015-06-24 21:27:07 UTC
Created attachment 40605 [details] [review]
(rebased) Config for MARC field doc URLs

Rebased from 3.15 to 3.21. no other changes made.

Test plans as before.

http://bugs.koha-community.org/show_bug.cgi?id=11674

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Comment 16 Indranil Das Gupta 2015-06-24 21:27:12 UTC
Created attachment 40606 [details] [review]
(squashed commits) qa fix and followup

1/ the qa fix addresses the QA comments from Jonathan Druart in
comment #6.

2/ qa followup added missing IGNORE to INSERT statement in
updatedatabase.pl for compliance with Bug 9071
Comment 17 M. Tompsett 2015-06-24 23:30:07 UTC
Indranil or paxed, could you please remove the addbiblio.pl change?
Everything tests fine, but:
    marcfielddocurl => C4::Context->preference("MarcFieldDocURL"),
is no longer needed, since Indranil grabs it with Koha.Preference.
Comment 18 Indranil Das Gupta 2015-06-25 14:36:57 UTC
Created attachment 40638 [details] [review]
(followup) removed C4::Context->preference

removed redundant reference based on comment #17 above.
Comment 19 M. Tompsett 2015-06-25 15:37:20 UTC
Comment on attachment 40606 [details] [review]
(squashed commits) qa fix and followup

Review of attachment 40606 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
@@ +144,1 @@
>          var docurl = "[% marcfielddocurl.replace('"','&quot;') %]";

Oops. This is not pulling the same data, particularly if we remove the parameter like I requested.
Comment 20 Francois Charbonnier 2015-08-04 21:28:53 UTC
Sorry, It doesn't work for me. Did I miss something?

* I applied the 3 patches on an up-to-date master and then run updatedatabase.pl
* I set up "MarcFieldDocURL" with the value : www.marc21.ca/MaJ/BIB/B{FIELD}.pdf
* I went to the cataloguing module and add a new biblio,click on the ? shortcut for the 245. A new blank tab opened and that's it.

I should have had this page opened : http://www.marc21.ca/MaJ/BIB/B245.pdf
Comment 21 paxed 2018-02-01 10:48:32 UTC
Created attachment 71108 [details] [review]
Add a new system preference MarcFieldDocURL

Add a new system preference MarcFieldDocURL. Setting it to some URL
will make all the MARC documentation links point to that in
the MARC edit UI. Leaving the value empty will use the old defaults
(http://loc.gov for MARC21 and http://archive.ifla.org for UNIMARC).

There are some possible substitutions usable in the URL:
 - {MARC} is replaced with either "MARC21" or "UNIMARC"
 - {FIELD} is replaced by the MARC field number, eg. "000", "048", ...
 - {LANG} is replaced by the UI language, eg. "en", or "fi-FI"

To test:

1) Go to Cataloguing > New record
2) Clicking on the question mark links in the MARC edit will
   open a window to either loc.gov or archive.ifla.org
3) Install patch, run updatedatabase, etc
4) Redo parts 1, and 2.
5) Set the value of MarcFieldDocURL to
   http://example.com/?field={FIELD}&marc={MARC}&lang={LANG}
6) Redo parts 1 and 2
7) Clicking on the question mark links in the MARC edit will
   open a window to example.com, with the proper substitutions
   in the URL for the field, marc flavour and language
Comment 22 M. Tompsett 2018-04-04 02:04:01 UTC
Created attachment 73594 [details] [review]
Bug 11674: Configuration for MARC field doc URLs

Add a new system preference MarcFieldDocURL. Setting it to some URL
will make all the MARC documentation links point to that in
the MARC edit UI. Leaving the value empty will use the old defaults
(http://loc.gov for MARC21 and http://archive.ifla.org for UNIMARC).

There are some possible substitutions usable in the URL:
 - {MARC} is replaced with either "MARC21" or "UNIMARC"
 - {FIELD} is replaced by the MARC field number, eg. "000", "048", ...
 - {LANG} is replaced by the UI language, eg. "en", or "fi-FI"

To test:

1) Go to Cataloguing > New record
2) Clicking on the question mark links in the MARC edit will
   open a window to either loc.gov or archive.ifla.org
3) Install patch, run updatedatabase, etc
4) Redo parts 1, and 2.
5) Set the value of MarcFieldDocURL to
   http://example.com/?field={FIELD}&marc={MARC}&lang={LANG}
6) Redo parts 1 and 2
7) Clicking on the question mark links in the MARC edit will
   open a window to example.com, with the proper substitutions
   in the URL for the field, marc flavour and language

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 23 Katrin Fischer 2018-04-16 06:03:06 UTC
Created attachment 74196 [details] [review]
Bug 11674: Configuration for MARC field doc URLs

Add a new system preference MarcFieldDocURL. Setting it to some URL
will make all the MARC documentation links point to that in
the MARC edit UI. Leaving the value empty will use the old defaults
(http://loc.gov for MARC21 and http://archive.ifla.org for UNIMARC).

There are some possible substitutions usable in the URL:
 - {MARC} is replaced with either "MARC21" or "UNIMARC"
 - {FIELD} is replaced by the MARC field number, eg. "000", "048", ...
 - {LANG} is replaced by the UI language, eg. "en", or "fi-FI"

To test:

1) Go to Cataloguing > New record
2) Clicking on the question mark links in the MARC edit will
   open a window to either loc.gov or archive.ifla.org
3) Install patch, run updatedatabase, etc
4) Redo parts 1, and 2.
5) Set the value of MarcFieldDocURL to
   http://example.com/?field={FIELD}&marc={MARC}&lang={LANG}
6) Redo parts 1 and 2
7) Clicking on the question mark links in the MARC edit will
   open a window to example.com, with the proper substitutions
   in the URL for the field, marc flavour and language

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 24 Jonathan Druart 2018-04-16 17:12:39 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 25 Katrin Fischer 2018-05-01 09:10:13 UTC
Wonder if we should move this to Cataloguing for the release notes.
Comment 26 Nick Clemens 2018-05-22 10:03:10 UTC
Enhancement, not backported for 17.11