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

(-)a/C4/Tags.pm (-7 / +6 lines)
Lines 26-34 use Exporter; Link Here
26
use C4::Context;
26
use C4::Context;
27
use C4::Debug;
27
use C4::Debug;
28
#use Data::Dumper;
28
#use Data::Dumper;
29
use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created);
30
use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM   tags_all\n";
29
31
30
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
32
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
31
use vars qw($ext_dict $select_all @fields);
33
our $ext_dict;
32
34
33
BEGIN {
35
BEGIN {
34
    $VERSION = 3.07.00.049;
36
    $VERSION = 3.07.00.049;
Lines 70-77 More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG" Link Here
70
INIT {
72
INIT {
71
    $ext_dict and $Lingua::Ispell::path = $ext_dict;
73
    $ext_dict and $Lingua::Ispell::path = $ext_dict;
72
    $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
74
    $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
73
	@fields = qw(tag_id borrowernumber biblionumber term language date_created);
74
	$select_all = "SELECT " . join(',',@fields) . "\n FROM   tags_all\n";
75
}
75
}
76
76
77
sub get_filters {
77
sub get_filters {
Lines 181-187 sub delete_tag_rows_by_ids { Link Here
181
181
182
sub get_tag_rows {
182
sub get_tag_rows {
183
	my $hash = shift || {};
183
	my $hash = shift || {};
184
	my @ok_fields = @fields;
184
    my @ok_fields = TAG_FIELDS;
185
	push @ok_fields, 'limit';	# push the limit! :)
185
	push @ok_fields, 'limit';	# push the limit! :)
186
	my $wheres;
186
	my $wheres;
187
	my $limit  = "";
187
	my $limit  = "";
Lines 208-214 sub get_tag_rows { Link Here
208
			push @exe_args, $hash->{$key};
208
			push @exe_args, $hash->{$key};
209
		}
209
		}
210
	}
210
	}
211
	my $query = $select_all . ($wheres||'') . $limit;
211
    my $query = TAG_SELECT . ($wheres||'') . $limit;
212
	$debug and print STDERR "get_tag_rows query:\n $query\n",
212
	$debug and print STDERR "get_tag_rows query:\n $query\n",
213
							"get_tag_rows query args: ", join(',', @exe_args), "\n";
213
							"get_tag_rows query args: ", join(',', @exe_args), "\n";
214
	my $sth = C4::Context->dbh->prepare($query);
214
	my $sth = C4::Context->dbh->prepare($query);
Lines 491-497 sub add_tag_index { Link Here
491
491
492
sub get_tag {		# by tag_id
492
sub get_tag {		# by tag_id
493
	(@_) or return;
493
	(@_) or return;
494
	my $sth = C4::Context->dbh->prepare("$select_all WHERE tag_id = ?");
494
    my $sth = C4::Context->dbh->prepare(TAG_SELECT . "WHERE tag_id = ?");
495
	$sth->execute(shift);
495
	$sth->execute(shift);
496
	return $sth->fetchrow_hashref;
496
	return $sth->fetchrow_hashref;
497
}
497
}
498
- 

Return to bug 9136