Lines 32-42
C4::Installer
Link Here
|
32 |
|
32 |
|
33 |
use C4::Installer; |
33 |
use C4::Installer; |
34 |
my $installer = C4::Installer->new(); |
34 |
my $installer = C4::Installer->new(); |
35 |
my $all_languages = getAllLanguages(); |
|
|
36 |
my $error = $installer->load_db_schema(); |
35 |
my $error = $installer->load_db_schema(); |
37 |
my $list; |
36 |
my $list; |
38 |
#fill $list with list of sql files |
37 |
#fill $list with list of sql files |
39 |
my ($fwk_language, $error_list) = $installer->load_sql_in_order($all_languages, @$list); |
38 |
my $list = $installer->load_sql_in_order(@$list); |
40 |
$installer->set_version_syspref(); |
39 |
$installer->set_version_syspref(); |
41 |
$installer->set_marcflavour_syspref('MARC21'); |
40 |
$installer->set_marcflavour_syspref('MARC21'); |
42 |
|
41 |
|
Lines 258-264
sub load_db_schema {
Link Here
|
258 |
|
257 |
|
259 |
=head2 load_sql_in_order |
258 |
=head2 load_sql_in_order |
260 |
|
259 |
|
261 |
my ($fwk_language, $list) = $installer->load_sql_in_order($all_languages, @sql_list); |
260 |
my $list = $installer->load_sql_in_order(@sql_list); |
262 |
|
261 |
|
263 |
Given a list of SQL scripts supplied in C<@sql_list>, loads each of them |
262 |
Given a list of SQL scripts supplied in C<@sql_list>, loads each of them |
264 |
into the database and sets the FrameworksLoaded system preference to names |
263 |
into the database and sets the FrameworksLoaded system preference to names |
Lines 277-290
The return value C<$list> is an arrayref containing a hashref for each
Link Here
|
277 |
a list of hashrefs containing a list of each script load and any error |
276 |
a list of hashrefs containing a list of each script load and any error |
278 |
messages associated with the loading of each script. |
277 |
messages associated with the loading of each script. |
279 |
|
278 |
|
280 |
B<FIXME:> The C<$fwk_language> code probably doesn't belong and needs to be |
|
|
281 |
moved to a different method. |
282 |
|
283 |
=cut |
279 |
=cut |
284 |
|
280 |
|
285 |
sub load_sql_in_order { |
281 |
sub load_sql_in_order { |
286 |
my $self = shift; |
282 |
my $self = shift; |
287 |
my $all_languages = shift; |
|
|
288 |
my @sql_list = @_; |
283 |
my @sql_list = @_; |
289 |
|
284 |
|
290 |
my $lang; |
285 |
my $lang; |
Lines 322-336
sub load_sql_in_order {
Link Here
|
322 |
chop $systempreference; |
317 |
chop $systempreference; |
323 |
my @list; |
318 |
my @list; |
324 |
map { push @list, { "level" => $_, "fwklist" => $hashlevel{$_} } } keys %hashlevel; |
319 |
map { push @list, { "level" => $_, "fwklist" => $hashlevel{$_} } } keys %hashlevel; |
325 |
my $fwk_language; |
|
|
326 |
for my $each_language (@$all_languages) { |
327 |
|
328 |
# warn "CODE".$each_language->{'language_code'}; |
329 |
# warn "LANG:".$lang; |
330 |
if ( $lang eq $each_language->{'language_code'} ) { |
331 |
$fwk_language = $each_language->{language_locale_name}; |
332 |
} |
333 |
} |
334 |
my $updateflag = |
320 |
my $updateflag = |
335 |
$self->{'dbh'}->do( |
321 |
$self->{'dbh'}->do( |
336 |
"UPDATE systempreferences set value=\"$systempreference\" where variable='FrameworksLoaded'" |
322 |
"UPDATE systempreferences set value=\"$systempreference\" where variable='FrameworksLoaded'" |
Lines 342-348
sub load_sql_in_order {
Link Here
|
342 |
my $rq = $self->{'dbh'}->prepare($string); |
328 |
my $rq = $self->{'dbh'}->prepare($string); |
343 |
$rq->execute; |
329 |
$rq->execute; |
344 |
} |
330 |
} |
345 |
return ($fwk_language, \@list); |
331 |
return \@list; |
346 |
} |
332 |
} |
347 |
|
333 |
|
348 |
=head2 set_marcflavour_syspref |
334 |
=head2 set_marcflavour_syspref |