Skip to content

Commit

Permalink
Allow export certificates for student boss - refs BT#9442
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Apr 14, 2015
1 parent 622137f commit 3157090
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main/gradebook/gradebook_display_certificate.php
Expand Up @@ -8,7 +8,9 @@
require_once '../inc/global.inc.php';
$current_course_tool = TOOL_GRADEBOOK;

api_protect_course_script();
if (!api_is_student_boss()) {
api_protect_course_script();
}

set_time_limit(0);
ini_set('max_execution_time', 0);
Expand All @@ -25,7 +27,7 @@ function confirmation() {
</script>";
api_block_anonymous_users();

if (!api_is_allowed_to_edit()) {
if (!api_is_allowed_to_edit() && !api_is_student_boss()) {
api_not_allowed(true);
}

Expand All @@ -36,10 +38,15 @@ function confirmation() {

switch ($action) {
case 'export_all_certificates':
if (api_is_student_boss()) {
$userList = GroupPortalManager::getGroupUsersByUser(api_get_user_id());
} else {
$userList = array();
if (!empty($filterOfficialCodeGet)) {
$userList = UserManager::getUsersByOfficialCode($filterOfficialCodeGet);
}
}

Category::exportAllCertificates($cat_id, $userList);
break;
case 'generate_all_certificates':
Expand Down
9 changes: 9 additions & 0 deletions main/mySpace/company_reports.php
Expand Up @@ -110,6 +110,15 @@
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
"#"
);
$actions .= Display::url(
Display::return_icon(
"certificate_list.png",
get_lang("GradebookSeeListOfStudentsCertificates"),
[],
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
);
}

$content = '<div class="actions">';
Expand Down
9 changes: 9 additions & 0 deletions main/mySpace/company_reports_resumed.php
Expand Up @@ -99,6 +99,15 @@
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"
);
$actions .= Display::url(
Display::return_icon(
"certificate_list.png",
get_lang("GradebookSeeListOfStudentsCertificates"),
[],
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
);
}

$content = '<div class="actions">';
Expand Down
9 changes: 9 additions & 0 deletions main/mySpace/student.php
Expand Up @@ -211,6 +211,15 @@ function get_users($from, $limit, $column, $direction)
Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"
);
$actions .= Display::url(
Display::return_icon(
"certificate_list.png",
get_lang("GradebookSeeListOfStudentsCertificates"),
[],
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
);
}

$actions .= '<span style="float:right">';
Expand Down

0 comments on commit 3157090

Please sign in to comment.