Merge branch 'develop'

# Conflicts:
#	config/version.php
This commit is contained in:
snipe 2017-11-30 16:43:59 -08:00
commit 5979a18852
8 changed files with 71 additions and 54 deletions

View file

@ -1081,70 +1081,73 @@ class AssetsController extends Controller
* @internal param array $assets
* @since [v2.0]
*/
public function postBulkSave()
public function postBulkSave(Request $request)
{
$this->authorize('update', Asset::class);
if (Input::has('ids')) {
$assets = Input::get('ids');
if ((Input::has('purchase_date'))
|| (Input::has('purchase_cost'))
|| (Input::has('supplier_id'))
|| (Input::has('order_number'))
|| (Input::has('warranty_months'))
|| (Input::has('rtd_location_id'))
|| (Input::has('requestable'))
|| (Input::has('company_id'))
|| (Input::has('status_id'))
|| (Input::has('model_id'))
\Log::debug($request->input('ids'));
if (($request->has('ids')) && (count($request->input('ids') > 0))) {
$assets = $request->input('ids');
if (($request->has('purchase_date'))
|| ($request->has('purchase_cost'))
|| ($request->has('supplier_id'))
|| ($request->has('order_number'))
|| ($request->has('warranty_months'))
|| ($request->has('rtd_location_id'))
|| ($request->has('requestable'))
|| ($request->has('company_id'))
|| ($request->has('status_id'))
|| ($request->has('model_id'))
) {
foreach ($assets as $key => $value) {
$update_array = array();
if (Input::has('purchase_date')) {
$update_array['purchase_date'] = e(Input::get('purchase_date'));
if ($request->has('purchase_date')) {
$update_array['purchase_date'] = $request->input('purchase_date');
}
if (Input::has('purchase_cost')) {
$update_array['purchase_cost'] = Helper::ParseFloat(e(Input::get('purchase_cost')));
if ($request->has('purchase_cost')) {
$update_array['purchase_cost'] = Helper::ParseFloat($request->input('purchase_cost'));
}
if (Input::has('supplier_id')) {
$update_array['supplier_id'] = e(Input::get('supplier_id'));
if ($request->has('supplier_id')) {
$update_array['supplier_id'] = $request->input('supplier_id');
}
if (Input::has('model_id')) {
$update_array['model_id'] = e(Input::get('model_id'));
if ($request->has('model_id')) {
$update_array['model_id'] = $request->input('model_id');
}
if (Input::has('company_id')) {
if (Input::get('company_id')=="clear") {
if ($request->has('company_id')) {
if ($request->input('company_id')=="clear") {
$update_array['company_id'] = null;
} else {
$update_array['company_id'] = e(Input::get('company_id'));
$update_array['company_id'] = $request->input('company_id');
}
}
if (Input::has('order_number')) {
$update_array['order_number'] = e(Input::get('order_number'));
if ($request->has('order_number')) {
$update_array['order_number'] = $request->input('order_number');
}
if (Input::has('warranty_months')) {
$update_array['warranty_months'] = e(Input::get('warranty_months'));
if ($request->has('warranty_months')) {
$update_array['warranty_months'] = $request->input('warranty_months');
}
if (Input::has('rtd_location_id')) {
$update_array['rtd_location_id'] = e(Input::get('rtd_location_id'));
if ($request->has('rtd_location_id')) {
$update_array['rtd_location_id'] = $request->input('rtd_location_id');
}
if (Input::has('status_id')) {
$update_array['status_id'] = e(Input::get('status_id'));
if ($request->has('status_id')) {
$update_array['status_id'] = $request->input('status_id');
}
if (Input::has('requestable')) {
$update_array['requestable'] = e(Input::get('requestable'));
if ($request->has('requestable')) {
$update_array['requestable'] = $request->input('requestable');
}
DB::table('assets')
->where('id', $key)
->update($update_array);
} // 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
}
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
return redirect()->to("hardware");
return redirect()->route("hardware.index")->with('warning', trans('No assets selected, so nothing was updated.'));
}
/**

View file

@ -160,7 +160,6 @@ class CustomField extends Model
public function getFormatAttribute($value)
{
foreach (self::$PredefinedFormats as $name => $pattern) {
\Log::debug($name.'=>'.$pattern);
if ($pattern === $value) {
return $name;
}

View file

@ -40,7 +40,7 @@ class LocationPresenter extends Presenter
public function glyph()
{
return '<i class="fa fa-globe"></i>';
return '<i class="fa fa-map-marker"></i>';
}
public function fullName() {

View file

@ -352,6 +352,6 @@ class UserPresenter extends Presenter
public function glyph()
{
return '<i class="fa fa-users"></i>';
return '<i class="fa fa-user"></i>';
}
}

View file

@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v4.1.6-pre',
'full_app_version' => 'v4.1.6-pre - build 2963-g83c8449',
'app_version' => 'v4.1.6',
'full_app_version' => 'v4.1.6 - build 2963-g83c8449',
'build_version' => '2963',
'prerelease_version' => '',
'hash_version' => 'g83c8449',
'full_hash' => 'v4.1.5-57-g83c8449',
'full_hash' => 'v4.1.5-76-gb934d2e',
'branch' => 'master',
);

View file

@ -52,7 +52,7 @@
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id'])
<!-- 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 -->

View file

@ -82,13 +82,23 @@
<tr>
<td>{{ trans('general.status') }}</td>
<td>
@if ($asset->assetstatus->color)
<span class="label label-default" style="background-color: {{ e($asset->assetstatus->color) }};">
&nbsp; &nbsp;</span>
</span>
@if (($asset->assignedTo) && ($asset->deleted_at==''))
<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() !!}
{!! $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
<a href="{{ route('statuslabels.show', $asset->assetstatus->id) }}">{{ $asset->assetstatus->name }}</a>
<label class="label label-default">{{ $asset->present()->statusMeta }}</label>
</td>
</tr>
@endif
@ -233,9 +243,15 @@
@endif
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost)}}
@if ($asset->order_number)
(Order #{{ $asset->order_number }})
@endif
</td>
</tr>
@endif
@if ($asset->order_number)
<tr>
<td>{{ trans('general.order_number') }}</td>
<td>
#{{ $asset->order_number }}
</td>
</tr>
@endif

View file

@ -371,7 +371,6 @@
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;
}