Completed
Push — FVSv2 ( f8ec7e...1beff5 )
by Patrick
07:31
created
app/VolunteerAutoload.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
     $classname = ltrim($classname, '\\');
6 6
     $filename  = '';
7 7
     $namespace = '';
8
-    if ($lastNsPos = strrpos($classname, '\\'))
8
+    if($lastNsPos = strrpos($classname, '\\'))
9 9
     {
10 10
         $namespace = substr($classname, 0, $lastNsPos);
11 11
         $classname = substr($classname, $lastNsPos + 1);
12
-        $filename  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
12
+        $filename  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR;
13 13
     }
14 14
     $filename = __DIR__.DIRECTORY_SEPARATOR.$filename.'class.'.$classname.'.php'; 
15 15
     if(is_readable($filename))
Please login to merge, or discard this 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.
api/v1/class.DepartmentAPI.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -314,6 +314,9 @@
 block discarded – undo
314 314
         return $response;
315 315
     }
316 316
 
317
+    /**
318
+     * @param string $type
319
+     */
317 320
     public function generateGridSchedule($dept, $shifts, $request, $response, $type)
318 321
     {
319 322
         $ssheat = new Spreadsheet();
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 use PhpOffice\PhpSpreadsheet\Spreadsheet;
4 4
 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
5
-use PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf;
6 5
 
7 6
 class DepartmentAPI extends Http\Rest\DataTableAPI
8 7
 {
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $filter = new \Data\Filter("departmentID eq '$deptId'");
100 100
         $odata = $request->getAttribute('odata', new \ODataParams(array()));
101 101
         $roles = $dataTable->read($filter, $odata->select, $odata->top,
102
-                                  $odata->skip, $odata->orderby);
102
+                                    $odata->skip, $odata->orderby);
103 103
         if($roles === false)
104 104
         {
105 105
             $roles = array();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $filter = new \Data\Filter("departmentID eq '$deptId'");
124 124
         $odata = $request->getAttribute('odata', new \ODataParams(array()));
125 125
         $shifts = $dataTable->read($filter, $odata->select, $odata->top,
126
-                                  $odata->skip, $odata->orderby);
126
+                                    $odata->skip, $odata->orderby);
127 127
         if($shifts === false)
128 128
         {
129 129
             $shifts = array();
@@ -337,15 +337,15 @@  discard block
 block discarded – undo
337 337
             $shifts[$i]['length'] = $diff->h;
338 338
             if(!isset($roles[$shifts[$i]['roleID']]))
339 339
             {
340
-                 $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
341
-                 $roles2[$shifts[$i]['roleID']] = array();
340
+                    $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
341
+                    $roles2[$shifts[$i]['roleID']] = array();
342 342
             }
343 343
             else
344 344
             {
345
-                 if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length'])
346
-                 {
347
-                     $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
348
-                 }
345
+                    if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length'])
346
+                    {
347
+                        $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
348
+                    }
349 349
             }
350 350
             array_push($roles2[$shifts[$i]['roleID']], array('start'=>$start, 'end'=>$end));
351 351
         }
@@ -486,17 +486,17 @@  discard block
 block discarded – undo
486 486
         {
487 487
             for($j = 0; $j < count($rows); $j++)
488 488
             {
489
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
490
-                 if($cell->isInMergeRange())
491
-                 {
492
-                      continue;
493
-                 }
494
-                 else
495
-                 {
496
-                     $style = $cell->getStyle();
497
-                     $style->getBorders()->getAllBorders()->setBorderStyle(false);
498
-                     $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY);
499
-                 }
489
+                    $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
490
+                    if($cell->isInMergeRange())
491
+                    {
492
+                        continue;
493
+                    }
494
+                    else
495
+                    {
496
+                        $style = $cell->getStyle();
497
+                        $style->getBorders()->getAllBorders()->setBorderStyle(false);
498
+                        $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY);
499
+                    }
500 500
             }
501 501
         }
502 502
         $sheat->getColumnDimension('A')->setAutoSize(true);
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
     {
263 263
         $pdf = new \PDF\PDF();
264 264
         $html = '<body>';
265
-        $html.= '<style type="text/css">table {border-collapse: collapse;} table, th, td {border: 1px solid black;}</style>';
266
-        $html.= '<h1 style="text-align: center;">'.$dept['departmentName'].' Shift Schedule</h1>';
265
+        $html .= '<style type="text/css">table {border-collapse: collapse;} table, th, td {border: 1px solid black;}</style>';
266
+        $html .= '<h1 style="text-align: center;">'.$dept['departmentName'].' Shift Schedule</h1>';
267 267
         //Group shifts by day...
268 268
         $days = array();
269 269
         $count = count($shifts);
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             $timeStr = $start->format('g:i A').' till '.$end->format('g:i A');
278 278
             if(strlen($shifts[$i]['name']) > 0)
279 279
             {
280
-                $timeStr.=' - <i>'.$shifts[$i]['name'].'</i>';
280
+                $timeStr .= ' - <i>'.$shifts[$i]['name'].'</i>';
281 281
             }
282 282
             if(!isset($days[$dateStr]))
283 283
             {
@@ -292,22 +292,22 @@  discard block
 block discarded – undo
292 292
         ksort($days);
293 293
         foreach($days as $dateStr=>$day)
294 294
         {
295
-            $html.='<h2>'.$dateStr.'</h2>';
295
+            $html .= '<h2>'.$dateStr.'</h2>';
296 296
             uksort($day, array($this, 'groupSort'));
297 297
             foreach($day as $shiftStr=>$shifts)
298 298
             {
299 299
                 usort($shifts, array($this, 'shiftSort'));
300
-                $html.='<h3>'.$shiftStr.'</h3>';
301
-                $html.='<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
300
+                $html .= '<h3>'.$shiftStr.'</h3>';
301
+                $html .= '<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
302 302
                 foreach($shifts as $shift)
303 303
                 {
304 304
                     //TODO Volunteer info for shift...
305
-                    $html.='<tr><td>'.$this->getRoleNameFromID($shift['roleID']).'</td><td></td><td></td></tr>';
305
+                    $html .= '<tr><td>'.$this->getRoleNameFromID($shift['roleID']).'</td><td></td><td></td></tr>';
306 306
                 }
307
-                $html.='</table>';
307
+                $html .= '</table>';
308 308
             }
309 309
         }
310
-        $html.='</body>';
310
+        $html .= '</body>';
311 311
         $pdf->setPDFFromHTML($html);
312 312
         $response = $response->withHeader('Content-Type', 'application/pdf');
313 313
         $response->getBody()->write($pdf->toPDFBuffer());
@@ -354,9 +354,9 @@  discard block
 block discarded – undo
354 354
         $originalStartTime = $shifts[0]['startTime'];
355 355
         $str = $shifts[0]['startTime']->format('c');
356 356
         $start = date_parse($str);
357
-        $lastShift = $shifts[$count-1];
357
+        $lastShift = $shifts[$count - 1];
358 358
         $interval = $lastShift['endTime']->diff($shifts[0]['startTime']);
359
-        $hourCount = ($interval->d*24)+$interval->h;
359
+        $hourCount = ($interval->d * 24) + $interval->h;
360 360
         $simpleHours = array();
361 361
         $militaryHours = array();
362 362
         $hour = $start['hour'];
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                 }
382 382
                 else
383 383
                 {
384
-                    array_push($simpleHours, ($hour-12).'p');
384
+                    array_push($simpleHours, ($hour - 12).'p');
385 385
                 }
386 386
             }
387 387
             array_push($militaryHours, $hour.':00');
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         }
394 394
         $sheat->fromArray($simpleHours, null, 'B2');
395 395
         $sheat->fromArray($militaryHours, null, 'B3');
396
-        $mergeCount = 24-$start['hour'];
396
+        $mergeCount = 24 - $start['hour'];
397 397
         if($mergeCount > $hourCount)
398 398
         {
399 399
             $mergeCount = $hourCount;
@@ -402,12 +402,12 @@  discard block
 block discarded – undo
402 402
         $cellIndex = 2;
403 403
         while($mergeCount)
404 404
         {
405
-            $sheat->mergeCellsByColumnAndRow($cellIndex, 1, $cellIndex+$mergeCount-1, 1);
405
+            $sheat->mergeCellsByColumnAndRow($cellIndex, 1, $cellIndex + $mergeCount - 1, 1);
406 406
             $sheat->setCellValueByColumnAndRow($cellIndex, 1, array_shift($days));
407 407
             $cell = $sheat->getCellByColumnAndRow($cellIndex, 1);
408 408
             $cell->getStyle()->getAlignment()->setHorizontal('center');
409
-            $cellIndex+=$mergeCount;
410
-            $hourCount-=$mergeCount;
409
+            $cellIndex += $mergeCount;
410
+            $hourCount -= $mergeCount;
411 411
             $mergeCount = $hourCount;
412 412
             if($mergeCount > 24)
413 413
             {
@@ -418,13 +418,13 @@  discard block
 block discarded – undo
418 418
         $rows = array();
419 419
         foreach($roles as $role=>$hour)
420 420
         {
421
-            $sheat->setCellValueByColumnAndRow(1, 4+$i, $this->getRoleNameFromID($role));
421
+            $sheat->setCellValueByColumnAndRow(1, 4 + $i, $this->getRoleNameFromID($role));
422 422
             array_push($rows, $role);
423 423
             $overlaps = array();
424
-            for($j = 0; $j < count($roles2[$role])-1; $j++)
424
+            for($j = 0; $j < count($roles2[$role]) - 1; $j++)
425 425
             {
426 426
                 $currRole = $roles2[$role][$j];
427
-                $nextRole = $roles2[$role][$j+1];
427
+                $nextRole = $roles2[$role][$j + 1];
428 428
                 if($currRole['end'] > $nextRole['start'])
429 429
                 {
430 430
                     $str = $currRole['start']->format('c');
@@ -438,10 +438,10 @@  discard block
 block discarded – undo
438 438
             if(!empty($overlaps))
439 439
             {
440 440
                 $overlapCount = max(array_values($overlaps));
441
-                for($j = 0; $j < $overlapCount+1; $j++)
441
+                for($j = 0; $j < $overlapCount + 1; $j++)
442 442
                 {
443 443
                     $i++;
444
-                    $sheat->setCellValueByColumnAndRow(1, 4+$i, $this->getRoleNameFromID($role));
444
+                    $sheat->setCellValueByColumnAndRow(1, 4 + $i, $this->getRoleNameFromID($role));
445 445
                     if($j > 0)
446 446
                     {
447 447
                         array_push($rows, $role);
@@ -458,35 +458,35 @@  discard block
 block discarded – undo
458 458
         {
459 459
             $i = 1;
460 460
             $timeDiff = $originalStartTime->diff($shift['startTime']);
461
-            $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h;
461
+            $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h;
462 462
             $firstRow = array_search($shift['roleID'], $rows);
463
-            $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4);
463
+            $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4);
464 464
             if($cell->isInMergeRange())
465 465
             {
466
-                while($rows[$firstRow+$i] === $shift['roleID'])
466
+                while($rows[$firstRow + $i] === $shift['roleID'])
467 467
                 {
468
-                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4+$i);
468
+                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i);
469 469
                     if(!$cell->isInMergeRange())
470 470
                     {
471 471
                         break;
472 472
                     }
473 473
                     $i++;
474 474
                 }
475
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $hoursFromStart+1+$shift['length'], $firstRow+4+$i);
475
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $hoursFromStart + 1 + $shift['length'], $firstRow + 4 + $i);
476 476
             }
477 477
             else
478 478
             {
479
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4, $hoursFromStart+1+$shift['length'], $firstRow+4);
479
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $hoursFromStart + 1 + $shift['length'], $firstRow + 4);
480 480
             }
481 481
             $shift = array_shift($shifts);
482 482
         }
483
-        $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3+count($rows));
483
+        $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + count($rows));
484 484
         $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
485 485
         for($i = 0; $i < count($simpleHours); $i++)
486 486
         {
487 487
             for($j = 0; $j < count($rows); $j++)
488 488
             {
489
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
489
+                 $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4);
490 490
                  if($cell->isInMergeRange())
491 491
                  {
492 492
                       continue;
Please login to merge, or discard this patch.
api/v1/class.Processor.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -1,6 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 trait Processor
3 3
 {
4
+    /**
5
+     * @param string $certType
6
+     */
4 7
     protected function certCheck($requirements, $certs, $certType)
5 8
     {
6 9
         if(isset($requirements[$certType]) && $requirements[$certType])
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@
 block discarded – undo
261 261
             $tmp = $dataTable->read();
262 262
             foreach($tmp as $role)
263 263
             {
264
-               $roles[$role['short_name']] = $role;
264
+                $roles[$role['short_name']] = $role;
265 265
             }
266 266
         }
267 267
         $entry['isAdmin'] = $this->canUpdate($request, $entry);
Please login to merge, or discard this patch.
api/v1/class.ShiftAPI.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     protected function canUpdate($request, $entity)
42 42
     {
43
- 	if($this->isVolunteerAdmin($request))
43
+        if($this->isVolunteerAdmin($request))
44 44
         {
45 45
             return true;
46 46
         }
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
             $ret = $dataTable->update($filter, $entArray[$i]);
114 114
             if($ret === false)
115 115
             {
116
-               $myRet = false;
117
-               array_push($errors, $array[$i]);
116
+                $myRet = false;
117
+                array_push($errors, $array[$i]);
118 118
             }
119 119
         }
120 120
         if($myRet)
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             $leads = array();
185 185
             for($i = 0; $i < $count; $i++)
186 186
             {
187
-            	$leads = array_merge($leads, $this->getLeadForDepartment($overlaps[$i]['departmentID']));
187
+                $leads = array_merge($leads, $this->getLeadForDepartment($overlaps[$i]['departmentID']));
188 188
                 $overlaps[$i]['status'] = 'pending';
189 189
             }
190 190
             $leads = array_merge($leads, $this->getLeadForDepartment($entity['departmentID']));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,24 +59,24 @@
 block discarded – undo
59 59
 
60 60
     protected function genUUID()
61 61
     {
62
-        return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
62
+        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
63 63
             // 32 bits for "time_low"
64
-            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
64
+            mt_rand(0, 0xffff), mt_rand(0, 0xffff),
65 65
 
66 66
             // 16 bits for "time_mid"
67
-            mt_rand( 0, 0xffff ),
67
+            mt_rand(0, 0xffff),
68 68
 
69 69
             // 16 bits for "time_hi_and_version",
70 70
             // four most significant bits holds version number 4
71
-            mt_rand( 0, 0x0fff ) | 0x4000,
71
+            mt_rand(0, 0x0fff) | 0x4000,
72 72
 
73 73
             // 16 bits, 8 bits for "clk_seq_hi_res",
74 74
             // 8 bits for "clk_seq_low",
75 75
             // two most significant bits holds zero and one for variant DCE1.1
76
-            mt_rand( 0, 0x3fff ) | 0x8000,
76
+            mt_rand(0, 0x3fff) | 0x8000,
77 77
 
78 78
             // 48 bits for "node"
79
-            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
79
+            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
80 80
         );
81 81
     }
82 82
 
Please login to merge, or discard this patch.
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.
api/v1/class.ParticipantAPI.php 2 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.
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.
signup.php 2 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 class ProcessorUser
6 6
 {
7
-  use Processor;
7
+    use Processor;
8 8
 }
9 9
 
10 10
 $processor = new ProcessorUser();
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 
16 16
 if(!isset($_GET['shiftID']))
17 17
 {
18
-  $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
19
-  $page->printPage();
20
-  return;
18
+    $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
19
+    $page->printPage();
20
+    return;
21 21
 }
22 22
 
23 23
 $shiftID = $_GET['shiftID'];
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 $shifts = $dataTable->read($filter);
27 27
 if(empty($shifts))
28 28
 {
29
-  $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
30
-  $page->printPage();
31
-  return;
29
+    $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
30
+    $page->printPage();
31
+    return;
32 32
 }
33 33
 $shift = $shifts[0];
34 34
 
@@ -36,38 +36,38 @@  discard block
 block discarded – undo
36 36
 $profiles = $dataTable->read(new \Data\Filter('uid eq '.$page->user->uid));
37 37
 if(empty($profiles))
38 38
 {
39
-  $page->body .= 'Error! Could not locate user profile!';
40
-  $page->printPage();
41
-  return;
39
+    $page->body .= 'Error! Could not locate user profile!';
40
+    $page->printPage();
41
+    return;
42 42
 }
43 43
 $profile = $profiles[0];
44 44
 
45 45
 if($processor->isAdminForShift($shift, $page->user))
46 46
 {
47
-  if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
48
-  {
47
+    if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
48
+    {
49 49
     $page->body .= '
50 50
     <div class="alert alert-info" role="alert">
51 51
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
52 52
       Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>.
53 53
     </div>
54 54
     ';
55
-  }
56
-  else
57
-  {
55
+    }
56
+    else
57
+    {
58 58
     $page->body .= '
59 59
     <div class="alert alert-info" role="alert">
60 60
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
61 61
     </div>
62 62
     ';
63
-  }
63
+    }
64 64
 }
65 65
 
66 66
 //Is shift already taken?
67 67
 if(isset($entry['status']) && ($entry['status'] === 'pending' || $entry['status'] === 'filled'))
68 68
 {
69
-  if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
70
-  {
69
+    if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
70
+    {
71 71
     $page->body .= '<div class="alert alert-success" role="alert">
72 72
       You already have this shift!
73 73
     </div>
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
       <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button>
76 76
       <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button>
77 77
     </div>';
78
-  }
79
-  else
80
-  {
78
+    }
79
+    else
80
+    {
81 81
     $page->body .= '<div class="alert alert-danger" role="alert">
82 82
       Someone else took this shift!
83 83
     </div>';
84
-  }
85
-  $page->printPage();
86
-  return;
84
+    }
85
+    $page->printPage();
86
+    return;
87 87
 }
88 88
 
89 89
 $overlap = false;
@@ -108,47 +108,47 @@  discard block
 block discarded – undo
108 108
 $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID']));
109 109
 if(!empty($depts))
110 110
 {
111
-  $deptName = $depts[0]['departmentName'];
111
+    $deptName = $depts[0]['departmentName'];
112 112
 }
113 113
 
114 114
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events');
115 115
 $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID']));
116 116
 if(!empty($events))
117 117
 {
118
-  if($events[0]['tickets'])
119
-  {
118
+    if($events[0]['tickets'])
119
+    {
120 120
     //TODO... Event requires tickets. Does this account have tickets?
121
-  }
121
+    }
122 122
 }
123 123
 
124 124
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles');
125 125
 $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID']));
126 126
 if(!empty($roles))
127 127
 {
128
-  $roleName = $roles[0]['display_name'];
128
+    $roleName = $roles[0]['display_name'];
129 129
 }
130 130
 
131 131
 //Is user eligible for shift?
132 132
 $canDo = $processor->canUserDoRole($profile, $roles[0]);
133 133
 if($canDo !== true)
134 134
 {
135
-  $page->body .= '<div class="alert alert-danger" role="alert">';
136
-  switch($canDo['whyClass'])
137
-  {
135
+    $page->body .= '<div class="alert alert-danger" role="alert">';
136
+    switch($canDo['whyClass'])
137
+    {
138 138
     case 'INVITE':
139 139
       $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>.';
140
-      break;
140
+        break;
141 141
     case 'CERT':
142 142
        $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.';
143
-       break;
143
+        break;
144 144
     default:
145 145
       $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg'];
146
-      break;
147
-  }
148
-  $page->body .= '</div>';
149
-  $page->printPage();
150
-  return;  
151
-  var_dump($canDo); die();
146
+        break;
147
+    }
148
+    $page->body .= '</div>';
149
+    $page->printPage();
150
+    return;  
151
+    var_dump($canDo); die();
152 152
 }
153 153
 
154 154
 $start = new \DateTime($shift['startTime']);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 $page->body .= '<div id="signupContent" ';
160 160
 if($overlap)
161 161
 {
162
-  $page->body .= 'class="d-none" ';
162
+    $page->body .= 'class="d-none" ';
163 163
 }
164 164
 $page->body .= '/>';
165 165
 $page->body .= '
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 //Is group eligible?
201 201
 if(isset($shift['groupID']) && isset($roles[0]['groups_allowed']) && $roles[0]['groups_allowed'])
202 202
 {
203
-  $page->body .= '
203
+    $page->body .= '
204 204
   <div class="row">
205 205
     <div class="alert alert-primary" role="alert">
206 206
       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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@
 block discarded – undo
154 154
 $start = new \DateTime($shift['startTime']);
155 155
 $end = new \DateTime($shift['endTime']);
156 156
 $diff = $end->diff($start);
157
-$shiftLength = $diff->h + ($diff->i/60.0);
157
+$shiftLength = $diff->h + ($diff->i / 60.0);
158 158
 
159 159
 $page->body .= '<div id="signupContent" ';
160 160
 if($overlap)
Please login to merge, or discard this patch.
class.VolunteerPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         }
30 30
     }
31 31
 
32
-    function printPage($header=true)
32
+    function printPage($header = true)
33 33
     {
34 34
         if($this->user === false || $this->user === null)
35 35
         {
Please login to merge, or discard this patch.
_admin/roles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 $page->content['selectors'] = '<div class="col-sm2"><button type="button" class="btn btn-primary" id="newRoleBtn" onclick="showRoleWizard();">New Role</button></div>';
14 14
 if(!isset($_GET['dept']))
15 15
 {
16
-    $page->content['selectors'].='<div class="col-sm4"><select class="form-control" id="deptFilter"><option value="*"></option></select></div>';
16
+    $page->content['selectors'] .= '<div class="col-sm4"><select class="form-control" id="deptFilter"><option value="*"></option></select></div>';
17 17
 }
18 18
 $page->content['body'] = '
19 19
 <div class="modal fade bd-example-modal-lg" id="roleWizard" tabindex="-1" role="dialog" aria-labelledby="roleWizardTitle" aria-hidden="true" data-backdrop="static" data-complete="newRole">
Please login to merge, or discard this patch.