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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt (-3 / +5 lines)
Lines 53-64 Link Here
53
            type: 'PUT',
53
            type: 'PUT',
54
            url: '/cgi-bin/koha/svc/localization',
54
            url: '/cgi-bin/koha/svc/localization',
55
            success: function (data) {
55
            success: function (data) {
56
                if ( data.is_changed ) {
56
                if ( data.error ) {
57
                    $(cell).css('background-color', '#FF0000');
58
                    show_message({ type: 'error_on_update', data: data });
59
                } else if ( data.is_changed == 1 ) {
57
                    $(cell).css('background-color', '#00FF00');
60
                    $(cell).css('background-color', '#00FF00');
58
                    show_message({ type: 'success_on_update', data: data });
61
                    show_message({ type: 'success_on_update', data: data });
59
                } else {
60
                    show_message({ type: 'error_on_update', data: data });
61
                }
62
                }
63
62
                if ( $(cell).hasClass('lang') ) {
64
                if ( $(cell).hasClass('lang') ) {
63
                    $(cell).text(data.lang)
65
                    $(cell).text(data.lang)
64
                } else if ( $(cell).hasClass('translation') ) {
66
                } else if ( $(cell).hasClass('translation') ) {
(-)a/svc/localization (-1 / +3 lines)
Lines 37-43 sub update_translation { Link Here
37
        $localization->translation( $translation )
37
        $localization->translation( $translation )
38
    }
38
    }
39
    my %params;
39
    my %params;
40
    my $is_changed;
40
    if ( $localization->is_changed ) {
41
    if ( $localization->is_changed ) {
42
        $is_changed = 1;
41
        unless ( Koha::Localizations->search( { entity => $localization->entity, code => $localization->code, lang => $lang, localization_id => { '!=' => $localization->localization_id }, } )->count ) {
43
        unless ( Koha::Localizations->search( { entity => $localization->entity, code => $localization->code, lang => $lang, localization_id => { '!=' => $localization->localization_id }, } )->count ) {
42
            $localization->store;
44
            $localization->store;
43
        } else {
45
        } else {
Lines 52-57 sub update_translation { Link Here
52
        code        => Encode::encode('utf-8', $localization->code),
54
        code        => Encode::encode('utf-8', $localization->code),
53
        lang        => Encode::encode('utf-8', $localization->lang),
55
        lang        => Encode::encode('utf-8', $localization->lang),
54
        translation => Encode::encode('utf-8', $localization->translation),
56
        translation => Encode::encode('utf-8', $localization->translation),
57
        is_changed  => $is_changed,
55
    );
58
    );
56
    C4::Service->return_success( $response );
59
    C4::Service->return_success( $response );
57
}
60
}
58
- 

Return to bug 15477