fixed timezone inside thematic tool - partial BT#578

skala
Cristian Fasanando 16 years ago
parent 272fd85c3a
commit a8a84ee42f
  1. 6
      main/course_progress/thematic.php
  2. 4
      main/inc/introductionSection.inc.php
  3. 14
      main/inc/lib/thematic.lib.php

@ -59,7 +59,7 @@ if ($action == 'thematic_list') {
}
echo '<table width="100%" class="data_table">';
echo '<tr><th width="35%">'.get_lang('Thematic').'</th><th width="30%">'.get_lang('ThematicPlan').'</th><th width="25%">'.get_lang('ThematicAdvance').'</th></tr>';
echo '<tr><th width="33%">'.get_lang('Thematic').'</th><th>'.get_lang('ThematicPlan').'</th><th width="33%">'.get_lang('ThematicAdvance').'</th></tr>';
foreach ($thematic_data as $thematic) {
echo '<tr>';
@ -89,9 +89,11 @@ if ($action == 'thematic_list') {
echo '<table width="100%">';
if (!empty($thematic_advance_data[$thematic['id']])) {
foreach ($thematic_advance_data[$thematic['id']] as $thematic_advance) {
$thematic_advance['start_date'] = api_get_local_time($thematic_advance['start_date']);
$thematic_advance['start_date'] = api_format_date($thematic_advance['start_date'], DATE_TIME_FORMAT_LONG);
echo '<tr>';
echo '<td width="90%">';
echo '<div><strong>'.api_convert_and_format_date($thematic_advance['start_date'], DATE_TIME_FORMAT_LONG, date_default_timezone_get()).'</strong></div>';
echo '<div><strong>'.$thematic_advance['start_date'].'</strong></div>';
echo '<div>'.Security::remove_XSS($thematic_advance['content'], STUDENT).'</div>';
echo '<div>'.get_lang('DurationInHours').' : '.$thematic_advance['duration'].'</div>';
echo '</td>';

@ -178,6 +178,8 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$thematic_advance = '<a href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?action=thematic_details&'.api_get_cidreq().'">'.get_lang('ThematicAdvance').'&nbsp;'.$thematic->get_total_average_of_thematic_advances().'%</a>';
}
$thematic_info = $thematic->get_thematic_list($thematic_advance_info['thematic_id']);
$thematic_advance_info['start_date'] = api_get_local_time($thematic_advance_info['start_date']);
$thematic_advance_info['start_date'] = api_format_date($thematic_advance_info['start_date'], DATE_TIME_FORMAT_LONG);
$thematic_description_html = '<div style="width:20%;float:left;font-size:10pt;"><div class="thematic-postit">
<div class="thematic-postit-top"><a class="thematic-postit-head" style="" href="#">'.Display::return_icon('postit_top.png').'</a></div>
@ -185,7 +187,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$thematic_description_html .= '<h3>'.$thematic_advance.'</h3>';
$thematic_description_html .= '<h4>'.$information_title.'</h4>';
$thematic_description_html .= '<div><strong>'.$thematic_info['title'].'</strong></div>';
$thematic_description_html .= '<div><strong>'.api_convert_and_format_date($thematic_advance_info['start_date'], DATE_TIME_FORMAT_LONG, date_default_timezone_get()).'</strong></div>';
$thematic_description_html .= '<div><strong>'.$thematic_advance_info['start_date'].'</strong></div>';
$thematic_description_html .= '<div>'.$thematic_advance_info['content'].'</div>';
$thematic_description_html .= '<div>'.get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].'</div>';
$thematic_description_html .= '<br />';

@ -338,20 +338,14 @@ class Thematic
ORDER BY col$column $direction LIMIT $from,$number_of_items ";
$res = Database::query($sql);
$data = array ();
$param_gradebook = '';
if (isset($_SESSION['gradebook'])) {
$param_gradebook = '&gradebook='.$_SESSION['gradebook'];
}
$i = 1;
while ($thematic_advance = Database::fetch_row($res)) {
$thematic_advance[1] = api_convert_and_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG, date_default_timezone_get());
$thematic_advance[1] = api_get_local_time($thematic_advance[1]);
$thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG);
if (api_is_allowed_to_edit(null, true)) {
$actions = '';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].$param_gradebook.'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>&nbsp;';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].$param_gradebook.'">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a></center>';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>&nbsp;';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a></center>';
$data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions);
}
$i++;

Loading…
Cancel
Save