[opw-web] view_participants: show accepted students as "Intern" not "Applicant"
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] view_participants: show accepted students as "Intern" not "Applicant"
- Date: Sun, 14 Jun 2015 17:56:33 +0000 (UTC)
commit 9f66b68014ba9cad1db5ec8d7bb832af79cd8569
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Sun Jun 14 13:33:28 2015 -0400
view_participants: show accepted students as "Intern" not "Applicant"
lang/en-gb.php | 1 +
modules/mod_view_participants.php | 2 +-
utils.php | 7 +++++++
3 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/lang/en-gb.php b/lang/en-gb.php
index ac905cc..587f6ff 100644
--- a/lang/en-gb.php
+++ b/lang/en-gb.php
@@ -325,6 +325,7 @@ $lang_data = array(
'accepted_participants' => 'Accepted participants',
'role' => 'Role',
'role_s' => 'Applicant',
+ 'role_s_accepted' => 'Intern',
'role_r' => 'Resigned applicant',
'role_x' => 'Rejected mentor',
'role_m' => 'Mentor',
diff --git a/modules/mod_view_participants.php b/modules/mod_view_participants.php
index f06ee7b..4f8585e 100644
--- a/modules/mod_view_participants.php
+++ b/modules/mod_view_participants.php
@@ -79,7 +79,7 @@ foreach ($list_data as $row)
$list[] = array(
'username' => $row['username'],
'profile' => $user->profile($row['username'], true, $row['fullname']),
- 'role' => $lang->get('role_' . $row['role']),
+ 'role' => get_role_string($row['role'], $row['project_id'] != null),
'projects' => $project,
'any_accepted' => $row['is_accepted'] == 1,
'contract_approved' => $row['contract_approved'],
diff --git a/utils.php b/utils.php
index a94814f..f3de71c 100644
--- a/utils.php
+++ b/utils.php
@@ -254,4 +254,11 @@ function get_project_permissions($program_data, $role, $project_data) {
return new ProjectPermissions($program_data, $role, $project_data);
}
+function get_role_string($role, $has_project) {
+ global $lang;
+
+ $role_key = ($has_project and $role == 's') ? 'role_s_accepted' : ('role_' . $role);
+ return $lang->get($role_key);
+}
+
?>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]