Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Models/Accessory.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Accessory extends SnipeModel
* Accessory validation rules
*/
public $rules = [
'name' => 'required|min:3|max:255',
'name' => 'required|max:255',
'qty' => 'required|integer|min:1',
'category_id' => 'required|integer|exists:categories,id',
'company_id' => 'integer|nullable',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ final class Company extends SnipeModel

// Declare the rules for the model validation
protected $rules = [
'name' => 'required|min:1|max:255|unique:companies,name',
'name' => 'required|max:255|unique:companies,name',
'fax' => 'min:7|max:35|nullable',
'phone' => 'min:7|max:35|nullable',
'email' => 'email|max:150|nullable',
'email' => 'email|max:150|nullable',
];

protected $presenter = \App\Presenters\CompanyPresenter::class;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Component extends SnipeModel
* Category validation rules
*/
public $rules = [
'name' => 'required|min:3|max:191',
'name' => 'required|max:191',
'qty' => 'required|integer|min:1',
'category_id' => 'required|integer|exists:categories,id',
'supplier_id' => 'nullable|integer|exists:suppliers,id',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Consumable.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Consumable extends SnipeModel
* Category validation rules
*/
public $rules = [
'name' => 'required|min:3|max:255',
'name' => 'required|max:255',
'qty' => 'required|integer|min:0|max:99999',
'category_id' => 'required|integer',
'company_id' => 'integer|nullable',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Depreciation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Depreciation extends SnipeModel
use Presentable;
// Declare the rules for the form validation
protected $rules = [
'name' => 'required|min:3|max:255|unique:depreciations,name',
'name' => 'required|max:255|unique:depreciations,name',
'months' => 'required|max:3600|integer',
];

Expand Down
2 changes: 1 addition & 1 deletion app/Models/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Group extends SnipeModel
protected $table = 'permission_groups';

public $rules = [
'name' => 'required|min:2|max:255|unique',
'name' => 'required|max:255|unique',
];

protected $fillable = [
Expand Down
2 changes: 1 addition & 1 deletion app/Models/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class License extends Depreciable
];

protected $rules = [
'name' => 'required|string|min:3|max:255',
'name' => 'required|string|max:255',
'seats' => 'required|min:1|integer|limit_change:10000', // limit_change is a "pseudo-rule" that translates into 'between', see prepareLimitChangeRule() below
'license_email' => 'email|nullable|max:120',
'license_name' => 'string|nullable|max:100',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Location extends SnipeModel

protected $table = 'locations';
protected $rules = [
'name' => 'required|min:2|max:255|unique_undeleted',
'name' => 'required|max:255|unique_undeleted',
'address' => 'max:191|nullable',
'address2' => 'max:191|nullable',
'city' => 'max:191|nullable',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Manufacturer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Manufacturer extends SnipeModel

// Declare the rules for the form validation
protected $rules = [
'name' => 'required|min:2|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL',
'name' => 'required|max:255|unique:manufacturers,name,NULL,id,deleted_at,NULL',
'url' => 'nullable|starts_with:http://,https://,afp://,facetime://,file://,irc://',
'support_email' => 'email|nullable',
'support_url' => 'nullable|starts_with:http://,https://,afp://,facetime://,file://,irc://',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/PredefinedKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PredefinedKit extends SnipeModel
* Category validation rules
*/
public $rules = [
'name' => 'required|min:1|max:255|unique',
'name' => 'required|max:255|unique',
];

use ValidatingTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Statuslabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Statuslabel extends SnipeModel
protected $hidden = ['user_id', 'deleted_at'];

protected $rules = [
'name' => 'required|string|unique_undeleted',
'name' => 'required|max:255|string|unique_undeleted',
'notes' => 'string|nullable',
'deployable' => 'required',
'pending' => 'required',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Supplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Supplier extends SnipeModel
protected $table = 'suppliers';

protected $rules = [
'name' => 'required|min:1|max:255|unique_undeleted',
'name' => 'required|max:255|unique_undeleted',
'fax' => 'min:7|max:35|nullable',
'phone' => 'min:7|max:35|nullable',
'contact' => 'max:100|nullable',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
*/

protected $rules = [
'first_name' => 'required|string|min:1|max:191',
'first_name' => 'required|string|max:191',
'last_name' => 'nullable|string|max:191',
'display_name' => 'nullable|string|max:191',
'username' => 'required|string|min:1|unique_undeleted|max:191',
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en-US/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
'manufacturers' => 'Manufacturers',
'markdown' => 'This field allows <a href="https://help.github.com/articles/github-flavored-markdown/">Github flavored markdown</a>.',
'min_amt' => 'Min. QTY',
'min_amt_help' => 'Minimum number of items that should be available before an alert gets triggered. Leave Min. QTY blank if you do not want to receive alerts for low inventory.',
'min_amt_help' => 'Minimum number of this item that should be available for checkout before an alert gets triggered. Leave blank if you do not wish to receive alerts for low inventory.',
'model_no' => 'Model No.',
'months' => 'months',
'moreinfo' => 'More Info',
Expand Down
6 changes: 3 additions & 3 deletions resources/views/consumables/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
@section('inputFields')

@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/consumables/table.title')])
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'consumable'])
@include ('partials.forms.edit.quantity')
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
Expand All @@ -25,8 +27,6 @@
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
@include ('partials.forms.edit.purchase_cost', [ 'unit_cost' => trans('general.unit_cost')])
@include ('partials.forms.edit.quantity')
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.notes')
@include ('partials.forms.edit.image-upload', ['image_path' => app('consumables_upload_path')])

Expand Down
14 changes: 7 additions & 7 deletions resources/views/partials/forms/edit/minimum_quantity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<div class="form-group{{ $errors->has('min_amt') ? ' has-error' : '' }}">
<label for="min_amt" class="col-md-3 control-label">{{ trans('general.min_amt') }}</label>
<div class="col-md-9">
<div class="col-md-2" style="padding-left:0px">
<input class="form-control col-md-3" maxlength="5" type="text" name="min_amt" id="min_amt"
<div class="col-md-3" style="padding-left:0px">
<input class="form-control col-md-3" maxlength="5" type="number" name="min_amt" id="min_amt"
aria-label="min_amt"
min="0"
value="{{ old('min_amt', ($item->min_amt ?? '')) }}"
{{ (isset($item) && (Helper::checkIfRequired($item, 'min_amt')) ? ' required' : '') }}/>
</div>
<div class="col-md-7" style="margin-left: -15px;">
<x-form-tooltip>
{{ trans('general.min_amt_help') }}
</x-form-tooltip>
</a>
<div class="col-md-7" style="margin-left: -15px;">
<x-form-tooltip>
{{ trans('general.min_amt_help') }}
</x-form-tooltip>
</div>
<div class="col-md-12">
{!! $errors->first('min_amt', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
Expand Down
8 changes: 4 additions & 4 deletions resources/views/partials/forms/edit/quantity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<!-- QTY -->
<div class="form-group {{ $errors->has('qty') ? ' has-error' : '' }}">
<label for="qty" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
<div class="col-md-7">
<div class="col-md-3" style="padding-left:0px">
<input class="form-control" maxlength="5" type="text" name="qty" aria-label="qty" id="qty" value="{{ old('qty', $item->qty) }}" {!! (Helper::checkIfRequired($item, 'qty')) ? ' required ' : '' !!}/>
<div class="col-md-9">
<div class="col-md-3" style="padding-left:0">
<input class="form-control" maxlength="5" min="1" type="number" name="qty" aria-label="qty" id="qty" value="{{ old('qty', $item->qty) }}" {!! (Helper::checkIfRequired($item, 'qty')) ? ' required ' : '' !!}/>
</div>
<div class="col-md-12" style="padding-left:0px">
<div class="col-md-12" style="padding-left:0">
{!! $errors->first('qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
Expand Down
Loading