Completed
Push — master ( 26807d...efd759 )
by Patrick
01:43
created
api/v1/class.Processor.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
     protected abstract function isVolunteerAdmin($request);
14 14
 
15
+    /**
16
+     * @param VolunteerProfile|null $user
17
+     */
15 18
     public function canUserDoRole($user, $role)
16 19
     {
17 20
         static $certs = null;
@@ -155,6 +158,9 @@  discard block
 block discarded – undo
155 158
         return !in_array($deptId, $privateDepts);
156 159
     }
157 160
 
161
+    /**
162
+     * @param VolunteerShift $shift
163
+     */
158 164
     protected function doShiftTimeChecks($shift, $entry)
159 165
     {
160 166
         $now = new DateTime();
Please login to merge, or discard this patch.
app/Emails/class.PendingRejectedEmail.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -3,6 +3,9 @@
 block discarded – undo
3 3
 
4 4
 class PendingRejectedEmail extends VolunteerEmail
5 5
 {
6
+    /**
7
+     * @param \VolunteerProfile $userProfile
8
+     */
6 9
     public function __construct($userProfile)
7 10
     {
8 11
         parent::__construct($userProfile);
Please login to merge, or discard this patch.
groupSignup.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 if(!isset($_GET['id']))
11 11
 {
12
-  $page->body .= 'Error! Missing Group ID. You must have followed a bad link!';
13
-  $page->printPage();
14
-  return;
12
+    $page->body .= 'Error! Missing Group ID. You must have followed a bad link!';
13
+    $page->printPage();
14
+    return;
15 15
 }
16 16
 
17 17
 $groupID = $_GET['id'];
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 $shifts = $dataTable->read($filter);
21 21
 if(empty($shifts))
22 22
 {
23
-  $page->body .= 'Error! Could not locate shifts. You must have followed an old link!';
24
-  $page->printPage();
25
-  return;
23
+    $page->body .= 'Error! Could not locate shifts. You must have followed an old link!';
24
+    $page->printPage();
25
+    return;
26 26
 }
27 27
 
28 28
 $filled = array();
@@ -32,35 +32,35 @@  discard block
 block discarded – undo
32 32
 $count = count($shifts);
33 33
 for($i = 0; $i < $count; $i++)
34 34
 {
35
-  $shifts[$i] = new \VolunteerShift(false, $shifts[$i]);
36
-  if($shifts[$i]->status === 'filled' || $shifts[$i]->status === 'pending')
37
-  {
38
-      array_push($filled, $shifts[$i]);
39
-      if($page->user && $shifts[$i]->participant === $page->user->uid)
40
-      {
41
-          $alreadySignedUp = true;
42
-      }
43
-  }
44
-  else
45
-  {
46
-      array_push($available, $shifts[$i]);
47
-  }
35
+    $shifts[$i] = new \VolunteerShift(false, $shifts[$i]);
36
+    if($shifts[$i]->status === 'filled' || $shifts[$i]->status === 'pending')
37
+    {
38
+        array_push($filled, $shifts[$i]);
39
+        if($page->user && $shifts[$i]->participant === $page->user->uid)
40
+        {
41
+            $alreadySignedUp = true;
42
+        }
43
+    }
44
+    else
45
+    {
46
+        array_push($available, $shifts[$i]);
47
+    }
48 48
 }
49 49
 $page->body .= '<div class="row"><h3>Filled Shifts</h3></div><div class="row"><table class="table"><tr><th>Role</th><th>Participant</th></tr>';
50 50
 foreach($filled as $shift)
51 51
 {
52
-  $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$shift->webParticipantName.'</td></tr>';
52
+    $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$shift->webParticipantName.'</td></tr>';
53 53
 }
54 54
 $page->body .= '</table></div>';
55 55
 $page->body .= '<div class="row"><h3>Unfilled Shifts</h3></div><div class="row"><table class="table"><tr><th>Role</th><th>Sign Up</th></tr>';
56 56
 foreach($available as $shift)
57 57
 {
58
-  $cell = '<i>You already have a shift!</i>';
59
-  if($alreadySignedUp === false)
60
-  {
58
+    $cell = '<i>You already have a shift!</i>';
59
+    if($alreadySignedUp === false)
60
+    {
61 61
     $cell = '<button type="button" class="btn btn-primary" onClick="signUp(\''.$shift->_id.'\');">Sign Up</button>';
62
-  } 
63
-  $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$cell.'</td></tr>';
62
+    } 
63
+    $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$cell.'</td></tr>';
64 64
 }
65 65
 $page->body .= '</table></div>';
66 66
 $page->printPage();
Please login to merge, or discard this patch.
app/class.VolunteerShift.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
 
114 114
     public function isFilled()
115 115
     {
116
-         return isset($this->dbData['status']) && ($this->dbData['status'] === 'pending' || $this->dbData['status'] === 'filled' || $this->dbData['status'] === 'groupPending');
116
+            return isset($this->dbData['status']) && ($this->dbData['status'] === 'pending' || $this->dbData['status'] === 'filled' || $this->dbData['status'] === 'groupPending');
117 117
     }
118 118
 
119 119
     public function findOverlaps($uid, $shortCircuit = false)
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -177,6 +177,9 @@
 block discarded – undo
177 177
         return $res;
178 178
     }
179 179
 
180
+    /**
181
+     * @param Data\DataTable $dataTable
182
+     */
180 183
     public function makeCopy($dataTable)
181 184
     {
182 185
         $tmp = $this->dbData;
Please login to merge, or discard this patch.
_admin/class.VolunteerAdminPage.php 1 patch
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.
app/Emails/class.ShiftEmail.php 1 patch
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.
app/Emails/class.CertificationEmail.php 1 patch
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.
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 1 patch
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.