Subversion Repositories VORC

Rev

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

Rev 8 Rev 35
Line 21... Line 21...
21
my $change = param ('change');
21
my $change = param ('change');
22
my $RCid   = param ('RCid') // $user->{RCid};
22
my $RCid   = param ('RCid') // $user->{RCid};
23
my $id     = param ('id');
23
my $id     = param ('id');
24
my $role   = param ('role') // "";
24
my $role   = param ('role') // "";
25
my $noshow = param ('noshow');
25
my $noshow = param ('noshow');
26
my $department = getShiftDepartment ($role ? $id."-".$role : $id);
26
my $department = ($id =~ /^\d+$/) ? getShiftDepartment ($role ? $id."-".$role : $id) : "CLA";
Line 27... Line 27...
27
 
27
 
Line 28... Line 28...
28
print start_html (-title => "vORC Make Shift Change", -style => {'src' => "/style.css"}), $h->open ("body");
28
print start_html (-title => "vORC Make Shift Change", -style => {'src' => "/style.css"}), $h->open ("body");
29
 
29
 
30
 
30
 
31
if ($change eq "lookup") {
31
if ($change eq "lookup") {
32
	if (convertDepartments($user->{department})->{$department} < 2 and $LVL < 5) {
32
	if (convertDepartments($user->{department})->{$department} < 2 and $LVL < 5 and convertDepartments($user->{department})->{VCI} < 2) {
33
    print $h->div ({ class=>"error" }, "You're not allowed to change other people's schedules.");
33
    print $h->div ({ class=>"error" }, "You're not allowed to change other people's schedules.");
Line 39... Line 39...
39
  
39
  
40
  print $h->form ({ action=>url }, [
40
  print $h->form ({ action=>url }, [
41
    $h->input ({ type=>"hidden", name=>"change", value=>"add" }),
41
    $h->input ({ type=>"hidden", name=>"change", value=>"add" }),
42
    $h->input ({ type=>"hidden", name=>"id", value=>$id }),
42
    $h->input ({ type=>"hidden", name=>"id", value=>$id }),
43
    $h->input ({ type=>"hidden", name=>"role", value=>$role }),
43
    $h->input ({ type=>"hidden", name=>"role", value=>$role }),
44
    $h->p ("Add User to Shift ($id):"),
44
    $department eq "CLA" ? $h->p ("Add User to Class ($id):") : $h->p ("Add User to Shift ($id):"),
45
    $h->select ({ name=>"RCid", id=>"pickname" }, [ $h->option, $options ]),
45
    $h->select ({ name=>"RCid", id=>"pickname" }, [ $h->option, $options ]),
46
    $h->input ({ type=>"submit", value=>"Save", onClick=>"if (document.getElementById('pickname').selectedIndex === 0) { return false; }" }),
46
    $h->input ({ type=>"submit", value=>"Save", onClick=>"if (document.getElementById('pickname').selectedIndex === 0) { return false; }" }),
47
    $h->button ({ onClick=>"window.close();" }, "Cancel")
47
    $h->button ({ onClick=>"window.close();" }, "Cancel")