Completed
Pull Request — master (#63)
by Patrick
01:48
created
app/Schedules/class.SimplePDF.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             $timeStr = $start->format('g:i A').' till '.$end->format('g:i A');
46 46
             if(strlen($shifts[$i]['name']) > 0)
47 47
             {
48
-                $timeStr .=' - <i>'.$shifts[$i]['name'].'</i>';
48
+                $timeStr .= ' - <i>'.$shifts[$i]['name'].'</i>';
49 49
             }
50 50
             if(!isset($days[$dateStr]))
51 51
             {
@@ -60,30 +60,30 @@  discard block
 block discarded – undo
60 60
         uksort($days, array($this, 'daySort'));
61 61
         foreach($days as $dateStr=>$day)
62 62
         {
63
-            $html .='<h2>'.$dateStr.'</h2>';
63
+            $html .= '<h2>'.$dateStr.'</h2>';
64 64
             uksort($day, array($this, 'groupSort'));
65 65
             foreach($day as $shiftStr=>$shifts)
66 66
             {
67 67
                 usort($shifts, array($this, 'shiftSort'));
68
-                $html .='<h3>'.$shiftStr.'</h3>';
69
-                $html .='<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
68
+                $html .= '<h3>'.$shiftStr.'</h3>';
69
+                $html .= '<table width="100%"><tr><th style="width: 20%">Role</th><th>Volunteer Name</th><th>Volunteer Camp</th></tr>';
70 70
                 foreach($shifts as $shift)
71 71
                 {
72 72
                     $shift = new \VolunteerShift(false, $shift);
73 73
                     $participant = $shift->participantObj;
74 74
                     if($participant !== false)
75 75
                     { 
76
-                        $html .='<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td>'.$participant->getDisplayName('paperName').'</td><td>'.$participant->campName.'</td></tr>';
76
+                        $html .= '<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td>'.$participant->getDisplayName('paperName').'</td><td>'.$participant->campName.'</td></tr>';
77 77
                     }
78 78
                     else
79 79
                     {
80
-                        $html .='<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td></td><td></td></tr>';
80
+                        $html .= '<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td></td><td></td></tr>';
81 81
                     }
82 82
                 }
83
-                $html .='</table>';
83
+                $html .= '</table>';
84 84
             }
85 85
         }
86
-        $html .='</body>';
86
+        $html .= '</body>';
87 87
         $this->setPDFFromHTML($html);
88 88
     }
89 89
 } 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
                     $shift = new \VolunteerShift(false, $shift);
73 73
                     $participant = $shift->participantObj;
74 74
                     if($participant !== false)
75
-                    { 
75
+                    {
76 76
                         $html .='<tr><td>'.$this->getRoleNameFromID($shift->roleID).'</td><td>'.$participant->getDisplayName('paperName').'</td><td>'.$participant->campName.'</td></tr>';
77 77
                     }
78 78
                     else
Please login to merge, or discard this patch.
_admin/class.VolunteerAdminPage.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
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
             {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
                 $uid = $this->user->uid;
45 45
                 $email = $this->user->mail;
46 46
                 $filter = new \Data\Filter("others eq $uid or others eq $email");
47
-                $dataTable = DataSetFactory::getDataTableByNames('fvs','departments');
47
+                $dataTable = DataSetFactory::getDataTableByNames('fvs', 'departments');
48 48
                 $depts = $dataTable->read($filter);
49 49
                 $this->isLead = !empty($depts);
50 50
                 $this->is_admin = true;
Please login to merge, or discard this patch.
app/Emails/class.ShiftEmail.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
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
         {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 $end = strpos($rawText, "</script>");
77 77
                 if($index === 0)
78 78
                 {
79
-                    $rawText = substr($rawText, $end+9);
79
+                    $rawText = substr($rawText, $end + 9);
80 80
                 }
81 81
             }
82 82
             return strtr(strip_tags($rawText), $vars);
Please login to merge, or discard this patch.
signup.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,46 +124,46 @@  discard block
 block discarded – undo
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($canDo !== true)
150 150
 {
151
-  $page->body .= '<div class="alert alert-danger" role="alert">';
152
-  switch($canDo['whyClass'])
153
-  {
151
+    $page->body .= '<div class="alert alert-danger" role="alert">';
152
+    switch($canDo['whyClass'])
153
+    {
154 154
     case 'INVITE':
155 155
       $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>.';
156
-      break;
156
+        break;
157 157
     case 'CERT':
158 158
        $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.';
159
-       break;
159
+        break;
160 160
     default:
161 161
       $page->body .= 'You are not eligible for this shift because: '.$canDo['whyMsg'];
162
-      break;
163
-  }
164
-  $page->body .= '</div>';
165
-  $page->printPage();
166
-  return;  
162
+        break;
163
+    }
164
+    $page->body .= '</div>';
165
+    $page->printPage();
166
+    return;  
167 167
 }
168 168
 
169 169
 $start = new \DateTime($shift['startTime']);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 $page->body .= '<div id="signupContent" ';
175 175
 if($overlap)
176 176
 {
177
-  $page->body .= 'class="d-none" ';
177
+    $page->body .= 'class="d-none" ';
178 178
 }
179 179
 $page->body .= '/>';
180 180
 $page->body .= '
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
 if($processor->isAdminForShift($shift, $page->user) && (!isset($shift['participant']) || strlen($shift['participant']) === 0))
216 216
 {
217
-  $page->body .= '
217
+    $page->body .= '
218 218
   <div class="row d-none" id="adminSignup">
219 219
     <div class="alert alert-danger" role="alert">
220 220
       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.
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 //Is group eligible?
232 232
 if(isset($shift['groupID']) && isset($roles[0]['groups_allowed']) && $roles[0]['groups_allowed'])
233 233
 {
234
-  $page->body .= '<div id="groupContent" ';
235
-  if($overlap)
236
-  {
234
+    $page->body .= '<div id="groupContent" ';
235
+    if($overlap)
236
+    {
237 237
     $page->body .= 'class="d-none" ';
238
-  }
239
-  $page->body .= '>
238
+    }
239
+    $page->body .= '>
240 240
   <div class="row">
241 241
     <div class="alert alert-primary" role="alert">
242 242
       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?
Please login to merge, or discard this patch.
app/Emails/class.CertificationEmail.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
         $certType = $this->additionalProps['certType'];
49 49
         $rejectReason = $this->additionalProps['reason'];
50 50
         $vars = array(
51
-          '{$firstName}' => $firstName,
52
-          '{$lastName}' => $lastName,
53
-          '{$paperName}' => $paperName,
54
-          '{$webName}' => $webName,
55
-          '{$certType}' => $certType,
56
-          '{$rejectReason}' => $rejectReason
51
+            '{$firstName}' => $firstName,
52
+            '{$lastName}' => $lastName,
53
+            '{$paperName}' => $paperName,
54
+            '{$webName}' => $webName,
55
+            '{$certType}' => $certType,
56
+            '{$rejectReason}' => $rejectReason
57 57
         );
58 58
         if($html === true)
59 59
         {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 $end = strpos($rawText, "</script>");
77 77
                 if($index === 0)
78 78
                 {
79
-                    $rawText = substr($rawText, $end+9);
79
+                    $rawText = substr($rawText, $end + 9);
80 80
                 }
81 81
             }
82 82
             return strtr(strip_tags($rawText), $vars);
Please login to merge, or discard this patch.
app/class.VolunteerEvent.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -6,6 +6,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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']))
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.