Merge branch 'delete_asset_from_view_page' of https://github.com/akemidx/snipe-it into delete_asset_from_view_page

This commit is contained in:
akemidx 2023-05-10 19:30:11 -04:00
commit ba4fc146e2
112 changed files with 1887 additions and 533 deletions

59
.chipperci.yml Normal file
View file

@ -0,0 +1,59 @@
version: 1
environment:
php: 8.0
node: 12
services:
- mysql: 5.7
- dusk:
on:
push:
branches:
- master
- develop
pipeline:
- name: Setup
cmd: |
cp -v .env.example .env
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Generate Key
cmd: |
php artisan key:generate --force
- name: Passport Keys
cmd: |
php artisan passport:keys
- name: Run Migrations
cmd: |
# php artisan migrate --force
- name: PHPUnit Unit Tests
cmd: |
# php artisan test --testsuite Unit
- name: PHPUnit Feature Tests
cmd: |
# php artisan test --testsuite Feature
- name: Browser Tests
cmd: |
cp -v .env.dusk.example .env.dusk.ci
sed -i "s@APP_ENV=.*@APP_ENV=ci@g" .env.dusk.ci
sed -i "s@APP_URL=.*@APP_URL=http://$BUILD_HOST:8000@g" .env.dusk.ci
#sed -i "s@DB_HOST=.*@DB_HOST=mysql@g" .env.dusk.ci
sed -i "s@DB_HOST=.*@DB_HOST=$DB_HOST@g" .env.dusk.ci
sed -i "s@DB_USERNAME=.*@DB_USERNAME=chipperci@g" .env.dusk.ci
sed -i "s@DB_DATABASE=.*@DB_DATABASE=chipperci@g" .env.dusk.ci
sed -i "s@DB_PASSWORD=.*@DB_PASSWORD=secret@g" .env.dusk.ci
php -S [::0]:8000 -t public 2>server.log &
sleep 2
php artisan dusk:chrome-driver $CHROME_DRIVER
php artisan dusk --env=ci

View file

@ -175,6 +175,15 @@ REQUIRE_SAML=false
API_THROTTLE_PER_MINUTE=120 API_THROTTLE_PER_MINUTE=120
CSV_ESCAPE_FORMULAS=true CSV_ESCAPE_FORMULAS=true
# --------------------------------------------
# OPTIONAL: HASHING
# --------------------------------------------
HASHING_DRIVER='bcrypt'
BCRYPT_ROUNDS=10
ARGON_MEMORY=1024
ARGON_THREADS=2
ARGON_TIME=2
# -------------------------------------------- # --------------------------------------------
# OPTIONAL: SCIM # OPTIONAL: SCIM
# -------------------------------------------- # --------------------------------------------

View file

@ -11,7 +11,7 @@ class SystemBackup extends Command
* *
* @var string * @var string
*/ */
protected $name = 'snipeit:backup'; protected $signature = 'snipeit:backup {--filename=}';
/** /**
* The console command description. * The console command description.
@ -37,7 +37,18 @@ class SystemBackup extends Command
*/ */
public function handle() public function handle()
{ {
// if ($this->option('filename')) {
$this->call('backup:run'); $filename = $this->option('filename');
// Make sure the filename ends in .zip
if (!ends_with($filename, '.zip')) {
$filename = $filename.'.zip';
}
$this->call('backup:run', ['--filename' => $filename]);
} else {
$this->call('backup:run');
}
} }
} }

View file

@ -121,7 +121,6 @@ class AcceptanceController extends Controller
$pdf_filename = 'accepted-eula-'.date('Y-m-d-h-i-s').'.pdf'; $pdf_filename = 'accepted-eula-'.date('Y-m-d-h-i-s').'.pdf';
$sig_filename=''; $sig_filename='';
if ($request->input('asset_acceptance') == 'accepted') { if ($request->input('asset_acceptance') == 'accepted') {
/** /**
@ -153,12 +152,14 @@ class AcceptanceController extends Controller
} }
} }
// this is horrible // this is horrible
switch($acceptance->checkoutable_type){ switch($acceptance->checkoutable_type){
case 'App\Models\Asset': case 'App\Models\Asset':
$pdf_view_route ='account.accept.accept-asset-eula'; $pdf_view_route ='account.accept.accept-asset-eula';
$asset_model = AssetModel::find($item->model_id); $asset_model = AssetModel::find($item->model_id);
if (!$asset_model) {
return redirect()->back()->with('error', trans('admin/models/message.does_not_exist'));
}
$display_model = $asset_model->name; $display_model = $asset_model->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
@ -167,7 +168,7 @@ class AcceptanceController extends Controller
$pdf_view_route ='account.accept.accept-accessory-eula'; $pdf_view_route ='account.accept.accept-accessory-eula';
$accessory = Accessory::find($item->id); $accessory = Accessory::find($item->id);
$display_model = $accessory->name; $display_model = $accessory->name;
$assigned_to = User::find($item->assignedTo); $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
case 'App\Models\LicenseSeat': case 'App\Models\LicenseSeat':
@ -250,11 +251,15 @@ class AcceptanceController extends Controller
// This is the most horriblest // This is the most horriblest
switch($acceptance->checkoutable_type){ switch($acceptance->checkoutable_type){
case 'App\Models\Asset': case 'App\Models\Asset':
$asset_model = AssetModel::find($item->model_id);
$display_model = $asset_model->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
case 'App\Models\Accessory': case 'App\Models\Accessory':
$assigned_to = User::find($item->assignedTo); $accessory = Accessory::find($item->id);
$display_model = $accessory->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
case 'App\Models\LicenseSeat': case 'App\Models\LicenseSeat':
@ -266,6 +271,8 @@ class AcceptanceController extends Controller
break; break;
case 'App\Models\Consumable': case 'App\Models\Consumable':
$consumable = Consumable::find($item->id);
$display_model = $consumable->name;
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
break; break;
} }
@ -289,4 +296,4 @@ class AcceptanceController extends Controller
return redirect()->to('account/accept')->with('success', $return_msg); return redirect()->to('account/accept')->with('success', $return_msg);
} }
} }

View file

@ -36,7 +36,7 @@ class AssetMaintenancesController extends Controller
{ {
$this->authorize('view', Asset::class); $this->authorize('view', Asset::class);
$maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'supplier', 'asset.company', 'admin'); $maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'asset.defaultLoc', 'supplier', 'asset.company', 'admin');
if ($request->filled('search')) { if ($request->filled('search')) {
$maintenances = $maintenances->TextSearch($request->input('search')); $maintenances = $maintenances->TextSearch($request->input('search'));

View file

@ -573,6 +573,7 @@ class AssetsController extends Controller
// Update custom fields in the database. // Update custom fields in the database.
// Validation for these fields is handled through the AssetRequest form request // Validation for these fields is handled through the AssetRequest form request
$model = AssetModel::find($request->get('model_id')); $model = AssetModel::find($request->get('model_id'));
if (($model) && ($model->fieldset)) { if (($model) && ($model->fieldset)) {
foreach ($model->fieldset->fields as $field) { foreach ($model->fieldset->fields as $field) {

View file

@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use App\Http\Transformers\CustomFieldsetsTransformer; use App\Http\Transformers\CustomFieldsetsTransformer;
use App\Http\Transformers\CustomFieldsTransformer; use App\Http\Transformers\CustomFieldsTransformer;
use App\Models\CustomFieldset; use App\Models\CustomFieldset;
use App\Models\CustomField;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Redirect; use Redirect;
use View; use View;
@ -94,6 +95,18 @@ class CustomFieldsetsController extends Controller
$fieldset->fill($request->all()); $fieldset->fill($request->all());
if ($fieldset->save()) { if ($fieldset->save()) {
// Sync fieldset with auto_add_to_fieldsets
$fields = CustomField::select('id')->where('auto_add_to_fieldsets', '=', '1')->get();
if ($fields->count() > 0) {
foreach ($fields as $field) {
$field_ids[] = $field->id;
}
$fieldset->fields()->sync($field_ids);
}
return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.create.success'))); return response()->json(Helper::formatStandardApiResponse('success', $fieldset, trans('admin/custom_fields/message.fieldset.create.success')));
} }

View file

@ -160,7 +160,7 @@ class ImportController extends Controller
// Run a backup immediately before processing // Run a backup immediately before processing
if ($request->get('run-backup')) { if ($request->get('run-backup')) {
\Log::debug('Backup manually requested via importer'); \Log::debug('Backup manually requested via importer');
Artisan::call('backup:run'); Artisan::call('snipeit:backup', ['--filename' => 'pre-import-backup-'.date('Y-m-d-H:i:s')]);
} else { } else {
\Log::debug('NO BACKUP requested via importer'); \Log::debug('NO BACKUP requested via importer');
} }
@ -193,6 +193,9 @@ class ImportController extends Controller
case 'user': case 'user':
$redirectTo = 'users.index'; $redirectTo = 'users.index';
break; break;
case 'location':
$redirectTo = 'locations.index';
break;
} }
if ($errors) { //Failure if ($errors) { //Failure

View file

@ -23,10 +23,10 @@ class ManufacturersController extends Controller
public function index(Request $request) public function index(Request $request)
{ {
$this->authorize('view', Manufacturer::class); $this->authorize('view', Manufacturer::class);
$allowed_columns = ['id', 'name', 'url', 'support_url', 'support_email', 'support_phone', 'created_at', 'updated_at', 'image', 'assets_count', 'consumables_count', 'components_count', 'licenses_count']; $allowed_columns = ['id', 'name', 'url', 'support_url', 'support_email', 'warranty_lookup_url', 'support_phone', 'created_at', 'updated_at', 'image', 'assets_count', 'consumables_count', 'components_count', 'licenses_count'];
$manufacturers = Manufacturer::select( $manufacturers = Manufacturer::select(
['id', 'name', 'url', 'support_url', 'support_email', 'support_phone', 'created_at', 'updated_at', 'image', 'deleted_at'] ['id', 'name', 'url', 'support_url', 'warranty_lookup_url', 'support_email', 'support_phone', 'created_at', 'updated_at', 'image', 'deleted_at']
)->withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('consumables as consumables_count')->withCount('accessories as accessories_count'); )->withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('consumables as consumables_count')->withCount('accessories as accessories_count');
if ($request->input('deleted') == 'true') { if ($request->input('deleted') == 'true') {
@ -49,6 +49,10 @@ class ManufacturersController extends Controller
$manufacturers->where('support_url', '=', $request->input('support_url')); $manufacturers->where('support_url', '=', $request->input('support_url'));
} }
if ($request->filled('warranty_lookup_url')) {
$manufacturers->where('warranty_lookup_url', '=', $request->input('warranty_lookup_url'));
}
if ($request->filled('support_phone')) { if ($request->filled('support_phone')) {
$manufacturers->where('support_phone', '=', $request->input('support_phone')); $manufacturers->where('support_phone', '=', $request->input('support_phone'));
} }

View file

@ -7,6 +7,7 @@ use App\Http\Requests\CustomFieldRequest;
use App\Models\CustomField; use App\Models\CustomField;
use App\Models\CustomFieldset; use App\Models\CustomFieldset;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Redirect; use Redirect;
/** /**
@ -45,7 +46,7 @@ class CustomFieldsController extends Controller
* @see CustomFieldsController::storeField() * @see CustomFieldsController::storeField()
* @author [A. Gianotto] [<snipe@snipe.net>] * @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v5.1.5] * @since [v5.1.5]
* @return Redirect * @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function show() public function show()
@ -63,14 +64,17 @@ class CustomFieldsController extends Controller
* @return \Illuminate\Support\Facades\View * @return \Illuminate\Support\Facades\View
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function create() public function create(Request $request)
{ {
$this->authorize('create', CustomField::class); $this->authorize('create', CustomField::class);
$fieldsets = CustomFieldset::get();
return view('custom_fields.fields.edit', [ return view('custom_fields.fields.edit', [
'predefinedFormats' => Helper::predefined_formats(), 'predefinedFormats' => Helper::predefined_formats(),
'customFormat' => '', 'customFormat' => '',
])->with('field', new CustomField()); 'fieldsets' => $fieldsets,
'field' => new CustomField(),
]);
} }
/** /**
@ -79,7 +83,7 @@ class CustomFieldsController extends Controller
* @see CustomFieldsController::createField() * @see CustomFieldsController::createField()
* @author [Brady Wetherington] [<uberbrady@gmail.com>] * @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8] * @since [v1.8]
* @return Redirect * @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function store(CustomFieldRequest $request) public function store(CustomFieldRequest $request)
@ -104,6 +108,7 @@ class CustomFieldsController extends Controller
"show_in_email" => $show_in_email, "show_in_email" => $show_in_email,
"is_unique" => $request->get("is_unique", 0), "is_unique" => $request->get("is_unique", 0),
"display_in_user_view" => $display_in_user_view, "display_in_user_view" => $display_in_user_view,
"auto_add_to_fieldsets" => $request->get("auto_add_to_fieldsets", 0),
"user_id" => Auth::id() "user_id" => Auth::id()
]); ]);
@ -115,10 +120,20 @@ class CustomFieldsController extends Controller
} }
if ($field->save()) { if ($field->save()) {
// Sync fields with fieldsets
$fieldset_array = $request->input('associate_fieldsets');
if ($request->has('associate_fieldsets') && (is_array($fieldset_array))) {
$field->fieldset()->sync(array_keys($fieldset_array));
} else {
$field->fieldset()->sync([]);
}
return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/message.field.create.success')); return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/message.field.create.success'));
} }
return redirect()->back()->withInput() return redirect()->back()->with('selected_fieldsets', $request->input('associate_fieldsets'))->withInput()
->with('error', trans('admin/custom_fields/message.field.create.error')); ->with('error', trans('admin/custom_fields/message.field.create.error'));
} }
@ -128,7 +143,7 @@ class CustomFieldsController extends Controller
* *
* @author [A. Gianotto] [<snipe@snipe.net>] * @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0] * @since [v3.0]
* @return Redirect * @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function deleteFieldFromFieldset($field_id, $fieldset_id) public function deleteFieldFromFieldset($field_id, $fieldset_id)
@ -147,8 +162,7 @@ class CustomFieldsController extends Controller
->with('success', trans('admin/custom_fields/message.field.delete.success')); ->with('success', trans('admin/custom_fields/message.field.delete.success'));
} else { } else {
return redirect()->back()->withErrors(['message' => "Field is in use and cannot be deleted."]); return redirect()->back()->withErrors(['message' => "Field is in use and cannot be deleted."]);
} }
} }
return redirect()->back()->withErrors(['message' => "Error deleting field from fieldset"]); return redirect()->back()->withErrors(['message' => "Error deleting field from fieldset"]);
@ -161,7 +175,7 @@ class CustomFieldsController extends Controller
* *
* @author [Brady Wetherington] [<uberbrady@gmail.com>] * @author [Brady Wetherington] [<uberbrady@gmail.com>]
* @since [v1.8] * @since [v1.8]
* @return Redirect * @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function destroy($field_id) public function destroy($field_id)
@ -190,12 +204,12 @@ class CustomFieldsController extends Controller
* @return \Illuminate\Support\Facades\View * @return \Illuminate\Support\Facades\View
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function edit($id) public function edit(Request $request, $id)
{ {
if ($field = CustomField::find($id)) { if ($field = CustomField::find($id)) {
$this->authorize('update', $field); $this->authorize('update', $field);
$fieldsets = CustomFieldset::get();
$customFormat = ''; $customFormat = '';
if ((stripos($field->format, 'regex') === 0) && ($field->format !== CustomField::PREDEFINED_FORMATS['MAC'])) { if ((stripos($field->format, 'regex') === 0) && ($field->format !== CustomField::PREDEFINED_FORMATS['MAC'])) {
$customFormat = $field->format; $customFormat = $field->format;
@ -204,6 +218,7 @@ class CustomFieldsController extends Controller
return view('custom_fields.fields.edit', [ return view('custom_fields.fields.edit', [
'field' => $field, 'field' => $field,
'customFormat' => $customFormat, 'customFormat' => $customFormat,
'fieldsets' => $fieldsets,
'predefinedFormats' => Helper::predefined_formats(), 'predefinedFormats' => Helper::predefined_formats(),
]); ]);
} }
@ -222,7 +237,7 @@ class CustomFieldsController extends Controller
* @author [A. Gianotto] [<snipe@snipe.net>] * @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $id * @param int $id
* @since [v4.0] * @since [v4.0]
* @return Redirect * @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException * @throws \Illuminate\Auth\Access\AuthorizationException
*/ */
public function update(CustomFieldRequest $request, $id) public function update(CustomFieldRequest $request, $id)
@ -249,6 +264,7 @@ class CustomFieldsController extends Controller
$field->show_in_email = $show_in_email; $field->show_in_email = $show_in_email;
$field->is_unique = $request->get("is_unique", 0); $field->is_unique = $request->get("is_unique", 0);
$field->display_in_user_view = $display_in_user_view; $field->display_in_user_view = $display_in_user_view;
$field->auto_add_to_fieldsets = $request->get("auto_add_to_fieldsets", 0);
if ($request->get('format') == 'CUSTOM REGEX') { if ($request->get('format') == 'CUSTOM REGEX') {
$field->format = e($request->get('custom_format')); $field->format = e($request->get('custom_format'));
@ -256,11 +272,21 @@ class CustomFieldsController extends Controller
$field->format = e($request->get('format')); $field->format = e($request->get('format'));
} }
if($field->element == 'checkbox' || $field->element == 'radio'){ if ($field->element == 'checkbox' || $field->element == 'radio'){
$field->format = 'ANY'; $field->format = 'ANY';
} }
if ($field->save()) { if ($field->save()) {
// Sync fields with fieldsets
$fieldset_array = $request->input('associate_fieldsets');
if ($request->has('associate_fieldsets') && (is_array($fieldset_array))) {
$field->fieldset()->sync(array_keys($fieldset_array));
} else {
$field->fieldset()->sync([]);
}
return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/message.field.update.success')); return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/message.field.update.success'));
} }

View file

@ -93,16 +93,27 @@ class CustomFieldsetsController extends Controller
{ {
$this->authorize('create', CustomField::class); $this->authorize('create', CustomField::class);
$cfset = new CustomFieldset([ $fieldset = new CustomFieldset([
'name' => e($request->get('name')), 'name' => e($request->get('name')),
'user_id' => Auth::user()->id, 'user_id' => Auth::user()->id,
]); ]);
$validator = Validator::make($request->all(), $cfset->rules); $validator = Validator::make($request->all(), $fieldset->rules);
if ($validator->passes()) {
$cfset->save();
return redirect()->route('fieldsets.show', [$cfset->id]) if ($validator->passes()) {
$fieldset->save();
// Sync fieldset with auto_add_to_fieldsets
$fields = CustomField::select('id')->where('auto_add_to_fieldsets', '=', '1')->get();
if ($fields->count() > 0) {
foreach ($fields as $field) {
$field_ids[] = $field->id;
}
$fieldset->fields()->sync($field_ids);
}
return redirect()->route('fieldsets.show', [$fieldset->id])
->with('success', trans('admin/custom_fields/message.fieldset.create.success')); ->with('success', trans('admin/custom_fields/message.fieldset.create.success'));
} }

View file

@ -0,0 +1,73 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Laravel\Socialite\Facades\Socialite;
use Laravel\Socialite\Two\InvalidStateException;
use App\Models\Setting;
class GoogleAuthController extends Controller
{
/**
* We need this constructor so that we override the socialite expected config variables,
* since we want to allow this to be changed via database fields
*/
public function __construct()
{
parent::__construct();
$setting = Setting::getSettings();
config(['services.google.redirect' => config('app.url').'/google/callback']);
config(['services.google.client_id' => $setting->google_client_id]);
config(['services.google.client_secret' => $setting->google_client_secret]);
}
public function redirectToGoogle()
{
return Socialite::driver('google')->redirect();
}
public function handleGoogleCallback()
{
try {
$socialUser = Socialite::driver('google')->user();
\Log::debug('Google user found');
} catch (InvalidStateException $exception) {
\Log::debug('Google user NOT found');
return redirect()->route('login')
->withErrors(
[
'username' => [
trans('auth/general.google_login_failed')
],
]
);
}
$user = User::where('username', $socialUser->getEmail())->first();
if ($user) {
$user->update([
'avatar' => $socialUser->avatar,
]);
Auth::login($user, true);
return redirect()->route('home');
}
return redirect()->route('login')
->withErrors(
[
'username' => [
trans('admin/users/message.user_not_found'),
],
]
);
}
}

View file

@ -68,6 +68,7 @@ class ManufacturersController extends Controller
$manufacturer->user_id = Auth::id(); $manufacturer->user_id = Auth::id();
$manufacturer->url = $request->input('url'); $manufacturer->url = $request->input('url');
$manufacturer->support_url = $request->input('support_url'); $manufacturer->support_url = $request->input('support_url');
$manufacturer->warranty_lookup_url = $request->input('warranty_lookup_url');
$manufacturer->support_phone = $request->input('support_phone'); $manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email'); $manufacturer->support_email = $request->input('support_email');
$manufacturer = $request->handleImages($manufacturer); $manufacturer = $request->handleImages($manufacturer);
@ -123,10 +124,11 @@ class ManufacturersController extends Controller
return redirect()->route('manufacturers.index')->with('error', trans('admin/manufacturers/message.does_not_exist')); return redirect()->route('manufacturers.index')->with('error', trans('admin/manufacturers/message.does_not_exist'));
} }
// Save the data // Save the data
$manufacturer->name = $request->input('name'); $manufacturer->name = $request->input('name');
$manufacturer->url = $request->input('url'); $manufacturer->url = $request->input('url');
$manufacturer->support_url = $request->input('support_url'); $manufacturer->support_url = $request->input('support_url');
$manufacturer->warranty_lookup_url = $request->input('warranty_lookup_url');
$manufacturer->support_phone = $request->input('support_phone'); $manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email'); $manufacturer->support_email = $request->input('support_email');

View file

@ -641,6 +641,9 @@ class ReportsController extends Controller
if (($request->filled('created_start')) && ($request->filled('created_end'))) { if (($request->filled('created_start')) && ($request->filled('created_end'))) {
$assets->whereBetween('assets.created_at', [$request->input('created_start'), $request->input('created_end')]); $assets->whereBetween('assets.created_at', [$request->input('created_start'), $request->input('created_end')]);
} }
if (($request->filled('checkout_date_start')) && ($request->filled('checkout_date_end'))) {
$assets->whereBetween('assets.last_checkout', [$request->input('checkout_date_start'), $request->input('checkout_date_end')]);
}
if (($request->filled('expected_checkin_start')) && ($request->filled('expected_checkin_end'))) { if (($request->filled('expected_checkin_start')) && ($request->filled('expected_checkin_end'))) {
$assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]); $assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]);
@ -898,12 +901,8 @@ class ReportsController extends Controller
public function getAssetMaintenancesReport() public function getAssetMaintenancesReport()
{ {
$this->authorize('reports.view'); $this->authorize('reports.view');
// Grab all the improvements
$assetMaintenances = AssetMaintenance::with('asset', 'supplier', 'asset.company')
->orderBy('created_at', 'DESC')
->get();
return view('reports/asset_maintenances', compact('assetMaintenances')); return view('reports.asset_maintenances');
} }
/** /**

View file

@ -1039,6 +1039,48 @@ class SettingsController extends Controller
return $pdf_branding; return $pdf_branding;
} }
/**
* Show Google login settings form
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.1.1]
* @return View
*/
public function getGoogleLoginSettings()
{
$setting = Setting::getSettings();
return view('settings.google', compact('setting'));
}
/**
* ShSaveow Google login settings form
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v6.1.1]
* @return View
*/
public function postGoogleLoginSettings(Request $request)
{
if (!config('app.lock_passwords')) {
$setting = Setting::getSettings();
$setting->google_login = $request->input('google_login', 0);
$setting->google_client_id = $request->input('google_client_id');
$setting->google_client_secret = $request->input('google_client_secret');
if ($setting->save()) {
return redirect()->route('settings.index')
->with('success', trans('admin/settings/message.update.success'));
}
return redirect()->back()->withInput()->withErrors($setting->getErrors());
}
return redirect()->back()->with('error', trans('general.feature_disabled'));
}
/** /**
* Show the listing of backups. * Show the listing of backups.
* *
@ -1094,7 +1136,7 @@ class SettingsController extends Controller
public function postBackups() public function postBackups()
{ {
if (! config('app.lock_passwords')) { if (! config('app.lock_passwords')) {
Artisan::call('backup:run'); Artisan::call('snipeit:backup', ['--filename' => 'manual-backup-'.date('Y-m-d-H:i:s')]);
$output = Artisan::output(); $output = Artisan::output();
// Backup completed // Backup completed

View file

@ -67,7 +67,6 @@ class Importer extends Component
'location' => 'Location', 'location' => 'Location',
'maintained' => 'Maintained', 'maintained' => 'Maintained',
'manufacturer' => 'Manufacturer', 'manufacturer' => 'Manufacturer',
'notes' => 'Notes',
'order_number' => 'Order Number', 'order_number' => 'Order Number',
'purchase_cost' => 'Purchase Cost', 'purchase_cost' => 'Purchase Cost',
'purchase_date' => 'Purchase Date', 'purchase_date' => 'Purchase Date',
@ -81,11 +80,14 @@ class Importer extends Component
static $accessories = [ static $accessories = [
'model_number' => 'Model Number', 'model_number' => 'Model Number',
'notes' => 'Notes',
]; ];
static $assets = [ static $assets = [
'asset_tag' => 'Asset Tag', 'asset_tag' => 'Asset Tag',
'asset_model' => 'Model Name', 'asset_model' => 'Model Name',
'asset_notes' => 'Asset Notes',
'model_notes' => 'Model Notes',
'byod' => 'BYOD', 'byod' => 'BYOD',
'checkout_class' => 'Checkout Type', 'checkout_class' => 'Checkout Type',
'checkout_location' => 'Checkout Location', 'checkout_location' => 'Checkout Location',
@ -99,6 +101,7 @@ class Importer extends Component
static $consumables = [ static $consumables = [
'item_no' => "Item Number", 'item_no' => "Item Number",
'model_number' => "Model Number", 'model_number' => "Model Number",
'notes' => 'Notes',
'min_amt' => "Minimum Quantity", 'min_amt' => "Minimum Quantity",
]; ];
@ -111,13 +114,15 @@ class Importer extends Component
'purchase_order' => 'Purchase Order', 'purchase_order' => 'Purchase Order',
'reassignable' => 'Reassignable', 'reassignable' => 'Reassignable',
'seats' => 'Seats', 'seats' => 'Seats',
'notes' => 'Notes',
]; ];
static $users = [ static $users = [
'employee_num' => 'Employee Number', 'employee_num' => 'Employee Number',
'first_name' => 'First Name', 'first_name' => 'First Name',
'jobtitle' => 'Job Title',
'last_name' => 'Last Name', 'last_name' => 'Last Name',
'notes' => 'Notes',
'jobtitle' => 'Job Title',
'phone_number' => 'Phone Number', 'phone_number' => 'Phone Number',
'manager_first_name' => 'Manager First Name', 'manager_first_name' => 'Manager First Name',
'manager_last_name' => 'Manager Last Name', 'manager_last_name' => 'Manager Last Name',
@ -126,7 +131,25 @@ class Importer extends Component
'city' => 'City', 'city' => 'City',
'state' => 'State', 'state' => 'State',
'country' => 'Country', 'country' => 'Country',
'vip' => 'VIP' 'zip' => 'Zip',
'vip' => 'VIP',
'remote' => 'Remote',
];
static $locations = [
'name' => 'Name',
'address' => 'Address',
'address2' => 'Address 2',
'city' => 'City',
'state' => 'State',
'country' => 'Country',
'zip' => 'Zip',
'currency' => 'Currency',
'ldap_ou' => 'LDAP OU',
'manager_username' => 'Manager Username',
'manager' => 'Manager',
'parent_location' => 'Parent Location',
'notes' => 'Notes',
]; ];
//array of "real fieldnames" to a list of aliases for that field //array of "real fieldnames" to a list of aliases for that field
@ -150,6 +173,11 @@ class Importer extends Component
'QTY', 'QTY',
'Quantity' 'Quantity'
], ],
'zip' =>
[
'Postal Code',
'Post Code'
],
'min_amt' => 'min_amt' =>
[ [
'Min Amount', 'Min Amount',
@ -159,6 +187,31 @@ class Importer extends Component
[ [
'Next Audit', 'Next Audit',
], ],
'address2' =>
[
'Address 2',
'Address2',
],
'ldap_ou' =>
[
'LDAP OU',
'OU',
],
'parent_location' =>
[
'Parent',
'Parent Location',
],
'manager' =>
[
'Managed By',
'Manager Name',
'Manager Full Name',
],
'manager_username' =>
[
'Manager Username',
],
]; ];
@ -181,6 +234,9 @@ class Importer extends Component
case 'user': case 'user':
$results = self::$general + self::$users; $results = self::$general + self::$users;
break; break;
case 'location':
$results = self::$general + self::$locations;
break;
default: default:
$results = self::$general; $results = self::$general;
} }
@ -252,7 +308,6 @@ class Importer extends Component
$this->authorize('import'); $this->authorize('import');
$this->progress = -1; // '-1' means 'don't show the progressbar' $this->progress = -1; // '-1' means 'don't show the progressbar'
$this->progress_bar_class = 'progress-bar-warning'; $this->progress_bar_class = 'progress-bar-warning';
\Log::debug("Hey, we are calling MOUNT (in the importer-file) !!!!!!!!"); //fcuk
$this->importTypes = [ $this->importTypes = [
'asset' => trans('general.assets'), 'asset' => trans('general.assets'),
'accessory' => trans('general.accessories'), 'accessory' => trans('general.accessories'),
@ -260,6 +315,7 @@ class Importer extends Component
'component' => trans('general.components'), 'component' => trans('general.components'),
'license' => trans('general.licenses'), 'license' => trans('general.licenses'),
'user' => trans('general.users'), 'user' => trans('general.users'),
'location' => trans('general.locations'),
]; ];
$this->columnOptions[''] = $this->getColumns(''); //blank mode? I don't know what this is supposed to mean $this->columnOptions[''] = $this->getColumns(''); //blank mode? I don't know what this is supposed to mean
@ -273,8 +329,7 @@ class Importer extends Component
public function selectFile($id) public function selectFile($id)
{ {
\Log::debug("TOGGLE EVENT FIRED!");
\Log::debug("The ID we are trying to find is AS FOLLOWS: ".$id);
$this->activeFile = Import::find($id); $this->activeFile = Import::find($id);
$this->field_map = null; $this->field_map = null;
foreach($this->activeFile->header_row as $element) { foreach($this->activeFile->header_row as $element) {
@ -284,11 +339,9 @@ class Importer extends Component
$this->field_map[] = null; // re-inject the 'nulls' if a file was imported with some 'Do Not Import' settings $this->field_map[] = null; // re-inject the 'nulls' if a file was imported with some 'Do Not Import' settings
} }
} }
//$this->field_map = $this->activeFile->field_map ? array_values($this->activeFile->field_map) : []; // this is wrong
$this->file_id = $id; $this->file_id = $id;
$this->import_errors = null; $this->import_errors = null;
$this->statusText = null; $this->statusText = null;
\Log::debug("The import type we are about to try and load up is gonna be this: ".$this->activeFile->import_type);
} }

View file

@ -26,6 +26,8 @@ class CustomFieldRequest extends FormRequest
{ {
$rules = []; $rules = [];
$rules['associate_fieldsets.*'] = 'nullable|integer|exists:custom_fieldsets,id';
switch ($this->method()) { switch ($this->method()) {
// Brand new // Brand new
@ -54,4 +56,11 @@ class CustomFieldRequest extends FormRequest
return $rules; return $rules;
} }
public function messages()
{
return [
'associate_fieldsets.*.exists' => trans('admin/custom_fields/message/does_not_exist'),
];
}
} }

View file

@ -38,6 +38,9 @@ class CategoriesTransformer
case 'component': case 'component':
$category->item_count = $category->components_count; $category->item_count = $category->components_count;
break; break;
case 'license':
$category->item_count = $category->licenses_count;
break;
default: default:
$category->item_count = 0; $category->item_count = 0;
} }

View file

@ -48,6 +48,7 @@ class CustomFieldsTransformer
'type' => e($field->element), 'type' => e($field->element),
'required' => (($field->pivot) && ($field->pivot->required=='1')) ? true : false, 'required' => (($field->pivot) && ($field->pivot->required=='1')) ? true : false,
'display_in_user_view' => ($field->display_in_user_view =='1') ? true : false, 'display_in_user_view' => ($field->display_in_user_view =='1') ? true : false,
'auto_add_to_fieldsets' => ($field->auto_add_to_fieldsets == '1') ? true : false,
'created_at' => Helper::getFormattedDateObject($field->created_at, 'datetime'), 'created_at' => Helper::getFormattedDateObject($field->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($field->updated_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($field->updated_at, 'datetime'),
]; ];

View file

@ -29,6 +29,7 @@ class ManufacturersTransformer
'url' => e($manufacturer->url), 'url' => e($manufacturer->url),
'image' => ($manufacturer->image) ? Storage::disk('public')->url('manufacturers/'.e($manufacturer->image)) : null, 'image' => ($manufacturer->image) ? Storage::disk('public')->url('manufacturers/'.e($manufacturer->image)) : null,
'support_url' => e($manufacturer->support_url), 'support_url' => e($manufacturer->support_url),
'warranty_lookup_url' => e($manufacturer->warranty_lookup_url),
'support_phone' => e($manufacturer->support_phone), 'support_phone' => e($manufacturer->support_phone),
'support_email' => e($manufacturer->support_email), 'support_email' => e($manufacturer->support_email),
'assets_count' => (int) $manufacturer->assets_count, 'assets_count' => (int) $manufacturer->assets_count,

View file

@ -65,19 +65,22 @@ abstract class Importer
'email' => 'email', 'email' => 'email',
'username' => 'username', 'username' => 'username',
'address' => 'address', 'address' => 'address',
'address2' => 'address2',
'city' => 'city', 'city' => 'city',
'state' => 'state', 'state' => 'state',
'country' => 'country', 'country' => 'country',
'zip' => 'zip',
'jobtitle' => 'job title', 'jobtitle' => 'job title',
'employee_num' => 'employee number', 'employee_num' => 'employee number',
'phone_number' => 'phone number', 'phone_number' => 'phone number',
'first_name' => 'first name', 'first_name' => 'first name',
'last_name' => 'last name', 'last_name' => 'last name',
'department' => 'department', 'department' => 'department',
'manager_first_name' => 'manager first name', 'manager_name' => 'manager full name',
'manager_last_name' => 'manager last name', 'manager_username' => 'manager username',
'min_amt' => 'minimum quantity', 'min_amt' => 'minimum quantity',
'remote' => 'remote', 'remote' => 'remote',
'vip' => 'vip',
]; ];
/** /**
* Map of item fields->csv names * Map of item fields->csv names
@ -119,7 +122,7 @@ abstract class Importer
} else { } else {
$this->csv = Reader::createFromString($file); $this->csv = Reader::createFromString($file);
} }
$this->tempPassword = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 20); $this->tempPassword = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 40);
} }
// Cached Values for import lookups // Cached Values for import lookups
@ -198,11 +201,11 @@ abstract class Importer
$val = $default; $val = $default;
$key = $this->lookupCustomKey($key); $key = $this->lookupCustomKey($key);
$this->log("Custom Key: ${key}"); // $this->log("Custom Key: ${key}");
if (array_key_exists($key, $array)) { if (array_key_exists($key, $array)) {
$val = Encoding::toUTF8(trim($array[$key])); $val = Encoding::toUTF8(trim($array[$key]));
} }
$this->log("${key}: ${val}"); //$this->log("${key}: ${val}");
return $val; return $val;
} }
@ -280,8 +283,9 @@ abstract class Importer
* @return User Model w/ matching name * @return User Model w/ matching name
* @internal param array $user_array User details parsed from csv * @internal param array $user_array User details parsed from csv
*/ */
protected function createOrFetchUser($row) protected function createOrFetchUser($row, $type = 'user')
{ {
$user_array = [ $user_array = [
'full_name' => $this->findCsvMatch($row, 'full_name'), 'full_name' => $this->findCsvMatch($row, 'full_name'),
'email' => $this->findCsvMatch($row, 'email'), 'email' => $this->findCsvMatch($row, 'email'),
@ -292,31 +296,36 @@ abstract class Importer
'remote' => $this->fetchHumanBoolean(($this->findCsvMatch($row, 'remote'))), 'remote' => $this->fetchHumanBoolean(($this->findCsvMatch($row, 'remote'))),
]; ];
// Maybe we're lucky and the user already exists.
if ($user = User::where('username', $user_array['username'])->first()) {
$this->log('User '.$user_array['username'].' already exists');
return $user; if ($type == 'manager') {
$user_array['full_name'] = $this->findCsvMatch($row, 'manager');
$user_array['username'] = $this->findCsvMatch($row, 'manager_username');
} }
// If the full name is empty, bail out--we need this to extract first name (at the very least) // Maybe we're lucky and the username was passed and it already exists.
if (empty($user_array['full_name'])) { if (!empty($user_array['username'])) {
$this->log('Insufficient user data provided (Full name is required)- skipping user creation, just adding asset'); if ($user = User::where('username', $user_array['username'])->first()) {
$this->log('User '.$user_array['username'].' already exists');
return $user;
}
}
// If the full name and username is empty, bail out--we need this to extract first name (at the very least)
if ((empty($user_array['username'])) && (empty($user_array['full_name']))) {
$this->log('Insufficient user data provided (Full name or username is required) - skipping user creation.');
\Log::debug(print_r($user_array, true));
\Log::debug(print_r($row, true));
return false; return false;
} }
// Is the user actually an ID?
if ($user = $this->findUserByNumber($user_array['full_name'])) {
return $user;
}
$this->log('User does not appear to be an id with number: '.$user_array['full_name'].'. Continuing through our processes');
// Populate email if it does not exist. // Populate email if it does not exist.
if (empty($user_array['email'])) { if (empty($user_array['email'])) {
$user_array['email'] = User::generateEmailFromFullName($user_array['full_name']); $user_array['email'] = User::generateEmailFromFullName($user_array['full_name']);
} }
// Get some fields for first name and last name based off of full name
$user_formatted_array = User::generateFormattedNameFromFullName($user_array['full_name'], Setting::getSettings()->username_format); $user_formatted_array = User::generateFormattedNameFromFullName($user_array['full_name'], Setting::getSettings()->username_format);
$user_array['first_name'] = $user_formatted_array['first_name']; $user_array['first_name'] = $user_formatted_array['first_name'];
$user_array['last_name'] = $user_formatted_array['last_name']; $user_array['last_name'] = $user_formatted_array['last_name'];
@ -326,14 +335,12 @@ abstract class Importer
if ($this->usernameFormat == 'email') { if ($this->usernameFormat == 'email') {
$user_array['username'] = $user_array['email']; $user_array['username'] = $user_array['email'];
} }
}
// Does this ever actually fire?? // Check for a matching username one more time after trying to guess username.
// Check for a matching user after trying to guess username. if ($user = User::where('username', $user_array['username'])->first()) {
if ($user = User::where('username', $user_array['username'])->first()) { $this->log('User '.$user_array['username'].' already exists');
$this->log('User '.$user_array['username'].' already exists'); return $user;
}
return $user;
} }
// If at this point we have not found a username or first name, bail out in shame. // If at this point we have not found a username or first name, bail out in shame.
@ -341,7 +348,7 @@ abstract class Importer
return false; return false;
} }
// No Luck, let's create one. // No luck finding a user on username or first name, let's create one.
$user = new User; $user = new User;
$user->first_name = $user_array['first_name']; $user->first_name = $user_array['first_name'];
$user->last_name = $user_array['last_name']; $user->last_name = $user_array['last_name'];
@ -356,9 +363,9 @@ abstract class Importer
if ($user->save()) { if ($user->save()) {
$this->log('User '.$user_array['username'].' created'); $this->log('User '.$user_array['username'].' created');
return $user; return $user;
} }
$this->logError($user, 'User "'.$user_array['username'].'" was not able to be created.'); $this->logError($user, 'User "'.$user_array['username'].'" was not able to be created.');
return false; return false;

View file

@ -60,8 +60,8 @@ class ItemImporter extends Importer
$this->item['department_id'] = $this->createOrFetchDepartment($item_department); $this->item['department_id'] = $this->createOrFetchDepartment($item_department);
} }
$item_manager_first_name = $this->findCsvMatch($row, 'manage_first_name'); $item_manager_first_name = $this->findCsvMatch($row, 'manager_first_name');
$item_manager_last_name = $this->findCsvMatch($row, 'manage_last_name'); $item_manager_last_name = $this->findCsvMatch($row, 'manager_last_name');
if ($this->shouldUpdateField($item_manager_first_name)) { if ($this->shouldUpdateField($item_manager_first_name)) {
$this->item['manager_id'] = $this->fetchManager($item_manager_first_name, $item_manager_last_name); $this->item['manager_id'] = $this->fetchManager($item_manager_first_name, $item_manager_last_name);
@ -112,6 +112,10 @@ class ItemImporter extends Importer
return $this->createOrFetchUser($row); return $this->createOrFetchUser($row);
} }
if (get_class($this) != LocationImporter::class) {
return;
}
if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) { if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) {
return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location'))); return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location')));
} }

View file

@ -0,0 +1,102 @@
<?php
namespace App\Importer;
use App\Models\Location;
/**
* When we are importing users via an Asset/etc import, we use createOrFetchUser() in
* Importer\Importer.php. [ALG]
*
* Class LocationImporter
*/
class LocationImporter extends ItemImporter
{
protected $locations;
public function __construct($filename)
{
parent::__construct($filename);
}
protected function handle($row)
{
parent::handle($row);
$this->createLocationIfNotExists($row);
}
/**
* Create a location if a duplicate does not exist.
* @todo Investigate how this should interact with Importer::createLocationIfNotExists
*
* @author A. Gianotto
* @since 6.1.0
* @param array $row
*/
public function createLocationIfNotExists(array $row)
{
$editingLocation = false;
$location = Location::where('name', '=', $this->findCsvMatch($row, 'name'))->first();
if ($location) {
if (! $this->updating) {
$this->log('A matching Location '.$this->item['name'].' already exists');
return;
}
$this->log('Updating Location');
$editingLocation = true;
} else {
$this->log('No Matching Location, Create a new one');
$location = new Location;
}
// Pull the records from the CSV to determine their values
$this->item['name'] = $this->findCsvMatch($row, 'name');
$this->item['address'] = $this->findCsvMatch($row, 'address');
$this->item['address2'] = $this->findCsvMatch($row, 'address2');
$this->item['city'] = $this->findCsvMatch($row, 'city');
$this->item['state'] = $this->findCsvMatch($row, 'state');
$this->item['country'] = $this->findCsvMatch($row, 'country');
$this->item['zip'] = $this->findCsvMatch($row, 'zip');
$this->item['currency'] = $this->findCsvMatch($row, 'currency');
$this->item['ldap_ou'] = $this->findCsvMatch($row, 'ldap_ou');
$this->item['manager'] = $this->findCsvMatch($row, 'manager');
$this->item['manager_username'] = $this->findCsvMatch($row, 'manager_username');
$this->item['user_id'] = \Auth::user()->id;
if ($this->findCsvMatch($row, 'parent_location')) {
$this->item['parent_id'] = $this->createOrFetchLocation($this->findCsvMatch($row, 'parent_location'));
}
if (!empty($this->item['manager'])) {
if ($manager = $this->createOrFetchUser($row, 'manager')) {
$this->item['manager_id'] = $manager->id;
}
}
\Log::debug('Item array is: ');
\Log::debug(print_r($this->item, true));
if ($editingLocation) {
\Log::debug('Updating existing location');
$location->update($this->sanitizeItemForUpdating($location));
} else {
\Log::debug('Creating location');
$location->fill($this->sanitizeItemForStoring($location));
}
if ($location->save()) {
$this->log('Location '.$location->name.' created or updated from CSV import');
return $location;
} else {
\Log::debug($location->getErrors());
return $location->errors;
}
}
}

View file

@ -90,7 +90,7 @@ class Asset extends Depreciable
protected $rules = [ protected $rules = [
'name' => 'max:255|nullable', 'name' => 'max:255|nullable',
'model_id' => 'required|integer|exists:models,id', 'model_id' => 'required|integer|exists:models,id,deleted_at,NULL',
'status_id' => 'required|integer|exists:status_labels,id', 'status_id' => 'required|integer|exists:status_labels,id',
'company_id' => 'integer|nullable', 'company_id' => 'integer|nullable',
'warranty_months' => 'numeric|nullable|digits_between:0,240', 'warranty_months' => 'numeric|nullable|digits_between:0,240',
@ -909,7 +909,13 @@ class Asset extends Depreciable
return false; return false;
} }
public function getComponentCost(){
$cost = 0;
foreach($this->components as $component) {
$cost += $component->pivot->assigned_qty*$component->purchase_cost;
}
return $cost;
}
/** /**
* ----------------------------------------------- * -----------------------------------------------

View file

@ -3,13 +3,14 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
class CheckoutAcceptance extends Model class CheckoutAcceptance extends Model
{ {
use SoftDeletes, Notifiable; use HasFactory, SoftDeletes, Notifiable;
protected $casts = [ protected $casts = [
'accepted_at' => 'datetime', 'accepted_at' => 'datetime',

View file

@ -52,6 +52,7 @@ class CustomField extends Model
'name' => 'required|unique:custom_fields', 'name' => 'required|unique:custom_fields',
'element' => 'required|in:text,listbox,textarea,checkbox,radio', 'element' => 'required|in:text,listbox,textarea,checkbox,radio',
'field_encrypted' => 'nullable|boolean', 'field_encrypted' => 'nullable|boolean',
'auto_add_to_fieldsets' => 'boolean',
]; ];
/** /**
@ -69,6 +70,8 @@ class CustomField extends Model
'show_in_email', 'show_in_email',
'is_unique', 'is_unique',
'display_in_user_view', 'display_in_user_view',
'auto_add_to_fieldsets',
]; ];
/** /**

View file

@ -26,11 +26,12 @@ class Location extends SnipeModel
protected $table = 'locations'; protected $table = 'locations';
protected $rules = [ protected $rules = [
'name' => 'required|min:2|max:255|unique_undeleted', 'name' => 'required|min:2|max:255|unique_undeleted',
'city' => 'min:2|max:255|nullable', 'address' => 'max:191|nullable',
'country' => 'min:2|max:255|nullable', 'address2' => 'max:191|nullable',
'address' => 'max:80|nullable', 'city' => 'max:191|nullable',
'address2' => 'max:80|nullable', 'state' => 'min:2|max:191|nullable',
'zip' => 'min:3|max:10|nullable', 'country' => 'min:2|max:191|nullable',
'zip' => 'max:10|nullable',
'manager_id' => 'exists:users,id|nullable', 'manager_id' => 'exists:users,id|nullable',
'parent_id' => 'non_circular:locations,id', 'parent_id' => 'non_circular:locations,id',
]; ];

View file

@ -23,8 +23,9 @@ class Manufacturer extends SnipeModel
protected $rules = [ protected $rules = [
'name' => 'required|min:2|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL', 'name' => 'required|min:2|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL',
'url' => 'url|nullable', 'url' => 'url|nullable',
'support_url' => 'url|nullable',
'support_email' => 'email|nullable', 'support_email' => 'email|nullable',
'support_url' => 'nullable|url',
'warranty_lookup_url' => 'nullable|starts_with:http://,https://,afp://,facetime://,file://,irc://'
]; ];
protected $hidden = ['user_id']; protected $hidden = ['user_id'];
@ -51,6 +52,7 @@ class Manufacturer extends SnipeModel
'support_phone', 'support_phone',
'support_url', 'support_url',
'url', 'url',
'warranty_lookup_url',
]; ];
use Searchable; use Searchable;

View file

@ -76,6 +76,7 @@ class Setting extends Model
'audit_interval' => 'numeric|nullable', 'audit_interval' => 'numeric|nullable',
'custom_forgot_pass_url' => 'url|nullable', 'custom_forgot_pass_url' => 'url|nullable',
'privacy_policy_link' => 'nullable|url', 'privacy_policy_link' => 'nullable|url',
'google_client_id' => 'nullable|ends_with:apps.googleusercontent.com'
]; ];
protected $fillable = [ protected $fillable = [
@ -86,6 +87,9 @@ class Setting extends Model
'webhook_endpoint', 'webhook_endpoint',
'webhook_channel', 'webhook_channel',
'webhook_botname', 'webhook_botname',
'google_login',
'google_client_id',
'google_client_secret',
]; ];
/** /**

View file

@ -16,17 +16,17 @@ class Supplier extends SnipeModel
protected $table = 'suppliers'; protected $table = 'suppliers';
protected $rules = [ protected $rules = [
'name' => 'required|min:1|max:255|unique_undeleted', 'name' => 'required|min:1|max:255|unique_undeleted',
'address' => 'max:250|nullable',
'address2' => 'max:250|nullable',
'city' => 'max:255|nullable',
'state' => 'max:32|nullable',
'country' => 'max:3|nullable',
'fax' => 'min:7|max:35|nullable', 'fax' => 'min:7|max:35|nullable',
'phone' => 'min:7|max:35|nullable', 'phone' => 'min:7|max:35|nullable',
'contact' => 'max:100|nullable', 'contact' => 'max:100|nullable',
'notes' => 'max:191|nullable', // Default string length is 191 characters.. 'notes' => 'max:191|nullable', // Default string length is 191 characters..
'email' => 'email|max:150|nullable', 'email' => 'email|max:150|nullable',
'address' => 'max:250|nullable',
'address2' => 'max:250|nullable',
'city' => 'max:191|nullable',
'state' => 'min:2|max:191|nullable',
'country' => 'min:2|max:191|nullable',
'zip' => 'max:10|nullable', 'zip' => 'max:10|nullable',
'url' => 'sometimes|nullable|string|max:250', 'url' => 'sometimes|nullable|string|max:250',
]; ];

View file

@ -98,6 +98,11 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'start_date' => 'nullable|date_format:Y-m-d', 'start_date' => 'nullable|date_format:Y-m-d',
'end_date' => 'nullable|date_format:Y-m-d|after_or_equal:start_date', 'end_date' => 'nullable|date_format:Y-m-d|after_or_equal:start_date',
'autoassign_licenses' => 'boolean', 'autoassign_licenses' => 'boolean',
'address' => 'max:191|nullable',
'city' => 'max:191|nullable',
'state' => 'min:2|max:191|nullable',
'country' => 'min:2|max:191|nullable',
'zip' => 'max:10|nullable',
]; ];
/** /**

View file

@ -534,6 +534,18 @@ class AssetPresenter extends Presenter
return false; return false;
} }
/**
* Used to take user created warranty URL and dynamically fill in the needed values per asset
* @return string
*/
public function dynamicWarrantyUrl()
{
$warranty_lookup_url = $this->model->model->manufacturer->warranty_lookup_url;
$url = (str_replace('{LOCALE}',\App\Models\Setting::getSettings()->locale,$warranty_lookup_url));
$url = (str_replace('{SERIAL}',$this->model->serial,$url));
return $url;
}
/** /**
* Url to view this item. * Url to view this item.
* @return string * @return string

View file

@ -151,6 +151,21 @@ class LicensePresenter extends Presenter
'visible' => false, 'visible' => false,
'title' => trans('general.order_number'), 'title' => trans('general.order_number'),
], [ ], [
'field' => 'created_at',
'searchable' => false,
'sortable' => true,
'visible' => false,
'title' => trans('general.created_at'),
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'updated_at',
'searchable' => false,
'sortable' => true,
'visible' => false,
'title' => trans('general.updated_at'),
'formatter' => 'dateDisplayFormatter',
],
[
'field' => 'notes', 'field' => 'notes',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View file

@ -47,7 +47,7 @@ class ManufacturerPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('admin/manufacturers/table.url'), 'title' => trans('admin/manufacturers/table.url'),
'visible' => true, 'visible' => true,
'formatter' => 'linkFormatter', 'formatter' => 'externalLinkFormatter',
], ],
[ [
'field' => 'support_url', 'field' => 'support_url',
@ -56,7 +56,7 @@ class ManufacturerPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('admin/manufacturers/table.support_url'), 'title' => trans('admin/manufacturers/table.support_url'),
'visible' => true, 'visible' => true,
'formatter' => 'linkFormatter', 'formatter' => 'externalLinkFormatter',
], ],
[ [
@ -78,6 +78,15 @@ class ManufacturerPresenter extends Presenter
'visible' => true, 'visible' => true,
'formatter' => 'emailFormatter', 'formatter' => 'emailFormatter',
], ],
[
'field' => 'warranty_lookup_url',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/manufacturers/table.warranty_lookup_url'),
'visible' => false,
'formatter' => 'externalLinkFormatter',
],
[ [
'field' => 'assets_count', 'field' => 'assets_count',

View file

@ -7,6 +7,7 @@ use App\Models\Setting;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
/** /**
* Class UserPresenter * Class UserPresenter
@ -399,17 +400,25 @@ class UserPresenter extends Presenter
public function gravatar() public function gravatar()
{ {
if ($this->avatar) { if ($this->avatar) {
// Check if it's a google avatar or some external avatar
if (Str::startsWith($this->avatar, ['http://', 'https://'])) {
return $this->avatar;
}
// Otherwise assume it's an uploaded image
return Storage::disk('public')->url('avatars/'.e($this->avatar)); return Storage::disk('public')->url('avatars/'.e($this->avatar));
} }
if (Setting::getSettings()->load_remote == '1') { if (Setting::getSettings()->load_remote == '1') {
if ($this->model->gravatar != '') { if ($this->model->gravatar != '') {
$gravatar = md5(strtolower(trim($this->model->gravatar))); $gravatar = md5(strtolower(trim($this->model->gravatar)));
return '//gravatar.com/avatar/'.$gravatar; return '//gravatar.com/avatar/'.$gravatar;
} elseif ($this->email != '') {
$gravatar = md5(strtolower(trim($this->email)));
} elseif ($this->email != '') {
$gravatar = md5(strtolower(trim($this->email)));
return '//gravatar.com/avatar/'.$gravatar; return '//gravatar.com/avatar/'.$gravatar;
} }
} }

View file

@ -17,7 +17,7 @@
} }
], ],
"require": { "require": {
"php": ">=7.4 <8.3", "php": ">=7.4.3 <8.2",
"ext-curl": "*", "ext-curl": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-json": "*", "ext-json": "*",
@ -46,6 +46,7 @@
"laravel/helpers": "^1.4", "laravel/helpers": "^1.4",
"laravel/passport": "^10.1", "laravel/passport": "^10.1",
"laravel/slack-notification-channel": "^2.3", "laravel/slack-notification-channel": "^2.3",
"laravel/socialite": "^5.6",
"laravel/tinker": "^2.6", "laravel/tinker": "^2.6",
"laravel/ui": "^3.3", "laravel/ui": "^3.3",
"laravelcollective/html": "^6.2", "laravelcollective/html": "^6.2",

156
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "590171872e4a6a29c78efde99fbbf00e", "content-hash": "4c82b2e171fb02a3ef024906db5d74c9",
"packages": [ "packages": [
{ {
"name": "alek13/slack", "name": "alek13/slack",
@ -2673,6 +2673,7 @@
"type": "github" "type": "github"
} }
], ],
"abandoned": true,
"time": "2022-02-23T14:25:13+00:00" "time": "2022-02-23T14:25:13+00:00"
}, },
{ {
@ -3604,6 +3605,75 @@
}, },
"time": "2022-01-12T18:07:54+00:00" "time": "2022-01-12T18:07:54+00:00"
}, },
{
"name": "laravel/socialite",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/socialite.git",
"reference": "a14a177f2cc71d8add71e2b19e00800e83bdda09"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/socialite/zipball/a14a177f2cc71d8add71e2b19e00800e83bdda09",
"reference": "a14a177f2cc71d8add71e2b19e00800e83bdda09",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0|^7.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"league/oauth1-client": "^1.10.1",
"php": "^7.2|^8.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0",
"phpunit/phpunit": "^8.0|^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Socialite\\SocialiteServiceProvider"
],
"aliases": {
"Socialite": "Laravel\\Socialite\\Facades\\Socialite"
}
}
},
"autoload": {
"psr-4": {
"Laravel\\Socialite\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel wrapper around OAuth 1 & OAuth 2 libraries.",
"homepage": "https://laravel.com",
"keywords": [
"laravel",
"oauth"
],
"support": {
"issues": "https://github.com/laravel/socialite/issues",
"source": "https://github.com/laravel/socialite"
},
"time": "2023-01-20T15:42:35+00:00"
},
{ {
"name": "laravel/tinker", "name": "laravel/tinker",
"version": "v2.7.2", "version": "v2.7.2",
@ -3803,6 +3873,7 @@
"issues": "https://github.com/LaravelCollective/html/issues", "issues": "https://github.com/LaravelCollective/html/issues",
"source": "https://github.com/LaravelCollective/html" "source": "https://github.com/LaravelCollective/html"
}, },
"abandoned": "spatie/laravel-html",
"time": "2022-02-08T21:02:54+00:00" "time": "2022-02-08T21:02:54+00:00"
}, },
{ {
@ -4532,6 +4603,82 @@
], ],
"time": "2022-04-17T13:12:02+00:00" "time": "2022-04-17T13:12:02+00:00"
}, },
{
"name": "league/oauth1-client",
"version": "v1.10.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/oauth1-client.git",
"reference": "d6365b901b5c287dd41f143033315e2f777e1167"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/d6365b901b5c287dd41f143033315e2f777e1167",
"reference": "d6365b901b5c287dd41f143033315e2f777e1167",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-openssl": "*",
"guzzlehttp/guzzle": "^6.0|^7.0",
"guzzlehttp/psr7": "^1.7|^2.0",
"php": ">=7.1||>=8.0"
},
"require-dev": {
"ext-simplexml": "*",
"friendsofphp/php-cs-fixer": "^2.17",
"mockery/mockery": "^1.3.3",
"phpstan/phpstan": "^0.12.42",
"phpunit/phpunit": "^7.5||9.5"
},
"suggest": {
"ext-simplexml": "For decoding XML-based responses."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev",
"dev-develop": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"League\\OAuth1\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ben Corlett",
"email": "bencorlett@me.com",
"homepage": "http://www.webcomm.com.au",
"role": "Developer"
}
],
"description": "OAuth 1.0 Client Library",
"keywords": [
"Authentication",
"SSO",
"authorization",
"bitbucket",
"identity",
"idp",
"oauth",
"oauth1",
"single sign on",
"trello",
"tumblr",
"twitter"
],
"support": {
"issues": "https://github.com/thephpleague/oauth1-client/issues",
"source": "https://github.com/thephpleague/oauth1-client/tree/v1.10.1"
},
"time": "2022-04-15T14:02:14+00:00"
},
{ {
"name": "league/oauth2-server", "name": "league/oauth2-server",
"version": "8.3.5", "version": "8.3.5",
@ -5007,6 +5154,10 @@
"source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.1" "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.1"
}, },
"funding": [ "funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
},
{ {
"url": "https://opencollective.com/zipstream", "url": "https://opencollective.com/zipstream",
"type": "open_collective" "type": "open_collective"
@ -13984,6 +14135,7 @@
"type": "github" "type": "github"
} }
], ],
"abandoned": true,
"time": "2020-12-07T05:51:20+00:00" "time": "2020-12-07T05:51:20+00:00"
}, },
{ {
@ -16410,7 +16562,7 @@
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=7.4 <8.3", "php": ">=7.4.3 <8.2",
"ext-curl": "*", "ext-curl": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-json": "*", "ext-json": "*",

View file

@ -216,7 +216,8 @@ return [
*/ */
'require_saml' => env('REQUIRE_SAML', false), 'require_saml' => env('REQUIRE_SAML', false),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Demo Mode Lockdown | Demo Mode Lockdown
@ -294,6 +295,7 @@ return [
Laravel\Tinker\TinkerServiceProvider::class, Laravel\Tinker\TinkerServiceProvider::class,
Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class, Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class,
Eduardokum\LaravelMailAutoEmbed\ServiceProvider::class, Eduardokum\LaravelMailAutoEmbed\ServiceProvider::class,
Laravel\Socialite\SocialiteServiceProvider::class,
/* /*
* Application Service Providers... * Application Service Providers...
@ -366,6 +368,7 @@ return [
'Image' => Intervention\Image\ImageServiceProvider::class, 'Image' => Intervention\Image\ImageServiceProvider::class,
'Carbon' => Carbon\Carbon::class, 'Carbon' => Carbon\Carbon::class,
'Helper' => App\Helpers\Helper::class, // makes it much easier to use 'Helper::blah' in blades (which is where we usually use this) 'Helper' => App\Helpers\Helper::class, // makes it much easier to use 'Helper::blah' in blades (which is where we usually use this)
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
], ],

View file

@ -15,7 +15,7 @@ return [
| |
*/ */
'driver' => 'bcrypt', 'driver' => env('HASHING_DRIVER', 'bcrypt'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -44,9 +44,9 @@ return [
*/ */
'argon' => [ 'argon' => [
'memory' => 1024, 'memory' => env('ARGON_MEMORY', 1024),
'threads' => 2, 'threads' => env('ARGON_THREADS', 2),
'time' => 2, 'time' => env('ARGON_TIME', 2),
], ],
]; ];

View file

@ -140,8 +140,8 @@ return [
| |
*/ */
'sendmail' => '/usr/sbin/sendmail -bs', 'sendmail' => env('SENDMAIL_PATH', ini_get('sendmail_path')),
'markdown' => [ 'markdown' => [
'theme' => 'default', 'theme' => 'default',
'paths' => [ 'paths' => [

View file

@ -1,10 +1,10 @@
<?php <?php
return array ( return array (
'app_version' => 'v6.1.0', 'app_version' => 'v6.1.1-pre',
'full_app_version' => 'v6.1.0 - build 10161-ga8ca3ad2a', 'full_app_version' => 'v6.1.1-pre - build 10534-g609b1646e',
'build_version' => '10161', 'build_version' => '10534',
'prerelease_version' => '', 'prerelease_version' => '',
'hash_version' => 'ga8ca3ad2a', 'hash_version' => 'g609b1646e',
'full_hash' => 'v6.1.0-127-ga8ca3ad2a', 'full_hash' => 'v6.1.1-pre-292-g609b1646e',
'branch' => 'develop', 'branch' => 'develop',
); );

View file

@ -0,0 +1,41 @@
<?php
namespace Database\Factories;
use App\Models\Accessory;
use App\Models\Asset;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class CheckoutAcceptanceFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'checkoutable_type' => Asset::class,
'checkoutable_id' => Asset::factory(),
'assigned_to_id' => User::factory(),
];
}
public function forAccessory()
{
return $this->state([
'checkoutable_type' => Accessory::class,
'checkoutable_id' => Accessory::factory(),
]);
}
public function pending()
{
return $this->state([
'accepted_at' => null,
'declined_at' => null,
]);
}
}

View file

@ -25,6 +25,7 @@ class CustomFieldFactory extends Factory
'name' => $this->faker->catchPhrase(), 'name' => $this->faker->catchPhrase(),
'format' => '', 'format' => '',
'element' => 'text', 'element' => 'text',
'auto_add_to_fieldsets' => '0',
]; ];
} }

View file

@ -38,6 +38,7 @@ class ManufacturerFactory extends Factory
'name' => 'Apple', 'name' => 'Apple',
'url' => 'https://apple.com', 'url' => 'https://apple.com',
'support_url' => 'https://support.apple.com', 'support_url' => 'https://support.apple.com',
'warranty_lookup_url' => 'https://checkcoverage.apple.com',
'image' => 'apple.jpg', 'image' => 'apple.jpg',
]; ];
}); });
@ -50,6 +51,7 @@ class ManufacturerFactory extends Factory
'name' => 'Microsoft', 'name' => 'Microsoft',
'url' => 'https://microsoft.com', 'url' => 'https://microsoft.com',
'support_url' => 'https://support.microsoft.com', 'support_url' => 'https://support.microsoft.com',
'warranty_lookup_url' => 'https://account.microsoft.com/devices',
'image' => 'microsoft.png', 'image' => 'microsoft.png',
]; ];
}); });
@ -62,6 +64,7 @@ class ManufacturerFactory extends Factory
'name' => 'Dell', 'name' => 'Dell',
'url' => 'https://dell.com', 'url' => 'https://dell.com',
'support_url' => 'https://support.dell.com', 'support_url' => 'https://support.dell.com',
'warranty_lookup_url' => 'https://www.dell.com/support/home/en-us/Products/?app=warranty',
'image' => 'dell.png', 'image' => 'dell.png',
]; ];
}); });

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAutoaddToCustomfields extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('custom_fields', function (Blueprint $table) {
$table->boolean('auto_add_to_fieldsets')->nullable()->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('custom_fields', function (Blueprint $table) {
if (Schema::hasColumn('custom_fields', 'auto_add_to_fieldsets')) {
$table->dropColumn('auto_add_to_fieldsets');
}
});
}
}

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddWarrantyUrlToManufacturers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('manufacturers', function (Blueprint $table) {
$table->string('warranty_lookup_url')->after('support_url')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('manufacturers', function (Blueprint $table) {
$table->dropColumn('warranty_lookup_url');
});
}
}

View file

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class IncreaseStateToMoreThan3 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('state', 191)->nullable()->default(null)->change();
});
Schema::table('suppliers', function (Blueprint $table) {
$table->string('state', 191)->nullable()->default(null)->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->string('state', 3)->nullable()->default(null)->change();
});
Schema::table('suppliers', function (Blueprint $table) {
$table->string('state', 32)->nullable()->default(null)->change();
});
}
}

View file

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddGoogleAuthToSettings extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->boolean('google_login')->nullable()->default(0);
$table->string('google_client_id')->nullable()->default(null);
$table->string('google_client_secret')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('google_login');
$table->dropColumn('google_client_id');
$table->dropColumn('google_client_secret');
});
}
}

View file

@ -54,6 +54,6 @@
"tableexport.jquery.plugin": "1.27.0", "tableexport.jquery.plugin": "1.27.0",
"tether": "^1.4.0", "tether": "^1.4.0",
"vue-resource": "^1.5.2", "vue-resource": "^1.5.2",
"webpack": "^5.77.0" "webpack": "^5.78.0"
} }
} }

View file

@ -501,6 +501,9 @@ a.accordion-header {
.btn-info.btn-outline { .btn-info.btn-outline {
color: #5bc0de; color: #5bc0de;
} }
.btn-warning {
background-color: #f39c12 !important;
}
.btn-warning.btn-outline { .btn-warning.btn-outline {
color: #f0ad4e; color: #f0ad4e;
} }

View file

@ -134,6 +134,9 @@ a.accordion-header {
.btn-info.btn-outline { .btn-info.btn-outline {
color: #5bc0de; color: #5bc0de;
} }
.btn-warning {
background-color: #f39c12 !important;
}
.btn-warning.btn-outline { .btn-warning.btn-outline {
color: #f0ad4e; color: #f0ad4e;
} }

View file

@ -23267,6 +23267,9 @@ a.accordion-header {
.btn-info.btn-outline { .btn-info.btn-outline {
color: #5bc0de; color: #5bc0de;
} }
.btn-warning {
background-color: #f39c12 !important;
}
.btn-warning.btn-outline { .btn-warning.btn-outline {
color: #f0ad4e; color: #f0ad4e;
} }
@ -24490,6 +24493,9 @@ a.accordion-header {
.btn-info.btn-outline { .btn-info.btn-outline {
color: #5bc0de; color: #5bc0de;
} }
.btn-warning {
background-color: #f39c12 !important;
}
.btn-warning.btn-outline { .btn-warning.btn-outline {
color: #f0ad4e; color: #f0ad4e;
} }

View file

@ -201,6 +201,9 @@ a:visited {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -212,6 +215,23 @@ a:visited {
.pagination > .active > a:hover { .pagination > .active > a:hover {
background-color: var(--hover-link); background-color: var(--hover-link);
} }
.tasks-menu > .dropdown-menu > li .menu > li > a:hover .progress {
background-color: var(--background);
}
a:hover > h2.task_menu {
color: var(--header);
}
h2.task_menu {
color: var(--link);
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
background-color: var(--back-main);
color: var(--link);
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu > li.header {
background-color: var(--header);
color: var(--link);
}
.main-header .navbar, .main-header .navbar,
.main-header .logo { .main-header .logo {
background-color: var(--header); background-color: var(--header);

View file

@ -201,6 +201,9 @@ a:visited {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -212,6 +215,23 @@ a:visited {
.pagination > .active > a:hover { .pagination > .active > a:hover {
background-color: var(--hover-link); background-color: var(--hover-link);
} }
.tasks-menu > .dropdown-menu > li .menu > li > a:hover .progress {
background-color: var(--background);
}
a:hover > h2.task_menu {
color: var(--header);
}
h2.task_menu {
color: var(--link);
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
background-color: var(--back-main);
color: var(--link);
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu > li.header {
background-color: var(--header);
color: var(--link);
}
.main-header .navbar, .main-header .navbar,
.main-header .logo { .main-header .logo {
background-color: var(--header); background-color: var(--header);

View file

@ -196,6 +196,9 @@ a:visited {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -482,6 +485,12 @@ a:hover {
a:visited { a:visited {
color: var(--visited-link); color: var(--visited-link);
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -196,6 +196,9 @@ a:visited {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -482,6 +485,12 @@ a:hover {
a:visited { a:visited {
color: var(--visited-link); color: var(--visited-link);
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -196,6 +196,9 @@ a:visited {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -240,9 +243,6 @@ h2.task_menu {
background-color: var(--back-main); background-color: var(--back-main);
color: var(--text-main); color: var(--text-main);
} }
a:link {
color: var(--link);
}
.btn-primary.hover { .btn-primary.hover {
color: var(--nav-link); color: var(--nav-link);
} }
@ -472,6 +472,12 @@ a:hover {
a:visited { a:visited {
color: var(--visited-link); color: var(--visited-link);
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -196,6 +196,9 @@ a:visited {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -240,9 +243,6 @@ h2.task_menu {
background-color: var(--back-main); background-color: var(--back-main);
color: var(--text-main); color: var(--text-main);
} }
a:link {
color: var(--link);
}
.btn-primary.hover { .btn-primary.hover {
color: var(--nav-link); color: var(--nav-link);
} }
@ -472,6 +472,12 @@ a:hover {
a:visited { a:visited {
color: var(--visited-link); color: var(--visited-link);
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -190,6 +190,9 @@ li.dropdown-item-marker {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -470,6 +473,12 @@ input[type=search] {
.box-header.with-border { .box-header.with-border {
border-bottom: #000; border-bottom: #000;
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -190,6 +190,9 @@ li.dropdown-item-marker {
#ldapad_test_results.well.well-sm { #ldapad_test_results.well.well-sm {
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color: #fff !important;
}
.pagination > li > a { .pagination > li > a {
color: var(--light-link); color: var(--light-link);
background-color: var(--back-main); background-color: var(--back-main);
@ -470,6 +473,12 @@ input[type=search] {
.box-header.with-border { .box-header.with-border {
border-bottom: #000; border-bottom: #000;
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -244,12 +244,12 @@ h2.task_menu {
a:link { a:link {
color: var(--link); color: var(--link);
} }
a:visited {
color: var(--nav-link);
}
a:hover { a:hover {
color: var(--hover-link); color: var(--hover-link);
} }
a:visited {
color: var(--nav-link);
}
.far fa-life-ring { .far fa-life-ring {
color: var(--link); color: var(--link);
} }
@ -462,7 +462,6 @@ input[type=search] {
} }
.table-striped > tbody > tr:nth-of-type(even) { .table-striped > tbody > tr:nth-of-type(even) {
background-color: var(--back-sub-alt); background-color: var(--back-sub-alt);
color: var(--text-alt);
} }
#webui > div > div > div > div > div > table > tbody > tr > td > a > i.fa, #webui > div > div > div > div > div > table > tbody > tr > td > a > i.fa,
.box-body, .box-body,
@ -477,14 +476,20 @@ a {
color: var(--link); color: var(--link);
} }
a:link { a:link {
color: var(--link); color: var(--nav-link);
} }
a:hover { a:hover {
color: var(--hover-link); color: var(--nav-link);
text-decoration: underline; text-decoration: underline;
} }
a:visited { a:visited {
color: var(--visited-link); color: var(--nav-link);
}
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
} }
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;

View file

@ -244,12 +244,12 @@ h2.task_menu {
a:link { a:link {
color: var(--link); color: var(--link);
} }
a:visited {
color: var(--nav-link);
}
a:hover { a:hover {
color: var(--hover-link); color: var(--hover-link);
} }
a:visited {
color: var(--nav-link);
}
.far fa-life-ring { .far fa-life-ring {
color: var(--link); color: var(--link);
} }
@ -462,7 +462,6 @@ input[type=search] {
} }
.table-striped > tbody > tr:nth-of-type(even) { .table-striped > tbody > tr:nth-of-type(even) {
background-color: var(--back-sub-alt); background-color: var(--back-sub-alt);
color: var(--text-alt);
} }
#webui > div > div > div > div > div > table > tbody > tr > td > a > i.fa, #webui > div > div > div > div > div > table > tbody > tr > td > a > i.fa,
.box-body, .box-body,
@ -477,14 +476,20 @@ a {
color: var(--link); color: var(--link);
} }
a:link { a:link {
color: var(--link); color: var(--nav-link);
} }
a:hover { a:hover {
color: var(--hover-link); color: var(--nav-link);
text-decoration: underline; text-decoration: underline;
} }
a:visited { a:visited {
color: var(--visited-link); color: var(--nav-link);
}
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets'] {
background-color: transparent;
} }
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;

View file

@ -101,10 +101,6 @@
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.btn,
.btn:hover {
color: #000;
}
.btn.btn-primary, .btn.btn-primary,
.btn:hover.btn-primary, .btn:hover.btn-primary,
.btn .btn-primary:link, .btn .btn-primary:link,
@ -129,6 +125,9 @@
background-color: var(--hover-link); background-color: var(--hover-link);
color: #545454; color: #545454;
} }
a.actions {
color: #fff !important;
}
/** /**
The dropdown is white, so use a darker color The dropdown is white, so use a darker color
*/ */
@ -211,7 +210,7 @@ a.btn.btn-default {
color: var(--nav-link); color: var(--nav-link);
} }
.bootstrap-table .fixed-table-container .table thead th .sortable { .bootstrap-table .fixed-table-container .table thead th .sortable {
color: var(--nav-link); color: var(--text-main);
} }
.bootstrap-table .fixed-table-toolbar .columns label { .bootstrap-table .fixed-table-toolbar .columns label {
color: #000; color: #000;
@ -423,14 +422,9 @@ input[type=search] {
.skin-yellow-dark .main-header .navbar .dropdown-menu li a { .skin-yellow-dark .main-header .navbar .dropdown-menu li a {
color: var(--header); color: var(--header);
} }
div.th-inner { tr th div.th-inner {
color: var(--text-main); color: var(--text-main);
} }
.fixed-table-body thead th .th-inner,
.skin-yellow-dark,
.skin-yellow {
background-color: var(--header) !important;
}
.tab-content, .tab-content,
.tab-pane { .tab-pane {
background-color: var(--back-main); background-color: var(--back-main);

View file

@ -101,10 +101,6 @@
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
.btn,
.btn:hover {
color: #000;
}
.btn.btn-primary, .btn.btn-primary,
.btn:hover.btn-primary, .btn:hover.btn-primary,
.btn .btn-primary:link, .btn .btn-primary:link,
@ -129,6 +125,9 @@
background-color: var(--hover-link); background-color: var(--hover-link);
color: #545454; color: #545454;
} }
a.actions {
color: #fff !important;
}
/** /**
The dropdown is white, so use a darker color The dropdown is white, so use a darker color
*/ */
@ -211,7 +210,7 @@ a.btn.btn-default {
color: var(--nav-link); color: var(--nav-link);
} }
.bootstrap-table .fixed-table-container .table thead th .sortable { .bootstrap-table .fixed-table-container .table thead th .sortable {
color: var(--nav-link); color: var(--text-main);
} }
.bootstrap-table .fixed-table-toolbar .columns label { .bootstrap-table .fixed-table-toolbar .columns label {
color: #000; color: #000;
@ -423,14 +422,9 @@ input[type=search] {
.skin-yellow-dark .main-header .navbar .dropdown-menu li a { .skin-yellow-dark .main-header .navbar .dropdown-menu li a {
color: var(--header); color: var(--header);
} }
div.th-inner { tr th div.th-inner {
color: var(--text-main); color: var(--text-main);
} }
.fixed-table-body thead th .th-inner,
.skin-yellow-dark,
.skin-yellow {
background-color: var(--header) !important;
}
.tab-content, .tab-content,
.tab-pane { .tab-pane {
background-color: var(--back-main); background-color: var(--back-main);

View file

@ -1,24 +1,24 @@
{ {
"/js/build/app.js": "/js/build/app.js?id=7caeae38608edd96421f8ef59d33f5f6", "/js/build/app.js": "/js/build/app.js?id=7caeae38608edd96421f8ef59d33f5f6",
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374", "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374",
"/css/build/overrides.css": "/css/build/overrides.css?id=ce20eefb1895545e882840c480bca0dc", "/css/build/overrides.css": "/css/build/overrides.css?id=97a58ce3a89cd0043a1c54ecf63d4686",
"/css/build/app.css": "/css/build/app.css?id=3afc900b0a697567f8285f46aded1c89", "/css/build/app.css": "/css/build/app.css?id=02dbcc25fce08e9b9a9b285883821805",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=dc383f8560a8d4adb51d44fb4043e03b", "/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.css": "/css/dist/skins/skin-orange.css?id=6f0563e726c2fe4fab4026daaa5bfdf2",
"/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=ca38553d041220a4296dda555940e056", "/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=e6e53eef152bba01a4c666a4d8b01117",
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=032f18fdd48936784cfcfe70712a68ae", "/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=07273f6ca3c698a39e8fc2075af4fa07",
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=e5b6ec4691d8fd647d38722886f983e6", "/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=7c4badf178b44a4489dac90c0f772908",
"/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=7b315b9612b8fde8f9c5b0ddb6bba690", "/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=7b315b9612b8fde8f9c5b0ddb6bba690",
"/css/dist/skins/skin-purple-dark.css": "/css/dist/skins/skin-purple-dark.css?id=7d92dea45d94be7e1d4e427c728d335d", "/css/dist/skins/skin-purple-dark.css": "/css/dist/skins/skin-purple-dark.css?id=7d92dea45d94be7e1d4e427c728d335d",
"/css/dist/skins/skin-purple.css": "/css/dist/skins/skin-purple.css?id=6fe68325d5356197672c27bc77cedcb4", "/css/dist/skins/skin-purple.css": "/css/dist/skins/skin-purple.css?id=6fe68325d5356197672c27bc77cedcb4",
"/css/dist/skins/skin-red-dark.css": "/css/dist/skins/skin-red-dark.css?id=218c6d947f73c767d23a663a9859d97e", "/css/dist/skins/skin-red-dark.css": "/css/dist/skins/skin-red-dark.css?id=d6086232485d2b9661b7f83ed482355e",
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=87c6506e9aac3ebc68dfd99b6f983602", "/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=bdfc704731682c67645a2248b0b8d2d7",
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb", "/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb",
"/css/dist/skins/skin-green-dark.css": "/css/dist/skins/skin-green-dark.css?id=28b36223cf7b1d6e5f236859a4ef2b45", "/css/dist/skins/skin-green-dark.css": "/css/dist/skins/skin-green-dark.css?id=e36e83c2aa3c3afdbb8ebe2c0309e91d",
"/css/dist/skins/skin-green.css": "/css/dist/skins/skin-green.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", "/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-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/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=44bf834f2110504a793dadec132a5898",
"/css/dist/all.css": "/css/dist/all.css?id=41d8a74912c3b0d17cc508361530c597", "/css/dist/all.css": "/css/dist/all.css?id=999cf8c1432f7baff31b61a04a9a8485",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/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/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=e2e2b1797606a266ed55549f5bb5a179", "/css/webfonts/fa-brands-400.ttf": "/css/webfonts/fa-brands-400.ttf?id=e2e2b1797606a266ed55549f5bb5a179",
@ -34,18 +34,18 @@
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=a0e44dba789031b34ef150a01318b865", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=a0e44dba789031b34ef150a01318b865",
"/js/dist/all.js": "/js/dist/all.js?id=97b1034b75e3ac29a2eb9770d66c3370", "/js/dist/all.js": "/js/dist/all.js?id=97b1034b75e3ac29a2eb9770d66c3370",
"/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397", "/css/dist/skins/skin-green.min.css": "/css/dist/skins/skin-green.min.css?id=0a82a6ae6bb4e58fe62d162c4fb50397",
"/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=28b36223cf7b1d6e5f236859a4ef2b45", "/css/dist/skins/skin-green-dark.min.css": "/css/dist/skins/skin-green-dark.min.css?id=e36e83c2aa3c3afdbb8ebe2c0309e91d",
"/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=76482123f6c70e866d6b971ba91de7bb", "/css/dist/skins/skin-black.min.css": "/css/dist/skins/skin-black.min.css?id=76482123f6c70e866d6b971ba91de7bb",
"/css/dist/skins/skin-black-dark.min.css": "/css/dist/skins/skin-black-dark.min.css?id=87c6506e9aac3ebc68dfd99b6f983602", "/css/dist/skins/skin-black-dark.min.css": "/css/dist/skins/skin-black-dark.min.css?id=bdfc704731682c67645a2248b0b8d2d7",
"/css/dist/skins/skin-blue.min.css": "/css/dist/skins/skin-blue.min.css?id=f677207c6cf9678eb539abecb408c374", "/css/dist/skins/skin-blue.min.css": "/css/dist/skins/skin-blue.min.css?id=f677207c6cf9678eb539abecb408c374",
"/css/dist/skins/skin-blue-dark.min.css": "/css/dist/skins/skin-blue-dark.min.css?id=032f18fdd48936784cfcfe70712a68ae", "/css/dist/skins/skin-blue-dark.min.css": "/css/dist/skins/skin-blue-dark.min.css?id=07273f6ca3c698a39e8fc2075af4fa07",
"/css/dist/skins/skin-yellow.min.css": "/css/dist/skins/skin-yellow.min.css?id=7b315b9612b8fde8f9c5b0ddb6bba690", "/css/dist/skins/skin-yellow.min.css": "/css/dist/skins/skin-yellow.min.css?id=7b315b9612b8fde8f9c5b0ddb6bba690",
"/css/dist/skins/skin-yellow-dark.min.css": "/css/dist/skins/skin-yellow-dark.min.css?id=e5b6ec4691d8fd647d38722886f983e6", "/css/dist/skins/skin-yellow-dark.min.css": "/css/dist/skins/skin-yellow-dark.min.css?id=7c4badf178b44a4489dac90c0f772908",
"/css/dist/skins/skin-red.min.css": "/css/dist/skins/skin-red.min.css?id=44bf834f2110504a793dadec132a5898", "/css/dist/skins/skin-red.min.css": "/css/dist/skins/skin-red.min.css?id=44bf834f2110504a793dadec132a5898",
"/css/dist/skins/skin-red-dark.min.css": "/css/dist/skins/skin-red-dark.min.css?id=218c6d947f73c767d23a663a9859d97e", "/css/dist/skins/skin-red-dark.min.css": "/css/dist/skins/skin-red-dark.min.css?id=d6086232485d2b9661b7f83ed482355e",
"/css/dist/skins/skin-purple.min.css": "/css/dist/skins/skin-purple.min.css?id=6fe68325d5356197672c27bc77cedcb4", "/css/dist/skins/skin-purple.min.css": "/css/dist/skins/skin-purple.min.css?id=6fe68325d5356197672c27bc77cedcb4",
"/css/dist/skins/skin-purple-dark.min.css": "/css/dist/skins/skin-purple-dark.min.css?id=7d92dea45d94be7e1d4e427c728d335d", "/css/dist/skins/skin-purple-dark.min.css": "/css/dist/skins/skin-purple-dark.min.css?id=7d92dea45d94be7e1d4e427c728d335d",
"/css/dist/skins/skin-orange.min.css": "/css/dist/skins/skin-orange.min.css?id=6f0563e726c2fe4fab4026daaa5bfdf2", "/css/dist/skins/skin-orange.min.css": "/css/dist/skins/skin-orange.min.css?id=6f0563e726c2fe4fab4026daaa5bfdf2",
"/css/dist/skins/skin-orange-dark.min.css": "/css/dist/skins/skin-orange-dark.min.css?id=ca38553d041220a4296dda555940e056", "/css/dist/skins/skin-orange-dark.min.css": "/css/dist/skins/skin-orange-dark.min.css?id=e6e53eef152bba01a4c666a4d8b01117",
"/css/dist/skins/skin-contrast.min.css": "/css/dist/skins/skin-contrast.min.css?id=da6c7997d9de2f8329142399f0ce50da" "/css/dist/skins/skin-contrast.min.css": "/css/dist/skins/skin-contrast.min.css?id=da6c7997d9de2f8329142399f0ce50da"
} }

View file

@ -195,6 +195,9 @@ a.accordion-header {
.btn-info.btn-outline { .btn-info.btn-outline {
color: #5bc0de; color: #5bc0de;
} }
.btn-warning{
background-color:#f39c12 !important;
}
.btn-warning.btn-outline { .btn-warning.btn-outline {
color: #f0ad4e; color: #f0ad4e;
@ -499,14 +502,14 @@ h4 {
background: #FFFFFF; background: #FFFFFF;
border-top: 1px solid #dddddd; border-top: 1px solid #dddddd;
display: table-row; display: table-row;
} }
.row-new-striped > .row:nth-of-type(odd) { .row-new-striped > .row:nth-of-type(odd) {
background-color: #F8F8F8; background-color: #F8F8F8;
border-top: 1px solid #dddddd; border-top: 1px solid #dddddd;
display: table-row; display: table-row;
} }
.row-new-striped div { .row-new-striped div {
@ -740,7 +743,7 @@ input[type="checkbox"] {
input[type="checkbox"]::before { input[type="checkbox"]::before {
/** If you want to use the non-checkbox, filled square, use this instead **/ /** If you want to use the non-checkbox, filled square, use this instead **/
content: ""; content: "";
width: 1em; width: 1em;
height: 1em; height: 1em;

View file

@ -135,6 +135,9 @@ a {
#ldapad_test_results.well.well-sm{ #ldapad_test_results.well.well-sm{
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color:#fff !important;
}
//pagination //pagination
.pagination > li >a{ .pagination > li >a{
color: var(--light-link); color: var(--light-link);
@ -147,6 +150,23 @@ a {
.pagination > .active > a:hover{ .pagination > .active > a:hover{
background-color: var(--hover-link); background-color: var(--hover-link);
} }
.tasks-menu > .dropdown-menu > li .menu > li > a:hover .progress{
background-color: var(--background);
}
a:hover > h2.task_menu{
color:var(--header);
}
h2.task_menu{
color:var(--link);
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu{
background-color:var(--back-main);
color:var(--link);
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu > li.header{
background-color:var(--header);
color:var(--link);
}
.main-header .navbar, .main-header .logo { .main-header .navbar, .main-header .logo {
background-color: var(--header); background-color: var(--header);

View file

@ -132,6 +132,9 @@ a {
#ldapad_test_results.well.well-sm{ #ldapad_test_results.well.well-sm{
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color:#fff !important;
}
//pagination //pagination
.pagination > li >a{ .pagination > li >a{
color: var(--light-link); color: var(--light-link);
@ -394,6 +397,12 @@ a {
color: var(--visited-link) color: var(--visited-link)
} }
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets']{
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;

View file

@ -131,6 +131,9 @@ a {
#ldapad_test_results.well.well-sm{ #ldapad_test_results.well.well-sm{
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color:#fff !important;
}
//pagination //pagination
.pagination > li >a{ .pagination > li >a{
color: var(--light-link); color: var(--light-link);
@ -180,10 +183,6 @@ h2.task_menu{
color: var(--text-main); color: var(--text-main);
} }
a:link {
color: var(--link);
}
.btn-primary.hover { .btn-primary.hover {
color: var(--nav-link); color: var(--nav-link);
} }
@ -385,6 +384,12 @@ a {
color: var(--visited-link) color: var(--visited-link)
} }
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets']{
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;

View file

@ -119,6 +119,9 @@ li.dropdown-item-marker {
#ldapad_test_results.well.well-sm{ #ldapad_test_results.well.well-sm{
color: var(--back-main); color: var(--back-main);
} }
a.actions {
color:#fff !important;
}
//pagination //pagination
.pagination > li >a{ .pagination > li >a{
color: var(--light-link); color: var(--light-link);
@ -378,6 +381,12 @@ input[type=text], input[type=search] {
.box-header.with-border { .box-header.with-border {
border-bottom: #000; border-bottom: #000;
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets']{
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;

View file

@ -58,8 +58,6 @@
} }
} }
.btn, .btn:hover { .btn, .btn:hover {
color: #fff; color: #fff;
@ -134,6 +132,7 @@ a {
#ldapad_test_results.well.well-sm{ #ldapad_test_results.well.well-sm{
color: var(--back-main); color: var(--back-main);
} }
//pagination //pagination
.pagination > li >a{ .pagination > li >a{
color: var(--light-link); color: var(--light-link);
@ -186,14 +185,12 @@ h2.task_menu{
a:link { a:link {
color: var(--link); color: var(--link);
} }
a:visited {
color: var(--nav-link);
}
a:hover { a:hover {
color: var(--hover-link); color: var(--hover-link);
} }
a:visited {
color: var(--nav-link);
}
.far fa-life-ring{ .far fa-life-ring{
color:var(--link); color:var(--link);
} }
@ -380,7 +377,6 @@ input[type=text], input[type=search] {
} }
.table-striped>tbody>tr:nth-of-type(even){ .table-striped>tbody>tr:nth-of-type(even){
background-color: var(--back-sub-alt); background-color: var(--back-sub-alt);
color: var(--text-alt);
} }
#webui>div>div>div>div>div>table>tbody>tr>td>a>i.fa, .box-body, .box-footer, .box-header { #webui>div>div>div>div>div>table>tbody>tr>td>a>i.fa, .box-body, .box-footer, .box-header {
color: var(--text-main); color: var(--text-main);
@ -394,16 +390,22 @@ a {
color: var(--link); color: var(--link);
&:link { &:link {
color: var(--link) } color: var(--nav-link);
}
&:hover { &:hover {
color: var(--hover-link); color: var(--nav-link);
text-decoration: underline; text-decoration: underline;
} }
&:visited { &:visited {
color: var(--visited-link) color: var(--nav-link);
} }
} }
#customFieldsTable a[href*='/models'] {
color: var(--back-sub);
}
#customFieldsTable a[href*='/fieldsets']{
background-color: transparent;
}
.row-striped { .row-striped {
vertical-align: top; vertical-align: top;
line-height: 2.6; line-height: 2.6;

View file

@ -52,7 +52,6 @@
} }
.btn, .btn:hover { .btn, .btn:hover {
color: #000;
&.btn-primary, .btn-primary:link { &.btn-primary, .btn-primary:link {
background-color: var(--button-default); background-color: var(--button-default);
@ -60,7 +59,6 @@
color: #545454; color: #545454;
} }
&a.btn-primary:hover { &a.btn-primary:hover {
background-color: var(--button-hover); background-color: var(--button-hover);
border-color: var(--button-hover); border-color: var(--button-hover);
@ -77,6 +75,9 @@
color: #545454; color: #545454;
} }
} }
a.actions {
color:#fff !important;
}
/** /**
The dropdown is white, so use a darker color The dropdown is white, so use a darker color
@ -165,7 +166,7 @@ a.btn.btn-default{
color:var(--nav-link); color:var(--nav-link);
} }
.bootstrap-table .fixed-table-container .table thead th .sortable { .bootstrap-table .fixed-table-container .table thead th .sortable {
color: var(--nav-link); color: var(--text-main);
} }
.bootstrap-table .fixed-table-toolbar .columns label { .bootstrap-table .fixed-table-toolbar .columns label {
color:#000; color:#000;
@ -355,12 +356,9 @@ input[type=text], input[type=search] {
.skin-yellow-dark .main-header .navbar .dropdown-menu li a { .skin-yellow-dark .main-header .navbar .dropdown-menu li a {
color: var(--header); color: var(--header);
} }
div.th-inner{ tr th div.th-inner {
color:var(--text-main); color:var(--text-main);
} }
.fixed-table-body thead th .th-inner, .skin-yellow-dark, .skin-yellow {
background-color: var(--header)!important;
}
.tab-content, .tab-pane { .tab-content, .tab-pane {
background-color: var(--back-main); background-color: var(--back-main);
color: var(--text-main); color: var(--text-main);

View file

@ -17,5 +17,6 @@ return array(
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.', 'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.', 'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
'clone' => 'Clone Accessory', 'clone' => 'Clone Accessory',
'delete_disabled' => 'This accessory cannot be deleted yet because some items are still checked out.',
); );

View file

@ -49,4 +49,6 @@ return [
'unique' => 'Unique', 'unique' => 'Unique',
'display_in_user_view' => 'Allow the checked out user to view these values in their View Assigned Assets page', 'display_in_user_view' => 'Allow the checked out user to view these values in their View Assigned Assets page',
'display_in_user_view_table' => 'Visible to User', 'display_in_user_view_table' => 'Visible to User',
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
]; ];

View file

@ -8,6 +8,7 @@ return [
'change' => 'In/Out', 'change' => 'In/Out',
'checkout_date' => 'Checkout Date', 'checkout_date' => 'Checkout Date',
'checkoutto' => 'Checked Out', 'checkoutto' => 'Checked Out',
'components_cost' => 'Total Components Cost',
'current_value' => 'Current Value', 'current_value' => 'Current Value',
'diff' => 'Diff', 'diff' => 'Diff',
'dl_csv' => 'Download CSV', 'dl_csv' => 'Download CSV',

View file

@ -2,6 +2,7 @@
return array( return array(
'support_url_help' => 'Use <code>{LOCALE}</code> and <code>{SERIAL}</code> in your URL as variables to have those values auto-populate when viewing assets.',
'does_not_exist' => 'Manufacturer does not exist.', 'does_not_exist' => 'Manufacturer does not exist.',
'assoc_users' => 'This manufacturer is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this manufacturer and try again. ', 'assoc_users' => 'This manufacturer is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this manufacturer and try again. ',

View file

@ -10,6 +10,7 @@ return array(
'support_email' => 'Support Email', 'support_email' => 'Support Email',
'support_phone' => 'Support Phone', 'support_phone' => 'Support Phone',
'support_url' => 'Support URL', 'support_url' => 'Support URL',
'warranty_lookup_url' => 'Warranty Lookup URL',
'update' => 'Update Manufacturer', 'update' => 'Update Manufacturer',
'url' => 'URL', 'url' => 'URL',

View file

@ -330,4 +330,9 @@ return [
'setup_migration_create_user' => 'Next: Create User', 'setup_migration_create_user' => 'Next: Create User',
'ldap_settings_link' => 'LDAP Settings Page', 'ldap_settings_link' => 'LDAP Settings Page',
'slack_test' => 'Test <i class="fab fa-slack"></i> Integration', 'slack_test' => 'Test <i class="fab fa-slack"></i> Integration',
'google_callback_help' => 'This should be entered as the callback URL in your Google OAuth app settings in your organization&apos;s <strong><a href="https://console.cloud.google.com/" target="_blank">Google developer console <i class="fa fa-external-link" aria-hidden="true"></i></a></strong>.',
'google_login' => 'Google Workspace Login Settings',
'enable_google_login' => 'Enable users to login with Google Workspace',
'enable_google_login_help' => 'Users will not be automatically provisioned. They must have an existing account here AND in Google Workspace, and their username here must match their Google Workspace email address. ',
]; ];

View file

@ -12,5 +12,8 @@ return [
'remember_me' => 'Remember Me', 'remember_me' => 'Remember Me',
'username_help_top' => 'Enter your <strong>username</strong> to be emailed a password reset link.', 'username_help_top' => 'Enter your <strong>username</strong> to be emailed a password reset link.',
'username_help_bottom' => 'Your username and email address <em>may</em> be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator. <br><br><strong>Usernames without an associated email address will not be emailed a password reset link.</strong> ', 'username_help_bottom' => 'Your username and email address <em>may</em> be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator. <br><br><strong>Usernames without an associated email address will not be emailed a password reset link.</strong> ',
]; 'google_login' => 'Or login with Google Workspace',
'google_login_failed' => 'Google Login failed, please try again.',
];

View file

@ -91,6 +91,8 @@ return [
'debug_warning' => 'Warning!', 'debug_warning' => 'Warning!',
'debug_warning_text' => 'This application is running in production mode with debugging enabled. This can expose sensitive data if your application is accessible to the outside world. Disable debug mode by setting the <code>APP_DEBUG</code> value in your <code>.env</code> file to <code>false</code>.', 'debug_warning_text' => 'This application is running in production mode with debugging enabled. This can expose sensitive data if your application is accessible to the outside world. Disable debug mode by setting the <code>APP_DEBUG</code> value in your <code>.env</code> file to <code>false</code>.',
'delete' => 'Delete', 'delete' => 'Delete',
'delete_confirm' => 'Are you sure you wish to delete :item?',
'delete_confirm_no_undo' => 'Are you sure you wish to delete :item? This can not be undone.',
'deleted' => 'Deleted', 'deleted' => 'Deleted',
'delete_seats' => 'Deleted Seats', 'delete_seats' => 'Deleted Seats',
'deletion_failed' => 'Deletion failed', 'deletion_failed' => 'Deletion failed',

View file

@ -67,6 +67,8 @@ return [
'array' => 'The :attribute must have at least :min items.', 'array' => 'The :attribute must have at least :min items.',
], ],
'starts_with' => 'The :attribute must start with one of the following: :values.', 'starts_with' => 'The :attribute must start with one of the following: :values.',
'ends_with' => 'The :attribute must end with one of the following: :values.',
'not_in' => 'The selected :attribute is invalid.', 'not_in' => 'The selected :attribute is invalid.',
'numeric' => 'The :attribute must be a number.', 'numeric' => 'The :attribute must be a number.',
'present' => 'The :attribute field must be present.', 'present' => 'The :attribute field must be present.',

View file

@ -12,43 +12,6 @@
@parent @parent
@stop @stop
{{-- Right header --}}
@section('header_right')
@can('manage', \App\Models\Accessory::class)
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{{ trans('button.actions') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
@if ($accessory->assigned_to != '')
@can('checkin', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('accessories.checkin.show', $accessory->id) }}">{{ trans('admin/accessories/general.checkin') }}</a>
</li>
@endcan
@else
@can('checkout', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('accessories.checkout.show', $accessory->id) }}">{{ trans('admin/accessories/general.checkout') }}</a>
</li>
@endcan
@endif
@can('update', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('accessories.edit', $accessory->id) }}">{{ trans('admin/accessories/general.edit') }}</a>
</li>
@endcan
@can('update', \App\Models\Accessory::class)
<li role="menuitem">
<a href="{{ route('clone/accessories', $accessory->id) }}">{{ trans('admin/accessories/general.clone') }}</a>
</li>
@endcan
</ul>
</div>
@endcan
@stop
{{-- Page content --}} {{-- Page content --}}
@section('content') @section('content')
{{-- Page content --}} {{-- Page content --}}
@ -136,7 +99,7 @@
</div> </div>
</div> </div>
<!-- histor tab pane --> <!-- history tab pane -->
<div class="tab-pane fade" id="history"> <div class="tab-pane fade" id="history">
<div class="table table-responsive"> <div class="table table-responsive">
<div class="row"> <div class="row">
@ -271,13 +234,13 @@
</table> </table>
</div> </div>
</div> </div>
</div>
</div> <!-- /.tab-pane -->
@endcan
</div>
</div> </div>
</div> </div> <!-- /.tab-pane -->
@endcan
</div>
</div>
</div>
<!-- side address column --> <!-- side address column -->
@ -294,10 +257,10 @@
@if ($accessory->company) @if ($accessory->company)
<div class="row"> <div class="row">
<div class="col-md-4" style="padding-bottom: 15px;"> <div class="col-md-3" style="padding-bottom: 15px;">
<strong> {{ trans('general.company')}}</strong> <strong> {{ trans('general.company')}}</strong>
</div> </div>
<div class="col-md-8"> <div class="col-md-9">
<a href="{{ route('companies.show', $accessory->company->id) }}">{{ $accessory->company->name }} </a> <a href="{{ route('companies.show', $accessory->company->id) }}">{{ $accessory->company->name }} </a>
</div> </div>
</div> </div>
@ -306,10 +269,10 @@
@if ($accessory->category) @if ($accessory->category)
<div class="row"> <div class="row">
<div class="col-md-4" style="padding-bottom: 15px;"> <div class="col-md-3" style="padding-bottom: 10px;">
<strong>{{ trans('general.category')}}</strong> <strong>{{ trans('general.category')}}</strong>
</div> </div>
<div class="col-md-8"> <div class="col-md-9">
<a href="{{ route('categories.show', $accessory->category->id) }}">{{ $accessory->category->name }} </a> <a href="{{ route('categories.show', $accessory->category->id) }}">{{ $accessory->category->name }} </a>
</div> </div>
</div> </div>
@ -317,88 +280,75 @@
@if ($accessory->notes) @if ($accessory->notes)
<div class="row">
<div class="col-md-12"> <div class="col-md-3" style="padding-bottom: 10px;">
<strong> <strong>
{{ trans('general.notes') }} {{ trans('general.notes') }}
</strong> </strong>
</div> </div>
<div class="col-md-12"> <div class="col-md-9">
{!! nl2br(e($accessory->notes)) !!} {!! nl2br(e($accessory->notes)) !!}
</div> </div>
</div>
@endif @endif
<div class="row"> <div class="row">
<div class="col-md-4" style="padding-bottom: 15px;"> <div class="col-md-3" style="padding-bottom: 10px;">
<strong>{{ trans('admin/accessories/general.remaining') }}</strong> <strong>{{ trans('admin/accessories/general.remaining') }}</strong>
</div> </div>
<div class="col-md-8"> <div class="col-md-9">
{{ $accessory->numRemaining() }} {{ $accessory->numRemaining() }}
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4" style="padding-bottom: 15px;"> <div class="col-md-3" style="padding-bottom: 10px;">
<strong>{{ trans('general.checked_out') }}</strong> <strong>{{ trans('general.checked_out') }}</strong>
</div> </div>
<div class="col-md-8"> <div class="col-md-9">
{{ $accessory->users_count }} {{ $accessory->users_count }}
</div> </div>
</div> </div>
</div>
<div class="col-md-3 pull-right">
@can('checkout', \App\Models\Accessory::class)
<div class="text-center" style="padding-top:5px;">
<a href="{{ route('accessories.checkout.show', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
</div>
@endcan
@can('update', \App\Models\Accessory::class)
<div class="text-center" style="padding-top:5px;">
<a href="{{ route('accessories.edit', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm">{{ trans('admin/accessories/general.edit') }}</a>
</div>
@endcan
@can('update', \App\Models\Accessory::class)
<div class="text-center" style="padding-top:5px;">
<a href="{{ route('clone/accessories', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm">{{ trans('admin/accessories/general.clone') }}</a>
</div>
@endcan
@can('delete', $accessory)
@can('checkout', \App\Models\Accessory::class) @if ($accessory->users_count == 0)
<div class="row"> <div class="text-center" style="padding-top:5px;">
<div class="col-md-12 text-center"> <button class="btn btn-block btn-danger delete-asset" style="padding-top:5px;" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm_no_undo', ['item' => $accessory->name]) }}" data-target="#dataConfirmModal">
<a href="{{ route('accessories.checkout.show', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a> {{ trans('general.delete') }}
</div> </button>
</div> </div>
@endcan @else
<div class="text-center" style="padding-top:5px;">
<span data-tooltip="true" title=" {{ trans('admin/accessories/general.delete_disabled') }}">
<div class="tab-pane fade" id="history"> <a href="#" class="btn btn-block btn-danger disabled">
<div class="row"> {{ trans('general.delete') }}
<div class="col-md-12"> </a>
<table </span>
class="table table-striped snipe-table" </div>
data-cookie-id-table="AccessoryHistoryTable" @endif
data-id-table="AccessoryHistoryTable" @endcan
id="AccessoryHistoryTable" </div>
data-pagination="true" </div>
data-show-columns="true"
data-side-pagination="server"
data-show-refresh="true"
data-show-export="true"
data-sort-order="desc"
data-export-options='{
"fileName": "export-{{ str_slug($accessory->name) }}-history-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-url="{{ route('api.activity.index', ['item_id' => $accessory->id, 'item_type' => 'accessory']) }}">
<thead>
<tr>
<th class="col-sm-2" data-visible="false" data-sortable="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.record_created') }}</th>
<th class="col-sm-2"data-visible="true" data-sortable="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
<th class="col-sm-2" data-sortable="true" 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-sortable="true" data-visible="true" data-field="note">{{ trans('general.notes') }}</th>
<th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
@if ($snipeSettings->require_accept_signature=='1')
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
@endif
</tr>
</thead>
</table>
</div> <!-- /.col-md-12-->
</div> <!-- /.row-->
</div><!--tab history-->
</div><!--col-md-3-->
</div><!--row-->
@ -411,5 +361,13 @@
@section('moar_scripts') @section('moar_scripts')
<script>
$('#dataConfirmModal').on('show.bs.modal', function (event) {
var content = $(event.relatedTarget).data('content');
var title = $(event.relatedTarget).data('title');
$(this).find(".modal-body").text(content);
$(this).find(".modal-header").text(title);
});
</script>
@include ('partials.bootstrap-table') @include ('partials.bootstrap-table')
@stop @stop

View file

@ -64,7 +64,7 @@
</div> <!-- end row --> </div> <!-- end row -->
@if (!config('app.require_saml') && $snipeSettings->saml_enabled) @if (!config('app.require_saml') && $snipeSettings->saml_enabled)
<div class="row "> <div class="row">
<div class="text-right col-md-12"> <div class="text-right col-md-12">
<a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a> <a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
</div> </div>
@ -73,22 +73,32 @@
</div> </div>
<div class="box-footer"> <div class="box-footer">
@if (config('app.require_saml')) @if (config('app.require_saml'))
<a class="btn btn-lg btn-primary btn-block" href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a> <a class="btn btn-primary btn-block" href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
@else @else
<button class="btn btn-lg btn-primary btn-block">{{ trans('auth/general.login') }}</button> <button class="btn btn-primary btn-block">{{ trans('auth/general.login') }}</button>
@endif @endif
</div>
<div class="text-right col-md-12 col-sm-12 col-xs-12" style="padding-top: 10px;">
@if ($snipeSettings->custom_forgot_pass_url) @if ($snipeSettings->custom_forgot_pass_url)
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">{{ trans('auth/general.forgot_password') }}</a> <div class="col-md-12 text-right" style="padding-top: 15px;">
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">{{ trans('auth/general.forgot_password') }}</a>
</div>
@elseif (!config('app.require_saml')) @elseif (!config('app.require_saml'))
<a href="{{ route('password.request') }}">{{ trans('auth/general.forgot_password') }}</a> <div class="col-md-12 text-right" style="padding-top: 15px;">
<a href="{{ route('password.request') }}">{{ trans('auth/general.forgot_password') }}</a>
</div>
@endif @endif
</div> </div>
</div> <!-- end login box --> </div> <!-- end login box -->
@if (($snipeSettings->google_login=='1') && ($snipeSettings->google_client_id!='') && ($snipeSettings->google_client_secret!=''))
<a href="{{ route('google.redirect') }}" class="btn btn-block btn-social btn-google">
<i class="fa-brands fa-google"></i> {{ trans('auth/general.google_login') }}
</a>
@endif
</div> <!-- col-md-4 --> </div> <!-- col-md-4 -->
</div> <!-- end row --> </div> <!-- end row -->

View file

@ -1,8 +1,8 @@
@php @extends('layouts/default', [
use App\Models\CustomField; 'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'),
@endphp 'helpPosition' => 'right',
])
@extends('layouts/default')
{{-- Page title --}} {{-- Page title --}}
@section('title') @section('title')
@ -21,24 +21,31 @@
{{-- Page content --}} {{-- Page content --}}
@section('content') @section('content')
<div class="row">
<div class="col-md-9">
<!-- Horizontal Form --> <!-- Horizontal Form -->
@if ($field->id) @if ($field->id)
{{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }} {{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }}
{{ method_field('PUT') }} {{ method_field('PUT') }}
@else @else
{{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }} {{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }}
@endif @endif
@csrf
<div class="row">
<div class="col-md-12">
<div class="box box-default"> <div class="box box-default">
<div class="box-header with-border text-right">
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
</div>
<div class="box-body"> <div class="box-body">
<div class="col-md-8">
<!-- Name --> <!-- Name -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-4 control-label"> <label for="name" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_name') }} {{ trans('admin/custom_fields/general.field_name') }}
</label> </label>
<div class="col-md-6 required"> <div class="col-md-8 required">
{{ Form::text('name', old('name', $field->name), array('class' => 'form-control', 'aria-label'=>'name')) }} {{ Form::text('name', old('name', $field->name), array('class' => 'form-control', 'aria-label'=>'name')) }}
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
@ -46,10 +53,10 @@
<!-- Element Type --> <!-- Element Type -->
<div class="form-group {{ $errors->has('element') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('element') ? ' has-error' : '' }}">
<label for="element" class="col-md-4 control-label"> <label for="element" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_element') }} {{ trans('admin/custom_fields/general.field_element') }}
</label> </label>
<div class="col-md-6 required"> <div class="col-md-8 required">
{!! Form::customfield_elements('element', old('element', $field->element), 'field_element select2 form-control') !!} {!! Form::customfield_elements('element', old('element', $field->element), 'field_element select2 form-control') !!}
{!! $errors->first('element', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('element', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
@ -59,10 +66,10 @@
<!-- Element values --> <!-- Element values -->
<div class="form-group {{ $errors->has('field_values') ? ' has-error' : '' }}" id="field_values_text" style="display:none;"> <div class="form-group {{ $errors->has('field_values') ? ' has-error' : '' }}" id="field_values_text" style="display:none;">
<label for="field_values" class="col-md-4 control-label"> <label for="field_values" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_values') }} {{ trans('admin/custom_fields/general.field_values') }}
</label> </label>
<div class="col-md-6 required"> <div class="col-md-8 required">
{!! Form::textarea('field_values', old('name', $field->field_values), ['style' => 'width: 100%', 'rows' => 4, 'class' => 'form-control', 'aria-label'=>'field_values']) !!} {!! Form::textarea('field_values', old('name', $field->field_values), ['style' => 'width: 100%', 'rows' => 4, 'class' => 'form-control', 'aria-label'=>'field_values']) !!}
{!! $errors->first('field_values', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('field_values', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block">{{ trans('admin/custom_fields/general.field_values_help') }}</p> <p class="help-block">{{ trans('admin/custom_fields/general.field_values_help') }}</p>
@ -71,7 +78,7 @@
<!-- Format --> <!-- Format -->
<div class="form-group {{ $errors->has('format') ? ' has-error' : '' }}" id="format_values"> <div class="form-group {{ $errors->has('format') ? ' has-error' : '' }}" id="format_values">
<label for="format" class="col-md-4 control-label"> <label for="format" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_format') }} {{ trans('admin/custom_fields/general.field_format') }}
</label> </label>
@php @php
@ -80,17 +87,17 @@
$field_format = 'CUSTOM REGEX'; $field_format = 'CUSTOM REGEX';
} }
@endphp @endphp
<div class="col-md-6 required"> <div class="col-md-8 required">
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }} {{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format')) }}
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>
<!-- Custom Format --> <!-- Custom Format -->
<div class="form-group {{ $errors->has('custom_format') ? ' has-error' : '' }}" id="custom_regex" style="display:none;"> <div class="form-group {{ $errors->has('custom_format') ? ' has-error' : '' }}" id="custom_regex" style="display:none;">
<label for="custom_format" class="col-md-4 control-label"> <label for="custom_format" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.field_custom_format') }} {{ trans('admin/custom_fields/general.field_custom_format') }}
</label> </label>
<div class="col-md-6 required"> <div class="col-md-8 required">
{{ Form::text('custom_format', old('custom_format', (($field->format!='') && (stripos($field->format,'regex')===0)) ? $field->format : ''), array('class' => 'form-control', 'id' => 'custom_format','aria-label'=>'custom_format', 'placeholder'=>'regex:/^[0-9]{15}$/')) }} {{ Form::text('custom_format', old('custom_format', (($field->format!='') && (stripos($field->format,'regex')===0)) ? $field->format : ''), array('class' => 'form-control', 'id' => 'custom_format','aria-label'=>'custom_format', 'placeholder'=>'regex:/^[0-9]{15}$/')) }}
<p class="help-block">{!! trans('admin/custom_fields/general.field_custom_format_help') !!}</p> <p class="help-block">{!! trans('admin/custom_fields/general.field_custom_format_help') !!}</p>
@ -101,68 +108,111 @@
<!-- Help Text --> <!-- Help Text -->
<div class="form-group {{ $errors->has('help_text') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('help_text') ? ' has-error' : '' }}">
<label for="help_text" class="col-md-4 control-label"> <label for="help_text" class="col-md-3 control-label">
{{ trans('admin/custom_fields/general.help_text') }} {{ trans('admin/custom_fields/general.help_text') }}
</label> </label>
<div class="col-md-6"> <div class="col-md-8">
{{ Form::text('help_text', old('help_text', $field->help_text), array('class' => 'form-control', 'aria-label'=>'help_text')) }} {{ Form::text('help_text', old('help_text', $field->help_text), array('class' => 'form-control', 'aria-label'=>'help_text')) }}
<p class="help-block">{{ trans('admin/custom_fields/general.help_text_description') }}</p> <p class="help-block">{{ trans('admin/custom_fields/general.help_text_description') }}</p>
{!! $errors->first('help_text', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('help_text', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>
@if (!$field->id) <!-- Auto-Add to Future Fieldsets -->
<div class="form-group {{ $errors->has('auto_add_to_fieldsets') ? ' has-error' : '' }}" id="auto_add_to_fieldsets">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="auto_add_to_fieldsets" aria-label="auto_add_to_fieldsets" value="1"{{ (old('auto_add_to_fieldsets') || $field->auto_add_to_fieldsets) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.auto_add_to_fieldsets') }}
</label>
</div>
@if (!$field->id)
<!-- Encrypted --> <!-- Encrypted -->
<div class="form-group {{ $errors->has('encrypted') ? ' has-error' : '' }}"> <div class="col-md-9 col-md-offset-3">
<div class="col-md-8 col-md-offset-4">
<label class="form-control"> <label class="form-control">
<input type="checkbox" value="1" name="field_encrypted" id="field_encrypted"{{ (Request::old('field_encrypted') || $field->field_encrypted) ? ' checked="checked"' : '' }}> <input type="checkbox" value="1" name="field_encrypted" id="field_encrypted"{{ (Request::old('field_encrypted') || $field->field_encrypted) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.encrypt_field') }} {{ trans('admin/custom_fields/general.encrypt_field') }}
</label> </label>
</div> </div>
<div class="col-md-6 col-md-offset-4" id="encrypt_warning" style="display:none;">
<div class="col-md-9 col-md-offset-3" id="encrypt_warning" style="display:none;">
<div class="callout callout-danger"> <div class="callout callout-danger">
<p><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.encrypt_field_help') }}</p> <p><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.encrypt_field_help') }}</p>
</div> </div>
</div> </div>
</div> @endif
@endif
<!-- Show in Email --> <!-- Show in Email -->
<div class="form-group {{ $errors->has('show_in_email') ? ' has-error' : '' }}" id="show_in_email"> <div class="col-md-9 col-md-offset-3">
<div class="col-md-8 col-md-offset-4">
<label class="form-control"> <label class="form-control">
<input type="checkbox" name="show_in_email" aria-label="show_in_email" value="1"{{ (old('show_in_email') || $field->show_in_email) ? ' checked="checked"' : '' }}> <input type="checkbox" name="show_in_email" aria-label="show_in_email" value="1"{{ (old('show_in_email') || $field->show_in_email) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.show_in_email') }} {{ trans('admin/custom_fields/general.show_in_email') }}
</label> </label>
</div> </div>
</div> <!-- Show in View All Assets profile view -->
<div class="col-md-9 col-md-offset-3">
<!-- Show in View All Assets profile view -->
<div class="form-group {{ $errors->has('display_in_user_view') ? ' has-error' : '' }}" id="display_in_user_view">
<div class="col-md-8 col-md-offset-4">
<label class="form-control"> <label class="form-control">
<input type="checkbox" name="display_in_user_view" aria-label="display_in_user_view" value="1" {{ (old('display_in_user_view') || $field->display_in_user_view) ? ' checked="checked"' : '' }}> <input type="checkbox" name="display_in_user_view" aria-label="display_in_user_view" value="1" {{ (old('display_in_user_view') || $field->display_in_user_view) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.display_in_user_view') }} {{ trans('admin/custom_fields/general.display_in_user_view') }}
</label> </label>
</div> </div>
<!-- Value Must be Unique -->
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" name="is_unique" aria-label="is_unique" value="1"{{ (old('is_unique') || $field->is_unique) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.is_unique') }}
</label>
</div>
</div> </div>
<!-- Value Must be Unique --> </div>
<div class="form-group {{ $errors->has('is_unique') ? ' has-error' : '' }}" id="is_unique">
<div class="col-md-8 col-md-offset-4">
<label class="form-control">
<input type="checkbox" name="is_unique" aria-label="is_unique" value="1"{{ (old('is_unique') || $field->is_unique) ? ' checked="checked"' : '' }}>
{{ trans('admin/custom_fields/general.is_unique') }}
</label>
</div>
</div> @if ($fieldsets->count() > 0)
<!-- begin fieldset columns -->
<div class="col-md-4">
<h4>{{ trans('admin/custom_fields/general.fieldsets') }}</h4>
{!! $errors->first('associate_fieldsets', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<label class="form-control">
<input type="checkbox" id="checkAll">
{{ trans('general.select_all') }}
</label>
@foreach ($fieldsets as $fieldset)
@php
$array_fieldname = 'associate_fieldsets.'.$fieldset->id;
// Consider the form data first
if (old($array_fieldname) == $fieldset->id) {
$checked = 'checked';
// Otherwise check DB
} elseif (isset($field->fieldset) && ($field->fieldset->contains($fieldset->id))) {
$checked = 'checked';
} else {
$checked = '';
}
@endphp
<label class="form-control{{ $errors->has('associate_fieldsets.'.$fieldset->id) ? ' has-error' : '' }}">
<input type="checkbox"
name="associate_fieldsets[{{ $fieldset->id }}]"
class="fieldset"
value="{{ $fieldset->id }}"
{{ $checked }}>
{{ $fieldset->name }}
{!! $errors->first('associate_fieldsets.'.$fieldset->id, '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</label>
@endforeach
</div>
@endif
</div> <!-- /.box-body--> </div> <!-- /.box-body-->
<div class="box-footer text-right"> <div class="box-footer text-right">
@ -171,20 +221,22 @@
</div> <!--.box.box-default--> </div> <!--.box.box-default-->
{{ Form::close() }}
</div> <!--/.col-md-9--> </div> <!--/.col-md-9-->
<div class="col-md-3">
<h2>{{ trans('admin/custom_fields/general.about_custom_fields_title') }}</h2>
<p>{{ trans('admin/custom_fields/general.about_custom_fields_text') }}</p>
</div>
</div> </div>
{{ Form::close() }}
@stop @stop
@section('moar_scripts') @section('moar_scripts')
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
$(document).ready(function(){ $(document).ready(function(){
$("#checkAll").change(function () {
$(".fieldset").prop('checked', $(this).prop("checked"));
});
// Only display the custom format field if it's a custom format validation type // Only display the custom format field if it's a custom format validation type
$(".format").change(function(){ $(".format").change(function(){
$(this).find("option:selected").each(function(){ $(this).find("option:selected").each(function(){

View file

@ -178,26 +178,29 @@
</td> </td>
<td> <td>
<nobr> <nobr>
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
@can('update', $field) @can('update', $field)
<a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm"> <a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm">
<i class="fas fa-pencil-alt" aria-hidden="true"></i> <i class="fas fa-pencil-alt" aria-hidden="true"></i>
<span class="sr-only">{{ trans('button.edit') }}</span> <span class="sr-only">{{ trans('button.edit') }}</span>
</a> </a>
@endcan @endcan
@can('delete', $field) @can('delete', $field)
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
@if($field->fieldset->count()>0) @if($field->fieldset->count()>0)
<button type="submit" class="btn btn-danger btn-sm disabled" disabled> <button type="submit" class="btn btn-danger btn-sm disabled" disabled>
<i class="fas fa-trash" aria-hidden="true"></i> <i class="fas fa-trash" aria-hidden="true"></i>
<span class="sr-only">{{ trans('button.delete') }}</span></button> <span class="sr-only">{{ trans('button.delete') }}</span></button>
@else @else
<button type="submit" class="btn btn-danger btn-sm"> <button type="submit" class="btn btn-danger btn-sm">
<i class="fas fa-trash" aria-hidden="true"></i> <i class="fas fa-trash" aria-hidden="true"></i>
<span class="sr-only">{{ trans('button.delete') }}</span> <span class="sr-only">{{ trans('button.delete') }}</span>
</button> </button>
@endif @endif
{{ Form::close() }}
@endcan @endcan
{{ Form::close() }}
</nobr> </nobr>
</td> </td>
</tr> </tr>

View file

@ -469,6 +469,25 @@
</div> </div>
</div> </div>
@endif @endif
@if(($asset->components->count() > 0) && ($asset->purchase_cost))
<div class="row">
<div class="col-md-2">
<strong>
{{ trans('admin/hardware/table.components_cost') }}
</strong>
</div>
<div class="col-md-6">
@if (($asset->id) && ($asset->location))
{{ $asset->location->currency }}
@elseif (($asset->id) && ($asset->location))
{{ $asset->location->currency }}
@else
{{ $snipeSettings->default_currency }}
@endif
{{Helper::formatCurrencyOutput($asset->getComponentCost())}}
</div>
</div>
@endif
@if (($asset->model) && ($asset->depreciation) && ($asset->purchase_date)) @if (($asset->model) && ($asset->depreciation) && ($asset->purchase_date))
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
@ -534,20 +553,10 @@
{{ $asset->warranty_months }} {{ $asset->warranty_months }}
{{ trans('admin/hardware/form.months') }} {{ trans('admin/hardware/form.months') }}
@if ($asset->serial && $asset->model->manufacturer) @if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!=''))
@if ((strtolower($asset->model->manufacturer->name) == "apple") || (str_starts_with(str_replace(' ','',strtolower($asset->model->manufacturer->name)),"appleinc"))) <a href="{{ $asset->present()->dynamicWarrantyUrl() }}" target="_blank">
<a href="https://checkcoverage.apple.com/?locale={{ (str_replace('-','_',\App\Models\Setting::getSettings()->locale)) }}" target="_blank"> <i class="fa fa-external-link" aria-hidden="true"><span class="sr-only">{{ trans('admin/hardware/general.mfg_warranty_lookup', ['manufacturer' => $asset->model->manufacturer->name]) }}</span></i>
<i class="fa-brands fa-apple" aria-hidden="true"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i>
</a> </a>
@elseif ((strtolower($asset->model->manufacturer->name) == "dell") || (str_starts_with(str_replace(' ','',strtolower($asset->model->manufacturer->name)),"dellinc")))
<a href="https://www.dell.com/support/home/en-us?app=warranty" target="_blank">
<img src="/img/demo/manufacturers/dellicon.png" style="width:25px;height:25px;"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i>
</a>
@elseif ((strtolower($asset->model->manufacturer->name) == "lenovo") || (str_starts_with(str_replace(' ','',strtolower($asset->model->manufacturer->name)),"lenovoinc")))
<a href="https://pcsupport.lenovo.com/us/en/warrantylookup#/" target="_blank">
<img src="/img/demo/manufacturers/lenovoicon.png" style="width:25px;height:25px;"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i>
</a>
@endif
@endif @endif
</div> </div>
</div> </div>
@ -1152,17 +1161,15 @@
data-cookie="true"> data-cookie="true">
<thead> <thead>
<tr> <tr>
<th data-visible="true" style="width: 40px;" class="hidden-xs">{{ trans('admin/hardware/table.icon') }}</th> <th data-visible="true" data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter">{{ trans('admin/hardware/table.icon') }}</th>
<th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th> <th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
<th class="col-sm-1" data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th> <th class="col-sm-1" data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
<th class="col-sm-1" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th> <th class="col-sm-1" data-visible="true" data-field="action_type">{{ trans('general.action') }}</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="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-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th> <th class="col-md-3" data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</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-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>

View file

@ -30,6 +30,17 @@
</div> </div>
</div> </div>
<!-- Warranty Lookup URL -->
<div class="form-group {{ $errors->has('warranty_lookup_url') ? ' has-error' : '' }}">
<label for="support_url" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.warranty_lookup_url') }}
</label>
<div class="col-md-6">
<input class="form-control" type="text" name="warranty_lookup_url" id="warranty_lookup_url" value="{{ old('warranty_lookup_url', $item->warranty_lookup_url) }}" />
<p class="help-block">{!! trans('admin/manufacturers/message.support_url_help') !!}</p>
{!! $errors->first('warranty_lookup_url', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Support Phone --> <!-- Support Phone -->
<div class="form-group {{ $errors->has('support_phone') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('support_phone') ? ' has-error' : '' }}">
<label for="support_phone" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_phone') }} <label for="support_phone" class="col-md-3 control-label">{{ trans('admin/manufacturers/table.support_phone') }}

View file

@ -11,7 +11,7 @@
| **{{ ucfirst(trans('general.accepted')) }}** | {{ $accepted_date }} | | **{{ ucfirst(trans('general.accepted')) }}** | {{ $accepted_date }} |
@endif @endif
@if (isset($declined_date)) @if (isset($declined_date))
| **{{ trans('general.declined') }}** | {{ $declined_date }} | | **{{ ucfirst(trans('general.declined')) }}** | {{ $declined_date }} |
@endif @endif
@if ((isset($item_tag)) && ($item_tag!='')) @if ((isset($item_tag)) && ($item_tag!=''))
| **{{ trans('mail.asset_tag') }}** | {{ $item_tag }} | | **{{ trans('mail.asset_tag') }}** | {{ $item_tag }} |

View file

@ -261,20 +261,27 @@
} }
if ((row.available_actions) && (row.available_actions.clone === true)) { if ((row.available_actions) && (row.available_actions.clone === true)) {
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/clone" class="btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a>&nbsp;'; actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/clone" class="actions btn btn-sm btn-info" data-tooltip="true" title="{{ trans('general.clone_item') }}"><i class="far fa-clone" aria-hidden="true"></i><span class="sr-only">Clone</span></a>&nbsp;';
} }
if ((row.available_actions) && (row.available_actions.update === true)) { if ((row.available_actions) && (row.available_actions.update === true)) {
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a>&nbsp;'; actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '/edit" class="actions btn btn-sm btn-warning" data-tooltip="true" title="{{ trans('general.update') }}"><i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span></a>&nbsp;';
} }
if ((row.available_actions) && (row.available_actions.delete === true)) { if ((row.available_actions) && (row.available_actions.delete === true)) {
// use the asset tag if no name is provided
var name_for_box = row.name
if (row.name=='') {
var name_for_box = row.asset_tag
}
actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '" ' actions += '<a href="{{ config('app.url') }}/' + dest + '/' + row.id + '" '
+ ' class="btn btn-danger btn-sm delete-asset" data-tooltip="true" ' + ' class="actions btn btn-danger btn-sm delete-asset" data-tooltip="true" '
+ ' data-toggle="modal" ' + ' data-toggle="modal" '
+ ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" ' + ' data-content="{{ trans('general.sure_to_delete') }} ' + name_for_box + '?" '
+ ' data-title="{{ trans('general.delete') }}" onClick="return false;">' + ' data-title="{{ trans('general.delete') }}" onClick="return false;">'
+ '<i class="fas fa-trash" aria-hidden="true"></i><span class="sr-only">Delete</span></a>&nbsp;'; + '<i class="fas fa-trash" aria-hidden="true"></i><span class="sr-only">{{ trans('general.delete') }}</span></a>&nbsp;';
} else { } else {
actions += '<span data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}"><a class="btn btn-danger btn-sm delete-asset disabled" onClick="return false;"><i class="fas fa-trash"></i></a></span>&nbsp;'; actions += '<span data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}"><a class="btn btn-danger btn-sm delete-asset disabled" onClick="return false;"><i class="fas fa-trash"></i></a></span>&nbsp;';
} }
@ -504,8 +511,12 @@
} }
function externalLinkFormatter(value) { function externalLinkFormatter(value) {
if (value) { if (value) {
return '<a href="' + value + '" target="_blank">' + value + '</a>'; if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) {
return '<nobr><a href="' + value + '" target="_blank" title="External link to ' + value + '" data-tooltip="true" ><i class="fa fa-external-link"></i> ' + value + '</a></nobr>';
}
return value;
} }
} }

View file

@ -1,7 +1,7 @@
<div class="form-group {{ $errors->has('address') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('address') ? ' has-error' : '' }}">
{{ Form::label('address', trans('general.address'), array('class' => 'col-md-3 control-label')) }} {{ Form::label('address', trans('general.address'), array('class' => 'col-md-3 control-label')) }}
<div class="col-md-7"> <div class="col-md-7">
{{Form::text('address', old('address', $item->address), array('class' => 'form-control', 'aria-label'=>'address')) }} {{Form::text('address', old('address', $item->address), array('class' => 'form-control', 'aria-label'=>'address', 'maxlength'=>'191')) }}
{!! $errors->first('address', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('address', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>
@ -9,13 +9,13 @@
<div class="form-group {{ $errors->has('address2') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('address2') ? ' has-error' : '' }}">
<label class="sr-only " for="address2">{{ trans('general.address') }}</label> <label class="sr-only " for="address2">{{ trans('general.address') }}</label>
<div class="col-md-7 col-md-offset-3"> <div class="col-md-7 col-md-offset-3">
{{Form::text('address2', old('address2', $item->address2), array('class' => 'form-control', 'aria-label'=>'address2')) }} {{Form::text('address2', old('address2', $item->address2), array('class' => 'form-control', 'aria-label'=>'address2', 'maxlength'=>'191')) }}
{!! $errors->first('address2', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('address2', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>
<div class="form-group {{ $errors->has('city') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('city') ? ' has-error' : '' }}">
{{ Form::label('city', trans('general.city'), array('class' => 'col-md-3 control-label')) }} {{ Form::label('city', trans('general.city'), array('class' => 'col-md-3 control-label', 'maxlength'=>'191')) }}
<div class="col-md-7"> <div class="col-md-7">
{{Form::text('city', old('city', $item->city), array('class' => 'form-control', 'aria-label'=>'city')) }} {{Form::text('city', old('city', $item->city), array('class' => 'form-control', 'aria-label'=>'city')) }}
{!! $errors->first('city', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('city', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
@ -23,7 +23,7 @@
</div> </div>
<div class="form-group {{ $errors->has('state') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('state') ? ' has-error' : '' }}">
{{ Form::label('state', trans('general.state'), array('class' => 'col-md-3 control-label')) }} {{ Form::label('state', trans('general.state'), array('class' => 'col-md-3 control-label', 'maxlength'=>'191')) }}
<div class="col-md-7"> <div class="col-md-7">
{{Form::text('state', old('state', $item->state), array('class' => 'form-control', 'aria-label'=>'state')) }} {{Form::text('state', old('state', $item->state), array('class' => 'form-control', 'aria-label'=>'state')) }}
{!! $errors->first('state', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('state', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
@ -40,7 +40,7 @@
</div> </div>
<div class="form-group {{ $errors->has('zip') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('zip') ? ' has-error' : '' }}">
{{ Form::label('zip', trans('general.zip'), array('class' => 'col-md-3 control-label')) }} {{ Form::label('zip', trans('general.zip'), array('class' => 'col-md-3 control-label', 'maxlength'=>'10')) }}
<div class="col-md-7"> <div class="col-md-7">
{{Form::text('zip', old('zip', $item->zip), array('class' => 'form-control')) }} {{Form::text('zip', old('zip', $item->zip), array('class' => 'form-control')) }}
{!! $errors->first('zip', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('zip', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}

View file

@ -283,6 +283,16 @@
</div> </div>
</div> </div>
<!-- Checkout Date -->
<div class="form-group checkout-range">
<label for="checkout_date" class="col-md-3 control-label">{{ trans('general.checkout') }} {{ trans('general.range') }}</label>
<div class="input-daterange input-group col-md-6" id="datepicker">
<input type="text" class="form-control" name="checkout_date_start" aria-label="checkout_date_start">
<span class="input-group-addon">to</span>
<input type="text" class="form-control" name="checkout_date_end" aria-label="checkout_date_end">
</div>
</div>
<!-- Expected Checkin Date --> <!-- Expected Checkin Date -->
<div class="form-group expected_checkin-range"> <div class="form-group expected_checkin-range">
<label for="expected_checkin_start" class="col-md-3 control-label">{{ trans('admin/hardware/form.expected_checkin') }}</label> <label for="expected_checkin_start" class="col-md-3 control-label">{{ trans('admin/hardware/form.expected_checkin') }}</label>
@ -368,6 +378,12 @@
endDate: '0d', endDate: '0d',
format: 'yyyy-mm-dd' format: 'yyyy-mm-dd'
}); });
$('.checkout-range .input-daterange').datepicker({
clearBtn: true,
todayHighlight: true,
endDate: '0d',
format: 'yyyy-mm-dd'
});
$('.expected_checkin-range .input-daterange').datepicker({ $('.expected_checkin-range .input-daterange').datepicker({
clearBtn: true, clearBtn: true,

View file

@ -71,7 +71,7 @@
class="btn delete-asset btn-danger btn-sm {{ (config('app.lock_passwords')) ? ' disabled': '' }}" class="btn delete-asset btn-danger btn-sm {{ (config('app.lock_passwords')) ? ' disabled': '' }}"
data-toggle="modal" href="{{ route('settings.backups.destroy', $file['filename']) }}" data-toggle="modal" href="{{ route('settings.backups.destroy', $file['filename']) }}"
data-content="{{ trans('admin/settings/message.backup.delete_confirm') }}" data-content="{{ trans('admin/settings/message.backup.delete_confirm') }}"
data-title="{{ trans('general.delete') }} {{ e($file['filename']) }} ?" data-title="{{ trans('general.delete') }} {{ e($file['filename']) }}?"
onClick="return false;"> onClick="return false;">
<i class="fas fa-trash icon-white" aria-hidden="true"></i> <i class="fas fa-trash icon-white" aria-hidden="true"></i>
<span class="sr-only">{{ trans('general.delete') }}</span> <span class="sr-only">{{ trans('general.delete') }}</span>

View file

@ -0,0 +1,117 @@
@extends('layouts/default')
{{-- Page title --}}
@section('title')
{{ trans('admin/settings/general.google_login') }}
@parent
@stop
@section('header_right')
<a href="{{ route('settings.index') }}" class="btn btn-primary"> {{ trans('general.back') }}</a>
@stop
{{-- Page content --}}
@section('content')
{{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }}
<!-- CSRF Token -->
{{csrf_field()}}
<div class="row">
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
<div class="panel box box-default">
<div class="box-header with-border">
<h2 class="box-title">
<i class="fa-brands fa-google"></i> {{ trans('admin/settings/general.google_login') }}
</h2>
</div>
<div class="box-body">
<div class="col-md-12">
<!-- Google Redirect URL -->
<div class="form-group">
<div class="col-md-3 text-right">
<strong>Redirect URL</strong>
</div>
<div class="col-md-8">
<p class="form-control-static" style="margin-top: -5px"><code>{{ config('app.url') }}/google/callback</code></p>
<p class="help-block">{!! trans('admin/settings/general.google_callback_help') !!}</p>
</div>
</div>
<!-- Google login -->
<div class="form-group {{ $errors->has('google') ? 'error' : '' }}">
<div class="col-md-8 col-md-offset-3">
<label class="form-control{{ (config('app.lock_passwords')===true) ? ' form-control--disabled': '' }}">
<span class="sr-only">{{ trans('admin/settings/general.pwd_secure_uncommon') }}</span>
{{ Form::checkbox('google_login', '1', old('google_login', $setting->google_login),array('aria-label'=>'google_login', (config('app.lock_passwords')===true) ? 'disabled': '')) }}
{{ trans('admin/settings/general.enable_google_login') }}
</label>
<p class="help-block">{{ trans('admin/settings/general.enable_google_login_help') }}</p>
</div>
</div>
<!-- Google Client ID -->
<div class="form-group {{ $errors->has('google_client_id') ? 'error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('google_client_id', 'Client ID') }}
</div>
<div class="col-md-8">
{{ Form::text('google_client_id', old('google_client_id', $setting->google_client_id), ['class' => 'form-control','placeholder' => trans('general.example') .'000000000000-XXXXXXXXXXX.apps.googleusercontent.com', (config('app.lock_passwords')===true) ? 'disabled': '']) }}
{!! $errors->first('google_client_id', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@endif
</div>
</div>
<!-- Google Client Secret -->
<div class="form-group {{ $errors->has('google_client_secret') ? 'error' : '' }}">
<div class="col-md-3 text-right">
{{ Form::label('google_client_secret', 'Client Secret') }}
</div>
<div class="col-md-8">
@if (config('app.lock_passwords')===true)
{{ Form::text('google_client_secret', 'XXXXXXXXXXXXXXXXXXXXXXX', ['class' => 'form-control', 'disabled']) }}
@else
{{ Form::text('google_client_secret', old('google_client_secret', $setting->google_client_secret), ['class' => 'form-control','placeholder' => trans('general.example') .'XXXXXXXXXXXX']) }}
@endif
{!! $errors->first('google_client_secret', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@endif
</div>
</div>
</div>
</div> <!--/.box-body-->
<div class="box-footer">
<div class="text-left col-md-6">
<a class="btn btn-link text-left" href="{{ route('settings.index') }}">{{ trans('button.cancel') }}</a>
</div>
<div class="text-right col-md-6">
<button type="submit" class="btn btn-success"{{ (config('app.lock_passwords')===true) ? ' disabled': '' }}><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
</div>
</div>
</div> <!-- /box -->
</div> <!-- /.col-md-8-->
</div> <!-- /.row-->
{{Form::close()}}
@stop

View file

@ -235,6 +235,21 @@
</div> </div>
</div> </div>
<div class="col-md-4 col-lg-3 col-sm-6 col-xl-1">
<div class="box box-default">
<div class="box-body text-center">
<h5>
<a href="{{ route('settings.google.index') }}" class="settings_button">
<i class="fa-brands fa-google fa-4x" aria-hidden="true"></i>
<br><br>
<span class="name">Google</span>
</a>
</h5>
<p class="help-block">{{ trans('admin/settings/general.google_login') }}</p>
</div>
</div>
</div>
<div class="col-md-4 col-lg-3 col-sm-6 col-xl-1"> <div class="col-md-4 col-lg-3 col-sm-6 col-xl-1">
<div class="box box-default"> <div class="box box-default">
<div class="box-body text-center"> <div class="box-body text-center">

View file

@ -60,12 +60,33 @@
<!-- Enable LDAP --> <!-- Enable LDAP -->
<div class="form-group {{ $errors->has('ldap_integration') ? 'error' : '' }}"> <div class="form-group {{ $errors->has('ldap_integration') ? 'error' : '' }}">
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_integration', trans('admin/settings/general.ldap_integration')) }} {{ Form::label('ldap_enabled', trans('admin/settings/general.ldap_integration')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::checkbox('ldap_enabled', '1', Request::old('ldap_enabled', $setting->ldap_enabled), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} <label class="form-control">
{{ Form::checkbox('ldap_enabled', '1', old('ldap_enabled', $setting->ldap_enabled), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'form-control '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('admin/settings/general.ldap_enabled') }} {{ trans('admin/settings/general.ldap_enabled') }}
</label>
@if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@endif
</div>
</div>
<!-- AD Flag -->
<div class="form-group">
<div class="col-md-3">
{{ Form::label('is_ad', trans('admin/settings/general.ad')) }}
</div>
<div class="col-md-8">
<label class="form-control">
{{ Form::checkbox('is_ad', '1', Request::old('is_ad', $setting->is_ad), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('admin/settings/general.is_ad') }}
</label>
{!! $errors->first('is_ad', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p> <p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@endif @endif
@ -77,10 +98,11 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_pw_sync', trans('admin/settings/general.ldap_pw_sync')) }} {{ Form::label('ldap_pw_sync', trans('admin/settings/general.ldap_pw_sync')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
<label class="form-control">
{{ Form::checkbox('ldap_pw_sync', '1', Request::old('ldap_pw_sync', $setting->ldap_pw_sync), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ Form::checkbox('ldap_pw_sync', '1', Request::old('ldap_pw_sync', $setting->ldap_pw_sync), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('general.yes') }} {{ trans('general.yes') }}
</label>
<p class="help-block">{{ trans('admin/settings/general.ldap_pw_sync_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ldap_pw_sync_help') }}</p>
{!! $errors->first('ldap_pw_sync_help', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_pw_sync_help', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -91,75 +113,12 @@
</div> </div>
</div> </div>
<!-- Default LDAP Permissions Group Select -->
<div class="form-group{{ $errors->has('group') ? ' has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('ldap_default_group', trans('admin/settings/general.ldap_default_group')) }}
</div>
<div class="col-md-9">
@if ($groups->count())
@if ((Config::get('app.lock_passwords') || (!Auth::user()->isSuperUser())))
<ul>
@foreach ($groups as $id => $group)
{!! '<li>'.e($group).'</li>' !!}
@endforeach
</ul>
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</span>
@else
<div class="controls">
<select
name="ldap_default_group"
aria-label="ldap_default_group"
id="ldap_default_group"
class="form-control select2"
>
<option value="">{{ trans('admin/settings/general.no_default_group') }}</option>
@foreach ($groups as $id => $group)
<option value="{{ $id }}" {{ $setting->ldap_default_group == $id ? 'selected' : '' }}>
{{ $group }}
</option>
@endforeach
</select>
<span class="help-block">
{{ trans('admin/settings/general.ldap_default_group_info') }}
</span>
</div>
@endif
@else
<p>No groups have been created yet. Visit <code>Admin Settings > Permission Groups</code> to add one.</p>
@endif
</div>
</div>
<!-- AD Flag -->
<div class="form-group">
<div class="col-md-3">
{{ Form::label('is_ad', trans('admin/settings/general.ad')) }}
</div>
<div class="col-md-9">
{{ Form::checkbox('is_ad', '1', Request::old('is_ad', $setting->is_ad), [((config('app.lock_passwords')===true)) ? 'disabled ': '', 'class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('admin/settings/general.is_ad') }}
{!! $errors->first('is_ad', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@endif
</div>
</div>
<!-- AD Domain --> <!-- AD Domain -->
<div class="form-group {{ $errors->has('ad_domain') ? 'error' : '' }}"> <div class="form-group {{ $errors->has('ad_domain') ? 'error' : '' }}">
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ad_domain', trans('admin/settings/general.ad_domain')) }} {{ Form::label('ad_domain', trans('admin/settings/general.ad_domain')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ad_domain', Request::old('ad_domain', $setting->ad_domain), ['class' => 'form-control','placeholder' => trans('general.example') .'example.com', $setting->demoMode]) }} {{ Form::text('ad_domain', Request::old('ad_domain', $setting->ad_domain), ['class' => 'form-control','placeholder' => trans('general.example') .'example.com', $setting->demoMode]) }}
<p class="help-block">{{ trans('admin/settings/general.ad_domain_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ad_domain_help') }}</p>
{!! $errors->first('ad_domain', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ad_domain', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -174,7 +133,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ad_append_domain', trans('admin/settings/general.ad_append_domain_label')) }} {{ Form::label('ad_append_domain', trans('admin/settings/general.ad_append_domain_label')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::checkbox('ad_append_domain', '1', Request::old('ad_append_domain', $setting->ad_append_domain),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} {{ Form::checkbox('ad_append_domain', '1', Request::old('ad_append_domain', $setting->ad_append_domain),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('admin/settings/general.ad_append_domain') }} {{ trans('admin/settings/general.ad_append_domain') }}
<p class="help-block">{{ trans('admin/settings/general.ad_append_domain_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ad_append_domain_help') }}</p>
@ -190,7 +149,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_client_tls_key', trans('admin/settings/general.ldap_client_tls_key')) }} {{ Form::label('ldap_client_tls_key', trans('admin/settings/general.ldap_client_tls_key')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::textarea('ldap_client_tls_key', Request::old('ldap_client_tls_key', $setting->ldap_client_tls_key), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN RSA PRIVATE KEY-----'."\r\n1234567890\r\n-----END RSA PRIVATE KEY----- {{ Form::textarea('ldap_client_tls_key', Request::old('ldap_client_tls_key', $setting->ldap_client_tls_key), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN RSA PRIVATE KEY-----'."\r\n1234567890\r\n-----END RSA PRIVATE KEY-----
", $setting->demoMode]) }} ", $setting->demoMode]) }}
{!! $errors->first('ldap_client_tls_key', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_client_tls_key', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -205,7 +164,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_client_tls_cert', trans('admin/settings/general.ldap_client_tls_cert')) }} {{ Form::label('ldap_client_tls_cert', trans('admin/settings/general.ldap_client_tls_cert')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::textarea('ldap_client_tls_cert', Request::old('ldap_client_tls_cert', $setting->ldap_client_tls_cert), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN CERTIFICATE-----'."\r\n1234567890\r\n-----END CERTIFICATE-----", $setting->demoMode]) }} {{ Form::textarea('ldap_client_tls_cert', Request::old('ldap_client_tls_cert', $setting->ldap_client_tls_cert), ['class' => 'form-control','placeholder' => trans('general.example') .'-----BEGIN CERTIFICATE-----'."\r\n1234567890\r\n-----END CERTIFICATE-----", $setting->demoMode]) }}
<p class="help-block">{{ trans('admin/settings/general.ldap_client_tls_cert_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ldap_client_tls_cert_help') }}</p>
{!! $errors->first('ldap_client_tls_cert', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_client_tls_cert', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -220,7 +179,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_server', trans('admin/settings/general.ldap_server')) }} {{ Form::label('ldap_server', trans('admin/settings/general.ldap_server')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_server', Request::old('ldap_server', $setting->ldap_server), ['class' => 'form-control','placeholder' => trans('general.example') .'ldap://ldap.example.com', $setting->demoMode]) }} {{ Form::text('ldap_server', Request::old('ldap_server', $setting->ldap_server), ['class' => 'form-control','placeholder' => trans('general.example') .'ldap://ldap.example.com', $setting->demoMode]) }}
<p class="help-block">{{ trans('admin/settings/general.ldap_server_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ldap_server_help') }}</p>
{!! $errors->first('ldap_server', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_server', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -235,9 +194,11 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_tls', trans('admin/settings/general.ldap_tls')) }} {{ Form::label('ldap_tls', trans('admin/settings/general.ldap_tls')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::checkbox('ldap_tls', '1', Request::old('ldap_tls', $setting->ldap_tls),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} <label class="form-control">
{{ trans('admin/settings/general.ldap_tls_help') }} {{ Form::checkbox('ldap_tls', '1', Request::old('ldap_tls', $setting->ldap_tls),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('admin/settings/general.ldap_tls_help') }}
</label>
{!! $errors->first('ldap_tls', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_tls', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p> <p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@ -250,9 +211,11 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_server_cert_ignore', trans('admin/settings/general.ldap_server_cert')) }} {{ Form::label('ldap_server_cert_ignore', trans('admin/settings/general.ldap_server_cert')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::checkbox('ldap_server_cert_ignore', '1', Request::old('ldap_server_cert_ignore', $setting->ldap_server_cert_ignore),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }} <label class="form-control">
{{ trans('admin/settings/general.ldap_server_cert_ignore') }} {{ Form::checkbox('ldap_server_cert_ignore', '1', Request::old('ldap_server_cert_ignore', $setting->ldap_server_cert_ignore),['class' => 'minimal '. $setting->demoMode, $setting->demoMode]) }}
{{ trans('admin/settings/general.ldap_server_cert_ignore') }}
</label>
{!! $errors->first('ldap_server_cert_ignore', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_server_cert_ignore', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.ldap_server_cert_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ldap_server_cert_help') }}</p>
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -266,7 +229,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_uname', trans('admin/settings/general.ldap_uname')) }} {{ Form::label('ldap_uname', trans('admin/settings/general.ldap_uname')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_uname', Request::old('ldap_uname', $setting->ldap_uname), ['class' => 'form-control','placeholder' => trans('general.example') .'binduser@example.com', $setting->demoMode]) }} {{ Form::text('ldap_uname', Request::old('ldap_uname', $setting->ldap_uname), ['class' => 'form-control','placeholder' => trans('general.example') .'binduser@example.com', $setting->demoMode]) }}
{!! $errors->first('ldap_uname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_uname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -280,7 +243,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_pword', trans('admin/settings/general.ldap_pword')) }} {{ Form::label('ldap_pword', trans('admin/settings/general.ldap_pword')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::password('ldap_pword', ['class' => 'form-control','placeholder' => trans('general.example') .' binduserpassword', $setting->demoMode]) }} {{ Form::password('ldap_pword', ['class' => 'form-control','placeholder' => trans('general.example') .' binduserpassword', $setting->demoMode]) }}
{!! $errors->first('ldap_pword', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_pword', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -294,7 +257,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_basedn', trans('admin/settings/general.ldap_basedn')) }} {{ Form::label('ldap_basedn', trans('admin/settings/general.ldap_basedn')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_basedn', Request::old('ldap_basedn', $setting->ldap_basedn), ['class' => 'form-control', 'placeholder' => trans('general.example') .'cn=users/authorized,dc=example,dc=com', $setting->demoMode]) }} {{ Form::text('ldap_basedn', Request::old('ldap_basedn', $setting->ldap_basedn), ['class' => 'form-control', 'placeholder' => trans('general.example') .'cn=users/authorized,dc=example,dc=com', $setting->demoMode]) }}
{!! $errors->first('ldap_basedn', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_basedn', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -308,7 +271,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_filter', trans('admin/settings/general.ldap_filter')) }} {{ Form::label('ldap_filter', trans('admin/settings/general.ldap_filter')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_filter', Request::old('ldap_filter', $setting->ldap_filter), ['class' => 'form-control','placeholder' => trans('general.example') .'&(cn=*)', $setting->demoMode]) }} {{ Form::text('ldap_filter', Request::old('ldap_filter', $setting->ldap_filter), ['class' => 'form-control','placeholder' => trans('general.example') .'&(cn=*)', $setting->demoMode]) }}
{!! $errors->first('ldap_filter', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_filter', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -322,7 +285,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_username_field', trans('admin/settings/general.ldap_username_field')) }} {{ Form::label('ldap_username_field', trans('admin/settings/general.ldap_username_field')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_username_field', Request::old('ldap_username_field', $setting->ldap_username_field), ['class' => 'form-control','placeholder' => trans('general.example') .'samaccountname', $setting->demoMode]) }} {{ Form::text('ldap_username_field', Request::old('ldap_username_field', $setting->ldap_username_field), ['class' => 'form-control','placeholder' => trans('general.example') .'samaccountname', $setting->demoMode]) }}
{!! $errors->first('ldap_username_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_username_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -336,7 +299,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_lname_field', trans('admin/settings/general.ldap_lname_field')) }} {{ Form::label('ldap_lname_field', trans('admin/settings/general.ldap_lname_field')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_lname_field', Request::old('ldap_lname_field', $setting->ldap_lname_field), ['class' => 'form-control','placeholder' => trans('general.example') .'sn', $setting->demoMode]) }} {{ Form::text('ldap_lname_field', Request::old('ldap_lname_field', $setting->ldap_lname_field), ['class' => 'form-control','placeholder' => trans('general.example') .'sn', $setting->demoMode]) }}
{!! $errors->first('ldap_lname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_lname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -350,7 +313,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_fname_field', trans('admin/settings/general.ldap_fname_field')) }} {{ Form::label('ldap_fname_field', trans('admin/settings/general.ldap_fname_field')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_fname_field', Request::old('ldap_fname_field', $setting->ldap_fname_field), ['class' => 'form-control', 'placeholder' => trans('general.example') .'givenname', $setting->demoMode]) }} {{ Form::text('ldap_fname_field', Request::old('ldap_fname_field', $setting->ldap_fname_field), ['class' => 'form-control', 'placeholder' => trans('general.example') .'givenname', $setting->demoMode]) }}
{!! $errors->first('ldap_fname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_fname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -364,7 +327,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_auth_filter_query', trans('admin/settings/general.ldap_auth_filter_query')) }} {{ Form::label('ldap_auth_filter_query', trans('admin/settings/general.ldap_auth_filter_query')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_auth_filter_query', Request::old('ldap_auth_filter_query', $setting->ldap_auth_filter_query), ['class' => 'form-control','placeholder' => trans('general.example') .'uid=', $setting->demoMode]) }} {{ Form::text('ldap_auth_filter_query', Request::old('ldap_auth_filter_query', $setting->ldap_auth_filter_query), ['class' => 'form-control','placeholder' => trans('general.example') .'uid=', $setting->demoMode]) }}
{!! $errors->first('ldap_auth_filter_query', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_auth_filter_query', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -373,17 +336,45 @@
</div> </div>
</div> </div>
<!-- LDAP Version --> <!-- Default LDAP Permissions Group Select -->
<div class="form-group {{ $errors->has('ldap_version') ? 'error' : '' }}">
<div class="form-group{{ $errors->has('group') ? ' has-error' : '' }}">
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_version', trans('admin/settings/general.ldap_version')) }} {{ Form::label('ldap_default_group', trans('admin/settings/general.ldap_default_group')) }}
</div> </div>
<div class="col-md-9">
{{ Form::text('ldap_version', Request::old('ldap_version', $setting->ldap_version), ['class' => 'form-control','placeholder' => '3', $setting->demoMode]) }} <div class="col-md-8">
{!! $errors->first('ldap_version', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if ($groups->count())
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p> @if ((Config::get('app.lock_passwords') || (!Auth::user()->isSuperUser())))
<ul>
@foreach ($groups as $id => $group)
{!! '<li>'.e($group).'</li>' !!}
@endforeach
</ul>
<span class="help-block">{{ trans('admin/users/general.group_memberships_helpblock') }}</span>
@else
<div class="controls">
<select name="ldap_default_group" aria-label="ldap_default_group" id="ldap_default_group" class="form-control select2">
<option value="">{{ trans('admin/settings/general.no_default_group') }}</option>
@foreach ($groups as $id => $group)
<option value="{{ $id }}" {{ $setting->ldap_default_group == $id ? 'selected' : '' }}>
{{ $group }}
</option>
@endforeach
</select>
<span class="help-block">
{{ trans('admin/settings/general.ldap_default_group_info') }}
</span>
</div>
@endif
@else
<p>No groups have been created yet. Visit <code>Admin Settings > Permission Groups</code> to add one.</p>
@endif @endif
</div> </div>
</div> </div>
@ -392,7 +383,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_active_flag', trans('admin/settings/general.ldap_active_flag')) }} {{ Form::label('ldap_active_flag', trans('admin/settings/general.ldap_active_flag')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_active_flag', Request::old('ldap_active_flag', $setting->ldap_active_flag), ['class' => 'form-control', $setting->demoMode]) }} {{ Form::text('ldap_active_flag', Request::old('ldap_active_flag', $setting->ldap_active_flag), ['class' => 'form-control', $setting->demoMode]) }}
<p class="help-block">{!! trans('admin/settings/general.ldap_activated_flag_help') !!}</p> <p class="help-block">{!! trans('admin/settings/general.ldap_activated_flag_help') !!}</p>
@ -409,7 +400,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_emp_num', trans('admin/settings/general.ldap_emp_num')) }} {{ Form::label('ldap_emp_num', trans('admin/settings/general.ldap_emp_num')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_emp_num', Request::old('ldap_emp_num', $setting->ldap_emp_num), ['class' => 'form-control','placeholder' => trans('general.example') .'employeenumber/employeeid', $setting->demoMode]) }} {{ Form::text('ldap_emp_num', Request::old('ldap_emp_num', $setting->ldap_emp_num), ['class' => 'form-control','placeholder' => trans('general.example') .'employeenumber/employeeid', $setting->demoMode]) }}
{!! $errors->first('ldap_emp_num', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_emp_num', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -422,7 +413,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_dept', trans('admin/settings/general.ldap_dept')) }} {{ Form::label('ldap_dept', trans('admin/settings/general.ldap_dept')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_dept', Request::old('ldap_dept', $setting->ldap_dept), ['class' => 'form-control','placeholder' => trans('general.example') .'department', $setting->demoMode]) }} {{ Form::text('ldap_dept', Request::old('ldap_dept', $setting->ldap_dept), ['class' => 'form-control','placeholder' => trans('general.example') .'department', $setting->demoMode]) }}
{!! $errors->first('ldap_dept', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_dept', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -435,7 +426,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_dept', trans('admin/settings/general.ldap_manager')) }} {{ Form::label('ldap_dept', trans('admin/settings/general.ldap_manager')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_manager', Request::old('ldap_manager', $setting->ldap_manager), ['class' => 'form-control','placeholder' => trans('general.example') .'manager', $setting->demoMode]) }} {{ Form::text('ldap_manager', Request::old('ldap_manager', $setting->ldap_manager), ['class' => 'form-control','placeholder' => trans('general.example') .'manager', $setting->demoMode]) }}
{!! $errors->first('ldap_manager', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_manager', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -449,7 +440,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_email', trans('admin/settings/general.ldap_email')) }} {{ Form::label('ldap_email', trans('admin/settings/general.ldap_email')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_email', Request::old('ldap_email', $setting->ldap_email), ['class' => 'form-control','placeholder' => trans('general.example') .'mail', $setting->demoMode]) }} {{ Form::text('ldap_email', Request::old('ldap_email', $setting->ldap_email), ['class' => 'form-control','placeholder' => trans('general.example') .'mail', $setting->demoMode]) }}
{!! $errors->first('ldap_email', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_email', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -463,7 +454,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_phone', trans('admin/settings/general.ldap_phone')) }} {{ Form::label('ldap_phone', trans('admin/settings/general.ldap_phone')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_phone', Request::old('ldap_phone', $setting->ldap_phone_field), ['class' => 'form-control','placeholder' => trans('general.example') .'telephonenumber', $setting->demoMode]) }} {{ Form::text('ldap_phone', Request::old('ldap_phone', $setting->ldap_phone_field), ['class' => 'form-control','placeholder' => trans('general.example') .'telephonenumber', $setting->demoMode]) }}
{!! $errors->first('ldap_phone', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_phone', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -477,7 +468,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_jobtitle', trans('admin/settings/general.ldap_jobtitle')) }} {{ Form::label('ldap_jobtitle', trans('admin/settings/general.ldap_jobtitle')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_jobtitle', Request::old('ldap_jobtitle', $setting->ldap_jobtitle), ['class' => 'form-control','placeholder' => trans('general.example') .'title', $setting->demoMode]) }} {{ Form::text('ldap_jobtitle', Request::old('ldap_jobtitle', $setting->ldap_jobtitle), ['class' => 'form-control','placeholder' => trans('general.example') .'title', $setting->demoMode]) }}
{!! $errors->first('ldap_jobtitle', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_jobtitle', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -491,7 +482,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_country', trans('admin/settings/general.ldap_country')) }} {{ Form::label('ldap_country', trans('admin/settings/general.ldap_country')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_country', Request::old('ldap_country', $setting->ldap_country), ['class' => 'form-control','placeholder' => trans('general.example') .'c', $setting->demoMode]) }} {{ Form::text('ldap_country', Request::old('ldap_country', $setting->ldap_country), ['class' => 'form-control','placeholder' => trans('general.example') .'c', $setting->demoMode]) }}
{!! $errors->first('ldap_country', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_country', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
@ -504,7 +495,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('ldap_location', trans('admin/settings/general.ldap_location')) }} {{ Form::label('ldap_location', trans('admin/settings/general.ldap_location')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('ldap_location', Request::old('ldap_location', $setting->ldap_location), ['class' => 'form-control','placeholder' => trans('general.example') .'physicaldeliveryofficename', $setting->demoMode]) }} {{ Form::text('ldap_location', Request::old('ldap_location', $setting->ldap_location), ['class' => 'form-control','placeholder' => trans('general.example') .'physicaldeliveryofficename', $setting->demoMode]) }}
<p class="help-block">{!! trans('admin/settings/general.ldap_location_help') !!}</p> <p class="help-block">{!! trans('admin/settings/general.ldap_location_help') !!}</p>
{!! $errors->first('ldap_location', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('ldap_location', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -520,14 +511,14 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('test_ldap_sync', 'Test LDAP Sync') }} {{ Form::label('test_ldap_sync', 'Test LDAP Sync') }}
</div> </div>
<div class="col-md-9" id="ldaptestrow"> <div class="col-md-8" id="ldaptestrow">
<a {{ $setting->demoMode }} class="btn btn-default btn-sm pull-left" id="ldaptest" style="margin-right: 10px;">{{ trans('admin/settings/general.ldap_test_sync') }}</a> <a {{ $setting->demoMode }} class="btn btn-default btn-sm pull-left" id="ldaptest" style="margin-right: 10px;">{{ trans('admin/settings/general.ldap_test_sync') }}</a>
</div> </div>
<div class="col-md-9 col-md-offset-3"> <div class="col-md-8 col-md-offset-3">
<br /> <br />
<div id="ldapad_test_results" class="hidden well well-sm"></div> <div id="ldapad_test_results" class="hidden well well-sm"></div>
</div> </div>
<div class="col-md-9 col-md-offset-3"> <div class="col-md-8 col-md-offset-3">
<p class="help-block">{{ trans('admin/settings/general.ldap_login_sync_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ldap_login_sync_help') }}</p>
@if (config('app.lock_passwords')===true) @if (config('app.lock_passwords')===true)
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p> <p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@ -541,7 +532,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('test_ldap_login', 'Test LDAP Login') }} {{ Form::label('test_ldap_login', 'Test LDAP Login') }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<input type="text" name="ldaptest_user" id="ldaptest_user" class="form-control" placeholder="LDAP username"> <input type="text" name="ldaptest_user" id="ldaptest_user" class="form-control" placeholder="LDAP username">
@ -556,12 +547,12 @@
</div> </div>
</div> </div>
<div class="col-md-9 col-md-offset-3"> <div class="col-md-8 col-md-offset-3">
<span id="ldaptestloginicon"></span> <span id="ldaptestloginicon"></span>
<span id="ldaptestloginresult"></span> <span id="ldaptestloginresult"></span>
<span id="ldaptestloginstatus"></span> <span id="ldaptestloginstatus"></span>
</div> </div>
<div class="col-md-9 col-md-offset-3"> <div class="col-md-8 col-md-offset-3">
<p class="help-block">{{ trans('admin/settings/general.ldap_login_test_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.ldap_login_test_help') }}</p>
</div> </div>
@ -575,7 +566,7 @@
<div class="col-md-3"> <div class="col-md-3">
{{ Form::label('custom_forgot_pass_url', trans('admin/settings/general.custom_forgot_pass_url')) }} {{ Form::label('custom_forgot_pass_url', trans('admin/settings/general.custom_forgot_pass_url')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-8">
{{ Form::text('custom_forgot_pass_url', Request::old('custom_forgot_pass_url', $setting->custom_forgot_pass_url), ['class' => 'form-control','placeholder' => trans('general.example') .'https://my.ldapserver-forgotpass.com', $setting->demoMode]) }} {{ Form::text('custom_forgot_pass_url', Request::old('custom_forgot_pass_url', $setting->custom_forgot_pass_url), ['class' => 'form-control','placeholder' => trans('general.example') .'https://my.ldapserver-forgotpass.com', $setting->demoMode]) }}
<p class="help-block">{{ trans('admin/settings/general.custom_forgot_pass_url_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.custom_forgot_pass_url_help') }}</p>
{!! $errors->first('custom_forgot_pass_url', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('custom_forgot_pass_url', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
@ -610,6 +601,8 @@
@push('js') @push('js')
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
/** /**
* Check to see if is_ad is checked, if not disable the ad_domain field * Check to see if is_ad is checked, if not disable the ad_domain field
*/ */
@ -621,6 +614,15 @@
} }
}); });
$("#is_ad").change(function() {
$('#ad_domain').prop('disabled', 'disabled');
if (this.checked) {
$('#ad_domain').toggleDisabled();
}
});
/** /**
* Toggle the server info based on the is_ad checkbox * Toggle the server info based on the is_ad checkbox
*/ */

View file

@ -92,9 +92,10 @@
<p class="help-block"> <p class="help-block">
<a href="{{ route('saml.metadata') }}" target="_blank" class="btn btn-default" style="margin-right: 5px;">{{ trans('admin/settings/general.saml_download') }}</a> <a href="{{ route('saml.metadata') }}" target="_blank" class="btn btn-default" style="margin-right: 5px;">{{ trans('admin/settings/general.saml_download') }}</a>
</p> </p>
</div>
@endif @endif
{!! $errors->first('saml_enabled', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('saml_enabled', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div> </div>

View file

@ -441,7 +441,7 @@
<div class="form-group{{ $errors->has('state') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('state') ? ' has-error' : '' }}">
<label class="col-md-3 control-label" for="state">{{ trans('general.state') }}</label> <label class="col-md-3 control-label" for="state">{{ trans('general.state') }}</label>
<div class="col-md-6"> <div class="col-md-6">
<input class="form-control" type="text" name="state" id="state" value="{{ old('state', $user->state) }}" maxlength="3" /> <input class="form-control" type="text" name="state" id="state" value="{{ old('state', $user->state) }}" maxlength="191" />
{!! $errors->first('state', '<span class="alert-msg" aria-hidden="true">:message</span>') !!} {!! $errors->first('state', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div> </div>
</div> </div>

View file

@ -192,6 +192,9 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser
Route::get('oauth', [SettingsController::class, 'api'])->name('settings.oauth.index'); Route::get('oauth', [SettingsController::class, 'api'])->name('settings.oauth.index');
Route::get('google', [SettingsController::class, 'getGoogleLoginSettings'])->name('settings.google.index');
Route::post('google', [SettingsController::class, 'postGoogleLoginSettings'])->name('settings.google.save');
Route::get('purge', [SettingsController::class, 'getPurge'])->name('settings.purge.index'); Route::get('purge', [SettingsController::class, 'getPurge'])->name('settings.purge.index');
Route::post('purge', [SettingsController::class, 'postPurge'])->name('settings.purge.save'); Route::post('purge', [SettingsController::class, 'postPurge'])->name('settings.purge.save');
@ -291,7 +294,8 @@ Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () {
Route::get('accept/{id}', [Account\AcceptanceController::class, 'create']) Route::get('accept/{id}', [Account\AcceptanceController::class, 'create'])
->name('account.accept.item'); ->name('account.accept.item');
Route::post('accept/{id}', [Account\AcceptanceController::class, 'store']); Route::post('accept/{id}', [Account\AcceptanceController::class, 'store'])
->name('account.store-acceptance');
Route::get( Route::get(
'print', 'print',
@ -452,8 +456,6 @@ Route::group(['middleware' => 'web'], function () {
[LoginController::class, 'postTwoFactorAuth'] [LoginController::class, 'postTwoFactorAuth']
); );
Route::post( Route::post(
'password/email', 'password/email',
[ForgotPasswordController::class, 'sendResetLinkEmail'] [ForgotPasswordController::class, 'sendResetLinkEmail']
@ -482,7 +484,9 @@ Route::group(['middleware' => 'web'], function () {
)->name('password.email')->middleware('throttle:forgotten_password'); )->name('password.email')->middleware('throttle:forgotten_password');
// Socialite Google login
Route::get('google', 'App\Http\Controllers\GoogleAuthController@redirectToGoogle')->name('google.redirect');
Route::get('google/callback', 'App\Http\Controllers\GoogleAuthController@handleGoogleCallback')->name('google.callback');
Route::get( Route::get(

View file

@ -0,0 +1,20 @@
name,address,address2,city,state,country,zip,manager,manager username,currency
Peace River,8 Brentwood Court,,Birendranagar,AB,CA,T8S,Danika Mostyn,dmostyn0,CAD
Airdrie,14 Summer Ridge Court,306 Buhler Parkway,Poniatowa,AB,CA,T4B,Clementina Van Halen,cvan1,CAD
Calgary,3 Fieldstone Drive,,Iwanai,AB,CA,,Harwilll Heffernan,hheffernan2,CAD
High Prairie,1906 Weeping Birch Park,,Lopar,AB,CA,,Christian Pache,cpache3,CAD
Sundre,20 Summer Ridge Court,,Burujul,AB,CA,,,,
Athabasca,22 Browning Drive,424 Rieder Court,Itambacuri,AB,CA,,Alphonso Ashbridge,aashbridge5,CAD
Drayton Valley,56064 Onsgard Center,,Bahía Honda,AB,CA,,,,
Crossfield,0 Lighthouse Bay Place,,Bengras,AB,CA,,Vania Dufton,vdufton7,CAD
Beaverlodge,6 Katie Terrace,,Zhajin,AB,CA,,Papageno Baldi,pbaldi8,CAD
Grande Prairie,0 Ridgeview Parkway,,Yunxi,AB,CA,R3J,Selia Biggadike,sbiggadike9,CAD
Sherwood Park,263 Aberg Alley,,El Paso,AB,CA,,,,
Vegreville,9039 Shoshone Parkway,,Huazhou,AB,CA,,Georgy Eversfield,geversfieldb,CAD
Rocky Mountain House,8617 Arapahoe Parkway,,Paraipaba,AB,CA,,Mara Gilfoyle,mgilfoylec,CAD
Calmar,14 Green Ridge Circle,,Medveditskiy,AB,CA,S0G,Paulette Rylatt,prylattd,CAD
Rocky Mountain House,517 Bowman Terrace,,Viana,AB,CA,,Neal Gabitis,ngabitise,CAD
Pincher Creek,6054 Anzinger Hill,,Chlumec,AB,CA,,Bonnee Fowle,bfowlef,CAD
Airdrie,8 Lien Drive,,Reims,AB,CA,,Kerry Aherne,kaherneg,CAD
Camrose,4 Summit Parkway,,Xinqiao,AB,CA,T4V,Sherlock Stobbart,sstobbarth,CAD
Lamont,12 Ilene Park,,Huangtang,AB,CA,N2E,Karlotta Pinckstone,kpinckstonei,CAD
1 name address address2 city state country zip manager manager username currency
2 Peace River 8 Brentwood Court Birendranagar AB CA T8S Danika Mostyn dmostyn0 CAD
3 Airdrie 14 Summer Ridge Court 306 Buhler Parkway Poniatowa AB CA T4B Clementina Van Halen cvan1 CAD
4 Calgary 3 Fieldstone Drive Iwanai AB CA Harwilll Heffernan hheffernan2 CAD
5 High Prairie 1906 Weeping Birch Park Lopar AB CA Christian Pache cpache3 CAD
6 Sundre 20 Summer Ridge Court Burujul AB CA
7 Athabasca 22 Browning Drive 424 Rieder Court Itambacuri AB CA Alphonso Ashbridge aashbridge5 CAD
8 Drayton Valley 56064 Onsgard Center Bahía Honda AB CA
9 Crossfield 0 Lighthouse Bay Place Bengras AB CA Vania Dufton vdufton7 CAD
10 Beaverlodge 6 Katie Terrace Zhajin AB CA Papageno Baldi pbaldi8 CAD
11 Grande Prairie 0 Ridgeview Parkway Yunxi AB CA R3J Selia Biggadike sbiggadike9 CAD
12 Sherwood Park 263 Aberg Alley El Paso AB CA
13 Vegreville 9039 Shoshone Parkway Huazhou AB CA Georgy Eversfield geversfieldb CAD
14 Rocky Mountain House 8617 Arapahoe Parkway Paraipaba AB CA Mara Gilfoyle mgilfoylec CAD
15 Calmar 14 Green Ridge Circle Medveditskiy AB CA S0G Paulette Rylatt prylattd CAD
16 Rocky Mountain House 517 Bowman Terrace Viana AB CA Neal Gabitis ngabitise CAD
17 Pincher Creek 6054 Anzinger Hill Chlumec AB CA Bonnee Fowle bfowlef CAD
18 Airdrie 8 Lien Drive Reims AB CA Kerry Aherne kaherneg CAD
19 Camrose 4 Summit Parkway Xinqiao AB CA T4V Sherlock Stobbart sstobbarth CAD
20 Lamont 12 Ilene Park Huangtang AB CA N2E Karlotta Pinckstone kpinckstonei CAD

View file

@ -0,0 +1,82 @@
<?php
namespace Tests\Feature\CheckoutAcceptances;
use App\Models\Accessory;
use App\Models\CheckoutAcceptance;
use App\Notifications\AcceptanceAssetAcceptedNotification;
use App\Notifications\AcceptanceAssetDeclinedNotification;
use Notification;
use Tests\Support\InteractsWithSettings;
use Tests\TestCase;
class AccessoryAcceptanceTest extends TestCase
{
use InteractsWithSettings;
/**
* This can be absorbed into a bigger test
*/
public function testUsersNameIsIncludedInAccessoryAcceptedNotification()
{
Notification::fake();
$this->settings->enableAlertEmail();
$acceptance = CheckoutAcceptance::factory()
->pending()
->for(Accessory::factory()->appleMouse(), 'checkoutable')
->create();
$this->actingAs($acceptance->assignedTo)
->post(route('account.store-acceptance', $acceptance), ['asset_acceptance' => 'accepted'])
->assertSessionHasNoErrors();
$this->assertNotNull($acceptance->fresh()->accepted_at);
Notification::assertSentTo(
$acceptance,
function (AcceptanceAssetAcceptedNotification $notification) use ($acceptance) {
$this->assertStringContainsString(
$acceptance->assignedTo->present()->fullName,
$notification->toMail()->render()
);
return true;
}
);
}
/**
* This can be absorbed into a bigger test
*/
public function testUsersNameIsIncludedInAccessoryDeclinedNotification()
{
Notification::fake();
$this->settings->enableAlertEmail();
$acceptance = CheckoutAcceptance::factory()
->pending()
->for(Accessory::factory()->appleMouse(), 'checkoutable')
->create();
$this->actingAs($acceptance->assignedTo)
->post(route('account.store-acceptance', $acceptance), ['asset_acceptance' => 'declined'])
->assertSessionHasNoErrors();
$this->assertNotNull($acceptance->fresh()->declined_at);
Notification::assertSentTo(
$acceptance,
function (AcceptanceAssetDeclinedNotification $notification) use ($acceptance) {
$this->assertStringContainsString(
$acceptance->assignedTo->present()->fullName,
$notification->toMail($acceptance)->render()
);
return true;
}
);
}
}

Some files were not shown because too many files have changed in this diff Show more