From c1933fe1ededfe89392dceab8497c3ecc94866be Mon Sep 17 00:00:00 2001
From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Date: Wed, 2 May 2018 19:42:22 -0300
Subject: [PATCH] Bug 20700: MARC21 add/update leader/007/008 codes

This add/updates some codes from updates 22 (Apr/16)
and 23 (Nov/16)

Update 22 https://www.loc.gov/marc/up22bibliographic/bdapndxg.html

Sound Recording 007/03 n (new)
Sound Recording 007/10 n (new)
Sound Recording 007/01 r (new)
Sound Recording 007/01 s (new)

Update 23 https://www.loc.gov/marc/up23bibliographic/bdapndxg.html

Leader/18 n (new)
Music 008/20 p (new), b (renamed)

To test:
1) Apply the patch
2) Clean your browser cache
3) Go to cataloguing -> new record
4) Leader plugin: check leader/18, new option 'n'
5) 007 Plugin:
a) Sound recording
	check 007/01 new 'r'
	check 007/03 new 'n'
	check 007/10 new 'n'
b) Electronic resource
	check 007/01 new 's'
6) 008 Plugin: Music, check 008/20 renamed 'b', new 'p'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
---
 .../prog/en/data/marc21_field_008.xml         |  3 +-
 .../en/includes/cateditor-widgets-marc21.inc  |  1 +
 .../value_builder/marc21_field_007.tt         | 38 ++++++++++++++++++-
 .../value_builder/marc21_leader.tt            |  5 +++
 4 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/data/marc21_field_008.xml b/koha-tmpl/intranet-tmpl/prog/en/data/marc21_field_008.xml
index eb62dd503f..de577816a9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/data/marc21_field_008.xml
+++ b/koha-tmpl/intranet-tmpl/prog/en/data/marc21_field_008.xml
@@ -824,7 +824,7 @@
     </Position>
     <Position pos="20"><name>Format of music</name><description>One-character code that indicates the format of a musical composition (e.g., piano-conductor score). "Staff notation" in this element refers to music written using staves. "Musical notation" refers to music written using staves or graphic, symbolic, or word-based notation.</description>
       <Value code="a"><description>Full score</description></Value>
-      <Value code="b"><description>Full score, miniature or study size</description></Value>
+      <Value code="b"><description>Miniature or study size</description></Value>
       <Value code="c"><description>Accompaniment reduced for keyboard</description></Value>
       <Value code="d"><description>Voice score with accompaniment omitted</description></Value>
       <Value code="e"><description>Condensed score or piano-conductor score</description></Value>
@@ -836,6 +836,7 @@
       <Value code="l"><description>Score</description></Value>
       <Value code="m"><description>Multiple score formats</description></Value>
       <Value code="n"><description>Not applicable</description></Value>
+      <Value code="p"><description>Piano score</description></Value>
       <Value code="u"><description>Unknown</description></Value>
       <Value code="z"><description>Other</description></Value>
       <Value code="|"><description>No attempt to code</description></Value>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc
index 6db5d7e5ca..ba049d5239 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc
@@ -57,6 +57,7 @@
             <option value="a">a - AACR 2</option>
             <option value="c">c - ISBD punctuation omitted</option>
             <option value="i">i - ISBD punctuation included</option>
+            <option value="n">n - Non-ISBD punctuation omitted</option>
             <option value="u">u - Unknown</option>
         </select>
         <select name="f19" title="Multipart record resource level">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt
index 2d2675a426..bad89fc707 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt
@@ -806,6 +806,15 @@
                                  [% ELSE %] \
                                   <option value="r">' +
                     _("r- Remote") +
+                    '</option> \
+                                 [% END %] \
+                     [% IF ( f1s ) %] \
+                                  <option value="s" selected="selected">' +
+                    _("s- Standalone device") +
+                    '</option> \
+                                 [% ELSE %] \
+                                  <option value="r">' +
+                    _("s- Standalone device") +
                     '</option> \
                                  [% END %] \
                      [% IF ( f1u ) %] \
@@ -7546,6 +7555,15 @@
                                  [% ELSE %] \
                                   <option value="q">' +
                     _("q- Roll") +
+                    '</option> \
+                                 [% END %] \
+                     [% IF ( f1r ) %] \
+                                  <option value="r" selected="selected">' +
+                    _("r- Remote") +
+                    '</option> \
+                                 [% ELSE %] \
+                                  <option value="r">' +
+                    _("r- Remote") +
                     '</option> \
                                  [% END %] \
                      [% IF ( f1s ) %] \
@@ -7726,6 +7744,15 @@
                                  [% ELSE %] \
                                   <option value="m">' +
                     _("m- 3/34 ips (tapes)") +
+                    '</option> \
+                                 [% END %] \
+                                 [% IF ( f3n ) %] \
+                                  <option value="n" selected="selected">' +
+                    _("n- Not applicable") +
+                    '</option> \
+                                 [% ELSE %] \
+                                  <option value="n">' +
+                    _("n- Not applicable") +
                     '</option> \
                                  [% END %] \
                                  [% IF ( f3o ) %] \
@@ -8410,6 +8437,15 @@
                                  [% ELSE %] \
                                   <option value="m">' +
                     _("m- Plastic with metal") +
+                    '</option> \
+                                 [% END %] \
+                                 [% IF ( f10n ) %] \
+                                  <option value="n" selected="selected">' +
+                    _("n- Not applicable") +
+                    '</option> \
+                                 [% ELSE %] \
+                                  <option value="n">' +
+                    _("n- Not applicable") +
                     '</option> \
                                  [% END %] \
                      [% IF ( f10p ) %] \
@@ -9594,4 +9630,4 @@
 </script>
 [% END %]
 
-[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt
index 9d1404fe54..de5c453df3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader.tt
@@ -274,6 +274,11 @@
 				[% ELSE %]
 					<option value="i">i- ISBD punctuation included</option>
 				[% END %]
+                [% IF ( f18n ) %]
+                    <option value="n" selected="selected">n- Non-ISBD punctuation omitted</option>
+                [% ELSE %]
+                    <option value="n">n- Non-ISBD punctuation omitted</option>
+                [% END %]
 				[% IF ( f18u ) %]
 					<option value="u" selected="selected">u- Unknown</option>
 				[% ELSE %]
-- 
2.17.0