Lines 25-30
use Digest::MD5 qw(md5_base64);
Link Here
|
25 |
use POSIX qw(strftime); |
25 |
use POSIX qw(strftime); |
26 |
|
26 |
|
27 |
use C4::Context; |
27 |
use C4::Context; |
|
|
28 |
use C4::DBQ; |
28 |
use C4::Debug; |
29 |
use C4::Debug; |
29 |
|
30 |
|
30 |
|
31 |
|
Lines 266-273
sub _export_table_sql
Link Here
|
266 |
|
267 |
|
267 |
eval { |
268 |
eval { |
268 |
# First row with the name of the columns |
269 |
# First row with the name of the columns |
269 |
my $query = 'SHOW COLUMNS FROM ' . $table; |
270 |
my $dbq = C4::DBQ->dbq; |
270 |
my $sth = $dbh->prepare($query); |
271 |
my $sth = $dbh->prepare($dbq->tableColumns($table)); |
271 |
$sth->execute(); |
272 |
$sth->execute(); |
272 |
my @fields = (); |
273 |
my @fields = (); |
273 |
while (my $hashRef = $sth->fetchrow_hashref) { |
274 |
while (my $hashRef = $sth->fetchrow_hashref) { |
Lines 305-312
sub _export_table_csv
Link Here
|
305 |
|
306 |
|
306 |
eval { |
307 |
eval { |
307 |
# First row with the name of the columns |
308 |
# First row with the name of the columns |
308 |
my $query = 'SHOW COLUMNS FROM ' . $table; |
309 |
my $dbq = C4::DBQ->dbq; |
309 |
my $sth = $dbh->prepare($query); |
310 |
my $sth = $dbh->prepare($dbq->tableColumns($table)); |
310 |
$sth->execute(); |
311 |
$sth->execute(); |
311 |
my @fields = (); |
312 |
my @fields = (); |
312 |
while (my $hashRef = $sth->fetchrow_hashref) { |
313 |
while (my $hashRef = $sth->fetchrow_hashref) { |
Lines 361-368
sub _export_table_ods
Link Here
|
361 |
my $elementCell; |
362 |
my $elementCell; |
362 |
my $elementData; |
363 |
my $elementData; |
363 |
# First row with the name of the columns |
364 |
# First row with the name of the columns |
364 |
my $query = 'SHOW COLUMNS FROM ' . $table; |
365 |
my $dbq = C4::DBQ->dbq; |
365 |
my $sth = $dbh->prepare($query); |
366 |
my $sth = $dbh->prepare($dbq->tableColumns($table)); |
366 |
$sth->execute(); |
367 |
$sth->execute(); |
367 |
my @fields = (); |
368 |
my @fields = (); |
368 |
while (my $hashRef = $sth->fetchrow_hashref) { |
369 |
while (my $hashRef = $sth->fetchrow_hashref) { |
Lines 426-433
sub _export_table_excel
Link Here
|
426 |
# First row with the name of the columns |
427 |
# First row with the name of the columns |
427 |
my $elementCell; |
428 |
my $elementCell; |
428 |
my $elementData; |
429 |
my $elementData; |
429 |
my $query = 'SHOW COLUMNS FROM ' . $table; |
430 |
my $dbq = C4::DBQ->dbq; |
430 |
my $sth = $dbh->prepare($query); |
431 |
my $sth = $dbh->prepare($dbq->tableColumns($table)); |
431 |
$sth->execute(); |
432 |
$sth->execute(); |
432 |
my @fields = (); |
433 |
my @fields = (); |
433 |
while (my $hashRef = $sth->fetchrow_hashref) { |
434 |
while (my $hashRef = $sth->fetchrow_hashref) { |
Lines 946-957
sub _check_validity_worksheet
Link Here
|
946 |
|
947 |
|
947 |
my $ret = 0; |
948 |
my $ret = 0; |
948 |
eval { |
949 |
eval { |
949 |
my $query = 'DESCRIBE ' . $table; |
950 |
my $dbq = C4::DBQ->dbq; |
950 |
my $sth = $dbh->prepare($query); |
951 |
my $sth = $dbh->prepare($dbq->tableColumns($table)); |
951 |
$sth->execute(); |
|
|
952 |
$sth->finish; |
953 |
$query = 'SHOW COLUMNS FROM ' . $table; |
954 |
$sth = $dbh->prepare($query); |
955 |
$sth->execute(); |
952 |
$sth->execute(); |
956 |
my $fields = {}; |
953 |
my $fields = {}; |
957 |
while (my $hashRef = $sth->fetchrow_hashref) { |
954 |
while (my $hashRef = $sth->fetchrow_hashref) { |
Lines 1004-1011
sub _import_table
Link Here
|
1004 |
if ($format eq 'csv') { |
1001 |
if ($format eq 'csv') { |
1005 |
my @fieldsName = (); |
1002 |
my @fieldsName = (); |
1006 |
eval { |
1003 |
eval { |
1007 |
my $query = 'SHOW COLUMNS FROM ' . $table; |
1004 |
my $dbq = C4::DBQ->dbq; |
1008 |
my $sth = $dbh->prepare($query); |
1005 |
my $sth = $dbh->prepare($dbq->tableColumns($table)); |
1009 |
$sth->execute(); |
1006 |
$sth->execute(); |
1010 |
while (my $hashRef = $sth->fetchrow_hashref) { |
1007 |
while (my $hashRef = $sth->fetchrow_hashref) { |
1011 |
push @fieldsName, $hashRef->{Field}; |
1008 |
push @fieldsName, $hashRef->{Field}; |