[opw-web] Allow reject mentors to reapply as students or mentors



commit ce2e96814b7cb6a16d17b1ce0204225b04dbb41e
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Apr 20 00:26:39 2014 -0400

    Allow reject mentors to reapply as students or mentors
    
    If someone accidentally applied as a mentor, they shouldn't be
    banned from the program - maybe they want to apply as a student,
    or apply as a mentor with a different organization or after providing
    clarifying information.

 lang/en-gb.php                                |    2 +-
 modules/mod_program_home.php                  |    2 +-
 modules/mod_view_projects.php                 |    3 +-
 skins/easterngreen/html/tpl_program_home.html |   28 ++++++++++++------------
 utils.php                                     |    2 +-
 5 files changed, 18 insertions(+), 19 deletions(-)
---
diff --git a/lang/en-gb.php b/lang/en-gb.php
index 16ef5d6..277a56a 100644
--- a/lang/en-gb.php
+++ b/lang/en-gb.php
@@ -142,7 +142,7 @@ $lang_data = array(
     'role_student_rejected' => 'You were not accepted for this program. Please continue working with your 
organization and apply in a future round.',
     'role_mentor'           => 'You are a mentor for this program',
     'role_resigned'         => 'You have resigned from this program and cannot participate again',
-    'role_rejected'         => 'Your mentorship application has been declined and you cannot participate in 
this program as a mentor',
+    'role_rejected'         => 'Your mentorship application has been declined',
     'role_intermediate'     => 'You mentor application for this program is awaiting admin approval',
     'view_accepted'         => 'View accepted projects',
     'student_dl_info'       => 'Application deadline: [[dl_student]]',
diff --git a/modules/mod_program_home.php b/modules/mod_program_home.php
index b0a43ee..c30c489 100644
--- a/modules/mod_program_home.php
+++ b/modules/mod_program_home.php
@@ -90,7 +90,7 @@ if ($program_data != null)
         'mentor_deadlines'         => $lang->get('mentor_dl_info'),
         'return_url'               => urlencode($core->request_uri()),
         'role_message'             => $role_message,
-        'prg_guest_visibility'     => $skin->visibility($role == 'g' || $role == 'r'),
+        'prg_guest_visibility'     => $skin->visibility($role == 'g' || $role == 'r' || $role == 'x'),
         'prg_resign_visibility'    => $skin->visibility(false),
         'prg_rejected_visibility'  => $skin->visibility($role == 'x'),
         'prg_student_visibility'   => $skin->visibility($role == 's'),
diff --git a/modules/mod_view_projects.php b/modules/mod_view_projects.php
index 87ed6f5..b832b5d 100644
--- a/modules/mod_view_projects.php
+++ b/modules/mod_view_projects.php
@@ -855,8 +855,7 @@ else if ($action == 'approve' || $action == 'reject' || $action == 'pending')
 }
 else if ($action == 'apply')
 {
-    // Only guests and resigned participants can apply
-    $user->restrict($role == 'g' || $role == 'r');
+    $user->restrict($project_permissions->can_apply_student || $project_permissions->can_apply_mentor);
 
     // We need program ID for this action
     $user->restrict($program_id > 0);
diff --git a/skins/easterngreen/html/tpl_program_home.html b/skins/easterngreen/html/tpl_program_home.html
index 65fb872..0154b17 100644
--- a/skins/easterngreen/html/tpl_program_home.html
+++ b/skins/easterngreen/html/tpl_program_home.html
@@ -59,6 +59,20 @@
     </div>
 
     <div class="program-actions [[user_visibility]]">
+        <div class="[[prg_rejected_visibility]]">
+            <h4 class="rejected-notice">
+                <i class="icon-user"></i>
+                [[role_message]]
+            </h4>
+        </div>
+
+        <div class="[[prg_resign_visibility]]">
+            <h4 class="resign-notice">
+                <i class="icon-user"></i>
+                [[role_message]]
+            </h4>
+        </div>
+
         <div class="[[prg_guest_visibility]]">
             <a href="#" onclick="submitForm(event, 
'?q=view_projects&amp;prg=[[program_id]]&amp;a=apply&amp;c=student')"
                class="btn btn-large [[apply_student_visibility]]">
@@ -73,13 +87,6 @@
             </a>
         </div>
 
-        <div class="[[prg_resign_visibility]]">
-            <h4 class="resign-notice">
-                <i class="icon-user"></i>
-                [[role_message]]
-            </h4>
-        </div>
-
         <div class="[[prg_student_visibility]]">
             <h4>
                 <i class="icon-user"></i>
@@ -141,13 +148,6 @@
                 </a>
             </div>
         </div>
-
-        <div class="[[prg_rejected_visibility]]">
-            <h4 class="rejected-notice">
-                <i class="icon-user"></i>
-                [[role_message]]
-            </h4>
-        </div>
     </div>
 
     <a href="https://wiki.gnome.org/OutreachProgramForWomen/2014/MayAugust#Accepted_Participants"; class="btn 
btn-large [[started_visibility]]">
diff --git a/utils.php b/utils.php
index a6fa436..b027736 100644
--- a/utils.php
+++ b/utils.php
@@ -151,7 +151,7 @@ class ProjectPermissions {
                         $can_submit = true;
                 }
             }
-        } else if ($role == 'g' || $role == 'r') {
+        } else if ($role == 'g' || $role == 'r' || $role == 'x') {
             if ($core->timestamp <= $program_data['dl_student']) {
                 $can_apply_student = true;
                 $can_apply_mentor = true;


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