Bug 17216: Move the AV cat list file to the top level
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 27 Sep 2016 12:44:13 +0000 (13:44 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 11 Oct 2016 07:30:33 +0000 (07:30 +0000)
This way it will get used for any languages.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
C4/Installer.pm
installer/data/mysql/en/mandatory/auth_values.sql
installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql
installer/data/mysql/mandatory/auth_val_cat.sql [new file with mode: 0644]

index f5af971..719e6b2 100644 (file)
@@ -301,6 +301,9 @@ sub load_sql_in_order {
     # Make sure subtag_registry.sql is loaded second
     my $subtag_registry = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory/subtag_registry.sql";
     unshift(@fnames, $subtag_registry);
+    # Make sure authorised value categories are loaded at the beginning
+    my $av_cat = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory/auth_val_cat.sql";
+    unshift(@fnames, $av_cat);
     # Make sure the global sysprefs.sql file is loaded first
     my $globalsysprefs = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql";
     unshift(@fnames, $globalsysprefs);
index 74b917d..d7fb280 100644 (file)
@@ -1,31 +1,2 @@
 INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('YES_NO','0','No','No');
 INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('YES_NO','1','Yes','Yes');
-INSERT IGNORE INTO authorised_value_categories( category_name )
-    VALUES
-    ('Asort1'),
-    ('Asort2'),
-    ('Bsort1'),
-    ('Bsort2'),
-    ('SUGGEST'),
-    ('DAMAGED'),
-    ('LOST'),
-    ('REPORT_GROUP'),
-    ('REPORT_SUBGROUP'),
-    ('DEPARTMENT'),
-    ('TERM'),
-    ('SUGGEST_STATUS'),
-    ('ITEMTYPECAT');
-INSERT IGNORE INTO authorised_value_categories( category_name )
-    VALUES
-    ('branches'),
-    ('itemtypes'),
-    ('cn_source');
-
-INSERT IGNORE INTO authorised_value_categories( category_name )
-    VALUES
-    ('WITHDRAWN'),
-    ('RESTRICTED'),
-    ('NOT_LOAN'),
-    ('CCODE'),
-    ('LOC'),
-    ('STACK');
index befaece..89a48b1 100644 (file)
@@ -31,6 +31,12 @@ INSERT INTO `biblio_framework` (`frameworkcode`, `frameworktext`) VALUES ('MULT'
 INSERT INTO `biblio_framework` (`frameworkcode`, `frameworktext`) VALUES ('PERI', 'Périodique');
 INSERT INTO `biblio_framework` (`frameworkcode`, `frameworktext`) VALUES ('WEB', 'Ressource web');
 
+--
+-- Add some AV categories specific to this file
+--
+
+INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES ('statut'), ('genre'), ('public'), ('local'), ('pcdm');
+
 -- 
 -- Contenu de la table `marc_tag_structure`
 -- 
diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql
new file mode 100644 (file)
index 0000000..5584a3d
--- /dev/null
@@ -0,0 +1,51 @@
+INSERT IGNORE INTO authorised_value_categories( category_name )
+    VALUES
+    (''),
+    ('Asort1'),
+    ('Asort2'),
+    ('Bsort1'),
+    ('Bsort2'),
+    ('SUGGEST'),
+    ('SUGGEST_STATUS'),
+    ('SUGGEST_FORMAT'),
+    ('DAMAGED'),
+    ('LOST'),
+    ('REPORT_GROUP'),
+    ('REPORT_SUBGROUP'),
+    ('DEPARTMENT'),
+    ('TERM'),
+    ('ITEMTYPECAT');
+INSERT IGNORE INTO authorised_value_categories( category_name )
+    VALUES
+    ('branches'),
+    ('itemtypes'),
+    ('cn_source');
+
+INSERT IGNORE INTO authorised_value_categories( category_name )
+    VALUES
+    ('WITHDRAWN'),
+    ('RESTRICTED'),
+    ('NOT_LOAN'),
+    ('CCODE'),
+    ('LOC'),
+    ('MANUAL_INV'),
+    ('BOR_NOTES'),
+    ('OPAC_SUG'),
+    ('SIP_MEDIA_TYPE'),
+    ('ORDER_CANCELLATION_REASON'),
+    ('RELTERMS'),
+    ('YES_NO'),
+    ('LANG'),
+    ('HINGS_UT'),
+    ('HINGS_PF'),
+    ('HINGS_C'),
+    ('HINGS_AS'),
+    ('HINGS_RD'),
+    ('STACK');
+
+-- UNIMARC specific?
+INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
+    ('ETAT'),
+    ('CAND'),
+    ('COUNTRY'),
+    ('qualif');