# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
#**************************************************************************/
-package ND::Web::Pages::Intel;
+package NDWeb::Pages::Intel;
use strict;
use warnings FATAL => 'all';
-use ND::Web::Forum;
-use ND::Web::Include;
+use NDWeb::Forum;
+use NDWeb::Include;
use ND::Include;
use CGI qw/:standard/;
-use base qw/ND::Web::XMLPage/;
+use base qw/NDWeb::XMLPage/;
-$ND::Web::Page::PAGES{intel} = __PACKAGE__;
+$NDWeb::Page::PAGES{intel} = __PACKAGE__;
sub parse {
my $self = shift;
$BODY->param(Nick => escapeHTML($planet->{nick}));
$BODY->param(Channel => $planet->{channel});
my @status;
- for my $status (" ","Friendly", "NAP", "Hostile"){
+ for my $status ("","Friendly", "NAP", "Hostile"){
push @status,{Status => $status, Selected => defined $planet->{planet_status} && $status eq $planet->{planet_status}}
}
$BODY->param(PlanetStatus => \@status);
$query->execute($planet->{id}) or $error .= $DBH->errstr;
my @intellists;
my @incomings;
- my $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
- $i++;
- $intel->{ODD} = $i % 2;
push @incomings,$intel;
}
push @intellists,{Message => 'Incoming fleets', Intel => \@incomings, Origin => 1};
$query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks"));
$query->execute($planet->{id}) or $error .= $DBH->errstr;
my @outgoings;
- $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
- $i++;
- $intel->{ODD} = $i % 2;
push @outgoings,$intel;
}
push @intellists,{Message => 'Outgoing Fleets', Intel => \@outgoings, Target => 1};
}elsif(!param('coords')){
my $query = $DBH->prepare(intelquery('o.alliance AS oalliance,coords(o.x,o.y,o.z) AS origin, t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',qq{not ingal
- AND ((( t.alliance_id != o.alliance_id OR t.alliance_id IS NULL OR o.alliance_id IS NULL) AND i.mission != 'Attack')
+ AND ((( t.alliance_id != o.alliance_id OR t.alliance_id IS NULL OR o.alliance_id IS NULL) AND (i.mission = 'Defend' OR i.mission = 'AllyDef' ))
OR ( t.alliance_id = o.alliance_id AND i.mission = 'Attack'))
AND i.sender NOT IN (SELECT planet FROM users u NATURAL JOIN groupmembers gm WHERE gid = 8 AND planet IS NOT NULL)
$showticks}));
my @intellists;
my @intel;
- my $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
- $i++;
- $intel->{ODD} = $i % 2;
push @intel,$intel;
}
push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1};