user_id!=$USER->id) { require_capability('mod/apply:viewreports', $context); } $student = apply_get_user_info($submit->user_id); if ($student) { //$user_name = jbxl_get_user_name($student, $name_pattern); // $user_url = $CFG->wwwroot.'/user/view.php?id='.$student->id.'&course='.$courseid; $acked_url = $CFG->wwwroot.'/user/view.php?id='.$submit->acked_user.'&course='.$courseid; $execd_url = $CFG->wwwroot.'/user/view.php?id='.$submit->execd_user.'&course='.$courseid; /////////////////////////////////////// // //if (!$req_own_data) { // $data[] = $OUTPUT->user_picture($student, array('courseid'=>$courseid, 'size'=>20)); //} $data[] = $line_num; // $title = $submit->title; if ($title=='') $title = get_string('no_title', 'apply'); $entry_params = array('user_id'=>$student->id, 'submit_id'=>$submit->id, 'submit_ver'=>$submit->version, 'do_show'=>'view_one_entry', 'show_all'=>$show_all); $entry_url = new moodle_url($this_url, $entry_params); //$data[] = '
'.$title.'
'; $data[] = '
'.$title.'
'; // if (!$req_own_data) { //$data[] = $OUTPUT->user_picture($student, array('courseid'=>$courseid, 'size'=>20)); if ($name_pattern=='firstname') { $data[] = '
'.$student->firstname.'
'; } else if ($name_pattern=='lasttname') { $data[] = '
'.$student->lastname.'
'; } else if ($name_pattern=='firstlastname') { $data[] = '
'.$student->firstname.'
'; $data[] = '
'.$student->lastname.'
'; } else if ($name_pattern=='lastfirstname') { $data[] = '
'.$student->lastname. '
'; $data[] = '
'.$student->firstname.'
'; } else { $user_name =jbxl_get_user_name($student, 'fullname'); $data[] = '
'.$user_name.'
'; } } // if ($apply->date_format=='') $apply->date_format = get_string('date_format_default', 'apply'); $data[] = userdate($submit->time_modified, $apply->date_format); $data[] = $submit->version; // if ($submit->class==APPLY_CLASS_DRAFT) $class = get_string('class_draft', 'apply'); else if ($submit->class==APPLY_CLASS_NEW) $class = get_string('class_newpost', 'apply'); else if ($submit->class==APPLY_CLASS_UPDATE) $class = get_string('class_update', 'apply'); else if ($submit->class==APPLY_CLASS_CANCEL) $class = get_string('class_cancel', 'apply'); if ($submit->class==APPLY_CLASS_DRAFT || $submit->class==APPLY_CLASS_CANCEL) $class = '
'.$class.'
'; $data[] = $class; // if ($req_own_data) { if ($submit->version>0 and apply_exist_draft_values($submit->id)) { $draft_params = array('user_id'=>$student->id, 'submit_id'=>$submit->id, 'submit_ver'=>0, 'do_show'=>'view_one_entry', 'show_all'=>$show_all); $draft_url = new moodle_url($this_url, $draft_params); //$data[] = '
'.get_string('exist', 'apply').'
'; $data[] = '
'.get_string('exist', 'apply').'
'; } else { $data[] = '-'; } } // if ($submit->class==APPLY_CLASS_DRAFT) $acked = '-'; else if ($submit->acked==APPLY_ACKED_NOTYET) $acked = get_string('acked_notyet', 'apply'); else if ($submit->acked==APPLY_ACKED_ACCEPT) $acked = get_string('acked_accept', 'apply'); else if ($submit->acked==APPLY_ACKED_REJECT) $acked = get_string('acked_reject', 'apply'); if ($submit->acked!=APPLY_ACKED_NOTYET) { //$acked = '
'.$acked.'
'; $acked = '
'.$acked.'
'; } $data[] = $acked; // if (!$apply->only_acked_accept) { // if ($submit->class==APPLY_CLASS_DRAFT) $execd = '-'; else if ($submit->execd==APPLY_EXECD_DONE) $execd = get_string('execd_done', 'apply'); else $execd = get_string('execd_notyet', 'apply'); if ($submit->execd!=APPLY_EXECD_NOTYET) { //$execd = '
'.$execd.'
'; $execd = '
'.$execd.'
'; } $data[] = $execd; } // // if ($submit->version>1) { $prev_ver = $submit->version - 1; //$form = '
'; $form = ''; $form.= ' '; $form.= ''; $form.= ''; $form.= ''; $form.= ''; $form.= ''; $form.= ''; $form.= '
'; } else { $form = '-'; } $data[] = $form; // if ($req_own_data) { if ($submit->class==APPLY_CLASS_CANCEL and $submit->acked==APPLY_ACKED_ACCEPT) { // 解除が受理されたものは,ユーザは変更できない $data[] = '-'; $data[] = '-'; } else { if ($submit->acked==APPLY_ACKED_ACCEPT) { // Update $change_label = get_string('update_entry_button', 'apply'); $change_params = array('id'=>$id, 'submit_id'=>$submit->id, 'submit_ver'=>$submit->version, 'courseid'=>$courseid, 'go_page'=>0, 'show_all'=>$show_all); $change_action = 'submit.php'; // Discard if ($apply->can_discard) { $discard_label = get_string('cancel_entry_button', 'apply'); $discard_params = array('id'=>$id, 'submit_id'=>$submit->id, 'show_all'=>$show_all); $discard_action = 'delete_submit.php'; } } else { // Edit $change_label = get_string('edit_entry_button', 'apply'); $change_params = array('id'=>$id, 'submit_id'=>$submit->id, 'submit_ver'=>$submit->version, 'courseid'=>$courseid, 'go_page'=>0, 'show_all'=>$show_all); $change_action = 'submit.php'; if ($submit->version<=1 and $apply->can_discard) { // Discard $discard_label = get_string('delete_entry_button', 'apply'); $discard_params = array('id'=>$id, 'submit_id'=>$submit->id, 'show_all'=>$show_all); $discard_action = 'delete_submit.php'; } else { // Rollback $discard_label = get_string('rollback_entry_button', 'apply'); $discard_params = array('id'=>$id, 'submit_id'=>$submit->id, 'show_all'=>$show_all); $discard_action = 'delete_submit.php'; } } // if ($submit->class==APPLY_CLASS_CANCEL or $apply_is_closed) { // 解除を申請している場合は,内容を編集・更新できない $data[] = '-'; } else { $data[] = apply_single_button($CFG->wwwroot.'/mod/apply/'.$change_action, $change_params, $change_label); } if ($apply_is_closed) { $data[] = '-'; } else { if ($apply->can_discard) { $data[] = apply_single_button($CFG->wwwroot.'/mod/apply/'.$discard_action, $discard_params, $discard_label); } } } } // for admin else { $operate_params = array('id'=>$id, 'submit_id'=>$submit->id, 'submit_ver'=>$submit->version, 'courseid'=>$courseid, 'show_all'=>$show_all); $operate_url = $CFG->wwwroot.'/mod/apply/operate_submit.php'; //$data[] = apply_single_button($operate_url, $operate_params, get_string('operate_submit', 'apply'), 'POST', '_blank'); $data[] = apply_single_button($operate_url, $operate_params, get_string('operate_submit', 'apply'), 'POST'); if ($apply->enable_deletemode) { //$form = '
'; $form = ''; $form.= ''; $form.= ''; $form.= ''; $form.= ''; $form.= ''; $form.= ''; $form.= '
'; $data[] = $form; } } }