|
1
|
|
|
<?php |
|
2
|
|
|
// This file is part of BOINC. |
|
3
|
|
|
// http://boinc.berkeley.edu |
|
4
|
|
|
// Copyright (C) 2008 University of California |
|
5
|
|
|
// |
|
6
|
|
|
// BOINC is free software; you can redistribute it and/or modify it |
|
7
|
|
|
// under the terms of the GNU Lesser General Public License |
|
8
|
|
|
// as published by the Free Software Foundation, |
|
9
|
|
|
// either version 3 of the License, or (at your option) any later version. |
|
10
|
|
|
// |
|
11
|
|
|
// BOINC is distributed in the hope that it will be useful, |
|
12
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
14
|
|
|
// See the GNU Lesser General Public License for more details. |
|
15
|
|
|
// |
|
16
|
|
|
// You should have received a copy of the GNU Lesser General Public License |
|
17
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
|
18
|
|
|
|
|
19
|
|
|
require_once("../inc/util_ops.inc"); |
|
20
|
|
|
|
|
21
|
|
|
function show_assign($asgn) { |
|
22
|
|
|
$when = time_str($asgn->create_time); |
|
23
|
|
|
switch ($asgn->target_type) { |
|
24
|
|
|
case 0: |
|
25
|
|
|
$x = "All hosts"; |
|
26
|
|
|
break; |
|
27
|
|
|
case 1: |
|
28
|
|
|
$x = "<a href=db_action.php?table=host&id=$asgn->id>Host $asgn->target_id</a>"; |
|
29
|
|
|
break; |
|
30
|
|
|
case 2: |
|
31
|
|
|
if ($asgn->multi) { |
|
32
|
|
|
$y = "All hosts belonging to "; |
|
33
|
|
|
} else { |
|
34
|
|
|
$y = "One host belonging to "; |
|
35
|
|
|
} |
|
36
|
|
|
$x = "$y<a href=db_action.php?table=user&id=$asgn->target_id>User $asgn->target_id</a>"; |
|
37
|
|
|
break; |
|
38
|
|
|
case 3: |
|
39
|
|
|
if ($asgn->multi) { |
|
40
|
|
|
$y = "All hosts belonging to "; |
|
41
|
|
|
} else { |
|
42
|
|
|
$y = "One host belonging to "; |
|
43
|
|
|
} |
|
44
|
|
|
$x = "$y<a href=db_action.php?table=team&id=$asgn->target_id>Team $asgn->target_id</a>"; |
|
45
|
|
|
break; |
|
46
|
|
|
} |
|
47
|
|
|
echo "<tr> |
|
48
|
|
|
<td>$asgn->id (created $when)</td> |
|
49
|
|
|
<td>$x</td> |
|
|
|
|
|
|
50
|
|
|
<td><a href=db_action.php?table=workunit&id=$asgn->workunitid>$asgn->workunitid</a></td> |
|
51
|
|
|
<td><a href=db_action.php?table=result&id=$asgn->resultid>$asgn->resultid</a></td> |
|
52
|
|
|
</tr> |
|
53
|
|
|
"; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
function show_assigns() { |
|
57
|
|
|
admin_page_head("Assignments"); |
|
58
|
|
|
$asgns = BoincAssignment::enum(); |
|
59
|
|
|
if (count($asgns)) { |
|
60
|
|
|
start_table(); |
|
61
|
|
|
table_header("Assignment ID/time", "target", "workunit", "result"); |
|
62
|
|
|
foreach ($asgns as $asgn) { |
|
63
|
|
|
show_assign($asgn); |
|
64
|
|
|
} |
|
65
|
|
|
end_table(); |
|
66
|
|
|
} else { |
|
67
|
|
|
echo "No assignments"; |
|
68
|
|
|
} |
|
69
|
|
|
admin_page_tail(); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
$action = get_str('action', true); |
|
73
|
|
|
switch ($action) { |
|
|
|
|
|
|
74
|
|
|
default: |
|
|
|
|
|
|
75
|
|
|
show_assigns(); |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
?> |
|
79
|
|
|
|