#!/usr/bin/perl # # $Id: addcnd.pl,v 1.14 2006/09/29 19:03:46 psims Exp $ # # Source File: addcnd.pl ### DED 5/27/04 being passed FORM[usetestform] - do something with it. use Data::Dumper; # Get config require 'sitecfg.pl'; require 'testlib.pl'; &app_initialize; print "Content-Type: text/html\n\n"; $SESSION{'registrar'} = $FORM{'imaregistrar'}; #print STDERR Dumper(\%FORM); if (&get_session($FORM{'tid'})) { #hkh 03/04 inserted &LanguageSupportInit for bug#108 &LanguageSupportInit(); my $newflag="N"; my $prevenb=0; my $nxtenb=0; if ($FORM{'lang'} ne $SESSION{'lang'}) { &set_session($FORM{'tid'},'lang',$FORM{'lang'});} &get_client_configuration(); $SESSION{'lang'} = ($SYSTEM{'DEFAULTLANG'} eq '') ? "enu" : $SYSTEM{'DEFAULTLANG'}; $SESSION{'lang'} = ($FORM{'lang'} eq '') ? $SESSION{'lang'} : $FORM{'lang'}; &LoadLanguage($SESSION{'lang'}); $FORM{'respmsg'} = ""; $uid = $FORM{'uid'}; $usrerror=0; if ($FORM{'dbop'} eq 'new') { $newflag="Y"; $FORM{'cndid'}=""; } elsif ($FORM{'new'} eq 'Y') { if ((&get_candidate_profile( $SESSION{'clid'}, $FORM{'cndid'})) || (&check_admin_profiles($FORM{'cndid'}))) { $smsg="You have attempted to create a candidate registration
with an id"; $smsg=join('', $smsg, " that is already assigned to another candidate.

\ \;
"); $smsg=join('', $smsg, "Please close this page and reenter the new candidate with"); $smsg=join('', $smsg, " a different ID.
\ \;
"); $smsg=join('', $smsg, "You can confirm availability of the ID you enter
by clicking on the"); $smsg=join('', $smsg, " Check to Confirm Availability check box
immediately to the right"); $smsg=join('', $smsg, " of the Login ID input box."); $TEST_SESSION{'message'} = $smsg; $TEST_SESSION{'navbuttons'}=""; &show_template("tend"); $usrerror = 1; } else { $FORM{'grpowner'} = "N"; $FORM{'registrar'} = "N"; $FORM{'selfreg'} = "N"; if ($FORM{'grptype'} eq 'C') { #placeholder } elsif ($FORM{'grptype'} eq 'G') { $FORM{'grpowner'} = "Y"; } elsif ($FORM{'grptype'} eq 'R') { $FORM{'registrar'} = "Y"; } elsif ($FORM{'grptype'} eq 'S') { $FORM{'selfreg'} = "Y"; } else { print STDERR "grptype slipped thru the cracks\n"; } $FORM{'uid'} = $FORM{'cndid'}; $FORM{'createdby'} = $SESSION{'uid'}; my $converted_time = time(); #&compare_time is responsible for conversion. $FORM{'createdate'} = $converted_time; #make sure this is only set at addcnd time. &add_candidate_profile($SESSION{'clid'}); &log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "Add candidate $FORM{'cndid'}"); &prepare_test($SESSION{'clid'}, $FORM{'cndid'}, $FORM{'authtests'}, $FORM{'usetestform'},$FORM{'rmtests'}); $FORM{'respmsg'} = "$xlatphrase[760]"; # sac - start addition for subject area percentage support if ($SYSTEM{'testprepmsg'} ne "") { $FORM{'respmsg'}=join('', $FORM{'respmsg'}," except:
",$SYSTEM{'testprepmsg'}); $SYSTEM{'testprepmsg'} = ""; } # sac - end addition for subject area percentage support } } elsif ($FORM{'dbop'} eq 'resend') { &resend_exit_emails( $SESSION{'clid'}, $FORM{'cndid'}, $FORM{'tkntest'}); $FORM{'respmsg'} = "$xlatphrase[871]"; } else { $FORM{'uid'} = $FORM{'cndid'}; ### DED 10/5/2002 Check for cnd info change before ### writing to cnd file if ($FORM{'cndchange'} eq 'Y' ) { $FORM{'grpowner'} = "N"; $FORM{'registrar'} = "N"; $FORM{'selfreg'} = "N"; if ($FORM{'grptype'} eq 'C') { #placeholder } elsif ($FORM{'grptype'} eq 'G') { $FORM{'grpowner'} = "Y"; } elsif ($FORM{'grptype'} eq 'R') { $FORM{'registrar'} = "Y"; } elsif ($FORM{'grptype'} eq 'S') { $FORM{'selfreg'} = "Y"; } else { print STDERR "grptype slipped thru the cracks\n"; } &put_candidate_profile($SESSION{'clid'}, $FORM{'cndid'}, $SESSION{'uac'}); $FORM{'respmsg'} = "$xlatphrase[761]"; } else { $FORM{'respmsg'} = "$xlatphrase[762]"; } &log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "Save candidate $FORM{'cndid'}"); &prepare_test($SESSION{'clid'}, $FORM{'cndid'}, $FORM{'authtests'}, $FORM{'usetestform'},$FORM{'rmtests'}); &log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "Tests Prepared for candidate $FORM{'cndid'}"); # sac - start addition for subject area percentage support if ($SYSTEM{'testprepmsg'} ne "") { $FORM{'respmsg'}=join('', $FORM{'respmsg'}," except:
",$SYSTEM{'testprepmsg'}); $SYSTEM{'testprepmsg'} = ""; } # sac - end addition for subject area percentage support } unless ($usrerror) { $FORM{'uid'} = $uid; $FORM{'new'} = $newflag; if ($newflag ne "Y") { ($cndid,$prevenb,$nxtenb)=&get_candidate_list_nav($SESSION{'clid'},$FORM{'cndid'},$FORM{'dbop'},$FORM{'sortedkey'}); #print STDERR "($cndid,$prevenb,$nxtenb)=get_candidate_list_nav()\n"; $FORM{'cndid'} = $cndid; } $FORM{'prevenb'} = $prevenb unless $FORM{'imaregistrar'} eq "Y"; $FORM{'nxtenb'} = $nxtenb unless $FORM{'imaregistrar'} eq "Y"; &get_client_profile($SESSION{'clid'}); &get_candidate_profile( $SESSION{'clid'}, $FORM{'cndid'}); &show_template("addcnd"); } }