Completed
Push — FVSv2 ( 10d7ab...2b5aa4 )
by Patrick
01:37
created
app/Schedules/class.SimplePDF.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $timeStr = $start->format('g:i A').' till '.$end->format('g:i A');
36 36
             if(strlen($shifts[$i]['name']) > 0)
37 37
             {
38
-                $timeStr .=' - <i>'.$shifts[$i]['name'].'</i>';
38
+                $timeStr .= ' - <i>'.$shifts[$i]['name'].'</i>';
39 39
             }
40 40
             if(!isset($days[$dateStr]))
41 41
             {
@@ -50,22 +50,22 @@  discard block
 block discarded – undo
50 50
         ksort($days);
51 51
         foreach($days as $dateStr=>$day)
52 52
         {
53
-            $html .='<h2>'.$dateStr.'</h2>';
53
+            $html .= '<h2>'.$dateStr.'</h2>';
54 54
             uksort($day, array($this, 'groupSort'));
55 55
             foreach($day as $shiftStr=>$shifts)
56 56
             {
57 57
                 usort($shifts, array($this, 'shiftSort'));
58
-                $html .='<h3>'.$shiftStr.'</h3>';
59
-                $html .='<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
58
+                $html .= '<h3>'.$shiftStr.'</h3>';
59
+                $html .= '<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
60 60
                 foreach($shifts as $shift)
61 61
                 {
62 62
                     //TODO Volunteer info for shift...
63
-                    $html .='<tr><td>'.$this->getRoleNameFromID($shift['roleID']).'</td><td></td><td></td></tr>';
63
+                    $html .= '<tr><td>'.$this->getRoleNameFromID($shift['roleID']).'</td><td></td><td></td></tr>';
64 64
                 }
65
-                $html .='</table>';
65
+                $html .= '</table>';
66 66
             }
67 67
         }
68
-        $html .='</body>';
68
+        $html .= '</body>';
69 69
         $this->setPDFFromHTML($html);
70 70
     }
71 71
 } 
Please login to merge, or discard this patch.
app/Schedules/class.GridSchedule.php 1 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.ParticipantAPI.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -103,24 +103,24 @@
 block discarded – undo
103 103
         $filter = new \Data\Filter("participant eq '$uid'");
104 104
         $shifts = $dataTable->read($filter);
105 105
         $text = "BEGIN:VCALENDAR\r\n";
106
-        $text.= "VERSION:2.0\r\n";
107
-        $text.= "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n";
106
+        $text .= "VERSION:2.0\r\n";
107
+        $text .= "PRODID:-//hacksw/handcal//NONSGML v1.0//EN\r\n";
108 108
         $count = count($shifts);
109 109
         for($i = 0; $i < $count; $i++)
110 110
         {
111
-            $text.= "BEGIN:VEVENT\r\n";
112
-            $text.= "UID:".$this->user->mail."\r\n";
111
+            $text .= "BEGIN:VEVENT\r\n";
112
+            $text .= "UID:".$this->user->mail."\r\n";
113 113
             $d = new DateTime($shifts[$i]['startTime']);
114 114
             $d->setTimezone(new \DateTimeZone('UTC'));
115
-            $text.= "DTSTAMP:".$d->format('Ymd\THis\Z')."\r\n";
116
-            $text.= "DTSTART:".$d->format('Ymd\THis\Z')."\r\n";
115
+            $text .= "DTSTAMP:".$d->format('Ymd\THis\Z')."\r\n";
116
+            $text .= "DTSTART:".$d->format('Ymd\THis\Z')."\r\n";
117 117
             $d = new DateTime($shifts[$i]['endTime']);
118 118
             $d->setTimezone(new \DateTimeZone('UTC'));
119
-            $text.= "DTEND:".$d->format('Ymd\THis\Z')."\r\n";
120
-            $text.= "SUMMARY:".$shifts[$i]['roleID'].' '.$shifts[$i]['name']."\r\n";
121
-            $text.= "END:VEVENT\r\n";
119
+            $text .= "DTEND:".$d->format('Ymd\THis\Z')."\r\n";
120
+            $text .= "SUMMARY:".$shifts[$i]['roleID'].' '.$shifts[$i]['name']."\r\n";
121
+            $text .= "END:VEVENT\r\n";
122 122
         }
123
-        $text.= "END:VCALENDAR\r\n";
123
+        $text .= "END:VCALENDAR\r\n";
124 124
         $response = $response->withHeader('Content-type', 'text/calendar');
125 125
         $response = $response->withHeader('Content-Disposition', 'attachment; filename="MyShifts.ics"');
126 126
         $body = $response->getBody();
Please login to merge, or discard this patch.