| @@ 72-99 (lines=28) @@ | ||
| 69 | if (!empty($my_folder_data)) { |
|
| 70 | $homework = get_work_assignment_by_id($my_folder_data['id']); |
|
| 71 | ||
| 72 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
| 73 | $time_now = time(); |
|
| 74 | ||
| 75 | if (!empty($homework['expires_on']) && |
|
| 76 | !empty($homework['expires_on']) |
|
| 77 | ) { |
|
| 78 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
| 79 | $difference = $time_expires - $time_now; |
|
| 80 | if ($difference < 0) { |
|
| 81 | $has_expired = true; |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| 85 | if (empty($homework['expires_on'])) { |
|
| 86 | $has_expired = false; |
|
| 87 | } |
|
| 88 | ||
| 89 | if (!empty($homework['ends_on'])) { |
|
| 90 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
| 91 | $difference2 = $time_ends - $time_now; |
|
| 92 | if ($difference2 < 0) { |
|
| 93 | $has_ended = true; |
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||
| 97 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
| 98 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||
| 102 | $interbreadcrumb[] = array( |
|
| @@ 3541-3566 (lines=26) @@ | ||
| 3538 | $has_ended = false; |
|
| 3539 | ||
| 3540 | if (!empty($homework)) { |
|
| 3541 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
| 3542 | $time_now = time(); |
|
| 3543 | ||
| 3544 | if (!empty($homework['expires_on'])) { |
|
| 3545 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
| 3546 | $difference = $time_expires - $time_now; |
|
| 3547 | if ($difference < 0) { |
|
| 3548 | $has_expired = true; |
|
| 3549 | } |
|
| 3550 | } |
|
| 3551 | ||
| 3552 | if (empty($homework['expires_on'])) { |
|
| 3553 | $has_expired = false; |
|
| 3554 | } |
|
| 3555 | ||
| 3556 | if (!empty($homework['ends_on'])) { |
|
| 3557 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
| 3558 | $difference2 = $time_ends - $time_now; |
|
| 3559 | if ($difference2 < 0) { |
|
| 3560 | $has_ended = true; |
|
| 3561 | } |
|
| 3562 | } |
|
| 3563 | ||
| 3564 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
| 3565 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
| 3566 | } |
|
| 3567 | ||
| 3568 | if ($has_ended) { |
|
| 3569 | $message = Display::return_message(get_lang('EndDateAlreadyPassed').' '.$ends_on, 'error'); |
|