mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge branch 'develop' into delete_asset_from_view_page
This commit is contained in:
commit
537aa04c9a
59
.chipperci.yml
Normal file
59
.chipperci.yml
Normal 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
|
||||
|
|
@ -175,6 +175,15 @@ REQUIRE_SAML=false
|
|||
API_THROTTLE_PER_MINUTE=120
|
||||
CSV_ESCAPE_FORMULAS=true
|
||||
|
||||
# --------------------------------------------
|
||||
# OPTIONAL: HASHING
|
||||
# --------------------------------------------
|
||||
HASHING_DRIVER='bcrypt'
|
||||
BCRYPT_ROUNDS=10
|
||||
ARGON_MEMORY=1024
|
||||
ARGON_THREADS=2
|
||||
ARGON_TIME=2
|
||||
|
||||
# --------------------------------------------
|
||||
# OPTIONAL: SCIM
|
||||
# --------------------------------------------
|
||||
|
|
|
@ -11,7 +11,7 @@ class SystemBackup extends Command
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'snipeit:backup';
|
||||
protected $signature = 'snipeit:backup {--filename=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
@ -37,7 +37,18 @@ class SystemBackup extends Command
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
$this->call('backup:run');
|
||||
if ($this->option('filename')) {
|
||||
$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');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,6 @@ class AcceptanceController extends Controller
|
|||
$pdf_filename = 'accepted-eula-'.date('Y-m-d-h-i-s').'.pdf';
|
||||
$sig_filename='';
|
||||
|
||||
|
||||
if ($request->input('asset_acceptance') == 'accepted') {
|
||||
|
||||
/**
|
||||
|
@ -153,12 +152,14 @@ class AcceptanceController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// this is horrible
|
||||
switch($acceptance->checkoutable_type){
|
||||
case 'App\Models\Asset':
|
||||
$pdf_view_route ='account.accept.accept-asset-eula';
|
||||
$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;
|
||||
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
|
||||
break;
|
||||
|
@ -167,7 +168,7 @@ class AcceptanceController extends Controller
|
|||
$pdf_view_route ='account.accept.accept-accessory-eula';
|
||||
$accessory = Accessory::find($item->id);
|
||||
$display_model = $accessory->name;
|
||||
$assigned_to = User::find($item->assignedTo);
|
||||
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
|
||||
break;
|
||||
|
||||
case 'App\Models\LicenseSeat':
|
||||
|
@ -250,11 +251,15 @@ class AcceptanceController extends Controller
|
|||
// This is the most horriblest
|
||||
switch($acceptance->checkoutable_type){
|
||||
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;
|
||||
break;
|
||||
|
||||
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;
|
||||
|
||||
case 'App\Models\LicenseSeat':
|
||||
|
@ -266,6 +271,8 @@ class AcceptanceController extends Controller
|
|||
break;
|
||||
|
||||
case 'App\Models\Consumable':
|
||||
$consumable = Consumable::find($item->id);
|
||||
$display_model = $consumable->name;
|
||||
$assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName;
|
||||
break;
|
||||
}
|
||||
|
@ -289,4 +296,4 @@ class AcceptanceController extends Controller
|
|||
return redirect()->to('account/accept')->with('success', $return_msg);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class AssetMaintenancesController extends Controller
|
|||
{
|
||||
$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')) {
|
||||
$maintenances = $maintenances->TextSearch($request->input('search'));
|
||||
|
|
|
@ -573,6 +573,7 @@ class AssetsController extends Controller
|
|||
// Update custom fields in the database.
|
||||
// Validation for these fields is handled through the AssetRequest form request
|
||||
$model = AssetModel::find($request->get('model_id'));
|
||||
|
||||
if (($model) && ($model->fieldset)) {
|
||||
foreach ($model->fieldset->fields as $field) {
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
|
|||
use App\Http\Transformers\CustomFieldsetsTransformer;
|
||||
use App\Http\Transformers\CustomFieldsTransformer;
|
||||
use App\Models\CustomFieldset;
|
||||
use App\Models\CustomField;
|
||||
use Illuminate\Http\Request;
|
||||
use Redirect;
|
||||
use View;
|
||||
|
@ -94,6 +95,18 @@ class CustomFieldsetsController extends Controller
|
|||
$fieldset->fill($request->all());
|
||||
|
||||
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')));
|
||||
}
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ class ImportController extends Controller
|
|||
// Run a backup immediately before processing
|
||||
if ($request->get('run-backup')) {
|
||||
\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 {
|
||||
\Log::debug('NO BACKUP requested via importer');
|
||||
}
|
||||
|
@ -193,6 +193,9 @@ class ImportController extends Controller
|
|||
case 'user':
|
||||
$redirectTo = 'users.index';
|
||||
break;
|
||||
case 'location':
|
||||
$redirectTo = 'locations.index';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($errors) { //Failure
|
||||
|
|
|
@ -23,10 +23,10 @@ class ManufacturersController extends Controller
|
|||
public function index(Request $request)
|
||||
{
|
||||
$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(
|
||||
['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');
|
||||
|
||||
if ($request->input('deleted') == 'true') {
|
||||
|
@ -49,6 +49,10 @@ class ManufacturersController extends Controller
|
|||
$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')) {
|
||||
$manufacturers->where('support_phone', '=', $request->input('support_phone'));
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ use App\Http\Requests\CustomFieldRequest;
|
|||
use App\Models\CustomField;
|
||||
use App\Models\CustomFieldset;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Redirect;
|
||||
|
||||
/**
|
||||
|
@ -45,7 +46,7 @@ class CustomFieldsController extends Controller
|
|||
* @see CustomFieldsController::storeField()
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v5.1.5]
|
||||
* @return Redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function show()
|
||||
|
@ -63,14 +64,17 @@ class CustomFieldsController extends Controller
|
|||
* @return \Illuminate\Support\Facades\View
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function create()
|
||||
public function create(Request $request)
|
||||
{
|
||||
$this->authorize('create', CustomField::class);
|
||||
$fieldsets = CustomFieldset::get();
|
||||
|
||||
return view('custom_fields.fields.edit', [
|
||||
'predefinedFormats' => Helper::predefined_formats(),
|
||||
'customFormat' => '',
|
||||
])->with('field', new CustomField());
|
||||
'customFormat' => '',
|
||||
'fieldsets' => $fieldsets,
|
||||
'field' => new CustomField(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,7 +83,7 @@ class CustomFieldsController extends Controller
|
|||
* @see CustomFieldsController::createField()
|
||||
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||
* @since [v1.8]
|
||||
* @return Redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function store(CustomFieldRequest $request)
|
||||
|
@ -104,6 +108,7 @@ class CustomFieldsController extends Controller
|
|||
"show_in_email" => $show_in_email,
|
||||
"is_unique" => $request->get("is_unique", 0),
|
||||
"display_in_user_view" => $display_in_user_view,
|
||||
"auto_add_to_fieldsets" => $request->get("auto_add_to_fieldsets", 0),
|
||||
"user_id" => Auth::id()
|
||||
]);
|
||||
|
||||
|
@ -115,10 +120,20 @@ class CustomFieldsController extends Controller
|
|||
}
|
||||
|
||||
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()->back()->withInput()
|
||||
return redirect()->back()->with('selected_fieldsets', $request->input('associate_fieldsets'))->withInput()
|
||||
->with('error', trans('admin/custom_fields/message.field.create.error'));
|
||||
}
|
||||
|
||||
|
@ -128,7 +143,7 @@ class CustomFieldsController extends Controller
|
|||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v3.0]
|
||||
* @return Redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
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'));
|
||||
} else {
|
||||
return redirect()->back()->withErrors(['message' => "Field is in use and cannot be deleted."]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->back()->withErrors(['message' => "Error deleting field from fieldset"]);
|
||||
|
@ -161,7 +175,7 @@ class CustomFieldsController extends Controller
|
|||
*
|
||||
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||
* @since [v1.8]
|
||||
* @return Redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function destroy($field_id)
|
||||
|
@ -190,12 +204,12 @@ class CustomFieldsController extends Controller
|
|||
* @return \Illuminate\Support\Facades\View
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function edit($id)
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
if ($field = CustomField::find($id)) {
|
||||
|
||||
$this->authorize('update', $field);
|
||||
|
||||
$fieldsets = CustomFieldset::get();
|
||||
$customFormat = '';
|
||||
if ((stripos($field->format, 'regex') === 0) && ($field->format !== CustomField::PREDEFINED_FORMATS['MAC'])) {
|
||||
$customFormat = $field->format;
|
||||
|
@ -204,6 +218,7 @@ class CustomFieldsController extends Controller
|
|||
return view('custom_fields.fields.edit', [
|
||||
'field' => $field,
|
||||
'customFormat' => $customFormat,
|
||||
'fieldsets' => $fieldsets,
|
||||
'predefinedFormats' => Helper::predefined_formats(),
|
||||
]);
|
||||
}
|
||||
|
@ -222,7 +237,7 @@ class CustomFieldsController extends Controller
|
|||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @param int $id
|
||||
* @since [v4.0]
|
||||
* @return Redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function update(CustomFieldRequest $request, $id)
|
||||
|
@ -249,6 +264,7 @@ class CustomFieldsController extends Controller
|
|||
$field->show_in_email = $show_in_email;
|
||||
$field->is_unique = $request->get("is_unique", 0);
|
||||
$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') {
|
||||
$field->format = e($request->get('custom_format'));
|
||||
|
@ -256,11 +272,21 @@ class CustomFieldsController extends Controller
|
|||
$field->format = e($request->get('format'));
|
||||
}
|
||||
|
||||
if($field->element == 'checkbox' || $field->element == 'radio'){
|
||||
if ($field->element == 'checkbox' || $field->element == 'radio'){
|
||||
$field->format = 'ANY';
|
||||
}
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
|
|
|
@ -93,16 +93,27 @@ class CustomFieldsetsController extends Controller
|
|||
{
|
||||
$this->authorize('create', CustomField::class);
|
||||
|
||||
$cfset = new CustomFieldset([
|
||||
$fieldset = new CustomFieldset([
|
||||
'name' => e($request->get('name')),
|
||||
'user_id' => Auth::user()->id,
|
||||
]);
|
||||
|
||||
$validator = Validator::make($request->all(), $cfset->rules);
|
||||
if ($validator->passes()) {
|
||||
$cfset->save();
|
||||
$validator = Validator::make($request->all(), $fieldset->rules);
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
|
|
73
app/Http/Controllers/GoogleAuthController.php
Normal file
73
app/Http/Controllers/GoogleAuthController.php
Normal 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'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
|
@ -68,6 +68,7 @@ class ManufacturersController extends Controller
|
|||
$manufacturer->user_id = Auth::id();
|
||||
$manufacturer->url = $request->input('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_email = $request->input('support_email');
|
||||
$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'));
|
||||
}
|
||||
|
||||
// Save the data
|
||||
// Save the data
|
||||
$manufacturer->name = $request->input('name');
|
||||
$manufacturer->url = $request->input('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_email = $request->input('support_email');
|
||||
|
||||
|
|
|
@ -641,6 +641,9 @@ class ReportsController extends Controller
|
|||
if (($request->filled('created_start')) && ($request->filled('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'))) {
|
||||
$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()
|
||||
{
|
||||
$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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1039,6 +1039,48 @@ class SettingsController extends Controller
|
|||
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.
|
||||
*
|
||||
|
@ -1094,7 +1136,7 @@ class SettingsController extends Controller
|
|||
public function postBackups()
|
||||
{
|
||||
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();
|
||||
|
||||
// Backup completed
|
||||
|
|
|
@ -67,7 +67,6 @@ class Importer extends Component
|
|||
'location' => 'Location',
|
||||
'maintained' => 'Maintained',
|
||||
'manufacturer' => 'Manufacturer',
|
||||
'notes' => 'Notes',
|
||||
'order_number' => 'Order Number',
|
||||
'purchase_cost' => 'Purchase Cost',
|
||||
'purchase_date' => 'Purchase Date',
|
||||
|
@ -81,11 +80,14 @@ class Importer extends Component
|
|||
|
||||
static $accessories = [
|
||||
'model_number' => 'Model Number',
|
||||
'notes' => 'Notes',
|
||||
];
|
||||
|
||||
static $assets = [
|
||||
'asset_tag' => 'Asset Tag',
|
||||
'asset_model' => 'Model Name',
|
||||
'asset_notes' => 'Asset Notes',
|
||||
'model_notes' => 'Model Notes',
|
||||
'byod' => 'BYOD',
|
||||
'checkout_class' => 'Checkout Type',
|
||||
'checkout_location' => 'Checkout Location',
|
||||
|
@ -99,6 +101,7 @@ class Importer extends Component
|
|||
static $consumables = [
|
||||
'item_no' => "Item Number",
|
||||
'model_number' => "Model Number",
|
||||
'notes' => 'Notes',
|
||||
'min_amt' => "Minimum Quantity",
|
||||
];
|
||||
|
||||
|
@ -111,13 +114,15 @@ class Importer extends Component
|
|||
'purchase_order' => 'Purchase Order',
|
||||
'reassignable' => 'Reassignable',
|
||||
'seats' => 'Seats',
|
||||
'notes' => 'Notes',
|
||||
];
|
||||
|
||||
static $users = [
|
||||
'employee_num' => 'Employee Number',
|
||||
'first_name' => 'First Name',
|
||||
'jobtitle' => 'Job Title',
|
||||
'last_name' => 'Last Name',
|
||||
'notes' => 'Notes',
|
||||
'jobtitle' => 'Job Title',
|
||||
'phone_number' => 'Phone Number',
|
||||
'manager_first_name' => 'Manager First Name',
|
||||
'manager_last_name' => 'Manager Last Name',
|
||||
|
@ -126,7 +131,25 @@ class Importer extends Component
|
|||
'city' => 'City',
|
||||
'state' => 'State',
|
||||
'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
|
||||
|
@ -150,6 +173,11 @@ class Importer extends Component
|
|||
'QTY',
|
||||
'Quantity'
|
||||
],
|
||||
'zip' =>
|
||||
[
|
||||
'Postal Code',
|
||||
'Post Code'
|
||||
],
|
||||
'min_amt' =>
|
||||
[
|
||||
'Min Amount',
|
||||
|
@ -159,6 +187,31 @@ class Importer extends Component
|
|||
[
|
||||
'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':
|
||||
$results = self::$general + self::$users;
|
||||
break;
|
||||
case 'location':
|
||||
$results = self::$general + self::$locations;
|
||||
break;
|
||||
default:
|
||||
$results = self::$general;
|
||||
}
|
||||
|
@ -252,7 +308,6 @@ class Importer extends Component
|
|||
$this->authorize('import');
|
||||
$this->progress = -1; // '-1' means 'don't show the progressbar'
|
||||
$this->progress_bar_class = 'progress-bar-warning';
|
||||
\Log::debug("Hey, we are calling MOUNT (in the importer-file) !!!!!!!!"); //fcuk
|
||||
$this->importTypes = [
|
||||
'asset' => trans('general.assets'),
|
||||
'accessory' => trans('general.accessories'),
|
||||
|
@ -260,6 +315,7 @@ class Importer extends Component
|
|||
'component' => trans('general.components'),
|
||||
'license' => trans('general.licenses'),
|
||||
'user' => trans('general.users'),
|
||||
'location' => trans('general.locations'),
|
||||
];
|
||||
|
||||
$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)
|
||||
{
|
||||
\Log::debug("TOGGLE EVENT FIRED!");
|
||||
\Log::debug("The ID we are trying to find is AS FOLLOWS: ".$id);
|
||||
|
||||
$this->activeFile = Import::find($id);
|
||||
$this->field_map = null;
|
||||
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 = $this->activeFile->field_map ? array_values($this->activeFile->field_map) : []; // this is wrong
|
||||
$this->file_id = $id;
|
||||
$this->import_errors = 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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ class CustomFieldRequest extends FormRequest
|
|||
{
|
||||
$rules = [];
|
||||
|
||||
$rules['associate_fieldsets.*'] = 'nullable|integer|exists:custom_fieldsets,id';
|
||||
|
||||
switch ($this->method()) {
|
||||
|
||||
// Brand new
|
||||
|
@ -54,4 +56,11 @@ class CustomFieldRequest extends FormRequest
|
|||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'associate_fieldsets.*.exists' => trans('admin/custom_fields/message/does_not_exist'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,9 @@ class CategoriesTransformer
|
|||
case 'component':
|
||||
$category->item_count = $category->components_count;
|
||||
break;
|
||||
case 'license':
|
||||
$category->item_count = $category->licenses_count;
|
||||
break;
|
||||
default:
|
||||
$category->item_count = 0;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ class CustomFieldsTransformer
|
|||
'type' => e($field->element),
|
||||
'required' => (($field->pivot) && ($field->pivot->required=='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'),
|
||||
'updated_at' => Helper::getFormattedDateObject($field->updated_at, 'datetime'),
|
||||
];
|
||||
|
|
|
@ -29,6 +29,7 @@ class ManufacturersTransformer
|
|||
'url' => e($manufacturer->url),
|
||||
'image' => ($manufacturer->image) ? Storage::disk('public')->url('manufacturers/'.e($manufacturer->image)) : null,
|
||||
'support_url' => e($manufacturer->support_url),
|
||||
'warranty_lookup_url' => e($manufacturer->warranty_lookup_url),
|
||||
'support_phone' => e($manufacturer->support_phone),
|
||||
'support_email' => e($manufacturer->support_email),
|
||||
'assets_count' => (int) $manufacturer->assets_count,
|
||||
|
|
|
@ -65,19 +65,22 @@ abstract class Importer
|
|||
'email' => 'email',
|
||||
'username' => 'username',
|
||||
'address' => 'address',
|
||||
'address2' => 'address2',
|
||||
'city' => 'city',
|
||||
'state' => 'state',
|
||||
'country' => 'country',
|
||||
'zip' => 'zip',
|
||||
'jobtitle' => 'job title',
|
||||
'employee_num' => 'employee number',
|
||||
'phone_number' => 'phone number',
|
||||
'first_name' => 'first name',
|
||||
'last_name' => 'last name',
|
||||
'department' => 'department',
|
||||
'manager_first_name' => 'manager first name',
|
||||
'manager_last_name' => 'manager last name',
|
||||
'manager_name' => 'manager full name',
|
||||
'manager_username' => 'manager username',
|
||||
'min_amt' => 'minimum quantity',
|
||||
'remote' => 'remote',
|
||||
'vip' => 'vip',
|
||||
];
|
||||
/**
|
||||
* Map of item fields->csv names
|
||||
|
@ -119,7 +122,7 @@ abstract class Importer
|
|||
} else {
|
||||
$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
|
||||
|
@ -198,11 +201,11 @@ abstract class Importer
|
|||
$val = $default;
|
||||
$key = $this->lookupCustomKey($key);
|
||||
|
||||
$this->log("Custom Key: ${key}");
|
||||
// $this->log("Custom Key: ${key}");
|
||||
if (array_key_exists($key, $array)) {
|
||||
$val = Encoding::toUTF8(trim($array[$key]));
|
||||
}
|
||||
$this->log("${key}: ${val}");
|
||||
//$this->log("${key}: ${val}");
|
||||
return $val;
|
||||
}
|
||||
|
||||
|
@ -280,8 +283,9 @@ abstract class Importer
|
|||
* @return User Model w/ matching name
|
||||
* @internal param array $user_array User details parsed from csv
|
||||
*/
|
||||
protected function createOrFetchUser($row)
|
||||
protected function createOrFetchUser($row, $type = 'user')
|
||||
{
|
||||
|
||||
$user_array = [
|
||||
'full_name' => $this->findCsvMatch($row, 'full_name'),
|
||||
'email' => $this->findCsvMatch($row, 'email'),
|
||||
|
@ -292,31 +296,36 @@ abstract class Importer
|
|||
'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)
|
||||
if (empty($user_array['full_name'])) {
|
||||
$this->log('Insufficient user data provided (Full name is required)- skipping user creation, just adding asset');
|
||||
// Maybe we're lucky and the username was passed and it already exists.
|
||||
if (!empty($user_array['username'])) {
|
||||
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;
|
||||
}
|
||||
|
||||
// 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.
|
||||
if (empty($user_array['email'])) {
|
||||
$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_array['first_name'] = $user_formatted_array['first_name'];
|
||||
$user_array['last_name'] = $user_formatted_array['last_name'];
|
||||
|
@ -326,14 +335,12 @@ abstract class Importer
|
|||
if ($this->usernameFormat == 'email') {
|
||||
$user_array['username'] = $user_array['email'];
|
||||
}
|
||||
}
|
||||
|
||||
// Does this ever actually fire??
|
||||
// Check for a matching user after trying to guess username.
|
||||
if ($user = User::where('username', $user_array['username'])->first()) {
|
||||
$this->log('User '.$user_array['username'].' already exists');
|
||||
|
||||
return $user;
|
||||
// Check for a matching username one more time after trying to guess username.
|
||||
if ($user = User::where('username', $user_array['username'])->first()) {
|
||||
$this->log('User '.$user_array['username'].' already exists');
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// No Luck, let's create one.
|
||||
// No luck finding a user on username or first name, let's create one.
|
||||
$user = new User;
|
||||
$user->first_name = $user_array['first_name'];
|
||||
$user->last_name = $user_array['last_name'];
|
||||
|
@ -356,9 +363,9 @@ abstract class Importer
|
|||
|
||||
if ($user->save()) {
|
||||
$this->log('User '.$user_array['username'].' created');
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
$this->logError($user, 'User "'.$user_array['username'].'" was not able to be created.');
|
||||
|
||||
return false;
|
||||
|
|
|
@ -60,8 +60,8 @@ class ItemImporter extends Importer
|
|||
$this->item['department_id'] = $this->createOrFetchDepartment($item_department);
|
||||
}
|
||||
|
||||
$item_manager_first_name = $this->findCsvMatch($row, 'manage_first_name');
|
||||
$item_manager_last_name = $this->findCsvMatch($row, 'manage_last_name');
|
||||
$item_manager_first_name = $this->findCsvMatch($row, 'manager_first_name');
|
||||
$item_manager_last_name = $this->findCsvMatch($row, 'manager_last_name');
|
||||
|
||||
if ($this->shouldUpdateField($item_manager_first_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);
|
||||
}
|
||||
|
||||
if (get_class($this) != LocationImporter::class) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) {
|
||||
return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location')));
|
||||
}
|
||||
|
|
102
app/Importer/LocationImporter.php
Normal file
102
app/Importer/LocationImporter.php
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -90,7 +90,7 @@ class Asset extends Depreciable
|
|||
|
||||
protected $rules = [
|
||||
'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',
|
||||
'company_id' => 'integer|nullable',
|
||||
'warranty_months' => 'numeric|nullable|digits_between:0,240',
|
||||
|
@ -909,7 +909,13 @@ class Asset extends Depreciable
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getComponentCost(){
|
||||
$cost = 0;
|
||||
foreach($this->components as $component) {
|
||||
$cost += $component->pivot->assigned_qty*$component->purchase_cost;
|
||||
}
|
||||
return $cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* -----------------------------------------------
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class CheckoutAcceptance extends Model
|
||||
{
|
||||
use SoftDeletes, Notifiable;
|
||||
use HasFactory, SoftDeletes, Notifiable;
|
||||
|
||||
protected $casts = [
|
||||
'accepted_at' => 'datetime',
|
||||
|
|
|
@ -52,6 +52,7 @@ class CustomField extends Model
|
|||
'name' => 'required|unique:custom_fields',
|
||||
'element' => 'required|in:text,listbox,textarea,checkbox,radio',
|
||||
'field_encrypted' => 'nullable|boolean',
|
||||
'auto_add_to_fieldsets' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -69,6 +70,8 @@ class CustomField extends Model
|
|||
'show_in_email',
|
||||
'is_unique',
|
||||
'display_in_user_view',
|
||||
'auto_add_to_fieldsets',
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,11 +26,12 @@ class Location extends SnipeModel
|
|||
protected $table = 'locations';
|
||||
protected $rules = [
|
||||
'name' => 'required|min:2|max:255|unique_undeleted',
|
||||
'city' => 'min:2|max:255|nullable',
|
||||
'country' => 'min:2|max:255|nullable',
|
||||
'address' => 'max:80|nullable',
|
||||
'address2' => 'max:80|nullable',
|
||||
'zip' => 'min:3|max:10|nullable',
|
||||
'address' => 'max:191|nullable',
|
||||
'address2' => 'max:191|nullable',
|
||||
'city' => 'max:191|nullable',
|
||||
'state' => 'min:2|max:191|nullable',
|
||||
'country' => 'min:2|max:191|nullable',
|
||||
'zip' => 'max:10|nullable',
|
||||
'manager_id' => 'exists:users,id|nullable',
|
||||
'parent_id' => 'non_circular:locations,id',
|
||||
];
|
||||
|
|
|
@ -23,8 +23,9 @@ class Manufacturer extends SnipeModel
|
|||
protected $rules = [
|
||||
'name' => 'required|min:2|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL',
|
||||
'url' => 'url|nullable',
|
||||
'support_url' => 'url|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'];
|
||||
|
@ -51,6 +52,7 @@ class Manufacturer extends SnipeModel
|
|||
'support_phone',
|
||||
'support_url',
|
||||
'url',
|
||||
'warranty_lookup_url',
|
||||
];
|
||||
|
||||
use Searchable;
|
||||
|
|
|
@ -76,6 +76,7 @@ class Setting extends Model
|
|||
'audit_interval' => 'numeric|nullable',
|
||||
'custom_forgot_pass_url' => 'url|nullable',
|
||||
'privacy_policy_link' => 'nullable|url',
|
||||
'google_client_id' => 'nullable|ends_with:apps.googleusercontent.com'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
@ -86,6 +87,9 @@ class Setting extends Model
|
|||
'webhook_endpoint',
|
||||
'webhook_channel',
|
||||
'webhook_botname',
|
||||
'google_login',
|
||||
'google_client_id',
|
||||
'google_client_secret',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,17 +16,17 @@ class Supplier extends SnipeModel
|
|||
protected $table = 'suppliers';
|
||||
|
||||
protected $rules = [
|
||||
'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',
|
||||
'name' => 'required|min:1|max:255|unique_undeleted',
|
||||
'fax' => 'min:7|max:35|nullable',
|
||||
'phone' => 'min:7|max:35|nullable',
|
||||
'contact' => 'max:100|nullable',
|
||||
'notes' => 'max:191|nullable', // Default string length is 191 characters..
|
||||
'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',
|
||||
'url' => 'sometimes|nullable|string|max:250',
|
||||
];
|
||||
|
|
|
@ -98,6 +98,11 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
'start_date' => 'nullable|date_format:Y-m-d',
|
||||
'end_date' => 'nullable|date_format:Y-m-d|after_or_equal:start_date',
|
||||
'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',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -534,6 +534,18 @@ class AssetPresenter extends Presenter
|
|||
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.
|
||||
* @return string
|
||||
|
|
|
@ -151,6 +151,21 @@ class LicensePresenter extends Presenter
|
|||
'visible' => false,
|
||||
'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',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
|
@ -47,7 +47,7 @@ class ManufacturerPresenter extends Presenter
|
|||
'switchable' => true,
|
||||
'title' => trans('admin/manufacturers/table.url'),
|
||||
'visible' => true,
|
||||
'formatter' => 'linkFormatter',
|
||||
'formatter' => 'externalLinkFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'support_url',
|
||||
|
@ -56,7 +56,7 @@ class ManufacturerPresenter extends Presenter
|
|||
'switchable' => true,
|
||||
'title' => trans('admin/manufacturers/table.support_url'),
|
||||
'visible' => true,
|
||||
'formatter' => 'linkFormatter',
|
||||
'formatter' => 'externalLinkFormatter',
|
||||
],
|
||||
|
||||
[
|
||||
|
@ -78,6 +78,15 @@ class ManufacturerPresenter extends Presenter
|
|||
'visible' => true,
|
||||
'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',
|
||||
|
|
|
@ -7,6 +7,7 @@ use App\Models\Setting;
|
|||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* Class UserPresenter
|
||||
|
@ -399,17 +400,25 @@ class UserPresenter extends Presenter
|
|||
public function gravatar()
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
if (Setting::getSettings()->load_remote == '1') {
|
||||
if ($this->model->gravatar != '') {
|
||||
|
||||
$gravatar = md5(strtolower(trim($this->model->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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.4 <8.3",
|
||||
"php": ">=7.4.3 <8.2",
|
||||
"ext-curl": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-json": "*",
|
||||
|
@ -46,6 +46,7 @@
|
|||
"laravel/helpers": "^1.4",
|
||||
"laravel/passport": "^10.1",
|
||||
"laravel/slack-notification-channel": "^2.3",
|
||||
"laravel/socialite": "^5.6",
|
||||
"laravel/tinker": "^2.6",
|
||||
"laravel/ui": "^3.3",
|
||||
"laravelcollective/html": "^6.2",
|
||||
|
|
156
composer.lock
generated
156
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "590171872e4a6a29c78efde99fbbf00e",
|
||||
"content-hash": "4c82b2e171fb02a3ef024906db5d74c9",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alek13/slack",
|
||||
|
@ -2673,6 +2673,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"abandoned": true,
|
||||
"time": "2022-02-23T14:25:13+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -3604,6 +3605,75 @@
|
|||
},
|
||||
"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",
|
||||
"version": "v2.7.2",
|
||||
|
@ -3803,6 +3873,7 @@
|
|||
"issues": "https://github.com/LaravelCollective/html/issues",
|
||||
"source": "https://github.com/LaravelCollective/html"
|
||||
},
|
||||
"abandoned": "spatie/laravel-html",
|
||||
"time": "2022-02-08T21:02:54+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -4532,6 +4603,82 @@
|
|||
],
|
||||
"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",
|
||||
"version": "8.3.5",
|
||||
|
@ -5007,6 +5154,10 @@
|
|||
"source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/maennchen",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://opencollective.com/zipstream",
|
||||
"type": "open_collective"
|
||||
|
@ -13984,6 +14135,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"abandoned": true,
|
||||
"time": "2020-12-07T05:51:20+00:00"
|
||||
},
|
||||
{
|
||||
|
@ -16410,7 +16562,7 @@
|
|||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=7.4 <8.3",
|
||||
"php": ">=7.4.3 <8.2",
|
||||
"ext-curl": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-json": "*",
|
||||
|
|
|
@ -216,7 +216,8 @@ return [
|
|||
*/
|
||||
|
||||
'require_saml' => env('REQUIRE_SAML', false),
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Demo Mode Lockdown
|
||||
|
@ -294,6 +295,7 @@ return [
|
|||
Laravel\Tinker\TinkerServiceProvider::class,
|
||||
Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class,
|
||||
Eduardokum\LaravelMailAutoEmbed\ServiceProvider::class,
|
||||
Laravel\Socialite\SocialiteServiceProvider::class,
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
|
@ -366,6 +368,7 @@ return [
|
|||
'Image' => Intervention\Image\ImageServiceProvider::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)
|
||||
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
|
||||
|
||||
|
||||
],
|
||||
|
|
|
@ -15,7 +15,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
'driver' => env('HASHING_DRIVER', 'bcrypt'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -44,9 +44,9 @@ return [
|
|||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 1024,
|
||||
'threads' => 2,
|
||||
'time' => 2,
|
||||
'memory' => env('ARGON_MEMORY', 1024),
|
||||
'threads' => env('ARGON_THREADS', 2),
|
||||
'time' => env('ARGON_TIME', 2),
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
@ -140,8 +140,8 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
'sendmail' => env('SENDMAIL_PATH', ini_get('sendmail_path')),
|
||||
|
||||
'markdown' => [
|
||||
'theme' => 'default',
|
||||
'paths' => [
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
return array (
|
||||
'app_version' => 'v6.1.0',
|
||||
'full_app_version' => 'v6.1.0 - build 10161-ga8ca3ad2a',
|
||||
'build_version' => '10161',
|
||||
'app_version' => 'v6.1.1-pre',
|
||||
'full_app_version' => 'v6.1.1-pre - build 10534-g609b1646e',
|
||||
'build_version' => '10534',
|
||||
'prerelease_version' => '',
|
||||
'hash_version' => 'ga8ca3ad2a',
|
||||
'full_hash' => 'v6.1.0-127-ga8ca3ad2a',
|
||||
'hash_version' => 'g609b1646e',
|
||||
'full_hash' => 'v6.1.1-pre-292-g609b1646e',
|
||||
'branch' => 'develop',
|
||||
);
|
41
database/factories/CheckoutAcceptanceFactory.php
Normal file
41
database/factories/CheckoutAcceptanceFactory.php
Normal 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,
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ class CustomFieldFactory extends Factory
|
|||
'name' => $this->faker->catchPhrase(),
|
||||
'format' => '',
|
||||
'element' => 'text',
|
||||
'auto_add_to_fieldsets' => '0',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ class ManufacturerFactory extends Factory
|
|||
'name' => 'Apple',
|
||||
'url' => 'https://apple.com',
|
||||
'support_url' => 'https://support.apple.com',
|
||||
'warranty_lookup_url' => 'https://checkcoverage.apple.com',
|
||||
'image' => 'apple.jpg',
|
||||
];
|
||||
});
|
||||
|
@ -50,6 +51,7 @@ class ManufacturerFactory extends Factory
|
|||
'name' => 'Microsoft',
|
||||
'url' => 'https://microsoft.com',
|
||||
'support_url' => 'https://support.microsoft.com',
|
||||
'warranty_lookup_url' => 'https://account.microsoft.com/devices',
|
||||
'image' => 'microsoft.png',
|
||||
];
|
||||
});
|
||||
|
@ -62,6 +64,7 @@ class ManufacturerFactory extends Factory
|
|||
'name' => 'Dell',
|
||||
'url' => 'https://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',
|
||||
];
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
|
||||
});
|
||||
}
|
||||
}
|
|
@ -54,6 +54,6 @@
|
|||
"tableexport.jquery.plugin": "1.27.0",
|
||||
"tether": "^1.4.0",
|
||||
"vue-resource": "^1.5.2",
|
||||
"webpack": "^5.77.0"
|
||||
"webpack": "^5.78.0"
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
BIN
public/css/dist/all.css
vendored
BIN
public/css/dist/all.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-black-dark.css
vendored
BIN
public/css/dist/skins/skin-black-dark.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-black-dark.min.css
vendored
BIN
public/css/dist/skins/skin-black-dark.min.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-blue-dark.css
vendored
BIN
public/css/dist/skins/skin-blue-dark.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-blue-dark.min.css
vendored
BIN
public/css/dist/skins/skin-blue-dark.min.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-green-dark.css
vendored
BIN
public/css/dist/skins/skin-green-dark.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-green-dark.min.css
vendored
BIN
public/css/dist/skins/skin-green-dark.min.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-orange-dark.css
vendored
BIN
public/css/dist/skins/skin-orange-dark.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-orange-dark.min.css
vendored
BIN
public/css/dist/skins/skin-orange-dark.min.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-red-dark.css
vendored
BIN
public/css/dist/skins/skin-red-dark.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-red-dark.min.css
vendored
BIN
public/css/dist/skins/skin-red-dark.min.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-yellow-dark.css
vendored
BIN
public/css/dist/skins/skin-yellow-dark.css
vendored
Binary file not shown.
BIN
public/css/dist/skins/skin-yellow-dark.min.css
vendored
BIN
public/css/dist/skins/skin-yellow-dark.min.css
vendored
Binary file not shown.
|
@ -1,24 +1,24 @@
|
|||
{
|
||||
"/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/build/overrides.css": "/css/build/overrides.css?id=ce20eefb1895545e882840c480bca0dc",
|
||||
"/css/build/app.css": "/css/build/app.css?id=3afc900b0a697567f8285f46aded1c89",
|
||||
"/css/build/overrides.css": "/css/build/overrides.css?id=97a58ce3a89cd0043a1c54ecf63d4686",
|
||||
"/css/build/app.css": "/css/build/app.css?id=02dbcc25fce08e9b9a9b285883821805",
|
||||
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=dc383f8560a8d4adb51d44fb4043e03b",
|
||||
"/css/dist/skins/skin-orange.css": "/css/dist/skins/skin-orange.css?id=6f0563e726c2fe4fab4026daaa5bfdf2",
|
||||
"/css/dist/skins/skin-orange-dark.css": "/css/dist/skins/skin-orange-dark.css?id=ca38553d041220a4296dda555940e056",
|
||||
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=032f18fdd48936784cfcfe70712a68ae",
|
||||
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=e5b6ec4691d8fd647d38722886f983e6",
|
||||
"/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=07273f6ca3c698a39e8fc2075af4fa07",
|
||||
"/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-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-red-dark.css": "/css/dist/skins/skin-red-dark.css?id=218c6d947f73c767d23a663a9859d97e",
|
||||
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=87c6506e9aac3ebc68dfd99b6f983602",
|
||||
"/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=bdfc704731682c67645a2248b0b8d2d7",
|
||||
"/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-contrast.css": "/css/dist/skins/skin-contrast.css?id=da6c7997d9de2f8329142399f0ce50da",
|
||||
"/css/dist/skins/skin-red.css": "/css/dist/skins/skin-red.css?id=44bf834f2110504a793dadec132a5898",
|
||||
"/css/dist/all.css": "/css/dist/all.css?id=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.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7",
|
||||
"/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/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-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-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-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-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-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-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-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"
|
||||
}
|
||||
|
|
|
@ -195,6 +195,9 @@ a.accordion-header {
|
|||
.btn-info.btn-outline {
|
||||
color: #5bc0de;
|
||||
}
|
||||
.btn-warning{
|
||||
background-color:#f39c12 !important;
|
||||
}
|
||||
|
||||
.btn-warning.btn-outline {
|
||||
color: #f0ad4e;
|
||||
|
@ -499,14 +502,14 @@ h4 {
|
|||
background: #FFFFFF;
|
||||
border-top: 1px solid #dddddd;
|
||||
display: table-row;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.row-new-striped > .row:nth-of-type(odd) {
|
||||
background-color: #F8F8F8;
|
||||
border-top: 1px solid #dddddd;
|
||||
display: table-row;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.row-new-striped div {
|
||||
|
@ -740,7 +743,7 @@ input[type="checkbox"] {
|
|||
|
||||
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: "";
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
|
|
|
@ -135,6 +135,9 @@ a {
|
|||
#ldapad_test_results.well.well-sm{
|
||||
color: var(--back-main);
|
||||
}
|
||||
a.actions {
|
||||
color:#fff !important;
|
||||
}
|
||||
//pagination
|
||||
.pagination > li >a{
|
||||
color: var(--light-link);
|
||||
|
@ -147,6 +150,23 @@ a {
|
|||
.pagination > .active > a:hover{
|
||||
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 {
|
||||
background-color: var(--header);
|
||||
|
|
|
@ -132,6 +132,9 @@ a {
|
|||
#ldapad_test_results.well.well-sm{
|
||||
color: var(--back-main);
|
||||
}
|
||||
a.actions {
|
||||
color:#fff !important;
|
||||
}
|
||||
//pagination
|
||||
.pagination > li >a{
|
||||
color: var(--light-link);
|
||||
|
@ -394,6 +397,12 @@ a {
|
|||
color: var(--visited-link)
|
||||
}
|
||||
}
|
||||
#customFieldsTable a[href*='/models'] {
|
||||
color: var(--back-sub);
|
||||
}
|
||||
#customFieldsTable a[href*='/fieldsets']{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.row-striped {
|
||||
vertical-align: top;
|
||||
|
|
|
@ -131,6 +131,9 @@ a {
|
|||
#ldapad_test_results.well.well-sm{
|
||||
color: var(--back-main);
|
||||
}
|
||||
a.actions {
|
||||
color:#fff !important;
|
||||
}
|
||||
//pagination
|
||||
.pagination > li >a{
|
||||
color: var(--light-link);
|
||||
|
@ -180,10 +183,6 @@ h2.task_menu{
|
|||
color: var(--text-main);
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: var(--link);
|
||||
}
|
||||
|
||||
.btn-primary.hover {
|
||||
color: var(--nav-link);
|
||||
}
|
||||
|
@ -385,6 +384,12 @@ a {
|
|||
color: var(--visited-link)
|
||||
}
|
||||
}
|
||||
#customFieldsTable a[href*='/models'] {
|
||||
color: var(--back-sub);
|
||||
}
|
||||
#customFieldsTable a[href*='/fieldsets']{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.row-striped {
|
||||
vertical-align: top;
|
||||
|
|
|
@ -119,6 +119,9 @@ li.dropdown-item-marker {
|
|||
#ldapad_test_results.well.well-sm{
|
||||
color: var(--back-main);
|
||||
}
|
||||
a.actions {
|
||||
color:#fff !important;
|
||||
}
|
||||
//pagination
|
||||
.pagination > li >a{
|
||||
color: var(--light-link);
|
||||
|
@ -378,6 +381,12 @@ input[type=text], input[type=search] {
|
|||
.box-header.with-border {
|
||||
border-bottom: #000;
|
||||
}
|
||||
#customFieldsTable a[href*='/models'] {
|
||||
color: var(--back-sub);
|
||||
}
|
||||
#customFieldsTable a[href*='/fieldsets']{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.row-striped {
|
||||
vertical-align: top;
|
||||
|
|
|
@ -58,8 +58,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.btn, .btn:hover {
|
||||
color: #fff;
|
||||
|
||||
|
@ -134,6 +132,7 @@ a {
|
|||
#ldapad_test_results.well.well-sm{
|
||||
color: var(--back-main);
|
||||
}
|
||||
|
||||
//pagination
|
||||
.pagination > li >a{
|
||||
color: var(--light-link);
|
||||
|
@ -186,14 +185,12 @@ h2.task_menu{
|
|||
a:link {
|
||||
color: var(--link);
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: var(--nav-link);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: var(--hover-link);
|
||||
}
|
||||
a:visited {
|
||||
color: var(--nav-link);
|
||||
}
|
||||
.far fa-life-ring{
|
||||
color:var(--link);
|
||||
}
|
||||
|
@ -380,7 +377,6 @@ input[type=text], input[type=search] {
|
|||
}
|
||||
.table-striped>tbody>tr:nth-of-type(even){
|
||||
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 {
|
||||
color: var(--text-main);
|
||||
|
@ -394,16 +390,22 @@ a {
|
|||
color: var(--link);
|
||||
|
||||
&:link {
|
||||
color: var(--link) }
|
||||
color: var(--nav-link);
|
||||
}
|
||||
&:hover {
|
||||
color: var(--hover-link);
|
||||
color: var(--nav-link);
|
||||
text-decoration: underline;
|
||||
}
|
||||
&: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 {
|
||||
vertical-align: top;
|
||||
line-height: 2.6;
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
}
|
||||
|
||||
.btn, .btn:hover {
|
||||
color: #000;
|
||||
|
||||
&.btn-primary, .btn-primary:link {
|
||||
background-color: var(--button-default);
|
||||
|
@ -60,7 +59,6 @@
|
|||
color: #545454;
|
||||
}
|
||||
|
||||
|
||||
&a.btn-primary:hover {
|
||||
background-color: var(--button-hover);
|
||||
border-color: var(--button-hover);
|
||||
|
@ -77,6 +75,9 @@
|
|||
color: #545454;
|
||||
}
|
||||
}
|
||||
a.actions {
|
||||
color:#fff !important;
|
||||
}
|
||||
|
||||
/**
|
||||
The dropdown is white, so use a darker color
|
||||
|
@ -165,7 +166,7 @@ a.btn.btn-default{
|
|||
color:var(--nav-link);
|
||||
}
|
||||
.bootstrap-table .fixed-table-container .table thead th .sortable {
|
||||
color: var(--nav-link);
|
||||
color: var(--text-main);
|
||||
}
|
||||
.bootstrap-table .fixed-table-toolbar .columns label {
|
||||
color:#000;
|
||||
|
@ -355,12 +356,9 @@ input[type=text], input[type=search] {
|
|||
.skin-yellow-dark .main-header .navbar .dropdown-menu li a {
|
||||
color: var(--header);
|
||||
}
|
||||
div.th-inner{
|
||||
tr th div.th-inner {
|
||||
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 {
|
||||
background-color: var(--back-main);
|
||||
color: var(--text-main);
|
||||
|
|
|
@ -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_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
|
||||
'clone' => 'Clone Accessory',
|
||||
'delete_disabled' => 'This accessory cannot be deleted yet because some items are still checked out.',
|
||||
|
||||
);
|
||||
|
|
|
@ -49,4 +49,6 @@ return [
|
|||
'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_table' => 'Visible to User',
|
||||
'auto_add_to_fieldsets' => 'Automatically add this to every new fieldset',
|
||||
'add_to_preexisting_fieldsets' => 'Add to any existing fieldsets',
|
||||
];
|
||||
|
|
|
@ -8,6 +8,7 @@ return [
|
|||
'change' => 'In/Out',
|
||||
'checkout_date' => 'Checkout Date',
|
||||
'checkoutto' => 'Checked Out',
|
||||
'components_cost' => 'Total Components Cost',
|
||||
'current_value' => 'Current Value',
|
||||
'diff' => 'Diff',
|
||||
'dl_csv' => 'Download CSV',
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
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.',
|
||||
'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. ',
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ return array(
|
|||
'support_email' => 'Support Email',
|
||||
'support_phone' => 'Support Phone',
|
||||
'support_url' => 'Support URL',
|
||||
'warranty_lookup_url' => 'Warranty Lookup URL',
|
||||
'update' => 'Update Manufacturer',
|
||||
'url' => 'URL',
|
||||
|
||||
|
|
|
@ -330,4 +330,9 @@ return [
|
|||
'setup_migration_create_user' => 'Next: Create User',
|
||||
'ldap_settings_link' => 'LDAP Settings Page',
|
||||
'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'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. ',
|
||||
|
||||
];
|
||||
|
|
|
@ -12,5 +12,8 @@ return [
|
|||
'remember_me' => 'Remember Me',
|
||||
'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> ',
|
||||
];
|
||||
'google_login' => 'Or login with Google Workspace',
|
||||
'google_login_failed' => 'Google Login failed, please try again.',
|
||||
|
||||
];
|
||||
|
||||
|
|
|
@ -91,6 +91,8 @@ return [
|
|||
'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>.',
|
||||
'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',
|
||||
'delete_seats' => 'Deleted Seats',
|
||||
'deletion_failed' => 'Deletion failed',
|
||||
|
|
|
@ -67,6 +67,8 @@ return [
|
|||
'array' => 'The :attribute must have at least :min items.',
|
||||
],
|
||||
'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.',
|
||||
'numeric' => 'The :attribute must be a number.',
|
||||
'present' => 'The :attribute field must be present.',
|
||||
|
|
|
@ -12,43 +12,6 @@
|
|||
@parent
|
||||
@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 --}}
|
||||
@section('content')
|
||||
{{-- Page content --}}
|
||||
|
@ -136,7 +99,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- histor tab pane -->
|
||||
<!-- history tab pane -->
|
||||
<div class="tab-pane fade" id="history">
|
||||
<div class="table table-responsive">
|
||||
<div class="row">
|
||||
|
@ -271,13 +234,13 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- side address column -->
|
||||
|
@ -294,10 +257,10 @@
|
|||
|
||||
@if ($accessory->company)
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('companies.show', $accessory->company->id) }}">{{ $accessory->company->name }} </a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -306,10 +269,10 @@
|
|||
|
||||
@if ($accessory->category)
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('categories.show', $accessory->category->id) }}">{{ $accessory->category->name }} </a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -317,88 +280,75 @@
|
|||
|
||||
|
||||
@if ($accessory->notes)
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-9">
|
||||
{!! nl2br(e($accessory->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->numRemaining() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->users_count }}
|
||||
</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('checkout', \App\Models\Accessory::class)
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<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>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="history">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
class="table table-striped snipe-table"
|
||||
data-cookie-id-table="AccessoryHistoryTable"
|
||||
data-id-table="AccessoryHistoryTable"
|
||||
id="AccessoryHistoryTable"
|
||||
data-pagination="true"
|
||||
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-->
|
||||
@can('delete', $accessory)
|
||||
@if ($accessory->users_count == 0)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<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">
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<span data-tooltip="true" title=" {{ trans('admin/accessories/general.delete_disabled') }}">
|
||||
<a href="#" class="btn btn-block btn-danger disabled">
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
@ -411,5 +361,13 @@
|
|||
|
||||
|
||||
@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')
|
||||
@stop
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
</div> <!-- end row -->
|
||||
|
||||
@if (!config('app.require_saml') && $snipeSettings->saml_enabled)
|
||||
<div class="row ">
|
||||
<div class="row">
|
||||
<div class="text-right col-md-12">
|
||||
<a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
||||
</div>
|
||||
|
@ -73,22 +73,32 @@
|
|||
</div>
|
||||
<div class="box-footer">
|
||||
@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
|
||||
<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
|
||||
</div>
|
||||
<div class="text-right col-md-12 col-sm-12 col-xs-12" style="padding-top: 10px;">
|
||||
|
||||
@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'))
|
||||
<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
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</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> <!-- end row -->
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@php
|
||||
use App\Models\CustomField;
|
||||
@endphp
|
||||
@extends('layouts/default', [
|
||||
'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'),
|
||||
'helpPosition' => 'right',
|
||||
])
|
||||
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
@ -21,24 +21,31 @@
|
|||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<!-- Horizontal Form -->
|
||||
@if ($field->id)
|
||||
{{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }}
|
||||
{{ method_field('PUT') }}
|
||||
@else
|
||||
{{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }}
|
||||
@endif
|
||||
@if ($field->id)
|
||||
{{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }}
|
||||
{{ method_field('PUT') }}
|
||||
@else
|
||||
{{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }}
|
||||
@endif
|
||||
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<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="col-md-8">
|
||||
|
||||
<!-- Name -->
|
||||
<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') }}
|
||||
</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')) }}
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
@ -46,10 +53,10 @@
|
|||
|
||||
<!-- Element Type -->
|
||||
<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') }}
|
||||
</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') !!}
|
||||
{!! $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 -->
|
||||
<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') }}
|
||||
</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']) !!}
|
||||
{!! $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>
|
||||
|
@ -71,7 +78,7 @@
|
|||
|
||||
<!-- Format -->
|
||||
<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') }}
|
||||
</label>
|
||||
@php
|
||||
|
@ -80,17 +87,17 @@
|
|||
$field_format = 'CUSTOM REGEX';
|
||||
}
|
||||
@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')) }}
|
||||
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Format -->
|
||||
<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') }}
|
||||
</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}$/')) }}
|
||||
<p class="help-block">{!! trans('admin/custom_fields/general.field_custom_format_help') !!}</p>
|
||||
|
||||
|
@ -101,68 +108,111 @@
|
|||
|
||||
<!-- Help Text -->
|
||||
<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') }}
|
||||
</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')) }}
|
||||
<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>') !!}
|
||||
</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 -->
|
||||
<div class="form-group {{ $errors->has('encrypted') ? ' has-error' : '' }}">
|
||||
<div class="col-md-8 col-md-offset-4">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
<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') }}
|
||||
</label>
|
||||
</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">
|
||||
<p><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.encrypt_field_help') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<!-- Show in Email -->
|
||||
<div class="form-group {{ $errors->has('show_in_email') ? ' has-error' : '' }}" id="show_in_email">
|
||||
<div class="col-md-8 col-md-offset-4">
|
||||
<!-- Show in Email -->
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<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"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.show_in_email') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 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">
|
||||
<!-- Show in View All Assets profile view -->
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<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"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.display_in_user_view') }}
|
||||
</label>
|
||||
</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>
|
||||
|
||||
<!-- Value Must be Unique -->
|
||||
<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>
|
||||
|
||||
</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 class="box-footer text-right">
|
||||
|
@ -171,20 +221,22 @@
|
|||
|
||||
</div> <!--.box.box-default-->
|
||||
|
||||
{{ Form::close() }}
|
||||
|
||||
</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>
|
||||
{{ Form::close() }}
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(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
|
||||
$(".format").change(function(){
|
||||
$(this).find("option:selected").each(function(){
|
||||
|
|
|
@ -178,26 +178,29 @@
|
|||
</td>
|
||||
<td>
|
||||
<nobr>
|
||||
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
|
||||
@can('update', $field)
|
||||
<a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm">
|
||||
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.edit') }}</span>
|
||||
</a>
|
||||
<a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm">
|
||||
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.edit') }}</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', $field)
|
||||
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
|
||||
@if($field->fieldset->count()>0)
|
||||
<button type="submit" class="btn btn-danger btn-sm disabled" disabled>
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span></button>
|
||||
@else
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
|
||||
@if($field->fieldset->count()>0)
|
||||
<button type="submit" class="btn btn-danger btn-sm disabled" disabled>
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span></button>
|
||||
@else
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@endcan
|
||||
{{ Form::close() }}
|
||||
</nobr>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -469,6 +469,25 @@
|
|||
</div>
|
||||
</div>
|
||||
@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))
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
@ -534,20 +553,10 @@
|
|||
{{ $asset->warranty_months }}
|
||||
{{ trans('admin/hardware/form.months') }}
|
||||
|
||||
@if ($asset->serial && $asset->model->manufacturer)
|
||||
@if ((strtolower($asset->model->manufacturer->name) == "apple") || (str_starts_with(str_replace(' ','',strtolower($asset->model->manufacturer->name)),"appleinc")))
|
||||
<a href="https://checkcoverage.apple.com/?locale={{ (str_replace('-','_',\App\Models\Setting::getSettings()->locale)) }}" target="_blank">
|
||||
<i class="fa-brands fa-apple" aria-hidden="true"><span class="sr-only">{{ trans('hardware/general.mfg_warranty_lookup') }}</span></i>
|
||||
@if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!=''))
|
||||
<a href="{{ $asset->present()->dynamicWarrantyUrl() }}" 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>
|
||||
</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
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1152,17 +1161,15 @@
|
|||
data-cookie="true">
|
||||
<thead>
|
||||
<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-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-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-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>
|
||||
@endif
|
||||
<th class="col-md-3" data-visible="false" data-field="file" data-visible="false" data-formatter="fileUploadFormatter">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-3" data-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>
|
||||
<th class="col-sm-2" data-field="log_meta" data-visible="true" data-formatter="changeLogFormatter">{{ trans('admin/hardware/table.changed')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -30,6 +30,17 @@
|
|||
</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 -->
|
||||
<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') }}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
| **{{ ucfirst(trans('general.accepted')) }}** | {{ $accepted_date }} |
|
||||
@endif
|
||||
@if (isset($declined_date))
|
||||
| **{{ trans('general.declined') }}** | {{ $declined_date }} |
|
||||
| **{{ ucfirst(trans('general.declined')) }}** | {{ $declined_date }} |
|
||||
@endif
|
||||
@if ((isset($item_tag)) && ($item_tag!=''))
|
||||
| **{{ trans('mail.asset_tag') }}** | {{ $item_tag }} |
|
||||
|
|
|
@ -261,20 +261,27 @@
|
|||
}
|
||||
|
||||
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> ';
|
||||
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> ';
|
||||
}
|
||||
|
||||
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> ';
|
||||
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> ';
|
||||
}
|
||||
|
||||
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 + '" '
|
||||
+ ' 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-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;">'
|
||||
+ '<i class="fas fa-trash" aria-hidden="true"></i><span class="sr-only">Delete</span></a> ';
|
||||
+ '<i class="fas fa-trash" aria-hidden="true"></i><span class="sr-only">{{ trans('general.delete') }}</span></a> ';
|
||||
} 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> ';
|
||||
}
|
||||
|
@ -504,8 +511,12 @@
|
|||
}
|
||||
|
||||
function externalLinkFormatter(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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="form-group {{ $errors->has('address') ? ' has-error' : '' }}">
|
||||
{{ Form::label('address', trans('general.address'), array('class' => 'col-md-3 control-label')) }}
|
||||
<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>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,13 +9,13 @@
|
|||
<div class="form-group {{ $errors->has('address2') ? ' has-error' : '' }}">
|
||||
<label class="sr-only " for="address2">{{ trans('general.address') }}</label>
|
||||
<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>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
{{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>') !!}
|
||||
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
|
||||
<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">
|
||||
{{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>') !!}
|
||||
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
|
||||
<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">
|
||||
{{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>') !!}
|
||||
|
|
|
@ -283,6 +283,16 @@
|
|||
</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 -->
|
||||
<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>
|
||||
|
@ -368,6 +378,12 @@
|
|||
endDate: '0d',
|
||||
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({
|
||||
clearBtn: true,
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
class="btn delete-asset btn-danger btn-sm {{ (config('app.lock_passwords')) ? ' disabled': '' }}"
|
||||
data-toggle="modal" href="{{ route('settings.backups.destroy', $file['filename']) }}"
|
||||
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;">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
|
|
117
resources/views/settings/google.blade.php
Normal file
117
resources/views/settings/google.blade.php
Normal 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
|
|
@ -235,6 +235,21 @@
|
|||
</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="box box-default">
|
||||
<div class="box-body text-center">
|
||||
|
|
|
@ -60,12 +60,33 @@
|
|||
<!-- Enable LDAP -->
|
||||
<div class="form-group {{ $errors->has('ldap_integration') ? 'error' : '' }}">
|
||||
<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 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') }}
|
||||
</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)
|
||||
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
|
@ -77,10 +98,11 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_pw_sync', trans('admin/settings/general.ldap_pw_sync')) }}
|
||||
</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]) }}
|
||||
{{ trans('general.yes') }}
|
||||
</label>
|
||||
|
||||
<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>') !!}
|
||||
|
@ -91,75 +113,12 @@
|
|||
</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 -->
|
||||
<div class="form-group {{ $errors->has('ad_domain') ? 'error' : '' }}">
|
||||
<div class="col-md-3">
|
||||
{{ Form::label('ad_domain', trans('admin/settings/general.ad_domain')) }}
|
||||
</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]) }}
|
||||
<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>') !!}
|
||||
|
@ -174,7 +133,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ad_append_domain', trans('admin/settings/general.ad_append_domain_label')) }}
|
||||
</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]) }}
|
||||
{{ trans('admin/settings/general.ad_append_domain') }}
|
||||
<p class="help-block">{{ trans('admin/settings/general.ad_append_domain_help') }}</p>
|
||||
|
@ -190,7 +149,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_client_tls_key', trans('admin/settings/general.ldap_client_tls_key')) }}
|
||||
</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-----
|
||||
", $setting->demoMode]) }}
|
||||
{!! $errors->first('ldap_client_tls_key', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
|
@ -205,7 +164,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_client_tls_cert', trans('admin/settings/general.ldap_client_tls_cert')) }}
|
||||
</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]) }}
|
||||
<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>') !!}
|
||||
|
@ -220,7 +179,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_server', trans('admin/settings/general.ldap_server')) }}
|
||||
</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]) }}
|
||||
<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>') !!}
|
||||
|
@ -235,9 +194,11 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_tls', trans('admin/settings/general.ldap_tls')) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ 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') }}
|
||||
<div class="col-md-8">
|
||||
<label class="form-control">
|
||||
{{ 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>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<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">
|
||||
{{ Form::label('ldap_server_cert_ignore', trans('admin/settings/general.ldap_server_cert')) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ 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') }}
|
||||
<div class="col-md-8">
|
||||
<label class="form-control">
|
||||
{{ 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>') !!}
|
||||
<p class="help-block">{{ trans('admin/settings/general.ldap_server_cert_help') }}</p>
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -266,7 +229,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_uname', trans('admin/settings/general.ldap_uname')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_uname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -280,7 +243,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_pword', trans('admin/settings/general.ldap_pword')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_pword', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -294,7 +257,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_basedn', trans('admin/settings/general.ldap_basedn')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_basedn', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -308,7 +271,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_filter', trans('admin/settings/general.ldap_filter')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_filter', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -322,7 +285,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_username_field', trans('admin/settings/general.ldap_username_field')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_username_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -336,7 +299,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_lname_field', trans('admin/settings/general.ldap_lname_field')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_lname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -350,7 +313,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_fname_field', trans('admin/settings/general.ldap_fname_field')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_fname_field', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -364,7 +327,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_auth_filter_query', trans('admin/settings/general.ldap_auth_filter_query')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_auth_filter_query', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -373,17 +336,45 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- LDAP Version -->
|
||||
<div class="form-group {{ $errors->has('ldap_version') ? 'error' : '' }}">
|
||||
<!-- Default LDAP Permissions Group Select -->
|
||||
|
||||
<div class="form-group{{ $errors->has('group') ? ' has-error' : '' }}">
|
||||
<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 class="col-md-9">
|
||||
{{ Form::text('ldap_version', Request::old('ldap_version', $setting->ldap_version), ['class' => 'form-control','placeholder' => '3', $setting->demoMode]) }}
|
||||
{!! $errors->first('ldap_version', '<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>
|
||||
|
||||
<div class="col-md-8">
|
||||
|
||||
@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>
|
||||
|
||||
|
@ -392,7 +383,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_active_flag', trans('admin/settings/general.ldap_active_flag')) }}
|
||||
</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]) }}
|
||||
|
||||
<p class="help-block">{!! trans('admin/settings/general.ldap_activated_flag_help') !!}</p>
|
||||
|
@ -409,7 +400,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_emp_num', trans('admin/settings/general.ldap_emp_num')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_emp_num', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -422,7 +413,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_dept', trans('admin/settings/general.ldap_dept')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_dept', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -435,7 +426,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_dept', trans('admin/settings/general.ldap_manager')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_manager', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -449,7 +440,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_email', trans('admin/settings/general.ldap_email')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_email', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -463,7 +454,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_phone', trans('admin/settings/general.ldap_phone')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_phone', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -477,7 +468,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_jobtitle', trans('admin/settings/general.ldap_jobtitle')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_jobtitle', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -491,7 +482,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_country', trans('admin/settings/general.ldap_country')) }}
|
||||
</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]) }}
|
||||
{!! $errors->first('ldap_country', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
|
@ -504,7 +495,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('ldap_location', trans('admin/settings/general.ldap_location')) }}
|
||||
</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]) }}
|
||||
<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>') !!}
|
||||
|
@ -520,14 +511,14 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('test_ldap_sync', 'Test LDAP Sync') }}
|
||||
</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>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<br />
|
||||
<div id="ldapad_test_results" class="hidden well well-sm"></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>
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<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">
|
||||
{{ Form::label('test_ldap_login', 'Test LDAP Login') }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<input type="text" name="ldaptest_user" id="ldaptest_user" class="form-control" placeholder="LDAP username">
|
||||
|
@ -556,12 +547,12 @@
|
|||
|
||||
</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="ldaptestloginresult"></span>
|
||||
<span id="ldaptestloginstatus"></span>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
|
@ -575,7 +566,7 @@
|
|||
<div class="col-md-3">
|
||||
{{ Form::label('custom_forgot_pass_url', trans('admin/settings/general.custom_forgot_pass_url')) }}
|
||||
</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]) }}
|
||||
<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>') !!}
|
||||
|
@ -610,6 +601,8 @@
|
|||
@push('js')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
|
|
@ -92,9 +92,10 @@
|
|||
<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>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
{!! $errors->first('saml_enabled', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -441,7 +441,7 @@
|
|||
<div class="form-group{{ $errors->has('state') ? ' has-error' : '' }}">
|
||||
<label class="col-md-3 control-label" for="state">{{ trans('general.state') }}</label>
|
||||
<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>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -192,6 +192,9 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser
|
|||
|
||||
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::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'])
|
||||
->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(
|
||||
'print',
|
||||
|
@ -452,8 +456,6 @@ Route::group(['middleware' => 'web'], function () {
|
|||
[LoginController::class, 'postTwoFactorAuth']
|
||||
);
|
||||
|
||||
|
||||
|
||||
Route::post(
|
||||
'password/email',
|
||||
[ForgotPasswordController::class, 'sendResetLinkEmail']
|
||||
|
@ -482,7 +484,9 @@ Route::group(['middleware' => 'web'], function () {
|
|||
)->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(
|
||||
|
|
20
sample_csvs/MOCK_LOCATIONS.csv
Normal file
20
sample_csvs/MOCK_LOCATIONS.csv
Normal 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
|
|
|
@ -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
Loading…
Reference in a new issue