@@ 74-101 (lines=28) @@ | ||
71 | if (!empty($my_folder_data)) { |
|
72 | $homework = get_work_assignment_by_id($my_folder_data['id']); |
|
73 | ||
74 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
75 | $time_now = time(); |
|
76 | ||
77 | if (!empty($homework['expires_on']) && |
|
78 | !empty($homework['expires_on']) |
|
79 | ) { |
|
80 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
81 | $difference = $time_expires - $time_now; |
|
82 | if ($difference < 0) { |
|
83 | $has_expired = true; |
|
84 | } |
|
85 | } |
|
86 | ||
87 | if (empty($homework['expires_on'])) { |
|
88 | $has_expired = false; |
|
89 | } |
|
90 | ||
91 | if (!empty($homework['ends_on'])) { |
|
92 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
93 | $difference2 = $time_ends - $time_now; |
|
94 | if ($difference2 < 0) { |
|
95 | $has_ended = true; |
|
96 | } |
|
97 | } |
|
98 | ||
99 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
100 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
101 | } |
|
102 | } |
|
103 | ||
104 | $interbreadcrumb[] = array( |
@@ 3438-3463 (lines=26) @@ | ||
3435 | ||
3436 | if (!empty($homework)) { |
|
3437 | ||
3438 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
3439 | $time_now = time(); |
|
3440 | ||
3441 | if (!empty($homework['expires_on'])) { |
|
3442 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
3443 | $difference = $time_expires - $time_now; |
|
3444 | if ($difference < 0) { |
|
3445 | $has_expired = true; |
|
3446 | } |
|
3447 | } |
|
3448 | ||
3449 | if (empty($homework['expires_on'])) { |
|
3450 | $has_expired = false; |
|
3451 | } |
|
3452 | ||
3453 | if (!empty($homework['ends_on'])) { |
|
3454 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
3455 | $difference2 = $time_ends - $time_now; |
|
3456 | if ($difference2 < 0) { |
|
3457 | $has_ended = true; |
|
3458 | } |
|
3459 | } |
|
3460 | ||
3461 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
3462 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
3463 | } |
|
3464 | ||
3465 | if ($has_ended) { |
|
3466 | $message = Display::return_message(get_lang('EndDateAlreadyPassed').' '.$ends_on, 'error'); |