Completed
Push — master ( 44002c...26807d )
by Patrick
01:48
created
_admin/class.VolunteerAdminPage.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
             $this->isLead = $this->user->isInGroupNamed('Leads');
37 37
             if($this->isLead)
38 38
             {
39
-                 $this->is_admin = true;
39
+                    $this->is_admin = true;
40 40
             }
41 41
             else
42 42
             {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
                 $uid = $this->user->uid;
45 45
                 $email = $this->user->mail;
46 46
                 $filter = new \Data\Filter("others eq $uid or others eq $email");
47
-                $dataTable = DataSetFactory::getDataTableByNames('fvs','departments');
47
+                $dataTable = DataSetFactory::getDataTableByNames('fvs', 'departments');
48 48
                 $depts = $dataTable->read($filter);
49 49
                 $this->isLead = !empty($depts);
50 50
                 $this->is_admin = true;
Please login to merge, or discard this patch.
app/Emails/class.ShiftEmail.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
         $start = $this->shift->startTime->format('r');
45 45
         $end = $this->shift->endTime->format('r');
46 46
         $vars = array(
47
-          '{$firstName}' => $firstName,
48
-          '{$lastName}' => $lastName,
49
-          '{$paperName}' => $paperName,
50
-          '{$webName}' => $webName,
51
-          '{$department}' => $department,
52
-          '{$role}' => $role,
53
-          '{$event}' => $event,
54
-          '{$start}' => $start,
55
-          '{$end}' => $end
47
+            '{$firstName}' => $firstName,
48
+            '{$lastName}' => $lastName,
49
+            '{$paperName}' => $paperName,
50
+            '{$webName}' => $webName,
51
+            '{$department}' => $department,
52
+            '{$role}' => $role,
53
+            '{$event}' => $event,
54
+            '{$start}' => $start,
55
+            '{$end}' => $end
56 56
         );
57 57
         if(strpos($this->text, '{$newStart}') !== false || strpos($this->text, '{$newEnd}') !== false)
58 58
         {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 $end = strpos($rawText, "</script>");
77 77
                 if($index === 0)
78 78
                 {
79
-                    $rawText = substr($rawText, $end+9);
79
+                    $rawText = substr($rawText, $end + 9);
80 80
                 }
81 81
             }
82 82
             return strtr(strip_tags($rawText), $vars);
Please login to merge, or discard this patch.
app/Emails/class.CertificationEmail.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
         $certType = $this->additionalProps['certType'];
49 49
         $rejectReason = $this->additionalProps['reason'];
50 50
         $vars = array(
51
-          '{$firstName}' => $firstName,
52
-          '{$lastName}' => $lastName,
53
-          '{$paperName}' => $paperName,
54
-          '{$webName}' => $webName,
55
-          '{$certType}' => $certType,
56
-          '{$rejectReason}' => $rejectReason
51
+            '{$firstName}' => $firstName,
52
+            '{$lastName}' => $lastName,
53
+            '{$paperName}' => $paperName,
54
+            '{$webName}' => $webName,
55
+            '{$certType}' => $certType,
56
+            '{$rejectReason}' => $rejectReason
57 57
         );
58 58
         if($html === true)
59 59
         {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 $end = strpos($rawText, "</script>");
77 77
                 if($index === 0)
78 78
                 {
79
-                    $rawText = substr($rawText, $end+9);
79
+                    $rawText = substr($rawText, $end + 9);
80 80
                 }
81 81
             }
82 82
             return strtr(strip_tags($rawText), $vars);
Please login to merge, or discard this patch.
api/v1/class.ShiftAPI.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -221,6 +221,11 @@
 block discarded – undo
221 221
         return $response->withJSON($res, 500);
222 222
     }
223 223
 
224
+    /**
225
+     * @param string $status
226
+     * @param Data\Filter $filter
227
+     * @param Data\DataTable $dataTable
228
+     */
224 229
     protected function doSignup($uid, $status, $entity, $filter, $dataTable)
225 230
     {
226 231
         if(isset($entity['earlyLate']) && $entity['earlyLate'] !== '-1')
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
         }
53 53
         if(!isset($obj['departmentID']))
54 54
         {
55
-             return false;
55
+                return false;
56 56
         }
57 57
         if(isset($obj['unbounded']) && $obj['unbounded'])
58 58
         {
59 59
             if(!isset($obj['minShifts']) || $obj['minShifts'] === 0 || $obj['minShifts'] === '')
60 60
             {
61
-                 $obj['minShifts'] = '1';
61
+                    $obj['minShifts'] = '1';
62 62
             }
63 63
         }
64 64
         return $this->isUserDepartmentLead($obj['departmentID'], $this->user);
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
             $ret = $dataTable->update($filter, $entArray[$i]);
160 160
             if($ret === false)
161 161
             {
162
-               $myRet = false;
163
-               array_push($errors, $array[$i]);
162
+                $myRet = false;
163
+                array_push($errors, $array[$i]);
164 164
             }
165 165
         }
166 166
         if($myRet)
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         $entity = $this->processShift($entity, $request);
266 266
         if(isset($entity['minShifts']) && $entity['minShifts'] > 0)
267 267
         {
268
-          $shift->makeCopy($dataTable);
268
+            $shift->makeCopy($dataTable);
269 269
         }
270 270
         if(isset($entity['overlap']) && $entity['overlap'])
271 271
         {
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         $entity['status'] = 'unfilled';
332 332
         if(isset($entity['needEEApproval']))
333 333
         {
334
-          unset($entity['needEEApproval']);
334
+            unset($entity['needEEApproval']);
335 335
         }
336 336
         return $response->withJSON($dataTable->update($filter, $entity));
337 337
     }
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
         $entity['status'] = 'unfilled';
529 529
         if(isset($entity['needEEApproval']))
530 530
         {
531
-          unset($entity['needEEApproval']);
531
+            unset($entity['needEEApproval']);
532 532
         }
533 533
         $ret = $dataTable->update($filter, $entity);
534 534
         if($ret)
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
         $entity['status'] = 'unfilled';
564 564
         if(isset($entity['needEEApproval']))
565 565
         {
566
-          unset($entity['needEEApproval']);
566
+            unset($entity['needEEApproval']);
567 567
         }
568 568
         return $response->withJSON($dataTable->update($filter, $entity));
569 569
     }
Please login to merge, or discard this patch.
app/class.VolunteerEvent.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -6,6 +6,9 @@  discard block
 block discarded – undo
6 6
         parent::__construct($departmentID, $dbData, 'events', '_id');
7 7
     }
8 8
 
9
+    /**
10
+     * @param integer $eeListIndex
11
+     */
9 12
     public function hasVolOnEEList($uid, $eeListIndex)
10 13
     {
11 14
         if($eeListIndex === 1 || $eeListIndex === 0)
@@ -28,6 +31,9 @@  discard block
 block discarded – undo
28 31
         return false;
29 32
     }
30 33
 
34
+    /**
35
+     * @param integer $eeListIndex
36
+     */
31 37
     public function addToEEList($uid, $eeListIndex)
32 38
     {
33 39
         if(!isset($this->dbData['eeLists']))
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
         if($eeListIndex === 1 || $eeListIndex === 0)
12 12
         {
13 13
             //Check earlier EE lists too
14
-            $val = $this->hasVolOnEEList($uid, $eeListIndex+1);
14
+            $val = $this->hasVolOnEEList($uid, $eeListIndex + 1);
15 15
             if($val === true)
16 16
             {
17 17
                 return true;
Please login to merge, or discard this patch.
signup.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@  discard block
 block discarded – undo
5 5
 
6 6
 class ProcessorUser
7 7
 {
8
-  use Processor;
8
+    use Processor;
9 9
 
10
-  protected $isAdmin;
10
+    protected $isAdmin;
11 11
 
12
-  public function __construct($isAdmin)
13
-  {
14
-      $this->isAdmin = $isAdmin;
15
-  }
12
+    public function __construct($isAdmin)
13
+    {
14
+        $this->isAdmin = $isAdmin;
15
+    }
16 16
 
17
-  protected function isVolunteerAdmin()
18
-  {
19
-      return $this->isAdmin;
20
-  }
17
+    protected function isVolunteerAdmin()
18
+    {
19
+        return $this->isAdmin;
20
+    }
21 21
 }
22 22
 
23 23
 $page = new VolunteerPage('Burning Flipside - Flipside Volunteer System');
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 
31 31
 if(!isset($_GET['shiftID']))
32 32
 {
33
-  $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
34
-  $page->printPage();
35
-  return;
33
+    $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
34
+    $page->printPage();
35
+    return;
36 36
 }
37 37
 
38 38
 $shiftID = $_GET['shiftID'];
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 $shifts = $dataTable->read($filter);
42 42
 if(empty($shifts))
43 43
 {
44
-  $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
45
-  $page->printPage();
46
-  return;
44
+    $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
45
+    $page->printPage();
46
+    return;
47 47
 }
48 48
 $shift = $shifts[0];
49 49
 $myShift = new \VolunteerShift(false, $shift);
@@ -52,38 +52,38 @@  discard block
 block discarded – undo
52 52
 
53 53
 if($processor->isAdminForShift($shift, $page->user))
54 54
 {
55
-  if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
56
-  {
55
+    if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
56
+    {
57 57
     $page->body .= '
58 58
     <div class="alert alert-info" role="alert">
59 59
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
60 60
       Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>.
61 61
     </div>
62 62
     ';
63
-  }
64
-  else
65
-  {
63
+    }
64
+    else
65
+    {
66 66
     $page->body .= '
67 67
     <div class="alert alert-info" role="alert">
68 68
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
69 69
     </div>
70 70
     ';
71
-  }
72
-  if(!isset($shift['participant']) || strlen($shift['participant']) === 0)
73
-  {
71
+    }
72
+    if(!isset($shift['participant']) || strlen($shift['participant']) === 0)
73
+    {
74 74
     $page->body .= '
75 75
     <div class="alert alert-info" role="alert">
76 76
       You are an administrator for this shift. You can assign someone to the shift, but it is highly recommended to let the users sign up. But if you are sure click <a href="#" onClick="showAdminSignup()" class="alert-link">here</a>.
77 77
     </div>
78 78
     ';
79
-  }
79
+    }
80 80
 }
81 81
 
82 82
 //Is shift already taken?
83 83
 if($myShift->isFilled())
84 84
 {
85
-  if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
86
-  {
85
+    if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
86
+    {
87 87
     $page->body .= '<div class="alert alert-success" role="alert">
88 88
       You already have this shift!
89 89
     </div>
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
       <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button>
92 92
       <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button>
93 93
     </div>';
94
-  }
95
-  else
96
-  {
94
+    }
95
+    else
96
+    {
97 97
     $page->body .= '<div class="alert alert-danger" role="alert">
98 98
       Someone else took this shift!
99 99
     </div>';
100
-  }
101
-  $page->printPage();
102
-  return;
100
+    }
101
+    $page->printPage();
102
+    return;
103 103
 }
104 104
 
105 105
 $overlap = false;
@@ -124,50 +124,50 @@  discard block
 block discarded – undo
124 124
 $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID']));
125 125
 if(!empty($depts))
126 126
 {
127
-  $deptName = $depts[0]['departmentName'];
127
+    $deptName = $depts[0]['departmentName'];
128 128
 }
129 129
 
130 130
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events');
131 131
 $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID']));
132 132
 if(!empty($events))
133 133
 {
134
-  if($events[0]['tickets'])
135
-  {
134
+    if($events[0]['tickets'])
135
+    {
136 136
     //TODO... Event requires tickets. Does this account have tickets?
137
-  }
137
+    }
138 138
 }
139 139
 
140 140
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles');
141 141
 $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID']));
142 142
 if(!empty($roles))
143 143
 {
144
-  $roleName = $roles[0]['display_name'];
144
+    $roleName = $roles[0]['display_name'];
145 145
 }
146 146
 
147 147
 //Is user eligible for shift?
148 148
 $canDo = $processor->canUserDoRole($profile, $roles[0]);
149 149
 if(is_array($canDo) && $processor->isAdminForShift($shift, $page->user))
150 150
 {
151
-  $canDo = true;
151
+    $canDo = true;
152 152
 }
153 153
 if($canDo !== true)
154 154
 {
155
-  $page->body .= '<div class="alert alert-danger" role="alert">';
156
-  switch($canDo['whyClass'])
157
-  {
155
+    $page->body .= '<div class="alert alert-danger" role="alert">';
156
+    switch($canDo['whyClass'])
157
+    {
158 158
     case 'INVITE':
159 159
       $page->body .= 'This shift requires an invite from the department lead. If you think you should have recieved such an invite please <a href="https://www.burningflipside.com/contact" class="alert-link">contact the lead</a>.';
160
-      break;
160
+        break;
161 161
     case 'CERT':
162 162
        $page->body .= $canDo['whyMsg'].' If you have this certification it is not recorded in your profile. You can <a href="certiciation.php" class="alert-link">record that certification</a> to sign up.';
163
-       break;
163
+        break;
164 164
     default:
165 165
       $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg'];
166
-      break;
167
-  }
168
-  $page->body .= '</div>';
169
-  $page->printPage();
170
-  return;  
166
+        break;
167
+    }
168
+    $page->body .= '</div>';
169
+    $page->printPage();
170
+    return;  
171 171
 }
172 172
 
173 173
 $start = new \DateTime($shift['startTime']);
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 $page->body .= '<div id="signupContent" ';
179 179
 if($overlap)
180 180
 {
181
-  $page->body .= 'class="d-none" ';
181
+    $page->body .= 'class="d-none" ';
182 182
 }
183 183
 $page->body .= '/>';
184 184
 $page->body .= '
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
 if($processor->isAdminForShift($shift, $page->user) && (!isset($shift['participant']) || strlen($shift['participant']) === 0))
220 220
 {
221
-  $page->body .= '
221
+    $page->body .= '
222 222
   <div class="row d-none" id="adminSignup">
223 223
     <div class="alert alert-danger" role="alert">
224 224
       First off, make sure you understand what this will do. While it will let you fill out the details for a shift, it will prevent the user from seeing the shift on their list when the log it, it will not be correctly reported for t-shirts or for rock star volunteers, their camp will not be listed on the shift schedule, and the ability to contact past volunteers will not work for anyone signed up in this manner. Basically, doing this removes about 90% of the advantage of using this system. So please only do this if participant in question is unable to sign up on their own.
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
 //Is group eligible?
236 236
 if(isset($shift['groupID']) && isset($roles[0]['groups_allowed']) && $roles[0]['groups_allowed'])
237 237
 {
238
-  $page->body .= '<div id="groupContent" ';
239
-  if($overlap)
240
-  {
238
+    $page->body .= '<div id="groupContent" ';
239
+    if($overlap)
240
+    {
241 241
     $page->body .= 'class="d-none" ';
242
-  }
243
-  $page->body .= '>
242
+    }
243
+    $page->body .= '>
244 244
   <div class="row">
245 245
     <div class="alert alert-primary" role="alert">
246 246
       You have selected a group eligible shift. This means you can generate a link for your friends to sign up on the shift with you. Would you like to sign up for the shift and generate that link now?
Please login to merge, or discard this patch.
plugin.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
     function get_secure_menu_entries($page, $user)
5 5
     {
6 6
         $ret = array(
7
-          'Volunteer' => $page->secure_root.'fvs/index.php'
7
+            'Volunteer' => $page->secure_root.'fvs/index.php'
8 8
         );
9 9
         if($user !== null && $user->isInGroupNamed('VolunteerAdmins'))
10 10
         {
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
     function get_plugin_entry_point()
17 17
     {
18 18
         return array(
19
-          'name'=>'Volunteer',
20
-          'link' => 'fvs/index.php'
19
+            'name'=>'Volunteer',
20
+            'link' => 'fvs/index.php'
21 21
         );
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
         );
9 9
         if($user !== null && $user->isInGroupNamed('VolunteerAdmins'))
10 10
         {
11
-            $ret['Volunteer System Admin']=$page->secure_root.'fvs/_admin/index.php';
11
+            $ret['Volunteer System Admin'] = $page->secure_root.'fvs/_admin/index.php';
12 12
         }
13 13
         return $ret;
14 14
     }
Please login to merge, or discard this patch.