Completed
Push — master ( 340598...197461 )
by Patrick
01:50
created
api/v1/class.ShiftAPI.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     protected function canUpdate($request, $entity)
42 42
     {
43 43
  	if($this->isVolunteerAdmin($request))
44
-        {
44
+ 	{
45 45
             return true;
46 46
         }
47 47
         return $this->isUserDepartmentLead($entity['departmentID'], $this->user);
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     protected function canUpdate($request, $entity)
33 33
     {
34
- 	if($this->isVolunteerAdmin($request))
34
+        if($this->isVolunteerAdmin($request))
35 35
         {
36 36
             return true;
37 37
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         }
52 52
         if(!isset($obj['departmentID']))
53 53
         {
54
-             return false;
54
+                return false;
55 55
         }
56 56
         return $this->isUserDepartmentLead($obj['departmentID'], $this->user);
57 57
     }
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
             $ret = $dataTable->update($filter, $entArray[$i]);
118 118
             if($ret === false)
119 119
             {
120
-               $myRet = false;
121
-               array_push($errors, $array[$i]);
120
+                $myRet = false;
121
+                array_push($errors, $array[$i]);
122 122
             }
123 123
         }
124 124
         if($myRet)
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $entity = $this->processShift($entity, $request);
207 207
         if(isset($entity['minShifts']) && $entity['minShifts'] > 0)
208 208
         {
209
-          $shift->makeCopy($dataTable);
209
+            $shift->makeCopy($dataTable);
210 210
         }
211 211
         if(isset($entity['overlap']) && $entity['overlap'])
212 212
         {
Please login to merge, or discard this patch.
api/v1/class.ParticipantAPI.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     protected function canUpdate($request, $entity)
37 37
     {
38
- 	if($this->isVolunteerAdmin($request))
38
+        if($this->isVolunteerAdmin($request))
39 39
         {
40 40
             return true;
41 41
         }       
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $odata = $request->getAttribute('odata', new \ODataParams(array()));
84 84
         $filter = $this->getFilterForPrimaryKey($uid);
85 85
         $areas = $dataTable->read($filter, $odata->select, $odata->top,
86
-                                  $odata->skip, $odata->orderby);
86
+                                    $odata->skip, $odata->orderby);
87 87
         if(empty($areas))
88 88
         {
89 89
             return $response->withStatus(404);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     protected function canUpdate($request, $entity)
37 37
     {
38 38
  	if($this->isVolunteerAdmin($request))
39
-        {
39
+ 	{
40 40
             return true;
41 41
         }       
42 42
         //TODO give access to department lead
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -106,24 +106,24 @@
 block discarded – undo
106 106
         if($format === false || $format === 'text/calendar')
107 107
         {
108 108
             $text = "BEGIN:VCALENDAR\r\n";
109
-            $text.= "VERSION:2.0\r\n";
110
-            $text.= "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n";
109
+            $text .= "VERSION:2.0\r\n";
110
+            $text .= "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n";
111 111
             $count = count($shifts);
112 112
             for($i = 0; $i < $count; $i++)
113 113
             {
114
-                $text.= "BEGIN:VEVENT\r\n";
115
-                $text.= "UID:".$this->user->mail."\r\n";
114
+                $text .= "BEGIN:VEVENT\r\n";
115
+                $text .= "UID:".$this->user->mail."\r\n";
116 116
                 $d = new DateTime($shifts[$i]['startTime']);
117 117
                 $d->setTimezone(new \DateTimeZone('UTC'));
118
-                $text.= "DTSTAMP:".$d->format('Ymd\THis\Z')."\r\n";
119
-                $text.= "DTSTART:".$d->format('Ymd\THis\Z')."\r\n";
118
+                $text .= "DTSTAMP:".$d->format('Ymd\THis\Z')."\r\n";
119
+                $text .= "DTSTART:".$d->format('Ymd\THis\Z')."\r\n";
120 120
                 $d = new DateTime($shifts[$i]['endTime']);
121 121
                 $d->setTimezone(new \DateTimeZone('UTC'));
122
-                $text.= "DTEND:".$d->format('Ymd\THis\Z')."\r\n";
123
-                $text.= "SUMMARY:".$shifts[$i]['roleID'].' '.$shifts[$i]['name']."\r\n";
124
-                $text.= "END:VEVENT\r\n";
122
+                $text .= "DTEND:".$d->format('Ymd\THis\Z')."\r\n";
123
+                $text .= "SUMMARY:".$shifts[$i]['roleID'].' '.$shifts[$i]['name']."\r\n";
124
+                $text .= "END:VEVENT\r\n";
125 125
             }
126
-            $text.= "END:VCALENDAR\r\n";
126
+            $text .= "END:VCALENDAR\r\n";
127 127
             $response = $response->withHeader('Content-type', 'text/calendar');
128 128
             $response = $response->withHeader('Content-Disposition', 'attachment; filename="MyShifts.ics"');
129 129
             $body = $response->getBody();
Please login to merge, or discard this patch.
api/v1/class.EventAPI.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     protected function canUpdate($request, $entity)
39 39
     {
40
- 	if($this->isVolunteerAdmin($request))
40
+        if($this->isVolunteerAdmin($request))
41 41
         {
42 42
             return true;
43 43
         }       
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             }
97 97
         }
98 98
         $shifts = $dataTable->read($filter, $odata->select, $odata->top,
99
-                                  $odata->skip, $odata->orderby);
99
+                                    $odata->skip, $odata->orderby);
100 100
         if($shifts === false)
101 101
         {
102 102
             $shifts = array();
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     protected function canUpdate($request, $entity)
39 39
     {
40 40
  	if($this->isVolunteerAdmin($request))
41
-        {
41
+ 	{
42 42
             return true;
43 43
         }       
44 44
         return false;
Please login to merge, or discard this patch.
app/VolunteerAutoload.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@
 block discarded – undo
1 1
 <?php
2
-function VolunteerAutoload($classname)
3
-{
2
+function VolunteerAutoload($classname)
3
+{
4 4
     $classname = str_replace('/', '\\', $classname);
5 5
     $classname = ltrim($classname, '\\');
6 6
     $filename  = '';
7 7
     $namespace = '';
8
-    if($lastNsPos = strrpos($classname, '\\'))
9
-    {
8
+    if($lastNsPos = strrpos($classname, '\\'))
9
+    {
10 10
         $namespace = substr($classname, 0, $lastNsPos);
11 11
         $classname = substr($classname, $lastNsPos + 1);
12 12
         $filename  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR;
13 13
     }
14 14
     $filename = __DIR__.DIRECTORY_SEPARATOR.$filename.'class.'.$classname.'.php';
15
-    if(is_readable($filename))
16
-    {
15
+    if(is_readable($filename))
16
+    {
17 17
         require $filename;
18 18
     }
19 19
 }
20 20
 
21
-if(version_compare(PHP_VERSION, '5.3.0', '>='))
22
-{
21
+if(version_compare(PHP_VERSION, '5.3.0', '>='))
22
+{
23 23
     spl_autoload_register('VolunteerAutoload', true, true);
24
-}
25
-else
26
-{
24
+}
25
+else
26
+{
27 27
     spl_autoload_register('VolunteerAutoload');
28 28
 }
29 29
 /* vim: set tabstop=4 shiftwidth=4 expandtab: */
Please login to merge, or discard this patch.
app/Schedules/class.GridSchedule.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
         {
47 47
             for($j = 0; $j < $rowCount; $j++)
48 48
             {
49
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
50
-                 if($cell->isInMergeRange())
51
-                 {
52
-                      continue;
53
-                 }
54
-                 else
55
-                 {
56
-                     $style = $cell->getStyle();
57
-                     $style->getBorders()->getAllBorders()->setBorderStyle(false);
58
-                     $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY);
59
-                 }
49
+                    $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
50
+                    if($cell->isInMergeRange())
51
+                    {
52
+                        continue;
53
+                    }
54
+                    else
55
+                    {
56
+                        $style = $cell->getStyle();
57
+                        $style->getBorders()->getAllBorders()->setBorderStyle(false);
58
+                        $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY);
59
+                    }
60 60
             }
61 61
         }
62 62
     }
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
             $shifts[$i]['length'] = $diff->h;
87 87
             if(!isset($roles[$shifts[$i]['roleID']]))
88 88
             {
89
-                 $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
90
-                 $roles2[$shifts[$i]['roleID']] = array();
89
+                    $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
90
+                    $roles2[$shifts[$i]['roleID']] = array();
91 91
             }
92 92
             else
93 93
             {
94
-                 if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length'])
95
-                 {
96
-                     $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
97
-                 }
94
+                    if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length'])
95
+                    {
96
+                        $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
97
+                    }
98 98
             }
99 99
             array_push($roles2[$shifts[$i]['roleID']], array('start'=>$start, 'end'=>$end));
100 100
         }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         {
52 52
             for($j = 0; $j < $rowCount; $j++)
53 53
             {
54
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
54
+                 $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4);
55 55
                  if($cell->isInMergeRange())
56 56
                  {
57 57
                       continue;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     protected function createShiftCell($sheat, $col, $row, $shift)
95 95
     {
96
-        $sheat->mergeCellsByColumnAndRow($col, $row, $col+$shift['length']-1, $row);
96
+        $sheat->mergeCellsByColumnAndRow($col, $row, $col + $shift['length'] - 1, $row);
97 97
         $this->setShiftNameInCell($sheat, $col, $row, $shift);
98 98
     }
99 99
 
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $i = 1;
103 103
         $firstRow = array_search($roleID, $rows);
104
-        $cell = $sheat->getCellByColumnAndRow($col, $firstRow+4);
104
+        $cell = $sheat->getCellByColumnAndRow($col, $firstRow + 4);
105 105
         if($cell->isInMergeRange())
106 106
         {
107
-            while($rows[$firstRow+$i] === $roleID)
107
+            while($rows[$firstRow + $i] === $roleID)
108 108
             {
109
-                $cell = $sheat->getCellByColumnAndRow($col, $firstRow+4+$i);
109
+                $cell = $sheat->getCellByColumnAndRow($col, $firstRow + 4 + $i);
110 110
                 if(!$cell->isInMergeRange())
111 111
                 {
112 112
                     break;
113 113
                 }
114 114
                 $i++;
115 115
             }
116
-            return $firstRow+4+$i;
116
+            return $firstRow + 4 + $i;
117 117
         }
118
-        return $firstRow+4;
118
+        return $firstRow + 4;
119 119
     }
120 120
 
121 121
     protected function createSpreadSheet()
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $start = date_parse($str);
163 163
         $lastShift = $shifts[$count - 1];
164 164
         $interval = $lastShift['endTime']->diff($shifts[0]['startTime']);
165
-        $hourCount = ($interval->d*24) + $interval->h;
165
+        $hourCount = ($interval->d * 24) + $interval->h;
166 166
         $tmp = $this->getHoursArrays($start['hour'], $hourCount);
167 167
         $simpleHours = $tmp[0];
168 168
         $militaryHours = $tmp[1];
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
         while($shift)
233 233
         {
234 234
             $timeDiff = $originalStartTime->diff($shift['startTime']);
235
-            $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h;
236
-            $rowForShift = $this->getRowForShift($shift['roleID'], $rows, $hoursFromStart+2, $sheat);
237
-            $this->createShiftCell($sheat, $hoursFromStart+2, $rowForShift, $shift);
235
+            $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h;
236
+            $rowForShift = $this->getRowForShift($shift['roleID'], $rows, $hoursFromStart + 2, $sheat);
237
+            $this->createShiftCell($sheat, $hoursFromStart + 2, $rowForShift, $shift);
238 238
             $shift = array_shift($shifts);
239 239
         }
240 240
         $rowCount = count($rows);
241
-        $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3 + $rowCount);
241
+        $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + $rowCount);
242 242
         $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
243 243
         $hourCount = count($simpleHours);
244 244
         $this->grayOutUnused($hourCount, $rowCount, $sheat);
Please login to merge, or discard this patch.
api/v1/class.Processor.php 4 patches
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.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
         }
48 48
         for($i = 0; $i < $certCount; $i++)
49 49
         {
50
-             if($this->certCheck($requirements, $userCerts, $certs[$i]['certID']))
51
-             {
52
-                 return array('whyClass' => 'CERT', 'whyMsg' => 'Shift requires '.$certs[$i]['name'].' and you do not have that certification');
53
-             }
50
+                if($this->certCheck($requirements, $userCerts, $certs[$i]['certID']))
51
+                {
52
+                    return array('whyClass' => 'CERT', 'whyMsg' => 'Shift requires '.$certs[$i]['name'].' and you do not have that certification');
53
+                }
54 54
         }
55 55
         return true;
56 56
     }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $tmp = $dataTable->read();
189 189
             foreach($tmp as $role)
190 190
             {
191
-               $roles[$role['short_name']] = $role;
191
+                $roles[$role['short_name']] = $role;
192 192
             }
193 193
         }
194 194
         $shift = new \VolunteerShift(false, $entry);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
             try {
64 64
                 $profile = new \VolunteerProfile($uid);
65 65
                 $uids[$uid] = $profile->getDisplayName();
66
-            } catch (Exception $e) {
66
+            } catch(Exception $e) {
67 67
                 $uids[$uid] = $uid;
68 68
             }
69 69
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,10 +60,13 @@
 block discarded – undo
60 60
         static $uids = array();
61 61
         if(!isset($uids[$uid]))
62 62
         {
63
-            try {
63
+            try
64
+            {
64 65
                 $profile = new \VolunteerProfile($uid);
65 66
                 $uids[$uid] = $profile->getDisplayName();
66
-            } catch (Exception $e) {
67
+            }
68
+            catch (Exception $e)
69
+            {
67 70
                 $uids[$uid] = $uid;
68 71
             }
69 72
         }
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.
api/v1/class.DepartmentAPI.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $filter = new \Data\Filter("departmentID eq '$deptId'");
78 78
         $odata = $request->getAttribute('odata', new \ODataParams(array()));
79 79
         $roles = $dataTable->read($filter, $odata->select, $odata->top,
80
-                                  $odata->skip, $odata->orderby);
80
+                                    $odata->skip, $odata->orderby);
81 81
         if($roles === false)
82 82
         {
83 83
             $roles = array();
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             }
115 115
         }
116 116
         $shifts = $dataTable->read($filter, $odata->select, $odata->top,
117
-                                  $odata->skip, $odata->orderby);
117
+                                    $odata->skip, $odata->orderby);
118 118
         if($shifts === false)
119 119
         {
120 120
             $shifts = array();
Please login to merge, or discard this patch.
signup.php 1 patch
Indentation   +55 added lines, -55 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');
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
 if(!isset($_GET['shiftID']))
30 30
 {
31
-  $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
32
-  $page->printPage();
33
-  return;
31
+    $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
32
+    $page->printPage();
33
+    return;
34 34
 }
35 35
 
36 36
 $shiftID = $_GET['shiftID'];
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 $shifts = $dataTable->read($filter);
40 40
 if(empty($shifts))
41 41
 {
42
-  $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
43
-  $page->printPage();
44
-  return;
42
+    $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
43
+    $page->printPage();
44
+    return;
45 45
 }
46 46
 $shift = $shifts[0];
47 47
 $myShift = new \VolunteerShift(false, $shift);
@@ -50,38 +50,38 @@  discard block
 block discarded – undo
50 50
 
51 51
 if($processor->isAdminForShift($shift, $page->user))
52 52
 {
53
-  if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
54
-  {
53
+    if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
54
+    {
55 55
     $page->body .= '
56 56
     <div class="alert alert-info" role="alert">
57 57
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
58 58
       Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>.
59 59
     </div>
60 60
     ';
61
-  }
62
-  else
63
-  {
61
+    }
62
+    else
63
+    {
64 64
     $page->body .= '
65 65
     <div class="alert alert-info" role="alert">
66 66
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
67 67
     </div>
68 68
     ';
69
-  }
70
-  if(!isset($shift['participant']) || strlen($shift['participant']) === 0)
71
-  {
69
+    }
70
+    if(!isset($shift['participant']) || strlen($shift['participant']) === 0)
71
+    {
72 72
     $page->body .= '
73 73
     <div class="alert alert-info" role="alert">
74 74
       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>.
75 75
     </div>
76 76
     ';
77
-  }
77
+    }
78 78
 }
79 79
 
80 80
 //Is shift already taken?
81 81
 if(isset($entry['status']) && ($entry['status'] === 'pending' || $entry['status'] === 'filled'))
82 82
 {
83
-  if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
84
-  {
83
+    if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
84
+    {
85 85
     $page->body .= '<div class="alert alert-success" role="alert">
86 86
       You already have this shift!
87 87
     </div>
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
       <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button>
90 90
       <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button>
91 91
     </div>';
92
-  }
93
-  else
94
-  {
92
+    }
93
+    else
94
+    {
95 95
     $page->body .= '<div class="alert alert-danger" role="alert">
96 96
       Someone else took this shift!
97 97
     </div>';
98
-  }
99
-  $page->printPage();
100
-  return;
98
+    }
99
+    $page->printPage();
100
+    return;
101 101
 }
102 102
 
103 103
 $overlap = false;
@@ -122,46 +122,46 @@  discard block
 block discarded – undo
122 122
 $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID']));
123 123
 if(!empty($depts))
124 124
 {
125
-  $deptName = $depts[0]['departmentName'];
125
+    $deptName = $depts[0]['departmentName'];
126 126
 }
127 127
 
128 128
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events');
129 129
 $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID']));
130 130
 if(!empty($events))
131 131
 {
132
-  if($events[0]['tickets'])
133
-  {
132
+    if($events[0]['tickets'])
133
+    {
134 134
     //TODO... Event requires tickets. Does this account have tickets?
135
-  }
135
+    }
136 136
 }
137 137
 
138 138
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles');
139 139
 $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID']));
140 140
 if(!empty($roles))
141 141
 {
142
-  $roleName = $roles[0]['display_name'];
142
+    $roleName = $roles[0]['display_name'];
143 143
 }
144 144
 
145 145
 //Is user eligible for shift?
146 146
 $canDo = $processor->canUserDoRole($profile, $roles[0]);
147 147
 if($canDo !== true)
148 148
 {
149
-  $page->body .= '<div class="alert alert-danger" role="alert">';
150
-  switch($canDo['whyClass'])
151
-  {
149
+    $page->body .= '<div class="alert alert-danger" role="alert">';
150
+    switch($canDo['whyClass'])
151
+    {
152 152
     case 'INVITE':
153 153
       $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>.';
154
-      break;
154
+        break;
155 155
     case 'CERT':
156 156
        $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.';
157
-       break;
157
+        break;
158 158
     default:
159 159
       $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg'];
160
-      break;
161
-  }
162
-  $page->body .= '</div>';
163
-  $page->printPage();
164
-  return;  
160
+        break;
161
+    }
162
+    $page->body .= '</div>';
163
+    $page->printPage();
164
+    return;  
165 165
 }
166 166
 
167 167
 $start = new \DateTime($shift['startTime']);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 $page->body .= '<div id="signupContent" ';
173 173
 if($overlap)
174 174
 {
175
-  $page->body .= 'class="d-none" ';
175
+    $page->body .= 'class="d-none" ';
176 176
 }
177 177
 $page->body .= '/>';
178 178
 $page->body .= '
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 if($processor->isAdminForShift($shift, $page->user) && (!isset($shift['participant']) || strlen($shift['participant']) === 0))
214 214
 {
215
-  $page->body .= '
215
+    $page->body .= '
216 216
   <div class="row d-none" id="adminSignup">
217 217
     <div class="alert alert-danger" role="alert">
218 218
       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.
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
 //Is group eligible?
230 230
 if(isset($shift['groupID']) && isset($roles[0]['groups_allowed']) && $roles[0]['groups_allowed'])
231 231
 {
232
-  $page->body .= '<div id="groupContent" ';
233
-  if($overlap)
234
-  {
232
+    $page->body .= '<div id="groupContent" ';
233
+    if($overlap)
234
+    {
235 235
     $page->body .= 'class="d-none" ';
236
-  }
237
-  $page->body .= '>
236
+    }
237
+    $page->body .= '>
238 238
   <div class="row">
239 239
     <div class="alert alert-primary" role="alert">
240 240
       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.