mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 23:54:12 -08:00
Merge branch 'develop'
This commit is contained in:
commit
5addcb517f
|
@ -40,7 +40,7 @@ class Kernel extends ConsoleKernel
|
|||
|
||||
$schedule->command('snipeit:inventory-alerts')->daily();
|
||||
$schedule->command('snipeit:expiring-alerts')->daily();
|
||||
$schedule->command('snipeit:expected-checkins')->daily();
|
||||
$schedule->command('snipeit:expected-checkin')->daily();
|
||||
$schedule->command('snipeit:backup')->weekly();
|
||||
$schedule->command('backup:clean')->daily();
|
||||
}
|
||||
|
|
|
@ -98,10 +98,8 @@ class CategoriesController extends Controller
|
|||
*/
|
||||
public function edit($categoryId = null)
|
||||
{
|
||||
// Check if the category exists
|
||||
if (is_null($item = Category::find($categoryId))) {
|
||||
// Redirect to the blogs management page
|
||||
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.does_not_exist'));
|
||||
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist'));
|
||||
}
|
||||
$category_types= Helper::categoryTypeList();
|
||||
|
||||
|
@ -158,22 +156,22 @@ class CategoriesController extends Controller
|
|||
{
|
||||
// Check if the category exists
|
||||
if (is_null($category = Category::find($categoryId))) {
|
||||
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.not_found'));
|
||||
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.not_found'));
|
||||
}
|
||||
|
||||
if ($category->has_models() > 0) {
|
||||
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'model']));
|
||||
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'model']));
|
||||
} elseif ($category->accessories()->count() > 0) {
|
||||
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'accessory']));
|
||||
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'accessory']));
|
||||
} elseif ($category->consumables()->count() > 0) {
|
||||
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'consumable']));
|
||||
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'consumable']));
|
||||
} elseif ($category->components()->count() > 0) {
|
||||
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'component']));
|
||||
return redirect()->route('categories.index')->with('error', trans('admin/categories/message.assoc_items', ['asset_type'=>'component']));
|
||||
}
|
||||
|
||||
$category->delete();
|
||||
// Redirect to the locations management page
|
||||
return redirect()->to(route('categories.index'))->with('success', trans('admin/categories/message.delete.success'));
|
||||
return redirect()->route('categories.index')->with('success', trans('admin/categories/message.delete.success'));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,13 +27,11 @@ class DepartmentsController extends Controller
|
|||
public function index(Request $request)
|
||||
{
|
||||
$this->authorize('index', Department::class);
|
||||
$company = null;
|
||||
if ($request->has('company_id')) {
|
||||
$company = Company::find($request->input('company_id'));
|
||||
} else {
|
||||
$company = null;
|
||||
}
|
||||
return view('departments/index')->with('company',$company);
|
||||
|
||||
return view('departments/index')->with('company', $company);
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,12 +51,10 @@ class DepartmentsController extends Controller
|
|||
$department->user_id = Auth::user()->id;
|
||||
$department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null);
|
||||
|
||||
|
||||
if ($department->save()) {
|
||||
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.create.success'));
|
||||
}
|
||||
return redirect()->back()->withInput()->withErrors($department->getErrors());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,25 +136,20 @@ class DepartmentsController extends Controller
|
|||
->with('location_list', Helper::locationsList())
|
||||
->with('company_list', Helper::companyList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function update(Request $request, $id) {
|
||||
|
||||
$this->authorize('create', Department::class);
|
||||
if (is_null($department = Department::find($id))) {
|
||||
return redirect()->to('admin/settings/departments')->with('error', trans('admin/departments/message.does_not_exist'));
|
||||
return redirect()->route('departments.index')->with('error', trans('admin/departments/message.does_not_exist'));
|
||||
}
|
||||
|
||||
|
||||
$department->fill($request->all());
|
||||
$department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null);
|
||||
|
||||
if ($department->save()) {
|
||||
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.update.success'));
|
||||
}
|
||||
|
||||
return redirect()->back()->withInput()->withErrors($department->getErrors());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ class LocationsController extends Controller
|
|||
{
|
||||
// Check if the location exists
|
||||
if (is_null($item = Location::find($locationId))) {
|
||||
return redirect()->to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist'));
|
||||
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// Show the page
|
||||
|
@ -157,7 +157,6 @@ class LocationsController extends Controller
|
|||
$location_options = Location::flattenLocationsArray($location_options_array);
|
||||
$location_options = array('' => 'Top Level') + $location_options;
|
||||
|
||||
|
||||
return view('locations/edit', compact('item'))
|
||||
->with('location_options', $location_options)
|
||||
->with('manager_list', Helper::managerList());
|
||||
|
@ -177,7 +176,7 @@ class LocationsController extends Controller
|
|||
{
|
||||
// Check if the location exists
|
||||
if (is_null($location = Location::find($locationId))) {
|
||||
return redirect()->to('admin/settings/locations')->with('error', trans('admin/locations/message.does_not_exist'));
|
||||
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// Update the location data
|
||||
|
@ -218,7 +217,6 @@ class LocationsController extends Controller
|
|||
return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
if ($location->users->count() > 0) {
|
||||
return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.assoc_users'));
|
||||
} elseif ($location->childLocations->count() > 0) {
|
||||
|
|
BIN
public/css/dist/all.css
vendored
BIN
public/css/dist/all.css
vendored
Binary file not shown.
|
@ -93,7 +93,7 @@
|
|||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success pull-right"><i class="fa fa-check icon-white"></i> {{ trans('general.checkout') }}</button>
|
||||
<button type="submit" class="btn btn-success pull-right"><i class="fa fa-check icon-white"></i> {{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!--/.col-md-12-->
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
@endif
|
||||
|
||||
<p>
|
||||
Upload a CSV that contains asset history. The assets and users MUST already exist in the system, or they will be skipped. Matching assets for history import happens against the asset tag. We will try to find a matching user based on the user's name you provide, and the criteria you select below. If you do not select any criteria below, it will simply try to match on the username format you configured in the Admin < Settings.
|
||||
Upload a CSV that contains asset history. The assets and users MUST already exist in the system, or they will be skipped. Matching assets for history import happens against the asset tag. We will try to find a matching user based on the user's name you provide, and the criteria you select below. If you do not select any criteria below, it will simply try to match on the username format you configured in the Admin > General Settings.
|
||||
</p>
|
||||
|
||||
<p>Fields included in the CSV must match the headers: <strong>Date, Tag, Name</strong>. Any additional fields will be ignored. </p>
|
||||
|
|
|
@ -379,18 +379,17 @@
|
|||
|
||||
|
||||
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}>
|
||||
<a href="{{ url('hardware?status=Deployed') }}"><i class="fa fa-circle-o text-blue"></i>All @lang('general.deployed')
|
||||
<a href="{{ url('hardware?status=Deployed') }}"><i class="fa fa-circle-o text-blue"></i>All @lang('general.deployed')
|
||||
</a>
|
||||
</li>
|
||||
<li{!! (Request::query('status') == 'RTD' ? ' class="active"' : '') !!}>
|
||||
<a href="{{ url('hardware?status=RTD') }}">
|
||||
<i class="fa fa-circle-o text-green"></i>
|
||||
All @lang('general.ready_to_deploy')</a>
|
||||
<i class="fa fa-circle-o text-green"></i>All @lang('general.ready_to_deploy')</a>
|
||||
</li>
|
||||
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Pending') }}"><i class="fa fa-circle-o text-orange"></i>All @lang('general.pending')</a></li>
|
||||
<li{!! (Request::query('status') == 'Pending' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Pending') }}"><i class="fa fa-circle-o text-orange"></i>All @lang('general.pending')</a></li>
|
||||
<li{!! (Request::query('status') == 'Undeployable' ? ' class="active"' : '') !!} ><a href="{{ url('hardware?status=Undeployable') }}"><i class="fa fa-times text-red"></i>All @lang('general.undeployable')</a></li>
|
||||
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Archived') }}"><i class="fa fa-times text-red"></i>All @lang('admin/hardware/general.archived')</a></li>
|
||||
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Requestable') }}"><i class="fa fa-check text-blue"></i> @lang('admin/hardware/general.requestable')</a></li>
|
||||
<li{!! (Request::query('status') == 'Archived' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Archived') }}"><i class="fa fa-times text-red"></i>All @lang('admin/hardware/general.archived')</a></li>
|
||||
<li{!! (Request::query('status') == 'Requestable' ? ' class="active"' : '') !!}><a href="{{ url('hardware?status=Requestable') }}"><i class="fa fa-check text-blue"></i>@lang('admin/hardware/general.requestable')</a></li>
|
||||
|
||||
<li class="divider"> </li>
|
||||
@can('checkout', \App\Models\Asset::class)
|
||||
|
|
|
@ -201,11 +201,11 @@
|
|||
@if (is_null($improvement->deleted_at))
|
||||
<tr>
|
||||
<td><a href="{{ route('hardware.show', $improvement->asset_id) }}">{{ $improvement->asset->name }}</a></td>
|
||||
<td>{{ $improvement->improvement_type }}</td>
|
||||
<td>{{ $improvement->asset_maintenance_type }}</td>
|
||||
<td>{{ $improvement->start_date }}</td>
|
||||
<td>{{ $improvement->completion_date }}</td>
|
||||
<td>{{ $improvement->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}</td>
|
||||
<td>{{ sprintf( trans( 'general.currency' ) . '%01.2f', $improvement->cost) }}</td>
|
||||
<td>{{ sprintf( $snipeSettings->default_currency. '%01.2f', $improvement->cost) }}</td>
|
||||
<?php $totalCost += $improvement->cost; ?>
|
||||
<td><a href="{{ route('maintenances.edit', $improvement->id) }}" class="btn btn-warning"><i class="fa fa-pencil icon-white"></i></a>
|
||||
</td>
|
||||
|
@ -222,7 +222,7 @@
|
|||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{{sprintf(trans( 'general.currency' ) . '%01.2f', $totalCost)}}</td>
|
||||
<td>{{sprintf($snipeSettings->default_currency . '%01.2f', $totalCost)}}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue