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

(-)a/C4/Csv.pm (-19 lines)
Lines 36-42 $VERSION = 3.07.00.049; Link Here
36
  &GetCsvProfiles
36
  &GetCsvProfiles
37
  &GetCsvProfile
37
  &GetCsvProfile
38
  &GetCsvProfileId
38
  &GetCsvProfileId
39
  &GetCsvProfilesLoop
40
  &GetMarcFieldsForCsv
39
  &GetMarcFieldsForCsv
41
);
40
);
42
41
Lines 96-118 sub GetMarcFieldsForCsv { Link Here
96
 
95
 
97
}
96
}
98
97
99
# Returns informations aboout csv profiles suitable for html templates
100
sub GetCsvProfilesLoop {
101
    my ( $type ) = @_;
102
    # List of existing profiles
103
    my $dbh = C4::Context->dbh;
104
    my $sth;
105
    my $query = "SELECT export_format_id, profile FROM export_format";
106
    if ( $type ) {
107
        $query .= " WHERE type = ?";
108
    }
109
110
    $sth = $dbh->prepare($query);
111
    $sth->execute( $type ? $type : () );
112
    return $sth->fetchall_arrayref({});
113
114
}
115
116
117
98
118
1;
99
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 112-118 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
112
        } else {
112
        } else {
113
            $template->param(fullpage => 1);
113
            $template->param(fullpage => 1);
114
        }
114
        }
115
        $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
115
        $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
116
        $template->param( shelf => $shelf );
116
        $template->param( shelf => $shelf );
117
        output_html_with_http_headers $query, $cookie, $template->output;
117
        output_html_with_http_headers $query, $cookie, $template->output;
118
    }
118
    }
(-)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 302-308 $template->param( Link Here
302
    messages => \@messages,
304
    messages => \@messages,
303
    category => $category,
305
    category => $category,
304
    print    => $query->param('print') || 0,
306
    print    => $query->param('print') || 0,
305
    csv_profiles => GetCsvProfilesLoop('marc'),
307
    csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ],
306
);
308
);
307
309
308
output_html_with_http_headers $query, $cookie, $template->output;
310
output_html_with_http_headers $query, $cookie, $template->output;
309
- 

Return to bug 15451