Skip to content

Commit dede09e

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents f39922f + 3787a3f commit dede09e

File tree

8 files changed

+38
-13
lines changed

8 files changed

+38
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ public/uploads/avatars/*
1616
/app/storage/logs/*
1717
/app/storage/debugbar/
1818
/bin/
19-
.idea
19+
.idea
20+
crowdin.yaml

app/controllers/admin/AssetsController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ public function postCreate()
212212

213213
// Was the asset created?
214214
if($asset->save()) {
215+
216+
$logaction = new Actionlog();
217+
$logaction->asset_id = $asset->id;
218+
$logaction->checkedout_to = $asset->assigned_to;
219+
$logaction->asset_type = 'hardware';
220+
$logaction->user_id = Sentry::getUser()->id;
221+
$logaction->note = e(Input::get('note'));
222+
$log = $logaction->logaction('checkout');
223+
215224
// Redirect to the asset listing page
216225
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.create.success'));
217226
}

app/controllers/admin/LicensesController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,9 @@ public function getCheckout($seatId)
377377
// Left join to get a list of assets and some other helpful info
378378
$asset = DB::table('assets')
379379
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
380-
->select('assets.id', 'name', 'first_name', 'last_name','asset_tag',
381-
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id'))
380+
->leftJoin('models', 'assets.model_id', '=', 'models.id')
381+
->select('assets.id', 'assets.name', 'first_name', 'last_name','asset_tag',
382+
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id, models.name as modelname'))
382383
->whereNull('assets.deleted_at')
383384
->get();
384385

@@ -389,9 +390,9 @@ public function getCheckout($seatId)
389390
for ($x=0; $x<count($asset_array); $x++) {
390391

391392
if ($asset_array[$x]['full_name']!='') {
392-
$full_name = ' ('.$asset_array[$x]['full_name'].')';
393+
$full_name = ' ('.$asset_array[$x]['full_name'].') '.$asset_array[$x]['modelname'];
393394
} else {
394-
$full_name = ' (Unassigned)';
395+
$full_name = ' (Unassigned) '.$asset_array[$x]['modelname'];
395396
}
396397
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;
397398

app/lang/en/admin/settings/general.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

33
return array(
4+
'auto_increment_assets' => 'Generate auto-incrementing asset IDs',
5+
'auto_increment_prefix' => 'Prefix (optional)',
6+
'auti_incrementing_help' => 'Enable auto-incrementing asset IDs first to set this',
47
'display_asset_name' => 'Display Asset Name',
58
'display_checkout_date' => 'Display Checkout Date',
69
'display_eol' => 'Display EOL in table view',

app/models/Location.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class Location extends Elegant
77
protected $rules = array(
88
'name' => 'required|alpha_space|min:3|max:255|unique:locations,name,{id}',
99
'city' => 'required|alpha_space|min:3|max:255',
10-
'state' => 'required|alpha|min:2|max:32',
11-
'country' => 'required|alpha|min:2|max:2|max:2',
10+
'state' => 'required|alpha_space|min:2|max:32',
11+
'country' => 'required|alpha_space|min:2|max:2|max:2',
1212
'address' => 'required|alpha_space|min:5|max:80',
1313
'address2' => 'alpha_space|min:5|max:80',
1414
'zip' => 'alpha_dash|min:3|max:10',

app/views/backend/hardware/checkout.blade.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@
4343
</div>
4444
@endif
4545

46+
@if ($asset->model->name)
47+
<!-- Asset name -->
48+
<div class="form-group">
49+
<label class="col-sm-2 control-label">@lang('admin/hardware/form.model')</label>
50+
<div class="col-md-6">
51+
<p class="form-control-static">{{{ $asset->model->name }}}</p>
52+
</div>
53+
</div>
54+
@endif
55+
56+
4657
<!-- User -->
4758

4859
<div class="form-group {{ $errors->has('assigned_to') ? ' has-error' : '' }}">

app/views/backend/licenses/checkout.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
<div class="form-group">
3232
<label class="col-sm-2 control-label">@lang('admin/hardware/form.name')</label>
3333
<div class="col-md-6">
34-
<p class="form-control-static">{{ $licenseseat->license->name }}</p>
34+
<p class="form-control-static">{{{ $licenseseat->license->name }}}</p>
3535
</div>
3636
</div>
3737

3838
<!-- Serial -->
3939
<div class="form-group">
4040
<label class="col-sm-2 control-label">@lang('admin/hardware/form.serial')</label>
41-
<div class="col-md-6">
42-
<p class="form-control-static">{{ $licenseseat->license->serial }}</p>
41+
<div class="col-md-10">
42+
<p class="form-control-static" style="word-wrap: break-word;">{{{ $licenseseat->license->serial }}}</p>
4343
</div>
4444
</div>
4545

@@ -48,8 +48,8 @@
4848
<label for="asset_id" class="col-md-2 control-label">@lang('admin/licenses/form.asset')
4949
</label>
5050

51-
<div class="col-md-9">
52-
{{ Form::select('asset_id', $asset_list , Input::old('asset_id', $licenseseat->asset_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
51+
<div class="col-md-10">
52+
{{ Form::select('asset_id', $asset_list , Input::old('asset_id', $licenseseat->asset_id), array('class'=>'select2', 'style'=>'min-width:600px')) }}
5353
{{ $errors->first('asset_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
5454
</div>
5555
</div>

app/views/backend/settings/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
@endif
9292
</tr>
9393
<tr>
94-
<td>@lang('admin/settings/general.qr_text')</td>
94+
<td>@lang('admin/settings/general.auti_incrementing_help')</td>
9595
<td>{{{ $setting->qr_text }}}</td>
9696
</tr>
9797
@endforeach

0 commit comments

Comments
 (0)