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

(-)a/C4/Csv.pm (-19 lines)
Lines 34-40 use vars qw(@ISA @EXPORT); Link Here
34
  &GetCsvProfiles
34
  &GetCsvProfiles
35
  &GetCsvProfile
35
  &GetCsvProfile
36
  &GetCsvProfileId
36
  &GetCsvProfileId
37
  &GetCsvProfilesLoop
38
  &GetMarcFieldsForCsv
37
  &GetMarcFieldsForCsv
39
);
38
);
40
39
Lines 94-116 sub GetMarcFieldsForCsv { Link Here
94
 
93
 
95
}
94
}
96
95
97
# Returns informations aboout csv profiles suitable for html templates
98
sub GetCsvProfilesLoop {
99
    my ( $type ) = @_;
100
    # List of existing profiles
101
    my $dbh = C4::Context->dbh;
102
    my $sth;
103
    my $query = "SELECT export_format_id, profile FROM export_format";
104
    if ( $type ) {
105
        $query .= " WHERE type = ?";
106
    }
107
108
    $sth = $dbh->prepare($query);
109
    $sth->execute( $type ? $type : () );
110
    return $sth->fetchall_arrayref({});
111
112
}
113
114
115
96
116
1;
97
1;
(-)a/basket/basket.pl (-4 / +4 lines)
Lines 16-30 Link Here
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
17
18
18
19
use strict;
19
use Modern::Perl;
20
use warnings;
21
use CGI qw ( -utf8 );
20
use CGI qw ( -utf8 );
22
use C4::Koha;
21
use C4::Koha;
23
use C4::Biblio;
22
use C4::Biblio;
24
use C4::Items;
23
use C4::Items;
25
use C4::Auth;
24
use C4::Auth;
26
use C4::Output;
25
use C4::Output;
27
use C4::Csv;
26
27
use Koha::CsvProfiles;
28
28
29
my $query = new CGI;
29
my $query = new CGI;
30
30
Lines 121-127 my $resultsarray = \@results; Link Here
121
121
122
$template->param(
122
$template->param(
123
    BIBLIO_RESULTS => $resultsarray,
123
    BIBLIO_RESULTS => $resultsarray,
124
    csv_profiles => GetCsvProfilesLoop('marc'),
124
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ],
125
    bib_list => $bib_list,
125
    bib_list => $bib_list,
126
);
126
);
127
127
(-)a/basket/downloadcart.pl (-3 / +5 lines)
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use strict;
20
use Modern::Perl;
21
use warnings;
22
21
23
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
24
use Encode qw(encode);
23
use Encode qw(encode);
Lines 30-35 use C4::Output; Link Here
30
use C4::Record;
29
use C4::Record;
31
use C4::Ris;
30
use C4::Ris;
32
use C4::Csv;
31
use C4::Csv;
32
33
use Koha::CsvProfiles;
34
33
use utf8;
35
use utf8;
34
my $query = new CGI;
36
my $query = new CGI;
35
37
Lines 89-95 if ($bib_list && $format) { Link Here
89
    print $output;
91
    print $output;
90
92
91
} else { 
93
} else { 
92
    $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
94
    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
93
    $template->param(bib_list => $bib_list); 
95
    $template->param(bib_list => $bib_list); 
94
    output_html_with_http_headers $query, $cookie, $template->output;
96
    output_html_with_http_headers $query, $cookie, $template->output;
95
}
97
}
(-)a/opac/opac-downloadcart.pl (-3 / +5 lines)
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use strict;
20
use Modern::Perl;
21
use warnings;
22
21
23
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
24
use Encode qw(encode);
23
use Encode qw(encode);
Lines 30-35 use C4::Output; Link Here
30
use C4::Record;
29
use C4::Record;
31
use C4::Ris;
30
use C4::Ris;
32
use C4::Csv;
31
use C4::Csv;
32
33
use Koha::CsvProfiles;
34
33
use utf8;
35
use utf8;
34
my $query = new CGI;
36
my $query = new CGI;
35
37
Lines 95-101 if ($bib_list && $format) { Link Here
95
    print $output;
97
    print $output;
96
98
97
} else { 
99
} else { 
98
    $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
100
    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
99
    $template->param(bib_list => $bib_list); 
101
    $template->param(bib_list => $bib_list); 
100
    output_html_with_http_headers $query, $cookie, $template->output;
102
    output_html_with_http_headers $query, $cookie, $template->output;
101
}
103
}
(-)a/opac/opac-downloadshelf.pl (-3 / +3 lines)
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use strict;
20
use Modern::Perl;
21
use warnings;
22
21
23
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
24
use Encode qw(encode);
23
use Encode qw(encode);
Lines 31-36 use C4::Record; Link Here
31
use C4::Ris;
30
use C4::Ris;
32
use C4::Csv;
31
use C4::Csv;
33
32
33
use Koha::CsvProfiles;
34
use Koha::Virtualshelves;
34
use Koha::Virtualshelves;
35
35
36
use utf8;
36
use utf8;
Lines 118-124 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
118
        } else {
118
        } else {
119
            $template->param(fullpage => 1);
119
            $template->param(fullpage => 1);
120
        }
120
        }
121
        $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
121
        $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
122
        $template->param( shelf => $shelf );
122
        $template->param( shelf => $shelf );
123
        output_html_with_http_headers $query, $cookie, $template->output;
123
        output_html_with_http_headers $query, $cookie, $template->output;
124
    }
124
    }
(-)a/virtualshelves/downloadshelf.pl (-3 / +3 lines)
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use strict;
20
use Modern::Perl;
21
use warnings;
22
21
23
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
24
use Encode qw(encode);
23
use Encode qw(encode);
Lines 31-36 use C4::Record; Link Here
31
use C4::Ris;
30
use C4::Ris;
32
use C4::Csv;
31
use C4::Csv;
33
32
33
use Koha::CsvProfiles;
34
use Koha::Virtualshelves;
34
use Koha::Virtualshelves;
35
35
36
use utf8;
36
use utf8;
Lines 101-107 if ($shelfid && $format) { Link Here
101
    $format = "csv" if ($format =~ m/^\d+$/);
101
    $format = "csv" if ($format =~ m/^\d+$/);
102
}
102
}
103
else {
103
else {
104
    $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
104
    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
105
    $template->param(shelfid => $shelfid); 
105
    $template->param(shelfid => $shelfid); 
106
}
106
}
107
$template->param( messages => \@messages );
107
$template->param( messages => \@messages );
(-)a/virtualshelves/shelves.pl (-2 / +3 lines)
Lines 27-32 use C4::Items; Link Here
27
use C4::Members;
27
use C4::Members;
28
use C4::Output;
28
use C4::Output;
29
use C4::XSLT;
29
use C4::XSLT;
30
31
use Koha::CsvProfiles;
30
use Koha::Virtualshelves;
32
use Koha::Virtualshelves;
31
33
32
my $query = new CGI;
34
my $query = new CGI;
Lines 309-315 $template->param( Link Here
309
    messages => \@messages,
311
    messages => \@messages,
310
    category => $category,
312
    category => $category,
311
    print    => scalar $query->param('print') || 0,
313
    print    => scalar $query->param('print') || 0,
312
    csv_profiles => GetCsvProfilesLoop('marc'),
314
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ],
313
);
315
);
314
316
315
output_html_with_http_headers $query, $cookie, $template->output;
317
output_html_with_http_headers $query, $cookie, $template->output;
316
- 

Return to bug 15451