From cc9fb736247532528a0a033ed377ca3316d06e83 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Fri, 19 Mar 2010 11:28:58 -0500 Subject: [PATCH] minor - cosmetic changes in thematic - partial BT#578 --- main/attendance/index.php | 38 ++++++++++++------------- main/attendance/thematic.php | 28 +++++++++--------- main/attendance/thematic_controller.php | 4 ++- main/inc/introductionSection.inc.php | 12 +++++--- 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/main/attendance/index.php b/main/attendance/index.php index fb324ab927..c2150ff473 100644 --- a/main/attendance/index.php +++ b/main/attendance/index.php @@ -55,6 +55,14 @@ if (isset($_POST['action']) && $_POST['action'] == 'thematic_delete_select') { $action = 'thematic_delete_select'; } +if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') { + $action = 'attendance_list'; +} + +if ($action == 'thematic_details' || $action == 'thematic_list') { + $_SESSION['thematic_control'] = $action; +} + // get attendance id $attendance_id = 0; if (isset($_GET['attendance_id'])) { @@ -256,7 +264,7 @@ if (api_is_drh() && isset($_GET['student_id'])) { if (!empty($gradebook)) { $interbreadcrumb[] = array ('url' => '/main/gradebook/index.php', 'name' => get_lang('ToolGradebook')); } -$interbreadcrumb[] = array ('url' => 'index.php?action=attendance_list'.$param_gradebook.$student_param, 'name' => get_lang('ToolAttendance')); +$interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=attendance_list'.$param_gradebook.$student_param, 'name' => get_lang('ToolAttendance')); if ($action == 'attendance_add') { $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('CreateANewAttendance')); } @@ -264,29 +272,23 @@ if ($action == 'thematic_list') { $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicControl')); } if ($action == 'thematic_add') { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicSection')); } if ($action == 'thematic_edit') { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('EditThematicSection')); } if ($action == 'thematic_details') { - //$interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicControl')); } -if ($action == 'thematic_plan_list' || $action == 'thematic_plan_delete') { - if (isset($_GET['origin']) && $_GET['origin'] == 'thematic_details') { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_details', 'name' => get_lang('ThematicControl')); - } else { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); - } +if ($action == 'thematic_plan_list' || $action == 'thematic_plan_delete') { + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); $interbreadcrumb[] = array ('url' => '#', 'name' => $thematic_data['title'].':'.get_lang('ThematicPlan')); } if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => $thematic_data['title'].':'.get_lang('ThematicPlan')); - + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => $thematic_data['title'].':'.get_lang('ThematicPlan')); if ($description_type >= ADD_THEMATIC_PLAN) { $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewBloc')); } else { @@ -294,16 +296,12 @@ if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') { } } if ($action == 'thematic_advance_list') { - if (isset($_GET['origin']) && $_GET['origin'] == 'thematic_details') { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_details', 'name' => get_lang('ThematicControl')); - } else { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); - } + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); $interbreadcrumb[] = array ('url' => '#', 'name' => $thematic_data['title'].':'.get_lang('ThematicAdvance')); } if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') { - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_list', 'name' => get_lang('ThematicControl')); - $interbreadcrumb[] = array ('url' => 'index.php?action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => $thematic_data['title'].':'.get_lang('ThematicAdvance')); + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$_SESSION['thematic_control'], 'name' => get_lang('ThematicControl')); + $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => $thematic_data['title'].':'.get_lang('ThematicAdvance')); $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicAdvance')); } if ($action == 'attendance_edit') { diff --git a/main/attendance/thematic.php b/main/attendance/thematic.php index 436f8b342b..179dded034 100644 --- a/main/attendance/thematic.php +++ b/main/attendance/thematic.php @@ -45,24 +45,24 @@ if ($action == 'thematic_list') { if (!empty($thematic_id)) { echo '
'.$thematic_data[$thematic_id]['title'].': '.get_lang('Details').'

'; } else { - echo '
'.get_lang('ThematicDetails').'

'; - } - - // display information - $message = ''.get_lang('Information').'
'; - $message .= get_lang('ThematicDetailsDescription'); - Display::display_normal_message($message, false); - echo '
'; - - // display progress - if (!empty($thematic_id)) { - echo '
'.get_lang('Progress').': '.$total_average_of_advances.'%

'; - } else { - echo '
'.get_lang('Progress').': '.$total_average_of_advances.'%

'; + echo '
'.get_lang('ThematicDetails').'

'; + // display information + $message = ''.get_lang('Information').'
'; + $message .= get_lang('ThematicDetailsDescription'); + Display::display_normal_message($message, false); + echo '
'; } // display thematic data if (!empty($thematic_data)) { + + // display progress + if (!empty($thematic_id)) { + echo '
'.get_lang('Progress').': '.$total_average_of_advances.'%

'; + } else { + echo '
'.get_lang('Progress').': '.$total_average_of_advances.'%

'; + } + echo ''; echo ''; diff --git a/main/attendance/thematic_controller.php b/main/attendance/thematic_controller.php index 230d6ddd1d..44074cb992 100644 --- a/main/attendance/thematic_controller.php +++ b/main/attendance/thematic_controller.php @@ -267,7 +267,9 @@ class ThematicController // get last done thematic advance before move thematic list $last_done_thematic_advance = $thematic->get_last_done_thematic_advance(); // update done advances with de current thematic list - $update_done_advances = $thematic->update_done_thematic_advances($last_done_thematic_advance); + if (!empty($last_done_thematic_advance)) { + $update_done_advances = $thematic->update_done_thematic_advances($last_done_thematic_advance); + } } unset($_SESSION['thematic_advance_token']); diff --git a/main/inc/introductionSection.inc.php b/main/inc/introductionSection.inc.php index 29ddb4530a..aa9074b166 100755 --- a/main/inc/introductionSection.inc.php +++ b/main/inc/introductionSection.inc.php @@ -145,6 +145,7 @@ if ($intro_cmdEdit || $intro_cmdAdd) { /* Executes the display */ +// display thematic advance inside a postit if ($intro_dispForm) { $default['intro_content'] = $intro_content; $form->setDefaults($default); @@ -159,17 +160,19 @@ $thematic_description_html = ''; if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) { $thematic = new Thematic(); - if (api_get_course_setting('display_info_advance_inside_homecourse')) { + if (api_get_course_setting('display_info_advance_inside_homecourse')) { + $information_title = get_lang('InfoAboutLastDoneAdvance'); $last_done_advance = $thematic->get_last_done_thematic_advance(); $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance); } else { + $information_title = get_lang('InfoAboutNextAdvanceNotDone'); $next_advance_not_done = $thematic->get_next_thematic_advance_not_done(); $thematic_advance_info = $thematic->get_thematic_advance_list($next_advance_not_done); } if (!empty($thematic_advance_info)) { - $style_introduction_section = 'style="width:65%;float:left;margin-left:10%;"'; + $style_introduction_section = 'style="width:65%;float:left;margin-left:5%;"'; $thematic_advance = get_lang('ThematicAdvance').' '.$thematic->get_total_average_of_thematic_advances().'%'; if (api_is_allowed_to_edit(null, true)) { $thematic_advance = ''.get_lang('ThematicAdvance').' '.$thematic->get_total_average_of_thematic_advances().'%'; @@ -178,8 +181,9 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) { $thematic_description_html = '
-
'; - $thematic_description_html .= '

'.$thematic_advance.'

'; +
'; + $thematic_description_html .= '

'.$thematic_advance.'

'; + $thematic_description_html .= '

'.$information_title.'

'; $thematic_description_html .= '
'.$thematic_info['title'].'
'; $thematic_description_html .= '
'.api_get_local_time($thematic_advance_info['start_date']).'
'; $thematic_description_html .= '
'.$thematic_advance_info['content'].'
';
'.get_lang('Thematic').''.get_lang('ThematicPlan').''.get_lang('ThematicAdvance').'