@@ -126,7 +126,7 @@ |
||
| 126 | 126 | /** |
| 127 | 127 | * Add a photo name to the photos array |
| 128 | 128 | * |
| 129 | - * @param $fileName |
|
| 129 | + * @param string $fileName |
|
| 130 | 130 | */ |
| 131 | 131 | public function addPhoto($fileName) |
| 132 | 132 | { |
@@ -58,6 +58,9 @@ |
||
| 58 | 58 | return $record; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $fobId |
|
| 63 | + */ |
|
| 61 | 64 | public static function lookupPartialTag($fobId) |
| 62 | 65 | { |
| 63 | 66 | $record = self::where('key_id', 'LIKE', '%' . strtoupper($fobId) . '%')->active()->first(); |
@@ -18,6 +18,9 @@ |
||
| 18 | 18 | return $this->belongsToMany('\BB\Entities\User')->withTimestamps(); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param string $name |
|
| 23 | + */ |
|
| 21 | 24 | public static function findByName($name) { |
| 22 | 25 | $role = self::where('name', $name)->first(); |
| 23 | 26 | if ($role) { |
@@ -18,7 +18,8 @@ |
||
| 18 | 18 | return $this->belongsToMany('\BB\Entities\User')->withTimestamps(); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public static function findByName($name) { |
|
| 21 | + public static function findByName($name) |
|
| 22 | + { |
|
| 22 | 23 | $role = self::where('name', $name)->first(); |
| 23 | 24 | if ($role) { |
| 24 | 25 | return $role; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * Record the start of a new session |
| 43 | 43 | * |
| 44 | - * @return \Illuminate\Http\Response |
|
| 44 | + * @return \Illuminate\Http\JsonResponse |
|
| 45 | 45 | * |
| 46 | 46 | * @SWG\Post( |
| 47 | 47 | * path="/acs/activity", |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Update an ongoing activity |
| 82 | 82 | * |
| 83 | - * @return \Illuminate\Http\Response |
|
| 83 | + * @return \Illuminate\Http\JsonResponse |
|
| 84 | 84 | * |
| 85 | 85 | * @SWG\Put( |
| 86 | 86 | * path="/acs/activity/{activityId}", |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | /** |
| 104 | 104 | * Show the form for creating a new resource. |
| 105 | 105 | * |
| 106 | - * @return \Illuminate\Http\Response |
|
| 106 | + * @return \Illuminate\Http\JsonResponse |
|
| 107 | 107 | * |
| 108 | 108 | * @SWG\Delete( |
| 109 | 109 | * path="/acs/activity/{activityId}", |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @param $message |
| 145 | 145 | * @param $device |
| 146 | - * @return Response |
|
| 146 | + * @return \Illuminate\Http\JsonResponse |
|
| 147 | 147 | */ |
| 148 | 148 | private function handleSystemCheckIn($message, $device, $service) |
| 149 | 149 | { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * Json encode the response data and return |
| 182 | 182 | * |
| 183 | 183 | * @param array $responseData |
| 184 | - * @return \Response |
|
| 184 | + * @return \Illuminate\Http\JsonResponse |
|
| 185 | 185 | */ |
| 186 | 186 | private function sendResponse(array $responseData) |
| 187 | 187 | { |
@@ -84,10 +84,10 @@ |
||
| 84 | 84 | |
| 85 | 85 | $responseArray = [ |
| 86 | 86 | 'time' => time(), |
| 87 | - 'command' => null, //stored command for the device to process |
|
| 88 | - 'valid' => true, //member request |
|
| 89 | - 'available' => true, //device status - remote shutdown, |
|
| 90 | - 'member' => null, //member name |
|
| 87 | + 'command' => null, //stored command for the device to process |
|
| 88 | + 'valid' => true, //member request |
|
| 89 | + 'available' => true, //device status - remote shutdown, |
|
| 90 | + 'member' => null, //member name |
|
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | } |
@@ -3,9 +3,6 @@ |
||
| 3 | 3 | namespace BB\Http\Controllers; |
| 4 | 4 | |
| 5 | 5 | use BB\Entities\DetectedDevice; |
| 6 | -use Illuminate\Http\Request; |
|
| 7 | - |
|
| 8 | -use BB\Http\Requests; |
|
| 9 | 6 | use BB\Http\Controllers\Controller; |
| 10 | 7 | |
| 11 | 8 | class DetectedDevicesController extends Controller |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace BB\Http\Controllers; |
| 4 | 4 | |
| 5 | 5 | use BB\Entities\ACSNode; |
| 6 | -use BB\Http\Requests; |
|
| 7 | 6 | |
| 8 | 7 | class DeviceController extends Controller |
| 9 | 8 | { |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | /** |
| 67 | 67 | * Store a newly created resource in storage. |
| 68 | 68 | * |
| 69 | - * @return Response |
|
| 69 | + * @return \Illuminate\Http\JsonResponse |
|
| 70 | 70 | * @throws ImageFailedException |
| 71 | 71 | * @throws \BB\Exceptions\FormValidationException |
| 72 | 72 | */ |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | * @return Response |
| 34 | 34 | * @throws \BB\Exceptions\AuthenticationException |
| 35 | 35 | */ |
| 36 | - public function index() |
|
| 37 | - { |
|
| 36 | + public function index() |
|
| 37 | + { |
|
| 38 | 38 | $userId = \Request::get('user_id', ''); |
| 39 | 39 | $sortBy = \Request::get('sortBy', 'created_at'); |
| 40 | 40 | $direction = \Request::get('direction', 'desc'); |
@@ -49,18 +49,18 @@ discard block |
||
| 49 | 49 | $expenses = $this->expenseRepository->getPaginated(compact('sortBy', 'direction')); |
| 50 | 50 | |
| 51 | 51 | return \View::make('expenses.index')->with('expenses', $expenses); |
| 52 | - } |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Show the form for creating a new resource. |
|
| 57 | - * |
|
| 58 | - * @return Response |
|
| 59 | - */ |
|
| 60 | - public function create() |
|
| 61 | - { |
|
| 62 | - // |
|
| 63 | - } |
|
| 55 | + /** |
|
| 56 | + * Show the form for creating a new resource. |
|
| 57 | + * |
|
| 58 | + * @return Response |
|
| 59 | + */ |
|
| 60 | + public function create() |
|
| 61 | + { |
|
| 62 | + // |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | * @throws ImageFailedException |
| 71 | 71 | * @throws \BB\Exceptions\FormValidationException |
| 72 | 72 | */ |
| 73 | - public function store() |
|
| 74 | - { |
|
| 75 | - $data = \Request::only(['user_id', 'category', 'description', 'amount', 'expense_date', 'file']); |
|
| 73 | + public function store() |
|
| 74 | + { |
|
| 75 | + $data = \Request::only(['user_id', 'category', 'description', 'amount', 'expense_date', 'file']); |
|
| 76 | 76 | |
| 77 | 77 | $this->expenseValidator->validate($data); |
| 78 | 78 | |
@@ -107,31 +107,31 @@ discard block |
||
| 107 | 107 | event(new NewExpenseSubmitted($expense)); |
| 108 | 108 | |
| 109 | 109 | return \Response::json($expense, 201); |
| 110 | - } |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Display the specified resource. |
|
| 115 | - * |
|
| 116 | - * @param int $id |
|
| 117 | - * @return Response |
|
| 118 | - */ |
|
| 119 | - public function show($id) |
|
| 120 | - { |
|
| 121 | - return \BB\Entities\Expense::findOrFail($id); |
|
| 122 | - } |
|
| 113 | + /** |
|
| 114 | + * Display the specified resource. |
|
| 115 | + * |
|
| 116 | + * @param int $id |
|
| 117 | + * @return Response |
|
| 118 | + */ |
|
| 119 | + public function show($id) |
|
| 120 | + { |
|
| 121 | + return \BB\Entities\Expense::findOrFail($id); |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | 124 | |
| 125 | - /** |
|
| 126 | - * Show the form for editing the specified resource. |
|
| 127 | - * |
|
| 128 | - * @param int $id |
|
| 129 | - * @return Response |
|
| 130 | - */ |
|
| 131 | - public function edit($id) |
|
| 132 | - { |
|
| 133 | - // |
|
| 134 | - } |
|
| 125 | + /** |
|
| 126 | + * Show the form for editing the specified resource. |
|
| 127 | + * |
|
| 128 | + * @param int $id |
|
| 129 | + * @return Response |
|
| 130 | + */ |
|
| 131 | + public function edit($id) |
|
| 132 | + { |
|
| 133 | + // |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -141,8 +141,8 @@ discard block |
||
| 141 | 141 | * @return Response |
| 142 | 142 | * @throws \BB\Exceptions\AuthenticationException |
| 143 | 143 | */ |
| 144 | - public function update($id) |
|
| 145 | - { |
|
| 144 | + public function update($id) |
|
| 145 | + { |
|
| 146 | 146 | /** |
| 147 | 147 | if (\Request::ajax()) { |
| 148 | 148 | $data = \Request::only(['category', 'description', 'amount', 'expense_date']); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | return $expense; |
| 154 | 154 | } |
| 155 | - */ |
|
| 155 | + */ |
|
| 156 | 156 | |
| 157 | 157 | if ( ! \Auth::user()->hasRole('admin')) { |
| 158 | 158 | throw new \BB\Exceptions\AuthenticationException(); |
@@ -167,20 +167,20 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | return \Redirect::route('expenses.index'); |
| 170 | - } |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | 172 | |
| 173 | - /** |
|
| 174 | - * Remove the specified resource from storage. |
|
| 175 | - * |
|
| 176 | - * @param int $id |
|
| 177 | - * @return Response |
|
| 178 | - */ |
|
| 179 | - public function destroy($id) |
|
| 180 | - { |
|
| 173 | + /** |
|
| 174 | + * Remove the specified resource from storage. |
|
| 175 | + * |
|
| 176 | + * @param int $id |
|
| 177 | + * @return Response |
|
| 178 | + */ |
|
| 179 | + public function destroy($id) |
|
| 180 | + { |
|
| 181 | 181 | //$expense = \BB\Entities\Expense::findOrFail($id); |
| 182 | 182 | //$expense->delete(); |
| 183 | - } |
|
| 183 | + } |
|
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | } |
@@ -83,13 +83,13 @@ |
||
| 83 | 83 | $ext = \Input::file('file')->guessClientExtension(); |
| 84 | 84 | $mimeType = \Input::file('file')->getMimeType(); |
| 85 | 85 | |
| 86 | - $newFilename = \App::environment().'/expenses/' . str_random() . '.' . $ext; |
|
| 86 | + $newFilename = \App::environment() . '/expenses/' . str_random() . '.' . $ext; |
|
| 87 | 87 | |
| 88 | 88 | Storage::put($newFilename, file_get_contents($filePath), 'public'); |
| 89 | 89 | |
| 90 | 90 | $data['file'] = $newFilename; |
| 91 | 91 | |
| 92 | - } catch(\Exception $e) { |
|
| 92 | + } catch (\Exception $e) { |
|
| 93 | 93 | \Log::error($e); |
| 94 | 94 | throw new ImageFailedException($e->getMessage()); |
| 95 | 95 | } |
@@ -6,7 +6,8 @@ |
||
| 6 | 6 | use Illuminate\Support\Facades\Response; |
| 7 | 7 | use Illuminate\Support\Facades\Storage; |
| 8 | 8 | |
| 9 | -class ExpensesController extends Controller { |
|
| 9 | +class ExpensesController extends Controller |
|
| 10 | +{ |
|
| 10 | 11 | |
| 11 | 12 | /** |
| 12 | 13 | * @var \BB\Validators\ExpenseValidator |
@@ -226,6 +226,9 @@ |
||
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | + /** |
|
| 230 | + * @param integer $userId |
|
| 231 | + */ |
|
| 229 | 232 | private function getName($reason, $userId) |
| 230 | 233 | { |
| 231 | 234 | if ($reason == 'subscription') { |