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

(-)a/C4/Koha.pm (+28 lines)
Lines 47-52 BEGIN { Link Here
47
		&getframeworks &getframeworkinfo
47
		&getframeworks &getframeworkinfo
48
		&getauthtypes &getauthtype
48
		&getauthtypes &getauthtype
49
		&getallthemes
49
		&getallthemes
50
		getallbasketgroupslayouts
50
		&getFacets
51
		&getFacets
51
		&displayServers
52
		&displayServers
52
		&getnbpages
53
		&getnbpages
Lines 684-689 sub getallthemes { Link Here
684
    return @themes;
685
    return @themes;
685
}
686
}
686
687
688
=head2 getallbasketgroupslayouts
689
690
  (@pdflayouts) = &getallbasketgroupslayouts();
691
692
Returns an array of all available basketgroup layouts
693
based on *. pm files in acqui/pdfformat
694
695
=cut
696
697
sub getallbasketgroupslayouts {
698
    my $type = shift;
699
    my $pdfdir;
700
    my @pdflayouts;
701
    $pdfdir = C4::Context->config('intranetdir');
702
    $pdfdir .= "/acqui/pdfformat";
703
    opendir DIR, $pdfdir;
704
    my @filelist = readdir DIR;
705
    foreach my $myfile (@filelist) {
706
        next unless (-f "$pdfdir/$myfile");
707
        next unless ($myfile =~ m/\.pm$/);
708
#keeping only *.pm files
709
        $myfile =~s/\.pm$//;
710
        push @pdflayouts,"pdfformat::".$myfile;
711
    }
712
    return @pdflayouts;
713
}
714
687
sub getFacets {
715
sub getFacets {
688
    my $facets;
716
    my $facets;
689
    if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
717
    if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
(-)a/acqui/basketgroup.pl (-11 lines)
Lines 184-207 sub displaybasketgroups { Link Here
184
184
185
sub printbasketgrouppdf{
185
sub printbasketgrouppdf{
186
    my ($basketgroupid) = @_;
186
    my ($basketgroupid) = @_;
187
    
188
    my $pdfformat = C4::Context->preference("OrderPdfFormat");
187
    my $pdfformat = C4::Context->preference("OrderPdfFormat");
189
    if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages'){
190
	eval {
188
	eval {
191
        eval "require $pdfformat";
189
        eval "require $pdfformat";
192
	    import $pdfformat;
190
	    import $pdfformat;
193
	};
191
	};
194
	if ($@){
192
	if ($@){
195
	}
193
	}
196
    }
197
    else {
198
	print $input->header;  
199
	print $input->start_html;  # FIXME Should do a nicer page
200
	print "<h1>Invalid PDF Format set</h1>";
201
	print "Please go to the systempreferences and set a valid pdfformat";
202
	exit;
203
    }
204
    
205
    my $basketgroup = GetBasketgroup($basketgroupid);
194
    my $basketgroup = GetBasketgroup($basketgroupid);
206
    my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'});
195
    my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'});
207
    my $baskets = GetBasketsByBasketgroup($basketgroupid);
196
    my $baskets = GetBasketsByBasketgroup($basketgroupid);
(-)a/admin/preferences.pl (+2 lines)
Lines 93-98 sub _get_chunk { Link Here
93
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) }
93
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) }
94
            } elsif ( $options{'choices'} eq 'staff-templates' ) {
94
            } elsif ( $options{'choices'} eq 'staff-templates' ) {
95
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) }
95
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) }
96
            } elsif ( $options{'choices'} eq 'basketgroupspdflayouts' ) {
97
                $options{'choices'} = { map { $_ => $_ } getallbasketgroupslayouts ()}
96
            } else {
98
            } else {
97
                die 'Unrecognized source of preference values: ' . $options{'choices'};
99
                die 'Unrecognized source of preference values: ' . $options{'choices'};
98
            }
100
            }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref (-1 / +1 lines)
Lines 40-43 Acquisitions: Link Here
40
        -
40
        -
41
            - Use
41
            - Use
42
            - pref: OrderPdfFormat
42
            - pref: OrderPdfFormat
43
              choices: basketgroupspdflayouts
43
            - when printing basket groups.
44
            - when printing basket groups.
44
- 

Return to bug 10135