@@ 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( |
@@ 3369-3394 (lines=26) @@ | ||
3366 | ||
3367 | if (!empty($homework)) { |
|
3368 | ||
3369 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
3370 | $time_now = time(); |
|
3371 | ||
3372 | if (!empty($homework['expires_on'])) { |
|
3373 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
3374 | $difference = $time_expires - $time_now; |
|
3375 | if ($difference < 0) { |
|
3376 | $has_expired = true; |
|
3377 | } |
|
3378 | } |
|
3379 | ||
3380 | if (empty($homework['expires_on'])) { |
|
3381 | $has_expired = false; |
|
3382 | } |
|
3383 | ||
3384 | if (!empty($homework['ends_on'])) { |
|
3385 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
3386 | $difference2 = $time_ends - $time_now; |
|
3387 | if ($difference2 < 0) { |
|
3388 | $has_ended = true; |
|
3389 | } |
|
3390 | } |
|
3391 | ||
3392 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
3393 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
3394 | } |
|
3395 | ||
3396 | if ($has_ended) { |
|
3397 | $message = Display::return_message(get_lang('EndDateAlreadyPassed').' '.$ends_on, 'error'); |