Subversion Repositories VORC

Rev

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

Rev 256 Rev 258
Line 598... Line 598...
598
  
598
  
599
  my $where = scalar @whereclause ? "where ".join " and ", @whereclause : "";
599
  my $where = scalar @whereclause ? "where ".join " and ", @whereclause : "";
600
  my @shifts;
600
  my @shifts;
601
  my $sth = $dbh->prepare("select * from (select id, date, dayofweek, track as location, time, role, teams, signup, 'OFF' as dept, volhours from v_shift_officiating where RCid = ? union
601
  my $sth = $dbh->prepare("select * from (select id, date, dayofweek, track as location, time, role, teams, signup, 'OFF' as dept, volhours from v_shift_officiating where RCid = ? union
602
                                          select id, date, dayofweek, track as location, time, role, teams, signup, 'ANN' as dept, volhours from v_shift_announcer where RCid = ? union
602
                                          select id, date, dayofweek, track as location, time, role, teams, signup, 'ANN' as dept, volhours from v_shift_announcer where RCid = ? union
603
                                          select id, date, dayofweek, location, time, role, '' as teams, type as signup, dept, volhours from v_shift where RCid = ? union
603
                                          select id, date, dayofweek, location, time, role, if(dept = 'COA', note, '') as teams, type as signup, dept, if(dept = 'PER', 0, volhours) as volhours from v_shift where RCid = ? union
604
                                          select id, date, dayofweek, location, time, role, name as teams, 'mvpclass' as signup, 'CLA' as dept, 0 as volhours from v_class_signup_new where RCid = ? union
604
                                          select id, date, dayofweek, location, time, role, name as teams, 'mvpclass' as signup, 'CLA' as dept, 0 as volhours from v_class_signup_new where RCid = ? union
605
                                          select id, date, dayofweek, location, time, role, name as teams, 'seminar' as signup, 'SEM' as dept, 0 as volhours from v_seminar_signup_new where RCid = ?) temp
605
                                          select id, date, dayofweek, location, time, role, name as teams, 'seminar' as signup, 'SEM' as dept, 0 as volhours from v_seminar_signup_new where RCid = ?) temp
606
                           $where order by date, time");
606
                           $where order by date, time");
607
  $sth->execute($RCid, $RCid, $RCid, $RCid, $RCid);
607
  $sth->execute($RCid, $RCid, $RCid, $RCid, $RCid);
Line 648... Line 648...
648
          # NO SHOW
648
          # NO SHOW
649
          $s->{buttons} .= " ".$h->button ({ onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$RCid&id=$s->{id}$linkargs','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "NO SHOW");
649
          $s->{buttons} .= " ".$h->button ({ onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$RCid&id=$s->{id}$linkargs','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "NO SHOW");
650
        }
650
        }
Line 651... Line 651...
651
        
651
        
652
      }
-
 
Line 653... Line 652...
653
#     $hours += $s->{volhours} unless $s->{dept} eq "PER" or $s->{dept} eq "CLA";
652
      }
654
      
653
      
655
    } elsif (($RCid == $ORCUSER->{RCid} and $s->{signup} !~ /^selected/ and $now < $cutoff) or ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5)) {
654
    } elsif (($RCid == $ORCUSER->{RCid} and $s->{signup} !~ /^selected/ and $now < $cutoff) or ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5)) {
656
      # it's a game shift
655
      # it's a game shift
657
      #DROP
656
      #DROP
658
      $s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$s->{id}&role=$s->{role}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "DROP");
657
      $s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$s->{id}&role=$s->{role}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "DROP");
659
      if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
658
      if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
660
        # NO SHOW
659
        # NO SHOW
661
        $s->{buttons} .= "&nbsp;".$h->button ({ onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$RCid&id=$s->{id}&role=$s->{role}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "NO SHOW");
-
 
662
      }
660
        $s->{buttons} .= "&nbsp;".$h->button ({ onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$RCid&id=$s->{id}&role=$s->{role}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "NO SHOW");
663
#      $hours += $s->{volhours};
661
      }
Line 664... Line -...
664
    }
-
 
665
    $s->{role} =~ s/\-\d+$//;
-
 
666
    
662
    }
-
 
663
    $s->{role} =~ s/\-\d+$//;
-
 
664
    
-
 
665
    $s->{time} = convertTime $s->{time};
-
 
666
    my $onclick =  $s->{dept} eq "PER" ? "location.href = 'personal_time.pl?id=$s->{id}';" :
-
 
667
                  ($s->{dept} eq "OFF" or $s->{dept} eq "ANN") ? "location.href = 'view_game.pl?id=$s->{id}';" :
-
 
668
                   $s->{dept} eq "CLA" ? "location.href = 'view_class.pl?id=$s->{id}';" :
-
 
669
                   $s->{dept} eq "SEM" ? "location.href = 'view_seminar.pl?id=$s->{id}';" :
-
 
670
                   "location.href = 'view_shift.pl?id=$s->{id}';";
-
 
671
    push @shifts, $h->div ({ class=>"rTableRow ".($s->{date} eq $dt ? "highlighted" : "shaded") },
-
 
672
                    [$h->div ( { class=>'rTableCellr', style=>"white-space:nowrap;padding:0px 5px;font-size:small;", onClick => $onclick },
667
#   push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "nowrap highlighted" : "nowrap shaded" }, join '&nbsp;&nbsp;', $s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams}, $s->{buttons});
673
                       substr($s->{dayofweek}, 0, 3)." [".$s->{date} =~ s/^\d{4}-(0)?//r =~ s|-(0)?|/|r."]",
668
#   push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, join '&nbsp;&nbsp;', $s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams}, $s->{buttons});
674
                       $s->{time}.$h->br.
-
 
675
                       ($s->{volhours} ? $s->{volhours}." hrs" : '&nbsp;'),
669
    $s->{time} = convertTime $s->{time};
676
                       $s->{location},
670
    if ($s->{dept} eq "PER") {
677
                       ($s->{dept} eq "CLA" ? "MVP Class" : $s->{dept} eq "SEM" ? "Seminar" : getDepartments()->{$s->{dept}}) .$h->br.
671
      push @shifts, $h->li ({ onClick => "location.replace('personal_time.pl?id=$s->{id}');", class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, $h->div ({ class=>"lisp0" }, [ $h->div ({ class=>"liLeft" }, join '&nbsp;&nbsp;', ($s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, $s->{dept} eq "CLA" ? "MVP Class:" : getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams})), $h->div ({ class=>"liRight" }, $s->{buttons}) ]));
678
                       ($s->{teams} ? $s->{role}.": ".$s->{teams} : $s->{role}),
672
    } else {
679
                       $s->{buttons})
673
      push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, $h->div ({ class=>"lisp0" }, [ $h->div ({ class=>"liLeft" }, join '&nbsp;&nbsp;', ($s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, $s->{dept} eq "CLA" ? "MVP Class:" : getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams})), $h->div ({ class=>"liRight" }, $s->{buttons}) ]));
680
                     ]
Line 674... Line 681...
674
    }
681
                   );
675
    $hours += $s->{volhours} unless $s->{dept} eq "PER" or $s->{dept} eq "CLA";
682
    $hours += $s->{volhours};
676
  }
683
  }
Line 677... Line 684...
677
  
684
  
678
  if ($output eq "hours") {
685
  if ($output eq "hours") {
679
    return $hours;
686
    return $hours;
680
  }
687
  }
681
  
688
  
682
  if (scalar @shifts) {
689
  if (scalar @shifts) {
683
    return $h->ul ([ @shifts, $h->h5 ("Currently showing $hours hours of Volunteer Time.") ]);
690
    return $h->ul ({ style=>"padding-inline-start:5px;" }, [ @shifts, $h->h5 ("Currently showing $hours ".($filter eq "all" ? " total " : "remaining ")."hours of Volunteer Time.") ]);