Subversion Repositories PEEPS

Rev

Rev 22 | Rev 31 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22 Rev 29
Line 9... Line 9...
9
use WebDB;
9
use WebDB;
Line 10... Line 10...
10
 
10
 
11
$SIG{__WARN__} = sub { warn sprintf("[%s] ", scalar localtime), @_ };
11
$SIG{__WARN__} = sub { warn sprintf("[%s] ", scalar localtime), @_ };
Line 12... Line 12...
12
$SIG{__DIE__}  = sub { die  sprintf("[%s] ", scalar localtime), @_ };
12
$SIG{__DIE__}  = sub { die  sprintf("[%s] ", scalar localtime), @_ };
Line 13... Line 13...
13
 
13
 
14
our @EXPORT = qw( $ORCUSER $SYSTEM_EMAIL getRCDBH getAccessLevels authDB max authenticate canView getLeagueAffiliation getLeagueName getLeagues getShiftRef getShiftDepartment getClassID getDepartments convertDepartments convertTime getSchedule getRCid getSetting getUser getUserEmail getUserDerbyName getYears printRCHeader changeShift modShiftTime signUpCount signUpEligible findConflict changeLeadShift sendNewUserEMail sendUserMFAEMail logit orglogit isLeagueAdmin isPersonCovered isLeagueCovered isWFTDAMember remainingPolicyDays remainingOrgPolicyDays getPolicyByID getCoverageByID);
14
our @EXPORT = qw( $ORCUSER $SYSTEM_EMAIL getRCDBH getAccessLevels authDB max authenticate canView getLeagueAffiliation getLeagueName getLeagues getShiftRef getShiftDepartment getClassID getDepartments convertDepartments convertTime getSchedule getRCid getSetting getUser getUserEmail getUserDerbyName getYears printRCHeader changeShift modShiftTime signUpCount signUpEligible findConflict changeLeadShift sendNewUserEMail sendUserMFAEMail logit orglogit isLeagueAdmin isPersonCovered isLeagueCovered isWFTDAMember remainingPolicyDays remainingOrgPolicyDays getPolicyByID getCoverageByID getOrgCoverageByID);
15
 
15
 
16
my $dbh = WebDB::connect ("peeps");
16
my $dbh = WebDB::connect ("peeps");
Line 628... Line 628...
628
  (warn "ERROR: No Coverage found with id: $pid and person_id: $person" and return) unless $policy->{id} =~ /^\d+$/;
628
  (warn "ERROR: No Coverage found with id: $pid and person_id: $person" and return) unless $policy->{id} =~ /^\d+$/;
Line 629... Line 629...
629
  
629
  
630
  return $policy;
630
  return $policy;
Line -... Line 631...
-
 
631
}
-
 
632
 
-
 
633
sub getOrgCoverageByID {
-
 
634
  my $pid = shift // "";
-
 
635
  my $leagueid = shift // "";
-
 
636
  
-
 
637
  (warn "ERROR: No PolicyID passed to getOrgCoverageByID()" and return) unless $pid    =~ /^\d+$/;
-
 
638
  (warn "ERROR: No LeagueID passed to getOrgCoverageByID()" and return) unless $leagueid =~ /^\d+$/;
-
 
639
  
-
 
640
  my $policy = $dbh->selectrow_hashref ("select * from org_coverage where id = ? and organization_id = ?", undef, $pid, $leagueid);
-
 
641
  
-
 
642
  (warn "ERROR: No Coverage found with id: $pid" and return) unless $policy->{id} =~ /^\d+$/;
-
 
643
  
-
 
644
  return $policy;
631
}
645
}
632
 
646
 
Line 633... Line 647...
633
sub convertTime {
647
sub convertTime {
634
  my $time = shift || return;
648
  my $time = shift || return;