@@ -41,7 +41,7 @@ |
||
| 41 | 41 | protected function canUpdate($request, $entity) |
| 42 | 42 | { |
| 43 | 43 | if($this->isVolunteerAdmin($request)) |
| 44 | - { |
|
| 44 | + { |
|
| 45 | 45 | return true; |
| 46 | 46 | } |
| 47 | 47 | return $this->isUserDepartmentLead($entity['departmentID'], $this->user); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | protected function canUpdate($request, $entity) |
| 37 | 37 | { |
| 38 | 38 | if($this->isVolunteerAdmin($request)) |
| 39 | - { |
|
| 39 | + { |
|
| 40 | 40 | return true; |
| 41 | 41 | } |
| 42 | 42 | //TODO give access to department lead |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | protected function canUpdate($request, $entity) |
| 39 | 39 | { |
| 40 | 40 | if($this->isVolunteerAdmin($request)) |
| 41 | - { |
|
| 41 | + { |
|
| 42 | 42 | return true; |
| 43 | 43 | } |
| 44 | 44 | return false; |
@@ -1,29 +1,29 @@ |
||
| 1 | 1 | <?php |
| 2 | -function VolunteerAutoload($classname) |
|
| 3 | -{
|
|
| 2 | +function VolunteerAutoload($classname) |
|
| 3 | +{ |
|
| 4 | 4 | $classname = str_replace('/', '\\', $classname);
|
| 5 | 5 | $classname = ltrim($classname, '\\'); |
| 6 | 6 | $filename = ''; |
| 7 | 7 | $namespace = ''; |
| 8 | - if($lastNsPos = strrpos($classname, '\\')) |
|
| 9 | - {
|
|
| 8 | + if($lastNsPos = strrpos($classname, '\\')) |
|
| 9 | + { |
|
| 10 | 10 | $namespace = substr($classname, 0, $lastNsPos); |
| 11 | 11 | $classname = substr($classname, $lastNsPos + 1); |
| 12 | 12 | $filename = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR;
|
| 13 | 13 | } |
| 14 | 14 | $filename = __DIR__.DIRECTORY_SEPARATOR.$filename.'class.'.$classname.'.php'; |
| 15 | - if(is_readable($filename)) |
|
| 16 | - {
|
|
| 15 | + if(is_readable($filename)) |
|
| 16 | + { |
|
| 17 | 17 | require $filename; |
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -if(version_compare(PHP_VERSION, '5.3.0', '>=')) |
|
| 22 | -{
|
|
| 21 | +if(version_compare(PHP_VERSION, '5.3.0', '>=')) |
|
| 22 | +{ |
|
| 23 | 23 | spl_autoload_register('VolunteerAutoload', true, true);
|
| 24 | -} |
|
| 25 | -else |
|
| 26 | -{
|
|
| 24 | +} |
|
| 25 | +else |
|
| 26 | +{ |
|
| 27 | 27 | spl_autoload_register('VolunteerAutoload');
|
| 28 | 28 | } |
| 29 | 29 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
@@ -242,6 +242,9 @@ |
||
| 242 | 242 | return $response; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | + /** |
|
| 246 | + * @param string $type |
|
| 247 | + */ |
|
| 245 | 248 | public function generateGridSchedule($dept, $shifts, $response, $type) |
| 246 | 249 | { |
| 247 | 250 | $ss = new \Schedules\GridSchedule($dept, $shifts); |
@@ -5,6 +5,9 @@ |
||
| 5 | 5 | protected $isAdmin = null; |
| 6 | 6 | protected $isLead = null; |
| 7 | 7 | |
| 8 | + /** |
|
| 9 | + * @param string $dataTableName |
|
| 10 | + */ |
|
| 8 | 11 | public function __construct($dataTableName, $idField = '_id') |
| 9 | 12 | { |
| 10 | 13 | parent::__construct('fvs', $dataTableName, $idField); |
@@ -1,6 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | trait Processor |
| 3 | 3 | { |
| 4 | + /** |
|
| 5 | + * @param string $certType |
|
| 6 | + */ |
|
| 4 | 7 | protected function certCheck($requirements, $certs, $certType) |
| 5 | 8 | { |
| 6 | 9 | if(isset($requirements[$certType]) && $requirements[$certType]) |
@@ -10,6 +13,9 @@ discard block |
||
| 10 | 13 | return false; |
| 11 | 14 | } |
| 12 | 15 | |
| 16 | + /** |
|
| 17 | + * @param VolunteerProfile|null $user |
|
| 18 | + */ |
|
| 13 | 19 | public function canUserDoRole($user, $role) |
| 14 | 20 | { |
| 15 | 21 | if($role['publicly_visible'] === true) |
@@ -124,6 +130,9 @@ discard block |
||
| 124 | 130 | return !in_array($deptId, $privateDepts); |
| 125 | 131 | } |
| 126 | 132 | |
| 133 | + /** |
|
| 134 | + * @param VolunteerShift $shift |
|
| 135 | + */ |
|
| 127 | 136 | protected function doShiftTimeChecks($shift, $entry) |
| 128 | 137 | { |
| 129 | 138 | $now = new DateTime(); |