@@ 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( |
@@ 3319-3344 (lines=26) @@ | ||
3316 | $has_ended = false; |
|
3317 | ||
3318 | if (!empty($homework)) { |
|
3319 | if (!empty($homework['expires_on']) || !empty($homework['ends_on'])) { |
|
3320 | $time_now = time(); |
|
3321 | ||
3322 | if (!empty($homework['expires_on'])) { |
|
3323 | $time_expires = api_strtotime($homework['expires_on'], 'UTC'); |
|
3324 | $difference = $time_expires - $time_now; |
|
3325 | if ($difference < 0) { |
|
3326 | $has_expired = true; |
|
3327 | } |
|
3328 | } |
|
3329 | ||
3330 | if (empty($homework['expires_on'])) { |
|
3331 | $has_expired = false; |
|
3332 | } |
|
3333 | ||
3334 | if (!empty($homework['ends_on'])) { |
|
3335 | $time_ends = api_strtotime($homework['ends_on'], 'UTC'); |
|
3336 | $difference2 = $time_ends - $time_now; |
|
3337 | if ($difference2 < 0) { |
|
3338 | $has_ended = true; |
|
3339 | } |
|
3340 | } |
|
3341 | ||
3342 | $ends_on = api_convert_and_format_date($homework['ends_on']); |
|
3343 | $expires_on = api_convert_and_format_date($homework['expires_on']); |
|
3344 | } |
|
3345 | ||
3346 | if ($has_ended) { |
|
3347 | $message = Display::return_message(get_lang('EndDateAlreadyPassed').' '.$ends_on, 'error'); |