Merge branch 'madd15-patch-2' into develop
This commit is contained in:
@@ -82,6 +82,7 @@ class SettingsController extends AdminController
|
||||
$setting->id = '1';
|
||||
$setting->site_name = e(Input::get('site_name'));
|
||||
$setting->display_asset_name = e(Input::get('display_asset_name', '0'));
|
||||
$setting->display_checkout_date = e(Input::get('display_checkout_date', '0'));
|
||||
$setting->per_page = e(Input::get('per_page'));
|
||||
$setting->qr_code = e(Input::get('qr_code', '0'));
|
||||
$setting->qr_text = e(Input::get('qr_text'));
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDisplayCheckoutDate extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->integer('display_checkout_date')->nullable()->default(NULL);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('display_checkout_date');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ return array(
|
||||
'asset_model' => 'Model',
|
||||
'book_value' => 'Value',
|
||||
'change' => 'In/Out',
|
||||
'checkout_date' => 'Checkout Date',
|
||||
'checkoutto' => 'Checked Out',
|
||||
'diff' => 'Diff',
|
||||
'dl_csv' => 'Download CSV',
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'display_asset_name' => 'Display Asset Name',
|
||||
'display_checkout_date' => 'Display Checkout Date',
|
||||
'display_qr' => 'Display QR Codes',
|
||||
'info' => 'These settings let you customize certain aspects of your installation.',
|
||||
'per_page' => 'Results Per Page',
|
||||
'php_gd_info' => 'You must install php-gd to display QR codes, see <a href="http://www.php.net/manual/en/image.installation.php">install instructions</a>.',
|
||||
'php_gd_warning' => 'PHP Image Processing and GD plugin is NOT installed.',
|
||||
'qr_help' => 'Enable QR Codes first to set this',
|
||||
'qr_text' => 'QR Code Text',
|
||||
'setting' => 'Setting',
|
||||
'title' => 'Settings',
|
||||
'settings' => 'Settings',
|
||||
'site_name' => 'Site Name',
|
||||
'update' => 'Update Settings',
|
||||
'value' => 'Value',
|
||||
'display_asset_name' => 'Display Asset Name',
|
||||
);
|
||||
|
||||
@@ -61,6 +61,9 @@ $debugbar["messages"]->addMessage("hello world!");
|
||||
<th class="col-md-2" bSortable="true">@lang('general.status')</th>
|
||||
|
||||
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.location')</th>
|
||||
@if (Input::get('Deployed') && Setting::getSettings()->display_checkout_date)
|
||||
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.checkout_date')</th>
|
||||
@endif
|
||||
<th class="col-md-2">@lang('admin/hardware/table.eol')</th>
|
||||
<th class="col-md-1">@lang('admin/hardware/table.change')</th>
|
||||
<th class="col-md-2 actions" bSortable="false">@lang('table.actions')</th>
|
||||
@@ -113,7 +116,13 @@ $debugbar["messages"]->addMessage("hello world!");
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
@if (Input::get('Deployed') && Setting::getSettings()->display_checkout_date)
|
||||
<td>
|
||||
@if (count($asset->assetlog) > 0)
|
||||
{{{ $asset->assetlog->first()->added_on }}}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
@if ($asset->model->eol)
|
||||
{{{ $asset->eol_date() }}}
|
||||
|
||||
@@ -37,46 +37,47 @@ $debugbar["messages"]->addMessage("hello world!");
|
||||
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
{{ Form::hidden('_token', csrf_token()) }}
|
||||
|
||||
@foreach ($settings as $setting)
|
||||
|
||||
<div class="form-group {{ $errors->has('site_name') ? 'error' : '' }}">
|
||||
<label class="control-label" for="site_name">Site Name</label>
|
||||
{{ Form::label('site_name', Lang::get('admin/settings/general.site_name'), array('class' => 'control-label')) }}
|
||||
<div class="controls">
|
||||
<input class="col-md-9" type="text" name="site_name" id="site_name" value="{{{ Input::old('site_name', $setting->site_name) }}}" />
|
||||
{{ Form::text('site_name', Input::old('site_name', $setting->site_name), array('class' => 'col-md-9')) }}
|
||||
{{ $errors->first('site_name', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('display_asset_name') ? 'error' : '' }}">
|
||||
<label class="control-label" for="display_asset_name">
|
||||
@lang('admin/settings/general.display_asset_name')
|
||||
</label>
|
||||
{{ Form::label('display_asset_name', Lang::get('admin/settings/general.display_asset_name'), array('class' => 'control-label')) }}
|
||||
<div class="controls">
|
||||
|
||||
<input class="col-md-1" type="checkbox" name="display_asset_name" id="display_asset_name" value="1" {{{ $setting->display_asset_name === 1 ? 'checked' : '' }}} />
|
||||
|
||||
{{ Form::checkbox('display_asset_name', '1', Input::old('display_asset_name', $setting->display_asset_name)) }}
|
||||
{{ $errors->first('display_asset_name', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group {{ $errors->has('display_checkout_date') ? 'error' : '' }}">
|
||||
{{ Form::label('display_checkout_date', Lang::get('admin/settings/general.display_checkout_date'), array('class' => 'control-label')) }}
|
||||
<div class="controls">
|
||||
{{ Form::checkbox('display_checkout_date', '1', Input::old('display_checkout_date', $setting->display_checkout_date)) }}
|
||||
{{ $errors->first('display_checkout_date', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('per_page') ? 'error' : '' }}">
|
||||
<label class="control-label" for="per_page">Results Per Page</label>
|
||||
{{ Form::label('per_page', Lang::get('admin/settings/general.per_page'), array('class' => 'control-label')) }}
|
||||
<div class="controls">
|
||||
<input class="col-md-1" type="text" name="per_page" id="per_page" value="{{{ Input::old('per_page', $setting->per_page) }}}" />
|
||||
{{ Form::text('per_page', Input::old('per_page', $setting->per_page))}}
|
||||
{{ $errors->first('per_page', '<span class="help-inline">:message</span>') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('qr_code') ? 'error' : '' }}">
|
||||
<label class="control-label" for="qr_code">
|
||||
@lang('admin/settings/general.display_qr')</label>
|
||||
{{ Form::label('qr_code', Lang::get('admin/settings/general.display_qr'), array('class' => 'control-label')) }}
|
||||
<div class="controls">
|
||||
@if ($is_gd_installed)
|
||||
{{ Form::checkbox('qr_code', '1', Input::old('qr_code', $setting->qr_code)) }}
|
||||
{{ Form::checkbox('qr_code', '1', Input::old('qr_code', $setting->qr_code)) }}
|
||||
|
||||
@else
|
||||
<span class="help-inline">
|
||||
@@ -90,10 +91,10 @@ $debugbar["messages"]->addMessage("hello world!");
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('qr_text') ? 'error' : '' }}">
|
||||
<label class="control-label" for="qr_text"> @lang('admin/settings/general.qr_text')</label>
|
||||
{{ Form::label('qr_text', Lang::get('admin/settings/general.qr_text'), array('class' => 'control-label')) }}
|
||||
<div class="controls">
|
||||
@if ($setting->qr_code === 1)
|
||||
<input class="col-md-9" type="text" name="qr_text" id="qr_text" value="{{{ Input::old('qr_text', $setting->qr_text) }}}" />
|
||||
{{ Form::text('qr_text', Input::old('qr_text', $setting->qr_text), array('class' => 'col-md-9')) }}
|
||||
@else
|
||||
<span class="help-inline">
|
||||
@lang('admin/settings/general.qr_help')
|
||||
@@ -127,5 +128,4 @@ $debugbar["messages"]->addMessage("hello world!");
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
Settings ::
|
||||
@lang('admin/settings/general.settings') ::
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@@ -16,7 +16,7 @@ Settings ::
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="name">Settings</h3>
|
||||
<h3 class="name">@lang('admin/settings/general.settings')</h3>
|
||||
|
||||
|
||||
<div class="row-fluid profile">
|
||||
@@ -29,14 +29,14 @@ Settings ::
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">Setting</th>
|
||||
<th class="col-md-3"><span class="line"></span>Value</th>
|
||||
<th class="col-md-3">@lang('admin/settings/general.setting')</th>
|
||||
<th class="col-md-3"><span class="line"></span>@lang('admin/settings/general.value')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($settings as $setting)
|
||||
<tr>
|
||||
<td>Site Name</td>
|
||||
<td>@lang('admin/settings/general.site_name')</td>
|
||||
<td>{{{ $setting->site_name }}} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -49,13 +49,22 @@ Settings ::
|
||||
<td>No</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Per Page</td>
|
||||
<td>@lang('admin/settings/general.display_checkout_date')</td>
|
||||
|
||||
|
||||
@if ($setting->display_checkout_date === 1)
|
||||
<td>Yes</td>
|
||||
@else
|
||||
<td>No</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@lang('admin/settings/general.per_page')</td>
|
||||
<td>{{{ $setting->per_page }}} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display QR Codes</td>
|
||||
<td>@lang('admin/settings/general.display_qr')</td>
|
||||
@if ($setting->qr_code === 1)
|
||||
<td>Yes</td>
|
||||
@else
|
||||
@@ -63,7 +72,7 @@ Settings ::
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td>QR Code Text</td>
|
||||
<td>@lang('admin/settings/general.qr_text')</td>
|
||||
<td>{{{ $setting->qr_text }}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user