projects
/
clearscm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Last batch of updates
[clearscm.git]
/
maps
/
bin
/
detail.cgi
diff --git
a/maps/bin/detail.cgi
b/maps/bin/detail.cgi
index
12abc73
..
1d39097
100755
(executable)
--- a/
maps/bin/detail.cgi
+++ b/
maps/bin/detail.cgi
@@
-1,5
+1,5
@@
#!/usr/bin/perl
#!/usr/bin/perl
-################################################################################
#
+################################################################################
#
# File: $RCSfile: detail.cgi,v $
# Revision: $Revision: 1.1 $
#
# File: $RCSfile: detail.cgi,v $
# Revision: $Revision: 1.1 $
@@
-11,26
+11,27
@@
#
# (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
#
#
# (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
#
-################################################################################use strict;
+################################################################################
+use strict;
use warnings;
use MIME::Words qw(:all);
use FindBin;
$0 = $FindBin::Script;
use warnings;
use MIME::Words qw(:all);
use FindBin;
$0 = $FindBin::Script;
-use lib
$FindBin::Bin
;
+use lib
"$FindBin::Bin/../lib"
;
use MAPS;
use MAPSLog;
use MAPSUtil;
use MAPSWeb;
use MAPS;
use MAPSLog;
use MAPSUtil;
use MAPSWeb;
-use CGI qw
(:standard *table start_td end_td start_Tr end_Tr start_div end_div);
+use CGI qw(:standard *table start_td end_td start_Tr end_Tr start_div end_div);
use CGI::Carp 'fatalsToBrowser';
use CGI::Carp 'fatalsToBrowser';
-my $type = param
('type');
-my $next = param
('next');
-my $lines = param
('lines');
-my $date = param
('date');
+my $type = param('type');
+my $next = param('next');
+my $lines = param('lines');
+my $date = param('date');
$date ||= '';
$date ||= '';
@@
-73,7
+74,7
@@
my %types = (
);
sub MakeButtons {
);
sub MakeButtons {
- my
$type = shift
;
+ my
($type) = @_
;
my $prev_button = $prev >= 0 ?
a ({-href => "detail.cgi?type=$type;date=$date;next=$prev",
my $prev_button = $prev >= 0 ?
a ({-href => "detail.cgi?type=$type;date=$date;next=$prev",
@@
-150,12
+151,12
@@
sub PrintTable {
-action => 'processaction.cgi',
-name => 'detail'
};
-action => 'processaction.cgi',
-name => 'detail'
};
- print start_table
({-align => 'center',
-
-id => $table_name,
-
-border => 0,
-
-cellspacing => 0,
-
-cellpadding => 0,
-
-width => '100%'}) . "\n";
+ print start_table({-align => 'center',
+ -id => $table_name,
+ -border => 0,
+ -cellspacing => 0,
+ -cellpadding => 0,
+ -width => '100%'}) . "\n";
my $buttons = MakeButtons $type;
my $buttons = MakeButtons $type;
@@
-170,20
+171,22
@@
sub PrintTable {
];
print end_div;
];
print end_div;
- for
each my $sender (ReturnSenders $userid, $type, $next, $lines, $date
) {
- my @msgs
= ReturnMessages $userid, $sender
;
+ for
my $sender (ReturnSenders($userid, $type, $next, $lines, $date)
) {
+ my @msgs
= ReturnMessages($userid, $sender)
;
my @msgs2 = @msgs;
my @msgs2 = @msgs;
- my ($onlist, $rule);
- $rule = 'none';
+ my ($onlist, $seq);
+
+ my $rule = 'none';
+ my $hit_count = 0;
- ($onlist, $rule
) = OnWhitelist $sender
;
+ ($onlist, $rule
, $seq, $hit_count) = OnWhitelist($sender, $userid, 0)
;
unless ($onlist) {
unless ($onlist) {
- ($onlist, $rule
) = OnBlacklist $sender
;
+ ($onlist, $rule
, $seq, $hit_count) = OnBlacklist($sender, 0)
;
unless ($onlist) {
unless ($onlist) {
- ($onlist, $rule
) = OnNulllist $sender
;
+ ($onlist, $rule
, $seq, $hit_count) = OnNulllist($sender, 0)
;
} # unless
} # unless
} # unless
} # unless
@@
-194,7
+197,7
@@
sub PrintTable {
if ($rule =~ /(\w+):(\d+)/) {
my $list = $1;
my $sequence = $2 - 1;
if ($rule =~ /(\w+):(\d+)/) {
my $list = $1;
my $sequence = $2 - 1;
- my $link = "<a href=\"/maps/php/list.php?type=$list&next=$sequence\">$list:$2</a>";
+ my $link = "<a href=\"/maps/php/list.php?type=$list&next=$sequence\">$list:$2</a>
/$hit_count
";
$rule =~ s/\w+:\d+/$link/;
} # if
$rule =~ s/\w+:\d+/$link/;
} # if
@@
-218,6
+221,10
@@
sub PrintTable {
-border => 0,
-width => '100%',
-bgcolor => '#d4d0c8'};
-border => 0,
-width => '100%',
-bgcolor => '#d4d0c8'};
+
+ # Get subject line
+ my $heading = $msgs2[0][0] || '';
+ $heading = "?subject=$heading" if $heading;
print
td {-class => 'tablelabel',
-valign => 'middle',
print
td {-class => 'tablelabel',
-valign => 'middle',
@@
-225,7
+232,7
@@
sub PrintTable {
td {-class => 'sender',
-valign => 'middle',
-width => '40%'},
td {-class => 'sender',
-valign => 'middle',
-width => '40%'},
- a {-href => "mailto:$sender
?subject=$msgs2[0][0]
"}, $sender,
+ a {-href => "mailto:$sender
$heading
"}, $sender,
td {
-valign => 'middle'},
$rule;
td {
-valign => 'middle'},
$rule;
@@
-234,7
+241,7
@@
sub PrintTable {
my $messages = 1;
my $messages = 1;
- for
each
(@msgs) {
+ for (@msgs) {
my $msg_date = pop @{$_};
my $subject = pop @{$_};
my $msg_date = pop @{$_};
my $subject = pop @{$_};
@@
-274,10
+281,10
@@
sub PrintTable {
-valign => 'middle'}, $msg_date
];
print end_table;
-valign => 'middle'}, $msg_date
];
print end_table;
- } # for
each
+ } # for
print end_td;
print end_Tr;
print end_td;
print end_Tr;
- } # for
each
+ } # for
print start_div {-class => 'toolbar'};
print
print start_div {-class => 'toolbar'};
print
@@
-291,14
+298,17
@@
sub PrintTable {
print end_div;
print end_table;
print end_form;
print end_div;
print end_table;
print end_form;
+
+ return;
} # PrintTable
# Main
} # PrintTable
# Main
+my $condition;
my @scripts = ('ListActions.js');
my $heading_date =$date ne '' ? ' on ' . FormatDate ($date) : '';
my @scripts = ('ListActions.js');
my $heading_date =$date ne '' ? ' on ' . FormatDate ($date) : '';
-$userid = Heading
(
+$userid = Heading(
'getcookie',
'',
(ucfirst ($type) . ' Report'),
'getcookie',
'',
(ucfirst ($type) . ' Report'),
@@
-310,11
+320,11
@@
$userid = Heading (
$userid ||= $ENV{USER};
$userid ||= $ENV{USER};
-SetContext
$userid
;
-NavigationBar
$userid
;
+SetContext
($userid)
;
+NavigationBar
($userid)
;
unless ($lines) {
unless ($lines) {
- my %options = GetUserOptions
$userid
;
+ my %options = GetUserOptions
($userid)
;
$lines = $options{'Page'};
} # unless
$lines = $options{'Page'};
} # unless
@@
-328,7
+338,7
@@
if ($date eq '') {
. "and timestamp > '$sod' and timestamp < '$eod' ";
} # if
. "and timestamp > '$sod' and timestamp < '$eod' ";
} # if
-$total =
MAPSDB::count_distinct
('log', 'sender', $condition);
+$total =
count_distinct
('log', 'sender', $condition);
$next ||= 0;
$next ||= 0;
@@
-337,11
+347,11
@@
$last = $next + $lines < $total ? $next + $lines : $total;
if (($next - $lines) > 0) {
$prev = $next - $lines;
} else {
if (($next - $lines) > 0) {
$prev = $next - $lines;
} else {
- $prev = $next
eq
0 ? -1 : 0;
+ $prev = $next
==
0 ? -1 : 0;
} # if
} # if
-PrintTable
$type
;
+PrintTable
($type)
;
-Footing
$table_name
;
+Footing
($table_name)
;
exit;
exit;