[opw-web] Allow mentors to sign up at any time



commit c59548dcab433ef863741aaa151ca193e9ecac42
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Mar 10 12:45:02 2014 -0400

    Allow mentors to sign up at any time
    
    Don't require the student deadline to pass - this enables information
    to be collected as it is available, rather than in a burst.

 modules/mod_view_projects.php |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/modules/mod_view_projects.php b/modules/mod_view_projects.php
index 2f900fe..c8fae5a 100644
--- a/modules/mod_view_projects.php
+++ b/modules/mod_view_projects.php
@@ -316,7 +316,8 @@ if ($action == 'editor')
                 $db->query($sql, $params);
 
                 // Get the new project ID
-                $params['project_id'] = $db->get_id();
+                $project_id = $db->get_id();
+                $params['project_id'] = $project_id;
                 // XXX - this seems wrong when admin is creating
                 $params['username'] = $user->username;
 
@@ -337,6 +338,9 @@ if ($action == 'editor')
 
             // Purge the project cache
             $cache->purge('projects');
+
+            // Redirect to the view screen for the project
+            $core->redirect("?q=view_projects&prg={$program_id}&p={$project_id}");
         }
     }
 
@@ -501,9 +505,11 @@ else if ($action == 'view')
     //  1. He signed up as a mentor for the program, and
     //  2. Project doesn't already have a mentor
     //  3. Project hasn't passed mentor deadline
-    //  4. Projest has passed student deadline
+    //
+    // KSoC had:
+    // XXXX 4. Projest has passed student deadline
+    // $core->timestamp > $program_data['dl_student'] &&
     $can_mentor = ($role == 'm' && !$has_mentor &&
-                   $core->timestamp > $program_data['dl_student'] &&
                    $core->timestamp < $program_data['dl_mentor']);
 
     // User applied as mentor


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