Subversion Repositories ORC

Rev

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

Rev 24 Rev 25
Line 93... Line 93...
93
 
93
 
94
use DateTime;
94
use DateTime;
95
use DateTime::Duration;
95
use DateTime::Duration;
96
sub modify_derby_name {
96
sub modify_derby_name {
97
  my $t = shift;  
-
 
-
 
97
  my $t = shift;  
98
 
98
  my $now = DateTime->now (time_zone => 'America/Los_Angeles');
99
 	my ($yyyy, $mm, $dd) = split /\-/, $t->{date};
99
 	my ($yyyy, $mm, $dd) = split /\-/, $t->{date};
100
	my $cutoff = DateTime->new(
100
	my $cutoff = DateTime->new(
101
        year => $yyyy,
101
        year => $yyyy,
102
        month => $mm,
102
        month => $mm,
103
        day => $dd,
103
        day => $dd,
104
        hour => 5,
104
        hour => 5,
105
        minute => 0,
105
        minute => 0,
106
        second => 0,
106
        second => 0,
107
        time_zone => 'America/Los_Angeles'
107
        time_zone => 'America/Los_Angeles'
108
  );
108
  );
109
 
109
  
110
 	if (($t->{assignee_id} == $RCid and $t->{type} ne "selected" and $now < $cutoff) or ($t->{derby_name} and ($user->{department}->{$t->{dept}} >= 2 or $LVL >= 5))) {
110
 	if (($t->{assignee_id} == $RCid and $t->{type} ne "selected" and $now < $cutoff) or ($t->{derby_name} and ($user->{department}->{$t->{dept}} >= 2 or $LVL >= 5))) {
111
 		# DROP
111
 		# DROP
112
 		$t->{derby_name} = "$t->{derby_name} <A HREF='#' onClick=\"event.stopPropagation(); if (confirm('Really? You want to drop this person from the shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$t->{assignee_id}&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }\">[DROP]</a>";
112
 		$t->{derby_name} = "$t->{derby_name} <A HREF='#' onClick=\"event.stopPropagation(); if (confirm('Really? You want to drop this person from the shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$t->{assignee_id}&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }\">[DROP]</a>";
113
 		if ($user->{department}->{$t->{dept}} >= 2 or $LVL > 4) {
113
 		if ($user->{department}->{$t->{dept}} >= 2 or $LVL > 4) {