Ticket #982: team_pages.diff
File team_pages.diff, 50.6 KB (added by , 14 years ago) |
---|
-
inc/team.inc
261 261 262 262 if ($offset > 0) { 263 263 $new_offset = $offset - $n; 264 echo "<a href=team_members.php?teamid=$team->id&sort_by=$sort_by&offset=$new_offset>".tra(' Last%1', $n)."</a> | ";264 echo "<a href=team_members.php?teamid=$team->id&sort_by=$sort_by&offset=$new_offset>".tra('Previous %1', $n)."</a> | "; 265 265 } 266 266 if ($j == $offset + $n + 1) { 267 267 $new_offset = $offset + $n; … … 358 358 } 359 359 echo " 360 360 <th>".tra('Country')."</th> 361 <th> Type</th>361 <th>".tra("Type")."</th> 362 362 </tr> 363 363 "; 364 364 } … … 407 407 echo "<input type=hidden name=teamid value=$team->id>\n"; 408 408 } 409 409 if ($team->seti_id) { 410 echo "<p><span class=error>WARNING: this is a BOINC-wide team. 411 If you make changes here, they will soon be overwritten. 412 Edit the 413 <a href=http://boinc.berkeley.edu/teams/>BOINC-wide team</a> 414 instead.</span> 410 echo "<p><span class=error>".tra("WARNING: this is a BOINC-wide team. If you make changes here, they will soon be overwritten. Edit the %1BOINC-wide team%2 instead.", "<a href=http://boinc.berkeley.edu/teams/>", "</a>") 411 ."</span> 415 412 <p> 416 413 "; 417 414 } … … 451 448 452 449 echo "</select></td></tr>\n"; 453 450 $x = $team->joinable?"checked":""; 454 row2( "Accept new members?", "<input type=checkbox name=joinable $x>");451 row2(tra("Accept new members?"), "<input type=checkbox name=joinable $x>"); 455 452 row2("", 456 453 "<input type=submit name=new value='$label'>" 457 454 ); -
user/team_admins.php
29 29 <td>$date</td> 30 30 <td> 31 31 "; 32 show_button("team_admins.php?teamid=$admin->teamid&action=remove&userid=$admin_user->id".$tokens, "Remove", "Remove Team Admin status from this member");32 show_button("team_admins.php?teamid=$admin->teamid&action=remove&userid=$admin_user->id".$tokens, tra("Remove"), tra("Remove Team Admin status from this member")); 33 33 echo "</td></tr> 34 34 "; 35 35 } 36 36 37 37 function show_admins($user, $teamid) { 38 page_head("Add or remove Team Admins"); 39 echo " 40 You can select team members as 'Team Admins'. 41 Team Admins can: 38 page_head(tra("Add or remove Team Admins")); 39 echo tra("You can select team members as 'Team Admins'. Team Admins can:")." 42 40 <ul> 43 <li> Edit team information (name, URL, description, country). 44 <li> View the team's join/quit history. 45 <li> Moderate the team forum, if any (admins get emails notification 46 of moderation events and red X reports). 41 <li>".tra("Edit team information (name, URL, description, country)")." 42 <li>".tra("View the team's join/quit history")." 43 <li>".tra("Moderate the team forum, if any (admins get email notification of moderation events and red X reports)")." 47 44 </ul> 48 Team Admins cannot:45 ".tra("Team Admins cannot:")." 49 46 <ul> 50 <li> Change the team founder.51 <li> Remove members.52 <li> Add or remove Team Admins.47 <li>".tra("Change the team founder")." 48 <li>".tra("Remove members")." 49 <li>".tra("Add or remove Team Admins")." 53 50 </ul> 54 If a Team Admin quits the team, they cease to be a Team Admin. 55 <p> 56 We recommend that you select only people 57 you know and trust very well as Team Admins. 58 "; 51 ".tra("If a Team Admin quits the team, they cease to be a Team Admin.")." 52 <br /><br />".tra("We recommend that you select only people you know and trust very well as Team Admins.") 53 ; 59 54 $admins = BoincTeamAdmin::enum("teamid=$teamid"); 60 55 start_table(); 61 56 if (count($admins)==0) { 62 row1( "There are currently no Team Admins");57 row1(tra("There are currently no Team Admins")); 63 58 } else { 64 row1( "Current Team Admins", 3);65 table_header( "Name", "Became Team Admin on", "");59 row1(tra("Current Team Admins"), 3); 60 table_header(tra("Name"), tra("Became Team Admin on"), ""); 66 61 foreach ($admins as $admin) { 67 62 show_admin($user, $admin); 68 63 } … … 77 72 "; 78 73 echo form_tokens($user->authenticator); 79 74 start_table(); 80 row1( "Add Team Admin");81 row2( "Email address of team member:", "<input name=email_addr>");82 row2("", "<input type=submit action value=\" Add\">");75 row1(tra("Add Team Admin")); 76 row2(tra("Email address of team member:"), "<input name=email_addr>"); 77 row2("", "<input type=submit action value=\"".tra("Add")."\">"); 83 78 end_table(); 84 79 echo "</form>"; 85 80 … … 90 85 $userid = get_int('userid'); 91 86 $ret = BoincTeamAdmin::delete("teamid=$team->id and userid=$userid"); 92 87 if (!$ret) { 93 error_page( "failed to remove admin");88 error_page(tra("failed to remove admin")); 94 89 } 95 90 } 96 91 97 92 function add_admin($team) { 98 93 $email_addr = get_str('email_addr'); 99 94 $user = BoincUser::lookup("email_addr='$email_addr'"); 100 if (!$user) error_page( "no such user");101 if ($user->teamid != $team->id) error_page( "User is not member of team");95 if (!$user) error_page(tra("no such user")); 96 if ($user->teamid != $team->id) error_page(tra("User is not member of team")); 102 97 if (is_team_admin($user, $team)) { 103 error_page( "$email_addr is already an admin of $team->name");98 error_page(tra("%1 is already an admin of %2", $email_addr, $team->name)); 104 99 } 105 100 $now = time(); 106 101 $ret = BoincTeamAdmin::insert("(teamid, userid, create_time) values ($team->id, $user->id, $now)"); 107 if (!$ret) error_page( "Couldn't add admin");102 if (!$ret) error_page(tra("Couldn't add admin")); 108 103 } 109 104 110 105 $user = get_logged_in_user(); 111 106 $teamid = get_int('teamid'); 112 107 $team = BoincTeam::lookup_id($teamid); 113 if (!$team) error_page( "No such team");108 if (!$team) error_page(tra("No such team")); 114 109 require_founder_login($user, $team); 115 110 116 111 $action = get_str('action', true); -
user/team_change_founder_action.php
25 25 $teamid = post_int("teamid"); 26 26 $team = BoincTeam::lookup_id($teamid); 27 27 if (!$team) { 28 error_page( "No such team");28 error_page(tra("no such team")); 29 29 } 30 30 require_founder_login($user, $team); 31 31 check_tokens($user->authenticator); … … 33 33 $userid = post_int("userid"); 34 34 $new_founder = BoincUser::lookup_id($userid); 35 35 if (!$new_founder || $new_founder->teamid != $team->id) { 36 error_page( "User is not a member of $team->name");36 error_page(tra("User is not a member of %1", $team->name)); 37 37 } 38 38 39 page_head( "Changing founder of $team->name");39 page_head(tra("Changing founder of %1", $team->name)); 40 40 $team->update("userid=$userid, ping_user=0"); 41 echo "$new_founder->name is now founder of $team->name";41 echo tra("%1 is now founder of %2", $new_founder->name, $team->name); 42 42 page_tail(); 43 43 44 44 ?> -
user/team_change_founder_form.php
28 28 $teamid = get_int("teamid"); 29 29 $team = BoincTeam::lookup_id($teamid); 30 30 if (!$team) { 31 error_page( "no such team");31 error_page(tra("no such team")); 32 32 } 33 33 require_founder_login($user, $team); 34 34 35 page_head( "Change founder of $team->name");35 page_head(tra("Change founder of %1", $team->name)); 36 36 37 37 if ($team->ping_user != 0) { 38 38 if ($team->ping_user < 0) { 39 39 $ping_user = BoincUser::lookup_id(-$team->ping_user); 40 40 $x = date_str($team->ping_time); 41 echo "<p>Team member ".user_links($ping_user)." requested this 42 team's foundership on $x, but left the team, thus canceling the request. 43 "; 41 echo "<p>".tra("Team member %1 requested this team's foundership on %2, but left the team, thus canceling the request.", user_links($ping_user), $x) 42 ."</p>"; 44 43 $team->update("ping_user=0, ping_time=0"); 45 44 } else { 46 45 $ping_user = BoincUser::lookup_id($team->ping_user); 47 46 $x = date_str(transfer_ok_time($team)); 48 echo "<p>Team member ".user_links($ping_user)." has requested this 49 team's foundership. 50 This may be because you left the team or haven't had contact 51 with the team for a long time. 52 "; 47 echo "<p>".tra("Team member %1 has requested this team's foundership. This may be because you left the team or haven't had contact with the team for a long time.", user_links($ping_user)) 48 ."</p>"; 53 49 echo "<p> 54 50 <form method=\"post\" action=\"team_founder_transfer_action.php\"> 55 51 <input type=\"hidden\" name=\"action\" value=\"decline\"> 56 52 <input type=\"hidden\" name=\"teamid\" value=\"".$team->id."\"> 57 To decline the request, <input type=\"submit\" value=\"click here\">53 <input type=\"submit\" value=\"".tra("decline request")."\"> 58 54 </form> 59 55 <p> 60 If you don't decline the request by $x, 61 $ping_user->name will have the option of 62 assuming team foundership. 63 <p> 64 To accept the request, assign foundership to $ping_user->name 65 using the form below. 66 <p> 56 ".tra("If you don't decline the request by %1, %2 will have the option of assuming team foundership.<br /><br /> 57 To accept the request, assign foundership to %3 using the form below.", $x, $ping_user->name, $ping_user->name)." 58 </p> 67 59 <hr> 68 60 <p> 69 61 "; 70 62 } 71 63 } else { 72 echo "No transfer request is pending.<p>";64 echo tra("No transfer request is pending.")."<br /><br />"; 73 65 } 74 66 75 echo " 76 To assign foundership of this team to another member, 77 check the box next to member name and click <b>Change founder</b> below. 78 <form method=post action=team_change_founder_action.php> 79 <input type=hidden name=teamid value=$team->id> 80 "; 67 echo tra("To assign foundership of this team to another member, check the box next to member name and click <strong>Change founder</strong> below.") 68 ."<form method=post action=team_change_founder_action.php> 69 <input type=hidden name=teamid value=$team->id>"; 81 70 echo form_tokens($user->authenticator); 82 71 83 72 start_table(); 84 73 echo "<tr> 85 <th> New founder?</th>86 <th> Name</th>87 <th> Total credit</th>88 <th> Recent average credit</th>74 <th>".tra("New founder?")."</th> 75 <th>".tra("Name")."</th> 76 <th>".tra("Total credit")."</th> 77 <th>".tra("Recent average credit")."</th> 89 78 </tr> 90 79 "; 91 80 … … 111 100 if ($navailable_users > 0) { 112 101 echo "<input type=hidden name=navailable_users value=$navailable_users>"; 113 102 end_table(); 114 echo "<input type=submit value=\" Change founder\">";103 echo "<input type=submit value=\"".tra("Change founder")."\">"; 115 104 } else { 116 105 echo '<tr> 117 <td colspan="4"> There are no users to transfer team to.</td>106 <td colspan="4">".tra("There are no users to transfer team to.")."</td> 118 107 </tr> 119 108 '; 120 109 end_table(); -
user/team_delta.php
61 61 if ($xml) { 62 62 xml_error("-1", "Not founder or admin"); 63 63 } else { 64 error_page( "Not founder or admin");64 error_page(tra("Not founder or admin")); 65 65 } 66 66 } 67 67 68 68 if ($xml) { 69 69 echo "<actions>\n"; 70 70 } else { 71 page_head( "Team history for $team->name");71 page_head(tra("Team history for %1", $team->name)); 72 72 start_table(); 73 73 echo "<tr> 74 <th> When</th>75 <th> User</th>76 <th> Action</th>77 <th> Total credit at time of action</th>74 <th>".tra("When")."</th> 75 <th>".tra("User")."</th> 76 <th>".tra("Action")."</th> 77 <th>".tra("Total credit at time of action")."</th> 78 78 </tr> 79 79 "; 80 80 } -
user/team_display.php
64 64 } 65 65 66 66 if (!$team) { 67 error_page( "No such team");67 error_page(tra("no such team")); 68 68 } 69 69 70 70 display_team_page($team, $user); -
user/team_edit_action.php
25 25 $teamid = post_int("teamid"); 26 26 $team = BoincTeam::lookup_id($teamid); 27 27 28 if (!$team) error_page( "no such team");28 if (!$team) error_page(tra("no such team")); 29 29 require_admin($user, $team); 30 30 31 31 $team_url = BoincDb::escape_string(strip_tags(post_str("url", true))); … … 48 48 $country = "International"; 49 49 } 50 50 if (!is_valid_country($country)) { 51 error_page( "bad country");51 error_page(tra("bad country")); 52 52 } 53 53 $joinable = post_str('joinable', true)?1:0; 54 54 55 55 $t = BoincTeam::lookup("name='$team_name'"); 56 56 if ($t && $t->id != $teamid) { 57 error_page( "The name '$team_name' is being used by another team.");57 error_page(tra("The name '%1' is being used by another team.", $team_name)); 58 58 } 59 59 if (strlen($team_name) == 0) { 60 error_page( "Must specify team name");60 error_page(tra("Must specify team name")); 61 61 // Should be caught up with the post_str("name"), 62 62 // but you can never be too safe. 63 63 } … … 85 85 if ($ret) { 86 86 Header("Location: team_display.php?teamid=$team->id"); 87 87 } else { 88 error_page( "Could not update team - please try later.");88 error_page(tra("Could not update team - please try again later.")); 89 89 } 90 90 91 91 ?> -
user/team_edit_form.php
24 24 25 25 $teamid = get_int("teamid"); 26 26 $team = BoincTeam::lookup_id($teamid); 27 if (!$team) error_page( "no such team");27 if (!$team) error_page(tra("no such team")); 28 28 require_admin($user, $team); 29 29 30 30 $team_name = strtr($team->name, '"', "'"); 31 page_head( "Edit ".$team_name);32 team_edit_form($team, "Update team info", "team_edit_action.php");31 page_head(tra("Edit %1", $team_name)); 32 team_edit_form($team, tra("Update team info"), "team_edit_action.php"); 33 33 page_tail(); 34 34 35 35 ?> -
user/team_email_list.php
49 49 $teamid = get_int("teamid"); 50 50 $plain = get_int("plain", true); 51 51 $team = BoincTeam::lookup_id($teamid); 52 if (!$team) error_page( "no such team");52 if (!$team) error_page(tra("no such team")); 53 53 require_founder_login($user, $team); 54 54 55 55 if ($plain) { 56 56 header("Content-type: text/plain"); 57 57 } else { 58 page_head( "$team->name Email List");58 page_head(tra("%1 Email List", $team->name)); 59 59 start_table(); 60 table_header(array( "Member list of ".$team->name, "colspan=\"6\""));61 table_header( "Name", "Email address", "Total credit", "Recent average credit", "Country");60 table_header(array(tra("Member list of %1", $team->name), "colspan=\"6\"")); 61 table_header(tra("Name"), tra("Email address"), tra("Total credit"), tra("Recent average credit"), tra("Country")); 62 62 } 63 63 $users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id"); 64 64 foreach($users as $user) { … … 72 72 } 73 73 if (!$plain) { 74 74 end_table(); 75 echo "<p><a href=\"team_email_list.php?teamid=".$teamid."&plain=1\"> Show as plain text</a></p>";75 echo "<p><a href=\"team_email_list.php?teamid=".$teamid."&plain=1\">".tra("Show as plain text")."</a></p>"; 76 76 page_tail(); 77 77 } 78 78 -
user/team_forum.php
23 23 require_once("../inc/forum_db.inc"); 24 24 25 25 function create_confirm($user, $team) { 26 page_head("Create Message Board"); 27 echo " 28 You may create a Message Board for use by $team->name. 26 page_head(tra("Create Message Board")); 27 echo tra("You may create a message board for use by %1.", $team->name)." 29 28 <ul> 30 <li> Only team members will be able to post.31 <li> At your option, only members will be able to read.32 <li> You and your Team Admins will have moderator privileges.29 <li>".tra("Only team members will be able to post.")." 30 <li>".tra("At your option, only members will be able to read.")." 31 <li>".tra("You and your Team Admins will have moderator privileges.")." 33 32 </ul> 34 33 "; 35 34 $tokens = url_tokens($user->authenticator); 36 35 show_button( 37 36 "team_forum.php?teamid=$team->id&cmd=create$tokens", 38 "Create Message Board",39 "Create a Message Board for $team->name"37 tra("Create Message Board"), 38 tra("Create a message board for %1", $team->name) 40 39 ); 41 40 page_tail(); 42 41 } … … 44 43 function create_forum($user, $team) { 45 44 $f = BoincForum::lookup("parent_type=1 and category=$team->id"); 46 45 if ($f) { 47 error_page( "Team already has a forum");46 error_page(tra("Team already has a message board")); 48 47 } 49 48 $id = BoincForum::insert("(category, parent_type) values ($team->id, 1)"); 50 49 $forum = BoincForum::lookup_id($id); 51 50 if (!$forum) { 52 error_page( "couldn't create forum");51 error_page(tra("couldn't create message board")); 53 52 } 54 53 edit_form($user, $team, $forum, true); 55 54 } 56 55 57 56 function edit_form($user, $team, $forum, $first) { 58 page_head( "Team forum");57 page_head(tra("Team Message Board")); 59 58 echo " 60 59 <form action=team_forum.php method=post> 61 60 <input type=hidden name=teamid value=$team->id> … … 64 63 echo form_tokens($user->authenticator); 65 64 start_table(); 66 65 if (!strlen($forum->title)) $forum->title = $team->name; 67 if (!strlen($forum->description)) $forum->description = "Discussion among members of $team->name";68 row2( "Title", "<input name=title value=\"$forum->title\">");69 row2( "Description", "<textarea name=description>$forum->description</textarea>");70 row2( "Minimum time between posts (seconds)",66 if (!strlen($forum->description)) $forum->description = tra("Discussion among members of %1", $team->name); 67 row2(tra("Title"), "<input name=title value=\"$forum->title\">"); 68 row2(tra("Description"), "<textarea name=description>$forum->description</textarea>"); 69 row2(tra("Minimum time between posts (seconds)"), 71 70 "<input name=post_min_interval value=$forum->post_min_interval>" 72 71 ); 73 row2( "Minimum total credit to post",72 row2(tra("Minimum total credit to post"), 74 73 "<input name=post_min_total_credit value=$forum->post_min_total_credit>" 75 74 ); 76 row2( "Minimum average credit to post",75 row2(tra("Minimum average credit to post"), 77 76 "<input name=post_min_expavg_credit value=$forum->post_min_expavg_credit>" 78 77 ); 79 row2("", "<input type=submit value= OK>");78 row2("", "<input type=submit value=".tra("Submit").">"); 80 79 end_table(); 81 80 echo " 82 81 </form> … … 85 84 echo " 86 85 <p> 87 86 <a href=team_forum.php?teamid=$team->id&cmd=remove_confirm$tokens> 88 Remove your team's message board.</a>87 ".tra("Remove your team's message board.")."</a> 89 88 "; 90 89 } 91 90 page_tail(); … … 93 92 94 93 function remove_confirm($user, $team) { 95 94 $tokens = url_tokens($user->authenticator); 96 page_head("Really remove message board?"); 97 echo " 98 Are you sure you want to remove your team's message board? 99 All threads and posts will be permanently removed. 100 (You may, however, create a new message board later). 101 <p> 102 <a href=team_forum.php?teamid=$team->id&cmd=remove>Yes - remove message board</a> 95 page_head(tra("Really remove message board?")); 96 echo tra("Are you sure you want to remove your team's message board? All threads and posts will be permanently removed. (You may, however, create a new message board later).") 97 ."<br /><br /> 98 <a href=team_forum.php?teamid=$team->id&cmd=remove>".tra("Yes - remove message board")."</a> 103 99 "; 104 100 page_tail(); 105 101 } 106 102 107 103 function remove($team) { 108 104 $forum = BoincForum::lookup("parent_type=1 and category=$team->id"); 109 if (!$forum) error_page( "not found");105 if (!$forum) error_page(tra("message board not found")); 110 106 111 107 // delete threads and posts 112 108 // … … 120 116 } 121 117 $forum->delete(); 122 118 123 page_head("Message board removed"); 119 page_head(tra("Message board removed")); 120 echo tra("<p>".tra("Your teams message board has been removed. You may now %1create a new one%2."), "<a href=team_forum.php?teamid=$team->id&cmd=manage>", "</a>") 121 ."</p>"; 124 122 page_tail(); 125 123 } 126 124 … … 134 132 $post_min_expavg_credit = post_int('post_min_expavg_credit'); 135 133 $ret = $forum->update("title='$title', description='$description', post_min_interval=$post_min_interval, post_min_total_credit=$post_min_total_credit, post_min_expavg_credit=$post_min_expavg_credit"); 136 134 if ($ret) { 137 page_head( "Team Message Board Updated");138 echo "Update successful";135 page_head(tra("Team Message Board Updated")); 136 echo tra("Update successful"); 139 137 page_tail(); 140 138 } else { 141 error_page( "update failed");139 error_page(tra("Update failed")); 142 140 } 143 141 } 144 142 145 143 function show_forum($team) { 146 144 $forum = BoincForum::lookup("parent_type=1 and category=$team->id"); 147 145 if (!$forum) { 148 error_page( "team has no forum");146 error_page(tra("team has no forum")); 149 147 } 150 148 Header("Location: forum_forum.php?id=$forum->id"); 151 149 } … … 155 153 156 154 $team = BoincTeam::lookup_id($teamid); 157 155 if (!$team) { 158 error_page( "no such team");156 error_page(tra("no such team")); 159 157 } 160 158 161 159 $cmd = get_str('cmd', true); … … 180 178 require_founder_login($user, $team); 181 179 check_tokens($user->authenticator); 182 180 $forum = BoincForum::lookup("parent_type=1 and category=$teamid"); 183 if (!$forum) error_page( "no forum");181 if (!$forum) error_page(tra("no such forum")); 184 182 edit_action($forum); 185 183 } else if ($cmd == "remove_confirm") { 186 184 $user = get_logged_in_user(); … … 191 189 require_founder_login($user, $team); 192 190 remove($team); 193 191 } else if ($cmd != "") { 194 error_page( "unknown command $cmd");192 error_page(tra("unknown command %1", $cmd)); 195 193 } else { 196 194 show_forum($team); 197 195 } -
user/team_founder_transfer_action.php
16 16 // You should have received a copy of the GNU Lesser General Public License 17 17 // along with BOINC. If not, see <http://www.gnu.org/licenses/>. 18 18 19 // action = 'transfer': 20 // handle a user's request to initiate a foundership transfer 19 // action = 'initiate_transfer': 20 // handle a user's request to initiate a foundership transfer 21 // action = 'finalize_transfer': 22 // handle a user's request to finalize a foundership transfer 21 23 // action = 'decline': 22 24 // handle the current founder's declining of the request 23 25 … … 29 31 30 32 $user = get_logged_in_user(); 31 33 if (!$user->teamid) { 32 error_page( "You must be a member of a team to access this page.");34 error_page(tra("You must be a member of a team to access this page.")); 33 35 } 34 36 35 37 function send_founder_transfer_email($team, $user) { … … 83 85 $team = BoincTeam::lookup_id($user->teamid); 84 86 $now = time(); 85 87 if (new_transfer_request_ok($team, $now)) { 86 page_head( "Requesting foundership of ".$team->name);88 page_head(tra("Requesting foundership of %1", $team->name)); 87 89 $success = send_founder_transfer_email($team, $user); 88 90 89 91 // Go ahead with the transfer even if the email send fails. … … 91 93 // whose founder email is invalid 92 94 // 93 95 $team->update("ping_user=$user->id, ping_time=$now"); 94 echo "<p> 95 The current founder has been notified of your request by email 96 and private message. 97 <p> 98 If the founder does not respond within 60 days you will be 99 allowed to become the founder. 100 <p> 101 "; 96 echo "<p>".tra("The current founder has been notified of your request by email and private message.<br /><br /> 97 If the founder does not respond within 60 days you will be allowed to become the founder.") 98 ."</p>\n"; 102 99 } else { 103 error_page( "Foundership request not allowed now");100 error_page(tra("Foundership request not allowed now")); 104 101 } 105 102 break; 106 103 case "finalize_transfer": 107 104 $team = BoincTeam::lookup_id($user->teamid); 108 105 $now = time(); 109 106 if ($user->id == $team->ping_user && transfer_ok($team, $now)) { 110 page_head( "Assumed foundership of ".$team->name);107 page_head(tra("Assumed foundership of %1", $team->name)); 111 108 $team->update("userid=$user->id, ping_user=0, ping_time=0"); 112 echo " 113 Congratulations, you are now the founder of team ".$team->name." 114 Go to <a href=\"".URL_BASE."home.php\">Your Account page</a> 115 to find the Team Admin options. 116 "; 109 echo tra("Congratulations, you are now the founder of team %1. Go to %2Your Account page%3 to find the Team Admin options.", $team->name, "<a href=\"".URL_BASE."home.php\">", "</a>"); 117 110 } else { 118 error_page( "Foundership request not allowed now");111 error_page(tra("Foundership request not allowed now")); 119 112 } 120 113 break; 121 114 case "decline": 122 115 $teamid = post_int("teamid"); 123 116 $team = lookup_team($teamid); 124 117 require_founder_login($user, $team); 125 page_head( "Decline founder change request");118 page_head(tra("Decline founder change request")); 126 119 127 120 if ($team->ping_user) { 128 121 $ping_user = BoincUser::lookup_id($team->ping_user); 129 122 130 123 $team->update("ping_user=0"); 131 124 send_founder_transfer_decline_email($team, $ping_user); 132 echo "<p>The foundership request from ".user_links($ping_user) 133 ." has been declined. 134 "; 125 echo "<p>".tra("The foundership request from %1 has been declined.", user_links($ping_user)) 126 ."</p>"; 135 127 } else { 136 echo "<p> There were no foundership requests.";128 echo "<p>".tra("There were no foundership requests.")."</p>"; 137 129 } 138 130 break; 139 131 default: 140 error_page( "undefined action $action");132 error_page(tra("undefined action %1", $action)); 141 133 } 142 134 143 echo "<a href='team_display.php?teamid=$team->id'> Return to team page</a>";135 echo "<a href='team_display.php?teamid=$team->id'>".tra("Return to team page")."</a>"; 144 136 145 137 page_tail(); 146 138 -
user/team_founder_transfer_form.php
23 23 $user = get_logged_in_user(); 24 24 $team = BoincTeam::lookup_id($user->teamid); 25 25 if (!$team) { 26 error_page( "You need to be a member of a team to access this page.");26 error_page(tra("You need to be a member of a team to access this page.")); 27 27 } 28 28 29 page_head( "Request foundership of $team->name");29 page_head(tra("Request foundership of %1", $team->name)); 30 30 $now = time(); 31 31 32 32 // it should never happen, but just in case 33 33 // 34 34 if (!$team->userid) { 35 35 $team->update("userid=$user->id, ping_user=0, ping_time=0"); 36 echo "You are now founder of team $team->name.";36 echo tra("You are now founder of team %1.", $team->name); 37 37 page_tail(); 38 38 exit; 39 39 } 40 40 41 41 if ($user->id == $team->ping_user) { 42 echo "<p>You requested the foundership of $team->name 43 on ".date_str($team->ping_time).". 44 "; 42 echo "<p>".tra("You requested the foundership of %1 on %2.", $team->name, date_str($team->ping_time))." 43 </p>"; 45 44 if (transfer_ok($team, $now)) { 46 echo " 47 60 days have elapsed since your request, 48 and the founder has not responded. 49 You may now assume foundership by clicking here: 50 <form method=\"post\" action=\"team_founder_transfer_action.php\"> 45 echo tra("60 days have elapsed since your request, and the founder has not responded. You may now assume foundership by clicking here:") 46 ."<form method=\"post\" action=\"team_founder_transfer_action.php\"> 51 47 <input type=\"hidden\" name=\"action\" value=\"finalize_transfer\"> 52 <input type=\"submit\" value=\" Assume foundership\">48 <input type=\"submit\" value=\"".tra("Assume foundership")."\"> 53 49 </form> 54 50 "; 55 51 } else { 56 echo "<p> 57 The founder was notified of your request. 58 If he/she does not respond by ".date_str(transfer_ok_time($team))." 59 you will be given an option to become founder. 60 "; 52 echo "<p>".tra("The founder was notified of your request. If he/she does not respond by %1 you will be given an option to become founder.", date_str(transfer_ok_time($team))) 53 ."</p>"; 61 54 } 62 55 } else { 63 56 if (new_transfer_request_ok($team, $now)) { 64 57 echo "<form method=\"post\" action=\"team_founder_transfer_action.php\">"; 65 echo "<p>If the team founder is not active and you want to assume 66 the role of founder, click the button below. 67 The current founder will be sent an email detailing your request, 68 and will be able to transfer foundership to you 69 or to decline your request. 70 If the founder does not respond in 60 days, 71 you will be allowed to become the founder. 72 <p> 73 Are you sure you want to request foundership? 74 "; 58 echo "<p>".tra("If the team founder is not active and you want to assume the role of founder, click the button below. The current founder will be sent an email detailing your request, and will be able to transfer foundership to you or to decline your request. If the founder does not respond in 60 days, you will be allowed to become the founder.<br /><br /> 59 Are you sure you want to request foundership?") 60 ."</p>"; 75 61 76 62 echo "<input type=\"hidden\" name=\"action\" value=\"initiate_transfer\"> 77 <input type=\"submit\" value=\" Request foundership\">63 <input type=\"submit\" value=\"".tra("Request foundership")."\"> 78 64 </form> 79 65 "; 80 66 } else { … … 83 69 $team->ping_user = -$team->ping_user; 84 70 } 85 71 $ping_user = BoincUser::lookup_id($team->ping_user); 86 echo "<p>Founder change has already been requested by ". 87 user_links($ping_user)." on ".date_str($team->ping_time).". 88 "; 72 echo "<p>".tra("Founder change has already been requested by %1 on %2.", user_links($ping_user), date_str($team->ping_time)) 73 ."</p>"; 89 74 } else { 90 echo "<p>A foundership change was requested during the last 90 days, 91 so new requests are not allowed. 92 Please try again later. 93 "; 75 echo "<p>".tra("A foundership change was requested during the last 90 days, so new requests are not allowed. Please try again later.") 76 ."</p>"; 94 77 } 95 78 } 96 79 } 97 80 98 echo "<p><a href=\"team_display.php?teamid=".$team->id."\"> Return to team page</a>";81 echo "<p><a href=\"team_display.php?teamid=".$team->id."\">".tra("Return to team page")."</a>"; 99 82 100 83 page_tail(); 101 84 -
user/team_join_action.php
27 27 $team = BoincTeam::lookup_id($teamid); 28 28 require_team($team); 29 29 if (!$team->joinable) { 30 error_page( "The team is not joinable.");30 error_page(tra("The team %1 is not joinable.", $team->name)); 31 31 } 32 32 if ($user->teamid == $team->id) { 33 page_head( "Unable to add $user->name");34 echo "You are already a member of $team->name.";33 page_head(tra("Already a member")); 34 echo tra("You are already a member of %1.", $team->name); 35 35 } else { 36 36 $success = user_join_team($team, $user); 37 37 if ($success) { 38 page_head("Joined $team->name"); 39 echo "You have joined 40 <a href=team_display.php?teamid=$team->id>$team->name</a>. 41 "; 38 page_head(tra("Joined %1", $team->name)); 39 echo tra("You have joined %1.", "<a href=team_display.php?teamid=$team->id>$team->name</a>"); 42 40 } else { 43 error_page( "Couldn't join team - please try later.");41 error_page(tra("Couldn't join team - please try again later.")); 44 42 } 45 43 } 46 44 -
user/team_join_form.php
26 26 27 27 $team = lookup_team($teamid); 28 28 if (!$team->joinable) { 29 error_page( "The team is not joinable.");29 error_page(tra("The team %1 is not joinable.", $team->name)); 30 30 } 31 31 $team_name = $team->name; 32 page_head( "Join $team_name");33 echo " <p><b> Please note:</b>32 page_head(tra("Join %1", $team_name)); 33 echo " <p><b>".tra("Please note:")."</b> 34 34 <ul> 35 <li> Joining a team gives its founder access to your email address.36 <li> Joining a team does not affect your account's credit.35 <li>".tra("Joining a team gives its founder access to your email address.")." 36 <li>".tra("Joining a team does not affect your account's credit.")." 37 37 </ul> 38 38 <hr> 39 39 <form method=\"post\" action=\"team_join_action.php\">"; 40 40 echo form_tokens($user->authenticator); 41 41 echo " 42 42 <input type=\"hidden\" name=\"teamid\" value=\"$teamid\"> 43 <input type=\"submit\" value=\" Join team\">43 <input type=\"submit\" value=\"".tra("Join team")."\"> 44 44 </form> 45 45 "; 46 46 page_tail(); -
user/team_join.php
27 27 $team = BoincTeam::lookup_id($teamid); 28 28 require_team($team); 29 29 if (!$team->joinable) { 30 error_page( "The team is not joinable.");30 error_page(tra("The team %1 is not joinable.", $team->name)); 31 31 } 32 32 if ($user->teamid == $team->id) { 33 page_head( "Already a member");34 echo "You are already a member of $team->name.";33 page_head(tra("Already a member")); 34 echo tra("You are already a member of %1.", $team->name); 35 35 } else { 36 36 $success = user_join_team($team, $user); 37 37 if ($success) { 38 38 Header("Location: home.php"); 39 39 } else { 40 error_page( "Couldn't join team - please try later.");40 error_page(tra("Couldn't join team - please try again later.")); 41 41 } 42 42 } 43 43 -
user/team_lookup.php
59 59 exit(); 60 60 } 61 61 62 page_head( "Search Results");62 page_head(tra("Search Results")); 63 63 if (count($teams)) { 64 echo "<h2> Search results for '".strip_tags($team_name)."'</h2>";64 echo "<h2>".tra("Search results for '%1'", strip_tags($team_name))."</h2>"; 65 65 echo "<p>"; 66 echo "You may view these teams' members, statistics, and information.";66 echo tra("You may view these teams' members, statistics, and information."); 67 67 echo "<ul>"; 68 68 foreach($teams as $team) { 69 69 echo "<li>"; … … 72 72 } 73 73 echo "</ul>"; 74 74 if (count($teams)==100) { 75 echo " 76 More than 100 teams match your search. 77 The first 100 are shown.<br> 78 "; 75 echo tra("More than 100 teams match your search. The first 100 are shown.") 76 ."<br>\n"; 79 77 } 80 78 } 81 echo "End of results<br>"; 82 echo "If you cannot find the team you are looking for, you may create a team "; 83 echo "by clicking <a href=team_create_form.php>here</a>."; 79 echo tra("End of results<br> 80 If you cannot find the team you are looking for, you may %1create a team%2 by yourself.", "<a href=team_create_form.php>", "</a>"); 84 81 page_tail(); 85 82 86 83 ?> -
user/team_manage.php
21 21 require_once("../inc/team.inc"); 22 22 23 23 function show_admin_page($user, $team) { 24 page_head( "Team administration for $team->name");24 page_head(tra("Team administration for %1", $team->name)); 25 25 echo " 26 26 <ul> 27 <li><a href=team_edit_form.php?teamid=$team->id> Edit team info</a>28 <br><span class=note> Change team name, URL, description, type, or country</span>27 <li><a href=team_edit_form.php?teamid=$team->id>".tra("Edit team info")."</a> 28 <br><span class=note>".tra("Change team name, URL, description, type, or country")."</span> 29 29 <li> 30 Member list:31 <a href=team_email_list.php?teamid=$team->id> HTML</a>32 | <a href=team_email_list.php?teamid=$team->id&plain=1> text</a>33 <br><span class=note> View member names and email addresses</span>34 <li> View change history:35 <a href=team_delta.php?teamid=$team->id> HTML</a>36 | <a href=team_delta.php?teamid=$team->id&xml=1> XML</a>37 <br><span class=note> See when members joined or quit this team</span>30 ".tra("Member list:")." 31 <a href=team_email_list.php?teamid=$team->id>".tra("HTML")."</a> 32 | <a href=team_email_list.php?teamid=$team->id&plain=1>".tra("text")."</a> 33 <br><span class=note>".tra("View member names and email addresses")."</span> 34 <li>".tra("View change history:")." 35 <a href=team_delta.php?teamid=$team->id>".tra("HTML")."</a> 36 | <a href=team_delta.php?teamid=$team->id&xml=1>".tra("XML")."</a> 37 <br><span class=note>".tra("See when members joined or quit this team")."</span> 38 38 "; 39 39 40 40 // founder-only stuff follows … … 45 45 $user2 = BoincUser::lookup_id($team->ping_user); 46 46 $deadline = date_str(transfer_ok_time($team)); 47 47 echo "<li> 48 <a href=team_change_founder_form.php?teamid=$team->id><font color=red>< b>Respond to foundership request</b></font></a>. If you don't respond by $deadline, $user2->name may assume foundership of this team.49 ";48 <a href=team_change_founder_form.php?teamid=$team->id><font color=red><strong>".tra("Respond to foundership request.")."</strong></font></a> ".tra("If you don't respond by %1, %2 may assume foundership of this team.", $deadline, $user2->name) 49 ; 50 50 } 51 51 echo " 52 <li><a href=team_remove_inactive_form.php?teamid=$team->id> Remove members</a>53 <br><span class=note> Remove inactive or unwanted members from this team</span>54 <li><a href=team_change_founder_form.php?teamid=$team->id> Change founder</a>55 <br><span class=note> Transfer foundership to another member</span>56 <li><a href=team_admins.php?teamid=$team->id> Add/remove Team Admins</a>57 <br><span class=note> Give selected team members Team Admin privileges</span>52 <li><a href=team_remove_inactive_form.php?teamid=$team->id>".tra("Remove members")."</a> 53 <br><span class=note>".tra("Remove inactive or unwanted members from this team")."</span> 54 <li><a href=team_change_founder_form.php?teamid=$team->id>".tra("Change founder")."</a> 55 <br><span class=note>".tra("Transfer foundership to another member")."</span> 56 <li><a href=team_admins.php?teamid=$team->id>".tra("Add/remove Team Admins")."</a> 57 <br><span class=note>".tra("Give selected team members Team Admin privileges")."</span> 58 58 59 <li><a href=team_manage.php?teamid=$team->id&action=delete&$tokens> Remove team</a>60 <br><span class=note> Allowed only if team has no members</a>61 <li><a href=team_forum.php?teamid=$team->id&cmd=manage> Message board</a>62 <br><span class=note> Create or manage team message board</span>59 <li><a href=team_manage.php?teamid=$team->id&action=delete&$tokens>".tra("Remove team")."</a> 60 <br><span class=note>".tra("Allowed only if team has no members")."</a> 61 <li><a href=team_forum.php?teamid=$team->id&cmd=manage>".tra("Message board")."</a> 62 <br><span class=note>".tra("Create or manage a team message board")."</span> 63 63 "; 64 64 } 65 65 echo " 66 66 67 67 <p> 68 68 <li> 69 To have this team created on all BOINC projects 70 (current and future) you can make it into a 71 <a href=http://boinc.berkeley.edu/teams/>BOINC-wide team</a>. 69 ".tra("To have this team created on all BOINC projects (current and future) you can make it into a %1BOINC-wide team%2.", "<a href=http://boinc.berkeley.edu/teams/>", "</a>")." 72 70 <li> 73 Team admins are encouraged to join and participate in the Google 74 <a href=http://groups.google.com/group/boinc-team-founders>boinc-team-founders</a> group. 71 ".tra("Team admins are encouraged to join and participate in the Google %1boinc-team-founders%2 group.", "<a href=http://groups.google.com/group/boinc-team-founders>", "</a>")." 75 72 <li> 76 Other resources for BOINC team admins 77 are available from a third-party site, 78 <a href=http://www.boincteams.com>www.boincteams.com</a>. 73 ".tra("Other resources for BOINC team admins are available from a third-party site, %1www.boincteams.com%2.", "<a href=http://www.boincteams.com>", "</a>")." 79 74 </ul> 80 75 "; 81 76 … … 85 80 $user = get_logged_in_user(true); 86 81 $teamid = get_int('teamid'); 87 82 $team = BoincTeam::lookup_id($teamid); 88 if (!$team) error_page( "no such team");83 if (!$team) error_page(tra("no such team")); 89 84 90 85 $action = get_str('action', true); 91 86 if ($action == 'delete') { 92 87 require_founder_login($user, $team); 93 88 if (team_count_members($team->id) > 0) { 94 error_page( "Can't delete non-empty team");89 error_page(tra("Can't delete non-empty team")); 95 90 } 96 91 check_tokens($user->authenticator); 97 92 $team->delete(); 98 page_head( "Team $team->name deleted");93 page_head(tra("Team %1 deleted", $team->name)); 99 94 page_tail(); 100 95 } else { 101 96 require_admin($user, $team); -
user/team_members.php
30 30 if (!$offset) $offset=0; 31 31 32 32 if ($offset > 1000) { 33 error_page( "Limit exceeded: Can only display the first 1000 members.");33 error_page(tra("Limit exceeded: Can only display the first 1000 members.")); 34 34 } 35 35 36 36 $teamid = get_int("teamid"); … … 40 40 41 41 $team = BoincTeam::lookup_id($teamid); 42 42 43 page_head( "Members of <a href=team_display.php?teamid=$teamid>$team->name</a>");43 page_head(tra("Members of %1", "<a href=team_display.php?teamid=$teamid>$team->name</a>")); 44 44 display_team_members($team, $offset, $sort_by); 45 45 page_tail(); 46 46 -
user/team_quit_action.php
29 29 user_quit_team($user); 30 30 Header("Location: home.php"); 31 31 } else { 32 page_head( "Unable to quit team");33 echo "Team doesn't exist, or you don't belong to it.\n";32 page_head(tra("Unable to quit team")); 33 echo tra("Team doesn't exist, or you don't belong to it."); 34 34 } 35 35 36 36 page_tail(); -
user/team_quit_form.php
25 25 26 26 $team = lookup_team($user->teamid); 27 27 if (!$team) { 28 error_page( "No such team");28 error_page(tra("No such team")); 29 29 } 30 30 31 page_head("Quit $team->name"); 32 echo " 33 <b>Please note before quitting a team:</b> 34 <ul> 35 <li>If you quit a team, you may rejoin later, 36 or join any other team you desire 37 <li>Quitting a team does not affect your personal credit 38 statistics in any way. 39 </ul> 40 </p> 41 <form method=\"post\" action=\"team_quit_action.php\">"; 31 page_head(tra("Quit %1", $team->name)); 32 echo tra("<strong>Please note before quitting a team:</strong> 33 <ul> 34 <li>If you quit a team, you may rejoin later, or join any other team you desire 35 <li>Quitting a team does not affect your personal credit statistics in any way. 36 </ul>") 37 ."<form method=\"post\" action=\"team_quit_action.php\">"; 42 38 echo form_tokens($user->authenticator); 43 39 echo "<input type=\"hidden\" name=\"id\" value=\"$team->id\"> 44 <input type=\"submit\" value=\" Quit Team\">40 <input type=\"submit\" value=\"".tra("Quit Team")."\"> 45 41 </form> 46 42 "; 47 43 page_tail(); -
user/team_remove_inactive_action.php
23 23 $user = get_logged_in_user(); 24 24 $teamid = post_int("id"); 25 25 $team = BoincTeam::lookup_id($teamid); 26 if (!$team) error_page( "No such team");26 if (!$team) error_page(tra("No such team")); 27 27 require_founder_login($user, $team); 28 28 29 page_head( "Removing users from $team->name");29 page_head(tra("Removing users from %1", $team->name)); 30 30 $ndel = 0; 31 31 for ($i=0; $i<$_POST["ninactive_users"]; $i++) { 32 32 $userid = post_int("remove_$i", true); … … 34 34 $user = BoincUser::lookup_id($userid); 35 35 if (!$user) continue; 36 36 if ($user->teamid != $team->id) { 37 echo "<br >$user->name is not a member of $team->name";37 echo "<br />".tra("%1 is not a member of %2", $user->name, $team->name); 38 38 } else { 39 39 user_quit_team($user); 40 echo "<br >$user->name has been removed";40 echo "<br />".tra("%1 has been removed", $user->name); 41 41 $ndel++; 42 42 } 43 43 } -
user/team_remove_inactive_form.php
27 27 $team = BoincTeam::lookup_id($teamid); 28 28 if (!$team) error_page("no such team"); 29 29 require_admin($logged_in_user, $team); 30 page_head( "Remove members from $team->name");30 page_head(tra("Remove members from %1", $team->name)); 31 31 echo " 32 32 <form method=\"post\" action=\"team_remove_inactive_action.php\"> 33 33 <input type=\"hidden\" name=\"id\" value=\"".$team->id."\"> 34 34 "; 35 35 start_table(); 36 36 echo "<tr> 37 <th> Remove?</th>38 <th> Name (ID)</th>39 <th> Total credit</th>40 <th> Recent average credit</th>37 <th>".tra("Remove?")."</th> 38 <th>".tra("Name (ID)")."</th> 39 <th>".tra("Total credit")."</th> 40 <th>".tra("Recent average credit")."</th> 41 41 </tr> 42 42 "; 43 43 … … 60 60 } 61 61 end_table(); 62 62 if ($ninactive_users == 0) { 63 echo "<p> No members are eligible for removal.";63 echo "<p>".tra("No members are eligible for removal.")."</p>"; 64 64 } else { 65 65 echo "<input type=hidden name=ninactive_users value=$ninactive_users>"; 66 echo "<input type=submit value=\" Remove users\">";66 echo "<input type=submit value=\"".tra("Remove users")."\">"; 67 67 } 68 68 echo "</form>"; 69 69 page_tail(); -
user/team_search.php
62 62 start_table(); 63 63 echo " 64 64 <tr> 65 <th> Team name</th>66 <th> Description</th>67 <th> Average credit</th>68 <th> Type</th>69 <th> Country</th>65 <th>".tra("Team name")."</th> 66 <th>".tra("Description")."</th> 67 <th>".tra("Average credit")."</th> 68 <th>".tra("Type")."</th> 69 <th>".tra("Country")."</th> 70 70 </tr> 71 71 "; 72 72 $i = 0; … … 124 124 } 125 125 126 126 if (sizeof($list) == 0) { 127 echo " 128 No teams were found matching your criteria. 129 Try another search. 130 <p> 131 Or you can <a href=team_create_form.php>create a new team</a>. 132 <p> 133 "; 127 echo tra("No teams were found matching your criteria. Try another search.") 128 ."<p>" 129 .tra("Or you can %1create a new team%2.", "<a href=team_create_form.php>", "</a>") 130 ."</p>\n"; 134 131 team_search_form($params); 135 132 } else { 136 echo " 137 The following teams match one or more of your search criteria. 133 echo tra("The following teams match one or more of your search criteria. 138 134 To join a team, click its name to go to the team page, 139 then click <b>Join this team</b>.140 <p>135 then click %1Join this team%2.", "<strong>", "</strong>") 136 ."<p> 141 137 "; 142 138 sort_list($list); 143 139 show_list($list); 144 echo "<h2> Change your search</h2>";140 echo "<h2>".tra("Change your search")."</h2>"; 145 141 team_search_form($params); 146 142 } 147 143 } … … 153 149 $params->country = $_GET['country']; 154 150 $params->type = $_GET['type']; 155 151 $params->active = get_str('active', true); 156 page_head( "Team search results");152 page_head(tra("Team search results")); 157 153 search($params); 158 154 } else { 159 page_head("Find a team", 'document.form.keywords.focus()'); 160 echo " 161 You can team up with other people with similar interests, 162 or from the same country, company, or school. 163 <p> 164 Use this form to find teams that might be right for you. 165 <p> 166 "; 155 page_head(tra("Find a team"), 'document.form.keywords.focus()'); 156 echo tra("You can team up with other people with similar interests, or from the same country, company, or school.") 157 ."<p>" 158 .tra("Use this form to find teams that might be right for you.") 159 ."</p>\n"; 167 160 team_search_form($params); 168 161 if (isset($_COOKIE['init'])) { 169 echo " 170 <p> 171 <a href=home.php>Click here</a> 172 if you're not interested in joining a team right now. 173 "; 162 echo "<p> 163 ".tra("%1I'm not interested%2 in joining a team right now.", "<a href=home.php>", "</a>"); 174 164 } 175 165 } 176 166 page_tail();