From 33972b05edbabd425e41341f437d5ecaefa63507 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 29 Apr 2011 18:11:45 +0200 Subject: [PATCH] Adding icons in reporting --- main/css/base.css | 69 +++++++++++++++---------------- main/mySpace/index.php | 2 +- main/mySpace/lp_tracking.php | 31 +++++++------- main/mySpace/myStudents.php | 10 +++-- main/newscorm/learnpath.class.php | 10 +++-- main/newscorm/lp_stats.php | 38 ++++++++--------- main/tracking/courseLog.php | 5 ++- 7 files changed, 83 insertions(+), 82 deletions(-) diff --git a/main/css/base.css b/main/css/base.css index 960e1af005..1fea1df0c2 100644 --- a/main/css/base.css +++ b/main/css/base.css @@ -264,9 +264,7 @@ input.maininput:focus { float:left; } -.course-link-desc span { - -} +/* Attendance */ .attendance-users-table td { height:66px; @@ -276,6 +274,7 @@ input.maininput:focus { height:66px; } +/* Agenda */ .rounded_div_agenda { background: none repeat scroll 0 0 #FFFFFF; @@ -331,29 +330,15 @@ a.tag { white-space: nowrap; } -/* New button style experimental */ -button { - border:1px solid #ccc; - - -opera-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; - - -opera-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5); - -webkit-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5); - box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5); - - font-weight:bold; - font-size: 105%; +#agenda_list th { + background-color: #F2F2F2; } -button:hover { - color:#000; - border-style: inset; - background-color:#eee; - border:1px solid #ccc; +#agenda_list .days_week { + height: 100px; } + /* Makes the course elements more readable */ .userportal-course-item{ padding:15px; @@ -363,11 +348,9 @@ button:hover { padding: 6px 0px 6px 5px ; } -/* New LP add item */ +/* LP tool*/ div.lp_resource { - /*background:#FAFAFA; - border:1px solid #ccc; */ padding:5px 10px; width:450px; @@ -378,11 +361,8 @@ div.lp_resource { } .lp_resource_element, .lp_resource_element_no_link { - /*background: -moz-linear-gradient(center top , #FEFEFE, #EEEEEE) repeat scroll 0 0 #EEEEEE; - background: -webkit-linear-gradient(center top , #FEFEFE, #EEEEEE) repeat scroll 0 0 #EEEEEE;*/ background-image:-moz-linear-gradient(top,#fefefe,#eee); - background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fdfdfd),color-stop(1,#eee)); - + background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fdfdfd),color-stop(1,#eee)); border: 1px solid #CCCCCC; color: #444444; cursor: pointer; @@ -412,12 +392,6 @@ table.lp_build td.tree { min-height:380px; } -/* Calendar */ -#agenda_list .days_week { - height: 100px; -} - - /* Breadcrumb */ .bread { @@ -493,6 +467,31 @@ table.lp_build td.tree { float:right; } +/* New button style experimental */ +button { + border:1px solid #ccc; + + -opera-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + + -opera-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5); + -webkit-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5); + box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.5); + + font-weight:bold; + font-size: 105%; +} + +button:hover { + color:#000; + border-style: inset; + background-color:#eee; + border:1px solid #ccc; +} + +/* Nice buttons v2 */ + .a_button { display: inline-block; zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */ diff --git a/main/mySpace/index.php b/main/mySpace/index.php index e0f2a4a697..599b7b9a87 100755 --- a/main/mySpace/index.php +++ b/main/mySpace/index.php @@ -158,7 +158,7 @@ if (api_is_allowed_to_create_course() && $_GET['display'] != 'yourstudents') { } else { if (!empty($session_id)) { $session_name = api_get_session_name($session_id); - $title = get_lang('Session').' '.$session_name; + $title = Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name; } $menu_items[] = ''.get_lang('TeacherInterface').''; } diff --git a/main/mySpace/lp_tracking.php b/main/mySpace/lp_tracking.php index 7e25f8e2a4..65eb3c6388 100755 --- a/main/mySpace/lp_tracking.php +++ b/main/mySpace/lp_tracking.php @@ -7,8 +7,6 @@ */ $language_file = array ('registration', 'index', 'tracking', 'exercice', 'scorm', 'learnpath'); -//$cidReset = true; - require_once '../inc/global.inc.php'; $from_myspace = false; @@ -19,12 +17,12 @@ if (isset($_GET['from']) && $_GET['from'] == 'myspace') { } else { $this_section = SECTION_COURSES; } -include_once api_get_path(LIBRARY_PATH).'tracking.lib.php'; -include_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; -include_once api_get_path(LIBRARY_PATH).'course.lib.php'; -include_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; -include_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php'; -include_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathItem.class.php'; +require_once api_get_path(LIBRARY_PATH).'tracking.lib.php'; +require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; +require_once api_get_path(LIBRARY_PATH).'course.lib.php'; +require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; +require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php'; +require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathItem.class.php'; require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false; @@ -55,7 +53,7 @@ if (!empty($course_exits)) { api_not_allowed(); } -$_course['dbNameGlu'] = $_configuration['table_prefix'] . $_course['db_name'] . $_configuration['db_glue']; +//$_course['dbNameGlu'] = $_configuration['table_prefix'] . $_course['db_name'] . $_configuration['db_glue']; if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') { $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$_course['directory'], 'name' => $_course['title']); @@ -71,6 +69,7 @@ if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') { } $interbreadcrumb[] = array("url" => "myStudents.php?student=".Security::remove_XSS($_GET['student_id'])."&course=".$cidReq."&details=true&origin=".Security::remove_XSS($_GET['origin']) , "name" => get_lang("DetailsStudentInCourse")); + $nameTools = get_lang('LearningPathDetails'); $htmlHeadXtra[] = ' @@ -97,8 +96,6 @@ $lp_id = intval($_GET['lp_id']); $sql = 'SELECT name FROM '.Database::get_course_table(TABLE_LP_MAIN, $_course['db_name']).' WHERE id='.$lp_id; $rs = Database::query($sql); $lp_title = Database::result($rs, 0, 0); - - echo '
'; echo ''.Display::return_icon('back.png',get_lang('Back'),'','32').''; echo ' @@ -110,18 +107,20 @@ echo '
'; echo '
'; $session_name = api_get_session_name(api_get_session_id()); -$table_title = ($session_name? get_lang('Session').' : '.$session_name.' | ':'').get_lang('Course').' : '.$_course['title'].' | '.$name; +$table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name.' ':' '). + Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$_course['title'].' '. + Display::return_icon('user.png', get_lang('User'), array(), 22).' '.$name; echo '

'.$table_title.'

'; -echo '

'.get_lang('ToolLearnpath').' : '.$lp_title.'

'; +echo '

'.Display::return_icon('learnpath.png', get_lang('ToolLearnpath'), array(), 22).' '.$lp_title.'

'; -$list = learnpath :: get_flat_ordered_items_list($lp_id); +$list = learnpath :: get_flat_ordered_items_list($lp_id, 0, $_course['db_name']); $origin = 'tracking'; if ($export_csv) { - include_once api_get_path(SYS_CODE_PATH).'newscorm/lp_stats.php'; + require_once api_get_path(SYS_CODE_PATH).'newscorm/lp_stats.php'; //Export :: export_table_csv($csv_content, 'reporting_student'); } else { ob_start(); - include_once api_get_path(SYS_CODE_PATH).'newscorm/lp_stats.php'; + require_once api_get_path(SYS_CODE_PATH).'newscorm/lp_stats.php'; $tracking_content = ob_get_contents(); ob_end_clean(); echo api_utf8_decode($tracking_content, $charset); diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index 65f74a4585..f7b7bc4c7e 100755 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -383,11 +383,13 @@ if (!empty ($_GET['student'])) { //$table_title = ($session_name? get_lang('Session').' : '.ucfirst($session_name).' | ':'').get_lang('Course').' : '.$info_course['title'].($coachs_name?' | '.get_lang('Tutor').' : '.stripslashes($coachs_name):''); //Hiding coach name - //$table_title = ($session_name? get_lang('Session').' : '.ucfirst($session_name).' | ':'').get_lang('Course').' : '.$info_course['title'].' | '.api_get_person_name($info_user['lastname'], $info_user['firstname']); + //$table_title = ($session_name? get_lang('Session').' : '.ucfirst($session_name).' | ':'').get_lang('Course').' : '.$info_course['title'].' | '.api_get_person_name($info_user['firstname'], $info_user['lastname']); $info_course = CourseManager :: get_course_information($get_course_code); $session_name = api_get_session_name($session_id); - $table_title = ($session_name? get_lang('Session').' : '.$session_name.' | ':'').($info_course ?get_lang('Course').' : '.$info_course['title'].' | ':'').api_get_person_name($info_user['lastname'], $info_user['firstname']); + $table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.$session_name.' ':''). + $table_title .= ($info_course ? Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$info_course['title'].' ':''); + $table_title .= Display::return_icon('user.png', get_lang('User'), array(), 22).api_get_person_name($info_user['firstname'], $info_user['lastname']); echo '

'.$table_title.'

'; @@ -407,7 +409,7 @@ if (!empty ($_GET['student'])) { $big_image_height = $big_image_size[1]; $url_big_image = $big_image . '?rnd=' . time(); $img_attributes = 'src="' . $image_file . '?rand=' . time() . '" ' . - 'alt="' . api_get_person_name($info_user['lastname'], $info_user['firstname']) . '" ' . + 'alt="' . api_get_person_name($info_user['firstname'], $info_user['lastname']) . '" ' . 'style="float:' . ($text_dir == 'rtl' ? 'left' : 'right') . '; padding:5px;" '; if ($image_array['file'] == 'unknown.jpg') { @@ -426,7 +428,7 @@ if (!empty ($_GET['student'])) { diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 0fc8bd0090..59f84a6079 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -2398,11 +2398,12 @@ class learnpath { * @param integer Item View ID * @return integer Number of interactions */ - public function get_interactions_count_from_db($lp_iv_id = 0) { + public function get_interactions_count_from_db($lp_iv_id = 0, $course_code = null) { if (empty ($lp_iv_id)) { return -1; } - $table = Database :: get_course_table(TABLE_LP_IV_INTERACTION); + $course_info = api_get_course_info($course_code); + $table = Database :: get_course_table(TABLE_LP_IV_INTERACTION, $course_info['db_name']); $sql = "SELECT count(*) FROM $table WHERE lp_iv_id = $lp_iv_id"; $res = Database::query($sql); $row = Database :: fetch_array($res); @@ -2458,11 +2459,12 @@ class learnpath { * @param integer Item View ID * @return integer Number of objectives */ - public function get_objectives_count_from_db($lp_iv_id = 0) { + public function get_objectives_count_from_db($lp_iv_id = 0, $course_code = null) { if (empty ($lp_iv_id)) { return -1; } - $table = Database :: get_course_table(TABLE_LP_IV_OBJECTIVE); + $course_info = api_get_course_info($course_code); + $table = Database :: get_course_table(TABLE_LP_IV_OBJECTIVE, $course_info['db_name']); $sql = "SELECT count(*) FROM $table WHERE lp_iv_id = $lp_iv_id"; $res = Database::query($sql); $row = Database :: fetch_array($res); diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index 8b85ddc2be..522ed5ec0d 100755 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -16,21 +16,18 @@ require_once api_get_path(LIBRARY_PATH).'tracking.lib.php'; require_once api_get_path(LIBRARY_PATH).'course.lib.php'; require_once '../exercice/exercise.lib.php'; -if (empty($_SESSION['_course']['id']) && isset($_GET['course'])) { - $course_code = Security::remove_XSS($_GET['course']); +$course_id = api_get_course_id(); +if (empty($course_id ) && isset($_GET['course'])) { + $course_code = Security::remove_XSS($_GET['course']); } else { - $course_code = $_SESSION['_course']['id']; + $course_code = $course_id; } if (isset($_GET['student_id'])) { $student_id = intval($_GET['student_id']); } -$session_id = api_get_session_id(); +$session_id = api_get_session_id(); $session_condition = api_get_session_condition($session_id); -//The two following variables have to be declared by the includer script -//$lp_id = $_SESSION['oLP']->get_id(); -//$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id); -//$user_id = $_user['user_id']; //When origin is not set that means that the lp_stats are viewed from the "man running" icon if (!isset($origin)) @@ -84,12 +81,16 @@ $output .= '  0) { foreach ($list as $my_item_id) { @@ -389,8 +390,8 @@ if (is_array($list) && count($list) > 0) { // Check if there are interactions below. $extend_attempt_link = ''; $extend_this_attempt = 0; - $inter_num = learnpath :: get_interactions_count_from_db($row['iv_id']); - $objec_num = learnpath :: get_objectives_count_from_db($row['iv_id']); + $inter_num = learnpath::get_interactions_count_from_db($row['iv_id']); + $objec_num = learnpath::get_objectives_count_from_db($row['iv_id']); if (($inter_num > 0 || $objec_num > 0) && !$extend_all) { if (!empty ($_GET['extend_attempt_id']) && $_GET['extend_attempt_id'] == $row['iv_id']) { // The extend button for this attempt has been clicked. @@ -486,9 +487,7 @@ if (is_array($list) && count($list) > 0) { } } $time_for_total = $subtotal_time; - //$subtotal_time.' - '; $time = learnpathItem :: get_scorm_time('js', $subtotal_time); - //var_dump($time ); if (empty ($title)) { $title = rl_get_resource_name(api_get_course_id(), $lp_id, $row['myid']); } @@ -696,7 +695,6 @@ if (is_array($list) && count($list) > 0) { } } } -//var_dump($a_my_id); //NOT Extend all "left green cross" if (!empty($a_my_id)) { $my_studen_id = 0; diff --git a/main/tracking/courseLog.php b/main/tracking/courseLog.php index f4d37cd764..b5f9c80d74 100755 --- a/main/tracking/courseLog.php +++ b/main/tracking/courseLog.php @@ -450,9 +450,10 @@ if ($_GET['studentlist'] == 'false') { $course_name = get_lang('Course').' '.$course_info['name']; if (api_get_session_id()) { - echo '

'.get_lang('Session').' '.api_get_session_name(api_get_session_id()).' | '.$course_name.'

'; + echo '

'.Display::return_icon('session.png', get_lang('Session'), array(), 22).' '.api_get_session_name(api_get_session_id()).' '. + Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_name.'

'; } else { - echo '

'.get_lang('Course').' '.$course_info['name'].'

'; + echo '

'.Display::return_icon('course.png', get_lang('Course'), array(), 22).' '.$course_info['name'].'

'; } $extra_field_select = TrackingCourseLog::display_additional_profile_fields();