@@ -270,13 +270,13 @@ |
||
| 270 | 270 | $domain = $this->domain; |
| 271 | 271 | $module = $this->module; |
| 272 | 272 | |
| 273 | - // Get model model class |
|
| 274 | - $modelClass = $module->model_class; |
|
| 273 | + // Get model model class |
|
| 274 | + $modelClass = $module->model_class; |
|
| 275 | 275 | |
| 276 | - // Check if the class exists |
|
| 277 | - if (!class_exists($modelClass)) { |
|
| 278 | - return false; |
|
| 279 | - } |
|
| 276 | + // Check if the class exists |
|
| 277 | + if (!class_exists($modelClass)) { |
|
| 278 | + return false; |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | 281 | // Filter on domain if column exists |
| 282 | 282 | if (Schema::hasColumn((new $modelClass)->getTable(), 'domain_id')) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ->get(); |
| 52 | 52 | |
| 53 | 53 | // Order by |
| 54 | - $filterOrderBy = (array) $selectedFilter->order_by; |
|
| 54 | + $filterOrderBy = (array)$selectedFilter->order_by; |
|
| 55 | 55 | |
| 56 | 56 | return $this->autoView(compact('datatableColumns', 'filters', 'selectedFilter', 'filterOrderBy')); |
| 57 | 57 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if ($relatedList && $relatedList->method) { |
| 116 | 116 | // Related list method |
| 117 | 117 | $method = $relatedList->method; |
| 118 | - $recordIdsMethod = $method . 'RecordIds'; |
|
| 118 | + $recordIdsMethod = $method.'RecordIds'; |
|
| 119 | 119 | |
| 120 | 120 | // Get related records ids |
| 121 | 121 | $model = new $modelClass; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | // Add the record id itself to be filtered |
| 125 | 125 | if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) { |
| 126 | - $filteredRecordIds[] = (int)$recordId; |
|
| 126 | + $filteredRecordIds[ ] = (int)$recordId; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // Make the quer |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $records = $query->paginate($length); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $records->getCollection()->transform(function ($record) use ($domain, $module) { |
|
| 137 | + $records->getCollection()->transform(function($record) use ($domain, $module) { |
|
| 138 | 138 | foreach ($module->fields as $field) { |
| 139 | 139 | // If a special template exists, use it. Else use the generic template |
| 140 | 140 | $uitype = uitype($field->uitype_id); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $results = collect(); |
| 175 | 175 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
| 176 | 176 | $searchResults = new Search(); |
| 177 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
| 177 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
| 178 | 178 | $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10)); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | $savePageLength = $request->input('save_page_length'); |
| 196 | 196 | |
| 197 | 197 | // Optional data |
| 198 | - $data = []; |
|
| 198 | + $data = [ ]; |
|
| 199 | 199 | if ($savePageLength) { |
| 200 | - $data["length"] = $request->input('page_length'); |
|
| 200 | + $data[ "length" ] = $request->input('page_length'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | $filter = Filter::firstOrNew([ |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create($this->tablePrefix.'entities', function (Blueprint $table) { |
|
| 16 | + Schema::create($this->tablePrefix.'entities', function(Blueprint $table) { |
|
| 17 | 17 | $table->uuid('id')->primary(); |
| 18 | 18 | $table->unsignedInteger('module_id'); |
| 19 | 19 | $table->unsignedInteger('record_id'); |
@@ -187,7 +187,7 @@ |
||
| 187 | 187 | */ |
| 188 | 188 | protected function getNotAdminModulesAttribute() : array |
| 189 | 189 | { |
| 190 | - return Cache::rememberForever('not_admin_modules', function () { |
|
| 190 | + return Cache::rememberForever('not_admin_modules', function() { |
|
| 191 | 191 | $modules = [ ]; |
| 192 | 192 | |
| 193 | 193 | foreach ($this->modules()->get() as $module) { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $modelClass = $module->model_class; |
| 53 | 53 | |
| 54 | 54 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
| 55 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
| 55 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $value = uitype($field->uitype_id)->getFormattedValueToDisplay($field, $record); |
| 3 | 3 | $valueParts = explode(';', $value); |
| 4 | -$fileName = $valueParts[0]; |
|
| 4 | +$fileName = $valueParts[ 0 ]; |
|
| 5 | 5 | ?> |
| 6 | 6 | @if (count($valueParts) === 2) |
| 7 | 7 | <a href="{{ ucroute('uccello.download', $domain, $module, [ 'id' => $record->getKey(), 'field' => $field->column ]) }}" |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | <?php |
| 8 | 8 | $value = uitype($field->uitype_id)->getFormattedValueToDisplay($field, $record); |
| 9 | 9 | $valueParts = explode(';', $value); |
| 10 | - $fileName = $valueParts[0]; |
|
| 10 | + $fileName = $valueParts[ 0 ]; |
|
| 11 | 11 | ?> |
| 12 | 12 | @if (count($valueParts) === 2) |
| 13 | 13 | <div class="truncate"> |
@@ -95,15 +95,15 @@ |
||
| 95 | 95 | <div class="hide-on-small-only hide-on-med-only"> |
| 96 | 96 | <?php |
| 97 | 97 | $searchValue = null; |
| 98 | - if ($selectedFilter && !empty($selectedFilter->conditions->search->{$column['name']})) { |
|
| 99 | - $searchValue = $selectedFilter->conditions->search->{$column['name']}; |
|
| 98 | + if ($selectedFilter && !empty($selectedFilter->conditions->search->{$column[ 'name' ]})) { |
|
| 99 | + $searchValue = $selectedFilter->conditions->search->{$column[ 'name' ]}; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // If a special template exists, use it. Else use the generic template |
| 103 | 103 | $uitypeViewName = sprintf('uitypes.search.%s', $column[ 'uitype' ]); |
| 104 | 104 | $uitypeFallbackView = 'uccello::modules.default.uitypes.search.text'; |
| 105 | 105 | $uitypeViewToInclude = uccello()->view($column[ 'package' ], $module, $uitypeViewName, $uitypeFallbackView); |
| 106 | - $field = $module->fields()->where('name', $column['name'])->first(); |
|
| 106 | + $field = $module->fields()->where('name', $column[ 'name' ])->first(); |
|
| 107 | 107 | ?> |
| 108 | 108 | @include($uitypeViewToInclude, [ 'field' => $field ]) |
| 109 | 109 | </div> |
@@ -30,15 +30,15 @@ |
||
| 30 | 30 | <div class="search hide-on-small-only hide-on-med-only"> |
| 31 | 31 | <?php |
| 32 | 32 | $searchValue = null; |
| 33 | - if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column['name']})) { |
|
| 34 | - $searchValue = $selectedFilter->conditions->search->{$column['name']}; |
|
| 33 | + if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column[ 'name' ]})) { |
|
| 34 | + $searchValue = $selectedFilter->conditions->search->{$column[ 'name' ]}; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | // If a special template exists, use it. Else use the generic template |
| 38 | 38 | $uitypeViewName = sprintf('uitypes.search.%s', $column[ 'uitype' ]); |
| 39 | 39 | $uitypeFallbackView = 'uccello::modules.default.uitypes.search.text'; |
| 40 | 40 | $uitypeViewToInclude = uccello()->view($column[ 'package' ], $module, $uitypeViewName, $uitypeFallbackView); |
| 41 | - $field = $module->fields()->where('name', $column['name'])->first(); |
|
| 41 | + $field = $module->fields()->where('name', $column[ 'name' ])->first(); |
|
| 42 | 42 | ?> |
| 43 | 43 | @include($uitypeViewToInclude, [ 'field' => $field ]) |
| 44 | 44 | </div> |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | {{-- Badge --}} |
| 32 | 32 | <?php |
| 33 | - $countMethod = $relatedlist->method . 'Count'; |
|
| 33 | + $countMethod = $relatedlist->method.'Count'; |
|
| 34 | 34 | |
| 35 | 35 | $model = new $relatedModule->model_class; |
| 36 | 36 | $count = $model->$countMethod($relatedlist, $record->id); |