Browse Source

Merge branch '1.10.x' of github.com:chamilo/chamilo-lms into 1.10.x

Yannick Warnier 9 years ago
parent
commit
a93f6b0c6d

+ 23 - 18
app/Resources/public/css/base.css

@@ -230,6 +230,11 @@ ul#navigation .report a {
     padding-top: 0px;
     background: none;
 }
+
+.work_correction_file_upload {
+    height: 40px;
+}
+
 .impress-content{
     position: relative;
     width: 100%;
@@ -354,24 +359,24 @@ ul#navigation .report a {
     display: inline-block;
     margin-left: 5px;
     padding: 5px;
-    background: #ffffff; 
-    background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); 
-    background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); 
-    background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); 
-    background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); 
-    background: linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%); 
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); 
+    background: #ffffff;
+    background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5));
+    background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
+    background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
+    background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%);
+    background: linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%);
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 );
 }
 .actions a:hover{
-    background: #f4f4f4; 
-    background: -moz-linear-gradient(top, #f4f4f4 0%, #dddddd 71%); 
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f4f4), color-stop(71%,#dddddd)); 
-    background: -webkit-linear-gradient(top, #f4f4f4 0%,#dddddd 71%);  
-    background: -o-linear-gradient(top, #f4f4f4 0%,#dddddd 71%); 
+    background: #f4f4f4;
+    background: -moz-linear-gradient(top, #f4f4f4 0%, #dddddd 71%);
+    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f4f4), color-stop(71%,#dddddd));
+    background: -webkit-linear-gradient(top, #f4f4f4 0%,#dddddd 71%);
+    background: -o-linear-gradient(top, #f4f4f4 0%,#dddddd 71%);
     background: -ms-linear-gradient(top, #f4f4f4 0%,#dddddd 71%);
     background: linear-gradient(to bottom, #f4f4f4 0%,#dddddd 71%);
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#dddddd',GradientType=0 ); 
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#dddddd',GradientType=0 );
 }*/
 .actions .btn-toolbar {
     margin : 0px;
@@ -3425,7 +3430,7 @@ div#no-data-view div.controls {
     padding-top: 1px;
 }
 
-/* styles for the star rater 
+/* styles for the star rater
 .star-rating{
     list-style:none;
     margin: 0px;
@@ -4028,7 +4033,7 @@ a.forum_group_link {
     min-height: 50px;
 }
 .new_actions .nav > li > a {
-    
+
     border-radius: 0 0 0 0;
     border-right: 1px solid #E5E5E5;
     margin: 0;
@@ -6197,7 +6202,7 @@ div#chat-remote-video video {
   padding-top: 3px;
   padding-bottom: 5px;
   border-radius: 5px;
-  
+
 }
 .hot-course-head{
   padding-top: 10px;
@@ -6459,7 +6464,7 @@ a.sessionView {
 {
   width: 70px;
   float: left;
-  margin-right: 5px; 
+  margin-right: 5px;
 }
 #course-block .list-group .list-group-item .title,
 #session-block .list-group .list-group-item .title{

+ 42 - 16
main/inc/lib/api.lib.php

@@ -3314,13 +3314,13 @@ function api_not_allowed($print_headers = false, $message = null)
 
     global $this_section;
 
-    if (empty($user_id)) {
+    if (CustomPages::enabled() && !isset($user_id)) {
 
-        // Why the CustomPages::enabled() need to be to set the request_uri
-        $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
-    }
+        if (empty($user_id)) {
+            // Why the CustomPages::enabled() need to be to set the request_uri
+            $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
+        }
 
-    if (CustomPages::enabled() && !isset($user_id)) {
         CustomPages::display(CustomPages::INDEX_UNLOGGED);
     }
 
@@ -3330,7 +3330,11 @@ function api_not_allowed($print_headers = false, $message = null)
     if (isset($message)) {
         $msg = $message;
     } else {
-        $msg = Display::return_message(get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>', 'error', false);
+        $msg = Display::return_message(
+            get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>',
+            'error',
+            false
+        );
     }
 
     $msg = Display::div($msg, array('align'=>'center'));
@@ -3342,11 +3346,13 @@ function api_not_allowed($print_headers = false, $message = null)
     }
 
     $tpl = new Template(null, $show_headers, $show_headers);
-
     $tpl->assign('hide_login_link', 1);
-
     $tpl->assign('content', $msg);
-    if (($user_id!=0 && !api_is_anonymous()) && (!isset($course) || $course == -1) && empty($_GET['cidReq'])) {
+
+    if (($user_id != 0 && !api_is_anonymous()) &&
+        (!isset($course) || $course == -1) &&
+        empty($_GET['cidReq'])
+    ) {
         // if the access is not authorized and there is some login information
         // but the cidReq is not found, assume we are missing course data and send the user
         // to the user_portal
@@ -3360,29 +3366,41 @@ function api_not_allowed($print_headers = false, $message = null)
             $this_section == SECTION_PLATFORM_ADMIN
         )
     ) {
-
-        //only display form and return to the previous URL if there was a course ID included
+        $courseCode = api_get_course_id();
+        // Only display form and return to the previous URL if there was a course ID included
         if ($user_id != 0 && !api_is_anonymous()) {
             //if there is a user ID, then the user is not allowed but the session is still there. Say so and exit
             $tpl->assign('content', $msg);
             $tpl->display_one_col_template();
             exit;
         }
-        if (!is_null(api_get_course_id())) {
-            api_set_firstpage_parameter(api_get_course_id());
+
+        if (!is_null($courseCode)) {
+            api_set_firstpage_parameter($courseCode);
         }
 
         // If the user has no user ID, then his session has expired
         $action = api_get_self().'?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
         $action = str_replace('&amp;', '&', $action);
-        $form = new FormValidator('formLogin', 'post', $action, null, array(), FormValidator::LAYOUT_BOX_NO_LABEL);
+        $form = new FormValidator(
+            'formLogin',
+            'post',
+            $action,
+            null,
+            array(),
+            FormValidator::LAYOUT_BOX_NO_LABEL
+        );
         $form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'autocapitalize_off'));
         $form->addElement('password', 'password', null, array('placeholder' => get_lang('Password')));
         $form->addButton('submitAuth', get_lang('LoginEnter'), '', 'primary');
 
         // see same text in auth/gotocourse.php and main_api.lib.php function api_not_allowed (above)
         $content = Display::return_message(get_lang('NotAllowed'), 'error', false);
-        $content .= '<h4>'.get_lang('LoginToGoToThisCourse').'</h4>';
+
+        if (!empty($courseCode)) {
+            $content .= '<h4>'.get_lang('LoginToGoToThisCourse').'</h4>';
+        }
+
         if (api_is_cas_activated()) {
             $content .= Display::return_message(sprintf(get_lang('YouHaveAnInstitutionalAccount'), api_get_setting("Institution")), '', false);
             $content .= Display::div("<br/><a href='".get_cas_direct_URL(api_get_course_id())."'>".sprintf(get_lang('LoginWithYourAccount'), api_get_setting("Institution"))."</a><br/><br/>", array('align'=>'center'));
@@ -3396,7 +3414,15 @@ function api_not_allowed($print_headers = false, $message = null)
         if (api_is_cas_activated()) {
             $content .= "</div>";
         }
-        $content .= '<hr/><p style="text-align:center"><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a></p>';
+
+        if (!empty($courseCode)) {
+            $content .= '<hr/><p style="text-align:center"><a href="'.$home_url.'">'.
+                get_lang('ReturnToCourseHomepage').'</a></p>';
+        } else {
+            $content .= '<hr/><p style="text-align:center"><a href="'.$home_url.'">'.
+                get_lang('CampusHomepage').'</a></p>';
+        }
+
         $tpl->setLoginBodyClass();
         $tpl->assign('content', $content);
         $tpl->display_one_col_template();

+ 0 - 12
main/inc/lib/login.lib.php

@@ -333,18 +333,6 @@ class Login
                     UserManager::update_extra_field_value($_user['user_id'], 'already_logged_in', 'true');
                     Session::write('is_platformAdmin', $is_platformAdmin);
                     Session::write('is_allowedCreateCourse', $is_allowedCreateCourse);
-
-//
-//
-//                    // If request_uri is setted we have to go further to have course permissions
-//                    if (empty($_SESSION['request_uri']) || !isset($_SESSION['request_uri'])) {
-//                        if (isset($_SESSION['noredirection'])) {
-//                            //If we just want to reset info without redirecting user
-//                            unset($_SESSION['noredirection']);
-//                        } else {
-//                            LoginRedirection::redirect();
-//                        }
-//                    }
                 } else {
                     header('location:' . api_get_path(WEB_PATH));
                     //exit("WARNING UNDEFINED UID !! ");

+ 7 - 16
main/template/default/work/view.tpl

@@ -1,31 +1,22 @@
 <div class="page-header">
     <h2>
         {{ work.title }}
-        {% if work.contains_file %}
-            <a href="{{ work.download_url }}">
-                <img src="{{ "save.png"|icon(22) }}" width="22" height="22">
-            </a>
-        {% endif %}
-        </h2>
+    </h2>
 </div>
 
-{% if work.url_correction %}
-    <h3>{{ "Correction" |get_lang }}</h3>
-    <p>
-        <a class="btn btn-default" href="{{ work.download_url }}&correction=1">
-            {{ "Download" |get_lang }}
-        </a>
-    </p>
-    <hr />
-{% endif %}
-
 {% if work.description %}
+<h3>
+    {{ 'Description' | get_lang }}
+</h3>
 <p>
     {{ work.description }}
 </p>
 {% endif %}
 
 {% if work.contains_file and work.show_content %}
+<h3>
+    {{ 'Content' | get_lang }}
+</h3>
 <p>
     {{ work.show_content }}
 </p>

+ 9 - 3
main/work/add_user.php

@@ -6,7 +6,7 @@ require_once '../inc/global.inc.php';
 // Including necessary files
 require_once 'work.lib.php';
 
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
+$current_course_tool = TOOL_STUDENTPUBLICATION;
 
 $workId = isset($_GET['id']) ? intval($_GET['id']) : null;
 $userId = isset($_GET['user_id']) ? intval($_GET['user_id']) : null;
@@ -30,8 +30,14 @@ if (!api_is_allowed_to_edit()) {
 
 $courseInfo = api_get_course_info();
 
-$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_all.php?'.api_get_cidreq().'&id='.$workId, 'name' => $my_folder_data['title']);
+$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_all.php?'.api_get_cidreq().'&id='.$workId,
+    'name' => $my_folder_data['title'],
+);
 $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('AddUsers'));
 
 $error_message = null;

+ 32 - 1
main/work/view.php

@@ -42,9 +42,11 @@ if ((user_is_author($id) || $isDrhOfCourse || (api_is_allowed_to_edit() || api_i
         $url_dir = 'work_list.php?id='.$my_folder_data['id'];
     }
 
+    $userInfo = api_get_user_info($work['user_id']);
     $interbreadcrumb[] = array('url' => $url_dir, 'name' => $my_folder_data['title']);
+    $interbreadcrumb[] = array('url' => '#', 'name' => $userInfo['complete_name']);
     $interbreadcrumb[] = array('url' => '#','name' => $work['title']);
-    //|| api_is_drh()
+
     if (($courseInfo['show_score'] == 0 &&
         $work['active'] == 1 &&
         $work['accepted'] == 1
@@ -99,6 +101,35 @@ if ((user_is_author($id) || $isDrhOfCourse || (api_is_allowed_to_edit() || api_i
         $tpl = new Template();
         $tpl->assign('work', $work);
         $tpl->assign('comments', $comments);
+
+        $actions = '';
+        if (isset($work['contains_file'])) {
+            if (isset($work['download_url'])) {
+                $actions .= Display::url(
+                    Display::return_icon(
+                        'save.png',
+                        get_lang('Download'),
+                        null,
+                        ICON_SIZE_MEDIUM
+                    ),
+                    $work['download_url']
+                );
+
+                if (isset($work['url_correction'])) {
+                    $actions .= Display::url(
+                        Display::return_icon(
+                            'check.png',
+                            get_lang('Correction'),
+                            null,
+                            ICON_SIZE_MEDIUM
+                        ),
+                        $work['download_url'].'&correction=1'
+                    );
+                }
+            }
+        }
+
+        $tpl->assign('actions', $actions);
         if (api_is_allowed_to_session_edit()) {
             $tpl->assign('form', $commentForm);
         }

+ 49 - 27
main/work/work.lib.php

@@ -50,7 +50,7 @@ function display_action_links($id, $cur_dir_path, $action)
             $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>';
         }
         $display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('viewStudents'),'',ICON_SIZE_MEDIUM) . '</a>';
-        
+
     }
 
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath' && api_is_allowed_to_session_edit(false, true)) {
@@ -1564,6 +1564,11 @@ function getWorkListTeacher(
                 api_get_path(WEB_CODE_PATH).'work/edit_work.php?id='.$workId.'&'.api_get_cidreq()
             );
 
+            $correctionLink = Display::url(
+                Display::return_icon('upload_file.png', get_lang('UploadCorrections'), '', ICON_SIZE_SMALL),
+                api_get_path(WEB_CODE_PATH).'work/upload_corrections.php?'.api_get_cidreq().'&id='.$workId
+            );
+
             if ($countUniqueAttempts > 0) {
                 $downloadLink = Display::url(
                     Display::return_icon(
@@ -1598,7 +1603,7 @@ function getWorkListTeacher(
                 $deleteLink = null;
                 $editLink = null;
             }
-            $work['actions'] = $visibilityLink.$downloadLink.$editLink.$deleteLink;
+            $work['actions'] = $visibilityLink.$correctionLink.$downloadLink.$editLink.$deleteLink;
             $works[] = $work;
         }
     }
@@ -1895,7 +1900,9 @@ function get_work_user_list(
                         u.username,
                         parent_id,
                         accepted,
-                        qualificator_id';
+                        qualificator_id,
+                        url_correction
+                        ';
         if ($getCount) {
             $select = "SELECT DISTINCT count(u.user_id) as count ";
         }
@@ -2055,8 +2062,15 @@ function get_work_user_list(
 
                 $action = '';
                 if (api_is_allowed_to_edit()) {
+                    if (!empty($work['url_correction'])) {
+                        $action .= Display::url(
+                            Display::return_icon('check.png', get_lang('Correction'), null, ICON_SIZE_SMALL),
+                            api_get_path(WEB_CODE_PATH).'work/download.php?id='.$item_id.'&'.api_get_cidreq().'&correction=1'
+                        );
+                    }
+
                     $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> ';
+                        Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a> ';
 
                     if ($unoconv && empty($work['contains_file'])) {
                         $action .=  '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
@@ -2169,6 +2183,7 @@ function get_work_user_list(
                 $work['qualificator_id'] = $qualificator_id;
                 $work['actions'] = $send_to.$link_to_download.$action;
                 $work['correction'] = $correction;
+
                 $works[] = $work;
             }
         }
@@ -2422,48 +2437,50 @@ function user_is_author($itemId, $userId = null, $courseId = null, $sessionId =
  */
 function get_list_users_without_publication($task_id, $studentId = null)
 {
-    $work_table              = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
-    $table_course_user       = Database::get_main_table(TABLE_MAIN_COURSE_USER);
-    $table_user              = Database::get_main_table(TABLE_MAIN_USER);
+    $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
+    $table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
+    $table_user = Database::get_main_table(TABLE_MAIN_USER);
     $session_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
 
-    //condition for the session
-    $session_id    = api_get_session_id();
-    $course_id     = api_get_course_int_id();
+    $users = getAllUserToWork($task_id, api_get_course_int_id());
+    $users = array_column($users, 'user_id');
 
+    // Condition for the session
+    $session_id = api_get_session_id();
+    $course_id = api_get_course_int_id();
     $task_id = intval($task_id);
 
     if ($session_id == 0) {
         $sql = "SELECT user_id as id FROM $work_table
                 WHERE
                     c_id = $course_id AND
-                    parent_id='$task_id' AND
+                    parent_id = '$task_id' AND
                     active IN (0, 1)";
     } else {
         $sql = "SELECT user_id as id FROM $work_table
                 WHERE
                     c_id = $course_id AND
-                    parent_id='$task_id' AND
-                    session_id='".$session_id."' AND
+                    parent_id = '$task_id' AND
+                    session_id = '".$session_id."' AND
                     active IN (0, 1)";
     }
 
     $result = Database::query($sql);
     $users_with_tasks = array();
-    while($row = Database::fetch_array($result)) {
+    while ($row = Database::fetch_array($result)) {
         $users_with_tasks[] = $row['id'];
     }
 
     if ($session_id == 0) {
         $sql_users = "SELECT cu.user_id, u.lastname, u.firstname, u.email
                       FROM $table_course_user AS cu, $table_user AS u
-                      WHERE u.status != 1 and cu.c_id='".api_get_course_int_id()."' AND u.user_id = cu.user_id";
+                      WHERE u.status != 1 and cu.c_id='".$course_id."' AND u.user_id = cu.user_id";
     } else {
         $sql_users = "SELECT cu.user_id, u.lastname, u.firstname, u.email
                       FROM $session_course_rel_user AS cu, $table_user AS u
                       WHERE
                         u.status != 1 AND
-                        cu.c_id='".api_get_course_int_id()."' AND
+                        cu.c_id='".$course_id."' AND
                         u.user_id = cu.user_id AND
                         cu.session_id = '".$session_id."'";
     }
@@ -2487,22 +2504,30 @@ function get_list_users_without_publication($task_id, $studentId = null)
 
     $result_users = Database::query($sql_users);
     $users_without_tasks = array();
-    while ($row_users = Database::fetch_row($result_users)) {
-
-        if (in_array($row_users[0], $users_with_tasks)) {
+    while ($rowUsers = Database::fetch_array($result_users)) {
+        $userId = $rowUsers['user_id'];
+        if (in_array($userId, $users_with_tasks)) {
             continue;
         }
 
-        if ($group_id && !in_array($row_users[0], $new_group_user_list)) {
+        if ($group_id && !in_array($userId, $new_group_user_list)) {
             continue;
         }
-        $userId = $row_users[0];
-        $row_users[0] = $row_users[1];
-        $row_users[1] = $row_users[2];
-        $row_users[2] = Display::encrypted_mailto_link($row_users[3]);
+
+        if (!empty($users)) {
+            if (!in_array($userId, $users)) {
+                continue;
+            }
+        }
+
+        $row_users = [];
+        $row_users[0] = $rowUsers['lastname'];
+        $row_users[1] = $rowUsers['firstname'];
+        $row_users[2] = Display::encrypted_mailto_link($rowUsers['email']);
         $row_users[3] = $userId;
         $users_without_tasks[] = $row_users;
     }
+
     return $users_without_tasks;
 }
 
@@ -2529,9 +2554,6 @@ function display_list_users_without_publication($task_id, $studentId = null)
     $paging_options = array();
     $my_params = array();
 
-    if (isset($_GET['curdirpath'])) {
-        $my_params['curdirpath'] = Security::remove_XSS($_GET['curdirpath']);
-    }
     if (isset($_GET['edit_dir'])) {
         $my_params['edit_dir'] = Security::remove_XSS($_GET['edit_dir']);
     }

+ 35 - 28
main/work/work_missing.php

@@ -1,8 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use ChamiloSession as Session;
-
 require_once '../inc/global.inc.php';
 $current_course_tool  = TOOL_STUDENTPUBLICATION;
 
@@ -15,8 +13,8 @@ require_once 'work.lib.php';
 $this_section = SECTION_COURSES;
 
 $workId = isset($_GET['id']) ? intval($_GET['id']) : null;
-
 $group_id = api_get_group_id();
+$user_id = api_get_user_id();
 
 if (empty($workId)) {
     api_not_allowed(true);
@@ -38,16 +36,17 @@ switch ($action) {
     case 'send_mail':
         $check = Security::check_token('get');
         if ($check) {
-            $mails_sent_to = send_reminder_users_without_publication($my_folder_data);
+            $mails_sent_to = send_reminder_users_without_publication(
+                $my_folder_data
+            );
 
             if (empty($mails_sent_to)) {
-                $error_message = Display::return_message(get_lang('NoResults'), 'warning');
+                Display::addFlash(Display::return_message(get_lang('NoResults'), 'warning'));
             } else {
-                $error_message = Display::return_message(get_lang('MessageHasBeenSent').' '.implode(', ', $mails_sent_to), 'success');
-            }
-
-            if (!empty($error_message)) {
-                Session::write('error_message', $error_message);
+                Display::addFlash(Display::return_message(
+                    get_lang('MessageHasBeenSent').' '.implode(', ', $mails_sent_to),
+                    'success'
+                ));
             }
             Security::clear_token();
         }
@@ -75,45 +74,53 @@ if (!empty($group_id)) {
         api_not_allowed();
     }
 
-    $interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'group/group.php', 'name' => get_lang('Groups'));
-    $interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gidReq='.$group_id, 'name' => get_lang('GroupSpace').' '.$group_properties['name']);
+    $interbreadcrumb[] = array(
+        'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
+        'name' => get_lang('Groups'),
+    );
+    $interbreadcrumb[] = array(
+        'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gidReq='.$group_id,
+        'name' => get_lang('GroupSpace').' '.$group_properties['name']
+    );
 }
 
-$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_all.php?'.api_get_cidreq().'&id='.$workId, 'name' =>  $my_folder_data['title']);
+$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_all.php?'.api_get_cidreq().'&id='.$workId,
+    'name' =>  $my_folder_data['title']
+);
 
 if (isset($_GET['list']) && $_GET['list'] == 'with') {
-    $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('UsersWithTask'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('UsersWithTask'));
 } else {
-    $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('UsersWithoutTask'));
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('UsersWithoutTask'));
 }
 
-Display :: display_header(null);
+Display::display_header(null);
 
 echo '<div class="actions">';
-echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_list_all.php?id='.$workId.'&'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'">'.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
-
+echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_list_all.php?id='.$workId.'&'.api_get_cidreq().'">'.
+    Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
+$output = '';
 if (!empty($workId)) {
     if (empty($_GET['list']) or Security::remove_XSS($_GET['list']) == 'with') {
-        $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$workId.'&amp;curdirpath='.$cur_dir_path.'&amp;origin='.$origin.'&amp;gradebook='.$gradebook.'&amp;list=without">'.
+        $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without">'.
             Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'),'',ICON_SIZE_MEDIUM)."</a>";
     } else {
         if (!isset($_GET['action']) || (isset($_GET['action']) && $_GET['action'] != 'send_mail')) {
-            $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$workId.'&amp;curdirpath='.$cur_dir_path.'&amp;origin='.$origin.'&amp;gradebook='.$gradebook.'&amp;list=without&amp;action=send_mail&amp;sec_token='.$token.'">'.
+            $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without&action=send_mail&sec_token='.$token.'">'.
                 Display::return_icon('mail_send.png', get_lang('ReminderMessage'),'',ICON_SIZE_MEDIUM)."</a>";
         } else {
-            $display_output .= Display::return_icon('mail_send_na.png', get_lang('ReminderMessage'),'',ICON_SIZE_MEDIUM);
+            $output .= Display::return_icon('mail_send_na.png', get_lang('ReminderMessage'),'',ICON_SIZE_MEDIUM);
         }
     }
 }
 
-echo $display_output;
+echo $output;
 echo '</div>';
 
-$error_message = Session::read('error_message');
-if (!empty($error_message)) {
-    echo $error_message;
-    Session::erase('error_message');
-}
 
 display_list_users_without_publication($workId);