Feature #272 - "Assignments" and "Dropbox" tools: Showing dates correctly on PHP 5.2 and PHP 5.3.

skala
Ivan Tcholakov 16 years ago
parent d63e8ef1cd
commit 2d81d29b4a
  1. 6
      main/dropbox/index.php
  2. 21
      main/work/work.lib.php
  3. 16
      main/work/work.php

@ -432,7 +432,8 @@ if ($_GET['action'] != 'add') {
$dropbox_file_data[] = $dropbox_file->author;
//$dropbox_file_data[] = $dropbox_file->description;
$dropbox_file_data[] = date_to_str_ago(api_get_local_time($dropbox_file->last_upload_date, null, null, date_default_timezone_get())).'<br /><span class="dropbox_date">'.api_get_local_time($dropbox_file->last_upload_date, null, null, date_default_timezone_get()).'</span>';
$last_upload_date = api_get_local_time($dropbox_file->last_upload_date, 'Y-m-d H:i:s', null, date_default_timezone_get());
$dropbox_file_data[] = date_to_str_ago($last_upload_date).'<br /><span class="dropbox_date">'.api_format_date_time_long($last_upload_date).'</span>';
$action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.Security::remove_XSS($_GET['view_received_category']).'&amp;view_sent_category='.Security::remove_XSS($_GET['view_sent_category']).'&amp;view='.Security::remove_XSS($_GET['view']).'&amp;action=viewfeedback&amp;id='.$dropbox_file->id.'">'.Display::return_icon('comment_bubble.gif', get_lang('Comment')).'</a>
@ -578,7 +579,8 @@ if ($_GET['action'] != 'add') {
}
$receivers_celldata = trim(trim($receivers_celldata), ','); // Removing the trailing comma.
$dropbox_file_data[] = $receivers_celldata;
$dropbox_file_data[] = date_to_str_ago(api_get_local_time($dropbox_file->last_upload_date, null, null, date_default_timezone_get())).'<br /><span class="dropbox_date">'.api_get_local_time($dropbox_file->last_upload_date, null, null, date_default_timezone_get()).'</span>';
$last_upload_date = api_get_local_time($dropbox_file->last_upload_date, 'Y-m-d H:i:s', null, date_default_timezone_get());
$dropbox_file_data[] = date_to_str_ago($last_upload_date).'<br /><span class="dropbox_date">'.api_get_local_time($last_upload_date).'</span>';
//$dropbox_file_data[] = $dropbox_file->author;
$receivers_celldata = '';

@ -693,15 +693,8 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
}
if ($direc_date != '' && $direc_date != '0000-00-00 00:00:00') {
$direc_date = api_get_local_time($direc_date, null, null, date_default_timezone_get());
/*
$my_direc_date = api_ucfirst(format_locale_date($dateFormatShort, strtotime($direc_date))).'&nbsp;&nbsp;&nbsp;&nbsp;';
$my_direc_date .= api_ucfirst(strftime($timeNoSecFormat, strtotime($direc_date)));
*/
$my_direc_date = $direc_date;
$row[] = date_to_str_ago($direc_date).'<br /><span class="dropbox_date">'.$my_direc_date.'</span>'.'<!--uts='.strtotime($direc_date).'-->';
$direc_date = api_get_local_time($direc_date, 'Y-m-d H:i:s', null, date_default_timezone_get());
$row[] = date_to_str_ago($direc_date).'<br /><span class="dropbox_date">'.api_format_date_time_long($direc_date).'</span>'.'<!--uts='.strtotime($direc_date).'-->';
} else {
$row[] = '';
}
@ -761,14 +754,8 @@ function display_student_publications_list($work_dir, $sub_course_dir, $currentC
$row[] = '<a href="download.php?file='.$url.'"'.$class.'><img src="../img/filesave.gif" style="float:right;" alt="'.get_lang('Save').'" title="'.get_lang('Save').'" />'.$work->title.'</a><br />'.$work->description;
$row[] = display_user_link_work($row2['insert_user_id'], $work->author).$qualification_string; // $work->author;
$work_sent_date = api_get_local_time($work->sent_date, null, null, date_default_timezone_get());
/*
$sent_date = api_ucfirst(format_locale_date($dateFormatShort, strtotime($work_sent_date))).'&nbsp;&nbsp;&nbsp;&nbsp;';
$sent_date .= api_ucfirst(strftime($timeNoSecFormat, strtotime($work_sent_date)));
*/
$sent_date = $work_sent_date;
$row[] = date_to_str_ago($work->sent_date).$add_string.'<br /><span class="dropbox_date">'.$sent_date.'</span>'.'<!--uts='.strtotime($work->sent_date).'-->';
$work_sent_date = api_get_local_time($work->sent_date, 'Y-m-d H:i:s', null, date_default_timezone_get());
$row[] = date_to_str_ago($work_sent_date).$add_string.'<br /><span class="dropbox_date">'.api_format_date_time_long($work_sent_date).'</span>'.'<!--uts='.strtotime($work_sent_date).'-->';
if ($is_allowed_to_edit) {

@ -1117,19 +1117,11 @@ if ($is_special > 0) {
define('ASSIGNMENT_EXPIRES', $time_expires);
}
$ends_on_datetime = api_get_local_time($homework['ends_on'], null, null, date_default_timezone_get());
/*
$ends_on = api_ucfirst(format_locale_date($dateFormatLong, strtotime($ends_on_datetime))).' ';
$ends_on .= api_ucfirst(strftime($timeNoSecFormat, strtotime($ends_on_datetime)));
*/
$ends_on = $ends_on_datetime;
$ends_on_datetime = api_get_local_time($homework['ends_on'], 'Y-m-d H:i:s', null, date_default_timezone_get());
$ends_on = api_format_date_time_long($ends_on_datetime);
$expires_on_datetime = api_get_local_time($homework['expires_on'], null, null, date_default_timezone_get());
/*
$expires_on = api_ucfirst(format_locale_date($dateFormatLong, strtotime($expires_on_datetime))).' ';
$expires_on .= api_ucfirst(strftime($timeNoSecFormat, strtotime($expires_on_datetime)));
*/
$expires_on = $expires_on_datetime;
$expires_on_datetime = api_get_local_time($homework['expires_on'], 'Y-m-d H:i:s', null, date_default_timezone_get());
$expires_on = api_format_date_time_long($expires_on_datetime);
if ($has_ended) {
display_action_links($cur_dir_path, $always_show_tool_options, true);

Loading…
Cancel
Save