-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry_view.php
87 lines (70 loc) · 2.98 KB
/
entry_view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
//
// 申請書を1枚表示する
//
// needs $submit, $items, $name_pattern, $user
require_once('jbxl/jbxl_moodle_tools.php');
echo '<style type="text/css">';
include('./html/html.css');
echo '</style>';
if ($submit->user_id!=$USER->id) {
require_capability('mod/apply:viewreports', $context);
}
$student = $DB->get_record('user', array('id'=>$submit->user_id));
$user_name = jbxl_get_user_name($student, $apply->name_pattern);
$title = $user_name.' ('.userdate($submit->time_modified, '%Y/%m/%d %H:%M').')';
if ($submit->class==APPLY_CLASS_DRAFT) $title .= ' <font color="#e22">'.get_string('class_draft', 'apply').'</font>';
else if ($submit->class==APPLY_CLASS_CANCEL) $title .= ' <font color="#e22">'.get_string('class_cancel','apply').'</font>';
if ($submit->version!=$submit_ver) $title .= ' <font color="#22e"> Ver.'.$submit_ver.'</font>';
// preview icon
if ($this_action!='preview') {
$preview_img = $OUTPUT->pix_icon('t/preview', get_string('preview'));
$preview_url = new moodle_url('/mod/apply/preview.php');
$preview_url->params(array('id'=>$cm->id, 'courseid'=>$courseid, 'action'=>$this_action));
$preview_url->params(array('submit_id'=>$submit->id, 'submit_ver'=>$submit_ver, 'user_id'=>$user_id));
$title .= ' <a href="'.$preview_url->out().'" '.'target="_blank">'.$preview_img.'</a>';
}
echo '<div align="center">';
echo $OUTPUT->heading(format_text($title), 4);
echo '</div>';
//echo '<br />';
//
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide entry_view');
foreach ($items as $item) {
//get the values
$params = array('submit_id'=>$submit->id, 'item_id'=>$item->id, 'version'=>$submit_ver);
$value = $DB->get_record('apply_value', $params);
if ($item->typ!='pagebreak' and $item->label!=APPLY_SUBMIT_ONLY_TAG and $item->label!=APPLY_ADMIN_ONLY_TAG and $item->typ!='fixedtitle') {
echo $OUTPUT->box_start('apply_print_item');
apply_print_line_space();
if (isset($value->value)) {
apply_print_item_show_value($item, $value->value);
}
else {
apply_print_item_show_value($item, false);
}
echo $OUTPUT->box_end();
}
//
else if ($item->label==APPLY_ADMIN_ONLY_TAG and has_capability('mod/apply:viewreports', $context) and $item->typ!='fixedtitle') {
echo $OUTPUT->box_start('apply_print_item');
apply_print_line_space();
if (isset($value->value)) {
apply_print_item_show_value($item, $value->value);
}
else {
apply_print_item_show_value($item, false);
}
echo $OUTPUT->box_end();
}
}
//
if ($Table_in) { // テーブルはまだ閉じられていない.
echo $OUTPUT->box_start('apply_print_item');
apply_close_table_tag();
echo $OUTPUT->box_end();
//echo '<div style="color:#c00000">['.get_string('not_close_table','apply').']</div>';
}
require('entry_info.php');
echo $OUTPUT->box_end();
//require('entry_button.php');