[opw-web] Always allow users to view an accepted contract



commit d08513933d5ebed9ce999f0538279dafa47b16d6
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu May 14 14:25:59 2015 -0400

    Always allow users to view an accepted contract
    
    Allow users to view contracts they previously accepted even for programs
    that are no longer active.

 modules/mod_contract.php |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/modules/mod_contract.php b/modules/mod_contract.php
index a264da9..c709d40 100644
--- a/modules/mod_contract.php
+++ b/modules/mod_contract.php
@@ -111,13 +111,16 @@ if ($action == 'edit_student' || $action == 'edit_mentor') {
 
 
         $user->restrict($role_data['has_project']);
-        $user->restrict($program_data['is_active'] &&
-                        $program_data['contracts_active'] &&
-                        $core->timestamp > $program_data['dl_mentor']);
+
+        $contract_accepted_time =  $role_data['contract_accepted_time'];
+
+        $user->restrict($contract_accepted_time != 0 ||
+                        ($program_data['is_active'] &&
+                         $program_data['contracts_active'] &&
+                         $core->timestamp > $program_data['dl_mentor']));
 
         $is_student = $role_data['role'] == 's';
         $is_mentor = $role_data['role'] == 'm';
-        $contract_accepted_time =  $role_data['contract_accepted_time'];
     }
 
     $has_accepted = $contract_accepted_time != 0;


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