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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-1 / +9 lines)
Lines 320-326 Link Here
320
                            <input type="hidden" name="add" value="1" />
320
                            <input type="hidden" name="add" value="1" />
321
                        [% END %]
321
                        [% END %]
322
322
323
                        <fieldset class="rows">
323
                        <fieldset class="rows page-section">
324
                            <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
324
                            <input type="hidden" name="oldbranchcode" value="[% oldbranchcode | html %]" />
325
                            [% IF independant_branch %]
325
                            [% IF independant_branch %]
326
                                <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
326
                                <input type="hidden" name="branchcode" value="[% independant_branch | html %]" />
Lines 483-488 Link Here
483
                                [% WRAPPER tab_panels %]
483
                                [% WRAPPER tab_panels %]
484
                                    [% FOREACH lang IN letters.keys %]
484
                                    [% FOREACH lang IN letters.keys %]
485
                                        [% WRAPPER tab_panel tabname="lang_${lang}" %]
485
                                        [% WRAPPER tab_panel tabname="lang_${lang}" %]
486
                                            [% IF lang == 'default' %]
487
                                            <p><span class="label">Default language:</span> [% default_language | html %]</p>
488
                                            [% END %]
486
                                            [% PROCESS message_templates %]
489
                                            [% PROCESS message_templates %]
487
                                        [% END # /WRAPPER tab_panel %]
490
                                        [% END # /WRAPPER tab_panel %]
488
                                    [% END # /FOREACH lang %]
491
                                    [% END # /FOREACH lang %]
Lines 490-498 Link Here
490
                            [% END # /WRAPPER tabs#tabs %]
493
                            [% END # /WRAPPER tabs#tabs %]
491
                        [% ELSE %]
494
                        [% ELSE %]
492
                            <div style="clear:both"></div>
495
                            <div style="clear:both"></div>
496
                            <div class="page-section">
493
                            [% FOREACH lang IN letters.keys %]
497
                            [% FOREACH lang IN letters.keys %]
498
                                [% IF lang == 'default' %]
499
                                <p><span class="label">Default language:</span> [% default_language | html %]</p>
500
                                [% END %]
494
                                [% PROCESS message_templates %]
501
                                [% PROCESS message_templates %]
495
                            [% END # /FOREACH lang %]
502
                            [% END # /FOREACH lang %]
503
                            </div>
496
                        [% END # /IF TranslateNotices %]
504
                        [% END # /IF TranslateNotices %]
497
505
498
                        <input type="hidden" id="redirect" name="redirect" value="" />
506
                        <input type="hidden" id="redirect" name="redirect" value="" />
(-)a/tools/letter.pl (-16 / +14 lines)
Lines 162-194 sub add_form { Link Here
162
    my $templates = { map { $_ => { message_transport_type => $_ } } sort @$message_transport_types };
162
    my $templates = { map { $_ => { message_transport_type => $_ } } sort @$message_transport_types };
163
    my %letters = ( default => { templates => $templates } );
163
    my %letters = ( default => { templates => $templates } );
164
164
165
    my $translated_languages = C4::Languages::getTranslatedLanguages(
166
        'opac',
167
        C4::Context->preference('template')
168
    );
165
    if ( C4::Context->preference('TranslateNotices') ) {
169
    if ( C4::Context->preference('TranslateNotices') ) {
166
        my $translated_languages =
167
          C4::Languages::getTranslatedLanguages( 'opac',
168
            C4::Context->preference('template') );
169
        for my $language (@$translated_languages) {
170
        for my $language (@$translated_languages) {
170
            for my $sublanguage( @{ $language->{sublanguages_loop} } ) {
171
            for my $sublanguage ( @{ $language->{sublanguages_loop} } ) {
171
                if ( $language->{plural} ) {
172
                if ( $language->{plural} ) {
172
                    $letters{ $sublanguage->{rfc4646_subtag} } = {
173
                    $letters{ $sublanguage->{rfc4646_subtag} } = {
173
                        description => $sublanguage->{native_description}
174
                              description => $sublanguage->{native_description} . ' '
174
                          . ' '
175
                            . $sublanguage->{region_description} . ' ('
175
                          . $sublanguage->{region_description} . ' ('
176
                            . $sublanguage->{rfc4646_subtag} . ')',
176
                          . $sublanguage->{rfc4646_subtag} . ')',
177
                        templates => {%$templates},
177
                        templates => { %$templates },
178
                    };
178
                    };
179
                }
179
                } else {
180
                else {
181
                    $letters{ $sublanguage->{rfc4646_subtag} } = {
180
                    $letters{ $sublanguage->{rfc4646_subtag} } = {
182
                        description => $sublanguage->{native_description}
181
                        description => $sublanguage->{native_description} . ' (' . $sublanguage->{rfc4646_subtag} . ')',
183
                          . ' ('
182
                        templates   => {%$templates},
184
                          . $sublanguage->{rfc4646_subtag} . ')',
185
                        templates => { %$templates },
186
                    };
183
                    };
187
                }
184
                }
188
            }
185
            }
189
        }
186
        }
190
        $template->param( languages => $translated_languages );
187
        $template->param( languages => $translated_languages );
191
    }
188
    }
189
    my $default_language = @{ @{$translated_languages}[0]->{sublanguages_loop} }[0]->{native_description};
190
    $template->param( default_language => $default_language );
192
    if ($letters) {
191
    if ($letters) {
193
        $template->param(
192
        $template->param(
194
            modify     => 1,
193
            modify     => 1,
195
- 

Return to bug 33237