Skip to content

Commit 53de97d

Browse files
committed
Merge branch 'develop' into saving_custom_report_template
2 parents 5574c5f + 6bec573 commit 53de97d

File tree

65 files changed

+28113
-18194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+28113
-18194
lines changed

.github/workflows/tests-mysql.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,3 @@ jobs:
7777
DB_PORT: ${{ job.services.mysql.ports[3306] }}
7878
DB_USERNAME: root
7979
run: php artisan test
80-
81-
- name: Test failure
82-
if: ${{ failure() }}
83-
run: docker exec "$PROJECT_NAME-php-fpm" cat storage/logs/laravel.log

.github/workflows/tests-postgres.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,3 @@ jobs:
7575
DB_USERNAME: snipeit
7676
DB_PASSWORD: password
7777
run: php artisan test
78-
79-
- name: Test failure
80-
if: ${{ failure() }}
81-
run: docker exec "$PROJECT_NAME-php-fpm" cat storage/logs/laravel.log

.github/workflows/tests-sqlite.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,3 @@ jobs:
5959
env:
6060
DB_CONNECTION: sqlite_testing
6161
run: php artisan test
62-
63-
- name: Test failure
64-
if: ${{ failure() }}
65-
run: docker exec "$PROJECT_NAME-php-fpm" cat storage/logs/laravel.log

app/Helpers/Helper.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Illuminate\Contracts\Encryption\DecryptException;
1717
use Carbon\Carbon;
1818
use Illuminate\Support\Facades\Log;
19+
use Illuminate\Support\Str;
1920
use Intervention\Image\ImageManagerStatic as Image;
2021
use Illuminate\Support\Facades\Session;
2122

@@ -708,6 +709,28 @@ public static function generateRandomString($length = 10)
708709

709710
return $randomString;
710711
}
712+
/**
713+
* A method to be used to handle deprecations notifications, currently handling MS Teams. more can be added when needed.
714+
*
715+
*
716+
* @author [Godfrey Martinez]
717+
* @since [v7.0.14]
718+
* @return array
719+
*/
720+
public static function deprecationCheck() : array {
721+
// The check and message that the user is still using the deprecated version
722+
$deprecations = [
723+
'ms_teams_deprecated' => array(
724+
'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'),
725+
'message' => 'The Microsoft Teams webhook URL being used will be deprecated Jan 31st, 2025. <a class="btn btn-primary" href="' . route('settings.slack.index') . '">Change webhook endpoint</a>'),
726+
];
727+
728+
// if item of concern is being used and its being used with the deprecated values return the notification array.
729+
if(Setting::getSettings()->webhook_selected === 'microsoft' && $deprecations['ms_teams_deprecated']['check']) {
730+
return $deprecations;
731+
}
732+
return [];
733+
}
711734

712735
/**
713736
* This nasty little method gets the low inventory info for the

app/Http/Controllers/Account/AcceptanceController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,5 @@ public function store(Request $request, $id) : RedirectResponse
338338
return redirect()->to('account/accept')->with('success', $return_msg);
339339

340340
}
341+
341342
}

app/Http/Controllers/ActionlogController.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ public function displaySig($filename) : RedirectResponse | Response | bool
3737
}
3838
}
3939

40-
public function getStoredEula($filename) : Response | BinaryFileResponse
40+
public function getStoredEula($filename) : Response | BinaryFileResponse | RedirectResponse
4141
{
4242
$this->authorize('view', \App\Models\Asset::class);
4343
$file = config('app.private_uploads').'/eula-pdfs/'.$filename;
44-
return response()->download($file);
44+
45+
if (Storage::exists($file)) {
46+
return response()->download($file);
47+
}
48+
49+
return redirect()->back()->with('error', trans('general.file_does_not_exist'));
50+
51+
52+
4553
}
4654
}

app/Http/Controllers/Api/ReportsController.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,6 @@ public function index(Request $request) : JsonResponse | array
4444
});
4545
}
4646

47-
if ($request->filled('action_type')) {
48-
$actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc');
49-
}
50-
51-
if ($request->filled('created_by')) {
52-
$actionlogs = $actionlogs->where('created_by', '=', $request->input('created_by'));
53-
}
54-
55-
if ($request->filled('action_source')) {
56-
$actionlogs = $actionlogs->where('action_source', '=', $request->input('action_source'))->orderBy('created_at', 'desc');
57-
}
58-
59-
if ($request->filled('remote_ip')) {
60-
$actionlogs = $actionlogs->where('remote_ip', '=', $request->input('remote_ip'))->orderBy('created_at', 'desc');
61-
}
6247

6348
if ($request->filled('uploads')) {
6449
$actionlogs = $actionlogs->whereNotNull('filename')->orderBy('created_at', 'desc');
@@ -74,6 +59,8 @@ public function index(Request $request) : JsonResponse | array
7459
'note',
7560
'remote_ip',
7661
'user_agent',
62+
'target_type',
63+
'item_type',
7764
'action_source',
7865
'action_date',
7966
];

app/Http/Controllers/Assets/BulkAssetsController.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ public function update(Request $request) : RedirectResponse
245245
|| ($request->filled('status_id'))
246246
|| ($request->filled('model_id'))
247247
|| ($request->filled('next_audit_date'))
248+
|| ($request->filled('asset_eol_date'))
248249
|| ($request->filled('null_name'))
249250
|| ($request->filled('null_purchase_date'))
250251
|| ($request->filled('null_expected_checkin_date'))
251252
|| ($request->filled('null_next_audit_date'))
253+
|| ($request->filled('null_asset_eol_date'))
252254
|| ($request->anyFilled($custom_field_columns))
253255

254256
) {
@@ -271,7 +273,8 @@ public function update(Request $request) : RedirectResponse
271273
->conditionallyAddItem('requestable')
272274
->conditionallyAddItem('supplier_id')
273275
->conditionallyAddItem('warranty_months')
274-
->conditionallyAddItem('next_audit_date');
276+
->conditionallyAddItem('next_audit_date')
277+
->conditionallyAddItem('asset_eol_date');
275278
foreach ($custom_field_columns as $key => $custom_field_column) {
276279
$this->conditionallyAddItem($custom_field_column);
277280
}
@@ -316,6 +319,17 @@ public function update(Request $request) : RedirectResponse
316319
$this->update_array['next_audit_date'] = null;
317320
}
318321

322+
if ($request->input('null_asset_eol_date')=='1') {
323+
$this->update_array['asset_eol_date'] = null;
324+
325+
// If they are nulling the EOL date to allow it to calculate, set eol explicit to 0
326+
if ($request->input('calc_eol')=='1') {
327+
$this->update_array['eol_explicit'] = 0;
328+
}
329+
}
330+
331+
332+
319333
if ($request->filled('purchase_cost')) {
320334
$this->update_array['purchase_cost'] = $request->input('purchase_cost');
321335
}

app/Http/Requests/StoreNotificationSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function rules(): array
2525
{
2626
return [
2727
'alert_email' => 'email_array|nullable',
28-
'admin_cc_email' => 'email|nullable',
28+
'admin_cc_email' => 'email_array|nullable',
2929
'alert_threshold' => 'numeric|nullable|gt:0',
3030
'alert_interval' => 'numeric|nullable|gt:0',
3131
'audit_warning_days' => 'numeric|nullable|gt:0',

0 commit comments

Comments
 (0)