From c271e8bd8636fbfc10556895a583943b145ebd19 Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Tue, 15 Sep 2015 10:24:08 -0400 Subject: [PATCH] Drupal: Adjust foundership placeholder countdown by 30 days The countdown was using the 60 day target instead of the proper 90 day target, so it was possible for other team members to see a negative number if a user had a request open for more than 60 days (DBOINCP-214) --- .../default/boinc/modules/boincteam/boincteam.module | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drupal/sites/default/boinc/modules/boincteam/boincteam.module b/drupal/sites/default/boinc/modules/boincteam/boincteam.module index d577dc5a0f..650ce7b633 100644 --- a/drupal/sites/default/boinc/modules/boincteam/boincteam.module +++ b/drupal/sites/default/boinc/modules/boincteam/boincteam.module @@ -1041,12 +1041,12 @@ function boincteam_request_foundership_panel($team_id) { $boincteam_id = boincteam_lookup_id($team_id); $boincteam = boincteam_load($boincteam_id); $boincuser_id = $account->boincuser_id; - $deadline = boincteam_foundership_transfer_ok_time($boincteam); - $days_to_deadline = ceil(($deadline - time()) / (24*60*60)); $output = ''; $output .= '

' . bts('Request foundership') . '

'; if (boincteam_user_requested_foundership($team_id)) { + $deadline = boincteam_foundership_transfer_ok_time($boincteam); + $days_to_deadline = ceil(($deadline - time()) / (24*60*60)); $request_age = 60 - $days_to_deadline; $days_to_respond = 30 + $days_to_deadline; if (time() > $deadline) { @@ -1094,7 +1094,12 @@ function boincteam_request_foundership_panel($team_id) { } } elseif (!boincteam_new_foundership_transfer_request_ok($team_id)) { - // Requests are not allowed right now + // If this user does not have a transfer request pending, but new requests + // are not allowed, set the deadline to 90 days instead of 60 (as the user + // who made the request has 30 additional days to assume foundership if + // there is no response to the request) + $deadline = boincteam_foundership_transfer_ok_time($boincteam); + $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30; $output .= '

'; $output .= bts('A team foundership change was already requested recently.' . ' Only one request is allowed within a period of 90 days.'