diff --git a/app/Http/Controllers/Account/AcceptanceController.php b/app/Http/Controllers/Account/AcceptanceController.php index a40a58634..685b5a965 100644 --- a/app/Http/Controllers/Account/AcceptanceController.php +++ b/app/Http/Controllers/Account/AcceptanceController.php @@ -152,6 +152,13 @@ class AcceptanceController extends Controller * since we want the moment-in-time proof of what the EULA was when they accepted it. */ $branding_settings = SettingsController::getPDFBranding(); + + if (is_null($branding_settings->logo)){ + $path_logo = ""; + } else { + $path_logo = public_path() . '/uploads/' . $branding_settings->logo; + } + $data = [ 'item_tag' => $item->asset_tag, 'item_model' => $display_model, @@ -162,7 +169,7 @@ class AcceptanceController extends Controller 'assigned_to' => $assigned_to, 'company_name' => $branding_settings->site_name, 'signature' => ($sig_filename) ? storage_path() . '/private_uploads/signatures/' . $sig_filename : null, - 'logo' => public_path() . '/uploads/' . $branding_settings->logo, + 'logo' => $path_logo, 'date_settings' => $branding_settings->date_display_format, ]; diff --git a/app/Http/Controllers/Api/LicenseSeatsController.php b/app/Http/Controllers/Api/LicenseSeatsController.php index 0dd1c1fbd..4d0fe0994 100644 --- a/app/Http/Controllers/Api/LicenseSeatsController.php +++ b/app/Http/Controllers/Api/LicenseSeatsController.php @@ -116,16 +116,20 @@ class LicenseSeatsController extends Controller return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success'))); } + // the logging functions expect only one "target". if both asset and user are present in the request, + // we simply let assets take precedence over users... + if ($licenseSeat->isDirty('assigned_to')) { + $target = $is_checkin ? $oldUser : User::find($licenseSeat->assigned_to); + } + if ($licenseSeat->isDirty('asset_id')) { + $target = $is_checkin ? $oldAsset : Asset::find($licenseSeat->asset_id); + } + + if (is_null($target)){ + return response()->json(Helper::formatStandardApiResponse('error', null, 'Target not found')); + } + if ($licenseSeat->save()) { - // the logging functions expect only one "target". if both asset and user are present in the request, - // we simply let assets take precedence over users... - $changes = $licenseSeat->getChanges(); - if (array_key_exists('assigned_to', $changes)) { - $target = $is_checkin ? $oldUser : User::find($changes['assigned_to']); - } - if (array_key_exists('asset_id', $changes)) { - $target = $is_checkin ? $oldAsset : Asset::find($changes['asset_id']); - } if ($is_checkin) { $licenseSeat->logCheckin($target, $request->input('note')); diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 12f89de2b..53bc3674d 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -55,25 +55,35 @@ class ActionlogsTransformer } } + $file_url = ''; + if($actionlog->filename!='') { + if ($actionlog->present()->actionType() == 'accepted') { + $file_url = route('log.storedeula.download', ['filename' => $actionlog->filename]); + } else { + if ($actionlog->itemType() == 'asset') { + $file_url = route('show/assetfile', ['assetId' => $actionlog->id, 'fileId' => $actionlog->id]); + } elseif ($actionlog->itemType() == 'license') { + $file_url = route('show.licensefile', ['licenseId' => $actionlog->item->id, 'fileId' => $actionlog->id]); + } elseif ($actionlog->itemType() == 'user') { + $file_url = route('show/userfile', ['userId' => $actionlog->item->id, 'fileId' => $actionlog->id]); + } + } + } - $array = [ + $array = [ 'id' => (int) $actionlog->id, 'icon' => $icon, 'file' => ($actionlog->filename!='') ? [ - 'url' => ($actionlog->present()->actionType()=='accepted') - ? - route('log.storedeula.download', ['filename' => $actionlog->filename]) - : - route('show/assetfile', ['assetId' => $actionlog->id, 'fileId' => $actionlog->id]), + 'url' => $file_url, 'filename' => $actionlog->filename, 'inlineable' => (bool) Helper::show_file_inline($actionlog->filename), ] : null, 'item' => ($actionlog->item) ? [ 'id' => (int) $actionlog->item->id, - 'name' => ($actionlog->itemType()=='user') ? $actionlog->filename : e($actionlog->item->getDisplayNameAttribute()), + 'name' => ($actionlog->itemType()=='user') ? e($actionlog->item->getFullNameAttribute()) : e($actionlog->item->getDisplayNameAttribute()), 'type' => e($actionlog->itemType()), ] : null, 'location' => ($actionlog->location) ? [ @@ -104,6 +114,7 @@ class ActionlogsTransformer ]; //\Log::info("Clean Meta is: ".print_r($clean_meta,true)); + //dd($array); return $array; } diff --git a/config/livewire.php b/config/livewire.php new file mode 100644 index 000000000..347402f9d --- /dev/null +++ b/config/livewire.php @@ -0,0 +1,158 @@ + 'App\\Http\\Livewire', + + /* + |-------------------------------------------------------------------------- + | View Path + |-------------------------------------------------------------------------- + | + | This value sets the path for Livewire component views. This affects + | file manipulation helper commands like `artisan make:livewire`. + | + */ + + 'view_path' => resource_path('views/livewire'), + + /* + |-------------------------------------------------------------------------- + | Layout + |-------------------------------------------------------------------------- + | The default layout view that will be used when rendering a component via + | Route::get('/some-endpoint', SomeComponent::class);. In this case the + | the view returned by SomeComponent will be wrapped in "layouts.app" + | + */ + + 'layout' => 'layouts.app', + + /* + |-------------------------------------------------------------------------- + | Livewire Assets URL + |-------------------------------------------------------------------------- + | + | This value sets the path to Livewire JavaScript assets, for cases where + | your app's domain root is not the correct path. By default, Livewire + | will load its JavaScript assets from the app's "relative root". + | + | Examples: "/assets", "myurl.com/app". + | + */ + + 'asset_url' => env('APP_URL'), + + /* + |-------------------------------------------------------------------------- + | Livewire App URL + |-------------------------------------------------------------------------- + | + | This value should be used if livewire assets are served from CDN. + | Livewire will communicate with an app through this url. + | + | Examples: "https://my-app.com", "myurl.com/app". + | + */ + + 'app_url' => null, + + /* + |-------------------------------------------------------------------------- + | Livewire Endpoint Middleware Group + |-------------------------------------------------------------------------- + | + | This value sets the middleware group that will be applied to the main + | Livewire "message" endpoint (the endpoint that gets hit everytime + | a Livewire component updates). It is set to "web" by default. + | + */ + + 'middleware_group' => 'web', + + /* + |-------------------------------------------------------------------------- + | Livewire Temporary File Uploads Endpoint Configuration + |-------------------------------------------------------------------------- + | + | Livewire handles file uploads by storing uploads in a temporary directory + | before the file is validated and stored permanently. All file uploads + | are directed to a global endpoint for temporary storage. The config + | items below are used for customizing the way the endpoint works. + | + */ + + 'temporary_file_upload' => [ + 'disk' => env('PRIVATE_FILESYSTEM_DISK', 'local'), // Example: 'local', 's3' Default: 'default' + 'rules' => null, // Example: ['file', 'mimes:png,jpg'] Default: ['required', 'file', 'max:12288'] (12MB) + 'directory' => null, // Example: 'tmp' Default 'livewire-tmp' + 'middleware' => null, // Example: 'throttle:5,1' Default: 'throttle:60,1' + 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs. + 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', + 'mov', 'avi', 'wmv', 'mp3', 'm4a', + 'jpg', 'jpeg', 'mpga', 'webp', 'wma', + ], + 'max_upload_time' => 5, // Max duration (in minutes) before an upload gets invalidated. + ], + + /* + |-------------------------------------------------------------------------- + | Manifest File Path + |-------------------------------------------------------------------------- + | + | This value sets the path to the Livewire manifest file. + | The default should work for most cases (which is + | "/bootstrap/cache/livewire-components.php"), but for specific + | cases like when hosting on Laravel Vapor, it could be set to a different value. + | + | Example: for Laravel Vapor, it would be "/tmp/storage/bootstrap/cache/livewire-components.php". + | + */ + + 'manifest_path' => null, + + /* + |-------------------------------------------------------------------------- + | Back Button Cache + |-------------------------------------------------------------------------- + | + | This value determines whether the back button cache will be used on pages + | that contain Livewire. By disabling back button cache, it ensures that + | the back button shows the correct state of components, instead of + | potentially stale, cached data. + | + | Setting it to "false" (default) will disable back button cache. + | + */ + + 'back_button_cache' => false, + + /* + |-------------------------------------------------------------------------- + | Render On Redirect + |-------------------------------------------------------------------------- + | + | This value determines whether Livewire will render before it's redirected + | or not. Setting it to "false" (default) will mean the render method is + | skipped when redirecting. And "true" will mean the render method is + | run before redirecting. Browsers bfcache can store a potentially + | stale view if render is skipped on redirect. + | + */ + + 'render_on_redirect' => false, + +]; diff --git a/index.html b/index.html deleted file mode 100644 index dbd1babcb..000000000 --- a/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Snipe-IT Setup - - - - - - -
-
-
-

D'oh. If you're seeing this, your DocumentRoot is set incorrectly. It should be set to the public directory. -

-
-
- - - diff --git a/resources/views/reports/activity.blade.php b/resources/views/reports/activity.blade.php index 1b54e7851..90a3ded45 100644 --- a/resources/views/reports/activity.blade.php +++ b/resources/views/reports/activity.blade.php @@ -47,6 +47,7 @@ {{ trans('general.date') }} {{ trans('general.admin') }} {{ trans('general.action') }} + {{ trans('general.file_name') }} {{ trans('general.type') }} {{ trans('general.item') }} {{ trans('general.to') }} diff --git a/upgrade.php b/upgrade.php index c1071bb4b..892e92e46 100644 --- a/upgrade.php +++ b/upgrade.php @@ -393,13 +393,17 @@ if (file_exists('composer.phar')) { } else { + echo "-- We couldn't find a local composer.phar. No worries, trying globally.\n"; + echo "Since you are running composer globally, we won't try to update it for you.\n"; + echo "If you run into issues with this step, try running `composer self-update` \n"; + echo "before running this updater again\n\n"; + if ($app_environment == 'production') { $composer = shell_exec('composer install --no-dev --prefer-source'); } else { $composer = shell_exec('composer install --prefer-source'); } - echo "-- We couldn't find a local composer.phar. No worries, trying globally.\n"; $composer_dump = shell_exec('composer dump');