Merge branch 'develop'

This commit is contained in:
snipe 2017-10-16 05:01:37 -07:00
commit 5addcb517f
9 changed files with 24 additions and 38 deletions

View file

@ -40,7 +40,7 @@ class Kernel extends ConsoleKernel
$schedule->command('snipeit:inventory-alerts')->daily(); $schedule->command('snipeit:inventory-alerts')->daily();
$schedule->command('snipeit:expiring-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('snipeit:backup')->weekly();
$schedule->command('backup:clean')->daily(); $schedule->command('backup:clean')->daily();
} }

View file

@ -98,10 +98,8 @@ class CategoriesController extends Controller
*/ */
public function edit($categoryId = null) public function edit($categoryId = null)
{ {
// Check if the category exists
if (is_null($item = Category::find($categoryId))) { if (is_null($item = Category::find($categoryId))) {
// Redirect to the blogs management page return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist'));
return redirect()->to('admin/settings/categories')->with('error', trans('admin/categories/message.does_not_exist'));
} }
$category_types= Helper::categoryTypeList(); $category_types= Helper::categoryTypeList();
@ -158,22 +156,22 @@ class CategoriesController extends Controller
{ {
// Check if the category exists // Check if the category exists
if (is_null($category = Category::find($categoryId))) { 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) { 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) { } 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) { } 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) { } 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(); $category->delete();
// Redirect to the locations management page // 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'));
} }

View file

@ -27,13 +27,11 @@ class DepartmentsController extends Controller
public function index(Request $request) public function index(Request $request)
{ {
$this->authorize('index', Department::class); $this->authorize('index', Department::class);
$company = null;
if ($request->has('company_id')) { if ($request->has('company_id')) {
$company = Company::find($request->input('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->user_id = Auth::user()->id;
$department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null); $department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null);
if ($department->save()) { if ($department->save()) {
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.create.success')); return redirect()->route("departments.index")->with('success', trans('admin/departments/message.create.success'));
} }
return redirect()->back()->withInput()->withErrors($department->getErrors()); return redirect()->back()->withInput()->withErrors($department->getErrors());
} }
/** /**
@ -141,24 +137,19 @@ class DepartmentsController extends Controller
->with('company_list', Helper::companyList()); ->with('company_list', Helper::companyList());
} }
public function update(Request $request, $id) { public function update(Request $request, $id) {
$this->authorize('create', Department::class); $this->authorize('create', Department::class);
if (is_null($department = Department::find($id))) { 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->fill($request->all());
$department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null); $department->manager_id = ($request->has('manager_id' ) ? $request->input('manager_id') : null);
if ($department->save()) { if ($department->save()) {
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.update.success')); return redirect()->route("departments.index")->with('success', trans('admin/departments/message.update.success'));
} }
return redirect()->back()->withInput()->withErrors($department->getErrors()); return redirect()->back()->withInput()->withErrors($department->getErrors());
} }
} }

View file

@ -148,7 +148,7 @@ class LocationsController extends Controller
{ {
// Check if the location exists // Check if the location exists
if (is_null($item = Location::find($locationId))) { 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 // Show the page
@ -157,7 +157,6 @@ class LocationsController extends Controller
$location_options = Location::flattenLocationsArray($location_options_array); $location_options = Location::flattenLocationsArray($location_options_array);
$location_options = array('' => 'Top Level') + $location_options; $location_options = array('' => 'Top Level') + $location_options;
return view('locations/edit', compact('item')) return view('locations/edit', compact('item'))
->with('location_options', $location_options) ->with('location_options', $location_options)
->with('manager_list', Helper::managerList()); ->with('manager_list', Helper::managerList());
@ -177,7 +176,7 @@ class LocationsController extends Controller
{ {
// Check if the location exists // Check if the location exists
if (is_null($location = Location::find($locationId))) { 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 // 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')); return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.not_found'));
} }
if ($location->users->count() > 0) { if ($location->users->count() > 0) {
return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.assoc_users')); return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.assoc_users'));
} elseif ($location->childLocations->count() > 0) { } elseif ($location->childLocations->count() > 0) {

Binary file not shown.

View file

@ -93,7 +93,7 @@
</div> </div>
<div class="box-footer"> <div class="box-footer">
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a> <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> </div>
</form> </form>
</div> <!--/.col-md-12--> </div> <!--/.col-md-12-->

View file

@ -61,7 +61,7 @@
@endif @endif
<p> <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 &lt; 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 &gt; General Settings.
</p> </p>
<p>Fields included in the CSV must match the headers: <strong>Date, Tag, Name</strong>. Any additional fields will be ignored. </p> <p>Fields included in the CSV must match the headers: <strong>Date, Tag, Name</strong>. Any additional fields will be ignored. </p>

View file

@ -379,18 +379,17 @@
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}> <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> </a>
</li> </li>
<li{!! (Request::query('status') == 'RTD' ? ' class="active"' : '') !!}> <li{!! (Request::query('status') == 'RTD' ? ' class="active"' : '') !!}>
<a href="{{ url('hardware?status=RTD') }}"> <a href="{{ url('hardware?status=RTD') }}">
<i class="fa fa-circle-o text-green"></i> <i class="fa fa-circle-o text-green"></i>All @lang('general.ready_to_deploy')</a>
All @lang('general.ready_to_deploy')</a>
</li> </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') == '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') == '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') == '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">&nbsp;</li> <li class="divider">&nbsp;</li>
@can('checkout', \App\Models\Asset::class) @can('checkout', \App\Models\Asset::class)

View file

@ -201,11 +201,11 @@
@if (is_null($improvement->deleted_at)) @if (is_null($improvement->deleted_at))
<tr> <tr>
<td><a href="{{ route('hardware.show', $improvement->asset_id) }}">{{ $improvement->asset->name }}</a></td> <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->start_date }}</td>
<td>{{ $improvement->completion_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>{{ $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; ?> <?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><a href="{{ route('maintenances.edit', $improvement->id) }}" class="btn btn-warning"><i class="fa fa-pencil icon-white"></i></a>
</td> </td>
@ -222,7 +222,7 @@
<td></td> <td></td>
<td></td> <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> </tr>
</tfoot> </tfoot>
</table> </table>