Commit f1437063 authored by OskarStenberg's avatar OskarStenberg
Browse files

Added Consumable bulk actions

parent 5b587449
......@@ -18,6 +18,9 @@ class ConsumablePresenter extends Presenter
{
$layout = [
[
"field" => "checkbox",
"checkbox" => true
], [
"field" => "id",
"searchable" => false,
"sortable" => true,
......
......@@ -11,12 +11,14 @@ return array(
'update' => array(
'error' => 'Consumable was not updated, please try again',
'success' => 'Consumable updated successfully.'
'success' => 'Consumable updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
),
'delete' => array(
'confirm' => 'Are you sure you wish to delete this consumable?',
'error' => 'There was an issue deleting the consumable. Please try again.',
'nothing_updated' => 'No consumables were selected, so nothing was deleted.',
'success' => 'The consumable was deleted successfully.'
),
......
......@@ -246,4 +246,5 @@
'clear_signature' => 'Clear Signature',
'show_help' => 'Show help',
'hide_help' => 'Hide help',
'min_amt' => 'Minimum Quantity',
];
......@@ -15,11 +15,26 @@
{{-- Page content --}}
@section('content')
{{ Form::open([
'method' => 'POST',
'route' => ['consumables/bulkedit'],
'class' => 'form-inline',
'id' => 'bulkForm']) }}
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<div class="box-body">
<div id="toolbar">
<label for="bulk_actions"><span class="sr-only">Bulk Actions</span></label>
<select name="bulk_actions" class="form-control select2" style="width: 150px;" aria-label="bulk_actions">
<option value="edit">Edit</option>
<option value="delete">Delete</option>
<option value="labels">Generate Labels</option>
</select>
<button class="btn btn-primary" id="bulkEdit" disabled>Go</button>
</div>
<table
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
data-cookie-id-table="consumablesTable"
......@@ -48,6 +63,7 @@
</div> <!-- /.col-md-12 -->
</div> <!-- /.row -->
{{ Form::close() }}
@stop
@section('moar_scripts')
......
......@@ -30,6 +30,25 @@
<div class="box-body">
<div class="row">
<div class="col-md-12">
<div class="col-md-2">
<strong>
Labels
</strong>
</div>
<div class="col-md-6">
{{ Form::open([
'method' => 'POST',
'route' => ['consumables/bulkedit'],
'class' => 'form-inline',
'id' => 'bulkForm']) }}
<input type="hidden" name="bulk_actions" value="labels" />
<input type="hidden" name="ids[{{$consumable->id}}]" value="{{ $consumable->id }}" />
<button class="btn btn-sm btn-default" id="bulkEdit" ><i class="fa fa-barcode" aria-hidden="true"></i> {{ trans_choice('button.generate_labels', 1) }}</button>
{{ Form::close() }}
</div>
<div class="table table-responsive">
<table
......
......@@ -3,14 +3,42 @@
# Consumables
Route::group([ 'prefix' => 'consumables', 'middleware' => ['auth']], function () {
Route::get(
'{consumableID}/checkout',
[ 'as' => 'checkout/consumable','uses' => 'Consumables\ConsumableCheckoutController@create' ]
);
Route::post(
'{consumableID}/checkout',
[ 'as' => 'checkout/consumable', 'uses' => 'Consumables\ConsumableCheckoutController@store' ]
);
Route::get('{consumableID}/checkout', [
'as' => 'checkout/consumable',
'uses' => 'Consumables\ConsumableCheckoutController@create'
]);
Route::post('{consumableID}/checkout', [
'as' => 'checkout/consumable',
'uses' => 'Consumables\ConsumableCheckoutController@store'
]);
Route::get('{consumableID}/label', [
'as' => 'label/consumable',
'uses' => 'Consumables\ConsumablesController@getLabel'
]);
Route::get('{consumableID}/qr_code', [
'as' => 'qr_code/consumable',
'uses' => 'Consumables\ConsumablesController@getQrCode'
]);
Route::get('{consumableID}/view', [
'as' => 'consumables.view',
'uses' => 'Assets\AssetsController@show'
]);
Route::get('{consumableID}/barcode', [
'as' => 'barcode/consumable',
'uses' => 'Consumables\ConsumablesController@getBarCode'
]);
Route::post( 'bulkedit', [
'as' => 'consumables/bulkedit',
'uses' => 'Consumables\BulkConsumablesController@edit'
]);
Route::post('bulkdelete', [
'as' => 'consumables/bulkdelete',
'uses' => 'Consumables\BulkConsumablesController@destroy'
]);
Route::post('bulksave', [
'as' => 'consumables/bulksave',
'uses' => 'Consumables\BulkConsumablesController@update'
]);
});
Route::resource('consumables', 'Consumables\ConsumablesController', [
......
......@@ -22,7 +22,10 @@ Route::group(
'parameters' => ['maintenance' => 'maintenance_id', 'asset' => 'asset_id']
]);
Route::get('requested', [ 'as' => 'assets.requested', 'uses' => 'Assets\AssetsController@getRequestedIndex']);
Route::get('requested', [
'as' => 'assets.requested',
'uses' => 'Assets\AssetsController@getRequestedIndex'
]);
Route::get('scan', [
'as' => 'asset.scan',
......@@ -129,8 +132,14 @@ Route::group(
'as' => 'hardware.view',
'uses' => 'Assets\AssetsController@show'
]);
Route::get('{assetId}/qr_code', [ 'as' => 'qr_code/hardware', 'uses' => 'Assets\AssetsController@getQrCode' ]);
Route::get('{assetId}/barcode', [ 'as' => 'barcode/hardware', 'uses' => 'Assets\AssetsController@getBarCode' ]);
Route::get('{assetId}/qr_code', [
'as' => 'qr_code/hardware',
'uses' => 'Assets\AssetsController@getQrCode'
]);
Route::get('{assetId}/barcode', [
'as' => 'barcode/hardware',
'uses' => 'Assets\AssetsController@getBarCode'
]);
Route::get('{assetId}/restore', [
'as' => 'restore/hardware',
'uses' => 'Assets\AssetsController@getRestore'
......@@ -151,27 +160,18 @@ Route::group(
]);
Route::post(
'bulkedit',
[
Route::post( 'bulkedit', [
'as' => 'hardware/bulkedit',
'uses' => 'Assets\BulkAssetsController@edit'
]
);
Route::post(
'bulkdelete',
[
]);
Route::post('bulkdelete', [
'as' => 'hardware/bulkdelete',
'uses' => 'Assets\BulkAssetsController@destroy'
]
);
Route::post(
'bulksave',
[
]);
Route::post('bulksave', [
'as' => 'hardware/bulksave',
'uses' => 'Assets\BulkAssetsController@update'
]
);
]);
# Bulk checkout / checkin
Route::get( 'bulkcheckout', [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment