View | Details | Raw Unified | Return to bug 13897
Collapse All | Expand All

(-)a/C4/Installer.pm (-9 / +21 lines)
Lines 21-26 use Modern::Perl; Link Here
21
21
22
use Encode qw( encode is_utf8 );
22
use Encode qw( encode is_utf8 );
23
use DBIx::RunSQL;
23
use DBIx::RunSQL;
24
use XML::LibXML;
24
use C4::Context;
25
use C4::Context;
25
use C4::Installer::PerlModules;
26
use C4::Installer::PerlModules;
26
use DBI;
27
use DBI;
Lines 145-151 sub marc_framework_sql_list { Link Here
145
146
146
    foreach my $requirelevel (@listdir) {
147
    foreach my $requirelevel (@listdir) {
147
        opendir( MYDIR, "$dir/$requirelevel" );
148
        opendir( MYDIR, "$dir/$requirelevel" );
148
        my @listname = grep { !/^\./ && -f "$dir/$requirelevel/$_" && $_ =~ m/\.sql$/ } readdir(MYDIR);
149
        my @listname = grep { !/^\./ && -f "$dir/$requirelevel/$_" && $_ =~ m/\.(sql|xml)$/ } readdir(MYDIR);
149
        closedir MYDIR;
150
        closedir MYDIR;
150
        my %cell;
151
        my %cell;
151
        my @frameworklist;
152
        my @frameworklist;
Lines 222-228 sub sample_data_sql_list { Link Here
222
223
223
    foreach my $requirelevel (@listdir) {
224
    foreach my $requirelevel (@listdir) {
224
        opendir( MYDIR, "$dir/$requirelevel" );
225
        opendir( MYDIR, "$dir/$requirelevel" );
225
        my @listname = grep { !/^\./ && -f "$dir/$requirelevel/$_" && $_ =~ m/\.sql$/ } readdir(MYDIR);
226
        my @listname = grep { !/^\./ && -f "$dir/$requirelevel/$_" && $_ =~ m/\.(sql|xml)$/ } readdir(MYDIR);
226
        closedir MYDIR;
227
        closedir MYDIR;
227
        my %cell;
228
        my %cell;
228
        my @frameworklist;
229
        my @frameworklist;
Lines 439-445 sub set_version_syspref { Link Here
439
440
440
  my $error = $installer->load_sql($filename);
441
  my $error = $installer->load_sql($filename);
441
442
442
Runs a the specified SQL file using a sql loader DBIx::RunSQL
443
Runs the specified input file using a sql loader DBIx::RunSQL, or a xml loader
443
Returns any strings sent to STDERR
444
Returns any strings sent to STDERR
444
445
445
# FIXME This should be improved: sometimes the caller and load_sql warn the same
446
# FIXME This should be improved: sometimes the caller and load_sql warn the same
Lines 459-470 sub load_sql { Link Here
459
        local *STDERR;
460
        local *STDERR;
460
        open STDERR, ">>", \$dup_stderr;
461
        open STDERR, ">>", \$dup_stderr;
461
462
462
        eval {
463
        if ( $filename =~ /sql$/ ) {                                                        # SQL files
463
            DBIx::RunSQL->run_sql_file(
464
            eval {
464
                dbh     => $dbh,
465
                DBIx::RunSQL->run_sql_file(
465
                sql     => $filename,
466
                    dbh     => $dbh,
466
            );
467
                    sql     => $filename,
467
        };
468
                );
469
            };
470
        }
471
        else {                                                                              # XML files
472
            eval {
473
                my $dom     = XML::LibXML->load_xml( location => $filename );               # Load XML
474
                my $table   = $dom->documentElement->nodeName;                              # Find table name
475
                my $query   = "LOAD XML LOCAL INFILE '".$filename."' INTO TABLE ".$table;   # MySQL only
476
                my $loadxml = $dbh->prepare($query);
477
                $loadxml->execute();
478
            };
479
        }
468
    };
480
    };
469
    #   errors thrown while loading installer data should be logged
481
    #   errors thrown while loading installer data should be logged
470
    if( $dup_stderr ) {
482
    if( $dup_stderr ) {
(-)a/installer/data/mysql/en/optional/auth_val.sql (-86 lines)
Lines 1-86 Link Here
1
-- Reasons for acceptance or rejection of suggestions in acquisitions
2
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','BSELL','Bestseller');
3
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','SCD','Shelf Copy Damaged');
4
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','LCL','Library Copy Lost');
5
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SUGGEST','AVILL','Available via ILL');
6
7
-- Desired formats for requesting new materials
8
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac) VALUES ('SUGGEST_FORMAT', 'BOOK', 'Book', 'Book');
9
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac) VALUES ('SUGGEST_FORMAT', 'LP', 'Large print', 'Large print');
10
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac) VALUES ('SUGGEST_FORMAT', 'EBOOK', 'EBook', 'Ebook');
11
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac) VALUES ('SUGGEST_FORMAT', 'AUDIOBOOK', 'Audiobook', 'Audiobook');
12
INSERT INTO authorised_values (category, authorised_value, lib, lib_opac) VALUES ('SUGGEST_FORMAT', 'DVD', 'DVD', 'DVD');
13
14
-- availability statuses
15
INSERT INTO `authorised_values`  (category, authorised_value, lib) VALUES ('LOST','2','Long Overdue (Lost)');
16
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOST','1','Lost');
17
INSERT INTO `authorised_values`  (category, authorised_value, lib ) VALUES ('LOST','3','Lost and Paid For');
18
INSERT INTO `authorised_values`  (category, authorised_value, lib )VALUES ('LOST','4','Missing');
19
20
-- damaged status of an item
21
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('DAMAGED','1','Damaged');
22
23
-- location qualification for an item, departments are linked by default to items.location
24
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','FIC','Fiction');
25
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','CHILD','Children\'s Area');
26
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','DISPLAY','On Display');
27
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','NEW','New Materials Shelf');
28
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','STAFF','Staff Office');
29
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','GEN','General Stacks');
30
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','AV','Audio Visual');
31
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','REF','Reference');
32
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','CART','Book Cart');
33
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('LOC','PROC','Processing Center');
34
35
-- collection codes for an item
36
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','FIC','Fiction');
37
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','REF','Reference');
38
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('CCODE','NFIC','Non-fiction');
39
40
-- withdrawn status of an item, linked to items.withdrawn
41
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('WITHDRAWN','1','Withdrawn');
42
43
-- loanability status of an item, linked to items.notforloan
44
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','-1','Ordered');
45
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','1','Not For Loan');
46
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_LOAN','2','Staff Collection');
47
48
-- restricted status of an item, linked to items.restricted
49
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','1','Restricted Access');
50
51
-- custom borrower notes
52
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_NOTES','ADDR','Address Notes');
53
54
-- OPAC Suggestions reasons
55
INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','The copy on the shelf is damaged','The copy on the shelf is damaged');
56
INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Upcoming title by popular author','Upcoming title by popular author');
57
58
-- Report groups
59
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CIRC', 'Circulation');
60
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CAT', 'Catalog');
61
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Patrons');
62
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Acquisitions');
63
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Accounts');
64
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'SER', 'Serials');
65
66
-- SIP2 media types
67
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '000', 'Other');
68
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '001', 'Book');
69
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '002', 'Magazine');
70
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '003', 'Bound journal');
71
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '004', 'Audio tape');
72
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '005', 'Video tape');
73
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '006', 'CD/CDROM');
74
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '007', 'Diskette');
75
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '008', 'Book with diskette');
76
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '009', 'Book with CD');
77
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '010', 'Book with audio tape');
78
79
-- order cancellation reasons
80
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('ORDER_CANCELLATION_REASON', 0, 'No reason provided');
81
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('ORDER_CANCELLATION_REASON', 1, 'Out of stock');
82
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('ORDER_CANCELLATION_REASON', 2, 'Restocking');
83
84
-- return claims
85
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('RETURN_CLAIM_RESOLUTION', 'RET_BY_PATRON', 'Returned by patron');
86
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('RETURN_CLAIM_RESOLUTION', 'FOUND_IN_LIB',  'Found in library');
(-)a/installer/data/mysql/en/optional/auth_val.xml (-1 / +234 lines)
Line 0 Link Here
0
- 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
   Some basic default authorised values for library locations, item lost status, etc.
4
   You can change these at any time after installation.
5
6
   Copyright 2019 Koha Development Team
7
8
   This file is part of Koha.
9
10
   Koha is free software; you can redistribute it and/or modify it under the
11
   terms of the GNU General Public License as published by the Free Software
12
   Foundation; either version 2 of the License, or (at your option) any later
13
   version.
14
15
   Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17
   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
18
19
   You should have received a copy of the GNU General Public License along
20
   with Koha; if not, write to the Free Software Foundation, Inc.,
21
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
-->
23
24
<authorised_values xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
25
26
    <!-- Reasons for acceptance or rejection of suggestions in acquisitions -->
27
    <row category="SUGGEST" authorised_value="BSELL">
28
        <field name="lib">Bestseller</field>
29
    </row>;
30
    <row category="SUGGEST" authorised_value="SCD">
31
        <field name="lib">Shelf Copy Damaged</field>
32
    </row>;
33
    <row category="SUGGEST" authorised_value="LCL">
34
        <field name="lib">Library Copy Lost</field>
35
    </row>;
36
    <row category="SUGGEST" authorised_value="AVILL">
37
        <field name="lib">Available via ILL</field>
38
    </row>;
39
40
    <!-- Desired formats for requesting new materials -->
41
    <row category="SUGGEST_FORMAT" authorised_value="BOOK">
42
        <field name="lib">Book</field>
43
        <field name="lib_opac">Book</field>
44
    </row>;
45
    <row category="SUGGEST_FORMAT" authorised_value="LP">
46
        <field name="lib">Large print</field>
47
        <field name="lib_opac">Large print</field>
48
    </row>;
49
    <row category="SUGGEST_FORMAT" authorised_value="EBOOK">
50
        <field name="lib">EBook</field>
51
        <field name="lib_opac">Ebook</field>
52
    </row>;
53
    <row category="SUGGEST_FORMAT" authorised_value="AUDIOBOOK">
54
        <field name="lib">Audiobook</field>
55
        <field name="lib_opac">Audiobook</field>
56
    </row>;
57
    <row category="SUGGEST_FORMAT" authorised_value="DVD">
58
        <field name="lib">DVD</field>
59
        <field name="lib_opac">DVD</field>
60
    </row>;
61
62
    <!-- availability statuses -->
63
    <row category="LOST" authorised_value="2">
64
        <field name="lib">Long Overdue (Lost)</field>
65
    </row>;
66
    <row category="LOST" authorised_value="1">
67
        <field name="lib">Lost</field>
68
    </row>;
69
    <row category="LOST" authorised_value="3">
70
        <field name="lib">Lost and Paid For</field>
71
    </row>;
72
    <row category="LOST" authorised_value="4">
73
        <field name="lib">Missing</field>
74
    </row>;
75
76
    <!-- damaged status of an item -->
77
    <row category="DAMAGED" authorised_value="1">
78
        <field name="lib">Damaged</field>
79
    </row>;
80
81
    <!-- location qualification for an item, departments are linked by default to items.location -->
82
    <row category="LOC" authorised_value="FIC">
83
        <field name="lib">Fiction</field>
84
    </row>;
85
    <row category="LOC" authorised_value="CHILD">
86
        <field name="lib">Children&apos;s Area</field>
87
    </row>;
88
    <row category="LOC" authorised_value="DISPLAY">
89
        <field name="lib">On Display</field>
90
    </row>;
91
    <row category="LOC" authorised_value="NEW">
92
        <field name="lib">New Materials Shelf</field>
93
    </row>;
94
    <row category="LOC" authorised_value="STAFF">
95
        <field name="lib">Staff Office</field>
96
    </row>;
97
    <row category="LOC" authorised_value="GEN">
98
        <field name="lib">General Stacks</field>
99
    </row>;
100
    <row category="LOC" authorised_value="AV">
101
        <field name="lib">Audio Visual</field>
102
    </row>;
103
    <row category="LOC" authorised_value="REF">
104
        <field name="lib">Reference</field>
105
    </row>;
106
    <row category="LOC" authorised_value="CART">
107
        <field name="lib">Book Cart</field>
108
    </row>;
109
    <row category="LOC" authorised_value="PROC">
110
        <field name="lib">Processing Center</field>
111
    </row>;
112
113
    <!-- collection codes for an item -->
114
    <row category="CCODE" authorised_value="FIC">
115
        <field name="lib">Fiction</field>
116
    </row>;
117
    <row category="CCODE" authorised_value="REF">
118
        <field name="lib">Reference</field>
119
    </row>;
120
    <row category="CCODE" authorised_value="NFIC">
121
        <field name="lib">Non-fiction</field>
122
    </row>;
123
124
    <!-- withdrawn status of an item, linked to items.withdrawn -->
125
    <row category="WITHDRAWN" authorised_value="1">
126
        <field name="lib">Withdrawn</field>
127
    </row>;
128
129
    <!-- loanability status of an item, linked to items.notforloan -->
130
    <row category="NOT_LOAN" authorised_value="-1">
131
        <field name="lib">Ordered</field>
132
    </row>;
133
    <row category="NOT_LOAN" authorised_value="1">
134
        <field name="lib">Not For Loan</field>
135
    </row>;
136
    <row category="NOT_LOAN" authorised_value="2">
137
        <field name="lib">Staff Collection</field>
138
    </row>;
139
140
    <!-- restricted status of an item, linked to items.restricted -->
141
    <row category="RESTRICTED" authorised_value="1">
142
        <field name="lib">Restricted Access</field>
143
    </row>;
144
145
    <!-- custom borrower notes -->
146
    <row category="BOR_NOTES" authorised_value="ADDR">
147
        <field name="lib">Address Notes</field>
148
    </row>;
149
150
    <!-- OPAC Suggestions reasons -->
151
    <row category="OPAC_SUG" authorised_value="damaged">
152
        <field name="lib">The copy on the shelf is damaged</field>
153
        <field name="lib_opac">The copy on the shelf is damaged</field>
154
    </row>;
155
    <row category="OPAC_SUG" authorised_value="bestseller">
156
        <field name="lib">Upcoming title by popular author</field>
157
        <field name="lib_opac">Upcoming title by popular author</field>
158
    </row>;
159
160
    <!-- Report groups -->
161
    <row category="REPORT_GROUP" authorised_value="CIRC">
162
        <field name="lib">Circulation</field>
163
    </row>;
164
    <row category="REPORT_GROUP" authorised_value="CAT">
165
        <field name="lib">Catalog</field>
166
    </row>;
167
    <row category="REPORT_GROUP" authorised_value="PAT">
168
        <field name="lib">Patrons</field>
169
    </row>;
170
    <row category="REPORT_GROUP" authorised_value="ACQ">
171
        <field name="lib">Acquisitions</field>
172
    </row>;
173
    <row category="REPORT_GROUP" authorised_value="ACC">
174
        <field name="lib">Accounts</field>
175
    </row>;
176
    <row category="REPORT_GROUP" authorised_value="SER">
177
        <field name="lib">Serials</field>
178
    </row>;
179
180
    <!-- SIP2 media types -->
181
    <row category="SIP_MEDIA_TYPE" authorised_value="000">
182
        <field name="lib">Other</field>
183
    </row>;
184
    <row category="SIP_MEDIA_TYPE" authorised_value="001">
185
        <field name="lib">Book</field>
186
    </row>;
187
    <row category="SIP_MEDIA_TYPE" authorised_value="002">
188
        <field name="lib">Magazine</field>
189
    </row>;
190
    <row category="SIP_MEDIA_TYPE" authorised_value="003">
191
        <field name="lib">Bound journal</field>
192
    </row>;
193
    <row category="SIP_MEDIA_TYPE" authorised_value="004">
194
        <field name="lib">Audio tape</field>
195
    </row>;
196
    <row category="SIP_MEDIA_TYPE" authorised_value="005">
197
        <field name="lib">Video tape</field>
198
    </row>;
199
    <row category="SIP_MEDIA_TYPE" authorised_value="006">
200
        <field name="lib">CD/CDROM</field>
201
    </row>;
202
    <row category="SIP_MEDIA_TYPE" authorised_value="007">
203
        <field name="lib">Diskette</field>
204
    </row>;
205
    <row category="SIP_MEDIA_TYPE" authorised_value="008">
206
        <field name="lib">Book with diskette</field>
207
    </row>;
208
    <row category="SIP_MEDIA_TYPE" authorised_value="009">
209
        <field name="lib">Book with CD</field>
210
    </row>;
211
    <row category="SIP_MEDIA_TYPE" authorised_value="010">
212
        <field name="lib">Book with audio tape</field>
213
    </row>;
214
215
    <!-- order cancellation reasons -->
216
    <row category="ORDER_CANCELLATION_REASON" authorised_value="0">
217
        <field name="lib">No reason provided</field>
218
    </row>;
219
    <row category="ORDER_CANCELLATION_REASON" authorised_value="1">
220
        <field name="lib">Out of stock</field>
221
    </row>;
222
    <row category="ORDER_CANCELLATION_REASON" authorised_value="2">
223
        <field name="lib">Restocking</field>
224
    </row>;
225
226
    <!-- return claims -->
227
    <row category="RETURN_CLAIM_RESOLUTION" authorised_value="RET_BY_PATRON">
228
        <field name="lib">Returned by patron</field>
229
    </row>;
230
    <row category="RETURN_CLAIM_RESOLUTION" authorised_value="FOUND_IN_LIB">
231
        <field name="lib">Found in library</field>
232
    </row>;
233
</authorised_values>
234

Return to bug 13897