@@ -1,6 +1,9 @@ |
||
| 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]) |
@@ -35,7 +35,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -242,6 +242,9 @@ |
||
| 242 | 242 | return $response; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | + /** |
|
| 246 | + * @param string $type |
|
| 247 | + */ |
|
| 245 | 248 | public function generateGridSchedule($dept, $shifts, $response, $type) |
| 246 | 249 | { |
| 247 | 250 | $ss = new \Schedules\GridSchedule($dept, $shifts); |
@@ -5,6 +5,9 @@ |
||
| 5 | 5 | protected $isAdmin = null; |
| 6 | 6 | protected $isLead = null; |
| 7 | 7 | |
| 8 | + /** |
|
| 9 | + * @param string $dataTableName |
|
| 10 | + */ |
|
| 8 | 11 | public function __construct($dataTableName, $idField = '_id') |
| 9 | 12 | { |
| 10 | 13 | parent::__construct('fvs', $dataTableName, $idField); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $start = date_parse($str); |
| 85 | 85 | $lastShift = $shifts[$count - 1]; |
| 86 | 86 | $interval = $lastShift['endTime']->diff($shifts[0]['startTime']); |
| 87 | - $hourCount = ($interval->d*24) + $interval->h; |
|
| 87 | + $hourCount = ($interval->d * 24) + $interval->h; |
|
| 88 | 88 | $simpleHours = array(); |
| 89 | 89 | $militaryHours = array(); |
| 90 | 90 | $hour = $start['hour']; |
@@ -165,45 +165,45 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $i = 1; |
| 167 | 167 | $timeDiff = $originalStartTime->diff($shift['startTime']); |
| 168 | - $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h; |
|
| 168 | + $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h; |
|
| 169 | 169 | $firstRow = array_search($shift['roleID'], $rows); |
| 170 | - $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4); |
|
| 170 | + $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4); |
|
| 171 | 171 | if($cell->isInMergeRange()) |
| 172 | 172 | { |
| 173 | - while($rows[$firstRow+$i] === $shift['roleID']) |
|
| 173 | + while($rows[$firstRow + $i] === $shift['roleID']) |
|
| 174 | 174 | { |
| 175 | - $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4+$i); |
|
| 175 | + $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i); |
|
| 176 | 176 | if(!$cell->isInMergeRange()) |
| 177 | 177 | { |
| 178 | 178 | break; |
| 179 | 179 | } |
| 180 | 180 | $i++; |
| 181 | 181 | } |
| 182 | - $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $hoursFromStart+1+$shift['length'], $firstRow+4+$i); |
|
| 182 | + $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $hoursFromStart + 1 + $shift['length'], $firstRow + 4 + $i); |
|
| 183 | 183 | if(isset($shift['participant'])) |
| 184 | 184 | { |
| 185 | - $sheat->setCellValueByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $this->getParticipantDiplayName($shift['participant'])); |
|
| 185 | + $sheat->setCellValueByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $this->getParticipantDiplayName($shift['participant'])); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | else |
| 189 | 189 | { |
| 190 | - $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4, $hoursFromStart+1+$shift['length'], $firstRow+4); |
|
| 190 | + $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $hoursFromStart + 1 + $shift['length'], $firstRow + 4); |
|
| 191 | 191 | if(isset($shift['participant'])) |
| 192 | 192 | { |
| 193 | - $sheat->setCellValueByColumnAndRow($hoursFromStart+2, $firstRow+4, $this->getParticipantDiplayName($shift['participant'])); |
|
| 193 | + $sheat->setCellValueByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $this->getParticipantDiplayName($shift['participant'])); |
|
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | $shift = array_shift($shifts); |
| 197 | 197 | } |
| 198 | 198 | $rowCount = count($rows); |
| 199 | - $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3 + $rowCount); |
|
| 199 | + $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + $rowCount); |
|
| 200 | 200 | $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN); |
| 201 | 201 | $hourCount = count($simpleHours); |
| 202 | 202 | for($i = 0; $i < $hourCount; $i++) |
| 203 | 203 | { |
| 204 | 204 | for($j = 0; $j < $rowCount; $j++) |
| 205 | 205 | { |
| 206 | - $cell = $sheat->getCellByColumnAndRow($i+2, $j+4); |
|
| 206 | + $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4); |
|
| 207 | 207 | if($cell->isInMergeRange()) |
| 208 | 208 | { |
| 209 | 209 | continue; |