@@ -6,6 +6,9 @@ discard block |
||
6 | 6 | parent::__construct($departmentID, $dbData, 'events', '_id'); |
7 | 7 | } |
8 | 8 | |
9 | + /** |
|
10 | + * @param integer $eeListIndex |
|
11 | + */ |
|
9 | 12 | public function hasVolOnEEList($uid, $eeListIndex) |
10 | 13 | { |
11 | 14 | if($eeListIndex === 1 || $eeListIndex === 0) |
@@ -28,6 +31,9 @@ discard block |
||
28 | 31 | return false; |
29 | 32 | } |
30 | 33 | |
34 | + /** |
|
35 | + * @param integer $eeListIndex |
|
36 | + */ |
|
31 | 37 | public function addToEEList($uid, $eeListIndex) |
32 | 38 | { |
33 | 39 | if(!isset($this->dbData['eeLists'])) |
@@ -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; |
@@ -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'); |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | |
31 | 31 | if(!isset($_GET['shiftID'])) |
32 | 32 | { |
33 | - $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!'; |
|
34 | - $page->printPage(); |
|
35 | - return; |
|
33 | + $page->body .= 'Error! Missing Shift ID. You must have followed a bad link!'; |
|
34 | + $page->printPage(); |
|
35 | + return; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $shiftID = $_GET['shiftID']; |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | $shifts = $dataTable->read($filter); |
42 | 42 | if(empty($shifts)) |
43 | 43 | { |
44 | - $page->body .= 'Error! Could not locate shift. You must have followed an old link!'; |
|
45 | - $page->printPage(); |
|
46 | - return; |
|
44 | + $page->body .= 'Error! Could not locate shift. You must have followed an old link!'; |
|
45 | + $page->printPage(); |
|
46 | + return; |
|
47 | 47 | } |
48 | 48 | $shift = $shifts[0]; |
49 | 49 | $myShift = new \VolunteerShift(false, $shift); |
@@ -52,38 +52,38 @@ discard block |
||
52 | 52 | |
53 | 53 | if($processor->isAdminForShift($shift, $page->user)) |
54 | 54 | { |
55 | - if(isset($shift['groupID']) && strlen($shift['groupID'] > 0)) |
|
56 | - { |
|
55 | + if(isset($shift['groupID']) && strlen($shift['groupID'] > 0)) |
|
56 | + { |
|
57 | 57 | $page->body .= ' |
58 | 58 | <div class="alert alert-info" role="alert"> |
59 | 59 | You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>. |
60 | 60 | Or you can edit the shift group <a href="_admin/shifts.php?groupID='.$shift['groupID'].'" class="alert-link">here</a>. |
61 | 61 | </div> |
62 | 62 | '; |
63 | - } |
|
64 | - else |
|
65 | - { |
|
63 | + } |
|
64 | + else |
|
65 | + { |
|
66 | 66 | $page->body .= ' |
67 | 67 | <div class="alert alert-info" role="alert"> |
68 | 68 | You are an administrator for this shift. You can edit the shift <a href="_admin/shifts.php?shiftID='.$shiftID.'" class="alert-link">here</a>. |
69 | 69 | </div> |
70 | 70 | '; |
71 | - } |
|
72 | - if(!isset($shift['participant']) || strlen($shift['participant']) === 0) |
|
73 | - { |
|
71 | + } |
|
72 | + if(!isset($shift['participant']) || strlen($shift['participant']) === 0) |
|
73 | + { |
|
74 | 74 | $page->body .= ' |
75 | 75 | <div class="alert alert-info" role="alert"> |
76 | 76 | You are an administrator for this shift. You can assign someone to the shift, but it is highly recommended to let the users sign up. But if you are sure click <a href="#" onClick="showAdminSignup()" class="alert-link">here</a>. |
77 | 77 | </div> |
78 | 78 | '; |
79 | - } |
|
79 | + } |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | //Is shift already taken? |
83 | 83 | if($myShift->isFilled()) |
84 | 84 | { |
85 | - if(isset($shift['participant']) && $shift['participant'] === $page->user->uid) |
|
86 | - { |
|
85 | + if(isset($shift['participant']) && $shift['participant'] === $page->user->uid) |
|
86 | + { |
|
87 | 87 | $page->body .= '<div class="alert alert-success" role="alert"> |
88 | 88 | You already have this shift! |
89 | 89 | </div> |
@@ -91,15 +91,15 @@ discard block |
||
91 | 91 | <button type="button" class="btn btn-secondary mr-auto" onClick="window.history.back();">Cancel</button> |
92 | 92 | <button type="button" class="btn btn-primary" onclick="abandon();">Abandon Shift</button> |
93 | 93 | </div>'; |
94 | - } |
|
95 | - else |
|
96 | - { |
|
94 | + } |
|
95 | + else |
|
96 | + { |
|
97 | 97 | $page->body .= '<div class="alert alert-danger" role="alert"> |
98 | 98 | Someone else took this shift! |
99 | 99 | </div>'; |
100 | - } |
|
101 | - $page->printPage(); |
|
102 | - return; |
|
100 | + } |
|
101 | + $page->printPage(); |
|
102 | + return; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | $overlap = false; |
@@ -124,50 +124,50 @@ discard block |
||
124 | 124 | $depts = $dataTable->read(new \Data\Filter('departmentID eq '.$shift['departmentID'])); |
125 | 125 | if(!empty($depts)) |
126 | 126 | { |
127 | - $deptName = $depts[0]['departmentName']; |
|
127 | + $deptName = $depts[0]['departmentName']; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | $dataTable = DataSetFactory::getDataTableByNames('fvs', 'events'); |
131 | 131 | $events = $dataTable->read(new \Data\Filter('_id eq '.$shift['eventID'])); |
132 | 132 | if(!empty($events)) |
133 | 133 | { |
134 | - if($events[0]['tickets']) |
|
135 | - { |
|
134 | + if($events[0]['tickets']) |
|
135 | + { |
|
136 | 136 | //TODO... Event requires tickets. Does this account have tickets? |
137 | - } |
|
137 | + } |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $dataTable = DataSetFactory::getDataTableByNames('fvs', 'roles'); |
141 | 141 | $roles = $dataTable->read(new \Data\Filter('short_name eq '.$shift['roleID'])); |
142 | 142 | if(!empty($roles)) |
143 | 143 | { |
144 | - $roleName = $roles[0]['display_name']; |
|
144 | + $roleName = $roles[0]['display_name']; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | //Is user eligible for shift? |
148 | 148 | $canDo = $processor->canUserDoRole($profile, $roles[0]); |
149 | 149 | if(is_array($canDo) && $processor->isAdminForShift($shift, $page->user)) |
150 | 150 | { |
151 | - $canDo = true; |
|
151 | + $canDo = true; |
|
152 | 152 | } |
153 | 153 | if($canDo !== true) |
154 | 154 | { |
155 | - $page->body .= '<div class="alert alert-danger" role="alert">'; |
|
156 | - switch($canDo['whyClass']) |
|
157 | - { |
|
155 | + $page->body .= '<div class="alert alert-danger" role="alert">'; |
|
156 | + switch($canDo['whyClass']) |
|
157 | + { |
|
158 | 158 | case 'INVITE': |
159 | 159 | $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>.'; |
160 | - break; |
|
160 | + break; |
|
161 | 161 | case 'CERT': |
162 | 162 | $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.'; |
163 | - break; |
|
163 | + break; |
|
164 | 164 | default: |
165 | 165 | $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg']; |
166 | - break; |
|
167 | - } |
|
168 | - $page->body .= '</div>'; |
|
169 | - $page->printPage(); |
|
170 | - return; |
|
166 | + break; |
|
167 | + } |
|
168 | + $page->body .= '</div>'; |
|
169 | + $page->printPage(); |
|
170 | + return; |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $start = new \DateTime($shift['startTime']); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $page->body .= '<div id="signupContent" '; |
179 | 179 | if($overlap) |
180 | 180 | { |
181 | - $page->body .= 'class="d-none" '; |
|
181 | + $page->body .= 'class="d-none" '; |
|
182 | 182 | } |
183 | 183 | $page->body .= '/>'; |
184 | 184 | $page->body .= ' |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | if($processor->isAdminForShift($shift, $page->user) && (!isset($shift['participant']) || strlen($shift['participant']) === 0)) |
220 | 220 | { |
221 | - $page->body .= ' |
|
221 | + $page->body .= ' |
|
222 | 222 | <div class="row d-none" id="adminSignup"> |
223 | 223 | <div class="alert alert-danger" role="alert"> |
224 | 224 | First off, make sure you understand what this will do. While it will let you fill out the details for a shift, it will prevent the user from seeing the shift on their list when the log it, it will not be correctly reported for t-shirts or for rock star volunteers, their camp will not be listed on the shift schedule, and the ability to contact past volunteers will not work for anyone signed up in this manner. Basically, doing this removes about 90% of the advantage of using this system. So please only do this if participant in question is unable to sign up on their own. |
@@ -235,12 +235,12 @@ discard block |
||
235 | 235 | //Is group eligible? |
236 | 236 | if(isset($shift['groupID']) && isset($roles[0]['groups_allowed']) && $roles[0]['groups_allowed']) |
237 | 237 | { |
238 | - $page->body .= '<div id="groupContent" '; |
|
239 | - if($overlap) |
|
240 | - { |
|
238 | + $page->body .= '<div id="groupContent" '; |
|
239 | + if($overlap) |
|
240 | + { |
|
241 | 241 | $page->body .= 'class="d-none" '; |
242 | - } |
|
243 | - $page->body .= '> |
|
242 | + } |
|
243 | + $page->body .= '> |
|
244 | 244 | <div class="row"> |
245 | 245 | <div class="alert alert-primary" role="alert"> |
246 | 246 | 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? |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | function get_secure_menu_entries($page, $user) |
5 | 5 | { |
6 | 6 | $ret = array( |
7 | - 'Volunteer' => $page->secure_root.'fvs/index.php' |
|
7 | + 'Volunteer' => $page->secure_root.'fvs/index.php' |
|
8 | 8 | ); |
9 | 9 | if($user !== null && $user->isInGroupNamed('VolunteerAdmins')) |
10 | 10 | { |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | function get_plugin_entry_point() |
17 | 17 | { |
18 | 18 | return array( |
19 | - 'name'=>'Volunteer', |
|
20 | - 'link' => 'fvs/index.php' |
|
19 | + 'name'=>'Volunteer', |
|
20 | + 'link' => 'fvs/index.php' |
|
21 | 21 | ); |
22 | 22 | } |
23 | 23 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | ); |
9 | 9 | if($user !== null && $user->isInGroupNamed('VolunteerAdmins')) |
10 | 10 | { |
11 | - $ret['Volunteer System Admin']=$page->secure_root.'fvs/_admin/index.php'; |
|
11 | + $ret['Volunteer System Admin'] = $page->secure_root.'fvs/_admin/index.php'; |
|
12 | 12 | } |
13 | 13 | return $ret; |
14 | 14 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 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 | 109 | $cell = $sheat->getCellByColumnAndRow($col, $firstRow + 4 + $i); |
110 | 110 | if(!$cell->isInMergeRange()) |
@@ -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); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
92 | 92 | $filter = $this->getFilterForPrimaryKey($uid); |
93 | 93 | $areas = $dataTable->read($filter, $odata->select, $odata->top, |
94 | - $odata->skip, $odata->orderby); |
|
94 | + $odata->skip, $odata->orderby); |
|
95 | 95 | if(empty($areas)) |
96 | 96 | { |
97 | 97 | return $response->withStatus(404); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
163 | 163 | $filter = $this->getFilterForPrimaryKey($uid); |
164 | 164 | $areas = $dataTable->read($filter, array('certs'), $odata->top, |
165 | - $odata->skip, $odata->orderby); |
|
165 | + $odata->skip, $odata->orderby); |
|
166 | 166 | if(empty($areas)) |
167 | 167 | { |
168 | 168 | return $response->withStatus(404); |
@@ -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(); |
@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | $shifts = $dataTable->read($filter, $odata->select, $odata->top, |
90 | - $odata->skip, $odata->orderby); |
|
90 | + $odata->skip, $odata->orderby); |
|
91 | 91 | if($shifts === false) |
92 | 92 | { |
93 | 93 | $shifts = array(); |