@@ -51,7 +51,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $page->body .= '<div class="row"><h3>Filled Shifts</h3></div><div class="row"><table class="table"><tr><th>Role</th><th>Participant</th></tr>'; |
| 50 | 50 | foreach($filled as $shift) |
| 51 | 51 | { |
| 52 | - $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$shift->webParticipantName.'</td></tr>'; |
|
| 52 | + $page->body .= '<tr><td>'.$shift->role->display_name.'</td><td>'.$shift->webParticipantName.'</td></tr>'; |
|
| 53 | 53 | } |
| 54 | 54 | $page->body .= '</table></div>'; |
| 55 | 55 | $page->body .= '<div class="row"><h3>Unfilled Shifts</h3></div><div class="row"><table class="table"><tr><th>Role</th><th>Sign Up</th></tr>'; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | $cell = '<button type="button" class="btn btn-primary" onClick="signUp(\''.$shift->_id.'\');">Sign Up</button>'; |
| 62 | 62 | } |
| 63 | - $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$cell.'</td></tr>'; |
|
| 63 | + $page->body .= '<tr><td>'.$shift->role->display_name.'</td><td>'.$cell.'</td></tr>'; |
|
| 64 | 64 | } |
| 65 | 65 | $page->body .= '</table></div>'; |
| 66 | 66 | $page->printPage(); |
@@ -63,7 +63,7 @@ |
||
| 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 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $timeStr = $start->format('g:i A').' till '.$end->format('g:i A'); |
| 46 | 46 | if(strlen($shifts[$i]['name']) > 0) |
| 47 | 47 | { |
| 48 | - $timeStr .=' - <i>'.$shifts[$i]['name'].'</i>'; |
|
| 48 | + $timeStr .= ' - <i>'.$shifts[$i]['name'].'</i>'; |
|
| 49 | 49 | } |
| 50 | 50 | if(!isset($days[$dateStr])) |
| 51 | 51 | { |
@@ -60,30 +60,30 @@ discard block |
||
| 60 | 60 | uksort($days, array($this, 'daySort')); |
| 61 | 61 | foreach($days as $dateStr=>$day) |
| 62 | 62 | { |
| 63 | - $html .='<h2>'.$dateStr.'</h2>'; |
|
| 63 | + $html .= '<h2>'.$dateStr.'</h2>'; |
|
| 64 | 64 | uksort($day, array($this, 'groupSort')); |
| 65 | 65 | foreach($day as $shiftStr=>$shifts) |
| 66 | 66 | { |
| 67 | 67 | usort($shifts, array($this, 'shiftSort')); |
| 68 | - $html .='<h3>'.$shiftStr.'</h3>'; |
|
| 69 | - $html .='<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>'; |
|
| 68 | + $html .= '<h3>'.$shiftStr.'</h3>'; |
|
| 69 | + $html .= '<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>'; |
|
| 70 | 70 | foreach($shifts as $shift) |
| 71 | 71 | { |
| 72 | 72 | $shift = new \VolunteerShift(false, $shift); |
| 73 | 73 | $participant = $shift->participantObj; |
| 74 | 74 | if($participant !== false) |
| 75 | 75 | { |
| 76 | - $html .='<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td>'.$participant->getDisplayName('paperName').'</td><td>'.$participant->campName.'</td></tr>'; |
|
| 76 | + $html .= '<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td>'.$participant->getDisplayName('paperName').'</td><td>'.$participant->campName.'</td></tr>'; |
|
| 77 | 77 | } |
| 78 | 78 | else |
| 79 | 79 | { |
| 80 | - $html .='<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td></td><td></td></tr>'; |
|
| 80 | + $html .= '<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td></td><td></td></tr>'; |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | - $html .='</table>'; |
|
| 83 | + $html .= '</table>'; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | - $html .='</body>'; |
|
| 86 | + $html .= '</body>'; |
|
| 87 | 87 | $this->setPDFFromHTML($html); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -106,24 +106,24 @@ |
||
| 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(); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $uid = $this->user->uid; |
| 45 | 45 | $email = $this->user->mail; |
| 46 | 46 | $filter = new \Data\Filter("others eq $uid or others eq $email"); |
| 47 | - $dataTable = DataSetFactory::getDataTableByNames('fvs','departments'); |
|
| 47 | + $dataTable = DataSetFactory::getDataTableByNames('fvs', 'departments'); |
|
| 48 | 48 | $depts = $dataTable->read($filter); |
| 49 | 49 | $this->isLead = !empty($depts); |
| 50 | 50 | $this->is_admin = true; |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | $end = strpos($rawText, "</script>"); |
| 77 | 77 | if($index === 0) |
| 78 | 78 | { |
| 79 | - $rawText = substr($rawText, $end+9); |
|
| 79 | + $rawText = substr($rawText, $end + 9); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | return strtr(strip_tags($rawText), $vars); |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | $end = strpos($rawText, "</script>"); |
| 77 | 77 | if($index === 0) |
| 78 | 78 | { |
| 79 | - $rawText = substr($rawText, $end+9); |
|
| 79 | + $rawText = substr($rawText, $end + 9); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | return strtr(strip_tags($rawText), $vars); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | if($eeListIndex === 1 || $eeListIndex === 0) |
| 12 | 12 | { |
| 13 | 13 | //Check earlier EE lists too |
| 14 | - $val = $this->hasVolOnEEList($uid, $eeListIndex+1); |
|
| 14 | + $val = $this->hasVolOnEEList($uid, $eeListIndex + 1); |
|
| 15 | 15 | if($val === true) |
| 16 | 16 | { |
| 17 | 17 | return true; |