mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-05 10:57:28 -08:00
Merge branch 'develop'
# Conflicts: # config/version.php
This commit is contained in:
commit
5979a18852
|
@ -1081,70 +1081,73 @@ class AssetsController extends Controller
|
||||||
* @internal param array $assets
|
* @internal param array $assets
|
||||||
* @since [v2.0]
|
* @since [v2.0]
|
||||||
*/
|
*/
|
||||||
public function postBulkSave()
|
public function postBulkSave(Request $request)
|
||||||
{
|
{
|
||||||
$this->authorize('update', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
if (Input::has('ids')) {
|
|
||||||
$assets = Input::get('ids');
|
\Log::debug($request->input('ids'));
|
||||||
if ((Input::has('purchase_date'))
|
|
||||||
|| (Input::has('purchase_cost'))
|
if (($request->has('ids')) && (count($request->input('ids') > 0))) {
|
||||||
|| (Input::has('supplier_id'))
|
$assets = $request->input('ids');
|
||||||
|| (Input::has('order_number'))
|
if (($request->has('purchase_date'))
|
||||||
|| (Input::has('warranty_months'))
|
|| ($request->has('purchase_cost'))
|
||||||
|| (Input::has('rtd_location_id'))
|
|| ($request->has('supplier_id'))
|
||||||
|| (Input::has('requestable'))
|
|| ($request->has('order_number'))
|
||||||
|| (Input::has('company_id'))
|
|| ($request->has('warranty_months'))
|
||||||
|| (Input::has('status_id'))
|
|| ($request->has('rtd_location_id'))
|
||||||
|| (Input::has('model_id'))
|
|| ($request->has('requestable'))
|
||||||
|
|| ($request->has('company_id'))
|
||||||
|
|| ($request->has('status_id'))
|
||||||
|
|| ($request->has('model_id'))
|
||||||
) {
|
) {
|
||||||
foreach ($assets as $key => $value) {
|
foreach ($assets as $key => $value) {
|
||||||
$update_array = array();
|
$update_array = array();
|
||||||
|
|
||||||
if (Input::has('purchase_date')) {
|
if ($request->has('purchase_date')) {
|
||||||
$update_array['purchase_date'] = e(Input::get('purchase_date'));
|
$update_array['purchase_date'] = $request->input('purchase_date');
|
||||||
}
|
}
|
||||||
if (Input::has('purchase_cost')) {
|
if ($request->has('purchase_cost')) {
|
||||||
$update_array['purchase_cost'] = Helper::ParseFloat(e(Input::get('purchase_cost')));
|
$update_array['purchase_cost'] = Helper::ParseFloat($request->input('purchase_cost'));
|
||||||
}
|
}
|
||||||
if (Input::has('supplier_id')) {
|
if ($request->has('supplier_id')) {
|
||||||
$update_array['supplier_id'] = e(Input::get('supplier_id'));
|
$update_array['supplier_id'] = $request->input('supplier_id');
|
||||||
}
|
}
|
||||||
if (Input::has('model_id')) {
|
if ($request->has('model_id')) {
|
||||||
$update_array['model_id'] = e(Input::get('model_id'));
|
$update_array['model_id'] = $request->input('model_id');
|
||||||
}
|
}
|
||||||
if (Input::has('company_id')) {
|
if ($request->has('company_id')) {
|
||||||
if (Input::get('company_id')=="clear") {
|
if ($request->input('company_id')=="clear") {
|
||||||
$update_array['company_id'] = null;
|
$update_array['company_id'] = null;
|
||||||
} else {
|
} else {
|
||||||
$update_array['company_id'] = e(Input::get('company_id'));
|
$update_array['company_id'] = $request->input('company_id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Input::has('order_number')) {
|
if ($request->has('order_number')) {
|
||||||
$update_array['order_number'] = e(Input::get('order_number'));
|
$update_array['order_number'] = $request->input('order_number');
|
||||||
}
|
}
|
||||||
if (Input::has('warranty_months')) {
|
if ($request->has('warranty_months')) {
|
||||||
$update_array['warranty_months'] = e(Input::get('warranty_months'));
|
$update_array['warranty_months'] = $request->input('warranty_months');
|
||||||
}
|
}
|
||||||
if (Input::has('rtd_location_id')) {
|
if ($request->has('rtd_location_id')) {
|
||||||
$update_array['rtd_location_id'] = e(Input::get('rtd_location_id'));
|
$update_array['rtd_location_id'] = $request->input('rtd_location_id');
|
||||||
}
|
}
|
||||||
if (Input::has('status_id')) {
|
if ($request->has('status_id')) {
|
||||||
$update_array['status_id'] = e(Input::get('status_id'));
|
$update_array['status_id'] = $request->input('status_id');
|
||||||
}
|
}
|
||||||
if (Input::has('requestable')) {
|
if ($request->has('requestable')) {
|
||||||
$update_array['requestable'] = e(Input::get('requestable'));
|
$update_array['requestable'] = $request->input('requestable');
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::table('assets')
|
DB::table('assets')
|
||||||
->where('id', $key)
|
->where('id', $key)
|
||||||
->update($update_array);
|
->update($update_array);
|
||||||
} // endforeach
|
} // endforeach
|
||||||
return redirect()->to("hardware")->with('success', trans('admin/hardware/message.update.success'));
|
return redirect()->route("hardware.index")->with('success', trans('admin/hardware/message.update.success'));
|
||||||
// no values given, nothing to update
|
// no values given, nothing to update
|
||||||
}
|
}
|
||||||
return redirect()->to("hardware")->with('info', trans('admin/hardware/message.update.nothing_updated'));
|
return redirect()->route("hardware.index")->with('warning', trans('admin/hardware/message.update.nothing_updated'));
|
||||||
} // endif
|
} // endif
|
||||||
return redirect()->to("hardware");
|
return redirect()->route("hardware.index")->with('warning', trans('No assets selected, so nothing was updated.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -160,7 +160,6 @@ class CustomField extends Model
|
||||||
public function getFormatAttribute($value)
|
public function getFormatAttribute($value)
|
||||||
{
|
{
|
||||||
foreach (self::$PredefinedFormats as $name => $pattern) {
|
foreach (self::$PredefinedFormats as $name => $pattern) {
|
||||||
\Log::debug($name.'=>'.$pattern);
|
|
||||||
if ($pattern === $value) {
|
if ($pattern === $value) {
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LocationPresenter extends Presenter
|
||||||
|
|
||||||
public function glyph()
|
public function glyph()
|
||||||
{
|
{
|
||||||
return '<i class="fa fa-globe"></i>';
|
return '<i class="fa fa-map-marker"></i>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fullName() {
|
public function fullName() {
|
||||||
|
|
|
@ -352,6 +352,6 @@ class UserPresenter extends Presenter
|
||||||
|
|
||||||
public function glyph()
|
public function glyph()
|
||||||
{
|
{
|
||||||
return '<i class="fa fa-users"></i>';
|
return '<i class="fa fa-user"></i>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
return array (
|
return array (
|
||||||
'app_version' => 'v4.1.6-pre',
|
'app_version' => 'v4.1.6',
|
||||||
'full_app_version' => 'v4.1.6-pre - build 2963-g83c8449',
|
'full_app_version' => 'v4.1.6 - build 2963-g83c8449',
|
||||||
'build_version' => '2963',
|
'build_version' => '2963',
|
||||||
'prerelease_version' => '',
|
'prerelease_version' => '',
|
||||||
'hash_version' => 'g83c8449',
|
'hash_version' => 'g83c8449',
|
||||||
'full_hash' => 'v4.1.5-57-g83c8449',
|
'full_hash' => 'v4.1.5-76-gb934d2e',
|
||||||
'branch' => 'master',
|
'branch' => 'master',
|
||||||
);
|
);
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id'])
|
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id'])
|
||||||
|
|
||||||
<!-- Default Location -->
|
<!-- Default Location -->
|
||||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'location_id'])
|
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id'])
|
||||||
|
|
||||||
|
|
||||||
<!-- Purchase Cost -->
|
<!-- Purchase Cost -->
|
||||||
|
|
|
@ -82,13 +82,23 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ trans('general.status') }}</td>
|
<td>{{ trans('general.status') }}</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($asset->assetstatus->color)
|
|
||||||
<span class="label label-default" style="background-color: {{ e($asset->assetstatus->color) }};">
|
@if (($asset->assignedTo) && ($asset->deleted_at==''))
|
||||||
</span>
|
<i class="fa fa-circle text-blue"></i> {{ trans('general.deployed') }} <i class="fa fa-long-arrow-right" aria-hidden="true"></i> {!! $asset->assignedTo->present()->glyph() !!}
|
||||||
</span>
|
{!! $asset->assignedTo->present()->nameUrl() !!}
|
||||||
|
@else
|
||||||
|
@if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1'))
|
||||||
|
<i class="fa fa-circle text-green"></i>
|
||||||
|
@elseif (($asset->assetstatus) && ($asset->assetstatus->pending=='1'))
|
||||||
|
<i class="fa fa-circle text-orange"></i>
|
||||||
|
@elseif (($asset->assetstatus) && ($asset->assetstatus->archived=='1'))
|
||||||
|
<i class="fa fa-times text-red"></i>
|
||||||
|
@endif
|
||||||
|
<a href="{{ route('statuslabels.show', $asset->assetstatus->id) }}">
|
||||||
|
{{ $asset->assetstatus->name }}</a>
|
||||||
|
<label class="label label-default">{{ $asset->present()->statusMeta }}</label>
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
<a href="{{ route('statuslabels.show', $asset->assetstatus->id) }}">{{ $asset->assetstatus->name }}</a>
|
|
||||||
<label class="label label-default">{{ $asset->present()->statusMeta }}</label>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
|
@ -233,9 +243,15 @@
|
||||||
@endif
|
@endif
|
||||||
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}}
|
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}}
|
||||||
|
|
||||||
@if ($asset->order_number)
|
|
||||||
(Order #{{ $asset->order_number }})
|
</td>
|
||||||
@endif
|
</tr>
|
||||||
|
@endif
|
||||||
|
@if ($asset->order_number)
|
||||||
|
<tr>
|
||||||
|
<td>{{ trans('general.order_number') }}</td>
|
||||||
|
<td>
|
||||||
|
#{{ $asset->order_number }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -371,7 +371,6 @@
|
||||||
return '<a href="mailto:' + row.custom_fields[field_column_plain].value + '">' + row.custom_fields[field_column_plain].value + '</a>';
|
return '<a href="mailto:' + row.custom_fields[field_column_plain].value + '">' + row.custom_fields[field_column_plain].value + '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('NOT a URL!');
|
|
||||||
return row.custom_fields[field_column_plain].value;
|
return row.custom_fields[field_column_plain].value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue