Minor - removing comments adding the view document for teachers.

1.9.x
Julio Montoya 12 years ago
parent 75a9b7c301
commit 2b19b46dfb
  1. 2
      main/inc/ajax/model.ajax.php
  2. 17
      main/work/student_work.php
  3. 6
      main/work/work.lib.php
  4. 26
      main/work/work.php
  5. 25
      main/work/work_list_others.php

@ -328,10 +328,8 @@ switch ($action) {
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');
$columns = array('type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions');
} else {
//$columns = array('type', 'firstname', 'lastname', 'username', 'title', 'sent_date', 'actions');
$columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
}
$where_condition .= " AND u.user_id <> ".api_get_user_id();

@ -8,15 +8,11 @@ $language_file = array('exercice', 'work', 'document', 'admin', 'gradebook');
require_once '../inc/global.inc.php';
$current_course_tool = TOOL_STUDENTPUBLICATION;
/* Configuration settings */
api_protect_course_script(true);
// Including necessary files
require_once 'work.lib.php';
$this_section = SECTION_COURSES;
//$workId = isset($_GET['id']) ? intval($_GET['id']) : null;
$studentId = isset($_GET['studentId']) ? intval($_GET['studentId']) : null;
if (empty($studentId)) {
@ -27,11 +23,14 @@ $tool_name = get_lang('StudentPublications');
$group_id = api_get_group_id();
$userInfo = api_get_user_info($studentId);
$courseInfo = api_get_course_info();
if (empty($userInfo)) {
if (empty($userInfo) || empty($courseInfo)) {
api_not_allowed(true);
}
// Only a teachers page.
if (!empty($group_id)) {
$group_properties = GroupManager :: get_group_properties($group_id);
$show_work = false;
@ -89,11 +88,9 @@ foreach ($workPerUser as $work) {
$column++;
$table->setCellContents($row, $column, $userResult['sent_date']);
$column++;
//$dateQualification = !empty($workExtraData['expires_on']) && $workExtraData['expires_on'] != '0000-00-00 00:00:00' ? api_get_utc_datetime($workExtraData['expires_on']) : '-';
$dateQualification = !empty($workExtraData['expires_on']) && $workExtraData['expires_on'] != '0000-00-00 00:00:00' ? api_get_local_time($workExtraData['expires_on']) : '-';
$table->setCellContents($row, $column, $dateQualification);
$column++;
//var_dump($userResult);
$score = '-';
if (!empty($scoreWeight)) {
$score = strip_tags($userResult['qualification'])."/".$scoreWeight;
@ -104,16 +101,14 @@ foreach ($workPerUser as $work) {
// Actions
$links = null;
if (empty($userResult['url'])) {
// is a text
$url = api_get_path(WEB_CODE_PATH).'work/view.php?'.api_get_cidreq().'&id='.$userResult['id'];
$links .= Display::url(Display::return_icon('default.png'), $url);
} else {
if (!empty($userResult['url'])) {
$url = api_get_path(WEB_CODE_PATH).'work/download.php?'.api_get_cidreq().'&id='.$userResult['id'];
$links .= Display::url(Display::return_icon('save.png'), $url);
$links .= Display::url(Display::return_icon('save.png', get_lang('Download')), $url);
}
$url = api_get_path(WEB_CODE_PATH).'work/edit.php?'.api_get_cidreq().'&item_id='.$userResult['id'].'&id='.$workId.'&parent_id='.$workId;
$links .= Display::url(Display::return_icon('edit.png', get_lang('Comment')), $url);

@ -467,9 +467,6 @@ function display_student_publications_list($id, $my_folder_data, $work_parents,
$my_params = $sort_params;
$origin = Security::remove_XSS($origin);
// Getting the work data
//$my_folder_data = get_work_data_by_id($id);
$qualification_exists = false;
if (!empty($my_folder_data['qualification']) && intval($my_folder_data['qualification']) > 0) {
$qualification_exists = true;
@ -511,7 +508,6 @@ function display_student_publications_list($id, $my_folder_data, $work_parents,
$group_id = api_get_group_id();
if (is_array($work_parents)) {
foreach ($work_parents as $work_parent) {
$sql_select_directory = "SELECT
@ -863,11 +859,9 @@ function display_student_publications_list($id, $my_folder_data, $work_parents,
$work_title = !empty($work_data['title']) ? $work_data['title'] : basename($work_data['url']);
// Work name
//if (api_is_allowed_to_edit()) {
if ($cant_files > 0 ) {
$zip = '<a href="downloadfolder.inc.php?id='.$work_data['id'].'">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>';
}
//}
$link = 'work_list.php';
if (api_is_allowed_to_edit()) {

@ -508,17 +508,10 @@ switch ($action) {
if ($path = get_work_path($item_id)) {
if (move($course_dir.'/'.$path, $base_work_dir . $move_to_path)) {
//update db
// Update db
update_work_url($item_id, 'work' . $move_to_path, $_REQUEST['move_to_id']);
api_item_property_update($_course, 'work', $_REQUEST['move_to_id'], 'FolderUpdated', $user_id);
/*
// update all the parents in the table item propery
$list_id = get_parent_directories($move_to_path);
for ($i = 0; $i < count($list_id); $i++) {
api_item_property_update($_course, 'work', $list_id[$i], 'FolderUpdated', $user_id);
}*/
Display :: display_confirmation_message(get_lang('DirMv'));
} else {
Display :: display_error_message(get_lang('Impossible'));
@ -548,13 +541,6 @@ switch ($action) {
if ($is_allowed_to_edit && $action == 'make_visible') {
if (!empty($item_id)) {
if (isset($item_id) && $item_id == 'all') {
//never happens
/*
$sql = "ALTER TABLE " . $work_table . " CHANGE accepted accepted TINYINT(1) DEFAULT '1'";
Database::query($sql);
$sql = "UPDATE " . $work_table . " SET accepted = 1";
Database::query($sql);
Display::display_confirmation_message(get_lang('AllFilesVisible'));*/
} else {
$sql = "UPDATE " . $work_table . " SET accepted = 1 WHERE c_id = $course_id AND id = '" . $item_id . "'";
Database::query($sql);
@ -569,13 +555,6 @@ switch ($action) {
/* MAKE INVISIBLE WORK COMMAND */
if (!empty($item_id)) {
if (isset($item_id) && $item_id == 'all') {
/*
$sql = "ALTER TABLE " . $work_table . "
CHANGE accepted accepted TINYINT(1) DEFAULT '0'";
Database::query($sql);
$sql = "UPDATE " . $work_table . " SET accepted = 0";
Database::query($sql);
Display::display_confirmation_message(get_lang('AllFilesInvisible'));*/
} else {
$sql = "UPDATE " . $work_table . " SET accepted = 0
WHERE c_id = $course_id AND id = '" . $item_id . "'";
@ -740,11 +719,8 @@ switch ($action) {
echo $table->toHtml();
echo '</div>';
} else {
display_student_publications_list($work_id, $my_folder_data, $work_parents, $origin, $add_query, null);
}
break;
}
if ($origin != 'learnpath') {

@ -8,11 +8,8 @@ $language_file = array('exercice', 'work', 'document', 'admin', 'gradebook');
require_once '../inc/global.inc.php';
$current_course_tool = TOOL_STUDENTPUBLICATION;
/* Configuration settings */
api_protect_course_script(true);
// Including necessary files
require_once 'work.lib.php';
$this_section = SECTION_COURSES;
@ -64,7 +61,6 @@ if (!empty($group_id)) {
$interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), 'name' => get_lang('StudentPublications'));
$interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'work/work_list_others.php?'.api_get_cidreq().'&id='.$workId, 'name' => $my_folder_data['title']);
Display :: display_header(null);
echo '<div class="actions">';
@ -80,15 +76,14 @@ $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'));
$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'));
$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')
);
$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', 'wrap_cell' => 'true'),
array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
@ -96,30 +91,22 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification))
);
} 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'));
$columns = array(get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Date'), get_lang('Actions'));
$columns = array(
get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), 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', 'wrap_cell' => '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;
?>

Loading…
Cancel
Save