Merge branch 'snipe:master' into fixes/auto_asset_tag_phrasing
This commit is contained in:
commit
87bb741013
6 changed files with 90 additions and 14 deletions
|
@ -31,8 +31,8 @@ class PredefinedKitsController extends Controller
|
|||
|
||||
$offset = $request->input('offset', 0);
|
||||
$limit = $request->input('limit', 50);
|
||||
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
|
||||
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets_count';
|
||||
$order = $request->input('order') === 'desc' ? 'desc' : 'asc';
|
||||
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'name';
|
||||
$kits->orderBy($sort, $order);
|
||||
|
||||
$total = $kits->count();
|
||||
|
|
|
@ -23,6 +23,12 @@ use Redirect;
|
|||
class CustomFieldsetsController extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
return redirect()->route("fields.index")
|
||||
->with("error", trans('admin/custom_fields/message.fieldset.does_not_exist'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates and stores a new custom field.
|
||||
*
|
||||
|
|
|
@ -6,15 +6,49 @@ use App\Helpers\Helper;
|
|||
|
||||
class ModalController extends Controller
|
||||
{
|
||||
function show($type, $itemId = null) {
|
||||
$view = view("modals.${type}");
|
||||
|
||||
if($type == "statuslabel") {
|
||||
$view->with('statuslabel_types', Helper::statusTypeList());
|
||||
/**
|
||||
* Load the modal views after confirming they are in the allowed_types array.
|
||||
* The allowed types away just prevents shithead skiddies from fuzzing the urls
|
||||
* with automated scripts and junking up the logs. - snipe
|
||||
*
|
||||
* @version v5.3.7-pre
|
||||
* @author [Brady Wetherington] [<uberbrady@gmail.com>]
|
||||
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||
* @return View
|
||||
*/
|
||||
function show ($type, $itemId = null) {
|
||||
|
||||
// These values should correspond to a file in resources/views/modals/
|
||||
$allowed_types = [
|
||||
'category',
|
||||
'kit-model',
|
||||
'kit-license',
|
||||
'kit-consumable',
|
||||
'kit-accessory',
|
||||
'location',
|
||||
'manufacturer',
|
||||
'model',
|
||||
'statuslabel',
|
||||
'supplier',
|
||||
'upload-file',
|
||||
'user',
|
||||
];
|
||||
|
||||
|
||||
if (in_array($type, $allowed_types)) {
|
||||
$view = view("modals.${type}");
|
||||
|
||||
if ($type == "statuslabel") {
|
||||
$view->with('statuslabel_types', Helper::statusTypeList());
|
||||
}
|
||||
if (in_array($type, ['kit-model', 'kit-license', 'kit-consumable', 'kit-accessory'])) {
|
||||
$view->with('kitId', $itemId);
|
||||
}
|
||||
return $view;
|
||||
}
|
||||
if(in_array($type, ['kit-model', 'kit-license', 'kit-consumable', 'kit-accessory'])) {
|
||||
$view->with('kitId', $itemId);
|
||||
}
|
||||
return $view;
|
||||
|
||||
abort(404,'Page not found');
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,13 +9,13 @@ use Illuminate\Database\Eloquent\Collection;
|
|||
class GroupsTransformer
|
||||
{
|
||||
|
||||
public function transformGroups (Collection $groups)
|
||||
public function transformGroups (Collection $groups, $total = null)
|
||||
{
|
||||
$array = array();
|
||||
foreach ($groups as $group) {
|
||||
$array[] = self::transformGroup($group);
|
||||
}
|
||||
return (new DatatablesTransformer)->transformDatatables($array);
|
||||
return (new DatatablesTransformer)->transformDatatables($array, $total);
|
||||
}
|
||||
|
||||
public function transformGroup (Group $group)
|
||||
|
|
|
@ -14,8 +14,8 @@ class Supplier extends SnipeModel
|
|||
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:1|max:255|unique_undeleted',
|
||||
'address' => 'max:50|nullable',
|
||||
'address2' => 'max:50|nullable',
|
||||
'address' => 'max:250|nullable',
|
||||
'address2' => 'max:250|nullable',
|
||||
'city' => 'max:255|nullable',
|
||||
'state' => 'max:32|nullable',
|
||||
'country' => 'max:3|nullable',
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ChangeSupplierAddressLength extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('suppliers', function (Blueprint $table) {
|
||||
//
|
||||
$table->string('address', 250)->nullable()->change();
|
||||
$table->string('address2', 250)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('suppliers', function (Blueprint $table) {
|
||||
//
|
||||
$table->text('address', 50)->nullable()->default(null)->change();
|
||||
$table->text('address2', 50)->nullable()->default(null)->change();
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue