|
|
|
@ -310,24 +310,20 @@ if (isset ($_POST['action'])) { |
|
|
|
|
$filter_confirm_msg = false; |
|
|
|
|
break; |
|
|
|
|
case 'setvisible' : |
|
|
|
|
foreach ($_POST['id'] as $indexstr) |
|
|
|
|
{ |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'CATE') |
|
|
|
|
{ |
|
|
|
|
$cats= Category :: load(api_substr($indexstr, 4)); |
|
|
|
|
foreach ($_POST['id'] as $indexstr) { |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'CATE') { |
|
|
|
|
$cats = Category:: load(api_substr($indexstr, 4)); |
|
|
|
|
$cats[0]->set_visible(1); |
|
|
|
|
$cats[0]->save(); |
|
|
|
|
$cats[0]->apply_visibility_to_children(); |
|
|
|
|
} |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'EVAL') |
|
|
|
|
{ |
|
|
|
|
$eval= Evaluation :: load(api_substr($indexstr, 4)); |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'EVAL') { |
|
|
|
|
$eval = Evaluation:: load(api_substr($indexstr, 4)); |
|
|
|
|
$eval[0]->set_visible(1); |
|
|
|
|
$eval[0]->save(); |
|
|
|
|
} |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'LINK') |
|
|
|
|
{ |
|
|
|
|
$link= LinkFactory :: load(api_substr($indexstr, 4)); |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'LINK') { |
|
|
|
|
$link = LinkFactory:: load(api_substr($indexstr, 4)); |
|
|
|
|
$link[0]->set_visible(1); |
|
|
|
|
$link[0]->save(); |
|
|
|
|
} |
|
|
|
@ -336,24 +332,20 @@ if (isset ($_POST['action'])) { |
|
|
|
|
$filter_confirm_msg = false; |
|
|
|
|
break; |
|
|
|
|
case 'setinvisible' : |
|
|
|
|
foreach ($_POST['id'] as $indexstr) |
|
|
|
|
{ |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'CATE') |
|
|
|
|
{ |
|
|
|
|
$cats= Category :: load(api_substr($indexstr, 4)); |
|
|
|
|
foreach ($_POST['id'] as $indexstr) { |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'CATE') { |
|
|
|
|
$cats = Category:: load(api_substr($indexstr, 4)); |
|
|
|
|
$cats[0]->set_visible(0); |
|
|
|
|
$cats[0]->save(); |
|
|
|
|
$cats[0]->apply_visibility_to_children(); |
|
|
|
|
} |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'EVAL') |
|
|
|
|
{ |
|
|
|
|
$eval= Evaluation :: load(api_substr($indexstr, 4)); |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'EVAL') { |
|
|
|
|
$eval = Evaluation:: load(api_substr($indexstr, 4)); |
|
|
|
|
$eval[0]->set_visible(0); |
|
|
|
|
$eval[0]->save(); |
|
|
|
|
} |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'LINK') |
|
|
|
|
{ |
|
|
|
|
$link= LinkFactory :: load(api_substr($indexstr, 4)); |
|
|
|
|
if (api_substr($indexstr, 0, 4) == 'LINK') { |
|
|
|
|
$link = LinkFactory:: load(api_substr($indexstr, 4)); |
|
|
|
|
$link[0]->set_visible(0); |
|
|
|
|
$link[0]->save(); |
|
|
|
|
} |
|
|
|
@ -446,6 +438,7 @@ if (isset ($move_form)) { |
|
|
|
|
// LOAD DATA & DISPLAY TABLE - |
|
|
|
|
$is_platform_admin= api_is_platform_admin(); |
|
|
|
|
$is_course_admin= api_is_allowed_to_edit(); |
|
|
|
|
|
|
|
|
|
//load data for category, evaluation and links |
|
|
|
|
if (!isset ($_GET['selectcat']) || empty ($_GET['selectcat'])) { |
|
|
|
|
$category= 0; |
|
|
|
@ -454,7 +447,13 @@ if (!isset ($_GET['selectcat']) || empty ($_GET['selectcat'])) { |
|
|
|
|
} |
|
|
|
|
// search form |
|
|
|
|
|
|
|
|
|
$simple_search_form= new UserForm(UserForm :: TYPE_SIMPLE_SEARCH, null, 'simple_search_form', null, api_get_self() . '?selectcat=' . $selectcat); |
|
|
|
|
$simple_search_form = new UserForm( |
|
|
|
|
UserForm :: TYPE_SIMPLE_SEARCH, |
|
|
|
|
null, |
|
|
|
|
'simple_search_form', |
|
|
|
|
null, |
|
|
|
|
api_get_self().'?selectcat='.$selectcat |
|
|
|
|
); |
|
|
|
|
$values= $simple_search_form->exportValues(); |
|
|
|
|
$keyword = ''; |
|
|
|
|
if (isset($_GET['search']) && !empty($_GET['search'])) { |
|
|
|
@ -463,8 +462,8 @@ if (isset($_GET['search']) && !empty($_GET['search'])) { |
|
|
|
|
if ($simple_search_form->validate() && (empty($keyword))) { |
|
|
|
|
$keyword = $values['keyword']; |
|
|
|
|
} |
|
|
|
|
if (!empty($keyword)) { |
|
|
|
|
|
|
|
|
|
if (!empty($keyword)) { |
|
|
|
|
$cats= Category :: load($category); |
|
|
|
|
$allcat= array (); |
|
|
|
|
if ((isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search'])) { |
|
|
|
@ -486,7 +485,13 @@ if (!empty($keyword)) { |
|
|
|
|
$alllink= $cats[0]->get_links($stud_id, true); |
|
|
|
|
if (isset ($_GET['exportpdf'])) { |
|
|
|
|
$datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink); |
|
|
|
|
$header_names = array(get_lang('Name'),get_lang('Description'),get_lang('Weight'),get_lang('Date'),get_lang('Results')); |
|
|
|
|
$header_names = array( |
|
|
|
|
get_lang('Name'), |
|
|
|
|
get_lang('Description'), |
|
|
|
|
get_lang('Weight'), |
|
|
|
|
get_lang('Date'), |
|
|
|
|
get_lang('Results'), |
|
|
|
|
); |
|
|
|
|
$data_array = $datagen->get_data(GradebookDataGenerator :: GDG_SORT_NAME,0,null,true); |
|
|
|
|
$newarray = array(); |
|
|
|
|
foreach ($data_array as $data) { |
|
|
|
@ -500,7 +505,18 @@ if (!empty($keyword)) { |
|
|
|
|
$pdf->line(50,790,550,790); |
|
|
|
|
$pdf->line(50,40,550,40); |
|
|
|
|
$pdf->ezSetY(750); |
|
|
|
|
$pdf->ezTable($newarray,$header_names,'',array('showHeadings'=>1,'shaded'=>1,'showLines'=>1,'rowGap'=>3,'width'=> 500)); |
|
|
|
|
$pdf->ezTable( |
|
|
|
|
$newarray, |
|
|
|
|
$header_names, |
|
|
|
|
'', |
|
|
|
|
array( |
|
|
|
|
'showHeadings' => 1, |
|
|
|
|
'shaded' => 1, |
|
|
|
|
'showLines' => 1, |
|
|
|
|
'rowGap' => 3, |
|
|
|
|
'width' => 500, |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
$pdf->ezStream(); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
@ -565,7 +581,7 @@ if (isset($_GET['search'])) { |
|
|
|
|
if (isset ($_GET['studentoverview'])) { |
|
|
|
|
$addparams['studentoverview'] = ''; |
|
|
|
|
} |
|
|
|
|
if (count($allcat_info)>=0 && (isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search']) && strlen(trim($_GET['search']))>0 ) { |
|
|
|
|
if (isset($allcat_info) && count($allcat_info)>=0 && (isset($_GET['selectcat']) && $_GET['selectcat']==0) && isset($_GET['search']) && strlen(trim($_GET['search']))>0 ) { |
|
|
|
|
$allcat=$allcat_info; |
|
|
|
|
} else { |
|
|
|
|
$allcat=$allcat; |
|
|
|
|