@@ -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(); |
@@ -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 | } |
@@ -12,6 +12,9 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | protected abstract function isVolunteerAdmin($request); |
| 14 | 14 | |
| 15 | + /** |
|
| 16 | + * @param VolunteerProfile|null $user |
|
| 17 | + */ |
|
| 15 | 18 | public function canUserDoRole($user, $role) |
| 16 | 19 | { |
| 17 | 20 | static $certs = null; |
@@ -155,6 +158,9 @@ discard block |
||
| 155 | 158 | return !in_array($deptId, $privateDepts); |
| 156 | 159 | } |
| 157 | 160 | |
| 161 | + /** |
|
| 162 | + * @param VolunteerShift $shift |
|
| 163 | + */ |
|
| 158 | 164 | protected function doShiftTimeChecks($shift, $entry) |
| 159 | 165 | { |
| 160 | 166 | $now = new DateTime(); |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | for($i = 0; $i < $certCount; $i++) |
| 49 | 49 | { |
| 50 | - if($this->certCheck($requirements, $userCerts, $certs[$i]['certID'])) |
|
| 51 | - { |
|
| 52 | - return array('whyClass' => 'CERT', 'whyMsg' => 'Shift requires '.$certs[$i]['name'].' and you do not have that certification'); |
|
| 53 | - } |
|
| 50 | + if($this->certCheck($requirements, $userCerts, $certs[$i]['certID'])) |
|
| 51 | + { |
|
| 52 | + return array('whyClass' => 'CERT', 'whyMsg' => 'Shift requires '.$certs[$i]['name'].' and you do not have that certification'); |
|
| 53 | + } |
|
| 54 | 54 | } |
| 55 | 55 | return true; |
| 56 | 56 | } |
@@ -192,20 +192,20 @@ discard block |
||
| 192 | 192 | $tmp = $dataTable->read(); |
| 193 | 193 | foreach($tmp as $role) |
| 194 | 194 | { |
| 195 | - $roles[$role['short_name']] = $role; |
|
| 195 | + $roles[$role['short_name']] = $role; |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | if(isset($entry['volunteer'])) |
| 199 | 199 | { |
| 200 | - unset($entry['volunteer']); |
|
| 200 | + unset($entry['volunteer']); |
|
| 201 | 201 | } |
| 202 | 202 | if(isset($entry['why'])) |
| 203 | 203 | { |
| 204 | - unset($entry['why']); |
|
| 204 | + unset($entry['why']); |
|
| 205 | 205 | } |
| 206 | 206 | if(isset($entry['whyClass'])) |
| 207 | 207 | { |
| 208 | - unset($entry['whyClass']); |
|
| 208 | + unset($entry['whyClass']); |
|
| 209 | 209 | } |
| 210 | 210 | $shift = new \VolunteerShift(false, $entry); |
| 211 | 211 | $entry['isAdmin'] = $this->isAdminForShift($entry, $this->user); |
@@ -3,6 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class PendingRejectedEmail extends VolunteerEmail |
| 5 | 5 | { |
| 6 | + /** |
|
| 7 | + * @param \VolunteerProfile $userProfile |
|
| 8 | + */ |
|
| 6 | 9 | public function __construct($userProfile) |
| 7 | 10 | { |
| 8 | 11 | parent::__construct($userProfile); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $filter = new \Data\Filter("departmentID eq '$deptId'"); |
| 78 | 78 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
| 79 | 79 | $roles = $dataTable->read($filter, $odata->select, $odata->top, |
| 80 | - $odata->skip, $odata->orderby); |
|
| 80 | + $odata->skip, $odata->orderby); |
|
| 81 | 81 | if($roles === false) |
| 82 | 82 | { |
| 83 | 83 | $roles = array(); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | $shifts = $dataTable->read($filter, $odata->select, $odata->top, |
| 117 | - $odata->skip, $odata->orderby); |
|
| 117 | + $odata->skip, $odata->orderby); |
|
| 118 | 118 | if($shifts === false) |
| 119 | 119 | { |
| 120 | 120 | $shifts = array(); |
@@ -9,9 +9,9 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | if(!isset($_GET['id'])) |
| 11 | 11 | { |
| 12 | - $page->body .= 'Error! Missing Group ID. You must have followed a bad link!'; |
|
| 13 | - $page->printPage(); |
|
| 14 | - return; |
|
| 12 | + $page->body .= 'Error! Missing Group ID. You must have followed a bad link!'; |
|
| 13 | + $page->printPage(); |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $groupID = $_GET['id']; |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | $shifts = $dataTable->read($filter); |
| 21 | 21 | if(empty($shifts)) |
| 22 | 22 | { |
| 23 | - $page->body .= 'Error! Could not locate shifts. You must have followed an old link!'; |
|
| 24 | - $page->printPage(); |
|
| 25 | - return; |
|
| 23 | + $page->body .= 'Error! Could not locate shifts. You must have followed an old link!'; |
|
| 24 | + $page->printPage(); |
|
| 25 | + return; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $filled = array(); |
@@ -32,35 +32,35 @@ discard block |
||
| 32 | 32 | $count = count($shifts); |
| 33 | 33 | for($i = 0; $i < $count; $i++) |
| 34 | 34 | { |
| 35 | - $shifts[$i] = new \VolunteerShift(false, $shifts[$i]); |
|
| 36 | - if($shifts[$i]->status === 'filled' || $shifts[$i]->status === 'pending') |
|
| 37 | - { |
|
| 38 | - array_push($filled, $shifts[$i]); |
|
| 39 | - if($page->user && $shifts[$i]->participant === $page->user->uid) |
|
| 40 | - { |
|
| 41 | - $alreadySignedUp = true; |
|
| 42 | - } |
|
| 43 | - } |
|
| 44 | - else |
|
| 45 | - { |
|
| 46 | - array_push($available, $shifts[$i]); |
|
| 47 | - } |
|
| 35 | + $shifts[$i] = new \VolunteerShift(false, $shifts[$i]); |
|
| 36 | + if($shifts[$i]->status === 'filled' || $shifts[$i]->status === 'pending') |
|
| 37 | + { |
|
| 38 | + array_push($filled, $shifts[$i]); |
|
| 39 | + if($page->user && $shifts[$i]->participant === $page->user->uid) |
|
| 40 | + { |
|
| 41 | + $alreadySignedUp = true; |
|
| 42 | + } |
|
| 43 | + } |
|
| 44 | + else |
|
| 45 | + { |
|
| 46 | + array_push($available, $shifts[$i]); |
|
| 47 | + } |
|
| 48 | 48 | } |
| 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>'; |
| 56 | 56 | foreach($available as $shift) |
| 57 | 57 | { |
| 58 | - $cell = '<i>You already have a shift!</i>'; |
|
| 59 | - if($alreadySignedUp === false) |
|
| 60 | - { |
|
| 58 | + $cell = '<i>You already have a shift!</i>'; |
|
| 59 | + if($alreadySignedUp === false) |
|
| 60 | + { |
|
| 61 | 61 | $cell = '<button type="button" class="btn btn-primary" onClick="signUp(\''.$shift->_id.'\');">Sign Up</button>'; |
| 62 | - } |
|
| 63 | - $page->body.= '<tr><td>'.$shift->role->display_name.'</td><td>'.$cell.'</td></tr>'; |
|
| 62 | + } |
|
| 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(); |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | |
| 114 | 114 | public function isFilled() |
| 115 | 115 | { |
| 116 | - return isset($this->dbData['status']) && ($this->dbData['status'] === 'pending' || $this->dbData['status'] === 'filled' || $this->dbData['status'] === 'groupPending'); |
|
| 116 | + return isset($this->dbData['status']) && ($this->dbData['status'] === 'pending' || $this->dbData['status'] === 'filled' || $this->dbData['status'] === 'groupPending'); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function findOverlaps($uid, $shortCircuit = false) |
@@ -177,6 +177,9 @@ |
||
| 177 | 177 | return $res; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | + /** |
|
| 181 | + * @param Data\DataTable $dataTable |
|
| 182 | + */ |
|
| 180 | 183 | public function makeCopy($dataTable) |
| 181 | 184 | { |
| 182 | 185 | $tmp = $this->dbData; |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $this->isLead = $this->user->isInGroupNamed('Leads'); |
| 37 | 37 | if($this->isLead) |
| 38 | 38 | { |
| 39 | - $this->is_admin = true; |
|
| 39 | + $this->is_admin = true; |
|
| 40 | 40 | } |
| 41 | 41 | else |
| 42 | 42 | { |
@@ -44,15 +44,15 @@ |
||
| 44 | 44 | $start = $this->shift->startTime->format('r'); |
| 45 | 45 | $end = $this->shift->endTime->format('r'); |
| 46 | 46 | $vars = array( |
| 47 | - '{$firstName}' => $firstName, |
|
| 48 | - '{$lastName}' => $lastName, |
|
| 49 | - '{$paperName}' => $paperName, |
|
| 50 | - '{$webName}' => $webName, |
|
| 51 | - '{$department}' => $department, |
|
| 52 | - '{$role}' => $role, |
|
| 53 | - '{$event}' => $event, |
|
| 54 | - '{$start}' => $start, |
|
| 55 | - '{$end}' => $end |
|
| 47 | + '{$firstName}' => $firstName, |
|
| 48 | + '{$lastName}' => $lastName, |
|
| 49 | + '{$paperName}' => $paperName, |
|
| 50 | + '{$webName}' => $webName, |
|
| 51 | + '{$department}' => $department, |
|
| 52 | + '{$role}' => $role, |
|
| 53 | + '{$event}' => $event, |
|
| 54 | + '{$start}' => $start, |
|
| 55 | + '{$end}' => $end |
|
| 56 | 56 | ); |
| 57 | 57 | if(strpos($this->text, '{$newStart}') !== false || strpos($this->text, '{$newEnd}') !== false) |
| 58 | 58 | { |