@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | protected function canUpdate($request, $entity) |
| 42 | 42 | { |
| 43 | - if($this->isVolunteerAdmin($request)) |
|
| 43 | + if($this->isVolunteerAdmin($request)) |
|
| 44 | 44 | { |
| 45 | 45 | return true; |
| 46 | 46 | } |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $ret = $dataTable->update($filter, $entArray[$i]); |
| 114 | 114 | if($ret === false) |
| 115 | 115 | { |
| 116 | - $myRet = false; |
|
| 117 | - array_push($errors, $array[$i]); |
|
| 116 | + $myRet = false; |
|
| 117 | + array_push($errors, $array[$i]); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | if($myRet) |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $leads = array(); |
| 185 | 185 | for($i = 0; $i < $count; $i++) |
| 186 | 186 | { |
| 187 | - $leads = array_merge($leads, $this->getLeadForDepartment($overlaps[$i]['departmentID'])); |
|
| 187 | + $leads = array_merge($leads, $this->getLeadForDepartment($overlaps[$i]['departmentID'])); |
|
| 188 | 188 | $overlaps[$i]['status'] = 'pending'; |
| 189 | 189 | } |
| 190 | 190 | $leads = array_merge($leads, $this->getLeadForDepartment($entity['departmentID'])); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | protected function canUpdate($request, $entity) |
| 37 | 37 | { |
| 38 | - if($this->isVolunteerAdmin($request)) |
|
| 38 | + if($this->isVolunteerAdmin($request)) |
|
| 39 | 39 | { |
| 40 | 40 | return true; |
| 41 | 41 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
| 84 | 84 | $filter = $this->getFilterForPrimaryKey($uid); |
| 85 | 85 | $areas = $dataTable->read($filter, $odata->select, $odata->top, |
| 86 | - $odata->skip, $odata->orderby); |
|
| 86 | + $odata->skip, $odata->orderby); |
|
| 87 | 87 | if(empty($areas)) |
| 88 | 88 | { |
| 89 | 89 | return $response->withStatus(404); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | protected function canUpdate($request, $entity) |
| 39 | 39 | { |
| 40 | - if($this->isVolunteerAdmin($request)) |
|
| 40 | + if($this->isVolunteerAdmin($request)) |
|
| 41 | 41 | { |
| 42 | 42 | return true; |
| 43 | 43 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | $shifts = $dataTable->read($filter, $odata->select, $odata->top, |
| 99 | - $odata->skip, $odata->orderby); |
|
| 99 | + $odata->skip, $odata->orderby); |
|
| 100 | 100 | if($shifts === false) |
| 101 | 101 | { |
| 102 | 102 | $shifts = array(); |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | class ProcessorUser |
| 6 | 6 | { |
| 7 | - use Processor; |
|
| 7 | + use Processor; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $processor = new ProcessorUser(); |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | if(!isset($_GET['shiftID'])) |
| 17 | 17 | { |
| 18 | - $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!'; |
|
| 19 | - $page->printPage(); |
|
| 20 | - return; |
|
| 18 | + $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!'; |
|
| 19 | + $page->printPage(); |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $shiftID = $_GET['shiftID']; |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | $shifts = $dataTable->read($filter); |
| 27 | 27 | if(empty($shifts)) |
| 28 | 28 | { |
| 29 | - $page->body .= 'Error! Could not locate shift. You must have followed an old link!'; |
|
| 30 | - $page->printPage(); |
|
| 31 | - return; |
|
| 29 | + $page->body .= 'Error! Could not locate shift. You must have followed an old link!'; |
|
| 30 | + $page->printPage(); |
|
| 31 | + return; |
|
| 32 | 32 | } |
| 33 | 33 | $shift = $shifts[0]; |
| 34 | 34 | |
@@ -36,38 +36,38 @@ discard block |
||
| 36 | 36 | $profiles = $dataTable->read(new \Data\Filter('uid eq '.$page->user->uid)); |
| 37 | 37 | if(empty($profiles)) |
| 38 | 38 | { |
| 39 | - $page->body .= 'Error! Could not locate user profile!'; |
|
| 40 | - $page->printPage(); |
|
| 41 | - return; |
|
| 39 | + $page->body .= 'Error! Could not locate user profile!'; |
|
| 40 | + $page->printPage(); |
|
| 41 | + return; |
|
| 42 | 42 | } |
| 43 | 43 | $profile = $profiles[0]; |
| 44 | 44 | |
| 45 | 45 | if($processor->isAdminForShift($shift, $page->user)) |
| 46 | 46 | { |
| 47 | - if(isset($shift['groupID']) && strlen($shift['groupID'] > 0)) |
|
| 48 | - { |
|
| 47 | + if(isset($shift['groupID']) && strlen($shift['groupID'] > 0)) |
|
| 48 | + { |
|
| 49 | 49 | $page->body .= ' |
| 50 | 50 | <div class="alert alert-info" role="alert"> |
| 51 | 51 | You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>. |
| 52 | 52 | Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>. |
| 53 | 53 | </div> |
| 54 | 54 | '; |
| 55 | - } |
|
| 56 | - else |
|
| 57 | - { |
|
| 55 | + } |
|
| 56 | + else |
|
| 57 | + { |
|
| 58 | 58 | $page->body .= ' |
| 59 | 59 | <div class="alert alert-info" role="alert"> |
| 60 | 60 | You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>. |
| 61 | 61 | </div> |
| 62 | 62 | '; |
| 63 | - } |
|
| 63 | + } |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | //Is shift already taken? |
| 67 | 67 | if(isset($entry['status']) && ($entry['status'] === 'pending' || $entry['status'] === 'filled')) |
| 68 | 68 | { |
| 69 | - if(isset($shift['participant']) && $shift['participant'] === $page->user->uid) |
|
| 70 | - { |
|
| 69 | + if(isset($shift['participant']) && $shift['participant'] === $page->user->uid) |
|
| 70 | + { |
|
| 71 | 71 | $page->body .= '<div class="alert alert-success" role="alert"> |
| 72 | 72 | You already have this shift! |
| 73 | 73 | </div> |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button> |
| 76 | 76 | <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button> |
| 77 | 77 | </div>'; |
| 78 | - } |
|
| 79 | - else |
|
| 80 | - { |
|
| 78 | + } |
|
| 79 | + else |
|
| 80 | + { |
|
| 81 | 81 | $page->body .= '<div class="alert alert-danger" role="alert"> |
| 82 | 82 | Someone else took this shift! |
| 83 | 83 | </div>'; |
| 84 | - } |
|
| 85 | - $page->printPage(); |
|
| 86 | - return; |
|
| 84 | + } |
|
| 85 | + $page->printPage(); |
|
| 86 | + return; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $overlap = false; |
@@ -108,47 +108,47 @@ discard block |
||
| 108 | 108 | $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID'])); |
| 109 | 109 | if(!empty($depts)) |
| 110 | 110 | { |
| 111 | - $deptName = $depts[0]['departmentName']; |
|
| 111 | + $deptName = $depts[0]['departmentName']; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events'); |
| 115 | 115 | $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID'])); |
| 116 | 116 | if(!empty($events)) |
| 117 | 117 | { |
| 118 | - if($events[0]['tickets']) |
|
| 119 | - { |
|
| 118 | + if($events[0]['tickets']) |
|
| 119 | + { |
|
| 120 | 120 | //TODO... Event requires tickets. Does this account have tickets? |
| 121 | - } |
|
| 121 | + } |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles'); |
| 125 | 125 | $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID'])); |
| 126 | 126 | if(!empty($roles)) |
| 127 | 127 | { |
| 128 | - $roleName = $roles[0]['display_name']; |
|
| 128 | + $roleName = $roles[0]['display_name']; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | //Is user eligible for shift? |
| 132 | 132 | $canDo = $processor->canUserDoRole($profile, $roles[0]); |
| 133 | 133 | if($canDo !== true) |
| 134 | 134 | { |
| 135 | - $page->body .= '<div class="alert alert-danger" role="alert">'; |
|
| 136 | - switch($canDo['whyClass']) |
|
| 137 | - { |
|
| 135 | + $page->body .= '<div class="alert alert-danger" role="alert">'; |
|
| 136 | + switch($canDo['whyClass']) |
|
| 137 | + { |
|
| 138 | 138 | case 'INVITE': |
| 139 | 139 | $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>.'; |
| 140 | - break; |
|
| 140 | + break; |
|
| 141 | 141 | case 'CERT': |
| 142 | 142 | $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.'; |
| 143 | - break; |
|
| 143 | + break; |
|
| 144 | 144 | default: |
| 145 | 145 | $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg']; |
| 146 | - break; |
|
| 147 | - } |
|
| 148 | - $page->body .= '</div>'; |
|
| 149 | - $page->printPage(); |
|
| 150 | - return; |
|
| 151 | - var_dump($canDo); die(); |
|
| 146 | + break; |
|
| 147 | + } |
|
| 148 | + $page->body .= '</div>'; |
|
| 149 | + $page->printPage(); |
|
| 150 | + return; |
|
| 151 | + var_dump($canDo); die(); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $start = new \DateTime($shift['startTime']); |
@@ -159,7 +159,7 @@ discard block |
||
| 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 |
||
| 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? |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $this->isLead = $this->user->isInGroupNamed('Leads'); |
| 33 | 33 | if($this->isLead) |
| 34 | 34 | { |
| 35 | - $this->is_admin = true; |
|
| 35 | + $this->is_admin = true; |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $filter = new \Data\Filter("departmentID eq '$deptId'"); |
| 100 | 100 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
| 101 | 101 | $roles = $dataTable->read($filter, $odata->select, $odata->top, |
| 102 | - $odata->skip, $odata->orderby); |
|
| 102 | + $odata->skip, $odata->orderby); |
|
| 103 | 103 | if($roles === false) |
| 104 | 104 | { |
| 105 | 105 | $roles = array(); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $filter = new \Data\Filter("departmentID eq '$deptId'"); |
| 124 | 124 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
| 125 | 125 | $shifts = $dataTable->read($filter, $odata->select, $odata->top, |
| 126 | - $odata->skip, $odata->orderby); |
|
| 126 | + $odata->skip, $odata->orderby); |
|
| 127 | 127 | if($shifts === false) |
| 128 | 128 | { |
| 129 | 129 | $shifts = array(); |
@@ -45,15 +45,15 @@ discard block |
||
| 45 | 45 | $shifts[$i]['length'] = $diff->h; |
| 46 | 46 | if(!isset($roles[$shifts[$i]['roleID']])) |
| 47 | 47 | { |
| 48 | - $roles[$shifts[$i]['roleID']] = $shifts[$i]['length']; |
|
| 49 | - $roles2[$shifts[$i]['roleID']] = array(); |
|
| 48 | + $roles[$shifts[$i]['roleID']] = $shifts[$i]['length']; |
|
| 49 | + $roles2[$shifts[$i]['roleID']] = array(); |
|
| 50 | 50 | } |
| 51 | 51 | else |
| 52 | 52 | { |
| 53 | - if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length']) |
|
| 54 | - { |
|
| 55 | - $roles[$shifts[$i]['roleID']] = $shifts[$i]['length']; |
|
| 56 | - } |
|
| 53 | + if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length']) |
|
| 54 | + { |
|
| 55 | + $roles[$shifts[$i]['roleID']] = $shifts[$i]['length']; |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | array_push($roles2[$shifts[$i]['roleID']], array('start'=>$start, 'end'=>$end)); |
| 59 | 59 | } |
@@ -196,17 +196,17 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | for($j = 0; $j < $rowCount; $j++) |
| 198 | 198 | { |
| 199 | - $cell = $sheat->getCellByColumnAndRow($i+2, $j+4); |
|
| 200 | - if($cell->isInMergeRange()) |
|
| 201 | - { |
|
| 202 | - continue; |
|
| 203 | - } |
|
| 204 | - else |
|
| 205 | - { |
|
| 206 | - $style = $cell->getStyle(); |
|
| 207 | - $style->getBorders()->getAllBorders()->setBorderStyle(false); |
|
| 208 | - $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY); |
|
| 209 | - } |
|
| 199 | + $cell = $sheat->getCellByColumnAndRow($i+2, $j+4); |
|
| 200 | + if($cell->isInMergeRange()) |
|
| 201 | + { |
|
| 202 | + continue; |
|
| 203 | + } |
|
| 204 | + else |
|
| 205 | + { |
|
| 206 | + $style = $cell->getStyle(); |
|
| 207 | + $style->getBorders()->getAllBorders()->setBorderStyle(false); |
|
| 208 | + $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY); |
|
| 209 | + } |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | $sheat->getColumnDimension('A')->setAutoSize(true); |
@@ -254,7 +254,7 @@ |
||
| 254 | 254 | $tmp = $dataTable->read(); |
| 255 | 255 | foreach($tmp as $role) |
| 256 | 256 | { |
| 257 | - $roles[$role['short_name']] = $role; |
|
| 257 | + $roles[$role['short_name']] = $role; |
|
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | $entry['isAdmin'] = $this->isAdminForShift($entry, $this->user); |