@@ -46,17 +46,17 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -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); |
@@ -5,19 +5,19 @@ discard block |
||
| 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 | - protected function isVolunteerAdmin() |
|
| 18 | - { |
|
| 19 | - return $this->isAdmin; |
|
| 20 | - } |
|
| 17 | + protected function isVolunteerAdmin() |
|
| 18 | + { |
|
| 19 | + return $this->isAdmin; |
|
| 20 | + } |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $page = new VolunteerPage('Burning Flipside - Flipside Volunteer System'); |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if(!isset($_GET['shiftID'])) |
| 30 | 30 | { |
| 31 | - $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!'; |
|
| 32 | - $page->printPage(); |
|
| 33 | - return; |
|
| 31 | + $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!'; |
|
| 32 | + $page->printPage(); |
|
| 33 | + return; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $shiftID = $_GET['shiftID']; |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | $shifts = $dataTable->read($filter); |
| 40 | 40 | if(empty($shifts)) |
| 41 | 41 | { |
| 42 | - $page->body .= 'Error! Could not locate shift. You must have followed an old link!'; |
|
| 43 | - $page->printPage(); |
|
| 44 | - return; |
|
| 42 | + $page->body .= 'Error! Could not locate shift. You must have followed an old link!'; |
|
| 43 | + $page->printPage(); |
|
| 44 | + return; |
|
| 45 | 45 | } |
| 46 | 46 | $shift = $shifts[0]; |
| 47 | 47 | $myShift = new \VolunteerShift(false, $shift); |
@@ -50,30 +50,30 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | if($processor->isAdminForShift($shift, $page->user)) |
| 52 | 52 | { |
| 53 | - if(isset($shift['groupID']) && strlen($shift['groupID'] > 0)) |
|
| 54 | - { |
|
| 53 | + if(isset($shift['groupID']) && strlen($shift['groupID'] > 0)) |
|
| 54 | + { |
|
| 55 | 55 | $page->body .= ' |
| 56 | 56 | <div class="alert alert-info" role="alert"> |
| 57 | 57 | You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>. |
| 58 | 58 | Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>. |
| 59 | 59 | </div> |
| 60 | 60 | '; |
| 61 | - } |
|
| 62 | - else |
|
| 63 | - { |
|
| 61 | + } |
|
| 62 | + else |
|
| 63 | + { |
|
| 64 | 64 | $page->body .= ' |
| 65 | 65 | <div class="alert alert-info" role="alert"> |
| 66 | 66 | You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>. |
| 67 | 67 | </div> |
| 68 | 68 | '; |
| 69 | - } |
|
| 69 | + } |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | //Is shift already taken? |
| 73 | 73 | if(isset($entry['status']) && ($entry['status'] === 'pending' || $entry['status'] === 'filled')) |
| 74 | 74 | { |
| 75 | - if(isset($shift['participant']) && $shift['participant'] === $page->user->uid) |
|
| 76 | - { |
|
| 75 | + if(isset($shift['participant']) && $shift['participant'] === $page->user->uid) |
|
| 76 | + { |
|
| 77 | 77 | $page->body .= '<div class="alert alert-success" role="alert"> |
| 78 | 78 | You already have this shift! |
| 79 | 79 | </div> |
@@ -81,15 +81,15 @@ discard block |
||
| 81 | 81 | <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button> |
| 82 | 82 | <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button> |
| 83 | 83 | </div>'; |
| 84 | - } |
|
| 85 | - else |
|
| 86 | - { |
|
| 84 | + } |
|
| 85 | + else |
|
| 86 | + { |
|
| 87 | 87 | $page->body .= '<div class="alert alert-danger" role="alert"> |
| 88 | 88 | Someone else took this shift! |
| 89 | 89 | </div>'; |
| 90 | - } |
|
| 91 | - $page->printPage(); |
|
| 92 | - return; |
|
| 90 | + } |
|
| 91 | + $page->printPage(); |
|
| 92 | + return; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $overlap = false; |
@@ -114,46 +114,46 @@ discard block |
||
| 114 | 114 | $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID'])); |
| 115 | 115 | if(!empty($depts)) |
| 116 | 116 | { |
| 117 | - $deptName = $depts[0]['departmentName']; |
|
| 117 | + $deptName = $depts[0]['departmentName']; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events'); |
| 121 | 121 | $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID'])); |
| 122 | 122 | if(!empty($events)) |
| 123 | 123 | { |
| 124 | - if($events[0]['tickets']) |
|
| 125 | - { |
|
| 124 | + if($events[0]['tickets']) |
|
| 125 | + { |
|
| 126 | 126 | //TODO... Event requires tickets. Does this account have tickets? |
| 127 | - } |
|
| 127 | + } |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles'); |
| 131 | 131 | $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID'])); |
| 132 | 132 | if(!empty($roles)) |
| 133 | 133 | { |
| 134 | - $roleName = $roles[0]['display_name']; |
|
| 134 | + $roleName = $roles[0]['display_name']; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | //Is user eligible for shift? |
| 138 | 138 | $canDo = $processor->canUserDoRole($profile, $roles[0]); |
| 139 | 139 | if($canDo !== true) |
| 140 | 140 | { |
| 141 | - $page->body .= '<div class="alert alert-danger" role="alert">'; |
|
| 142 | - switch($canDo['whyClass']) |
|
| 143 | - { |
|
| 141 | + $page->body .= '<div class="alert alert-danger" role="alert">'; |
|
| 142 | + switch($canDo['whyClass']) |
|
| 143 | + { |
|
| 144 | 144 | case 'INVITE': |
| 145 | 145 | $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>.'; |
| 146 | - break; |
|
| 146 | + break; |
|
| 147 | 147 | case 'CERT': |
| 148 | 148 | $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.'; |
| 149 | - break; |
|
| 149 | + break; |
|
| 150 | 150 | default: |
| 151 | 151 | $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg']; |
| 152 | - break; |
|
| 153 | - } |
|
| 154 | - $page->body .= '</div>'; |
|
| 155 | - $page->printPage(); |
|
| 156 | - return; |
|
| 152 | + break; |
|
| 153 | + } |
|
| 154 | + $page->body .= '</div>'; |
|
| 155 | + $page->printPage(); |
|
| 156 | + return; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $start = new \DateTime($shift['startTime']); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $page->body .= '<div id="signupContent" '; |
| 165 | 165 | if($overlap) |
| 166 | 166 | { |
| 167 | - $page->body .= 'class="d-none" '; |
|
| 167 | + $page->body .= 'class="d-none" '; |
|
| 168 | 168 | } |
| 169 | 169 | $page->body .= '/>'; |
| 170 | 170 | $page->body .= ' |
@@ -205,12 +205,12 @@ discard block |
||
| 205 | 205 | //Is group eligible? |
| 206 | 206 | if(isset($shift['groupID']) && isset($roles[0]['groups_allowed']) && $roles[0]['groups_allowed']) |
| 207 | 207 | { |
| 208 | - $page->body .= '<div id="groupContent" '; |
|
| 209 | - if($overlap) |
|
| 210 | - { |
|
| 208 | + $page->body .= '<div id="groupContent" '; |
|
| 209 | + if($overlap) |
|
| 210 | + { |
|
| 211 | 211 | $page->body .= 'class="d-none" '; |
| 212 | - } |
|
| 213 | - $page->body .= '> |
|
| 212 | + } |
|
| 213 | + $page->body .= '> |
|
| 214 | 214 | <div class="row"> |
| 215 | 215 | <div class="alert alert-primary" role="alert"> |
| 216 | 216 | 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? |