Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2021-06-10 15:17:19 -07:00
commit 4c007ae085
4 changed files with 125 additions and 1 deletions

View file

@ -33,6 +33,10 @@ class UserFilesController extends Controller
$logActions = []; $logActions = [];
$files = $request->file('file'); $files = $request->file('file');
if (is_null($files)){
return redirect()->back()->with('error', trans('admin/users/message.upload.nofiles'));
}
foreach($files as $file) { foreach($files as $file) {
$extension = $file->getClientOriginalExtension(); $extension = $file->getClientOriginalExtension();
$filename = 'user-' . $user->id . '-' . str_random(8); $filename = 'user-' . $user->id . '-' . str_random(8);

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSerialNumberIndexes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function (Blueprint $table) {
$table->index(['serial']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function (Blueprint $table) {
$table->dropIndex(['serial']);
});
}
}

View file

@ -0,0 +1,88 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCompanyIdIndexes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accessories', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('action_logs', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('assets', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('components', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('consumables', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('departments', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('licenses', function (Blueprint $table) {
$table->index(['company_id']);
});
Schema::table('users', function (Blueprint $table) {
$table->index(['company_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('licenses', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('departments', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('consumables', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('components', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('assets', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('action_logs', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
Schema::table('accessories', function (Blueprint $table) {
$table->dropIndex(['company_id']);
});
}
}

View file

@ -19,7 +19,7 @@
<label class="btn btn-default"> <label class="btn btn-default">
{{ trans('button.select_file') }} {{ trans('button.select_file') }}
<input type="file" name="file[]" multiple="true" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/*,.csv,.zip,.rar,.doc,.docx,.xls,.xlsx,.xml,.lic,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain,.pdf,application/rtf" style="display:none"> <input type="file" name="file[]" multiple="true" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/*,.csv,.zip,.rar,.doc,.docx,.xls,.xlsx,.xml,.lic,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain,.pdf,application/rtf" style="display:none" required>
</label> </label>
</div> </div>