Skip to content

Commit

Permalink
Fixes #736 - more fields in bulk edit
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed May 4, 2015
1 parent bbdbd53 commit c8870dd
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/controllers/admin/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,22 @@ public function postBulkSave($assets = null)
if (Input::has('purchase_date')) {
$update_array['purchase_date'] = e(Input::get('purchase_date'));
}

if (Input::has('purchase_cost')) {
$update_array['purchase_cost'] = e(Input::get('purchase_cost'));
}

if (Input::has('supplier_id')) {
$update_array['supplier_id'] = e(Input::get('supplier_id'));
}

if (Input::has('order_number')) {
$update_array['order_number'] = e(Input::get('order_number'));
}

if (Input::has('warranty_months')) {
$update_array['warranty_months'] = e(Input::get('warranty_months'));
}

if (Input::has('rtd_location_id')) {
$update_array['rtd_location_id'] = e(Input::get('rtd_location_id'));
Expand Down
41 changes: 41 additions & 0 deletions app/views/backend/hardware/bulk.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,47 @@
</div>
</div>

<!-- Purchase Cost -->
<div class="form-group {{ $errors->has('purchase_cost') ? ' has-error' : '' }}">
<label for="purchase_cost" class="col-md-2 control-label">@lang('admin/hardware/form.cost')</label>
<div class="input-group col-md-3">
<span class="input-group-addon">@lang('general.currency')</span>
<input type="text" class="form-control" placeholder="@lang('admin/hardware/form.cost')" name="purchase_cost" id="purchase_cost" value="{{{ Input::old('purchase_cost') }}}">

{{ $errors->first('purchase_cost', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>

<!-- Supplier -->
<div class="form-group {{ $errors->has('supplier_id') ? ' has-error' : '' }}">
<label for="supplier_id" class="col-md-2 control-label">@lang('admin/hardware/form.supplier')</label>
<div class="col-md-7">
{{ Form::select('supplier_id', $supplier_list , Input::old('supplier_id'), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ $errors->first('supplier_id', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>

<!-- Order Number -->
<div class="form-group {{ $errors->has('order_number') ? ' has-error' : '' }}">
<label for="order_number" class="col-md-2 control-label">@lang('admin/hardware/form.order')</label>
<div class="col-md-7">
<input class="form-control" type="text" name="order_number" id="order_number" value="{{{ Input::old('order_number') }}}" />
{{ $errors->first('order_number', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>

<!-- Warranty -->
<div class="form-group {{ $errors->has('warranty_months') ? ' has-error' : '' }}">
<label for="warranty_months" class="col-md-2 control-label">@lang('admin/hardware/form.warranty')</label>
<div class="col-md-2">
<div class="input-group">
<input class="col-md-2 form-control" type="text" name="warranty_months" id="warranty_months" value="{{{ Input::old('warranty_months') }}}" /> <span class="input-group-addon">@lang('admin/hardware/form.months')</span>
{{ $errors->first('warranty_months', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>
</div>


@foreach ($assets as $key => $value)
<input type="hidden" name="bulk_edit[{{{ $key }}}]" value="1">
@endforeach
Expand Down

1 comment on commit c8870dd

@rp-tech
Copy link

@rp-tech rp-tech commented on c8870dd May 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: Nevermind, I made a total noob mistake - I appeared to download the PHP files from GitHub but it ended up just downloading the HTML of the site, with a .PHP extension.

Wget seems to have done the job. Thanks and sorry to be a bother!

I tried to merge these two files into my existing 1.2.7 install and I'm getting an error

Class Controllers\Admin\AssetsController does not exist

Am I missing anything obvious?

Apologies - I'm not a dev and I don't pretend to be - I'd just really like to get this feature working before 1.3 is out.

Thanks!

Please sign in to comment.