Commit 047ce504 authored by Keith Jolley's avatar Keith Jolley
Browse files

Use Datastore::run_query instead of run_simple_query.

parent 90bc352d
...@@ -519,7 +519,7 @@ sub _get_provenance_fields { ...@@ -519,7 +519,7 @@ sub _get_provenance_fields {
&& !$self->{'system'}->{'privacy'} ) && !$self->{'system'}->{'privacy'} )
) )
{ {
if ( $value > 0 && $userdata->{'email'} =~ /@/) { if ( $value > 0 && $userdata->{'email'} =~ /@/ ) {
$person .= " (E-mail: <a href=\"mailto:$userdata->{'email'}\">$userdata->{'email'}</a>)"; $person .= " (E-mail: <a href=\"mailto:$userdata->{'email'}\">$userdata->{'email'}</a>)";
} }
} }
...@@ -576,27 +576,26 @@ sub _get_provenance_fields { ...@@ -576,27 +576,26 @@ sub _get_provenance_fields {
my %attributes = map { $_->{'attribute'} => $_->{'value'} } @$attribute_list; my %attributes = map { $_->{'attribute'} => $_->{'value'} } @$attribute_list;
if ( keys %attributes ) { if ( keys %attributes ) {
my $rows = keys %attributes || 1; my $rows = keys %attributes || 1;
foreach ( sort { $order{$a} <=> $order{$b} } keys(%attributes) ) { foreach my $attribute ( sort { $order{$a} <=> $order{$b} } keys(%attributes) ) {
my $url_ref = my $url = $self->{'datastore'}->run_query(
$self->{'datastore'} "SELECT url FROM isolate_field_extended_attributes WHERE isolate_field=? AND attribute=?",
->run_simple_query( "SELECT url FROM isolate_field_extended_attributes WHERE isolate_field=? AND attribute=?", [ $field, $attribute ]
$field, $_ ); );
my $att_web; my $att_web;
if ( ref $url_ref eq 'ARRAY' ) { if ($url) {
my $url = $url_ref->[0] || ''; $url =~ s/\[\?\]/$attributes{$attribute}/;
$url =~ s/\[\?\]/$attributes{$_}/;
$url =~ s/\&/\&amp;/g; $url =~ s/\&/\&amp;/g;
my $domain; my $domain;
if ( ( lc($url) =~ /http:\/\/(.*?)\/+/ ) ) { if ( ( lc($url) =~ /http:\/\/(.*?)\/+/ ) ) {
$domain = $1; $domain = $1;
} }
$att_web = "<a href=\"$url\">$attributes{$_}</a>" if $url; $att_web = qq(<a href="$url">$attributes{$attribute}</a>) if $url;
if ( $domain && $domain ne $q->virtual_host ) { if ( $domain && $domain ne $q->virtual_host ) {
$att_web .= " <span class=\"link\"><span style=\"font-size:1.2em\">&rarr;</span> $domain</span>"; $att_web .= qq( <span class="link"><span style="font-size:1.2em">&rarr;</span> $domain</span>);
} }
} }
$buffer .= "<dt class=\"dontend\">$_</dt>\n"; $buffer .= "<dt class=\"dontend\">$attribute</dt>\n";
$buffer .= "<dd>" . ( $att_web || $attributes{$_} ) . "</dd>\n"; $buffer .= "<dd>" . ( $att_web || $attributes{$attribute} ) . "</dd>\n";
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment