| @@ 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( |
|
| @@ 3457-3482 (lines=26) @@ | ||
| 3454 | ||
| 3455 | if (!empty($homework)) { |
|
| 3456 | ||
| 3457 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
| 3458 | $time_now = time(); |
|
| 3459 | ||
| 3460 | if (!empty($homework['expires_on'])) { |
|
| 3461 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
| 3462 | $difference = $time_expires - $time_now; |
|
| 3463 | if ($difference < 0) { |
|
| 3464 | $has_expired = true; |
|
| 3465 | } |
|
| 3466 | } |
|
| 3467 | ||
| 3468 | if (empty($homework['expires_on'])) { |
|
| 3469 | $has_expired = false; |
|
| 3470 | } |
|
| 3471 | ||
| 3472 | if (!empty($homework['ends_on'])) { |
|
| 3473 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
| 3474 | $difference2 = $time_ends - $time_now; |
|
| 3475 | if ($difference2 < 0) { |
|
| 3476 | $has_ended = true; |
|
| 3477 | } |
|
| 3478 | } |
|
| 3479 | ||
| 3480 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
| 3481 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
| 3482 | } |
|
| 3483 | ||
| 3484 | if ($has_ended) { |
|
| 3485 | $message = Display::return_message(get_lang('EndDateAlreadyPassed').' '.$ends_on, 'error'); |
|