mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge branch 'hotfixes/accessory_model_number' into develop
# Conflicts: # resources/views/accessories/edit.blade.php
This commit is contained in:
commit
d8eb68af83
|
@ -82,6 +82,7 @@ class AccessoriesController extends Controller
|
||||||
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
|
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
|
||||||
$accessory->order_number = e(Input::get('order_number'));
|
$accessory->order_number = e(Input::get('order_number'));
|
||||||
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
|
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
|
||||||
|
$accessory->model_number = e(Input::get('model_number'));
|
||||||
|
|
||||||
if (e(Input::get('purchase_date')) == '') {
|
if (e(Input::get('purchase_date')) == '') {
|
||||||
$accessory->purchase_date = null;
|
$accessory->purchase_date = null;
|
||||||
|
@ -164,6 +165,7 @@ class AccessoriesController extends Controller
|
||||||
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
|
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
|
||||||
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
|
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
|
||||||
$accessory->order_number = e(Input::get('order_number'));
|
$accessory->order_number = e(Input::get('order_number'));
|
||||||
|
$accessory->model_number = e(Input::get('model_number'));
|
||||||
|
|
||||||
if (e(Input::get('purchase_date')) == '') {
|
if (e(Input::get('purchase_date')) == '') {
|
||||||
$accessory->purchase_date = null;
|
$accessory->purchase_date = null;
|
||||||
|
@ -552,7 +554,7 @@ class AccessoriesController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$allowed_columns = ['name','min_amt','order_number','purchase_date','purchase_cost','companyName','category'];
|
$allowed_columns = ['name','min_amt','order_number','purchase_date','purchase_cost','companyName','category','model_number'];
|
||||||
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
|
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
|
||||||
$sort = in_array(Input::get('sort'), $allowed_columns) ? e(Input::get('sort')) : 'created_at';
|
$sort = in_array(Input::get('sort'), $allowed_columns) ? e(Input::get('sort')) : 'created_at';
|
||||||
|
|
||||||
|
@ -594,6 +596,7 @@ class AccessoriesController extends Controller
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
'name' => '<a href="'.url('admin/accessories/'.$accessory->id).'/view">'. $accessory->name.'</a>',
|
'name' => '<a href="'.url('admin/accessories/'.$accessory->id).'/view">'. $accessory->name.'</a>',
|
||||||
'category' => ($accessory->category) ? (string)link_to('admin/settings/categories/'.$accessory->category->id.'/view', $accessory->category->name) : '',
|
'category' => ($accessory->category) ? (string)link_to('admin/settings/categories/'.$accessory->category->id.'/view', $accessory->category->name) : '',
|
||||||
|
'model_number' => e($accessory->model_number),
|
||||||
'qty' => e($accessory->qty),
|
'qty' => e($accessory->qty),
|
||||||
'order_number' => e($accessory->order_number),
|
'order_number' => e($accessory->order_number),
|
||||||
'min_amt' => e($accessory->min_amt),
|
'min_amt' => e($accessory->min_amt),
|
||||||
|
|
|
@ -12,6 +12,10 @@ class IncreasePurchaseCostSize extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
|
$platform = Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform();
|
||||||
|
$platform->registerDoctrineTypeMapping('enum', 'string');
|
||||||
|
|
||||||
|
|
||||||
Schema::table('assets', function ($table) {
|
Schema::table('assets', function ($table) {
|
||||||
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
|
$table->decimal('purchase_cost', 20, 2)->nullable()->default(null)->change();
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddModelNumberToAccessories extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('accessories', function ($table) {
|
||||||
|
$table->string('model_number')->nullable()->default(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('accessories', function ($table) {
|
||||||
|
$table->dropColumn('model_number');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,6 +35,7 @@
|
||||||
<th data-switchable="true" data-searchable="true" data-sortable="true" data-field="companyName" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
|
<th data-switchable="true" data-searchable="true" data-sortable="true" data-field="companyName" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
|
||||||
<th data-sortable="true" data-searchable="true" data-field="name">{{ trans('admin/accessories/table.title') }}</th>
|
<th data-sortable="true" data-searchable="true" data-field="name">{{ trans('admin/accessories/table.title') }}</th>
|
||||||
<th data-searchable="true" data-sortable="true" data-field="category">{{ trans('admin/accessories/general.accessory_category') }}</th>
|
<th data-searchable="true" data-sortable="true" data-field="category">{{ trans('admin/accessories/general.accessory_category') }}</th>
|
||||||
|
<th data-searchable="true" data-sortable="true" data-field="model_number">{{ trans('admin/models/table.modelnumber') }}</th>
|
||||||
<th data-field="manufacturer" data-searchable="true" data-sortable="true">{{ trans('general.manufacturer') }}</th>
|
<th data-field="manufacturer" data-searchable="true" data-sortable="true">{{ trans('general.manufacturer') }}</th>
|
||||||
<th data-searchable="true" data-sortable="true" data-field="location">{{ trans('general.location') }}</th>
|
<th data-searchable="true" data-sortable="true" data-field="location">{{ trans('general.location') }}</th>
|
||||||
<th data-searchable="false" data-sortable="false" data-field="qty">{{ trans('admin/accessories/general.total') }}</th>
|
<th data-searchable="false" data-sortable="false" data-field="qty">{{ trans('admin/accessories/general.total') }}</th>
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
|
|
||||||
{{ $accessory->name }}
|
{{ $accessory->name }}
|
||||||
{{ trans('general.accessory') }}
|
{{ trans('general.accessory') }}
|
||||||
|
@if ($accessory->model_number!='')
|
||||||
|
({{ $accessory->model_number }})
|
||||||
|
@endif
|
||||||
|
|
||||||
@parent
|
@parent
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue