mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
WIP: begin migrating notes to ui controller
This commit is contained in:
parent
071b4d1e67
commit
25215fd3c9
13
app/Http/Controllers/NotesController.php
Normal file
13
app/Http/Controllers/NotesController.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class NotesController extends Controller
|
||||||
|
{
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
dd($request->all());
|
||||||
|
}
|
||||||
|
}
|
|
@ -217,14 +217,16 @@
|
||||||
|
|
||||||
<!-- Add notes -->
|
<!-- Add notes -->
|
||||||
@can('update', \App\Models\Asset::class)
|
@can('update', \App\Models\Asset::class)
|
||||||
<!--
|
|
||||||
|
|
||||||
<div class="col-md-12 hidden-print" style="padding-top: 5px;">
|
<div class="col-md-12 hidden-print" style="padding-top: 5px;">
|
||||||
<a href='{{ route('modal.show', 'add-note') }}?type=asset&id={{$asset->id}}' style="width: 100%" data-toggle="modal" data-target="#createModal" data-select='add-note_select_id' data-refresh="assetHistory" data-hasnopayload="true" class="btn btn-sm btn-primary btn-block btn-social hidden-print">
|
<a href="#" style="width: 100%" data-toggle="modal" data-target="#createNoteModal" class="btn btn-sm btn-primary btn-block btn-social hidden-print">
|
||||||
<x-icon type="note" />
|
<x-icon type="note" />
|
||||||
{{ trans('general.add_note') }}</a>
|
{{ trans('general.add_note') }}
|
||||||
|
</a>
|
||||||
|
@include ('modals.add-note', ['type' => 'asset', 'id' => $asset->id])
|
||||||
</div>
|
</div>
|
||||||
-->
|
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
{{-- See snipeit_modals.js for what powers this --}}
|
{{-- See snipeit_modals.js for what powers this --}}
|
||||||
|
<div class="modal fade" id="createNoteModal" tabindex="-1" role="dialog" aria-labelledby="createNoteModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h2 class="modal-title">{{ trans('general.add_note') }}</h2>
|
<h2 class="modal-title" id="createNoteModalLabel">{{ trans('general.add_note') }}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
<form
|
||||||
|
method="POST"
|
||||||
|
action="{{ route('notes.store') }}"
|
||||||
|
accept-charset="UTF-8"
|
||||||
|
>
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" name="type" value="{{$type}}"/>
|
||||||
|
<input type="hidden" name="id" value="{{$id}}"/>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form action="{{ route('api.notes.store') }}" onsubmit="return false">
|
|
||||||
<input type="hidden" name="type" value="{{request("type")}}"/>
|
|
||||||
<input type="hidden" name="id" value="{{request("id")}}"/>
|
|
||||||
<div class="alert alert-danger" id="modal_error_msg" style="display:none"></div>
|
<div class="alert alert-danger" id="modal_error_msg" style="display:none"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -18,11 +24,12 @@
|
||||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('button.cancel') }}</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('button.cancel') }}</button>
|
||||||
<button type="button" class="btn btn-primary pull-right" id="modal-save">{{ trans('general.save') }}</button>
|
<button type="submit" class="btn btn-primary pull-right" id="modal-save">{{ trans('general.save') }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
|
|
@ -14,6 +14,7 @@ use App\Http\Controllers\LabelsController;
|
||||||
use App\Http\Controllers\LocationsController;
|
use App\Http\Controllers\LocationsController;
|
||||||
use App\Http\Controllers\ManufacturersController;
|
use App\Http\Controllers\ManufacturersController;
|
||||||
use App\Http\Controllers\ModalController;
|
use App\Http\Controllers\ModalController;
|
||||||
|
use App\Http\Controllers\NotesController;
|
||||||
use App\Http\Controllers\ProfileController;
|
use App\Http\Controllers\ProfileController;
|
||||||
use App\Http\Controllers\ReportsController;
|
use App\Http\Controllers\ReportsController;
|
||||||
use App\Http\Controllers\ReportTemplatesController;
|
use App\Http\Controllers\ReportTemplatesController;
|
||||||
|
@ -339,6 +340,10 @@ Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::group(['middleware' => ['auth']], function () {
|
||||||
|
Route::post('notes', [NotesController::class, 'store'])->name('notes.store');
|
||||||
|
});
|
||||||
|
|
||||||
Route::group(['middleware' => ['auth']], function () {
|
Route::group(['middleware' => ['auth']], function () {
|
||||||
Route::get('reports/audit',
|
Route::get('reports/audit',
|
||||||
[ReportsController::class, 'audit']
|
[ReportsController::class, 'audit']
|
||||||
|
|
Loading…
Reference in a new issue