@@ -20,19 +20,19 @@ |
||
| 20 | 20 | public function run() |
| 21 | 21 | { |
| 22 | 22 | // Get module |
| 23 | - $module = ucmodule($this->config['module']); |
|
| 23 | + $module = ucmodule($this->config[ 'module' ]); |
|
| 24 | 24 | |
| 25 | 25 | // Get record |
| 26 | 26 | $modelClass = $module->model_class; |
| 27 | - $record = $modelClass::find($this->config['record_id']); |
|
| 27 | + $record = $modelClass::find($this->config[ 'record_id' ]); |
|
| 28 | 28 | |
| 29 | 29 | return view('uccello::widgets.relatedlist', [ |
| 30 | 30 | 'config' => $this->config, |
| 31 | - 'domain' => ucdomain($this->config['domain']), |
|
| 31 | + 'domain' => ucdomain($this->config[ 'domain' ]), |
|
| 32 | 32 | 'module' => $module, |
| 33 | - 'data' => (object) $this->config['data'], |
|
| 33 | + 'data' => (object)$this->config[ 'data' ], |
|
| 34 | 34 | 'record' => $record, |
| 35 | - 'label' => $this->config['data']->label ?? $this->config['labelForTranslation'], |
|
| 35 | + 'label' => $this->config[ 'data' ]->label ?? $this->config[ 'labelForTranslation' ], |
|
| 36 | 36 | ]); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | 'uitype_id' => uitype('boolean')->id, |
| 34 | 34 | 'displaytype_id' => displaytype('everywhere')->id, |
| 35 | 35 | 'sequence' => 3, |
| 36 | - 'data' => [ 'info' => 'field_info.see_descendants_records'] |
|
| 36 | + 'data' => [ 'info' => 'field_info.see_descendants_records' ] |
|
| 37 | 37 | ]); |
| 38 | 38 | |
| 39 | 39 | $filter = Filter::where('module_id', $roleModule->id)->where('name', 'filter.all')->first(); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | foreach ($treeDomainsIds as $treeDomainId) { |
| 45 | 45 | $_domain = Domain::find($treeDomainId); |
| 46 | 46 | foreach ($_domain->roles as $role) { |
| 47 | - $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name . ' > ' . $role->name; |
|
| 47 | + $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name.' > '.$role->name; |
|
| 48 | 48 | $roles[ $role->id ] = $roleName; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | |
| 155 | 155 | // Add tab id if defined |
| 156 | 156 | if ($this->tab_id) { |
| 157 | - $params['tab'] = $this->tab_id; |
|
| 157 | + $params[ 'tab' ] = $this->tab_id; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | return ucroute('uccello.edit.relation.delete', $domain, $this->relatedModule, $params); |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | <?php |
| 4 | 4 | $autocompleteSearch = false; |
| 5 | 5 | |
| 6 | - $entities = []; |
|
| 6 | + $entities = [ ]; |
|
| 7 | 7 | |
| 8 | - if (isset($column['data']->autocomplete_search) && $column['data']->autocomplete_search === true) { |
|
| 8 | + if (isset($column[ 'data' ]->autocomplete_search) && $column[ 'data' ]->autocomplete_search === true) { |
|
| 9 | 9 | $autocompleteSearch = true; |
| 10 | 10 | } else { |
| 11 | 11 | $entities = auth()->user()->getAllowedGroupsAndUsers(false); |
@@ -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 | } |
@@ -82,8 +82,7 @@ |
||
| 82 | 82 | { |
| 83 | 83 | if (empty($data['conditions'])) { |
| 84 | 84 | $data['conditions'] = []; |
| 85 | - } |
|
| 86 | - else { |
|
| 85 | + } else { |
|
| 87 | 86 | $data['conditions'] = (array) $data['conditions']; |
| 88 | 87 | } |
| 89 | 88 | |
@@ -78,24 +78,24 @@ |
||
| 78 | 78 | $filter = new static(); |
| 79 | 79 | |
| 80 | 80 | // Refactor $data to mach match 'conditions' filter format... |
| 81 | - if(!empty($data['columns']) && is_array($data['columns']) && is_array(reset($data['columns']))) |
|
| 81 | + if (!empty($data[ 'columns' ]) && is_array($data[ 'columns' ]) && is_array(reset($data[ 'columns' ]))) |
|
| 82 | 82 | { |
| 83 | - if (empty($data['conditions'])) { |
|
| 84 | - $data['conditions'] = []; |
|
| 83 | + if (empty($data[ 'conditions' ])) { |
|
| 84 | + $data[ 'conditions' ] = [ ]; |
|
| 85 | 85 | } |
| 86 | 86 | else { |
| 87 | - $data['conditions'] = (array) $data['conditions']; |
|
| 87 | + $data[ 'conditions' ] = (array)$data[ 'conditions' ]; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - foreach ($data['columns'] as $fieldName => $field) { |
|
| 90 | + foreach ($data[ 'columns' ] as $fieldName => $field) { |
|
| 91 | 91 | foreach ($field as $key => $value) { |
| 92 | 92 | if (!empty($value) && $key != 'columnName') { |
| 93 | - $data['conditions'][$key][$fieldName] = $value; |
|
| 93 | + $data[ 'conditions' ][ $key ][ $fieldName ] = $value; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - unset($data['columns']); |
|
| 98 | + unset($data[ 'columns' ]); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | foreach ($data as $key => $value) { |