[opw-web] Show the entered full name for accepted agreements in more places



commit 0d93b27fb67b71cf2374322b0b2be400ef465f3d
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu May 14 14:37:52 2015 -0400

    Show the entered full name for accepted agreements in more places
    
    Show the entered full name on the user profile, and also in the message we
    show when viewing the contract.

 lang/en-gb.php                                     |    2 ++
 modules/mod_contract.php                           |    6 ++++--
 modules/mod_user_profile.php                       |    3 ++-
 skins/easterngreen/html/tpl_contract.html          |    2 +-
 .../html/tpl_user_profile_contract_header.html     |    2 +-
 5 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/lang/en-gb.php b/lang/en-gb.php
index 50b4eef..40e0470 100644
--- a/lang/en-gb.php
+++ b/lang/en-gb.php
@@ -275,6 +275,7 @@ $lang_data = array(
     'review_contract'       => 'Review agreement',
     'contract_accepted'     => 'Agreement accepted',
     'contract_not_accepted' => 'Agreement not accepted',
+    'by'                    => 'by',
     'visible_to_mentors'    => '(visible to mentors)',
     'visible_to_public'     => '(visible to public)',
     'visible_to_admins'     => '(visible to administrators)',
@@ -367,6 +368,7 @@ $lang_data = array(
     'review_contract_notice_student'   => 'Please review the following terms of participation as an intern 
in Outreachy. If they are acceptable to you, please type your full name then click on "Accept Agreement" at 
the bottom of the page.',
     'review_contract_notice_mentor'    => 'Please review the following terms of participation as a mentor in 
Outreachy. If they are acceptable to you, please type your full name then click on "Accept Agreement" at the 
bottom of the page.',
     'view_contract_notice'      => 'You accepted the following agreement on: ',
+    'view_contract_notice_name' => 'You gave your full name as',
     'type_your_name'            => 'Please type your full name',
     'accept_contract'           => "Accept Agreement",
 
diff --git a/modules/mod_contract.php b/modules/mod_contract.php
index c709d40..4adc52a 100644
--- a/modules/mod_contract.php
+++ b/modules/mod_contract.php
@@ -89,9 +89,9 @@ if ($action == 'edit_student' || $action == 'edit_mentor') {
         $is_student = $action == 'sample_student';
         $is_mentor = $action == 'sample_mentor';
         $contract_accepted_time =  0;
+        $contract_entered_name = '';
         $contract_id = NULL;
-    } else {
-        $is_sample = false;
+    } else {        $is_sample = false;
         $user->restrict(!is_null($user->username));
         $username = $user->username;
 
@@ -113,6 +113,7 @@ if ($action == 'edit_student' || $action == 'edit_mentor') {
         $user->restrict($role_data['has_project']);
 
         $contract_accepted_time =  $role_data['contract_accepted_time'];
+        $contract_entered_name =  $role_data['contract_entered_name'];
 
         $user->restrict($contract_accepted_time != 0 ||
                         ($program_data['is_active'] &&
@@ -181,6 +182,7 @@ if ($action == 'edit_student' || $action == 'edit_mentor') {
          'program_mentor_visibility' => $skin->visibility($is_mentor),
          'program_student_visibility' => $skin->visibility($is_student),
          'contract_accepted_time' => date('M d, Y h:m:s', $contract_accepted_time),
+         'contract_entered_name' => htmlspecialchars($contract_entered_name),
          'contract_html' => $contract_html,
                  ));
 
diff --git a/modules/mod_user_profile.php b/modules/mod_user_profile.php
index 6e5140d..7a57433 100644
--- a/modules/mod_user_profile.php
+++ b/modules/mod_user_profile.php
@@ -137,7 +137,7 @@ if ($action == 'view') {
 
             // Find all programs where the user is a student or mentor for an
             // accepted project.
-            $sql = "SELECT prg.*, r.role, r.contract_approved, r.contract_accepted_time FROM 
{$db->prefix}roles r " .
+            $sql = "SELECT prg.*, r.role, r.contract_approved, r.contract_accepted_time, 
r.contract_entered_name FROM {$db->prefix}roles r " .
                    "LEFT JOIN {$db->prefix}programs prg " .
                    "ON prg.id = r.program_id " .
                    "WHERE r.username = ? " .
@@ -178,6 +178,7 @@ if ($action == 'view') {
                                   'accepted_visibility' => 
$skin->visibility($program['contract_accepted_time'] != 0),
                                   'not_accepted_visibility' => $skin->visibility(!$is_self && 
!$program['contract_approved'] && $program['contract_accepted_time'] == 0),
                                   'contract_accepted_time' => date('M d, Y h:m:s', 
$program['contract_accepted_time']),
+                                  'contract_entered_name' => 
htmlspecialchars($program['contract_entered_name']),
                                   'accepted' => $skin->visibility($program['contract_approved']),
                              ));
 
diff --git a/skins/easterngreen/html/tpl_contract.html b/skins/easterngreen/html/tpl_contract.html
index ee25f53..1fc9bca 100644
--- a/skins/easterngreen/html/tpl_contract.html
+++ b/skins/easterngreen/html/tpl_contract.html
@@ -7,7 +7,7 @@
   </div>
 </div>
 <div class="alert [[view_visibility]]">
-  {{view_contract_notice}} [[contract_accepted_time]]
+  {{view_contract_notice}} [[contract_accepted_time]]. {{view_contract_notice_name}}: 
[[contract_entered_name]]
 </div>
 <div id="contractText" class="contract-text" onscroll="checkSensitive()">[[contract_html]]</div>
 <div class="[[review_visibility]]">
diff --git a/skins/easterngreen/html/tpl_user_profile_contract_header.html 
b/skins/easterngreen/html/tpl_user_profile_contract_header.html
index cde6526..4823d8d 100644
--- a/skins/easterngreen/html/tpl_user_profile_contract_header.html
+++ b/skins/easterngreen/html/tpl_user_profile_contract_header.html
@@ -1,5 +1,5 @@
 <tr>
     <th colspan="3">
-        [[program_title]] ([[role]]<span class="[[approved_visibility]]">, {{contract_approved}}</span><span 
class="[[accepted_visibility]]">, {{contract_accepted}}: [[contract_accepted_time]]</span><span 
class="[[not_accepted_visibility]]">, {{contract_not_accepted}}</span>)
+        [[program_title]] ([[role]]<span class="[[approved_visibility]]">, {{contract_approved}}</span><span 
class="[[accepted_visibility]]">, {{contract_accepted}}: [[contract_accepted_time]] {{by}} 
[[contract_entered_name]]</span><span class="[[not_accepted_visibility]]">, {{contract_not_accepted}}</span>)
     </th>
 </tr>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]