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

(-)a/C4/UsageStats.pm (-2 / +2 lines)
Lines 115-124 sub ReportToCommunity { Link Here
115
    );
115
    );
116
    my $content = decode_json( $res->decoded_content );
116
    my $content = decode_json( $res->decoded_content );
117
    if ( $content->{koha_id} ) {
117
    if ( $content->{koha_id} ) {
118
        C4::Context->set_preference( 'UsageStatsID', $content->{koha_id} );
118
        Koha::Config::SysPrefs->set_preference( 'UsageStatsID', $content->{koha_id} );
119
    }
119
    }
120
    if ( $content->{id} ) {
120
    if ( $content->{id} ) {
121
        C4::Context->set_preference( 'UsageStatsPublicID', $content->{id} );
121
        Koha::Config::SysPrefs->set_preference( 'UsageStatsPublicID', $content->{id} );
122
    }
122
    }
123
}
123
}
124
124
(-)a/Koha/SearchEngine/Elasticsearch/Indexer.pm (-1 / +1 lines)
Lines 245-251 sub index_status { Link Here
245
        ) {
245
        ) {
246
            Koha::Exception->throw("Invalid index status: $status");
246
            Koha::Exception->throw("Invalid index status: $status");
247
        }
247
        }
248
        C4::Context->set_preference($key, $status);
248
        Koha::Config::SysPrefs->set_preference($key, $status);
249
        return $status;
249
        return $status;
250
    }
250
    }
251
    else {
251
    else {
(-)a/admin/preferences.pl (-1 / +1 lines)
Lines 367-373 if ( $op eq 'save' ) { Link Here
367
367
368
        my $value = join( ',', $input->param( $param ) );
368
        my $value = join( ',', $input->param( $param ) );
369
369
370
        C4::Context->set_preference( $pref, $value );
370
        Koha::Config::SysPrefs->set_preference( $pref, $value );
371
    }
371
    }
372
372
373
    print $input->redirect( '/cgi-bin/koha/admin/preferences.pl?tab=' . $tab );
373
    print $input->redirect( '/cgi-bin/koha/admin/preferences.pl?tab=' . $tab );
(-)a/admin/share_content.pl (-5 / +5 lines)
Lines 50-66 if ( $op eq 'save' ) { Link Here
50
    my $auto_share = $query->param('autosharewithmana') || q{};
50
    my $auto_share = $query->param('autosharewithmana') || q{};
51
    my $mana = $query->param('mana');
51
    my $mana = $query->param('mana');
52
52
53
    C4::Context->set_preference('Mana', $mana);
53
    Koha::Config::SysPrefs->set_preference('Mana', $mana);
54
54
55
    if ( $auto_share ne '' ) {
55
    if ( $auto_share ne '' ) {
56
        C4::Context->set_preference('AutoShareWithMana', 'subscription');
56
        Koha::Config::SysPrefs->set_preference('AutoShareWithMana', 'subscription');
57
    } else {
57
    } else {
58
        C4::Context->set_preference('AutoShareWithMana', '');
58
        Koha::Config::SysPrefs->set_preference('AutoShareWithMana', '');
59
    }
59
    }
60
}
60
}
61
61
62
if ( $op eq 'reset' ) {
62
if ( $op eq 'reset' ) {
63
    C4::Context->set_preference('ManaToken', '');
63
    Koha::Config::SysPrefs->set_preference('ManaToken', '');
64
}
64
}
65
65
66
if ( $op eq 'send' && not $bad_url ) {
66
if ( $op eq 'send' && not $bad_url ) {
Lines 78-84 if ( $op eq 'send' && not $bad_url ) { Link Here
78
    $template->param( result => $result );
78
    $template->param( result => $result );
79
79
80
    if ( $result->{code} eq '201' && $result->{token} ) {
80
    if ( $result->{code} eq '201' && $result->{token} ) {
81
        C4::Context->set_preference('ManaToken', $result->{token});
81
        Koha::Config::SysPrefs->set_preference('ManaToken', $result->{token});
82
    }
82
    }
83
}
83
}
84
84
(-)a/admin/systempreferences.pl (-3 / +4 lines)
Lines 51-56 use C4::Languages qw( getTranslatedLanguages ); Link Here
51
use C4::ClassSource qw( GetClassSources GetClassSource );
51
use C4::ClassSource qw( GetClassSources GetClassSource );
52
use C4::Output qw( output_html_with_http_headers output_and_exit_if_error );
52
use C4::Output qw( output_html_with_http_headers output_and_exit_if_error );
53
use YAML::XS;
53
use YAML::XS;
54
use Koha::Config::Sysprefs;
54
55
55
my %tabsysprefs; #we do no longer need to keep track of a tab per pref (yaml)
56
my %tabsysprefs; #we do no longer need to keep track of a tab per pref (yaml)
56
57
Lines 274-280 if ( $op eq 'update_and_reedit' ) { Link Here
274
        }
275
        }
275
    }
276
    }
276
    my $variable = $input->param('variable');
277
    my $variable = $input->param('variable');
277
    C4::Context->set_preference($variable, $value);
278
    Koha::Config::SysPrefs->set_preference($variable, $value);
278
}
279
}
279
280
280
################## ADD_FORM ##################################
281
################## ADD_FORM ##################################
Lines 334-340 if ( $op eq 'add_form' ) { Link Here
334
        $value = encode_base64($value);
335
        $value = encode_base64($value);
335
    }
336
    }
336
337
337
    C4::Context->set_preference( $variable, $value, $expl, $type, $options );
338
    Koha::Config::SysPrefs->set_preference( $variable, $value, $expl, $type, $options );
338
    print $input->redirect("/cgi-bin/koha/admin/systempreferences.pl?tab=");
339
    print $input->redirect("/cgi-bin/koha/admin/systempreferences.pl?tab=");
339
    exit;
340
    exit;
340
################## DELETE_CONFIRM ##################################
341
################## DELETE_CONFIRM ##################################
Lines 351-357 if ( $op eq 'add_form' ) { Link Here
351
    # called by delete_confirm, used to effectively confirm deletion of data in DB
352
    # called by delete_confirm, used to effectively confirm deletion of data in DB
352
} elsif ( $op eq 'delete_confirmed' ) {
353
} elsif ( $op eq 'delete_confirmed' ) {
353
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
354
    output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' });
354
    C4::Context->delete_preference($searchfield);
355
    Koha::Config::SysPrefs->delete_preference($searchfield);
355
    # END $OP eq DELETE_CONFIRMED
356
    # END $OP eq DELETE_CONFIRMED
356
################## DEFAULT ##################################
357
################## DEFAULT ##################################
357
} else {    # DEFAULT
358
} else {    # DEFAULT
(-)a/admin/usage_statistics.pl (-7 / +7 lines)
Lines 43-55 if ( $op eq 'update' ) { Link Here
43
    my $UsageStatsLibraryUrl = $query->param('UsageStatsLibraryUrl');
43
    my $UsageStatsLibraryUrl = $query->param('UsageStatsLibraryUrl');
44
    my $UsageStatsLibrariesInfo = $query->param('UsageStatsLibrariesInfo');
44
    my $UsageStatsLibrariesInfo = $query->param('UsageStatsLibrariesInfo');
45
    my $UsageStatsGeolocation = $query->param('UsageStatsGeolocation');
45
    my $UsageStatsGeolocation = $query->param('UsageStatsGeolocation');
46
    C4::Context->set_preference('UsageStats', $UsageStats);
46
    Koha::Config::SysPrefs->set_preference('UsageStats', $UsageStats);
47
    C4::Context->set_preference('UsageStatsCountry', $UsageStatsCountry);
47
    Koha::Config::SysPrefs->set_preference('UsageStatsCountry', $UsageStatsCountry);
48
    C4::Context->set_preference('UsageStatsLibraryName', $UsageStatsLibraryName);
48
    Koha::Config::SysPrefs->set_preference('UsageStatsLibraryName', $UsageStatsLibraryName);
49
    C4::Context->set_preference('UsageStatsLibraryType', $UsageStatsLibraryType);
49
    Koha::Config::SysPrefs->set_preference('UsageStatsLibraryType', $UsageStatsLibraryType);
50
    C4::Context->set_preference('UsageStatsLibraryUrl', $UsageStatsLibraryUrl);
50
    Koha::Config::SysPrefs->set_preference('UsageStatsLibraryUrl', $UsageStatsLibraryUrl);
51
    C4::Context->set_preference('UsageStatsLibrariesInfo', $UsageStatsLibrariesInfo);
51
    Koha::Config::SysPrefs->set_preference('UsageStatsLibrariesInfo', $UsageStatsLibrariesInfo);
52
    C4::Context->set_preference('UsageStatsGeolocation', $UsageStatsGeolocation);
52
    Koha::Config::SysPrefs->set_preference('UsageStatsGeolocation', $UsageStatsGeolocation);
53
    my $libraries = Koha::Libraries->search;
53
    my $libraries = Koha::Libraries->search;
54
    while ( my $library = $libraries->next ) {
54
    while ( my $library = $libraries->next ) {
55
        if ( my $latlng = $query->param('geolocation_' . $library->branchcode) ) {
55
        if ( my $latlng = $query->param('geolocation_' . $library->branchcode) ) {
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +1 lines)
Lines 9651-9657 if ( CheckVersion($DBversion) ) { Link Here
9651
        WHERE variable = 'UsageStatsLibraryType'
9651
        WHERE variable = 'UsageStatsLibraryType'
9652
    ");
9652
    ");
9653
    if ( C4::Context->preference("UsageStatsLibraryType") eq "university" ) {
9653
    if ( C4::Context->preference("UsageStatsLibraryType") eq "university" ) {
9654
        C4::Context->set_preference("UsageStatsLibraryType", "academic")
9654
        Koha::Config::SysPrefs->set_preference("UsageStatsLibraryType", "academic")
9655
    }
9655
    }
9656
    print "Upgrade to $DBversion done (Bug 13436: Add more options to UsageStatsLibraryType)\n";
9656
    print "Upgrade to $DBversion done (Bug 13436: Add more options to UsageStatsLibraryType)\n";
9657
    SetVersion ($DBversion);
9657
    SetVersion ($DBversion);
(-)a/misc/admin/koha-preferences (-1 / +1 lines)
Lines 64-70 sub _set_preference { Link Here
64
        $value = 0;
64
        $value = 0;
65
    }
65
    }
66
66
67
    C4::Context->set_preference( $preference->{variable}, $value );
67
    Koha::Config::SysPrefs->set_preference( $preference->{variable}, $value );
68
}
68
}
69
69
70
sub GetPreferences {
70
sub GetPreferences {
(-)a/misc/cronjobs/share_usage_with_koha_community.pl (-1 / +1 lines)
Lines 46-52 if ($need_update) { Link Here
46
    say "Data need to be updated" if $verbose;
46
    say "Data need to be updated" if $verbose;
47
    my $report = C4::UsageStats::BuildReport();
47
    my $report = C4::UsageStats::BuildReport();
48
    C4::UsageStats::ReportToCommunity($report);
48
    C4::UsageStats::ReportToCommunity($report);
49
    C4::Context->set_preference( 'UsageStatsLastUpdateTime',
49
    Koha::Config::SysPrefs->set_preference( 'UsageStatsLastUpdateTime',
50
        strftime( "%s", localtime ) );
50
        strftime( "%s", localtime ) );
51
}
51
}
52
elsif ($verbose) {
52
elsif ($verbose) {
(-)a/svc/config/systempreferences (-2 / +2 lines)
Lines 72-78 sub set_preference { Link Here
72
    );
72
    );
73
73
74
    my $value = join( ',', $query->param( 'value' ) );
74
    my $value = join( ',', $query->param( 'value' ) );
75
    C4::Context->set_preference( $preference, $value );
75
    Koha::Config::SysPrefs->set_preference( $preference, $value );
76
76
77
    C4::Service->return_success( $response );
77
    C4::Service->return_success( $response );
78
}
78
}
Lines 143-149 sub set_preferences { Link Here
143
143
144
        my $value = join( ',', $query->multi_param( $param ) );
144
        my $value = join( ',', $query->multi_param( $param ) );
145
145
146
        C4::Context->set_preference( $pref, $value );
146
        Koha::Config::SysPrefs->set_preference( $pref, $value );
147
    }
147
    }
148
148
149
    C4::Service->return_success( $response );
149
    C4::Service->return_success( $response );
(-)a/tools/automatic_item_modification_by_age.pl (-2 / +1 lines)
Lines 93-99 if ( $op eq 'update' ) { Link Here
93
        push @rules, $rule;
93
        push @rules, $rule;
94
    }
94
    }
95
    my $syspref_content = to_json( \@rules );
95
    my $syspref_content = to_json( \@rules );
96
    C4::Context->set_preference($syspref_name, $syspref_content);
96
    Koha::Config::SysPrefs->set_preference($syspref_name, $syspref_content);
97
97
98
    $op = 'show';
98
    $op = 'show';
99
}
99
}
100
- 

Return to bug 35250