@@ -25,14 +25,14 @@ |
||
| 25 | 25 | public function boot() |
| 26 | 26 | { |
| 27 | 27 | // Service provider to customize form inputs |
| 28 | - Form::component('bsText', 'components.form.text', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 28 | + Form::component('bsText', 'components.form.text', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 29 | 29 | Form::component('bsPassword', 'components.form.password', ['name', 'label', 'value' => null, 'attributes' => []]); |
| 30 | - Form::component('bsNumber', 'components.form.number', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 31 | - Form::component('bsEmail', 'components.form.email', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 32 | - Form::component('bsDate', 'components.form.date', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 30 | + Form::component('bsNumber', 'components.form.number', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 31 | + Form::component('bsEmail', 'components.form.email', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 32 | + Form::component('bsDate', 'components.form.date', ['name', 'label', 'value' => null, 'attributes' => []]); |
|
| 33 | 33 | Form::component('bsTextarea', 'components.form.textarea', ['name', 'label', 'value' => null, 'attributes' => []]); |
| 34 | 34 | Form::component('bsCheckbox', 'components.form.checkbox', ['name', 'label', 'value' => 'on', 'checked' => false, 'attributes' => []]); |
| 35 | - Form::component('bsSelect', 'components.form.select', ['name', 'label', 'list', 'selected' => null, 'attributes' => []]); |
|
| 35 | + Form::component('bsSelect', 'components.form.select', ['name', 'label', 'list', 'selected' => null, 'attributes' => []]); |
|
| 36 | 36 | // Custom Submit button |
| 37 | 37 | Form::component('bsSubmit', 'components.form.submit', ['name']); |
| 38 | 38 | // List of all states in a dropdown box |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | protected function getNotes($custID, $shared = false) |
| 25 | 25 | { |
| 26 | 26 | return CustomerNotes::where('cust_id', $custID) |
| 27 | - ->when($shared, function($q) |
|
| 28 | - { |
|
| 27 | + ->when($shared, function($q) { |
|
| 29 | 28 | $q->where('shared', 1); |
| 30 | 29 | }) |
| 31 | 30 | ->orderBy('urgent', 'DESC') |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $parts = pathinfo($name); |
| 41 | 41 | $ext = isset($parts['extension']) ? ('.'.$parts['extension']) : ''; |
| 42 | 42 | $base = $parts['filename']; |
| 43 | - $number = 0; |
|
| 43 | + $number = 0; |
|
| 44 | 44 | |
| 45 | 45 | do |
| 46 | 46 | { |
@@ -76,32 +76,26 @@ |
||
| 76 | 76 | { |
| 77 | 77 | return Customers::orderBy($sort->sortField, $sort->sortType) |
| 78 | 78 | // Search equipment field |
| 79 | - ->when(isset($searchData->equipment), function($q) use ($searchData) |
|
| 80 | - { |
|
| 81 | - $q->whereHas('ParentSystems.SystemTypes', function($qry) use ($searchData) |
|
| 82 | - { |
|
| 79 | + ->when(isset($searchData->equipment), function($q) use ($searchData) { |
|
| 80 | + $q->whereHas('ParentSystems.SystemTypes', function($qry) use ($searchData) { |
|
| 83 | 81 | $qry->where('sys_id', $searchData->equipment); |
| 84 | 82 | }) |
| 85 | - ->orWhereHas('CustomerSystems.SystemTypes', function($qry) use ($searchData) |
|
| 86 | - { |
|
| 83 | + ->orWhereHas('CustomerSystems.SystemTypes', function($qry) use ($searchData) { |
|
| 87 | 84 | $qry->where('sys_id', $searchData->equipment); |
| 88 | 85 | }); |
| 89 | 86 | }) |
| 90 | 87 | // Search city field |
| 91 | - ->when(isset($searchData->city), function($q) use ($searchData) |
|
| 92 | - { |
|
| 88 | + ->when(isset($searchData->city), function($q) use ($searchData) { |
|
| 93 | 89 | $q->where('city', 'like', '%'.$searchData->city.'%'); |
| 94 | 90 | }) |
| 95 | 91 | // Search name field |
| 96 | - ->when(isset($searchData->name), function($q) use ($searchData) |
|
| 97 | - { |
|
| 92 | + ->when(isset($searchData->name), function($q) use ($searchData) { |
|
| 98 | 93 | $q->where('name', 'like', '%'.$searchData->name.'%') |
| 99 | 94 | ->orWhere('cust_id', 'like', '%'.$searchData->name.'%') |
| 100 | 95 | ->orWhere('dba_name', 'like', '%'.$searchData->name.'%'); |
| 101 | 96 | }) |
| 102 | 97 | // Search by equipment type |
| 103 | - ->when($includeSystems, function($q) |
|
| 104 | - { |
|
| 98 | + ->when($includeSystems, function($q) { |
|
| 105 | 99 | $q->with('CustomerSystems.SystemTypes') |
| 106 | 100 | ->with('ParentSystems.SystemTypes'); |
| 107 | 101 | }) |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | // Process all of the search filters to search for a tech tip |
| 43 | 43 | protected function searchFor($search) |
| 44 | 44 | { |
| 45 | - $searchText = isset($search['text']) ? explode(' ', $search['text']) : null; |
|
| 46 | - $type = isset($search['type']) ? $search['type'] : null; |
|
| 45 | + $searchText = isset($search['text']) ? explode(' ', $search['text']) : null; |
|
| 46 | + $type = isset($search['type']) ? $search['type'] : null; |
|
| 47 | 47 | $sys = isset($search['sys_id']) ? $search['sys_id'] : null; |
| 48 | 48 | |
| 49 | 49 | return TechTips::orderBy('sticky', 'DESC') |
@@ -49,8 +49,7 @@ discard block |
||
| 49 | 49 | return TechTips::orderBy('sticky', 'DESC') |
| 50 | 50 | ->orderBy('created_at', 'DESC') |
| 51 | 51 | // Search text fields |
| 52 | - ->when(!empty($searchText), function($q) use ($searchText) |
|
| 53 | - { |
|
| 52 | + ->when(!empty($searchText), function($q) use ($searchText) { |
|
| 54 | 53 | foreach($searchText as $text) |
| 55 | 54 | { |
| 56 | 55 | $q->orWhere('subject', 'like', '%'.$text.'%') |
@@ -59,15 +58,12 @@ discard block |
||
| 59 | 58 | } |
| 60 | 59 | }) |
| 61 | 60 | // Search Article Type fields |
| 62 | - ->when($type, function($q) use ($type) |
|
| 63 | - { |
|
| 61 | + ->when($type, function($q) use ($type) { |
|
| 64 | 62 | $q->whereIn('tip_type_id', $type); |
| 65 | 63 | }) |
| 66 | 64 | // Search equipment type fields |
| 67 | - ->when($sys, function($q) use ($sys) |
|
| 68 | - { |
|
| 69 | - $q->whereHas('SystemTypes', function($q2) use ($sys) |
|
| 70 | - { |
|
| 65 | + ->when($sys, function($q) use ($sys) { |
|
| 66 | + $q->whereHas('SystemTypes', function($q2) use ($sys) { |
|
| 71 | 67 | $q2->whereIn('system_types.sys_id', $sys); |
| 72 | 68 | }); |
| 73 | 69 | }) |
@@ -139,8 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | if(isset($equip['laravel_through_key'])) |
| 141 | 141 | { |
| 142 | - $current = $current->filter(function($item) use ($equip) |
|
| 143 | - { |
|
| 142 | + $current = $current->filter(function($item) use ($equip) { |
|
| 144 | 143 | return $item->sys_id != $equip['sys_id']; |
| 145 | 144 | }); |
| 146 | 145 | } |
@@ -216,8 +215,7 @@ discard block |
||
| 216 | 215 | // Send a notification of the new/edited tech tip |
| 217 | 216 | protected function sendNotification($tip, $edit = false) |
| 218 | 217 | { |
| 219 | - $users = User::whereHas('UserSettings', function($q) |
|
| 220 | - { |
|
| 218 | + $users = User::whereHas('UserSettings', function($q) { |
|
| 221 | 219 | $q->where('em_tech_tip', true); |
| 222 | 220 | })->get(); |
| 223 | 221 | |