Modify company reports for student boss role - refs BT#9441

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent bc44892da1
commit ea6e20a6e1
  1. 4
      main/inc/ajax/model.ajax.php
  2. 44
      main/mySpace/company_reports.php
  3. 46
      main/mySpace/company_reports_resumed.php
  4. 4
      main/mySpace/student.php

@ -186,6 +186,10 @@ switch ($action) {
if (empty($userIdList) || empty($courseCodeList)) { if (empty($userIdList) || empty($courseCodeList)) {
exit; exit;
} }
} else if(api_is_student_boss()) {
$users = UserManager::getUsersFollowedByStudentBoss(api_get_user_id());
$userIdList = array_keys($users);
} }
if ($action == 'get_user_course_report') { if ($action == 'get_user_course_report') {
$count = CourseManager::get_count_user_list_from_course_code(false, null, $courseCodeList, $userIdList); $count = CourseManager::get_count_user_list_from_course_code(false, null, $courseCodeList, $userIdList);

@ -12,8 +12,10 @@ $language_file = array('admin', 'gradebook', 'tracking');
$cidReset = true; $cidReset = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
if (!(api_is_platform_admin(false, true))) { $userNotAllowed = !api_is_student_boss() && !api_is_platform_admin(false, true);
api_not_allowed();
if ($userNotAllowed) {
api_not_allowed(true);
} }
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('MySpace')); $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('MySpace'));
@ -88,7 +90,43 @@ $(function() {
}); });
}); });
</script>'; </script>';
$content = Display::grid_html('user_course_report');
$actions = null;
if (api_is_student_boss()) {
$actions .= Display::url(
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
);
$actions .= Display::url(
Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/student.php"
);
$actions .= Display::url(
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
"#"
);
}
$content = '<div class="actions">';
if (!empty($actions)) {
$content .= $actions;
}
$content .= '<div class="pull-right">';
$content .= Display::url(
get_lang("CompanyReportResumed"),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports_resumed.php",
array(
'class' => 'btn btn-info'
)
);
$content .= '</div>';
$content .= '</div>';
$content .= '<h1 class="page-header">' . get_lang('CompanyReport') . '</h1>';
$content .= Display::grid_html('user_course_report');
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$tpl->assign('content', $content); $tpl->assign('content', $content);

@ -12,8 +12,10 @@ $cidReset = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
if (!(api_is_platform_admin(false, true))) { $userNotAllowed = !api_is_student_boss() && !api_is_platform_admin(false, true);
api_not_allowed();
if ($userNotAllowed) {
api_not_allowed(true);
} }
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('MySpace')); $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('MySpace'));
@ -83,7 +85,45 @@ $(function() {
}); });
}); });
</script>'; </script>';
$content = Display::grid_html('user_course_report');
$actions = null;
if (api_is_student_boss()) {
$actions .= Display::url(
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
);
$actions .= Display::url(
Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/student.php"
);
$actions .= Display::url(
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"
);
}
$content = '<div class="actions">';
if (!empty($actions)) {
$content .= $actions;
}
if (!api_is_student_boss()) {
$content .= '<div class="pull-right">';
$content .= Display::url(
get_lang("CompanyReport"),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php",
array(
'class' => 'btn btn-info'
)
);
$content .= '</div>';
}
$content .= '</div>';
$content .= '<h1 class="page-header">' . get_lang('CompanyReportResumed') . '</h1>';
$content .= Display::grid_html('user_course_report');
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$tpl->assign('content', $content); $tpl->assign('content', $content);

@ -212,6 +212,10 @@ if (api_is_drh()) {
Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
'#' '#'
); );
$actions .= Display::url(
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"
);
} }
$actions .= '<span style="float:right">'; $actions .= '<span style="float:right">';

Loading…
Cancel
Save