Subversion Repositories ORC

Rev

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

Rev 28 Rev 29
Line 20... Line 20...
20
my $username = $h->a ({ href=>"/schedule/manage_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
20
my $username = $h->a ({ href=>"/schedule/manage_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
21
my $RCid = $user->{RCid};
21
my $RCid = $user->{RCid};
22
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
22
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
23
my $YEAR = "2022";
23
my $YEAR = "2022";
Line 24... Line 24...
24
 
24
 
-
 
25
if (!scalar (grep { $user->{department}->{$_} > 0 } grep { !/^(ANN|OFF)$/ } keys %{$user->{department}}) and 
-
 
26
    $user->{department}->{ANN} < 2 and 
-
 
27
    $user->{department}->{OFF} < 2 and 
25
if (!scalar (grep { $user->{department}->{$_} < 1 } grep { !/^(ANN|OFF)$/ } keys %{$user->{department}}) and $user->{department}->{ANN} < 2 and $user->{department}->{OFF} < 2 and $LVL < 4) {
28
    $LVL < 4) {
26
	print header(-cookie=>$RCAUTH_cookie);
29
	print header(-cookie=>$RCAUTH_cookie);
27
	printRCHeader("Unauthorized Page");
30
	printRCHeader("Unauthorized Page");
28
	print $h->div ({ class=>"error" }, "No Access");
31
	print $h->div ({ class=>"error" }, "No Access");
29
	print $h->div ("Your user account is not registered as a Volunteer in a department that uses this view, so you can't see these shifts.  It's possible that your access is still being reviewed.  Please be patient.");
32
	print $h->div ("Your user account is not registered as a Volunteer in a department that uses this view, so you can't see these shifts.  It's possible that your access is still being reviewed.  Please be patient.");
Line 47... Line 50...
47
	location    => [qw(Location      30    select      default )],
50
	location    => [qw(Location      30    select      default )],
48
	time        => [qw(Time          35    text        default )],
51
	time        => [qw(Time          35    text        default )],
49
	start_time  => [qw(Start         36    text         )],
52
	start_time  => [qw(Start         36    text         )],
50
	end_time    => [qw(End           40    text         )],
53
	end_time    => [qw(End           40    text         )],
51
	mod_time    => [qw(ModTime       45    number         )],
54
	mod_time    => [qw(ModTime       45    number         )],
-
 
55
	doubletime  => [qw(DoubleTime    47    boolean         )],
52
	volhours    => [qw(VolHours      50    number         )],
56
	volhours    => [qw(VolHours      50    number         )],
53
	note        => [qw(Notes         55    text        default )],
57
	note        => [qw(Notes         55    text        default )],
54
	RCid        => [qw(AssigneeID    60    text         )],
58
	RCid        => [qw(AssigneeID    60    text         )],
55
	derby_name  => [qw(DerbyName     65    select      default   )],
59
	derby_name  => [qw(DerbyName     65    select      default   )],
56
);
60
);
57
my $stylesheet = "/style.css";
61
my $stylesheet = "/style.css";
58
my $homeURL = '/schedule/';
62
my $homeURL = '/schedule/';
59
my @pagelimitoptions = ("All", 5, 10, 25);
63
my @pagelimitoptions = ("All", 5, 10, 25);
Line 60... Line 64...
60
 
64
 
61
my @whereClause;
65
my @whereClause;
62
if ($LVL <= RollerCon::MANAGER) {
66
if ($LVL <= 3) {
63
  my $string = "dept in (".join ",", map { '"'.$_.'"' } grep { $ORCUSER->{department}->{$_} >= 3 } keys %{$ORCUSER->{department}};
67
  my $string = "dept in (".join ",", map { '"'.$_.'"' } grep { $ORCUSER->{department}->{$_} > 0 } keys %{$ORCUSER->{department}};
64
  $string .= ")";
68
  $string .= ")";
65
  # warn $string;
69
#   warn $string;
66
  push @whereClause, $string;
70
  push @whereClause, $string;
67
}
71
}
Line 68... Line 72...
68
push @whereClause, "(dept != 'PER' or RCid = $RCid)";
72
push @whereClause, "(dept != 'PER' or RCid = $RCid)";
69
 
73
 
Line -... Line 74...
-
 
74
 
-
 
75
# If we need to modify line item values, create a subroutine named "modify_$columnname"
-
 
76
#    It will receive a hashref to the object lineitem
-
 
77
 
-
 
78
sub modify_doubletime {
70
 
79
  my $thing = shift;
71
# If we need to modify line item values, create a subroutine named "modify_$columnname"
80
  return $thing->{doubletime} ? "True" : "False";
Line 72... Line 81...
72
#    It will receive a hashref to the object lineitem
81
}
73
 
82