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

(-)a/C4/Koha.pm (-2 / +2 lines)
Lines 126-132 returns the full path to the appropriate directory containing images. Link Here
126
sub getitemtypeimagedir {
126
sub getitemtypeimagedir {
127
	my $src = shift || 'opac';
127
	my $src = shift || 'opac';
128
	if ($src eq 'intranet') {
128
	if ($src eq 'intranet') {
129
		return C4::Context->config('intrahtdocs') . '/' .C4::Context->preference('template') . '/img/itemtypeimg';
129
		return C4::Context->config('intrahtdocs') . '/' .C4::Context->preference('intranet_theme') . '/img/itemtypeimg';
130
	} else {
130
	} else {
131
		return C4::Context->config('opachtdocs') . '/' . C4::Context->preference('opacthemes') . '/itemtypeimg';
131
		return C4::Context->config('opachtdocs') . '/' . C4::Context->preference('opacthemes') . '/itemtypeimg';
132
	}
132
	}
Lines 135-141 sub getitemtypeimagedir { Link Here
135
sub getitemtypeimagesrc {
135
sub getitemtypeimagesrc {
136
	my $src = shift || 'opac';
136
	my $src = shift || 'opac';
137
	if ($src eq 'intranet') {
137
	if ($src eq 'intranet') {
138
		return '/intranet-tmpl' . '/' .	C4::Context->preference('template') . '/img/itemtypeimg';
138
		return '/intranet-tmpl' . '/' .	C4::Context->preference('intranet_theme') . '/img/itemtypeimg';
139
	} else {
139
	} else {
140
		return '/opac-tmpl' . '/' . C4::Context->preference('opacthemes') . '/itemtypeimg';
140
		return '/opac-tmpl' . '/' . C4::Context->preference('opacthemes') . '/itemtypeimg';
141
	}
141
	}
(-)a/C4/Languages.pm (-1 / +1 lines)
Lines 604-610 sub getlanguage { Link Here
604
604
605
    $cgi //= CGI->new;
605
    $cgi //= CGI->new;
606
    my $interface = C4::Context->interface;
606
    my $interface = C4::Context->interface;
607
    my $theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'template' );
607
    my $theme = C4::Context->preference( ( $interface eq 'opac' ) ? 'opacthemes' : 'intranet_theme' );
608
    my $language;
608
    my $language;
609
609
610
    my $preference_to_check =
610
    my $preference_to_check =
(-)a/C4/Templates.pm (-2 / +2 lines)
Lines 280-287 sub availablethemes { Link Here
280
280
281
    # Get theme
281
    # Get theme
282
    my @themes;
282
    my @themes;
283
    my $theme_syspref    = ($interface eq 'intranet') ? 'template' : 'opacthemes';
283
    my $theme_syspref    = ($interface eq 'intranet') ? 'intranet_theme' : 'opacthemes';
284
    my $fallback_syspref = ($interface eq 'intranet') ? 'template' : 'OPACFallback';
284
    my $fallback_syspref = ($interface eq 'intranet') ? 'intranet_theme' : 'OPACFallback';
285
    # Yeah, hardcoded, last resort if the DB is not populated
285
    # Yeah, hardcoded, last resort if the DB is not populated
286
    my $hardcoded_theme = ($interface eq 'intranet') ? 'prog' : 'bootstrap';
286
    my $hardcoded_theme = ($interface eq 'intranet') ? 'prog' : 'bootstrap';
287
287
(-)a/Koha/pdfformat/layout2pages.pm (-1 / +1 lines)
Lines 246-252 sub printfooters { Link Here
246
sub printpdf {
246
sub printpdf {
247
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
247
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
248
    # open the default PDF that will be used for base (1st page already filled)
248
    # open the default PDF that will be used for base (1st page already filled)
249
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout2pages.pdf';
249
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('intranet_theme') . '/pdf/layout2pages.pdf';
250
    my $pdf = PDF::API2->open($pdf_template);
250
    my $pdf = PDF::API2->open($pdf_template);
251
    $pdf->pageLabel( 0, {
251
    $pdf->pageLabel( 0, {
252
        -style => 'roman',
252
        -style => 'roman',
(-)a/Koha/pdfformat/layout2pagesde.pm (-1 / +1 lines)
Lines 245-251 sub printfooters { Link Here
245
sub printpdf {
245
sub printpdf {
246
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
246
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
247
    # open the default PDF that will be used for base (1st page already filled)
247
    # open the default PDF that will be used for base (1st page already filled)
248
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout2pagesde.pdf';
248
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('intranet_theme') . '/pdf/layout2pagesde.pdf';
249
    my $pdf = PDF::API2->open($pdf_template);
249
    my $pdf = PDF::API2->open($pdf_template);
250
    $pdf->pageLabel( 0, {
250
    $pdf->pageLabel( 0, {
251
        -style => 'roman',
251
        -style => 'roman',
(-)a/Koha/pdfformat/layout3pages.pm (-1 / +1 lines)
Lines 413-419 sub printfooters { Link Here
413
sub printpdf {
413
sub printpdf {
414
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
414
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
415
    # open the default PDF that will be used for base (1st page already filled)
415
    # open the default PDF that will be used for base (1st page already filled)
416
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout3pages.pdf';
416
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('intranet_theme') . '/pdf/layout3pages.pdf';
417
    my $pdf = PDF::API2->open($pdf_template);
417
    my $pdf = PDF::API2->open($pdf_template);
418
    $pdf->pageLabel( 0, {
418
    $pdf->pageLabel( 0, {
419
        -style => 'roman',
419
        -style => 'roman',
(-)a/Koha/pdfformat/layout3pagesfr.pm (-1 / +1 lines)
Lines 415-421 sub printfooters { Link Here
415
sub printpdf {
415
sub printpdf {
416
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
416
    my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
417
    # open the default PDF that will be used for base (1st page already filled)
417
    # open the default PDF that will be used for base (1st page already filled)
418
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout3pagesfr.pdf';
418
    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('intranet_theme') . '/pdf/layout3pagesfr.pdf';
419
    my $pdf = PDF::API2->open($pdf_template);
419
    my $pdf = PDF::API2->open($pdf_template);
420
    $pdf->pageLabel( 0, {
420
    $pdf->pageLabel( 0, {
421
        -style => 'roman',
421
        -style => 'roman',
(-)a/admin/itemtypes.pl (-1 / +1 lines)
Lines 60-66 if ( $op eq 'add_form' ) { Link Here
60
    my $parent_types = Koha::ItemTypes->search({parent_type=>undef,itemtype => {'!='=>$itemtype_code}});
60
    my $parent_types = Koha::ItemTypes->search({parent_type=>undef,itemtype => {'!='=>$itemtype_code}});
61
    my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) );
61
    my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) );
62
    my $searchcategory = GetAuthorisedValues("ITEMTYPECAT");
62
    my $searchcategory = GetAuthorisedValues("ITEMTYPECAT");
63
    my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') );
63
    my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('intranet_theme') );
64
    $template->param(
64
    $template->param(
65
        itemtype  => $itemtype,
65
        itemtype  => $itemtype,
66
        parent_type => $parent_type,
66
        parent_type => $parent_type,
(-)a/admin/localization.pl (-1 / +1 lines)
Lines 50-56 while ( my $s = $rs->next ) { Link Here
50
      };
50
      };
51
}
51
}
52
52
53
my $translated_languages = C4::Languages::getTranslatedLanguages( 'intranet', C4::Context->preference('template') );
53
my $translated_languages = C4::Languages::getTranslatedLanguages( 'intranet', C4::Context->preference('intranet_theme') );
54
54
55
$template->param(
55
$template->param(
56
    translations => \@translations,
56
    translations => \@translations,
(-)a/admin/preferences.pl (-1 / +1 lines)
Lines 83-89 sub _get_chunk { Link Here
83
        } else {
83
        } else {
84
            # this is the staff interface
84
            # this is the staff interface
85
            $interface = 'intranet';
85
            $interface = 'intranet';
86
            $theme     = C4::Context->preference('template');
86
            $theme     = C4::Context->preference('intranet_theme');
87
        }
87
        }
88
        $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages );
88
        $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages );
89
        $chunk->{'type'} = 'languages';
89
        $chunk->{'type'} = 'languages';
(-)a/admin/systempreferences.pl (-1 / +1 lines)
Lines 184-190 sub GetPrefParams { Link Here
184
184
185
            # this is the staff interface
185
            # this is the staff interface
186
            $interface = 'intranet';
186
            $interface = 'intranet';
187
            $theme     = C4::Context->preference('template');
187
            $theme     = C4::Context->preference('intranet_theme');
188
        }
188
        }
189
        my $languages_loop = getTranslatedLanguages( $interface, $theme, $lang, $currently_selected_languages );
189
        my $languages_loop = getTranslatedLanguages( $interface, $theme, $lang, $currently_selected_languages );
190
190
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 672-678 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
672
('TagsShowOnDetail','10','','Number of tags to display on detail page.  0 is off.','Integer'),
672
('TagsShowOnDetail','10','','Number of tags to display on detail page.  0 is off.','Integer'),
673
('TagsShowOnList','6','','Number of tags to display on search results list.  0 is off.','Integer'),
673
('TagsShowOnList','6','','Number of tags to display on search results list.  0 is off.','Integer'),
674
('TalkingTechItivaPhoneNotification','0',NULL,'If ON, enables Talking Tech I-tiva phone notifications','YesNo'),
674
('TalkingTechItivaPhoneNotification','0',NULL,'If ON, enables Talking Tech I-tiva phone notifications','YesNo'),
675
('template','prog','','Define the preferred staff interface template','Themes'),
675
('intranet_theme','prog','','Define the preferred staff interface template','Themes'),
676
('ThingISBN','0','','Use with FRBRizeEditions. If ON, Koha will use the ThingISBN web service in the Editions tab on the detail pages.','YesNo'),
676
('ThingISBN','0','','Use with FRBRizeEditions. If ON, Koha will use the ThingISBN web service in the Editions tab on the detail pages.','YesNo'),
677
('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice'),
677
('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice'),
678
('timeout','1d',NULL,'Inactivity timeout for cookies authentication','Free'),
678
('timeout','1d',NULL,'Inactivity timeout for cookies authentication','Free'),
(-)a/members/memberentry.pl (-1 / +1 lines)
Lines 866-872 if ( defined $min ) { Link Here
866
}
866
}
867
867
868
if ( C4::Context->preference('TranslateNotices') ) {
868
if ( C4::Context->preference('TranslateNotices') ) {
869
    my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('template') );
869
    my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('intranet_theme') );
870
    $template->param( languages => $translated_languages );
870
    $template->param( languages => $translated_languages );
871
}
871
}
872
872
(-)a/opac/opac-messaging.pl (-1 / +1 lines)
Lines 91-97 $template->param( Link Here
91
);
91
);
92
92
93
if ( C4::Context->preference('TranslateNotices') ) {
93
if ( C4::Context->preference('TranslateNotices') ) {
94
    my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('template') );
94
    my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('intranet_theme') );
95
    $template->param(
95
    $template->param(
96
        languages => $translated_languages,
96
        languages => $translated_languages,
97
        patron_lang => $patron->lang,
97
        patron_lang => $patron->lang,
(-)a/t/db_dependent/Search.t (-1 / +1 lines)
Lines 146-152 $contextmodule->mock('preference', sub { Link Here
146
        return '--';
146
        return '--';
147
    } elsif ($pref eq 'casAuthentication' or $pref eq 'casLogout' or $pref eq 'casServerUrl' ) {
147
    } elsif ($pref eq 'casAuthentication' or $pref eq 'casLogout' or $pref eq 'casServerUrl' ) {
148
        return '';
148
        return '';
149
    } elsif ($pref eq 'template') {
149
    } elsif ($pref eq 'intranet_theme') {
150
        return 'prog';
150
        return 'prog';
151
    } elsif ($pref eq 'OPACXSLTResultsDisplay') {
151
    } elsif ($pref eq 'OPACXSLTResultsDisplay') {
152
        return C4::XSLT::_get_best_default_xslt_filename($htdocs, 'bootstrap','en',$marcflavour . 'slim2OPACResults.xsl');
152
        return C4::XSLT::_get_best_default_xslt_filename($htdocs, 'bootstrap','en',$marcflavour . 'slim2OPACResults.xsl');
(-)a/t/db_dependent/Templates.t (-1 / +1 lines)
Lines 67-73 subtest 'Testing themelanguage' => sub { Link Here
67
    my $cgi = CGI->new();
67
    my $cgi = CGI->new();
68
    my $htdocs = C4::Context->config('intrahtdocs');
68
    my $htdocs = C4::Context->config('intrahtdocs');
69
    my $section = 'intranet';
69
    my $section = 'intranet';
70
    t::lib::Mocks::mock_preference( 'template', 'prog' );
70
    t::lib::Mocks::mock_preference( 'intranet_theme', 'prog' );
71
71
72
    # trigger first case.
72
    # trigger first case.
73
    $testing_language = 'en';
73
    $testing_language = 'en';
(-)a/tools/letter.pl (-2 / +1 lines)
Lines 161-167 sub add_form { Link Here
161
    if ( C4::Context->preference('TranslateNotices') ) {
161
    if ( C4::Context->preference('TranslateNotices') ) {
162
        my $translated_languages =
162
        my $translated_languages =
163
          C4::Languages::getTranslatedLanguages( 'opac',
163
          C4::Languages::getTranslatedLanguages( 'opac',
164
            C4::Context->preference('template') );
164
            C4::Context->preference('intranet_theme') );
165
        for my $language (@$translated_languages) {
165
        for my $language (@$translated_languages) {
166
            for my $sublanguage( @{ $language->{sublanguages_loop} } ) {
166
            for my $sublanguage( @{ $language->{sublanguages_loop} } ) {
167
                if ( $language->{plural} ) {
167
                if ( $language->{plural} ) {
168
- 

Return to bug 29246