Fixing view icon see BT#6418

1.9.x
Julio Montoya 12 years ago
parent 4664c4f9f6
commit d6c136fc54
  1. 6
      main/work/view.php
  2. 25
      main/work/work.lib.php
  3. 4
      main/work/work_list.php

@ -23,7 +23,11 @@ $course_info = api_get_course_info();
allowOnlySubscribedUser(api_get_user_id(), $work['parent_id'], $course_info['real_id']); allowOnlySubscribedUser(api_get_user_id(), $work['parent_id'], $course_info['real_id']);
if (user_is_author($id) || $course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) { if (user_is_author($id) || $course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) {
$url_dir = 'work.php?&id=' . $my_folder_data['id']; if (api_is_allowed_to_edit(null, true)) {
$url_dir = 'work_list_all.php?id='.$my_folder_data['id'];
} else {
$url_dir = 'work_list.php?id='.$my_folder_data['id'];
}
$interbreadcrumb[] = array ('url' => $url_dir, 'name' => $my_folder_data['title']); $interbreadcrumb[] = array ('url' => $url_dir, 'name' => $my_folder_data['title']);
$interbreadcrumb[] = array ('url' => '#','name' => $work['title']); $interbreadcrumb[] = array ('url' => '#','name' => $work['title']);

@ -1635,6 +1635,16 @@ function get_count_work($work_id, $onlyMeUserId = null, $notMeUserId = null)
return $users_with_work; return $users_with_work;
} }
/**
* @param int $start
* @param int $limit
* @param int $column
* @param string $direction
* @param int $work_id
* @param array $where_condition
* @param int $studentId
* @return array
*/
function get_work_user_list($start, $limit, $column, $direction, $work_id, $where_condition, $studentId = null) function get_work_user_list($start, $limit, $column, $direction, $work_id, $where_condition, $studentId = null)
{ {
$work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
@ -1760,7 +1770,6 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher
// Firstname, lastname, username // Firstname, lastname, username
$work['firstname'] = Display::div($work['firstname'], array('class' => $class)); $work['firstname'] = Display::div($work['firstname'], array('class' => $class));
$work['lastname'] = Display::div($work['lastname'], array('class' => $class)); $work['lastname'] = Display::div($work['lastname'], array('class' => $class));
//$work['username'] = Display::div($work['username'], array('class' => $class));
if (strlen($work['title']) > 30) { if (strlen($work['title']) > 30) {
$short_title = substr($work['title'], 0, 27).'...'; $short_title = substr($work['title'], 0, 27).'...';
@ -1778,8 +1787,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher
if ($work['contains_file']) { if ($work['contains_file']) {
$link_to_download = '<a href="download.php?id='.$item_id.'">'.Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> '; $link_to_download = '<a href="download.php?id='.$item_id.'">'.Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> ';
} else { } else {
//api_get_cidreq() //$link_to_download = '<a href="view.php?id='.$item_id.'">'.Display::return_icon('save_na.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> ';
//$link_to_download = '<a href="view.php?id='.$item_id.'">'.Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a> ';
} }
$send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;')); $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;'));
@ -1794,6 +1802,11 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher
$url = api_get_path(WEB_CODE_PATH).'work/'; $url = api_get_path(WEB_CODE_PATH).'work/';
$action = ''; $action = '';
if ($is_allowed_to_edit) { if ($is_allowed_to_edit) {
$action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a> ';
if ($locked) { if ($locked) {
if ($qualification_exists) { if ($qualification_exists) {
$action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL); $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL);
@ -1809,6 +1822,8 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher
Display::return_icon('edit.png', get_lang('Comment'),array(), ICON_SIZE_SMALL).'</a>'; Display::return_icon('edit.png', get_lang('Comment'),array(), ICON_SIZE_SMALL).'</a>';
} }
} }
if ($work['contains_file']) { if ($work['contains_file']) {
if ($locked) { if ($locked) {
$action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL); $action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL);
@ -1821,6 +1836,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher
} else { } else {
$action .= '<a href="'.$url.'work.php?'.api_get_cidreq().'&action=make_visible&item_id='.$item_id.'&amp;'.$sort_params.'" title="'.get_lang('Visible').'" >'.Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).'</a> '; $action .= '<a href="'.$url.'work.php?'.api_get_cidreq().'&action=make_visible&item_id='.$item_id.'&amp;'.$sort_params.'" title="'.get_lang('Visible').'" >'.Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).'</a> ';
} }
if ($locked) { if ($locked) {
$action .= Display::return_icon('delete_na.png', get_lang('Delete'),'',ICON_SIZE_SMALL); $action .= Display::return_icon('delete_na.png', get_lang('Delete'),'',ICON_SIZE_SMALL);
} else { } else {
@ -1828,8 +1844,7 @@ function get_work_user_list($start, $limit, $column, $direction, $work_id, $wher
} }
} elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) { } elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) {
if (api_is_allowed_to_session_edit(false, true)) { if (api_is_allowed_to_session_edit(false, true)) {
//$action .= '<a href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Modify').'" >'.Display::return_icon('edit.png', get_lang('Modify'),array(), ICON_SIZE_SMALL).'</a>'; $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
$action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('Modify').'">'.
Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a>'; Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a>';
} else { } else {
$action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL); $action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL);

@ -97,7 +97,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(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 ( $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'),
@ -113,7 +112,6 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification))
); );
} else { } else {
$type = 'complex'; $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 ( $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'),
@ -134,7 +132,7 @@ $extra_params = array();
// Auto width // Auto width
$extra_params['autowidth'] = 'true'; $extra_params['autowidth'] = 'true';
//height auto // Height
$extra_params['height'] = 'auto'; $extra_params['height'] = 'auto';
$extra_params['sortname'] = 'firstname'; $extra_params['sortname'] = 'firstname';

Loading…
Cancel
Save