[opw-web] Don't allow mentors and students to resign after the selection deadline



commit c3e0b162df26a3c8c0a6046baf08487f2d49190e
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Apr 20 00:43:10 2014 -0400

    Don't allow mentors and students to resign after the selection deadline
    
    We dont' have the notifications and processes in place to handle
    people resigning from active projects (people will have to mail), and
    resigning without active projects after the selection deadline is
    pointless, so simply disallow resigning.
    
    The one exception is people waiting approval as mentors, to allow them
    to undo an "Apply as mentors.

 modules/mod_program_home.php                  |    9 ++++++++-
 skins/easterngreen/html/tpl_program_home.html |    6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/modules/mod_program_home.php b/modules/mod_program_home.php
index c30c489..ec646dd 100644
--- a/modules/mod_program_home.php
+++ b/modules/mod_program_home.php
@@ -38,6 +38,8 @@ if ($program_data != null)
         'dl_mentor'     => date('M d Y, h:i a T', $program_data['dl_mentor']),
     ));
 
+    $show_resign = false;
+
     if ($role == 's')
     {
         if ($show_started) {
@@ -59,16 +61,20 @@ if ($program_data != null)
             else
                 $role_message = $lang->get('role_student_rejected');
         }
-        else
+        else {
             $role_message = $lang->get('role_student_applied');
+            $show_resign = true;
+        }
     }
     else if ($role == 'm')
     {
         $role_message = $lang->get('role_mentor');
+        $show_resign = !$show_started;
     }
     else if ($role == 'i')
     {
         $role_message = $lang->get('role_intermediate');
+        $show_resign = true;
     }
     else if ($role == 'x')
     {
@@ -90,6 +96,7 @@ if ($program_data != null)
         'mentor_deadlines'         => $lang->get('mentor_dl_info'),
         'return_url'               => urlencode($core->request_uri()),
         'role_message'             => $role_message,
+        'resign_visibility'        => $skin->visibility($show_resign),
         'prg_guest_visibility'     => $skin->visibility($role == 'g' || $role == 'r' || $role == 'x'),
         'prg_resign_visibility'    => $skin->visibility(false),
         'prg_rejected_visibility'  => $skin->visibility($role == 'x'),
diff --git a/skins/easterngreen/html/tpl_program_home.html b/skins/easterngreen/html/tpl_program_home.html
index 0154b17..baace36 100644
--- a/skins/easterngreen/html/tpl_program_home.html
+++ b/skins/easterngreen/html/tpl_program_home.html
@@ -106,7 +106,7 @@
             <div class="alert alert-info [[late_submission_visibility]]">
               {{late_submission_notice}}
             </div>
-            <div class="resign-block">
+            <div class="resign-block [[resign_visibility]]">
                 <a href="?q=view_projects&amp;prg=[[program_id]]&amp;a=resign" class="btn btn-danger 
btn-mini">
                     {{resign_program}}
                 </a>
@@ -119,7 +119,7 @@
                 [[role_message]]
             </h4>
 
-            <div class="resign-block">
+            <div class="resign-block [[resign_visibility]]">
                 <a href="?q=view_projects&amp;prg=[[program_id]]&amp;a=resign" class="btn btn-danger 
btn-mini">
                     {{resign_program}}
                 </a>
@@ -142,7 +142,7 @@
                 {{view_my_projects}}
             </a>
 
-            <div class="resign-block">
+            <div class="resign-block [[resign_visibility]]">
                 <a href="?q=view_projects&amp;prg=[[program_id]]&amp;a=resign" class="btn btn-danger 
btn-mini">
                     {{resign_program}}
                 </a>


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