diff --git a/.github/workflows/crowdin-upload.yml b/.github/workflows/crowdin-upload.yml new file mode 100644 index 0000000000..c986accf37 --- /dev/null +++ b/.github/workflows/crowdin-upload.yml @@ -0,0 +1,21 @@ +name: Crowdin Action + +on: + push: + branches: [ develop ] + +jobs: + upload-sources-to-crowdin: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Crowdin push + uses: crowdin/github-action@v1 + with: + upload_sources: true + upload_translations: false + download_translations: false + project_id: ${{ secrets.CROWDIN_PROJECT_ID }} + token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index ac9287b53e..a0dafd4db6 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -101,6 +101,7 @@ class AssetsController extends Controller 'checkin_counter', 'requests_counter', 'byod', + 'asset_eol_date', ]; $filter = []; @@ -128,7 +129,6 @@ class AssetsController extends Controller // They are also used by the individual searches on detail pages like // locations, etc. - // Search custom fields by column name foreach ($all_custom_fields as $field) { if ($request->filled($field->db_column_name())) { @@ -136,7 +136,6 @@ class AssetsController extends Controller } } - if ($request->filled('status_id')) { $assets->where('assets.status_id', '=', $request->input('status_id')); } @@ -173,6 +172,10 @@ class AssetsController extends Controller $assets->where('assets.supplier_id', '=', $request->input('supplier_id')); } + if ($request->filled('asset_eol_date')) { + $assets->where('assets.asset_eol_date', '=', $request->input('asset_eol_date')); + } + if (($request->filled('assigned_to')) && ($request->filled('assigned_type'))) { $assets->where('assets.assigned_to', '=', $request->input('assigned_to')) ->where('assets.assigned_type', '=', $request->input('assigned_type')); diff --git a/app/Http/Controllers/Api/StatuslabelsController.php b/app/Http/Controllers/Api/StatuslabelsController.php index c4058f79ca..76055f2d9b 100644 --- a/app/Http/Controllers/Api/StatuslabelsController.php +++ b/app/Http/Controllers/Api/StatuslabelsController.php @@ -196,6 +196,7 @@ class StatuslabelsController extends Controller { $this->authorize('view', Statuslabel::class); $statuslabels = Statuslabel::withCount('assets')->get(); + $total = Array(); foreach ($statuslabels as $statuslabel) { diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index 1c7080bd46..9b51b7f267 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -142,6 +142,7 @@ class AssetsController extends Controller $asset->warranty_months = request('warranty_months', null); $asset->purchase_cost = Helper::ParseCurrency($request->get('purchase_cost')); $asset->purchase_date = request('purchase_date', null); + $asset->asset_eol_date = request('asset_eol_date', null); $asset->assigned_to = request('assigned_to', null); $asset->supplier_id = request('supplier_id', null); $asset->requestable = request('requestable', 0); @@ -312,6 +313,8 @@ class AssetsController extends Controller $asset->status_id = $request->input('status_id', null); $asset->warranty_months = $request->input('warranty_months', null); $asset->purchase_cost = Helper::ParseCurrency($request->input('purchase_cost', null)); + $asset->asset_eol_date = request('asset_eol_date', null); + $asset->purchase_date = $request->input('purchase_date', null); $asset->supplier_id = $request->input('supplier_id', null); $asset->expected_checkin = $request->input('expected_checkin', null); diff --git a/app/Http/Controllers/Licenses/LicenseCheckinController.php b/app/Http/Controllers/Licenses/LicenseCheckinController.php index d585e6714c..a34de73d77 100644 --- a/app/Http/Controllers/Licenses/LicenseCheckinController.php +++ b/app/Http/Controllers/Licenses/LicenseCheckinController.php @@ -59,6 +59,12 @@ class LicenseCheckinController extends Controller } $license = License::find($licenseSeat->license_id); + + // LicenseSeat is not assigned, it can't be checked in + if (is_null($licenseSeat->assignedTo) && is_null($licenseSeat->asset_id)) { + return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkin.error')); + } + $this->authorize('checkout', $license); if (! $license->reassignable) { diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php index 9524abf6ee..39b73a9797 100755 --- a/app/Http/Controllers/LocationsController.php +++ b/app/Http/Controllers/LocationsController.php @@ -227,6 +227,36 @@ class LocationsController extends Controller } + + /** + * Returns a view that presents a form to clone a location. + * + * @author [A. Gianotto] [] + * @param int $locationId + * @since [v6.0.14] + * @return View + */ + public function getClone($locationId = null) + { + $this->authorize('create', Location::class); + + // Check if the asset exists + if (is_null($location_to_clone = Location::find($locationId))) { + // Redirect to the asset management page + return redirect()->route('licenses.index')->with('error', trans('admin/locations/message.does_not_exist')); + } + + $location = clone $location_to_clone; + + // unset these values + $location->id = null; + $location->image = null; + + return view('locations/edit') + ->with('item', $location); + } + + public function print_all_assigned($id) { if ($location = Location::where('id', $id)->first()) { diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 41b2f257c0..c0c621ff68 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -284,7 +284,7 @@ class ReportsController extends Controller $row = [ $actionlog->created_at, - ($actionlog->user) ? e($actionlog->user->getFullNameAttribute()) : '', + ($actionlog->admin) ? e($actionlog->admin->getFullNameAttribute()) : '', $actionlog->present()->actionType(), e($actionlog->itemType()), ($actionlog->itemType() == 'user') ? $actionlog->filename : $item_name, diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index b04c692ac5..5498187561 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -111,17 +111,17 @@ class SettingsController extends Controller $start_settings['prod'] = true; } + $start_settings['owner'] = ''; + if (function_exists('posix_getpwuid')) { // Probably Linux $owner = posix_getpwuid(fileowner($_SERVER['SCRIPT_FILENAME'])); - $start_settings['owner'] = $owner['name']; - } else { // Windows - // TODO: Is there a way of knowing if a windows user has elevated permissions - // This just gets the user name, which likely isn't 'root' - // $start_settings['owner'] = getenv('USERNAME'); - $start_settings['owner'] = ''; + // This *should* be an array, but we've seen this return a bool in some chrooted environments + if (is_array($owner)) { + $start_settings['owner'] = $owner['name']; + } } - if (('root' === $start_settings['owner']) || ('0' === $start_settings['owner'])) { + if (($start_settings['owner'] === 'root') || ($start_settings['owner'] === '0')) { $start_settings['owner_is_admin'] = true; } else { $start_settings['owner_is_admin'] = false; diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index a36d0ab89b..4b1616026b 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -38,7 +38,8 @@ class AssetsTransformer 'byod' => ($asset->byod ? true : false), 'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null, - 'eol' => ($asset->purchase_date != '') ? Helper::getFormattedDateObject($asset->present()->eol_date(), 'date') : null, + 'eol' => ($asset->model->eol != '') ? $asset->model->eol : null, + 'asset_eol_date' => ($asset->asset_eol_date != '') ? Helper::getFormattedDateObject($asset->asset_eol_date, 'date') : null, 'status_label' => ($asset->assetstatus) ? [ 'id' => (int) $asset->assetstatus->id, 'name'=> e($asset->assetstatus->name), diff --git a/app/Http/Transformers/LocationsTransformer.php b/app/Http/Transformers/LocationsTransformer.php index a55c41b350..22eade5d6e 100644 --- a/app/Http/Transformers/LocationsTransformer.php +++ b/app/Http/Transformers/LocationsTransformer.php @@ -4,7 +4,7 @@ namespace App\Http\Transformers; use App\Helpers\Helper; use App\Models\Location; -use Gate; +use Illuminate\Support\Facades\Gate; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Storage; @@ -63,6 +63,7 @@ class LocationsTransformer $permissions_array['available_actions'] = [ 'update' => Gate::allows('update', Location::class) ? true : false, 'delete' => $location->isDeletable(), + 'clone' => (Gate::allows('create', Location::class) && ($location->deleted_at == '')), ]; $array += $permissions_array; diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 37e932cfa1..9be0cd62b8 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -114,6 +114,7 @@ class Asset extends Depreciable 'serial' => 'unique_serial|nullable', 'purchase_cost' => 'numeric|nullable|gte:0', 'supplier_id' => 'exists:suppliers,id|nullable', + 'asset_eol_date' => 'date|max:10|min:10|nullable', ]; /** @@ -143,9 +144,9 @@ class Asset extends Depreciable 'last_checkout', 'expected_checkin', 'byod', + 'asset_eol_date', 'last_audit_date', 'next_audit_date', - ]; use Searchable; @@ -168,6 +169,7 @@ class Asset extends Depreciable 'expected_checkin', 'next_audit_date', 'last_audit_date', + 'asset_eol_date', ]; /** @@ -181,7 +183,7 @@ class Asset extends Depreciable 'company' => ['name'], 'defaultLoc' => ['name'], 'location' => ['name'], - 'model' => ['name', 'model_number'], + 'model' => ['name', 'model_number', 'eol'], 'model.category' => ['name'], 'model.manufacturer' => ['name'], ]; diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php index 53ff279a09..d0bbd10733 100644 --- a/app/Models/Loggable.php +++ b/app/Models/Loggable.php @@ -93,8 +93,12 @@ trait Loggable { $settings = Setting::getSettings(); $log = new Actionlog; - $log->target_type = get_class($target); - $log->target_id = $target->id; + + if($target != null){ + $log->target_type = get_class($target); + $log->target_id = $target->id; + + } if (static::class == LicenseSeat::class) { $log->item_type = License::class; diff --git a/app/Models/User.php b/app/Models/User.php index 249178ce09..0e9d839a51 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -80,8 +80,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'created_at', 'updated_at', 'deleted_at', - 'start_date', - 'end_date', + 'start_date' => 'date_format:Y-m-d', + 'end_date' => 'date_format:Y-m-d', ]; diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index ccc4a4cf13..4be0f56010 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -163,9 +163,16 @@ class AssetPresenter extends Presenter ], [ 'field' => 'eol', 'searchable' => false, - 'sortable' => false, + 'sortable' => true, 'visible' => false, 'title' => trans('general.eol'), + ], + [ + 'field' => 'asset_eol_date', + 'searchable' => true, + 'sortable' => true, + 'visible' => false, + 'title' => trans('admin/hardware/form.eol_date'), 'formatter' => 'dateDisplayFormatter', ], [ 'field' => 'warranty_months', diff --git a/config/version.php b/config/version.php index 1eeb07c2c5..f3fef87667 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v6.0.14', - 'full_app_version' => 'v6.0.14 - build 9599-g1415c8c6e', - 'build_version' => '9599', + 'full_app_version' => 'v6.0.14 - build 9646-g417a1e624', + 'build_version' => '9646', 'prerelease_version' => '', - 'hash_version' => 'g1415c8c6e', - 'full_hash' => 'v6.0.14-555-g1415c8c6e', + 'hash_version' => 'g417a1e624', + 'full_hash' => 'v6.0.14-602-g417a1e624', 'branch' => 'develop', ); \ No newline at end of file diff --git a/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php new file mode 100644 index 0000000000..95c3bff35b --- /dev/null +++ b/database/migrations/2023_01_21_225350_add_eol_date_on_assets_table.php @@ -0,0 +1,54 @@ +date('asset_eol_date')->after('purchase_date')->nullable()->default(null); + } + }); + + // Chunk the model query to get the models that do have an EOL date + AssetModel::whereNotNull('eol')->with('assets')->chunk(200, function ($models) { + foreach ($models as $model) { + foreach ($model->assets as $asset) { + + if ($asset->purchase_date!='') { + $asset->asset_eol_date = $asset->present()->eol_date(); + $asset->save(); + } + + } + } + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('assets', function (Blueprint $table) { + if (Schema::hasColumn('assets', 'asset_eol_date')) { + $table->dropColumn('asset_eol_date'); + } + }); + } +} diff --git a/package-lock.json b/package-lock.json index 711ca8f2d7..a803788bfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1329,9 +1329,9 @@ "dev": true }, "@fortawesome/fontawesome-free": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.2.1.tgz", - "integrity": "sha512-viouXhegu/TjkvYQoiRZK3aax69dGXxgEjpvZW81wIJdxm5Fnvp3VVIP4VHKqX4SvFw6qpmkILkD4RJWAdrt7A==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.3.0.tgz", + "integrity": "sha512-qVtd5i1Cc7cdrqnTWqTObKQHjPWAiRwjUPaXObaeNPcy7+WKxJumGBx66rfSFgK6LNpIasVKkEgW8oyf0tmPLA==" }, "@jridgewell/gen-mapping": { "version": "0.1.1", diff --git a/package.json b/package.json index f64399454f..25a082bc8b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "vue-template-compiler": "2.4.4" }, "dependencies": { - "@fortawesome/fontawesome-free": "^6.2.1", + "@fortawesome/fontawesome-free": "^6.3.0", "acorn": "^8.8.2", "acorn-import-assertions": "^1.8.0", "admin-lte": "^2.4.18", diff --git a/public/css/build/app.css b/public/css/build/app.css index 13b44a11ea..b67a5f6a1c 100644 Binary files a/public/css/build/app.css and b/public/css/build/app.css differ diff --git a/public/css/build/overrides.css b/public/css/build/overrides.css index ec9e3fb85e..7d0450d520 100644 Binary files a/public/css/build/overrides.css and b/public/css/build/overrides.css differ diff --git a/public/css/dist/all.css b/public/css/dist/all.css index 59e1dd4d0e..f1f0b46d30 100644 Binary files a/public/css/dist/all.css and b/public/css/dist/all.css differ diff --git a/public/css/webfonts/fa-brands-400.ttf b/public/css/webfonts/fa-brands-400.ttf index 502f3621e7..641a489339 100644 Binary files a/public/css/webfonts/fa-brands-400.ttf and b/public/css/webfonts/fa-brands-400.ttf differ diff --git a/public/css/webfonts/fa-brands-400.woff2 b/public/css/webfonts/fa-brands-400.woff2 index d801b51f66..5929101297 100644 Binary files a/public/css/webfonts/fa-brands-400.woff2 and b/public/css/webfonts/fa-brands-400.woff2 differ diff --git a/public/css/webfonts/fa-regular-400.ttf b/public/css/webfonts/fa-regular-400.ttf index e0abe2710f..7d634a2ba0 100644 Binary files a/public/css/webfonts/fa-regular-400.ttf and b/public/css/webfonts/fa-regular-400.ttf differ diff --git a/public/css/webfonts/fa-regular-400.woff2 b/public/css/webfonts/fa-regular-400.woff2 index d736e4b24c..953d5540b0 100644 Binary files a/public/css/webfonts/fa-regular-400.woff2 and b/public/css/webfonts/fa-regular-400.woff2 differ diff --git a/public/css/webfonts/fa-solid-900.ttf b/public/css/webfonts/fa-solid-900.ttf index 13c9489771..b3a2b64103 100644 Binary files a/public/css/webfonts/fa-solid-900.ttf and b/public/css/webfonts/fa-solid-900.ttf differ diff --git a/public/css/webfonts/fa-solid-900.woff2 b/public/css/webfonts/fa-solid-900.woff2 index 3516fdbe33..83433f4455 100644 Binary files a/public/css/webfonts/fa-solid-900.woff2 and b/public/css/webfonts/fa-solid-900.woff2 differ diff --git a/public/css/webfonts/fa-v4compatibility.ttf b/public/css/webfonts/fa-v4compatibility.ttf index dc2981941d..e4eea68d0f 100644 Binary files a/public/css/webfonts/fa-v4compatibility.ttf and b/public/css/webfonts/fa-v4compatibility.ttf differ diff --git a/public/css/webfonts/fa-v4compatibility.woff2 b/public/css/webfonts/fa-v4compatibility.woff2 index 28d46b15ac..e804f18603 100644 Binary files a/public/css/webfonts/fa-v4compatibility.woff2 and b/public/css/webfonts/fa-v4compatibility.woff2 differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index b200128c7d..eeddb0376c 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,8 +1,8 @@ { "/js/build/app.js": "/js/build/app.js?id=f05cc05b9000ba73e1949bcf137d4301", "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374", - "/css/build/overrides.css": "/css/build/overrides.css?id=0465141b9ecb0662ba6790c1460f391f", - "/css/build/app.css": "/css/build/app.css?id=c3a896cab26e2093f8be24336b7db1b9", + "/css/build/overrides.css": "/css/build/overrides.css?id=d9175e3d9b9074397343dddebfe23888", + "/css/build/app.css": "/css/build/app.css?id=dcb8aa9f4501a370214a67442e88daf0", "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=dc383f8560a8d4adb51d44fb4043e03b", "/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=6f0563e726c2fe4fab4026daaa5bfdf2", "/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=f343f659ca1d45534d2c2c3cc30fb619", @@ -18,19 +18,19 @@ "/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", "/css/dist/skins/skin-contrast.css": "/css/dist/skins/skin-contrast.css?id=da6c7997d9de2f8329142399f0ce50da", "/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=44bf834f2110504a793dadec132a5898", - "/css/dist/all.css": "/css/dist/all.css?id=ef030b613d45620b907cf0184a14e868", + "/css/dist/all.css": "/css/dist/all.css?id=0314c741a636de602ec952468eb171f3", "/css/blue.png": "/css/blue.png?id=e83a6c29e04fe851f2122815b2e4b150", "/css/blue@2x.png": "/css/blue@2x.png?id=51135dd4d24f88f5de0b2414bd51dac5", "/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", - "/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=0b834d6c0ecc5bf275a83414eb38efd4", - "/css/webfonts/fa-brands-400.woff2": "/css/webfonts/fa-brands-400.woff2?id=a46924ee2a2a7702ef7fe7ead62fca18", - "/css/webfonts/fa-regular-400.ttf": "/css/webfonts/fa-regular-400.ttf?id=93d1ca4fec25c46c9ac67b07058b3f72", - "/css/webfonts/fa-regular-400.woff2": "/css/webfonts/fa-regular-400.woff2?id=d8373194363409c201ee33fcd48ba574", - "/css/webfonts/fa-solid-900.ttf": "/css/webfonts/fa-solid-900.ttf?id=a7d60e1f645d1b80e0879b2c8e72ed06", - "/css/webfonts/fa-solid-900.woff2": "/css/webfonts/fa-solid-900.woff2?id=3e1cccc95e0dadb2168d67c2f0f23bf3", - "/css/webfonts/fa-v4compatibility.ttf": "/css/webfonts/fa-v4compatibility.ttf?id=ee335846f3552dc6af2ef7c8cafae1dc", - "/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=1ad361f755ce9c96dadb8da2d7318975", + "/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=2df05d4beaa48550d71234e8dca79141", + "/css/webfonts/fa-brands-400.woff2": "/css/webfonts/fa-brands-400.woff2?id=682885a4f72597322017a9fcd0683831", + "/css/webfonts/fa-regular-400.ttf": "/css/webfonts/fa-regular-400.ttf?id=e7a7f9dd9376f68614860d920255d4df", + "/css/webfonts/fa-regular-400.woff2": "/css/webfonts/fa-regular-400.woff2?id=204fc700c679395e6aa9bebc3cada64e", + "/css/webfonts/fa-solid-900.ttf": "/css/webfonts/fa-solid-900.ttf?id=c9d3294ec75b843a31ef711069a0f0b6", + "/css/webfonts/fa-solid-900.woff2": "/css/webfonts/fa-solid-900.woff2?id=6707d0247b0bca1b4964bab435e3c0d6", + "/css/webfonts/fa-v4compatibility.ttf": "/css/webfonts/fa-v4compatibility.ttf?id=a947172f4fde88e43b4c1a60b01db061", + "/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=bbc23038a6067c78310d3f19432a3ebf", "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=ee4896df8b8f008ce73a9a0c2549aefd", "/js/build/vendor.js": "/js/build/vendor.js?id=47ecbb4bb3b0e02315f391caadbdf971", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=14d9a2affec7b066d20fcba2e6e67ad2", diff --git a/resources/assets/less/overrides.less b/resources/assets/less/overrides.less index ae427f3392..eb90f1b850 100644 --- a/resources/assets/less/overrides.less +++ b/resources/assets/less/overrides.less @@ -671,18 +671,18 @@ th.css-accessory > .th-inner::before } @media screen and (max-width: 511px){ .sidebar-menu{ - margin-top:64px; + margin-top:160px; } } @media screen and (max-width: 771px) and (min-width: 512px){ .sidebar-menu { - margin-top:14px + margin-top:160px } } @media screen and (max-width: 1098px) and (min-width: 772px){ .sidebar-menu { - margin-top:51px + margin-top:98px } } diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index cc7ee7fa1c..b73f999229 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -403,6 +403,8 @@ return [ 'toggle_navigation' => 'Toggle navigation', 'alerts' => 'Alerts', 'tasks_view_all' => 'View all tasks', + 'true' => 'True', + 'false' => 'False', diff --git a/resources/views/hardware/edit.blade.php b/resources/views/hardware/edit.blade.php index c5cd302a2c..56876ba47a 100755 --- a/resources/views/hardware/edit.blade.php +++ b/resources/views/hardware/edit.blade.php @@ -152,6 +152,7 @@
@include ('partials.forms.edit.order_number') @include ('partials.forms.edit.purchase_date') + @include ('partials.forms.edit.eol_date') @include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id']) @php diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 5b480a2446..de19100017 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -673,7 +673,8 @@ - + @endif + @if ($asset->asset_eol_date)
@@ -681,10 +682,10 @@
- @if ($asset->purchase_date) - {{ Helper::getFormattedDateObject($asset->present()->eol_date(), 'date', false) }} + @if ($asset->asset_eol_date) + {{ Helper::getFormattedDateObject($asset->asset_eol_date, 'date', false) }} - - {{ Carbon::parse($asset->present()->eol_date())->diffForHumans(['parts' => 2]) }} + {{ Carbon::parse($asset->asset_eol_date)->diffForHumans(['parts' => 2]) }} @else {{ trans('general.na_no_purchase_date') }} @endif diff --git a/resources/views/locations/edit.blade.php b/resources/views/locations/edit.blade.php index 0c93c83a81..10d0f59bb0 100755 --- a/resources/views/locations/edit.blade.php +++ b/resources/views/locations/edit.blade.php @@ -65,50 +65,3 @@ @include ('partials.forms.edit.image-upload') @stop -@if (!$item->id) -@section('moar_scripts') - -@stop -@endif diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index d3a0fddc14..e885f2115c 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -570,9 +570,9 @@ function trueFalseFormatter(value) { if ((value) && ((value == 'true') || (value == '1'))) { - return ''; + return '{{ trans('general.true') }}'; } else { - return ''; + return '{{ trans('general.false') }}'; } } diff --git a/resources/views/partials/forms/edit/datepicker.blade.php b/resources/views/partials/forms/edit/datepicker.blade.php index ab5a501072..3e5f1d478d 100644 --- a/resources/views/partials/forms/edit/datepicker.blade.php +++ b/resources/views/partials/forms/edit/datepicker.blade.php @@ -3,7 +3,7 @@ {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
- +
{!! $errors->first($fieldname, '') !!} diff --git a/resources/views/partials/forms/edit/eol_date.blade.php b/resources/views/partials/forms/edit/eol_date.blade.php new file mode 100644 index 0000000000..4e57610165 --- /dev/null +++ b/resources/views/partials/forms/edit/eol_date.blade.php @@ -0,0 +1,11 @@ + +
+ +
+
+ + +
+ {!! $errors->first('asset_eol_date', '') !!} +
+
diff --git a/resources/views/reports/accessories.blade.php b/resources/views/reports/accessories.blade.php index 44f90682ba..997e5fedff 100644 --- a/resources/views/reports/accessories.blade.php +++ b/resources/views/reports/accessories.blade.php @@ -35,7 +35,7 @@ - {{ trans('admin/companies/table.title') }} + {{ trans('admin/companies/table.title') }} {{ trans('admin/accessories/table.title') }} {{ trans('general.model_no') }} {{ trans('admin/accessories/general.total') }} diff --git a/routes/web.php b/routes/web.php index 4c52918f8e..cc358c910f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -40,22 +40,36 @@ Route::group(['middleware' => 'auth'], function () { 'parameters' => ['category' => 'category_id'], ]); + + /* - * Locations - */ + * Locations + */ + + Route::group(['prefix' => 'locations', 'middleware' => ['auth']], function () { + + Route::get('{locationId}/clone', + [LocationsController::class, 'getClone'] + )->name('clone/license'); + + Route::get( + '{locationId}/printassigned', + [LocationsController::class, 'print_assigned'] + )->name('locations.print_assigned'); + + Route::get( + '{locationId}/printallassigned', + [LocationsController::class, 'print_all_assigned'] + )->name('locations.print_all_assigned'); + }); + Route::resource('locations', LocationsController::class, [ 'parameters' => ['location' => 'location_id'], ]); - Route::get( - 'locations/{locationId}/printassigned', - [LocationsController::class, 'print_assigned'] - )->name('locations.print_assigned'); - Route::get( - 'locations/{locationId}/printallassigned', - [LocationsController::class, 'print_all_assigned'] - )->name('locations.print_all_assigned'); + + /* * Manufacturers