@@ -22,7 +22,8 @@ discard block |
||
| 22 | 22 | $this->line(''); |
| 23 | 23 | // Select which update file to use |
| 24 | 24 | $updateFile = $this->checkForUpdate(); |
| 25 | - if($updateFile) { |
|
| 25 | + if($updateFile) |
|
| 26 | + { |
|
| 26 | 27 | // Open up the file and verify it is at least the same version as the current setup |
| 27 | 28 | $valid = $this->openUpdate($updateFile); |
| 28 | 29 | |
@@ -80,7 +81,8 @@ discard block |
||
| 80 | 81 | $this->line(''); |
| 81 | 82 | |
| 82 | 83 | $anticipate = []; |
| 83 | - foreach($updateList as $key => $up) { |
|
| 84 | + foreach($updateList as $key => $up) |
|
| 85 | + { |
|
| 84 | 86 | $opt = $key + 1; |
| 85 | 87 | $anticipate[$opt] = $up; |
| 86 | 88 | $this->line('['.$opt.'] '.$up); |
@@ -25,7 +25,8 @@ discard block |
||
| 25 | 25 | // Validate the hash token |
| 26 | 26 | $user = UserInitialize::where('token', $hash)->get(); |
| 27 | 27 | |
| 28 | - if($user->isEmpty()) { |
|
| 28 | + if($user->isEmpty()) |
|
| 29 | + { |
|
| 29 | 30 | Log::warning('Visitor at IP Address '.\Request::ip().' tried to access invalid initialize hash - '.$hash); |
| 30 | 31 | return abort(404); |
| 31 | 32 | } |
@@ -43,7 +44,8 @@ discard block |
||
| 43 | 44 | |
| 44 | 45 | // Verify that the link matches the assigned email address |
| 45 | 46 | $valid = UserInitialize::where('token', $hash)->first(); |
| 46 | - if(empty($valid)) { |
|
| 47 | + if(empty($valid)) |
|
| 48 | + { |
|
| 47 | 49 | Log::warning('Visitor at IP Address '.\Request::ip().' tried to submit an invalid User Initialization link - '.$hash); |
| 48 | 50 | return abort(404); |
| 49 | 51 | } |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | $totalLinks = FileLinks::where('user_id', Auth::user()->user_id)->count(); |
| 31 | 31 | |
| 32 | 32 | // Debug Data |
| 33 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 33 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 34 | 34 | Log::debug('Customer Favorites for '.Auth::user()->full_name.': ', $custFavs->toArray()); |
| 35 | - Log::debug('Tech Tip Favorites for ' . Auth::user()->full_name . ': ', $tipFavs->toArray()); |
|
| 35 | + Log::debug('Tech Tip Favorites for '.Auth::user()->full_name.': ', $tipFavs->toArray()); |
|
| 36 | 36 | |
| 37 | 37 | return view('dashboard', [ |
| 38 | 38 | 'custFavs' => $custFavs, |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | // About page |
| 48 | 48 | public function about() |
| 49 | 49 | { |
| 50 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 50 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 51 | 51 | |
| 52 | 52 | return view('about', [ |
| 53 | 53 | 'branch' => 'latest' |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function getNotifications() |
| 59 | 59 | { |
| 60 | 60 | // Debug Data |
| 61 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 61 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 62 | 62 | Log::debug('Notifications for '.Auth::user()->full_name.':', Auth::user()->notifications->toArray()); |
| 63 | 63 | |
| 64 | 64 | return Auth::user()->notifications; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | // Mark a notification as read |
| 68 | 68 | public function markNotification($id) |
| 69 | 69 | { |
| 70 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 70 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 71 | 71 | |
| 72 | 72 | $notification = Auth::user()->notifications()->where('id', $id)->where('notifiable_id', Auth::user()->user_id)->first(); |
| 73 | 73 | if(!$notification) |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | else |
| 95 | 95 | { |
| 96 | - Log::error('User ' . Auth::user()->full_name . ' tried to delete an invalid notification as read. Notification ID: ' . $id); |
|
| 96 | + Log::error('User '.Auth::user()->full_name.' tried to delete an invalid notification as read. Notification ID: '.$id); |
|
| 97 | 97 | return abort(404); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | $searchResults = new CustomersCollection( |
| 48 | 48 | Customers::orderBy($request->sortField, $request->sortType) |
| 49 | 49 | // Search the name, dba name, and cust id columns |
| 50 | - ->where(function($query) use ($request) |
|
| 51 | - { |
|
| 50 | + ->where(function($query) use ($request) { |
|
| 52 | 51 | $query->where('name', 'like', '%'.$request->name.'%') |
| 53 | 52 | ->orWhere('cust_id', 'like', '%'.$request->name.'%') |
| 54 | 53 | ->orWhere('dba_name', 'like', '%'.$request->name.'%'); |
@@ -58,10 +57,8 @@ discard block |
||
| 58 | 57 | // Include the customers systems |
| 59 | 58 | ->with('CustomerSystems.SystemTypes') |
| 60 | 59 | // If the system field is present - search for system type |
| 61 | - ->when($request->system, function($query) use ($request) |
|
| 62 | - { |
|
| 63 | - $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request) |
|
| 64 | - { |
|
| 60 | + ->when($request->system, function($query) use ($request) { |
|
| 61 | + $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request) { |
|
| 65 | 62 | $query->where('sys_id', $request->system); |
| 66 | 63 | }); |
| 67 | 64 | }) |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | |
| 131 | 131 | // Update the primary contact information |
| 132 | 132 | $details = Customers::find($request->cust_id); |
| 133 | - if ($details->parent_id && $request->shared == 'true') |
|
| 133 | + if($details->parent_id && $request->shared == 'true') |
|
| 134 | 134 | { |
| 135 | 135 | $request->cust_id = $details->parent_id; |
| 136 | 136 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | // Determine if the note should go to the customer, or its parent |
| 33 | 33 | $details = Customers::find($request->cust_id); |
| 34 | - if ($details->parent_id && $request->shared == 'true') |
|
| 34 | + if($details->parent_id && $request->shared == 'true') |
|
| 35 | 35 | { |
| 36 | 36 | $request->cust_id = $details->parent_id; |
| 37 | 37 | } |
@@ -56,21 +56,21 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | // Determine if there is a parent site with shared notes |
| 58 | 58 | $parent = Customers::find($id)->parent_id; |
| 59 | - if ($parent) |
|
| 59 | + if($parent) |
|
| 60 | 60 | { |
| 61 | 61 | $parentList = CustomerNotes::where('cust_id', $parent)->where('shared', 1)->orderBy('urgent', 'desc')->get(); |
| 62 | 62 | |
| 63 | 63 | $notes = $notes->merge($parentList); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 66 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 67 | 67 | return $notes; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // Update a customer note |
| 71 | 71 | public function update(Request $request, $id) |
| 72 | 72 | { |
| 73 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
| 73 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
| 74 | 74 | |
| 75 | 75 | $request->validate([ |
| 76 | 76 | 'cust_id' => 'required', |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ]); |
| 80 | 80 | |
| 81 | 81 | $details = Customers::find($request->cust_id); |
| 82 | - if ($details->parent_id && $request->shared == 'true') |
|
| 82 | + if($details->parent_id && $request->shared == 'true') |
|
| 83 | 83 | { |
| 84 | 84 | $request->cust_id = $details->parent_id; |
| 85 | 85 | } |
@@ -100,7 +100,8 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | // Determine if there is a parent site with shared files |
| 102 | 102 | $parent = Customers::find($id)->parent_id; |
| 103 | - if($parent) { |
|
| 103 | + if($parent) |
|
| 104 | + { |
|
| 104 | 105 | $parentList = Customerfiles::where('cust_id', $parent) |
| 105 | 106 | ->where('shared', 1) |
| 106 | 107 | ->with('Files') |
@@ -126,7 +127,8 @@ discard block |
||
| 126 | 127 | ]); |
| 127 | 128 | |
| 128 | 129 | $details = Customers::find($request->cust_id); |
| 129 | - if($details->parent_id && $request->shared == 1) { |
|
| 130 | + if($details->parent_id && $request->shared == 1) |
|
| 131 | + { |
|
| 130 | 132 | $request->cust_id = $details->parent_id; |
| 131 | 133 | } |
| 132 | 134 | |
@@ -53,14 +53,17 @@ discard block |
||
| 53 | 53 | Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
| 54 | 54 | |
| 55 | 55 | // See if there are any search paramaters entered |
| 56 | - if(!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) { |
|
| 56 | + if(!$request->search['searchText'] && !isset($request->search['articleType']) && !isset($request->search['systemType'])) |
|
| 57 | + { |
|
| 57 | 58 | // No search paramaters, send all tech tips |
| 58 | 59 | $tips = new TechTipsCollection( |
| 59 | 60 | TechTips::orderBy('created_at', 'DESC') |
| 60 | 61 | ->with('SystemTypes') |
| 61 | 62 | ->paginate($request->pagination['perPage']) |
| 62 | 63 | ); |
| 63 | - } else { |
|
| 64 | + } |
|
| 65 | + else |
|
| 66 | + { |
|
| 64 | 67 | $article = isset($request->search['articleType']) ? true : false; |
| 65 | 68 | $system = isset($request->search['systemType']) ? true : false; |
| 66 | 69 | // Search paramaters, filter results |
@@ -151,7 +154,8 @@ discard block |
||
| 151 | 154 | $save = $receiver->receive(); |
| 152 | 155 | |
| 153 | 156 | // See if the uploade has finished |
| 154 | - if($save->isFinished()) { |
|
| 157 | + if($save->isFinished()) |
|
| 158 | + { |
|
| 155 | 159 | $this->saveFile($save->getFile()); |
| 156 | 160 | |
| 157 | 161 | return 'uploaded successfully'; |
@@ -266,7 +270,8 @@ discard block |
||
| 266 | 270 | // Details controller - will move to the show controller with just the tech tip id |
| 267 | 271 | public function details($id, $subject) |
| 268 | 272 | { |
| 269 | - if(session()->has('newTipFile')) { |
|
| 273 | + if(session()->has('newTipFile')) |
|
| 274 | + { |
|
| 270 | 275 | session()->forget('newTipFile'); |
| 271 | 276 | } |
| 272 | 277 | |
@@ -300,7 +305,8 @@ discard block |
||
| 300 | 305 | { |
| 301 | 306 | Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
| 302 | 307 | |
| 303 | - switch($action) { |
|
| 308 | + switch($action) |
|
| 309 | + { |
|
| 304 | 310 | case 'add': |
| 305 | 311 | TechTipFavs::create([ |
| 306 | 312 | 'user_id' => Auth::user()->user_id, |
@@ -329,7 +335,8 @@ discard block |
||
| 329 | 335 | $this->authorize('hasAccess', 'Edit Tech Tip'); |
| 330 | 336 | $tipData = TechTips::where('tip_id', $id)->with('User')->with('SystemTypes')->with('TechTipTypes')->first(); |
| 331 | 337 | |
| 332 | - if(!$tipData) { |
|
| 338 | + if(!$tipData) |
|
| 339 | + { |
|
| 333 | 340 | return view('tips.tipNotFound'); |
| 334 | 341 | } |
| 335 | 342 | |
@@ -362,7 +369,8 @@ discard block |
||
| 362 | 369 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 363 | 370 | |
| 364 | 371 | // Verify if there is a file to be processed or not |
| 365 | - if($receiver->isUploaded() === false || $request->_completed) { |
|
| 372 | + if($receiver->isUploaded() === false || $request->_completed) |
|
| 373 | + { |
|
| 366 | 374 | $this->storeUpdatedTip($request, $id); |
| 367 | 375 | Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id); |
| 368 | 376 | return response()->json(['tip_id' => $id]); |
@@ -372,7 +380,8 @@ discard block |
||
| 372 | 380 | $save = $receiver->receive(); |
| 373 | 381 | |
| 374 | 382 | // See if the uploade has finished |
| 375 | - if($save->isFinished()) { |
|
| 383 | + if($save->isFinished()) |
|
| 384 | + { |
|
| 376 | 385 | $this->saveFile($save->getFile(), $id); |
| 377 | 386 | |
| 378 | 387 | return 'uploaded successfully'; |
@@ -41,7 +41,8 @@ discard block |
||
| 41 | 41 | ]; |
| 42 | 42 | } |
| 43 | 43 | $mods = Module::allDisabled(); |
| 44 | - foreach($mods as $name => $mod) { |
|
| 44 | + foreach($mods as $name => $mod) |
|
| 45 | + { |
|
| 45 | 46 | $moduleList[] = [ |
| 46 | 47 | 'name' => $name, |
| 47 | 48 | 'status' => 'Disabled', |
@@ -78,7 +79,8 @@ discard block |
||
| 78 | 79 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
| 79 | 80 | |
| 80 | 81 | // Verify that the upload is valid and being processed |
| 81 | - if($receiver->isUploaded() === false) { |
|
| 82 | + if($receiver->isUploaded() === false) |
|
| 83 | + { |
|
| 82 | 84 | Log::error('Upload File Missing - '. |
| 83 | 85 | /** @scrutinizer ignore-type */ |
| 84 | 86 | $request->toArray()); |
@@ -89,7 +91,8 @@ discard block |
||
| 89 | 91 | $save = $receiver->receive(); |
| 90 | 92 | |
| 91 | 93 | // See if the uploade has finished |
| 92 | - if($save->isFinished()) { |
|
| 94 | + if($save->isFinished()) |
|
| 95 | + { |
|
| 93 | 96 | $this->saveFile($save->getFile()); |
| 94 | 97 | |
| 95 | 98 | return 'uploaded successfully'; |