Lines 34-44
C4::Installer
Link Here
|
34 |
|
34 |
|
35 |
use C4::Installer; |
35 |
use C4::Installer; |
36 |
my $installer = C4::Installer->new(); |
36 |
my $installer = C4::Installer->new(); |
37 |
my $all_languages = getAllLanguages(); |
|
|
38 |
my $error = $installer->load_db_schema(); |
37 |
my $error = $installer->load_db_schema(); |
39 |
my $list; |
38 |
my $list; |
40 |
#fill $list with list of sql files |
39 |
#fill $list with list of sql files |
41 |
my ($fwk_language, $error_list) = $installer->load_sql_in_order($all_languages, @$list); |
40 |
my $list = $installer->load_sql_in_order(@$list); |
42 |
$installer->set_version_syspref(); |
41 |
$installer->set_version_syspref(); |
43 |
$installer->set_marcflavour_syspref('MARC21'); |
42 |
$installer->set_marcflavour_syspref('MARC21'); |
44 |
|
43 |
|
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 325-339
sub load_sql_in_order {
Link Here
|
325 |
chop $systempreference; |
320 |
chop $systempreference; |
326 |
my @list; |
321 |
my @list; |
327 |
map { push @list, { "level" => $_, "fwklist" => $hashlevel{$_} } } keys %hashlevel; |
322 |
map { push @list, { "level" => $_, "fwklist" => $hashlevel{$_} } } keys %hashlevel; |
328 |
my $fwk_language; |
|
|
329 |
for my $each_language (@$all_languages) { |
330 |
|
331 |
# warn "CODE".$each_language->{'language_code'}; |
332 |
# warn "LANG:".$lang; |
333 |
if ( $lang eq $each_language->{'language_code'} ) { |
334 |
$fwk_language = $each_language->{language_locale_name}; |
335 |
} |
336 |
} |
337 |
my $updateflag = |
323 |
my $updateflag = |
338 |
$self->{'dbh'}->do( |
324 |
$self->{'dbh'}->do( |
339 |
"UPDATE systempreferences set value=\"$systempreference\" where variable='FrameworksLoaded'" |
325 |
"UPDATE systempreferences set value=\"$systempreference\" where variable='FrameworksLoaded'" |
Lines 345-351
sub load_sql_in_order {
Link Here
|
345 |
my $rq = $self->{'dbh'}->prepare($string); |
331 |
my $rq = $self->{'dbh'}->prepare($string); |
346 |
$rq->execute; |
332 |
$rq->execute; |
347 |
} |
333 |
} |
348 |
return ($fwk_language, \@list); |
334 |
return \@list; |
349 |
} |
335 |
} |
350 |
|
336 |
|
351 |
=head2 set_marcflavour_syspref |
337 |
=head2 set_marcflavour_syspref |