From 583588b4e5e17404b366c10d5282f1a466c48634 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 15 Aug 2013 13:01:37 +0200 Subject: [PATCH] Adding new work UI view see BT#6418 --- main/inc/ajax/model.ajax.php | 109 ++++++++++++++++++++++----------- main/work/student_work.php | 1 - main/work/work.lib.php | 71 +++++++++++++++------ main/work/work.php | 59 +----------------- main/work/work_list.php | 103 +++++++++++++++++++++++++++++++ main/work/work_list_all.php | 105 +++++++++++++++++++++++++++++++ main/work/work_list_others.php | 107 ++++++++++++++++++++++++++++++++ 7 files changed, 442 insertions(+), 113 deletions(-) create mode 100644 main/work/work_list.php create mode 100644 main/work/work_list_all.php create mode 100644 main/work/work_list_others.php diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index 3536b9101d..b819275318 100644 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -31,15 +31,20 @@ if (!in_array($sord, array('asc','desc'))) { $sord = 'desc'; } -if (!in_array($action, array( +if (!in_array( + $action, + array( 'get_exercise_results', 'get_hotpotatoes_exercise_results', 'get_work_user_list', + 'get_work_user_list_others', + 'get_work_user_list_all', 'get_timelines', 'get_user_skill_ranking', - 'get_usergroups_teacher')) - ) { - api_protect_admin_script(true); + 'get_usergroups_teacher' + ) +)) { + api_protect_admin_script(true); } //Search features @@ -63,7 +68,8 @@ $ops = array ( //@todo move this in the display_class or somewhere else -function get_where_clause($col, $oper, $val) { +function get_where_clause($col, $oper, $val) +{ global $ops; if (empty($col)){ return ''; @@ -126,17 +132,27 @@ switch ($action) { $course_id = api_get_course_int_id(); $count = Question::get_count_course_medias($course_id); break; - case 'get_user_skill_ranking': - $skill = new Skill(); - $count = $skill->get_user_list_skill_ranking_count(); - break; - case 'get_work_user_list': + case 'get_user_skill_ranking': + $skill = new Skill(); + $count = $skill->get_user_list_skill_ranking_count(); + break; + case 'get_work_user_list_all': require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php'; $work_id = $_REQUEST['work_id']; $count = get_count_work($work_id); break; - case 'get_exercise_results': - require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php'; + case 'get_work_user_list_others': + require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php'; + $work_id = $_REQUEST['work_id']; + $count = get_count_work($work_id, api_get_user_id()); + break; + case 'get_work_user_list': + require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php'; + $work_id = $_REQUEST['work_id']; + $count = get_count_work($work_id, null, api_get_user_id()); + break; + case 'get_exercise_results': + require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php'; $exercise_id = $_REQUEST['exerciseId']; if (isset($_GET['filter_by_user']) && !empty($_GET['filter_by_user'])) { @@ -147,13 +163,13 @@ switch ($action) { $where_condition .= " AND te.exe_user_id = '$filter_user'"; } } - $count = get_count_exam_results($exercise_id, $where_condition); - break; - case 'get_hotpotatoes_exercise_results': - require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php'; + $count = get_count_exam_results($exercise_id, $where_condition); + break; + case 'get_hotpotatoes_exercise_results': + require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php'; $hotpot_path = $_REQUEST['path']; - $count = get_count_exam_hotpotatoes_results($hotpot_path); - break; + $count = get_count_exam_hotpotatoes_results($hotpot_path); + break; case 'get_sessions': $count = SessionManager::get_count_admin(); break; @@ -294,12 +310,30 @@ switch ($action) { } } break; + case 'get_work_user_list_all': + if (isset($_GET['type']) && $_GET['type'] == 'simple') { + $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'); + } else { + $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'sent_date', 'actions'); + } + $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $where_condition); + break; + case 'get_work_user_list_others': + if (isset($_GET['type']) && $_GET['type'] == 'simple') { + $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'); + } else { + $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'sent_date', 'actions'); + } + $where_condition .= " AND u.user_id <> ".api_get_user_id(); + $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $where_condition); + break; case 'get_work_user_list': if (isset($_GET['type']) && $_GET['type'] == 'simple') { $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'); } else { $columns = array('type', 'firstname', 'lastname', 'username', 'title', 'sent_date', 'actions'); } + $where_condition .= " AND u.user_id = ".api_get_user_id(); $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $where_condition); break; case 'get_exercise_results': @@ -540,24 +574,27 @@ switch ($action) { exit; } -$allowed_actions = array('get_careers', - 'get_promotions', - 'get_usergroups', - 'get_usergroups_teacher', - 'get_gradebooks', - 'get_sessions', - 'get_exercise_results', - 'get_hotpotatoes_exercise_results', - 'get_work_user_list', - 'get_timelines', - 'get_grade_models', - 'get_event_email_template', - 'get_user_skill_ranking', - //'get_extra_fields', - //'get_extra_field_options', - //'get_course_exercise_medias', - 'get_user_course_report', - 'get_user_course_report_resumed' +$allowed_actions = array( + 'get_careers', + 'get_promotions', + 'get_usergroups', + 'get_usergroups_teacher', + 'get_gradebooks', + 'get_sessions', + 'get_exercise_results', + 'get_hotpotatoes_exercise_results', + 'get_work_user_list', + 'get_work_user_list_others', + 'get_work_user_list_all', + 'get_timelines', + 'get_grade_models', + 'get_event_email_template', + 'get_user_skill_ranking', + //'get_extra_fields', + //'get_extra_field_options', + //'get_course_exercise_medias', + 'get_user_course_report', + 'get_user_course_report_resumed' ); //5. Creating an obj to return a json diff --git a/main/work/student_work.php b/main/work/student_work.php index 6818a4ba4e..70c55abe9e 100644 --- a/main/work/student_work.php +++ b/main/work/student_work.php @@ -116,4 +116,3 @@ foreach ($workPerUser as $work) { echo $table->toHtml(); Display :: display_footer(); - diff --git a/main/work/work.lib.php b/main/work/work.lib.php index cb95397e50..dce48a898e 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -454,7 +454,6 @@ function display_student_publications_list($id, $my_folder_data, $work_parents, $qualification_exists = true; } - $edit_dir = isset($_GET['edit_dir']) ? $_GET['edit_dir'] : ''; $table_header = array(); @@ -467,22 +466,23 @@ function display_student_publications_list($id, $my_folder_data, $work_parents, $table_header[] = array(get_lang('LastName'), true); } - //$table_header[] = array(get_lang('Date'), true, 'style="width:200px"'); $table_header[] = array(get_lang('HandOutDateLimit'), true, 'style="width:200px"'); if ($is_allowed_to_edit) { $table_header[] = array(get_lang('HandedOut'), false); $table_header[] = array(get_lang('Actions'), false, 'style="width:90px"', array('class'=>'td_actions')); $table_has_actions_column = true; - } else { - //$table_header[] = array(get_lang('HandedOutDate'), false); - } - - if ($qualification_exists) { - $table_header[] = array(get_lang('Qualification'), true); - } + if ($qualification_exists) { + $table_header[] = array(get_lang('Qualification'), true); + } + } else { + // All users + if ($course_info['show_score'] == 0) { + $table_header[] = array(get_lang('Others'), false); + } + } $table_data = array(); @@ -802,14 +802,18 @@ function display_student_publications_list($id, $my_folder_data, $work_parents, $session_id = api_get_session_id(); if (api_is_allowed_to_edit()) { - $sql_document = "SELECT count(*) + $cant_files = get_count_work($work_data['id']); + /*$sql_document = "SELECT count(*) FROM $work_table w INNER JOIN $user_table u ON w.user_id = u.user_id - WHERE w.c_id = $course_id AND w.parent_id = ".$work_data['id']." AND w.active IN (0, 1)"; + WHERE w.c_id = $course_id AND w.parent_id = ".$work_data['id']." AND w.active IN (0, 1)";*/ } else { + $cant_files = get_count_work($work_data['id'], api_get_user_id()); + /* $user_filter = "user_id = ".api_get_user_id()." AND "; if ($course_info['show_score'] == 0) { $user_filter = null; } + $sql_document = "SELECT count(*) FROM $work_table s, $iprop_table p WHERE s.c_id = $course_id AND p.c_id = $course_id AND @@ -819,15 +823,14 @@ function display_student_publications_list($id, $my_folder_data, $work_parents, $user_filter parent_id = ".$work_data['id']." AND active = 1 AND - parent_id = ".$work_parent->id.""; + parent_id = ".$work_parent->id."";*/ } //count documents - $res_document = Database::query($sql_document); + /*$res_document = Database::query($sql_document); $count_document = Database::fetch_row($res_document); - $cant_files = $count_document[0]; + $cant_files = $count_document[0];*/ - $cant_files_per_user = getUniqueStudentAttempts($work_data['id'], $course_id); $text_file = get_lang('FilesUpload'); @@ -866,7 +869,13 @@ function display_student_publications_list($id, $my_folder_data, $work_parents, $zip = ''.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).''; } //} - $url = $zip.''. + + $link = 'work_list.php'; + if (api_is_allowed_to_edit()) { + $link = 'work_list_all.php'; + } + + $url = $zip.''. $work_title.' '.$add_to_name.'
'.$cant_files.' '.$text_file.$dirtext; $row[] = $url; } @@ -895,9 +904,18 @@ function display_student_publications_list($id, $my_folder_data, $work_parents, $row[] = '-'; } + if (!$is_allowed_to_edit) { + if ($course_info['show_score'] == 0) { + $url = api_get_path(WEB_CODE_PATH).'work/work_list_others.php?'.api_get_cidreq().'&id='.$work_parent->id; + $row[] = Display::url(Display::return_icon('group.png', get_lang('Others')), $url); + } + } if ($origin != 'learnpath') { if ($is_allowed_to_edit) { + + $cant_files_per_user = getUniqueStudentAttempts($work_data['id'], $course_id); + $row[] = $cant_files_per_user.'/'.$countUsers; if (api_resource_is_locked_by_gradebook($id2, LINK_STUDENTPUBLICATION)) { $action .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL); @@ -1575,7 +1593,14 @@ function get_work_id($path) { } } -function get_count_work($work_id) { +/** + * @param int $work_id + * @param int $onlyMeUserId show only my works + * @param int $notMeUserId show works from everyone except me + * @return int + */ +function get_count_work($work_id, $onlyMeUserId = null, $notMeUserId = null) +{ $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); $iprop_table = Database::get_course_table(TABLE_ITEM_PROPERTY); $user_table = Database::get_main_table(TABLE_MAIN_USER); @@ -1609,6 +1634,17 @@ function get_count_work($work_id) { $extra_conditions .= " AND parent_id = ".$work_id." "; + $where_condition = null; + + if (!empty($notMeUserId)) { + $where_condition .= " AND u.user_id <> ".intval($notMeUserId); + } + + if (!empty($onlyMeUserId)) { + $where_condition .= " AND u.user_id = ".intval($onlyMeUserId); + } + + $sql = "SELECT count(*) as count ". " FROM ".$iprop_table." prop INNER JOIN ".$work_table." work ". " ON (prop.ref=work.id AND prop.c_id = $course_id ". @@ -1690,7 +1726,6 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher FROM $work_condition $user_condition $course_conditions WHERE $extra_conditions $where_condition $condition_session "; - $sql .= " ORDER BY $column $direction "; $sql .= " LIMIT $start, $limit"; diff --git a/main/work/work.php b/main/work/work.php index 53e753f10d..6f79b68daf 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -239,7 +239,6 @@ if (!empty($group_id)) { } } - //stats event_access_tool(TOOL_STUDENTPUBLICATION); @@ -1113,63 +1112,7 @@ switch ($action) { //User works if (isset($work_id) && !empty($work_id) && !$display_list_users_without_publication) { - $work_data = get_work_assignment_by_id($work_id); - $check_qualification = intval($my_folder_data['qualification']); - - if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { - $type = 'simple'; - $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); - $column_model = array ( - array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), - array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), - array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), - array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), - array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), - // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), - array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), - array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), - array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), - array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') - ); - } else { - $type = 'complex'; - $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')); - $column_model = array ( - array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), - array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), - array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), - array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), - array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), - // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), - //array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), - array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), - //array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), - array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') - ); - } - $extra_params = array(); - - //Autowidth - $extra_params['autowidth'] = 'true'; - - //height auto - $extra_params['height'] = 'auto'; - //$extra_params['excel'] = 'excel'; - - //$extra_params['rowList'] = array(10, 20 ,30); - - $extra_params['sortname'] = 'firstname'; - $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list&work_id='.$work_id.'&type='.$type; - ?> - - '; +echo ''.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).''; +echo ''; + +// User works +$work_data = get_work_assignment_by_id($workId); +$check_qualification = intval($my_folder_data['qualification']); + +if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { + $type = 'simple'; + $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); + $column_model = array ( + array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), + // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), + array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') + ); +} else { + $type = 'complex'; + $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')); + $column_model = array ( + array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), + // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), + //array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + //array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') + ); +} + +$extra_params = array(); + +//Autowidth +$extra_params['autowidth'] = 'true'; + +//height auto +$extra_params['height'] = 'auto'; +//$extra_params['excel'] = 'excel'; + +//$extra_params['rowList'] = array(10, 20 ,30); + +$extra_params['sortname'] = 'firstname'; +$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list&work_id='.$workId.'&type='.$type; +?> + +'; +echo ''.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).''; +echo ''; + +// User works +$work_data = get_work_assignment_by_id($workId); +$check_qualification = intval($my_folder_data['qualification']); + +if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { + $type = 'simple'; + $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); + $column_model = array ( + array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), + // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), + array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') + ); +} else { + $type = 'complex'; + $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')); + $column_model = array ( + array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), + // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), + //array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + //array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') + ); +} + +$extra_params = array(); + +//Autowidth +$extra_params['autowidth'] = 'true'; + +//height auto +$extra_params['height'] = 'auto'; +//$extra_params['excel'] = 'excel'; + +//$extra_params['rowList'] = array(10, 20 ,30); + +$extra_params['sortname'] = 'firstname'; +$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list_all&work_id='.$workId.'&type='.$type; +?> + +'; +echo ''.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).''; +echo ''; + + +if (!empty($my_folder_data['description'])) { + echo '

'.get_lang('Description').':

'.Security::remove_XSS($my_folder_data['description'], STUDENT).'

'; +} + +// User works +$work_data = get_work_assignment_by_id($workId); +$check_qualification = intval($my_folder_data['qualification']); + +if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { + $type = 'simple'; + $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions')); + $column_model = array ( + array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), + // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), + array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') + ); +} else { + $type = 'complex'; + $columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('LoginName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')); + $column_model = array ( + array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), + array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), + array('name'=>'username', 'index'=>'username', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), + // array('name'=>'file', 'index'=>'file', 'width'=>'20', 'align'=>'left', 'search' => 'false'), + //array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true'), + //array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), + array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') + ); +} + +$extra_params = array(); + +//Autowidth +$extra_params['autowidth'] = 'true'; + +//height auto +$extra_params['height'] = 'auto'; + +$extra_params['sortname'] = 'firstname'; +$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list_others&work_id='.$workId.'&type='.$type; +?> + +