Skip to content

Commit 2ac4449

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 83708e1 + f890e1f commit 2ac4449

File tree

9 files changed

+22
-8
lines changed

9 files changed

+22
-8
lines changed

app/Http/Controllers/Api/AssetMaintenancesController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public function index(Request $request)
7171
'asset_tag',
7272
'asset_name',
7373
'user_id',
74-
'supplier'
74+
'supplier',
75+
'is_warranty',
7576
];
7677
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
7778
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';

app/Http/Livewire/Importer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ public function mount()
288288
];
289289

290290
$this->users_fields = [
291+
'id' => trans('general.id'),
291292
'company' => trans('general.company'),
292293
'location' => trans('general.location'),
293294
'department' => trans('general.department'),

app/Http/Transformers/AssetMaintenancesTransformer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function transformAssetMaintenance(AssetMaintenance $assetmaintenance)
5959
'user_id' => ($assetmaintenance->admin) ? ['id' => $assetmaintenance->admin->id, 'name'=> e($assetmaintenance->admin->getFullNameAttribute())] : null,
6060
'created_at' => Helper::getFormattedDateObject($assetmaintenance->created_at, 'datetime'),
6161
'updated_at' => Helper::getFormattedDateObject($assetmaintenance->updated_at, 'datetime'),
62+
'is_warranty'=> $assetmaintenance->is_warranty,
6263

6364
];
6465

app/Importer/UserImporter.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ protected function handle($row)
4242
public function createUserIfNotExists(array $row)
4343
{
4444
// Pull the records from the CSV to determine their values
45+
$this->item['id'] = $this->findCsvMatch($row, 'id');
4546
$this->item['username'] = $this->findCsvMatch($row, 'username');
4647
$this->item['first_name'] = $this->findCsvMatch($row, 'first_name');
4748
$this->item['last_name'] = $this->findCsvMatch($row, 'last_name');
@@ -76,13 +77,18 @@ public function createUserIfNotExists(array $row)
7677
$user_formatted_array = User::generateFormattedNameFromFullName($user_full_name, Setting::getSettings()->username_format);
7778
$this->item['username'] = $user_formatted_array['username'];
7879
}
79-
80-
$user = User::where('username', $this->item['username'])->first();
80+
81+
// Check if a numeric ID was passed. If it does, use that above all else.
82+
if ((array_key_exists('id', $this->item) && ($this->item['id'] != "") && (is_numeric($this->item['id'])))) {
83+
$user = User::find($this->item['id']);
84+
} else {
85+
$user = User::where('username', $this->item['username'])->first();
86+
}
87+
8188
if ($user) {
89+
8290
if (! $this->updating) {
83-
$this->log('A matching User '.$this->item['name'].' already exists. ');
8491
\Log::debug('A matching User '.$this->item['name'].' already exists. ');
85-
8692
return;
8793
}
8894
$this->log('Updating User');
@@ -109,7 +115,6 @@ public function createUserIfNotExists(array $row)
109115
$user->fill($this->sanitizeItemForStoring($user));
110116

111117
if ($user->save()) {
112-
// $user->logCreate('Imported using CSV Importer');
113118
$this->log('User '.$this->item['name'].' was created');
114119

115120
if (($user->email) && ($user->activated == '1')) {

app/Presenters/AssetMaintenancesPresenter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public static function dataTableLayout()
9595
'searchable' => true,
9696
'sortable' => true,
9797
'title' => trans('admin/asset_maintenances/table.is_warranty'),
98+
'formatter' => 'trueFalseFormatter'
9899
], [
99100
'field' => 'cost',
100101
'searchable' => true,

config/dompdf.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@
7474
* This is only checked on command line call by dompdf.php, but not by
7575
* direct class use like:
7676
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
77+
*
78+
*
79+
* Hardcoding 2 Paths needed for Docker Containers
7780
*/
78-
"chroot" => realpath(base_path()),
81+
"chroot" => realpath(base_path()) . ",/var/lib/snipeit/data/uploads,/var/lib/snipeit/data/private_uploads",
7982

8083
/**
8184
* Whether to enable font subsetting or not.

resources/views/account/requestable-assets.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class="table table-striped snipe-table"
5757
<thead>
5858
<tr>
5959
<th class="col-md-1" data-field="image" data-formatter="imageFormatter" data-sortable="true">{{ trans('general.image') }}</th>
60+
<th class="col-md-2" data-field="asset_tag" data-sortable="true" >{{ trans('general.asset_tag') }}</th>
6061
<th class="col-md-2" data-field="model" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
6162
<th class="col-md-2" data-field="model_number" data-sortable="true">{{ trans('admin/models/table.modelnumber') }}</th>
6263
<th class="col-md-2" data-field="name" data-sortable="true">{{ trans('admin/hardware/form.name') }}</th>

resources/views/reports/asset_maintenances.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class="table table-striped snipe-table"
4848
<th data-searchable="true" data-sortable="true" data-field="cost" class="text-right" data-footer-formatter="sumFormatter">{{ trans('admin/asset_maintenances/form.cost') }}</th>
4949
<th data-sortable="true" data-field="location" data-formatter="deployedLocationFormatter" data-visible="false">{{ trans('general.location') }}</th>
5050
<th data-sortable="true" data-field="rtd_location" data-formatter="deployedLocationFormatter" data-visible="false">{{ trans('admin/hardware/form.default_location') }}</th>
51+
<th data-searchable="true" data-sortable="true" data-field="is_warranty" data-formatter="trueFalseformatter">{{ trans('admin/asset_maintenances/table.is_warranty') }}</th>
5152
<th data-searchable="true" data-sortable="true" data-field="user_id" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
5253
<th data-searchable="true" data-sortable="true" data-field="notes" data-visible="false">{{ trans('admin/asset_maintenances/form.notes') }}</th>
5354
</tr>

resources/views/statuslabels/edit.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
7676
$(function() {
7777
$('.color').colorpicker({
78-
color: '#AA3399',
78+
color: `{{ old('color', $item->color) ?: '#AA3399' }}`,
7979
format: 'hex'
8080
});
8181
});

0 commit comments

Comments
 (0)