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

(-)a/C4/Tags.pm (-3 / +4 lines)
Lines 30-36 use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language d Link Here
30
use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM   tags_all\n";
30
use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM   tags_all\n";
31
31
32
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
32
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
33
our $ext_dict;
34
33
35
BEGIN {
34
BEGIN {
36
	@ISA = qw(Exporter);
35
	@ISA = qw(Exporter);
Lines 50-56 BEGIN { Link Here
50
      stratify_tags
49
      stratify_tags
51
    );
50
    );
52
	# %EXPORT_TAGS = ();
51
	# %EXPORT_TAGS = ();
53
	$ext_dict = C4::Context->preference('TagsExternalDictionary');
52
	my $ext_dict = C4::Context->preference('TagsExternalDictionary');
54
	if ($debug) {
53
	if ($debug) {
55
		require Data::Dumper;
54
		require Data::Dumper;
56
		import Data::Dumper qw(:DEFAULT);
55
		import Data::Dumper qw(:DEFAULT);
Lines 69-74 More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG" Link Here
69
=cut
68
=cut
70
69
71
INIT {
70
INIT {
71
    my $ext_dict = C4::Context->preference('TagsExternalDictionary');
72
    $ext_dict and $Lingua::Ispell::path = $ext_dict;
72
    $ext_dict and $Lingua::Ispell::path = $ext_dict;
73
    $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
73
    $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
74
}
74
}
Lines 367-372 sub is_approved { Link Here
367
	my $term = shift or return;
367
	my $term = shift or return;
368
	my $sth = C4::Context->dbh->prepare("SELECT approved FROM tags_approval WHERE term = ?");
368
	my $sth = C4::Context->dbh->prepare("SELECT approved FROM tags_approval WHERE term = ?");
369
	$sth->execute($term);
369
	$sth->execute($term);
370
    my $ext_dict = C4::Context->preference('TagsExternalDictionary');
370
	unless ($sth->rows) {
371
	unless ($sth->rows) {
371
		$ext_dict and return (spellcheck($term) ? 0 : 1);	# spellcheck returns empty on OK word
372
		$ext_dict and return (spellcheck($term) ? 0 : 1);	# spellcheck returns empty on OK word
372
		return 0;
373
		return 0;
Lines 390-395 sub get_tag_index { Link Here
390
sub whitelist {
391
sub whitelist {
391
	my $operator = shift;
392
	my $operator = shift;
392
	defined $operator or return; # have to test defined to allow =0 (kohaadmin)
393
	defined $operator or return; # have to test defined to allow =0 (kohaadmin)
394
    my $ext_dict = C4::Context->preference('TagsExternalDictionary');
393
	if ($ext_dict) {
395
	if ($ext_dict) {
394
		foreach (@_) {
396
		foreach (@_) {
395
			spellcheck($_) or next;
397
			spellcheck($_) or next;
396
- 

Return to bug 16444