line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::OptimalQuery::SavedSearches; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
756
|
use strict; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
219
|
|
4
|
8
|
|
|
8
|
|
32
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
224
|
|
5
|
8
|
|
|
8
|
|
32
|
no warnings qw( uninitialized redefine ); |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
225
|
|
6
|
8
|
|
|
8
|
|
2485
|
use CGI::OptimalQuery::Base(); |
|
8
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
2918
|
|
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
0
|
|
sub escapeHTML { CGI::OptimalQuery::Base::escapeHTML(@_) } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub get_html { |
11
|
0
|
|
|
0
|
0
|
|
my ($q,$dbh,$userid) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $oracleReadLen; |
14
|
0
|
0
|
|
|
|
|
if ($$dbh{Driver}{Name} eq 'Oracle') { |
15
|
0
|
|
|
|
|
|
($oracleReadLen) = $dbh->selectrow_array("SELECT max(dbms_lob.getlength(params)) FROM oq_saved_search WHERE user_id=?", undef, $userid); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
local $dbh->{LongReadLen} = $oracleReadLen |
18
|
0
|
0
|
0
|
|
|
|
if $oracleReadLen && $oracleReadLen > $dbh->{LongReadLen}; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
local $$dbh{FetchHashKeyName} = 'NAME_uc'; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $sth = $dbh->prepare( |
23
|
|
|
|
|
|
|
"SELECT * |
24
|
|
|
|
|
|
|
FROM oq_saved_search |
25
|
|
|
|
|
|
|
WHERE user_id=? |
26
|
|
|
|
|
|
|
ORDER BY oq_title, user_title"); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
$sth->execute($userid); |
29
|
0
|
|
|
|
|
|
my $last_oq_title = ''; |
30
|
0
|
|
|
|
|
|
my $buf = ''; |
31
|
0
|
|
|
|
|
|
while (my $h = $sth->fetchrow_hashref()) { |
32
|
0
|
0
|
|
|
|
|
next if $$h{IS_DEFAULT}; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $state_params=''; |
35
|
0
|
0
|
|
|
|
|
if ($$h{PARAMS}) { |
36
|
0
|
|
|
|
|
|
my $params = eval '{'.$$h{PARAMS}.'}'; |
37
|
0
|
|
|
|
|
|
foreach my $k (keys %$params) { |
38
|
0
|
0
|
|
|
|
|
next if $k =~ /^(module|show|rows_page|page|hiddenFilter|filter|queryDescr|sort)$/; |
39
|
0
|
|
|
|
|
|
my $v = $$params{$k}; |
40
|
0
|
0
|
|
|
|
|
if (ref($v) eq 'ARRAY') { |
41
|
0
|
|
|
|
|
|
$state_params .= '&'.$k.'='.$_ for @$v; |
42
|
|
|
|
|
|
|
} else { |
43
|
0
|
|
|
|
|
|
$state_params .= '&'.$k.'='.$v; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if ($last_oq_title ne $$h{OQ_TITLE}) { |
49
|
0
|
0
|
|
|
|
|
$buf .= '' if $last_oq_title; |
50
|
0
|
|
|
|
|
|
$last_oq_title = $$h{OQ_TITLE}; |
51
|
0
|
|
|
|
|
|
$buf .= "".escapeHTML($$h{OQ_TITLE})." |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
$buf .= " |
54
|
0
|
|
|
|
|
|
".escapeHTML($$h{USER_TITLE})." |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
"; |
57
|
|
|
|
|
|
|
} |
58
|
0
|
0
|
|
|
|
|
$buf .= '' if $last_oq_title; |
59
|
|
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
|
if ($buf) { |
61
|
0
|
|
|
|
|
|
$buf = ' '.$buf.' |
62
|
|
|
|
|
|
|
'; |
82
|
|
|
|
|
|
|
} |
83
|
0
|
|
|
|
|
|
return $buf; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
1; |