mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Merge branch 'develop'
This commit is contained in:
commit
567f741d95
|
@ -666,20 +666,23 @@ class AssetsController extends Controller
|
|||
|
||||
if ($settings->qr_code == '1') {
|
||||
$asset = Asset::withTrashed()->find($assetId);
|
||||
$size = Helper::barcodeDimensions($settings->barcode_type);
|
||||
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png';
|
||||
if ($asset) {
|
||||
$size = Helper::barcodeDimensions($settings->barcode_type);
|
||||
$qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png';
|
||||
|
||||
if (isset($asset->id, $asset->asset_tag)) {
|
||||
if (file_exists($qr_file)) {
|
||||
$header = ['Content-type' => 'image/png'];
|
||||
return response()->file($qr_file, $header);
|
||||
} else {
|
||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
|
||||
file_put_contents($qr_file, $barcode_obj->getPngData());
|
||||
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
|
||||
if (isset($asset->id, $asset->asset_tag)) {
|
||||
if (file_exists($qr_file)) {
|
||||
$header = ['Content-type' => 'image/png'];
|
||||
return response()->file($qr_file, $header);
|
||||
} else {
|
||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
|
||||
file_put_contents($qr_file, $barcode_obj->getPngData());
|
||||
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
|
||||
}
|
||||
}
|
||||
}
|
||||
return 'That asset is invalid';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Helpers\Helper;
|
||||
use App\Http\Requests\ImageUploadRequest;
|
||||
use App\Models\Actionlog;
|
||||
use App\Models\Company;
|
||||
use App\Models\Component;
|
||||
use App\Models\CustomField;
|
||||
|
@ -313,5 +314,97 @@ class ComponentsController extends Controller
|
|||
return redirect()->route('components.index')->with('success', trans('admin/components/message.checkout.success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a view that allows the checkin of a component from an asset.
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @see ComponentsController::postCheckout() method that stores the data.
|
||||
* @since [v4.1.4]
|
||||
* @param int $componentId
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function getCheckin($component_asset_id)
|
||||
{
|
||||
|
||||
// This could probably be done more cleanly but I am very tired. - @snipe
|
||||
if ($component_assets = DB::table('components_assets')->find($component_asset_id)) {
|
||||
if (is_null($component = Component::find($component_assets->component_id))) {
|
||||
return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found'));
|
||||
}
|
||||
if (is_null($asset = Asset::find($component_assets->asset_id))) {
|
||||
return redirect()->route('components.index')->with('error',
|
||||
trans('admin/components/message.not_found'));
|
||||
}
|
||||
$this->authorize('checkin', $component_assets);
|
||||
return view('components/checkin', compact('component_assets','component','asset'));
|
||||
}
|
||||
|
||||
return redirect()->route('components.index')->with('error', trans('admin/components/messages.not_found'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and store checkin data.
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @see ComponentsController::getCheckout() method that returns the form.
|
||||
* @since [v4.1.4]
|
||||
* @param Request $request
|
||||
* @param int $componentId
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function postCheckin(Request $request, $component_asset_id)
|
||||
{
|
||||
if ($component_assets = DB::table('components_assets')->find($component_asset_id)) {
|
||||
if (is_null($component = Component::find($component_assets->component_id))) {
|
||||
return redirect()->route('components.index')->with('error',
|
||||
trans('admin/components/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
$this->authorize('checkin', $component);
|
||||
|
||||
$max_to_checkin = $component_assets->assigned_qty;
|
||||
$validator = Validator::make($request->all(), [
|
||||
"checkin_qty" => "required|numeric|between:1,$max_to_checkin"
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return redirect()->back()
|
||||
->withErrors($validator)
|
||||
->withInput();
|
||||
}
|
||||
|
||||
// Validation passed, so let's figure out what we have to do here.
|
||||
$qty_remaining_in_checkout = ($component_assets->assigned_qty - (int)$request->input('checkin_qty'));
|
||||
|
||||
// We have to modify the record to reflect the new qty that's
|
||||
// actually checked out.
|
||||
$component_assets->assigned_qty = $qty_remaining_in_checkout;
|
||||
DB::table('components_assets')->where('id',
|
||||
$component_asset_id)->update(['assigned_qty' => $qty_remaining_in_checkout]);
|
||||
|
||||
$log = new Actionlog();
|
||||
$log->user_id = Auth::user()->id;
|
||||
$log->action_type = 'checkin from';
|
||||
$log->target_type = Asset::class;
|
||||
$log->target_id = $component_assets->asset_id;
|
||||
$log->item_id = $component_assets->component_id;
|
||||
$log->item_type = Component::class;
|
||||
$log->note = $request->input('note');
|
||||
$log->save();
|
||||
|
||||
// If the checked-in qty is exactly the same as the assigned_qty,
|
||||
// we can simply delete the associated components_assets record
|
||||
if ($qty_remaining_in_checkout == 0) {
|
||||
DB::table('components_assets')->where('id', '=', $component_asset_id)->delete();
|
||||
}
|
||||
|
||||
return redirect()->route('components.index')->with('success',
|
||||
trans('admin/components/message.checkout.success'));
|
||||
}
|
||||
return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -552,6 +552,7 @@ class SettingsController extends Controller
|
|||
$setting->alert_threshold = $request->input('alert_threshold');
|
||||
$setting->audit_interval = $request->input('audit_interval');
|
||||
$setting->audit_warning_days = $request->input('audit_warning_days');
|
||||
$setting->show_alerts_in_menu = $request->input('show_alerts_in_menu', '0');
|
||||
|
||||
if ($setting->save()) {
|
||||
return redirect()->route('settings.index')
|
||||
|
|
|
@ -121,7 +121,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'log' => env('APP_LOG', 'daily'),
|
||||
'log' => env('APP_LOG', 'single'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddAlertMenuSetting extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->boolean('show_alerts_in_menu')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->dropColumn('show_alerts_in_menu');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -27,6 +27,7 @@
|
|||
"bootstrap-less": "^3.3.8",
|
||||
"ekko-lightbox": "^5.1.1",
|
||||
"font-awesome": "^4.7.0",
|
||||
"icheck": "^1.0.2",
|
||||
"jquery-slimscroll": "^1.3.8",
|
||||
"jquery-ui": "^1.12.1",
|
||||
"jquery-ui-bundle": "^1.12.1",
|
||||
|
|
Binary file not shown.
BIN
public/js/dist/all.js
vendored
BIN
public/js/dist/all.js
vendored
Binary file not shown.
|
@ -8,7 +8,7 @@
|
|||
"/css/app.css.map": "/css/app.css.map?id=bdbe05e6ecd70ccfac72",
|
||||
"/css/overrides.css.map": "/css/overrides.css.map?id=898c91d4a425b01b589b",
|
||||
"/css/dist/all.css": "/css/dist/all.css?id=7c3842d2639193ac7e88",
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=991cd06c975979f6f067",
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=0d558c3ed637f4c81a77",
|
||||
"/css/build/all.css": "/css/build/all.css?id=7c3842d2639193ac7e88",
|
||||
"/js/build/all.js": "/js/build/all.js?id=991cd06c975979f6f067"
|
||||
"/js/build/all.js": "/js/build/all.js?id=0d558c3ed637f4c81a77"
|
||||
}
|
|
@ -6,7 +6,7 @@ return array(
|
|||
'ad_domain_help' => 'This is sometimes the same as your email domain, but not always.',
|
||||
'is_ad' => 'This is an Active Directory server',
|
||||
'alert_email' => 'Send alerts to',
|
||||
'alerts_enabled' => 'Alerts Enabled',
|
||||
'alerts_enabled' => 'Email Alerts Enabled',
|
||||
'alert_interval' => 'Expiring Alerts Threshold (in days)',
|
||||
'alert_inv_threshold' => 'Inventory Alert Threshold',
|
||||
'asset_ids' => 'Asset IDs',
|
||||
|
@ -27,7 +27,7 @@ return array(
|
|||
'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.',
|
||||
'default_currency' => 'Default Currency',
|
||||
'default_eula_text' => 'Default EULA',
|
||||
'default_language' => 'Default Language',
|
||||
'default_language' => 'Default Language',
|
||||
'default_eula_help_text' => 'You can also associate custom EULAs to specific asset categories.',
|
||||
'display_asset_name' => 'Display Asset Name',
|
||||
'display_checkout_date' => 'Display Checkout Date',
|
||||
|
@ -91,6 +91,7 @@ return array(
|
|||
'qr_text' => 'QR Code Text',
|
||||
'setting' => 'Setting',
|
||||
'settings' => 'Settings',
|
||||
'show_alerts_in_menu' => 'Show alerts in top menu',
|
||||
'site_name' => 'Site Name',
|
||||
'slack_botname' => 'Slack Botname',
|
||||
'slack_channel' => 'Slack Channel',
|
||||
|
|
69
resources/views/components/checkin.blade.php
Normal file
69
resources/views/components/checkin.blade.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/licenses/general.checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<form class="form-horizontal" method="post" action="{{ route('component.checkin.save', $component_assets->id) }}" autocomplete="off">
|
||||
{{csrf_field()}}
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"> {{ $component->name }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<!-- Checked out to -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">{{ trans('general.checkin_from') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $asset->present()->fullName }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Qty -->
|
||||
<div class="form-group {{ $errors->has('checkin_qty') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-2 control-label">{{ trans('general.qty') }}</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" name="checkin_qty" value="{{ Input::old('assigned_qty', $component_assets->assigned_qty) }}">
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-2">
|
||||
<p class="help-block">Must be {{ $component_assets->assigned_qty }} or less.</p>
|
||||
{!! $errors->first('checkin_qty', '<span class="alert-msg"><i class="fa fa-times"></i>
|
||||
:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-2 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ Input::old('note', $component->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('components.index') }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success pull-right"><i class="fa fa-check icon-white"></i> {{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
</div> <!-- /.box-->
|
||||
</form>
|
||||
</div> <!-- /.col-md-7-->
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
|
@ -58,6 +58,7 @@
|
|||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="name" data-formatter="hardwareLinkFormatter">{{ trans('general.asset') }}</th>
|
||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="qty">{{ trans('general.qty') }}</th>
|
||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="componentsInOutFormatter">Checkin/Checkout</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
$permission_name = $permission[$i]['permission'];
|
||||
?>
|
||||
@if ($permission[$i]['display'])
|
||||
<div class="col-md-12 col-md-offset-2">
|
||||
<div class="col-md-9 col-md-offset-2">
|
||||
<h3>{{ $area }}: {{ $permission[$i]['label'] }}</h3>
|
||||
<p>{{ $permission[$i]['note'] }}</p>
|
||||
|
||||
|
|
|
@ -10,8 +10,10 @@
|
|||
<?php
|
||||
$settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter;
|
||||
$settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter;
|
||||
$qr_size = ($settings->labels_height - .25);
|
||||
$qr_txt_size = $settings->labels_width - $qr_size - $settings->labels_display_sgutter - .1;
|
||||
// Leave space on bottom for 1D barcode if necessary
|
||||
$qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .25 : $settings->labels_height;
|
||||
// Leave space on left for QR code if necessary
|
||||
$qr_txt_size = ($settings->qr_code=='1' ? $settings->labels_width - $qr_size - .1: $settings->labels_width);
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
|
|
@ -239,6 +239,7 @@
|
|||
@endcan
|
||||
|
||||
@can('admin')
|
||||
@if ($snipeSettings->show_alerts_in_menu=='1')
|
||||
<!-- Tasks: style can be found in dropdown.less -->
|
||||
<?php $alert_items = \App\Helpers\Helper::checkLowInventory(); ?>
|
||||
|
||||
|
@ -281,6 +282,7 @@
|
|||
</ul>
|
||||
</li>
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@if ($errors->any())
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-danger">
|
||||
<div class="alert alert-danger fade in">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<i class="fa fa-exclamation-circle faa-pulse animated"></i>
|
||||
<strong>Error: </strong>
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
@if ($message = Session::get('status'))
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-success">
|
||||
<div class="alert alert-success fade in">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<i class="fa fa-check faa-pulse animated"></i>
|
||||
<strong>Success: </strong>
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-success">
|
||||
<div class="alert alert-success fade in">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<i class="fa fa-check faa-pulse animated"></i>
|
||||
<strong>Success: </strong>
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
@if ($message = Session::get('error'))
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert alert-danger">
|
||||
<div class="alert alert alert-danger fade in">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<i class="fa fa-exclamation-circle faa-pulse animated"></i>
|
||||
<strong>Error: </strong>
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
@if ($message = Session::get('warning'))
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-warning">
|
||||
<div class="alert alert-warning fade in">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<i class="fa fa-warning faa-pulse animated"></i>
|
||||
<strong>Warning: </strong>
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
@if ($message = Session::get('info'))
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">
|
||||
<div class="alert alert-info fade in">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<i class="fa fa-info-circle faa-pulse animated"></i>
|
||||
<strong>Info: </strong>
|
||||
|
|
|
@ -299,7 +299,7 @@
|
|||
if (row.assigned_to) {
|
||||
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
|
||||
} else if (row.assigned_pivot_id) {
|
||||
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purpley" data-tooltip="true" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
|
||||
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + row.assigned_pivot_id + '/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="Check this item in so it is available for re-imaging, re-issue, etc.">{{ trans('general.checkin') }}</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,18 @@
|
|||
</div>
|
||||
<div class="col-md-5">
|
||||
{{ Form::checkbox('alerts_enabled', '1', Input::old('alerts_enabled', $setting->alerts_enabled),array('class' => 'minimal')) }}
|
||||
{{ trans('admin/settings/general.alerts_enabled') }}
|
||||
{{ trans('general.yes') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Menu Alerts Enabled -->
|
||||
<div class="form-group {{ $errors->has('show_alerts_in_menu') ? 'error' : '' }}">
|
||||
<div class="col-md-3">
|
||||
{{ Form::label('show_alerts_in_menu', trans('admin/settings/general.show_alerts_in_menu')) }}
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
{{ Form::checkbox('show_alerts_in_menu', '1', Input::old('show_alerts_in_menu', $setting->show_alerts_in_menu),array('class' => 'minimal')) }}
|
||||
{{ trans('general.yes') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
margin-top: 0px;
|
||||
}
|
||||
.permissions.table > tbody+tbody {
|
||||
margin: 15px;
|
||||
|
||||
}
|
||||
.header-row {
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
@ -58,9 +58,6 @@
|
|||
padding: 1px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
table, tbody {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.header-name {
|
||||
cursor: pointer;
|
||||
|
@ -474,30 +471,29 @@
|
|||
<td class="col-md-5 tooltip-base permissions-item"
|
||||
data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="{{ $localPermission['note'] }}"
|
||||
>
|
||||
title="{{ $localPermission['note'] }}">
|
||||
<h4>{{ $area . ': ' . $localPermission['label'] }}</h4>
|
||||
</td>
|
||||
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['disabled'=>"disabled"]) }}
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['disabled'=>"disabled", 'class'=>'minimal']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['value'=>"grant"]) }}
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',$userPermissions[$localPermission['permission'] ] == '1',['value'=>"grant", 'class'=>'minimal']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['disabled'=>"disabled"]) }}
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['disabled'=>"disabled", 'class'=>'minimal']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['value'=>"deny"]) }}
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '-1',$userPermissions[$localPermission['permission'] ] == '-1',['value'=>"deny", 'class'=>'minimal']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($localPermission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['disabled'=>"disabled"] ) }}
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['disabled'=>"disabled",'class'=>'minimal'] ) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['value'=>"inherit"] ) }}
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']','0',$userPermissions[$localPermission['permission'] ] == '0',['value'=>"inherit", 'class'=>'minimal'] ) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -509,13 +505,13 @@
|
|||
<h3>{{ $area }}</h3>
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
{{ Form::radio("$area", '1',false,['value'=>"grant"]) }}
|
||||
{{ Form::radio("$area", '1',false,['value'=>"grant", 'class'=>'minimal']) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
{{ Form::radio("$area", '-1',false,['value'=>"deny"]) }}
|
||||
{{ Form::radio("$area", '-1',false,['value'=>"deny", 'class'=>'minimal']) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
{{ Form::radio("$area", '0',false,['value'=>"inherit"] ) }}
|
||||
{{ Form::radio("$area", '0',false,['value'=>"inherit", 'class'=>'minimal'] ) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -526,29 +522,28 @@
|
|||
class="col-md-5 tooltip-base permissions-item"
|
||||
data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="{{ $permission['note'] }}"
|
||||
>
|
||||
title="{{ $permission['note'] }}">
|
||||
{{ $permission['label'] }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[$permission['permission'] ] == '1', ["value"=>"grant", 'disabled'=>'disabled']) }}
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[$permission['permission'] ] == '1', ["value"=>"grant", 'disabled'=>'disabled', 'class'=>'minimal']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[ $permission['permission'] ] == '1', ["value"=>"grant"]) }}
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '1', $userPermissions[ $permission['permission'] ] == '1', ["value"=>"grant",'class'=>'minimal']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny", 'disabled'=>'disabled']) }}
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny", 'disabled'=>'disabled', 'class'=>'minimal']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny"]) }}
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '-1', $userPermissions[$permission['permission'] ] == '-1', ["value"=>"deny",'class'=>'minimal']) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
@if (($permission['permission'] == 'superuser') && (!Auth::user()->isSuperUser()))
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'disabled'=>'disabled']) }}
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'disabled'=>'disabled', 'class'=>'minimal']) }}
|
||||
@else
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit"]) }}
|
||||
{{ Form::radio('permission['.$permission['permission'].']', '0', $userPermissions[$permission['permission']] =='0', ["value"=>"inherit", 'class'=>'minimal']) }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
|
@ -588,11 +583,11 @@ $(document).ready(function() {
|
|||
</script>
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$('tr.header-row input:radio').click(function() {
|
||||
value = $(this).attr('value');
|
||||
$(this).parent().parent().siblings().each(function() {
|
||||
$(this).find('td input:radio[value='+value+']').prop("checked", true);
|
||||
})
|
||||
$('tr.header-row input:radio').on('ifClicked', function () {
|
||||
value = $(this).attr('value');
|
||||
$(this).parent().parent().parent().siblings().each(function(idx,elem) {
|
||||
$(this).find('td input:radio[value='+value+']').iCheck('check');
|
||||
})
|
||||
});
|
||||
|
||||
$('.header-name').click(function() {
|
||||
|
|
|
@ -11,6 +11,14 @@ Route::group([ 'prefix' => 'components','middleware' => ['auth'] ], function ()
|
|||
'{componentID}/checkout',
|
||||
[ 'as' => 'checkout/component', 'uses' => 'ComponentsController@postCheckout' ]
|
||||
);
|
||||
Route::get(
|
||||
'{componentID}/checkin',
|
||||
[ 'as' => 'checkin/component', 'uses' => 'ComponentsController@getCheckin' ]
|
||||
);
|
||||
Route::post(
|
||||
'{componentID}/checkin',
|
||||
[ 'as' => 'component.checkin.save', 'uses' => 'ComponentsController@postCheckin' ]
|
||||
);
|
||||
Route::post('bulk', [ 'as' => 'component/bulk-form', 'uses' => 'ComponentsController@postBulk' ]);
|
||||
Route::post('bulksave', [ 'as' => 'component/bulk-save', 'uses' => 'ComponentsController@postBulkSave' ]);
|
||||
|
||||
|
|
18
snipeit.sh
18
snipeit.sh
|
@ -147,6 +147,14 @@ isdnfinstalled () {
|
|||
fi
|
||||
}
|
||||
|
||||
openfirewalld () {
|
||||
if [ "$(firewall-cmd --state)" == "running" ]; then
|
||||
echo "* Configuring firewall to allow HTTP traffic only."
|
||||
log "firewall-cmd --zone=public --add-port=http/tcp --permanent"
|
||||
log "firewall-cmd --reload"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; then
|
||||
distro="$(lsb_release -s -i)"
|
||||
version="$(lsb_release -s -r)"
|
||||
|
@ -539,11 +547,8 @@ case $distro in
|
|||
|
||||
installsnipeit
|
||||
|
||||
if [ "$(firewall-cmd --state)" == "running" ]; then
|
||||
echo "* Configuring firewall."
|
||||
log "firewall-cmd --zone=public --add-port=http/tcp --permanent"
|
||||
log "firewall-cmd --reload"
|
||||
fi
|
||||
#open the firewall for HTTP traffic only
|
||||
openfirewalld
|
||||
|
||||
#Check if SELinux is enforcing
|
||||
if [ "$(getenforce)" == "Enforcing" ]; then
|
||||
|
@ -602,6 +607,9 @@ case $distro in
|
|||
|
||||
installsnipeit
|
||||
|
||||
#open the firewall for HTTP traffic only
|
||||
openfirewalld
|
||||
|
||||
#Check if SELinux is enforcing
|
||||
if [ "$(getenforce)" == "Enforcing" ]; then
|
||||
echo "* Configuring SELinux."
|
||||
|
|
|
@ -18,7 +18,7 @@ mix
|
|||
'./resources/assets/css/app.css',
|
||||
'public/css/AdminLTE.css',
|
||||
'resources/assets/css/font-awesome/font-awesome.min.css',
|
||||
'./bower_components/iCheck/skins/minimal/minimal.css',
|
||||
'./node_modules/icheck/skins/minimal/minimal.css',
|
||||
'./node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.standalone.css',
|
||||
'public/css/bootstrap-tables-sticky-header.css',
|
||||
'public/css/overrides.css'
|
||||
|
@ -40,10 +40,9 @@ mix
|
|||
'./node_modules/jquery-slimscroll/jquery.slimscroll.js',
|
||||
'./node_modules/jquery.iframe-transport/jquery.iframe-transport.js',
|
||||
'./node_modules/blueimp-file-upload/js/jquery.fileupload.js',
|
||||
// './node_modules/fastclick/lib/fastclick.js',
|
||||
'./node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js',
|
||||
'./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
|
||||
'./bower_components/iCheck/icheck.js',
|
||||
'./node_modules/icheck/icheck.js',
|
||||
'./node_modules/ekko-lightbox/dist/ekko-lightbox.js',
|
||||
'./resources/assets/js/app.js', //this is part of AdminLTE
|
||||
'./resources/assets/js/snipeit.js', //this is the actual Snipe-IT JS
|
||||
|
|
Loading…
Reference in a new issue