Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>

# Conflicts:
#	public/css/build/app.css
#	public/css/build/overrides.css
#	public/css/dist/all.css
#	public/mix-manifest.json
  • Loading branch information
snipe committed Nov 26, 2024
2 parents 6ee0c93 + 11f83b4 commit 37ac7fe
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 26 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ public function postSettings(Request $request) : RedirectResponse
$setting->depreciation_method = $request->input('depreciation_method');
$setting->dash_chart_type = $request->input('dash_chart_type');
$setting->profile_edit = $request->input('profile_edit', 0);
$setting->require_checkinout_notes = $request->input('require_checkinout_notes', 0);


if ($request->input('per_page') != '') {
$setting->per_page = $request->input('per_page');
Expand Down
9 changes: 7 additions & 2 deletions app/Http/Requests/AssetCheckinRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ public function authorize()
*/
public function rules()
{
return [
$settings = \App\Models\Setting::getSettings();

];
$rules = [];

if($settings->require_checkinout_notes) {
$rules['note'] = 'string|required';
}
return $rules;
}

public function response(array $errors)
Expand Down
8 changes: 7 additions & 1 deletion app/Http/Requests/AssetCheckoutRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public function authorize()
*/
public function rules()
{
$settings = \App\Models\Setting::getSettings();

$rules = [
'assigned_user' => 'required_without_all:assigned_asset,assigned_location',
'assigned_asset' => 'required_without_all:assigned_user,assigned_location',
Expand All @@ -35,7 +37,11 @@ public function rules()
'nullable',
'date'
],
];
];

if($settings->require_checkinout_notes) {
$rules['note'] = 'required|string';
}

return $rules;
}
Expand Down
1 change: 1 addition & 0 deletions app/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Setting extends Model

protected $casts = [
'label2_asset_logo' => 'boolean',
'require_checkinout_notes' => 'boolean',
];

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->boolean('require_checkinout_notes')->nullable()->default(0);
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('settings', function (Blueprint $table) {
if (Schema::hasColumn('settings', 'require_checkinout_notes')) {
$table->dropColumn('require_checkinout_notes');
}
});
}
};
2 changes: 1 addition & 1 deletion public/css/build/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/build/overrides.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/dist/all.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"/js/build/app.js": "/js/build/app.js?id=5572f3bd32a6131651ab3022edd76941",
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=d34ae2483cbe2c77478c45f4006eba55",
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=b1c78591f51b52beab05b52f407ad6e6",
"/css/build/overrides.css": "/css/build/overrides.css?id=49a09bf67bd6129ef4ce910d0be09757",
"/css/build/app.css": "/css/build/app.css?id=6b9acfefe41b964aa29d58dd26d6f910",
"/css/build/overrides.css": "/css/build/overrides.css?id=b1146d30456ed95c3d4a9b60ddc58313",
"/css/build/app.css": "/css/build/app.css?id=e5f692af9dd2c217455ad87e520ef32a",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=a67bd93bed52e6a29967fe472de66d6c",
"/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=fc7adb943668ac69fe4b646625a7571f",
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=53edc92eb2d272744bc7404ec259930e",
Expand All @@ -19,7 +19,7 @@
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=392cc93cfc0be0349bab9697669dd091",
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=18787b3f00a3be7be38ee4e26cbd2a07",
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=1f33ca3d860461c1127ec465ab3ebb6b",
"/css/dist/all.css": "/css/dist/all.css?id=9a85a7206ecd9a5e74ec0736bec0026e",
"/css/dist/all.css": "/css/dist/all.css?id=fa28de72acfa72bfdd7ad4206a65d4eb",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
"/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/less/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ a.logo.no-hover a:hover {
background-color: transparent;
}

input:required, select:required {
input:required, select:required, textarea:required {
border-right: 6px solid orange;
}

Expand Down
7 changes: 6 additions & 1 deletion resources/assets/less/overrides.less
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,6 @@ th.css-component > .th-inner::before
}
@media screen and (max-width: 992px){
.info-stack-container {
display: flex;
flex-direction: column;
}
.col-md-3.col-xs-12.col-sm-push-9.info-stack{
Expand All @@ -892,6 +891,12 @@ th.css-component > .th-inner::before
float:none;
}
}
@media screen and (max-width: 992px){
.row-new-striped div{
width:100%;
}
}

@media screen and (max-width: 1318px) and (min-width: 1200px){
.admin.box{
height:170px;
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en-US/admin/settings/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@
'two_factor_enrollment_text' => "Two factor authentication is required, however your device has not been enrolled yet. Open your Google Authenticator app and scan the QR code below to enroll your device. Once you've enrolled your device, enter the code below",
'require_accept_signature' => 'Require Signature',
'require_accept_signature_help_text' => 'Enabling this feature will require users to physically sign off on accepting an asset.',
'require_checkinout_notes' => 'Require Notes on Checkin/Checkout',
'require_checkinout_notes_help_text' => 'Enabling this feature will require the note fields to be populated when checking in or checking out an asset.',
'left' => 'left',
'right' => 'right',
'top' => 'top',
Expand Down
22 changes: 11 additions & 11 deletions resources/views/hardware/checkin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@
</div>
</div>

<!-- Note -->
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
<label for="note" class="col-sm-3 control-label">
{{ trans('general.notes') }}
</label>
<div class="col-md-8">
<textarea class="col-md-6 form-control" id="note"
name="note">{{ old('note', $asset->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Note -->
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
<label for="note" class="col-md-3 control-label">
{{ trans('general.notes') }}
</label>
<div class="col-md-8">
<textarea class="col-md-6 form-control" id="note" @required($snipeSettings->require_checkinout_notes)
name="note">{{ old('note', $asset->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
</div> <!--/.box-body-->
</div> <!--/.box-body-->

Expand Down
3 changes: 2 additions & 1 deletion resources/views/hardware/checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@
<label for="note" class="col-md-3 control-label">
{{ trans('general.notes') }}
</label>

<div class="col-md-8">
<textarea class="col-md-6 form-control" id="note"
<textarea class="col-md-6 form-control" id="note" @required($snipeSettings->require_checkinout_notes)
name="note">{{ old('note', $asset->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
Expand Down
17 changes: 17 additions & 0 deletions resources/views/settings/general.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,23 @@
</div>
</div>

<!-- Require Notes on checkin/checkout checkbox -->
<div class="form-group">
<div class="col-md-3">
<label>
{{ trans('admin/settings/general.require_checkinout_notes') }}
</label>
</div>
<div class="col-md-8">
<label class="form-control">
<input type="checkbox" value="1" name="require_checkinout_notes" {{ (old('require_checkinout_notes', $setting->require_checkinout_notes)) == '1' ? ' checked="checked"' : '' }} aria-label="require_checkinout_notes">
{{ trans('general.yes') }}
</label>
<p class="help-block">{{ trans('admin/settings/general.require_checkinout_notes_help_text') }}</p>
</div>
</div>
<!-- /.form-group -->


<!-- login text -->
<div class="form-group {{ $errors->has('login_note') ? 'error' : '' }}">
Expand Down
6 changes: 3 additions & 3 deletions resources/views/users/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@
<div class="row">
<!-- name -->

<div class="col-md-3 col-sm-2">
<div class="col-md-3">
{{ trans('admin/users/table.name') }}
</div>
<div class="col-md-9 col-sm-2">
<div class="col-md-9">
{{ $user->present()->fullName() }}
</div>

Expand Down Expand Up @@ -751,7 +751,7 @@
{{Helper::formatCurrencyOutput($user->getUserTotalCost()->total_user_cost)}}

<a id="optional_info" class="text-primary">
<x-icon type="caret-right" id="optional_info_icon" /></i>
<x-icon type="caret-right" id="optional_info_icon" />
<strong>{{ trans('admin/hardware/form.optional_infos') }}</strong>
</a>
</div>
Expand Down

0 comments on commit 37ac7fe

Please sign in to comment.