mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
adds translation for accept_eula, a bit more logic on the Acceptance Controller that is not working yet
This commit is contained in:
parent
59c583ac74
commit
e1a6a2afc6
|
@ -7,9 +7,12 @@ use App\Events\CheckoutDeclined;
|
||||||
use App\Events\ItemAccepted;
|
use App\Events\ItemAccepted;
|
||||||
use App\Events\ItemDeclined;
|
use App\Events\ItemDeclined;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\Actionlog;
|
||||||
|
use App\Models\Asset;
|
||||||
use App\Models\CheckoutAcceptance;
|
use App\Models\CheckoutAcceptance;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Contracts\Acceptable;
|
use App\Models\Contracts\Acceptable;
|
||||||
|
use App\Models\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
@ -136,10 +139,19 @@ class AcceptanceController extends Controller
|
||||||
\Log::error(storage_path().'/eula-pdfs/'.$sig_filename);
|
\Log::error(storage_path().'/eula-pdfs/'.$sig_filename);
|
||||||
|
|
||||||
$pdf = Pdf::loadView('account.accept.accept-eula', $data);
|
$pdf = Pdf::loadView('account.accept.accept-eula', $data);
|
||||||
$stored_eula = Storage::put('private_uploads/eula-pdfs/accepted-eula-'.date('Y-m-d-h-i-s').'.pdf', $pdf->output());
|
$stored_eula= Storage::put('private_uploads/eula-pdfs/accepted-eula-'.date('Y-m-d-h-i-s').'.pdf', $pdf->output());
|
||||||
|
\Log::info($stored_eula);
|
||||||
//not sure what im doing here,but I think its something of this.
|
//not sure what im doing here,but I think its something of this.
|
||||||
route('log.storedeula.download', $stored_eula);
|
Actionlog::Create([
|
||||||
|
'item_id' => $acceptance->id,
|
||||||
|
'stored_eula' => $stored_eula,
|
||||||
|
'action_type' => 'accepted',
|
||||||
|
]);
|
||||||
|
\log::info(Actionlog::Create([
|
||||||
|
'item_id' => $acceptance->id,
|
||||||
|
'stored_eula' => $stored_eula,
|
||||||
|
'action_type' => 'accepted',
|
||||||
|
]));
|
||||||
|
|
||||||
return redirect()->to('account/accept')->with('success', $return_msg);
|
return redirect()->to('account/accept')->with('success', $return_msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ class ActionlogController extends Controller
|
||||||
$this->authorize('view', \App\Models\Asset::class);
|
$this->authorize('view', \App\Models\Asset::class);
|
||||||
$file = config('app.private_uploads').'/eula-pdfs/'.$filename;
|
$file = config('app.private_uploads').'/eula-pdfs/'.$filename;
|
||||||
|
|
||||||
|
|
||||||
return Response::download($file);
|
return Response::download($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddEulaToCheckoutAcceptance extends Migration
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddEulaToActionLogs extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('action_logs', function (Blueprint $table) {
|
||||||
|
$table->text('stored_eula')->nullable()->default(null);
|
||||||
|
$table->string('stored_eula_file')->nullable()->default(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('action_logs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('stored_eula');
|
||||||
|
$table->dropColumn('stored_eula_file');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -237,6 +237,7 @@
|
||||||
'state' => 'State',
|
'state' => 'State',
|
||||||
'status_labels' => 'Status Labels',
|
'status_labels' => 'Status Labels',
|
||||||
'status' => 'Status',
|
'status' => 'Status',
|
||||||
|
'accept_eula' => 'Acceptance Agreement',
|
||||||
'supplier' => 'Supplier',
|
'supplier' => 'Supplier',
|
||||||
'suppliers' => 'Suppliers',
|
'suppliers' => 'Suppliers',
|
||||||
'sure_to_delete' => 'Are you sure you wish to delete',
|
'sure_to_delete' => 'Are you sure you wish to delete',
|
||||||
|
|
|
@ -1093,15 +1093,12 @@
|
||||||
<th class="col-sm-2" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
<th class="col-sm-2" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
||||||
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
|
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
|
||||||
<th class="col-sm-2" data-field="note">{{ trans('general.notes') }}</th>
|
<th class="col-sm-2" data-field="note">{{ trans('general.notes') }}</th>
|
||||||
@if ($snipeSettings->require_accept_signature=='1')
|
<th class="col-sm-1" data-field="stored_eula_file" data-visible="true">{{ trans('general.accept_eula') }}</th>
|
||||||
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
|
|
||||||
@endif
|
|
||||||
<th class="col-md-3" data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</th>
|
<th class="col-md-3" data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</th>
|
||||||
<th class="col-sm-2" data-field="log_meta" data-visible="true" data-formatter="changeLogFormatter">{{ trans('admin/hardware/table.changed')}}</th>
|
<th class="col-sm-2" data-field="log_meta" data-visible="true" data-formatter="changeLogFormatter">{{ trans('admin/hardware/table.changed')}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- /.row -->
|
</div> <!-- /.row -->
|
||||||
</div> <!-- /.tab-pane history -->
|
</div> <!-- /.tab-pane history -->
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
<th class="col-sm-2" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.to') }}</th>
|
<th class="col-sm-2" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.to') }}</th>
|
||||||
<th class="col-sm-1" data-field="note">{{ trans('general.notes') }}</th>
|
<th class="col-sm-1" data-field="note">{{ trans('general.notes') }}</th>
|
||||||
<th class="col-sm-2" data-field="log_meta" data-visible="false" data-formatter="changeLogFormatter">{{ trans('general.changed') }}</th>
|
<th class="col-sm-2" data-field="log_meta" data-visible="false" data-formatter="changeLogFormatter">{{ trans('general.changed') }}</th>
|
||||||
<th class="col-sm-1" data-field="stored_eula_file" data-visible="true">{{ trans('general.accept_eula') }}</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -125,8 +125,8 @@ Route::group(['middleware' => 'auth'], function () {
|
||||||
[ActionlogController::class, 'displaySig']
|
[ActionlogController::class, 'displaySig']
|
||||||
)->name('log.signature.view');
|
)->name('log.signature.view');
|
||||||
Route::get(
|
Route::get(
|
||||||
'stored-eula-file/{$filename}/download',
|
'stored-eula-file/{$filename}/',
|
||||||
[ActionlogController::class, 'getStoredEula']
|
[\App\Http\Controllers\Api\ReportsController::class, 'getStoredEula']
|
||||||
)->name('log.storedeula.download');
|
)->name('log.storedeula.download');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue