| @@ 139-148 (lines=10) @@ | ||
| 136 | $obj = json_decode($request->getBody()->getContents(), true); |
|
| 137 | } |
|
| 138 | $obj['departmentID'] = $deptId; |
|
| 139 | if($table === 'shifts') |
|
| 140 | { |
|
| 141 | if(isset($obj['unbounded']) && $obj['unbounded']) |
|
| 142 | { |
|
| 143 | if(!isset($obj['minShifts']) || $obj['minShifts'] === 0 || $obj['minShifts'] === '') |
|
| 144 | { |
|
| 145 | $obj['minShifts'] = '1'; |
|
| 146 | } |
|
| 147 | } |
|
| 148 | } |
|
| 149 | $ret = $dataTable->create($obj); |
|
| 150 | return $response->withJson($ret); |
|
| 151 | } |
|
| @@ 57-63 (lines=7) @@ | ||
| 54 | { |
|
| 55 | return false; |
|
| 56 | } |
|
| 57 | if(isset($obj['unbounded']) && $obj['unbounded']) |
|
| 58 | { |
|
| 59 | if(!isset($obj['minShifts']) || $obj['minShifts'] === 0 || $obj['minShifts'] === '') |
|
| 60 | { |
|
| 61 | $obj['minShifts'] = '1'; |
|
| 62 | } |
|
| 63 | } |
|
| 64 | return $this->isUserDepartmentLead($obj['departmentID'], $this->user); |
|
| 65 | } |
|
| 66 | ||