|
@@ -207,26 +207,27 @@ function build_edit_icons_cat($cat, $selectcat) {
|
|
|
|
|
|
$modify_icons .= '<a class="view_children" data-cat-id="'.$cat->get_id().'" href="javascript:void(0);">'.Display::return_icon('view_more_stats.gif', get_lang('Show'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
|
|
|
- if (empty($grade_model_id) || $grade_model_id == -1) {
|
|
|
- $modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&cidReq='.$cat->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
+ if (api_is_allowed_to_edit(null, true)) {
|
|
|
+ if (empty($grade_model_id) || $grade_model_id == -1) {
|
|
|
+ $modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&cidReq='.$cat->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $modify_icons .= ' <a href="' . api_get_self() . '?visiblecat=' . $cat->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . ' ">'.Display::return_icon($visibility_icon.'.png', get_lang('Visible'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
+
|
|
|
+ //no move ability for root categories
|
|
|
+ if ($cat->is_movable()) {
|
|
|
+ /*$modify_icons .= ' <a href="' . api_get_self() . '?movecat=' . $cat->get_id() . '&selectcat=' . $selectcat . ' &cidReq='.$cat->get_course_code().'">
|
|
|
+ <img src="../img/icons/22/move.png" border="0" title="' . get_lang('Move') . '" alt="" /></a>';*/
|
|
|
+ } else {
|
|
|
+ //$modify_icons .= ' <img src="../img/deplacer_fichier_na.gif" border="0" title="' . get_lang('Move') . '" alt="" />';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (empty($grade_model_id) || $grade_model_id == -1) {
|
|
|
+ /*$modify_icons .= ' <a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&cidReq='.$cat->get_course_code().'&selectcat=' . $cat->get_id() . '"> '.
|
|
|
+ Display::return_icon('percentage.png', get_lang('EditAllWeights'),'',ICON_SIZE_SMALL).' </a>'; */
|
|
|
+ }
|
|
|
+ $modify_icons .= ' <a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&selectcat=' . $selectcat . '&cidReq='.$cat->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
}
|
|
|
-
|
|
|
- $modify_icons .= ' <a href="' . api_get_self() . '?visiblecat=' . $cat->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . ' ">'.Display::return_icon($visibility_icon.'.png', get_lang('Visible'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
-
|
|
|
- //no move ability for root categories
|
|
|
- if ($cat->is_movable()) {
|
|
|
- /*$modify_icons .= ' <a href="' . api_get_self() . '?movecat=' . $cat->get_id() . '&selectcat=' . $selectcat . ' &cidReq='.$cat->get_course_code().'">
|
|
|
- <img src="../img/icons/22/move.png" border="0" title="' . get_lang('Move') . '" alt="" /></a>';*/
|
|
|
- } else {
|
|
|
- //$modify_icons .= ' <img src="../img/deplacer_fichier_na.gif" border="0" title="' . get_lang('Move') . '" alt="" />';
|
|
|
- }
|
|
|
-
|
|
|
- if (empty($grade_model_id) || $grade_model_id == -1) {
|
|
|
- /*$modify_icons .= ' <a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&cidReq='.$cat->get_course_code().'&selectcat=' . $cat->get_id() . '"> '.
|
|
|
- Display::return_icon('percentage.png', get_lang('EditAllWeights'),'',ICON_SIZE_SMALL).' </a>'; */
|
|
|
- }
|
|
|
-
|
|
|
- $modify_icons .= ' <a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&selectcat=' . $selectcat . '&cidReq='.$cat->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
|
|
|
return $modify_icons;
|
|
|
}
|
|
@@ -242,7 +243,8 @@ function build_edit_icons_eval($eval, $selectcat) {
|
|
|
$eval->get_course_code();
|
|
|
$cat=new Category();
|
|
|
$message_eval=$cat->show_message_resource_delete($eval->get_course_code());
|
|
|
- if ($message_eval===false) {
|
|
|
+
|
|
|
+ if ($message_eval===false && api_is_allowed_to_edit(null, true)) {
|
|
|
$visibility_icon= ($eval->is_visible() == 0) ? 'invisible' : 'visible';
|
|
|
$visibility_command= ($eval->is_visible() == 0) ? 'set_visible' : 'set_invisible';
|
|
|
$modify_icons= '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . ' &cidReq='.$eval->get_course_code().'">
|