# Returns informations aboout csv profiles suitable for html templates
sub GetCsvProfilesLoop {
- # List of existing profiles
+ my ( $type ) = @_;
+ # List of existing profiles
my $dbh = C4::Context->dbh;
my $sth;
my $query = "SELECT export_format_id, profile FROM export_format";
+ if ( $type ) {
+ $query .= " WHERE type = ?";
+ }
+
$sth = $dbh->prepare($query);
- $sth->execute();
+ $sth->execute( $type ? $type : () );
return $sth->fetchall_arrayref({});
}
shelvesloopall => [ ( @shelvesloop, @shelveslooppriv ) ],
numberCanManage => $numberCanManage,
"BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1,
- csv_profiles => GetCsvProfilesLoop()
+ csv_profiles => GetCsvProfilesLoop('marc')
);
if ( $shelfnumber
or $shelves
$template->param(
BIBLIO_RESULTS => $resultsarray,
- csv_profiles => GetCsvProfilesLoop(),
+ csv_profiles => GetCsvProfilesLoop('marc'),
bib_list => $bib_list,
);
print $output;
} else {
- $template->param(csv_profiles => GetCsvProfilesLoop());
+ $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
$template->param(bib_list => $bib_list);
output_html_with_http_headers $query, $cookie, $template->output;
}
print $output;
} else {
- $template->param(csv_profiles => GetCsvProfilesLoop());
+ $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
$template->param(bib_list => $bib_list);
output_html_with_http_headers $query, $cookie, $template->output;
}
print $output;
} else {
- $template->param(csv_profiles => GetCsvProfilesLoop());
+ $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
$template->param(shelfid => $shelfid);
output_html_with_http_headers $query, $cookie, $template->output;
}
print $output;
}
else {
- $template->param(csv_profiles => GetCsvProfilesLoop());
+ $template->param(csv_profiles => GetCsvProfilesLoop('marc'));
$template->param(shelfid => $shelfid);
output_html_with_http_headers $query, $cookie, $template->output;
}