@@ -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(); |
@@ -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(); |
@@ -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) |