ASNMTAP
view release on metacpan or search on metacpan
applications/htmlroot/cgi-bin/comments.pl view on Meta::CPAN
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
use vars qw($PROGNAME);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$PROGNAME = "comments.pl";
my $prgtext = "Comments";
my $version = do { my @r = (q$Revision: 3.002.003$ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; # must be all on one line or MakeMaker will get confused.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my $supportRequest = ( (-s "$APPLICATIONPATH/custom/supportRequest.pm") ? 1 : 0 );
my $localYear = sprintf ("%04d", (localtime)[5] );
my $localMonth = sprintf ("%02d", (localtime)[4] );
my $currentYear = sprintf ("%04d", (localtime)[5] + 1900 );
my $currentMonth = sprintf ("%02d", (localtime)[4] + 1 );
my $currentDay = sprintf ("%02d", (localtime)[3] );
my $currentHour = sprintf ("%02d", (localtime)[2] );
my $currentMin = sprintf ("%02d", (localtime)[1] );
my $currentSec = sprintf ("%02d", (localtime)[0] );
# URL Access Parameters
my $cgi = new CGI;
my $pagedir = (defined $cgi->param('pagedir')) ? $cgi->param('pagedir') : 'index'; $pagedir =~ s/\+/ /g;
my $pageset = (defined $cgi->param('pageset')) ? $cgi->param('pageset') : 'index-cv'; $pageset =~ s/\+/ /g;
my $debug = (defined $cgi->param('debug')) ? $cgi->param('debug') : 'F';
my $pageNo = (defined $cgi->param('pageNo')) ? $cgi->param('pageNo') : 1;
my $pageOffset = (defined $cgi->param('pageOffset')) ? $cgi->param('pageOffset') : 0;
my $action = (defined $cgi->param('action')) ? $cgi->param('action') : 'listView';
my $CcatalogID = (defined $cgi->param('catalogID')) ? $cgi->param('catalogID') : $CATALOGID;
my $Cid = (defined $cgi->param('id')) ? $cgi->param('id') : '';
my $CuKey = (defined $cgi->param('uKey')) ? $cgi->param('uKey') : 'none';
my $Ctitle = (defined $cgi->param('title')) ? $cgi->param('title') : '';
my $Cinstability = (defined $cgi->param('instability')) ? $cgi->param('instability') : 'off';
my $Cpersistent = (defined $cgi->param('persistent')) ? $cgi->param('persistent') : 'off';
my $Cdowntime = (defined $cgi->param('downtime')) ? $cgi->param('downtime') : 'off';
my $CactivationDate = (defined $cgi->param('activationDate')) ? $cgi->param('activationDate') : '';
my $CactivationTime = (defined $cgi->param('activationTime')) ? $cgi->param('activationTime') : '';
my $CsuspentionDate = (defined $cgi->param('suspentionDate')) ? $cgi->param('suspentionDate') : '';
my $CsuspentionTime = (defined $cgi->param('suspentionTime')) ? $cgi->param('suspentionTime') : '';
my $CproblemSolved = (defined $cgi->param('problemSolved')) ? $cgi->param('problemSolved') : 0;
my $CremoteUser = (defined $cgi->param('remoteUser')) ? $cgi->param('remoteUser') : 'none';
my $CcommentData = (defined $cgi->param('commentData')) ? $cgi->param('commentData') : '';
$CcommentData =~ s/"/'/g;
my ($pageDir, $environment) = split (/\//, $pagedir, 2);
$environment = 'P' unless (defined $environment);
my $htmlTitle = $APPLICATION .' - '. $ENVIRONMENT{$environment};
# User Session and Access Control
my ($sessionID, $iconAdd, $iconDelete, $iconDetails, $iconEdit, $iconQuery, $iconTable, $errorUserAccessControl, $remoteUserLoggedOn, undef, undef, $givenNameLoggedOn, $familyNameLoggedOn, undef, undef, $userType, undef, undef, undef, $subTitle) = us...
unless ( defined $errorUserAccessControl ) {
unless ( defined $userType ) {
print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);
print "<br>\n<table WIDTH=\"100%\" border=0><tr><td class=\"HelpPluginFilename\">\n<font size=\"+1\">$errorUserAccessControl</font>\n</td></tr></table>\n<br>\n";
} else {
$action = "listView" if ( $userType == 0 and ($action eq 'insertView' or $action eq 'insert' or $action eq 'createView' or $action eq 'create' or $action eq 'deleteView' or $action eq 'delete' or $action eq 'editView' or $action eq 'edit' or $act...
my $urlWithAccessParameters = $ENV{SCRIPT_NAME} ."?pagedir=$pagedir&pageset=$pageset&debug=$debug&CGISESSID=$sessionID";
my ($CactivationTimeslot, $CsuspentionTimeslot, $tsec, $tmin, $thour, $tday, $tmonth, $tyear);
if ($CactivationDate ne '' and $CactivationTime ne '') {
($tyear, $tmonth, $tday) = split(/\-/, $CactivationDate);
$tyear -= 1900; $tmonth--;
($thour, $tmin, $tsec) = split(/:/, $CactivationTime);
$CactivationTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
} else {
$CactivationTimeslot = '';
}
if ($CsuspentionDate ne '' and $CsuspentionTime ne '') {
($tyear, $tmonth, $tday) = split(/\-/, $CsuspentionDate);
$tyear -= 1900; $tmonth--;
($thour, $tmin, $tsec) = split(/:/, $CsuspentionTime);
$CsuspentionTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
} else {
$CsuspentionTimeslot = '';
}
my ($CentryDate, $CentryTime, $CentryTimeslot, $CsolvedDate, $CsolvedTime, $CsolvedTimeslot);
if ($action eq 'historyView' or $action eq 'history') {
$CentryDate = ($cgi->param('entryDate') or '');
$CentryTime = ($cgi->param('entryTime') or '');
if ($CentryDate ne '' and $CentryTime ne '') {
($tyear, $tmonth, $tday) = split(/\-/, $CentryDate);
$tyear -= 1900; $tmonth--;
($thour, $tmin, $tsec) = split(/:/, $CentryTime);
$CentryTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
} else {
$CentryTimeslot = '';
}
$CsolvedDate = ($cgi->param('solvedDate') or '');
$CsolvedTime = ($cgi->param('solvedTime') or '');
if ($CsolvedDate ne '' and $CsolvedTime ne '') {
($tyear, $tmonth, $tday) = split(/\-/, $CsolvedDate);
$tyear -= 1900; $tmonth--;
($thour, $tmin, $tsec) = split(/:/, $CsolvedTime);
$CsolvedTimeslot = timelocal($tsec, $tmin, $thour, $tday, $tmonth, $tyear);
} else {
$CsolvedTimeslot = '';
}
} else {
$CentryDate = ($cgi->param('entryDate') or "$currentYear-$currentMonth-$currentDay");
$CentryTime = ($cgi->param('entryTime') or "$currentHour:$currentMin:$currentSec");
$CentryTimeslot = ($cgi->param('entryTimeslot') or timelocal($currentSec, $currentMin, $currentHour, $currentDay, $localMonth, $localYear));
if ($CproblemSolved) {
$CsolvedDate = ($cgi->param('solvedDate') or "$currentYear-$currentMonth-$currentDay");
$CsolvedTime = ($cgi->param('solvedTime') or "$currentHour:$currentMin:$currentSec");
$CsolvedTimeslot = ($cgi->param('solvedTimeslot') or timelocal($currentSec, $currentMin, $currentHour, $currentDay, $localMonth, $localYear));
} else {
( run in 0.975 second using v1.01-cache-2.11-cpan-98e64b0badf )