# only export API methods
@EXPORT = qw(
- &GetCsvProfiles
&GetCsvProfile
&GetCsvProfileId
&GetMarcFieldsForCsv
);
-# Returns all informations about csv profiles
-sub GetCsvProfiles {
- my ( $type ) = @_;
- my $dbh = C4::Context->dbh;
- my $query = "SELECT * FROM export_format";
- if ( $type ) {
- $query .= " WHERE type = ?";
- }
-
- $sth = $dbh->prepare($query);
- $sth->execute( $type ? $type : () );
-
- $sth->fetchall_arrayref({});
-
-}
-
# Returns all informations about a given csv profile
sub GetCsvProfile {
my ($id) = @_;
C<$biblio> - a list of biblionumbers
-C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id and the GetCsvProfiles function in C4::Csv)
+C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id)
C<$itemnumbers> - a list of itemnumbers to export
C<$biblio> - a biblionumber
-C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id and the GetCsvProfiles function in C4::Csv)
+C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id)
C<$header> - true if the headers are to be printed (typically at first pass)
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
-use strict;
-use warnings;
+use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth;
use C4::Serials;
use C4::Branch; # GetBranches GetBranchesLoop
use C4::Koha qw( GetAuthorisedValues );
use Koha::AdditionalField;
-use C4::Csv qw( GetCsvProfiles );
+use Koha::CsvProfiles;
+use C4::Csv;
my $input = CGI->new;
claimletter => $claimletter,
branchloop => $branchloop,
additional_fields_for_subscription => $additional_fields,
- csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
+ csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ],
letters => $letters,
(uc(C4::Context->preference("marcflavour"))) => 1
);
use Koha::Authority::Types;
use Koha::Biblioitems;
+use Koha::CsvProfiles;
use Koha::Database;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Exporter::Record;
itemtypeloop => \@itemtypesloop,
authority_types => $authority_types,
export_remove_fields => C4::Context->preference("ExportRemoveFields"),
- csv_profiles => C4::Csv::GetCsvProfiles('marc'),
+ csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }),
);
output_html_with_http_headers $query, $cookie, $template->output;