Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jan 22, 2015
2 parents f39922f + 3787a3f commit dede09e
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ public/uploads/avatars/*
/app/storage/logs/*
/app/storage/debugbar/
/bin/
.idea
.idea
crowdin.yaml
9 changes: 9 additions & 0 deletions app/controllers/admin/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ public function postCreate()

// Was the asset created?
if($asset->save()) {

$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->checkedout_to = $asset->assigned_to;
$logaction->asset_type = 'hardware';
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$log = $logaction->logaction('checkout');

// Redirect to the asset listing page
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.create.success'));
}
Expand Down
9 changes: 5 additions & 4 deletions app/controllers/admin/LicensesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@ public function getCheckout($seatId)
// Left join to get a list of assets and some other helpful info
$asset = DB::table('assets')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->select('assets.id', 'name', 'first_name', 'last_name','asset_tag',
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id'))
->leftJoin('models', 'assets.model_id', '=', 'models.id')
->select('assets.id', 'assets.name', 'first_name', 'last_name','asset_tag',
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id, models.name as modelname'))
->whereNull('assets.deleted_at')
->get();

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

if ($asset_array[$x]['full_name']!='') {
$full_name = ' ('.$asset_array[$x]['full_name'].')';
$full_name = ' ('.$asset_array[$x]['full_name'].') '.$asset_array[$x]['modelname'];
} else {
$full_name = ' (Unassigned)';
$full_name = ' (Unassigned) '.$asset_array[$x]['modelname'];
}
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;

Expand Down
3 changes: 3 additions & 0 deletions app/lang/en/admin/settings/general.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

return array(
'auto_increment_assets' => 'Generate auto-incrementing asset IDs',
'auto_increment_prefix' => 'Prefix (optional)',
'auti_incrementing_help' => 'Enable auto-incrementing asset IDs first to set this',
'display_asset_name' => 'Display Asset Name',
'display_checkout_date' => 'Display Checkout Date',
'display_eol' => 'Display EOL in table view',
Expand Down
4 changes: 2 additions & 2 deletions app/models/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Location extends Elegant
protected $rules = array(
'name' => 'required|alpha_space|min:3|max:255|unique:locations,name,{id}',
'city' => 'required|alpha_space|min:3|max:255',
'state' => 'required|alpha|min:2|max:32',
'country' => 'required|alpha|min:2|max:2|max:2',
'state' => 'required|alpha_space|min:2|max:32',
'country' => 'required|alpha_space|min:2|max:2|max:2',
'address' => 'required|alpha_space|min:5|max:80',
'address2' => 'alpha_space|min:5|max:80',
'zip' => 'alpha_dash|min:3|max:10',
Expand Down
11 changes: 11 additions & 0 deletions app/views/backend/hardware/checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
</div>
@endif

@if ($asset->model->name)
<!-- Asset name -->
<div class="form-group">
<label class="col-sm-2 control-label">@lang('admin/hardware/form.model')</label>
<div class="col-md-6">
<p class="form-control-static">{{{ $asset->model->name }}}</p>
</div>
</div>
@endif


<!-- User -->

<div class="form-group {{ $errors->has('assigned_to') ? ' has-error' : '' }}">
Expand Down
10 changes: 5 additions & 5 deletions app/views/backend/licenses/checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
<div class="form-group">
<label class="col-sm-2 control-label">@lang('admin/hardware/form.name')</label>
<div class="col-md-6">
<p class="form-control-static">{{ $licenseseat->license->name }}</p>
<p class="form-control-static">{{{ $licenseseat->license->name }}}</p>
</div>
</div>

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

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

<div class="col-md-9">
{{ Form::select('asset_id', $asset_list , Input::old('asset_id', $licenseseat->asset_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
<div class="col-md-10">
{{ Form::select('asset_id', $asset_list , Input::old('asset_id', $licenseseat->asset_id), array('class'=>'select2', 'style'=>'min-width:600px')) }}
{{ $errors->first('asset_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/backend/settings/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
@endif
</tr>
<tr>
<td>@lang('admin/settings/general.qr_text')</td>
<td>@lang('admin/settings/general.auti_incrementing_help')</td>
<td>{{{ $setting->qr_text }}}</td>
</tr>
@endforeach
Expand Down

0 comments on commit dede09e

Please sign in to comment.