Request # body<= {'dbh'}; my $dbr = $dbs->{'reader'}; my $sth; my $spid = $FORM{'id'}+0; my $auth = $FORM{'auth'}; my $sp = LJ::Support::load_request($dbh, $spid); unless ($sp) { return ""; } my $cats = LJ::Support::load_cats($dbh); my $email = $sp->{'reqemail'}; my $u = {}; if ($sp->{'reqtype'} eq "user") { $u = LJ::load_userid($dbs, $sp->{'requserid'}); $email = $u->{'email'}; LJ::load_user_props($dbs, $u, "s1_lastn_style", "s1_calendar_style", "s1_day_style", "s1_friends_style", "stylesys", "s2_style", ); } my $winner; # who closed it? if ($sp->{'state'} eq "closed") { $sth = $dbh->prepare("SELECT u.user, sp.points FROM user u, supportpoints sp WHERE u.userid=sp.userid AND sp.spid=?"); $sth->execute($spid); $winner = $sth->fetchrow_hashref; } my $owner_mode = 0; my $remote = LJ::get_remote($dbh); LJ::Support::init_remote($dbh, $remote); # load category this request is in my $problemarea = $sp->{_cat}->{'catname'}; my $catkey = $sp->{_cat}->{'catkey'}; unless (LJ::Support::can_read($sp, $remote, $auth)) { return ""; } if (LJ::Support::can_close($dbh, $sp, $remote, $auth)) { $owner_mode = 1; } ### request info table my $ret = ""; $ret .= "
| From: | ";
if ($u->{'defaultpicid'}) {
my %pic;
my $picid = $u->{'defaultpicid'};
LJ::load_userpics($dbs, \%pic, [ $picid ]);
$ret .= "";
$ret .= " |
| Account type: | "; $ret .= LJ::name_caps($u->{'caps'}) || "Unknown"; $ret .= " |
| $LJ::SITENAMESHORT: | ";
if ($u->{'userid'}) {
$ret .= "username: {'user'} ljuserf?>";
$ret .= " style: "; if ($u->{'stylesys'} == 2) { $ret .= "(S2) "; if ($u->{'s2_style'}) { my $s2style = LJ::S2::load_style($dbr, $u->{'s2_style'}); my $pub = LJ::S2::get_public_layers(); # cached foreach my $lay (keys %{$s2style->{'layer'}}) { my $lid = $s2style->{'layer'}->{$lay}; $ret .= "$lay: "; $ret .= (defined $pub->{$lid} ? 'public' : 'user') . ", "; } } else { $ret .= "none"; } } else { $ret .= "(S1) "; foreach my $view (@LJ::views) { my $styid = $u->{"s1_${view}_style"}; my $viewuri = $view eq "lastn" ? "/users/$u->{'user'}/" : "/users/$u->{'user'}/$view"; if ($view eq "day") { my (undef,undef,undef,$dday,$dmon,$dyear) = localtime(time); $dyear+=1900; $dmon++; $dmon = $dmon <= 9 ? "0$dmon" : $dmon; $dday = $dday <= 9 ? "0$dday" : $dday; $viewuri = "/users/$u->{'user'}/$dyear/$dmon/$dday/"; } $ret .= "$view: $styid "; } if ($u->{'useoverrides'} eq 'Y') { $ret .= " overrides: view "; } } $ret .= " email validated? "; if ($u->{'status'} eq "A") { $ret .= "yes"; } if ($u->{'status'} eq "N") { $ret .= "no"; } if ($u->{'status'} eq "T") { $ret .= "transitioning (used to be validated, but changed email addresses and hasn't reconfirmed)"; } if ($u->{'clusterid'}) { $ret .= " cluster: " . ($LJ::CLUSTERNAME{$u->{'clusterid'}} || $u->{'clusterid'}) . ""; } } else { $ret .= "not a user"; } $ret .= " |
| Support category: | "; if (LJ::Support::can_read_cat($sp->{_cat}, $remote)) { $ret .= "$problemarea"; } else { $ret .= $problemarea; } $ret .= " |
| Time posted: | $timecreate ($age) |
| Status: | $state"; if ($owner_mode) { $ret .= $sp->{'state'} eq "open" ? ", {'authcode'}'>close without credit" : ""; $ret .= $sp->{'state'} eq "closed" ? ", {'authcode'}'>reopen this request" : ""; } $ret .= " |
| Summary: | " . LJ::ehtml($sp->{'subject'}) . " |
| " . LJ::ljuser($up->{'user'}, { 'full' => 1 }) . " - " . LJ::eall($up->{'name'}) . " |
| \n";
if ($le->{'faqid'}) {
# faq question
my $sth = $dbh->prepare("SELECT question FROM faq WHERE faqid=?");
$sth->execute($le->{'faqid'});
my $faqname = $sth->fetchrow_array;
$ret .= " \n";
# whitespace between these two DIVs is necessary for proper
# rendering in IE 5 for Mac OS < X
$ret .= " \n";
}
$ret .= "";
$ret .= "FAQ Reference: $faqname $message \n"; $ret .= " |
Post a comment or solution:
\n"; unless ($remote || LJ::Support::is_poster($sp, $remote, $auth)) { $ret .= "You must login to help people out.\n"; return $ret; } unless (LJ::Support::can_append($dbh, $sp, $remote, $auth)) { $ret .= "Sorry, you do not have access to answer people's support requests in this category.\n"; return $ret; } my @ans_type = LJ::Support::get_answer_types($dbh, $sp, $remote, $auth); my %ans_type = @ans_type; if ($ans_type{'answer'} || $ans_type{'screened'}) { $ret .= "Important Notes:"; $ret .= "