Completed
Push — FVSv2 ( e43498...abc2fa )
by Patrick
01:36
created
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   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  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);
49
+                 $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4);
50 50
                  if($cell->isInMergeRange())
51 51
                  {
52 52
                       continue;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $start = date_parse($str);
114 114
         $lastShift = $shifts[$count - 1];
115 115
         $interval = $lastShift['endTime']->diff($shifts[0]['startTime']);
116
-        $hourCount = ($interval->d*24) + $interval->h;
116
+        $hourCount = ($interval->d * 24) + $interval->h;
117 117
         $simpleHours = array();
118 118
         $militaryHours = array();
119 119
         $hour = $start['hour'];
@@ -194,32 +194,32 @@  discard block
 block discarded – undo
194 194
         {
195 195
             $i = 1;
196 196
             $timeDiff = $originalStartTime->diff($shift['startTime']);
197
-            $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h;
197
+            $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h;
198 198
             $firstRow = array_search($shift['roleID'], $rows);
199
-            $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4);
199
+            $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4);
200 200
             if($cell->isInMergeRange())
201 201
             {
202
-                while($rows[$firstRow+$i] === $shift['roleID'])
202
+                while($rows[$firstRow + $i] === $shift['roleID'])
203 203
                 {
204
-                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4+$i);
204
+                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i);
205 205
                     if(!$cell->isInMergeRange())
206 206
                     {
207 207
                         break;
208 208
                     }
209 209
                     $i++;
210 210
                 }
211
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $hoursFromStart+1+$shift['length'], $firstRow+4+$i);
212
-                $this->setShiftNameInCell($sheat, $hoursFromStart+2, $firstRow+4+$i, $shift);
211
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $hoursFromStart + 1 + $shift['length'], $firstRow + 4 + $i);
212
+                $this->setShiftNameInCell($sheat, $hoursFromStart + 2, $firstRow + 4 + $i, $shift);
213 213
             }
214 214
             else
215 215
             {
216
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4, $hoursFromStart+1+$shift['length'], $firstRow+4);
217
-                $this->setShiftNameInCell($sheat, $hoursFromStart+2, $firstRow+4, $shift);
216
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $hoursFromStart + 1 + $shift['length'], $firstRow + 4);
217
+                $this->setShiftNameInCell($sheat, $hoursFromStart + 2, $firstRow + 4, $shift);
218 218
             }
219 219
             $shift = array_shift($shifts);
220 220
         }
221 221
         $rowCount = count($rows);
222
-        $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3 + $rowCount);
222
+        $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + $rowCount);
223 223
         $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
224 224
         $hourCount = count($simpleHours);
225 225
         $this->grayOutUnused($hourCount, $rowCount, $sheat);
Please login to merge, or discard this patch.
signup.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  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 17
 
18 18
 $page = new VolunteerPage('Burning Flipside - Flipside Volunteer System');
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 if(!isset($_GET['shiftID']))
25 25
 {
26
-  $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
27
-  $page->printPage();
28
-  return;
26
+    $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!';
27
+    $page->printPage();
28
+    return;
29 29
 }
30 30
 
31 31
 $shiftID = $_GET['shiftID'];
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 $shifts = $dataTable->read($filter);
35 35
 if(empty($shifts))
36 36
 {
37
-  $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
38
-  $page->printPage();
39
-  return;
37
+    $page->body .= 'Error! Could not locate shift. You must have followed an old link!';
38
+    $page->printPage();
39
+    return;
40 40
 }
41 41
 $shift = $shifts[0];
42 42
 $myShift = new \VolunteerShift(false, $shift);
@@ -45,30 +45,30 @@  discard block
 block discarded – undo
45 45
 
46 46
 if($processor->isAdminForShift($shift, $page->user))
47 47
 {
48
-  if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
49
-  {
48
+    if(isset($shift['groupID']) && strlen($shift['groupID'] > 0))
49
+    {
50 50
     $page->body .= '
51 51
     <div class="alert alert-info" role="alert">
52 52
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
53 53
       Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>.
54 54
     </div>
55 55
     ';
56
-  }
57
-  else
58
-  {
56
+    }
57
+    else
58
+    {
59 59
     $page->body .= '
60 60
     <div class="alert alert-info" role="alert">
61 61
       You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>.
62 62
     </div>
63 63
     ';
64
-  }
64
+    }
65 65
 }
66 66
 
67 67
 //Is shift already taken?
68 68
 if(isset($entry['status']) && ($entry['status'] === 'pending' || $entry['status'] === 'filled'))
69 69
 {
70
-  if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
71
-  {
70
+    if(isset($shift['participant']) && $shift['participant'] === $page->user->uid)
71
+    {
72 72
     $page->body .= '<div class="alert alert-success" role="alert">
73 73
       You already have this shift!
74 74
     </div>
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
       <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button>
77 77
       <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button>
78 78
     </div>';
79
-  }
80
-  else
81
-  {
79
+    }
80
+    else
81
+    {
82 82
     $page->body .= '<div class="alert alert-danger" role="alert">
83 83
       Someone else took this shift!
84 84
     </div>';
85
-  }
86
-  $page->printPage();
87
-  return;
85
+    }
86
+    $page->printPage();
87
+    return;
88 88
 }
89 89
 
90 90
 $overlap = false;
@@ -109,46 +109,46 @@  discard block
 block discarded – undo
109 109
 $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID']));
110 110
 if(!empty($depts))
111 111
 {
112
-  $deptName = $depts[0]['departmentName'];
112
+    $deptName = $depts[0]['departmentName'];
113 113
 }
114 114
 
115 115
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events');
116 116
 $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID']));
117 117
 if(!empty($events))
118 118
 {
119
-  if($events[0]['tickets'])
120
-  {
119
+    if($events[0]['tickets'])
120
+    {
121 121
     //TODO... Event requires tickets. Does this account have tickets?
122
-  }
122
+    }
123 123
 }
124 124
 
125 125
 $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles');
126 126
 $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID']));
127 127
 if(!empty($roles))
128 128
 {
129
-  $roleName = $roles[0]['display_name'];
129
+    $roleName = $roles[0]['display_name'];
130 130
 }
131 131
 
132 132
 //Is user eligible for shift?
133 133
 $canDo = $processor->canUserDoRole($profile, $roles[0]);
134 134
 if($canDo !== true)
135 135
 {
136
-  $page->body .= '<div class="alert alert-danger" role="alert">';
137
-  switch($canDo['whyClass'])
138
-  {
136
+    $page->body .= '<div class="alert alert-danger" role="alert">';
137
+    switch($canDo['whyClass'])
138
+    {
139 139
     case 'INVITE':
140 140
       $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>.';
141
-      break;
141
+        break;
142 142
     case 'CERT':
143 143
        $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.';
144
-       break;
144
+        break;
145 145
     default:
146 146
       $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg'];
147
-      break;
148
-  }
149
-  $page->body .= '</div>';
150
-  $page->printPage();
151
-  return;  
147
+        break;
148
+    }
149
+    $page->body .= '</div>';
150
+    $page->printPage();
151
+    return;  
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.