[Koha-patches] [PATCH] DB REVISION: use items.itemtype for circulation rules. [WARNING: Manual intervention needed]

Ryan Higgins rch at liblime.com
Sat Dec 13 02:20:48 CET 2008


http://wiki.koha.org/doku.php?id=en:development:rfcs3.2:rfc32_item_level_itemtypes
    This commit includes database updates for the RFC
    'Mandate item-level circulation rules'.
    It copies biblioitems.itemtype to items.itemtype.
    WARNING: After running this db update, you should check your
    frameworks and be sure you have items.itemtype mapped to an item subfield.
    You then must run misc/maintenance/sync_items_in_marc_bib.pl !!!!
    If you are already using item-level_itypes, then no action should be required.
---
 .../marc21/mandatory/marc21_framework_DEFAULT.sql  |    4 +-
 .../optional/marc21_simple_bib_frameworks.sql      |   32 +++++++++---------
 .../Obligatoire/marc21_framework_DEFAULT.sql       |    4 +-
 .../Optionnel/marc21_simple_bib_frameworks.sql     |   32 +++++++++---------
 .../Obligatoire/framework_DEFAULT.sql              |   10 +++---
 installer/data/mysql/kohastructure.sql             |   15 ++++++--
 installer/data/mysql/updatedatabase.pl             |   33 ++++++++++++++++++++
 7 files changed, 85 insertions(+), 45 deletions(-)

diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
index a5e7d77..6c00640 100644
--- a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
+++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql
@@ -75,7 +75,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, '', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, '', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, '', '', '', NULL),
-		('942', 'c', 'Koha [default] item type', 'Koha item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
+		('942', 'c', 'Koha [default] item type', 'Koha item type', 0, 1, '', 9, '', '', '', NULL, 0, '', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, '', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, '', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 0, '', '', '', NULL),
@@ -135,7 +135,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, '', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, '', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, '', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, '', '', '', NULL);
 
 
diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
index 8821aa2..27316c6 100644
--- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
+++ b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql
@@ -134,7 +134,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'BKS', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'BKS', '', '', NULL),
@@ -194,7 +194,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'BKS', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL);
 
 
@@ -4054,7 +4054,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'CF', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'CF', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'CF', '', '', NULL),
@@ -4114,7 +4114,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'CF', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'CF', '', '', NULL);
 
 
@@ -7975,7 +7975,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'SR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'SR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'SR', '', '', NULL),
@@ -8035,7 +8035,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'SR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SR', '', '', NULL);
 
 
@@ -11895,7 +11895,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'VR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'VR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'VR', '', '', NULL),
@@ -11955,7 +11955,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'VR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'VR', '', '', NULL);
 
 
@@ -15814,7 +15814,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'AR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'AR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'AR', '', '', NULL),
@@ -15874,7 +15874,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'AR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'AR', '', '', NULL);
 
 
@@ -19732,7 +19732,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'KT', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'KT', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'KT', '', '', NULL),
@@ -19792,7 +19792,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'KT', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'KT', '', '', NULL);
 
 
@@ -23651,7 +23651,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'IR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'IR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'IR', '', '', NULL),
@@ -23711,7 +23711,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'IR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'IR', '', '', NULL);
 
 
@@ -27568,7 +27568,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'SER', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'SER', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
+		('942', 'c', 'Koha [default] Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'SER', '', '', NULL),
@@ -27628,7 +27628,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
 		('952', 'x', 'Non-public note', 'Non-public note', 0, 0, '', 10, '', '', '', NULL, 1, 'SER', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SER', '', '', NULL);
 
 
diff --git a/installer/data/mysql/fr-FR/marcflavour/marc21/Obligatoire/marc21_framework_DEFAULT.sql b/installer/data/mysql/fr-FR/marcflavour/marc21/Obligatoire/marc21_framework_DEFAULT.sql
index 5877662..76a0dce 100644
--- a/installer/data/mysql/fr-FR/marcflavour/marc21/Obligatoire/marc21_framework_DEFAULT.sql
+++ b/installer/data/mysql/fr-FR/marcflavour/marc21/Obligatoire/marc21_framework_DEFAULT.sql
@@ -75,7 +75,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, '', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, '', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, '', '', '', NULL),
-		('942', 'c', 'Koha [default] item type', 'Koha item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
+		('942', 'c', 'Koha [default] item type', 'Koha item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, '', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, '', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 0, '', '', '', NULL),
@@ -135,7 +135,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, '', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, '', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 1, 0, 'items.paidfor', 10, '', '', '', NULL, 7, '', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, '', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, '', '', '', NULL);
 
 
diff --git a/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql b/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql
index 024e2db..df891d5 100644
--- a/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql
+++ b/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql
@@ -134,7 +134,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'BKS', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'BKS', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'BKS', '', '', NULL),
@@ -194,7 +194,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'BKS', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'BKS', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'BKS', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'BKS', '', '', NULL);
 
 
@@ -4054,7 +4054,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'CF', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'CF', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'CF', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'CF', '', '', NULL),
@@ -4114,7 +4114,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'CF', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'CF', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'CF', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'CF', '', '', NULL);
 
 
@@ -7975,7 +7975,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'SR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'SR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'SR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'SR', '', '', NULL),
@@ -8035,7 +8035,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SR', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'SR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'SR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SR', '', '', NULL);
 
 
@@ -11895,7 +11895,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'VR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'VR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'VR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'VR', '', '', NULL),
@@ -11955,7 +11955,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'VR', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'VR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'VR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'VR', '', '', NULL);
 
 
@@ -15814,7 +15814,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'AR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'AR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'AR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'AR', '', '', NULL),
@@ -15874,7 +15874,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'AR', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'AR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'AR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'AR', '', '', NULL);
 
 
@@ -19732,7 +19732,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'KT', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'KT', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'KT', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'KT', '', '', NULL),
@@ -19792,7 +19792,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'KT', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'KT', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'KT', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'KT', '', '', NULL);
 
 
@@ -23651,7 +23651,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'IR', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'IR', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'IR', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'IR', '', '', NULL),
@@ -23711,7 +23711,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'IR', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'IR', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'IR', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'IR', '', '', NULL);
 
 
@@ -27568,7 +27568,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('942', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'biblioitems.cn_source', 9, 'cn_source', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', '6', 'Koha normalized classification for sorting', 'Koha normalized classification for sorting', 0, 0, 'biblioitems.cn_sort', -1, '', '', '', 0, 7, 'SER', '', '', NULL),
 		('942', 'a', 'Institution code [OBSOLETE]', 'Institution code [OBSOLETE]', 0, 0, '', 9, '', '', '', NULL, -5, 'SER', '', '', NULL),
-		('942', 'c', 'Item type', 'Item type', 0, 1, 'biblioitems.itemtype', 9, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
+		('942', 'c', 'Item type', 'Item type', 0, 1, '', 9, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', 'e', 'Edition', 'Edition', 0, 0, 'biblioitems.cn_edition', 9, 'CN_EDITION', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', 'h', 'Classification part', 'Classification part', 0, 0, 'biblioitems.cn_class', 9, '', '', '', NULL, 0, 'SER', '', '', NULL),
 		('942', 'i', 'Item part', 'Item part', 1, 0, 'biblioitems.cn_item', 9, '', '', '', NULL, 9, 'SER', '', '', NULL),
@@ -27628,7 +27628,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 		('952', 'v', 'Cost, replacement price', 'Cost, replacement price', 0, 0, 'items.replacementprice', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
 		('952', 'w', 'Price effective from', 'Price effective from', 0, 0, 'items.replacementpricedate', 10, '', '', '', 0, 0, 'SER', '', '', NULL),
 		('952', 'x', 'Nonpublic note (lost item payment)', 'Nonpublic note (lost item payment)', 0, 0, 'items.paidfor', 10, '', '', '', NULL, 7, 'SER', '', '', NULL),
-		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itype', 10, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
+		('952', 'y', 'Koha item type', 'Koha item type', 0, 0, 'items.itemtype', 10, 'itemtypes', '', '', NULL, 0, 'SER', '', '', NULL),
 		('952', 'z', 'Public note', 'Public note', 0, 0, 'items.itemnotes', 10, '', '', '', NULL, 0, 'SER', '', '', NULL);
 
 
diff --git a/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql b/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql
index d50164f..e1940bc 100644
--- a/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql
+++ b/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql
@@ -1146,7 +1146,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('141', 'a', 'données codées pour le livre ancien - caractères de l''exemplaire', '', 0, 0, '', -1, '', '', 'unimarc_field_141.pl', 0, 0, '', '', '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', '5', 'nom de l''institution à laquelle s''applique cette zone', '', 0, 0, '', -1, '', '', '', 0, 0, '', '', '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'a', 'titre propre', '', 1, 1, 'biblio.title', 0, '', '', '', 0, 0, '', '', '', NULL);
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, 'biblioitems.itemtype', 0, 'itemtypes', '', '', 0, 0, '', '', '', NULL);
+INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, '', 0, 'itemtypes', '', '', 0, 0, '', '', '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'c', 'titre propre d''un auteur différent', '', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'd', 'titre //', '', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'e', 'sous-titre', '', 1, 0, 'biblioitems.volume', 0, '', '', '', 0, -1, '', '', '', NULL);
@@ -2488,7 +2488,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('141', 'a', 'données codées pour le livre ancien - caractères de l''exemplaire', '', 0, 0, '', -1, '', '', 'unimarc_field_141.pl', NULL, 0, 'ARTI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', '5', 'nom de l''institution à laquelle s''applique cette zone', '', 0, 0, '', -1, '', '', '', NULL, 0, 'ARTI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'a', 'titre propre', '', 1, 1, 'biblio.title', 0, '', '', '', NULL, 0, 'ARTI', '', NULL, NULL);
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, 'biblioitems.itemtype', 0, 'itemtypes', '', '', NULL, 0, 'ARTI', '', NULL, NULL);
+INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, '', 0, 'itemtypes', '', '', NULL, 0, 'ARTI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'c', 'titre propre d''un auteur différent', '', 1, 0, '', 0, '', '', '', NULL, -1, 'ARTI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'd', 'titre //', '', 1, 0, '', 0, '', '', '', NULL, -1, 'ARTI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'e', 'sous-titre', '', 1, 0, 'biblioitems.volume', 0, '', '', '', NULL, -1, 'ARTI', '', NULL, NULL);
@@ -3829,7 +3829,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('141', 'a', 'données codées pour le livre ancien - caractères de l''exemplaire', '', 0, 0, '', -1, '', '', 'unimarc_field_141.pl', NULL, 0, 'MULT', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', '5', 'nom de l''institution à laquelle s''applique cette zone', '', 0, 0, '', -1, '', '', '', 0, 0, 'MULT', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'a', 'titre propre', '', 1, 1, 'biblio.title', 0, '', '', '', 0, 0, 'MULT', NULL, '', NULL);
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, 'biblioitems.itemtype', 0, 'itemtypes', '', '', 0, 0, 'MULT', NULL, '', NULL);
+INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, '', 0, 'itemtypes', '', '', 0, 0, 'MULT', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'c', 'titre propre d''un auteur différent', '', 1, 0, '', 0, '', '', '', 0, -1, 'MULT', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'd', 'titre //', '', 1, 0, '', 0, '', '', '', 0, -1, 'MULT', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'e', 'sous-titre', '', 1, 0, 'biblioitems.volume', 0, '', '', '', 0, -1, 'MULT', NULL, '', NULL);
@@ -5171,7 +5171,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('141', 'a', 'données codées pour le livre ancien - caractères de l''exemplaire', '', 0, 0, '', -1, '', '', 'unimarc_field_141.pl', NULL, 0, 'PERI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', '5', 'nom de l''institution à laquelle s''applique cette zone', '', 0, 0, '', -1, '', '', '', NULL, 0, 'PERI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'a', 'titre propre', '', 1, 1, 'biblio.title', 0, '', '', '', NULL, 0, 'PERI', '''200c'',''200d'',''200e'',''200h'',''200i'',''500a'',''500h'',''500i'',''500k'',''500l'',''500m'',''500n'',''500q'',''500r'',''500x'',''500y'',''500z'',''503a'',''503b'',''503d'',''503e'',''503f'',''503h'',''503i'',''503j'',''503k'',''503l'',''503m'',''512a'',''512e'',''512i'',''517a'',''517e'',''517h'',''517i''', NULL, NULL);
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, 'biblioitems.itemtype', 0, 'itemtypes', '', '', NULL, 0, 'PERI', '', NULL, NULL);
+INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, '', 0, 'itemtypes', '', '', NULL, 0, 'PERI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'c', 'titre propre d''un auteur différent', '', 1, 0, '', 0, '', '', '', NULL, -1, 'PERI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'd', 'titre //', '', 1, 0, '', 0, '', '', '', NULL, -1, 'PERI', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'e', 'sous-titre', '', 1, 0, 'biblioitems.volume', 0, '', '', '', NULL, -1, 'PERI', '', NULL, NULL);
@@ -6512,7 +6512,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('141', 'a', 'données codées pour le livre ancien - caractères de l''exemplaire', '', 0, 0, '', -1, '', '', 'unimarc_field_141.pl', NULL, 0, 'WEB', '', NULL, NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', '5', 'nom de l''institution à laquelle s''applique cette zone', '', 0, 0, '', -1, '', '', '', 0, 0, 'WEB', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'a', 'titre propre', '', 1, 1, 'biblio.title', 0, '', '', '', 0, 0, 'WEB', NULL, '', NULL);
-INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, 'biblioitems.itemtype', 0, 'itemtypes', '', '', 0, 0, 'WEB', NULL, '', NULL);
+INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'b', 'type doc', '', 0, 1, '', 0, 'itemtypes', '', '', 0, 0, 'WEB', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'c', 'titre propre d''un auteur différent', '', 1, 0, '', -1, '', '', '', 0, -1, 'WEB', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'd', 'titre //', '', 1, 0, '', -1, '', '', '', 0, -1, 'WEB', NULL, '', NULL);
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES ('200', 'e', 'sous-titre', '', 1, 0, 'biblioitems.volume', 0, '', '', '', 0, -1, 'WEB', NULL, '', NULL);
diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index b2e7515..f7c4433 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -915,7 +915,7 @@ CREATE TABLE `deleteditems` (
   `ccode` varchar(10) default NULL,
   `materials` varchar(10) default NULL,
   `uri` varchar(255) default NULL,
-  `itype` varchar(10) default NULL,
+  `itemtype` varchar(10) default NULL,
   `more_subfields_xml` longtext default NULL,
   `enumchron` varchar(80) default NULL,
   `copynumber` varchar(32) default NULL,
@@ -925,7 +925,11 @@ CREATE TABLE `deleteditems` (
   KEY `delitembinoidx` (`biblioitemnumber`),
   KEY `delitembibnoidx` (`biblionumber`),
   KEY `delhomebranch` (`homebranch`),
-  KEY `delholdingbranch` (`holdingbranch`)
+  KEY `delholdingbranch` (`holdingbranch`),
+  KEY `delitemtype` (`itemtype`),
+  CONSTRAINT `deleteditems_ibfk_1` FOREIGN KEY (`itemtype`)
+    REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE CASCADE
+
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
@@ -1156,7 +1160,7 @@ CREATE TABLE `items` (
   `ccode` varchar(10) default NULL,
   `materials` varchar(10) default NULL,
   `uri` varchar(255) default NULL,
-  `itype` varchar(10) default NULL,
+  `itemtype` varchar(10) default NULL,
   `more_subfields_xml` longtext default NULL,
   `enumchron` varchar(80) default NULL,
   `copynumber` varchar(32) default NULL,
@@ -1166,9 +1170,12 @@ CREATE TABLE `items` (
   KEY `itembibnoidx` (`biblionumber`),
   KEY `homebranch` (`homebranch`),
   KEY `holdingbranch` (`holdingbranch`),
+  KEY `itemtype` (`itemtype`),
+  KEY `cn_sort` (`cn_sort`),
   CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
-  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
+  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
+  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`itemtype`)  REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index fdebcf9..0b840dc 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2064,9 +2064,42 @@ $DBversion = '3.01.00.006';
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     $dbh->do("ALTER TABLE `biblioitems` ADD KEY issn (issn)");
     print "Upgrade to $DBversion done (add index on biblioitems.issn)\n";
+#   SetVersion ($DBversion);
+}
+
+$DBversion = "3.01.00.006";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+#-- 1: change items.itype to itemtype
+    $dbh->do("ALTER TABLE `items` CHANGE `itype` `itemtype` VARCHAR(10) DEFAULT NULL");
+    $dbh->do("ALTER TABLE `items` ADD KEY `itemtype` (`itemtype`) ");
+    $dbh->do("ALTER TABLE `items` ADD KEY `cn_sort` (`cn_sort`) ");
+    $dbh->do("UPDATE `items` SET itemtype=NULL WHERE itemtype='' ");
+    $dbh->do("ALTER TABLE `items` ADD CONSTRAINT `itemtype` FOREIGN KEY (itemtype) REFERENCES itemtypes (`itemtype`) ON DELETE SET NULL ON UPDATE CASCADE");
+    if($dbh->errstr()){
+        print STDERR "*** If you got an error, you'll have to manually fix itemtypes in your items table, then run this SQL query:\n
+        ALTER TABLE `items` ADD CONSTRAINT `itemtype` FOREIGN KEY (serialid) REFERENCES serial (serialid) ON DELETE CASCADE ON UPDATE CASCADE\n
+        and finally, run the maintenance/sync_items_in_marc.pl script to update MARC data.\n";
+    }
+#-- 2: copy bibliotems.itemtype if item-level_itypes is OFF.
+    unless(C4::Context->preference("item-level_itypes")){
+        print STDERR "Copying biblio-level itemtypes to items table...\n";
+        $dbh->do("UPDATE items i,biblioitems bi SET i.itemtype=bi.itemtype WHERE i.biblionumber=bi.biblionumber AND i.itemtype IS NULL ");
+        print STDERR "<em>!WARNING!</em>  You MUST now run the maintenance script sync_items_in_marc_bib.pl .\n
+            If you do NOT have itemtypes mapped to the item level in your frameworks, you must add a 'Koha Link' in your frameworks
+            to items.itemtype, and then run sync_items_in_marc_bib. Failure to do so may result in inability to modify itemtypes.
+            This update makes a significant change to Koha if you haven't been using item-level_itypes!!\n";
+    }
+#-- 3: fix frameworks for items.itemtype
+    $dbh->do("UPDATE `marc_subfield_structure` SET kohafield='items.itemtype' WHERE kohafield='items.itype' ");
+
+#-- 4: remove itype syspref.
+    $dbh->do("DELETE FROM systempreferences WHERE variable='item-level_itypes'");
+
+    print STDERR "Upgrade to $DBversion done ( Mandate item-level circulation.  See <a href=\"http://wiki.koha.org/doku.php?id=en:development:rfcs3.2:rfc32_item_level_itemtypes\">RFC</a> for details).\n";
     SetVersion ($DBversion);
 }
 
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
-- 
1.5.6.2




More information about the Koha-patches mailing list