Subversion Repositories VORC

Rev

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

Rev 96 Rev 106
Line 430... Line 430...
430
  my $where = scalar @whereclause ? "where ".join " and ", @whereclause : "";
430
  my $where = scalar @whereclause ? "where ".join " and ", @whereclause : "";
431
  my @shifts;
431
  my @shifts;
432
  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
432
  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
433
                                          select id, date, dayofweek, track as location, time, role, teams, signup, 'ANN' as dept, volhours from v_shift_announcer where RCid = ? union
433
                                          select id, date, dayofweek, track as location, time, role, teams, signup, 'ANN' as dept, volhours from v_shift_announcer where RCid = ? union
434
                                          select id, date, dayofweek, location, time, role, '' as teams, type as signup, dept, volhours from v_shift where RCid = ? union
434
                                          select id, date, dayofweek, location, time, role, '' as teams, type as signup, dept, volhours from v_shift where RCid = ? union
435
                                          select id, date, dayofweek, location, time, role, '' as teams, 'mvpclass' as signup, 'CLA' as dept, 0 as volhours from v_class_signup where RCid = ?) temp
435
                                          select id, date, dayofweek, location, time, role, name as teams, 'mvpclass' as signup, 'CLA' as dept, 0 as volhours from v_class_signup where RCid = ?) temp
436
                           $where order by date, time");
436
                           $where order by date, time");
437
  $sth->execute($RCid, $RCid, $RCid, $RCid);
437
  $sth->execute($RCid, $RCid, $RCid, $RCid);
438
  my $hours = 0;
438
  my $hours = 0;
439
  while (my $s = $sth->fetchrow_hashref) {
439
  while (my $s = $sth->fetchrow_hashref) {
440
    my ($yyyy, $mm, $dd) = split /\-/, $s->{date};
440
    my ($yyyy, $mm, $dd) = split /\-/, $s->{date};
Line 447... Line 447...
447
        second => 0,
447
        second => 0,
448
        time_zone => 'America/Los_Angeles'
448
        time_zone => 'America/Los_Angeles'
449
    );
449
    );
Line 450... Line 450...
450
    
450
    
451
    
451
    
452
  	if (!$s->{teams}) {
452
  	if (!$s->{teams} or $s->{dept} eq "CLA") {
453
  	  # it's a time-based shift
453
  	  # it's a time-based shift
454
  	  if ($s->{dept} eq "PER") {
454
  	  if ($s->{dept} eq "PER") {
455
        if ($RCid eq $ORCUSER->{RCid}) {
455
        if ($RCid eq $ORCUSER->{RCid}) {
Line 463... Line 463...
463
        # DROP
463
        # DROP
464
        my ($shiftORclass, $linkargs) = ("shift", "");
464
        my ($shiftORclass, $linkargs) = ("shift", "");
465
        if ($s->{dept} eq "CLA") {
465
        if ($s->{dept} eq "CLA") {
466
          $shiftORclass = "class";
466
          $shiftORclass = "class";
467
          $linkargs = "&role=$s->{role}";
467
          $linkargs = "&role=$s->{role}";
-
 
468
          $s->{role} = $s->{teams};
-
 
469
          $s->{teams} = "";
468
        }
470
        }
469
	   		$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this $shiftORclass?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$s->{id}$linkargs','Confirm Class Change','resizable,height=260,width=370'); return false; }" }, "DROP");
471
	   		$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this $shiftORclass?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$s->{id}$linkargs','Confirm Class Change','resizable,height=260,width=370'); return false; }" }, "DROP");
470
	   		if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
472
	   		if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
471
   		    # NO SHOW
473
   		    # NO SHOW
472
 	  	    $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");
474
 	  	    $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");
Line 487... Line 489...
487
  	$s->{role} =~ s/\-\d+$//;
489
  	$s->{role} =~ s/\-\d+$//;
Line 488... Line 490...
488
  	
490
  	
489
#  	push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "nowrap highlighted" : "nowrap shaded" }, join '  ', $s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams}, $s->{buttons});
491
#  	push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "nowrap highlighted" : "nowrap shaded" }, join '  ', $s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams}, $s->{buttons});
490
#  	push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, join '  ', $s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams}, $s->{buttons});
492
#  	push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, join '  ', $s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams}, $s->{buttons});
491
    $s->{time} = convertTime $s->{time};
493
    $s->{time} = convertTime $s->{time};
492
  	push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, $h->div ({ class=>"lisp0" }, [ $h->div ({ class=>"liLeft" }, join '  ', ($s->{date}, $s->{dayofweek}, $s->{time}, $s->{location}, getDepartments()->{$s->{dept}}, $s->{role}, $s->{teams})), $h->div ({ class=>"liRight" }, $s->{buttons}) ]));
494
  	push @shifts, $h->li ({ class=> $s->{date} eq $dt ? "highlighted" : "shaded" }, $h->div ({ class=>"lisp0" }, [ $h->div ({ class=>"liLeft" }, join '  ', ($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}) ]));
Line 493... Line 495...
493
  }
495
  }
494
  
496
  
495
  if (scalar @shifts) {
497
  if (scalar @shifts) {