2007-07-27 18:30:10 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2007-11-07 17:23:29 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2007-07-27 18:30:10 +00:00
|
|
|
require_once("../inc/user.inc");
|
|
|
|
require_once("../inc/team.inc");
|
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("xml", "teamid"));
|
|
|
|
|
2007-10-26 21:14:35 +00:00
|
|
|
$xml = get_int('xml', true);
|
2007-07-27 18:30:10 +00:00
|
|
|
|
|
|
|
function show_delta($delta) {
|
|
|
|
global $xml;
|
2007-11-07 17:23:29 +00:00
|
|
|
$user = BoincUser::lookup_id($delta->userid);
|
2007-07-27 18:30:10 +00:00
|
|
|
$when = time_str($delta->timestamp);
|
|
|
|
$what = $delta->joining?"joined":"quit";
|
|
|
|
if ($xml) {
|
|
|
|
echo " <action>
|
2007-08-15 03:07:35 +00:00
|
|
|
<id>$user->id</id>
|
|
|
|
<name>$user->name</name>
|
2007-07-27 18:30:10 +00:00
|
|
|
<action>$what</action>
|
|
|
|
<total_credit>$delta->total_credit</total_credit>
|
|
|
|
<when>$when</when>
|
|
|
|
</action>
|
|
|
|
";
|
|
|
|
} else {
|
|
|
|
echo "<tr>
|
|
|
|
<td>$when</td>
|
2007-11-16 21:31:43 +00:00
|
|
|
<td>",user_links($user)," (ID $user->id)</td>
|
2007-07-27 18:30:10 +00:00
|
|
|
<td>$what</td>
|
|
|
|
<td>$delta->total_credit</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$user = get_logged_in_user();
|
2007-11-07 17:23:29 +00:00
|
|
|
$teamid = get_int('teamid');
|
|
|
|
$team = BoincTeam::lookup_id($teamid);
|
2007-07-27 18:30:10 +00:00
|
|
|
if ($xml) {
|
|
|
|
require_once('../inc/xml.inc');
|
|
|
|
xml_header();
|
|
|
|
}
|
|
|
|
|
2007-11-22 02:36:51 +00:00
|
|
|
if (!$team || !is_team_admin($user, $team)) {
|
2007-07-27 18:30:10 +00:00
|
|
|
if ($xml) {
|
2007-11-22 02:36:51 +00:00
|
|
|
xml_error("-1", "Not founder or admin");
|
2007-07-27 18:30:10 +00:00
|
|
|
} else {
|
2010-02-16 01:06:03 +00:00
|
|
|
error_page(tra("Not founder or admin"));
|
2007-07-27 18:30:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($xml) {
|
|
|
|
echo "<actions>\n";
|
|
|
|
} else {
|
2010-02-16 01:06:03 +00:00
|
|
|
page_head(tra("Team history for %1", $team->name));
|
2007-07-27 18:30:10 +00:00
|
|
|
start_table();
|
|
|
|
echo "<tr>
|
2010-02-16 01:06:03 +00:00
|
|
|
<th>".tra("When")."</th>
|
|
|
|
<th>".tra("User")."</th>
|
|
|
|
<th>".tra("Action")."</th>
|
|
|
|
<th>".tra("Total credit at time of action")."</th>
|
2007-07-27 18:30:10 +00:00
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
2007-10-26 21:14:35 +00:00
|
|
|
$deltas = BoincTeamDelta::enum("teamid=$teamid order by timestamp");
|
|
|
|
foreach($deltas as $delta) {
|
2007-07-27 18:30:10 +00:00
|
|
|
show_delta($delta);
|
|
|
|
}
|
|
|
|
if ($xml) {
|
|
|
|
echo "</actions>\n";
|
|
|
|
} else {
|
|
|
|
end_table();
|
|
|
|
page_tail();
|
|
|
|
}
|
2007-11-07 17:23:29 +00:00
|
|
|
|
2007-07-27 18:30:10 +00:00
|
|
|
?>
|