Implementing new work student adding score/status in student view see BT#6916

1.9.x
Julio Montoya 11 years ago
parent 2b8b5de3e6
commit ed93152229
  1. 4
      main/inc/ajax/model.ajax.php
  2. 32
      main/work/work.lib.php
  3. 13
      main/work/work_list.php
  4. 9
      main/work/work_list_others.php

@ -489,10 +489,6 @@ switch ($action) {
$item['language_id'] = $language_info['english_name']; $item['language_id'] = $language_info['english_name'];
$item['actions'] = Display::url(Display::return_icon('edit.png', get_lang('Edit')), api_get_path(WEB_CODE_PATH).'admin/event_type.php?action=edit&event_type_name='.$item['event_type_name']); $item['actions'] = Display::url(Display::return_icon('edit.png', get_lang('Edit')), api_get_path(WEB_CODE_PATH).'admin/event_type.php?action=edit&event_type_name='.$item['event_type_name']);
$item['actions'] .= Display::url(Display::return_icon('delete.png', get_lang('Delete')), api_get_path(WEB_CODE_PATH).'admin/event_controller.php?action=delete&id='.$item['id']); $item['actions'] .= Display::url(Display::return_icon('delete.png', get_lang('Delete')), api_get_path(WEB_CODE_PATH).'admin/event_controller.php?action=delete&id='.$item['id']);
/*if (!$item['status']) {
$item['name'] = '<font style="color:#AAA">'.$item['subject'].'</font>';
}*/
$new_result[] = $item; $new_result[] = $item;
} }
$result = $new_result; $result = $new_result;

@ -1671,8 +1671,8 @@ function get_work_user_list_from_documents(
if ($getCount) { if ($getCount) {
$select = " SELECT count() as count "; $select = " SELECT count() as count ";
} else { } else {
$select1 = " SELECT DISTINCT u.firstname, u.lastname, u.user_id, w.title, w.document_id document_id, w.id"; $select1 = " SELECT DISTINCT u.firstname, u.lastname, u.user_id, w.title, w.document_id document_id, w.id, qualification, qualificator_id";
$select2 = " SELECT DISTINCT u.firstname, u.lastname, u.user_id, d.title, d.id document_id, 0"; $select2 = " SELECT DISTINCT u.firstname, u.lastname, u.user_id, d.title, d.id document_id, 0, 0, 0";
} }
$documentTable = Database::get_course_table(TABLE_DOCUMENT); $documentTable = Database::get_course_table(TABLE_DOCUMENT);
@ -1734,6 +1734,13 @@ function get_work_user_list_from_documents(
$currentUserId = api_get_user_id(); $currentUserId = api_get_user_id();
$work_data = get_work_data_by_id($workId);
$qualificationExists = false;
if (!empty($work_data['qualification']) && intval($work_data['qualification']) > 0) {
$qualificationExists = true;
}
if ($getCount) { if ($getCount) {
$result = Database::fetch_array($result); $result = Database::fetch_array($result);
return $result['count']; return $result['count'];
@ -1756,6 +1763,8 @@ function get_work_user_list_from_documents(
$documentId = $row['document_id']; $documentId = $row['document_id'];
$itemId = $row['id']; $itemId = $row['id'];
$addLinkShowed = false;
if (empty($documentId)) { if (empty($documentId)) {
$url = $urlEdit.'&item_id='.$row['id'].'&id='.$workId; $url = $urlEdit.'&item_id='.$row['id'].'&id='.$workId;
$editLink = Display::url($editIcon, $url); $editLink = Display::url($editIcon, $url);
@ -1767,6 +1776,7 @@ function get_work_user_list_from_documents(
if (empty($documentToWork)) { if (empty($documentToWork)) {
$url = $urlAdd.'&document_id='.$documentId.'&id='.$workId; $url = $urlAdd.'&document_id='.$documentId.'&id='.$workId;
$editLink = Display::url($addIcon, $url); $editLink = Display::url($addIcon, $url);
$addLinkShowed = true;
} else { } else {
$row['title'] = $documentToWork['title']; $row['title'] = $documentToWork['title'];
@ -1794,6 +1804,19 @@ function get_work_user_list_from_documents(
$row['type'] = build_document_icon_tag('file', $row['file']); $row['type'] = build_document_icon_tag('file', $row['file']);
if ($qualificationExists) {
if (empty($row['qualificator_id'])) {
$status = Display::label(get_lang('NotRevised'), 'warning');
} else {
$status = Display::label(get_lang('Revised'), 'success');
}
$row['qualificator_id'] = $status;
}
if (!empty($row['qualification'])) {
$row['qualification'] = Display::label($row['qualification'], 'info');
}
if (!empty($row['sent_date'])) { if (!empty($row['sent_date'])) {
$row['sent_date'] = api_get_local_time($row['sent_date']); $row['sent_date'] = api_get_local_time($row['sent_date']);
} }
@ -1802,6 +1825,11 @@ function get_work_user_list_from_documents(
$row['actions'] = $viewLink.$editLink.$deleteLink; $row['actions'] = $viewLink.$editLink.$deleteLink;
} }
if ($addLinkShowed) {
$row['qualification'] = '';
$row['qualificator_id'] = '';
}
$workList[] = $row; $workList[] = $row;
} }
} }

@ -98,7 +98,6 @@ $check_qualification = intval($my_folder_data['qualification']);
if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) {
$type = 'simple'; $type = 'simple';
$columns = array( $columns = array(
get_lang('Type'), get_lang('Type'),
get_lang('FirstName'), get_lang('FirstName'),
@ -111,14 +110,14 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification))
); );
$column_model = array ( $column_model = array (
array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'), array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'20', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'), array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'), array('name'=>'qualificator_id', 'index'=>'qualificator_id', 'width'=>'20', 'align'=>'left', 'search' => 'true'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
); );
} else { } else {
$type = 'complex'; $type = 'complex';
@ -133,7 +132,7 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification))
); );
$column_model = array ( $column_model = array (
array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),

@ -75,7 +75,14 @@ $check_qualification = intval($my_folder_data['qualification']);
if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) { if (!empty($work_data['enable_qualification']) && !empty($check_qualification)) {
$type = 'simple'; $type = 'simple';
$columns = array( $columns = array(
get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Qualification'), get_lang('Date'), get_lang('Status'), get_lang('Actions') get_lang('Type'),
get_lang('FirstName'),
get_lang('LastName'),
get_lang('Title'),
get_lang('Qualification'),
get_lang('Date'),
get_lang('Status'),
get_lang('Actions')
); );
$column_model = array( $column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false'),

Loading…
Cancel
Save