@@ -109,8 +109,8 @@ |
||
| 109 | 109 | */ |
| 110 | 110 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder |
| 111 | 111 | { |
| 112 | - $query->where(function ($query) use($field, $value) { |
|
| 113 | - foreach ((array) $value as $_value) { |
|
| 112 | + $query->where(function($query) use($field, $value) { |
|
| 113 | + foreach ((array)$value as $_value) { |
|
| 114 | 114 | // Replace me by connected user's id |
| 115 | 115 | if ($_value === 'me') { |
| 116 | 116 | $_value = Auth::user()->uuid; |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
| 131 | 131 | // Search related records and get all ids |
| 132 | 132 | $searchResults = new Search(); |
| 133 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
| 133 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
| 134 | 134 | $recordIds = $searchResults->search($value)->pluck('searchable.id'); |
| 135 | 135 | |
| 136 | 136 | // Search records linked to record ids got previously |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ]; |
| 59 | 59 | |
| 60 | 60 | // We want the field displays the datetime in the good format |
| 61 | - $options['value'] = $this->getFormattedValueToDisplay($field, $record); |
|
| 61 | + $options[ 'value' ] = $this->getFormattedValueToDisplay($field, $record); |
|
| 62 | 62 | |
| 63 | 63 | return $options; |
| 64 | 64 | } |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder |
| 124 | 124 | { |
| 125 | 125 | if (!$this->isEmptyOrNotEmptySearchQuery($query, $field, $value)) { |
| 126 | - $query->where(function ($query) use($field, $value) { |
|
| 126 | + $query->where(function($query) use($field, $value) { |
|
| 127 | 127 | $values = explode(',', $value); // Start Date, End Date |
| 128 | - $dateStart = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[0])); |
|
| 129 | - $dateEnd = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[1])); |
|
| 128 | + $dateStart = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[ 0 ])); |
|
| 129 | + $dateEnd = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[ 1 ])); |
|
| 130 | 130 | $query->whereBetween($field->column, [ $dateStart, $dateEnd ])->get(); |
| 131 | 131 | }); |
| 132 | 132 | } |
@@ -61,17 +61,17 @@ |
||
| 61 | 61 | |
| 62 | 62 | public function parentGroups() |
| 63 | 63 | { |
| 64 | - return $this->belongsToMany(static::class, $this->tablePrefix . 'rl_groups_groups', 'children_id', 'parent_id'); |
|
| 64 | + return $this->belongsToMany(static::class, $this->tablePrefix.'rl_groups_groups', 'children_id', 'parent_id'); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function childrenGroups() |
| 68 | 68 | { |
| 69 | - return $this->belongsToMany(static::class, $this->tablePrefix . 'rl_groups_groups', 'parent_id', 'children_id'); |
|
| 69 | + return $this->belongsToMany(static::class, $this->tablePrefix.'rl_groups_groups', 'parent_id', 'children_id'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function users() |
| 73 | 73 | { |
| 74 | - return $this->belongsToMany(User::class, $this->tablePrefix . 'rl_groups_users'); |
|
| 74 | + return $this->belongsToMany(User::class, $this->tablePrefix.'rl_groups_users'); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -56,15 +56,15 @@ |
||
| 56 | 56 | |
| 57 | 57 | protected static function getModuleFromClass($className) |
| 58 | 58 | { |
| 59 | - $modules = Cache::rememberForever('modules_by_model_class', function () { |
|
| 59 | + $modules = Cache::rememberForever('modules_by_model_class', function() { |
|
| 60 | 60 | $modulesGroupedByModelClass = collect(); |
| 61 | - Module::all()->map(function ($item) use ($modulesGroupedByModelClass) { |
|
| 62 | - $modulesGroupedByModelClass[$item->model_class] = $item; |
|
| 61 | + Module::all()->map(function($item) use ($modulesGroupedByModelClass) { |
|
| 62 | + $modulesGroupedByModelClass[ $item->model_class ] = $item; |
|
| 63 | 63 | return $modulesGroupedByModelClass; |
| 64 | 64 | }); |
| 65 | 65 | return $modulesGroupedByModelClass; |
| 66 | 66 | }); |
| 67 | - return $modules[(string) $className] ?? null; |
|
| 67 | + return $modules[ (string)$className ] ?? null; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function getUuidAttribute() |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | // With conditions |
| 64 | 64 | if ($request->input('with_conditions') === '1') { |
| 65 | 65 | // TODO: Build $conditions['search'] earlier in the export process to match filter format... |
| 66 | - $conditions = ['search' => json_decode($request->input('conditions'))]; |
|
| 66 | + $conditions = [ 'search' => json_decode($request->input('conditions')) ]; |
|
| 67 | 67 | $export = $export->withConditions($conditions); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function down() |
| 27 | 27 | { |
| 28 | - Schema::table($this->tablePrefix . 'filters', function (Blueprint $table) { |
|
| 28 | + Schema::table($this->tablePrefix.'filters', function(Blueprint $table) { |
|
| 29 | 29 | $table->renameColumn('order', 'order_by'); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <div class="autoscroll-x"> |
| 2 | - <?php $filterOrder = !empty($selectedFilter) ? (array) $selectedFilter->order : []; ?> |
|
| 2 | + <?php $filterOrder = !empty($selectedFilter) ? (array)$selectedFilter->order : [ ]; ?> |
|
| 3 | 3 | <table |
| 4 | 4 | id="{{ $datatableId }}" |
| 5 | 5 | class="striped highlight" |
@@ -31,15 +31,15 @@ discard block |
||
| 31 | 31 | <div class="search hide-on-small-only hide-on-med-only"> |
| 32 | 32 | <?php |
| 33 | 33 | $searchValue = null; |
| 34 | - if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column['name']})) { |
|
| 35 | - $searchValue = $selectedFilter->conditions->search->{$column['name']}; |
|
| 34 | + if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column[ 'name' ]})) { |
|
| 35 | + $searchValue = $selectedFilter->conditions->search->{$column[ 'name' ]}; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // If a special template exists, use it. Else use the generic template |
| 39 | 39 | $uitypeViewName = sprintf('uitypes.search.%s', $column[ 'uitype' ]); |
| 40 | 40 | $uitypeFallbackView = 'uccello::modules.default.uitypes.search.text'; |
| 41 | 41 | $uitypeViewToInclude = uccello()->view($column[ 'package' ], $module, $uitypeViewName, $uitypeFallbackView); |
| 42 | - $field = $module->fields()->where('name', $column['name'])->first(); |
|
| 42 | + $field = $module->fields()->where('name', $column[ 'name' ])->first(); |
|
| 43 | 43 | ?> |
| 44 | 44 | @include($uitypeViewToInclude, [ 'field' => $field ]) |
| 45 | 45 | </div> |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | // Related field |
| 35 | 35 | $relatedField = $relatedList->relatedField; |
| 36 | - $filter = ['order' => request('order')]; |
|
| 36 | + $filter = [ 'order' => request('order') ]; |
|
| 37 | 37 | |
| 38 | 38 | $query = $query->where($relatedField->column, $recordId) |
| 39 | 39 | ->filterBy($filter); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $relationName = $relatedList->relationName; |
| 75 | 75 | |
| 76 | 76 | $record = $modelClass::find($recordId); |
| 77 | - $filter = ['order' => request('order')]; |
|
| 77 | + $filter = [ 'order' => request('order') ]; |
|
| 78 | 78 | |
| 79 | 79 | $query = $record->$relationName() |
| 80 | 80 | ->filterBy($filter); |