Merge branch 'develop'

# Conflicts:
#	config/version.php
This commit is contained in:
snipe 2018-05-08 03:49:28 -07:00
commit 25f537e730
37 changed files with 388 additions and 53 deletions

View file

@ -57,6 +57,7 @@ Since the release of the JSON REST API, several third-party developers have been
- [Python Module](https://github.com/jbloomer/SnipeIT-PythonAPI) by [@jbloomer](https://github.com/jbloomer)
- [SnipeSharp - .NET module in C#](https://github.com/barrycarey/SnipeSharp) by [@barrycarey](https://github.com/barrycarey)
- [InQRy](https://github.com/Microsoft/InQRy) by [@Microsoft](https://github.com/Microsoft)
- [SnipeitPS](https://github.com/snazy2000/SnipeitPS) by [@snazy2000](https://github.com/snazy2000) - Powershell API Wrapper for Snipe-it
As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)

View file

@ -330,7 +330,14 @@ class Helper
*/
public static function categoryTypeList()
{
$category_types = array('' => '','accessory' => 'Accessory', 'asset' => 'Asset', 'consumable' => 'Consumable','component' => 'Component');
$category_types = array(
'' => '',
'accessory' => 'Accessory',
'asset' => 'Asset',
'consumable' => 'Consumable',
'component' => 'Component',
'license' => 'License'
);
return $category_types;
}
@ -738,6 +745,7 @@ class Helper
static $max_size = -1;
if ($max_size < 0) {
// Start with post_max_size.
$post_max_size = Helper::parse_size(ini_get('post_max_size'));
if ($post_max_size > 0) {
@ -751,6 +759,7 @@ class Helper
$max_size = $upload_max;
}
}
return $max_size;
}

View file

@ -21,10 +21,10 @@ class CategoriesController extends Controller
public function index(Request $request)
{
$this->authorize('view', Category::class);
$allowed_columns = ['id', 'name','category_type', 'category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email', 'assets_count', 'accessories_count', 'consumables_count', 'components_count', 'image'];
$allowed_columns = ['id', 'name','category_type', 'category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email', 'assets_count', 'accessories_count', 'consumables_count', 'components_count','licenses_count', 'image'];
$categories = Category::select(['id', 'created_at', 'updated_at', 'name','category_type','use_default_eula','eula_text', 'require_acceptance','checkin_email','image'])
->withCount('assets', 'accessories', 'consumables', 'components');
->withCount('assets', 'accessories', 'consumables', 'components','licenses');
if ($request->has('search')) {
$categories = $categories->TextSearch($request->input('search'));

View file

@ -25,7 +25,7 @@ class LicensesController extends Controller
public function index(Request $request)
{
$this->authorize('view', License::class);
$licenses = Company::scopeCompanyables(License::with('company', 'manufacturer', 'freeSeats', 'supplier')->withCount('freeSeats'));
$licenses = Company::scopeCompanyables(License::with('company', 'manufacturer', 'freeSeats', 'supplier','category')->withCount('freeSeats'));
if ($request->has('company_id')) {
@ -64,6 +64,10 @@ class LicensesController extends Controller
$licenses->where('supplier_id','=',$request->input('supplier_id'));
}
if ($request->has('category_i')) {
$licenses->where('category_i','=',$request->input('category_i'));
}
if ($request->has('depreciation_id')) {
$licenses->where('depreciation_id','=',$request->input('depreciation_id'));
}
@ -90,11 +94,14 @@ class LicensesController extends Controller
case 'supplier':
$licenses = $licenses->leftJoin('suppliers', 'licenses.supplier_id', '=', 'suppliers.id')->orderBy('suppliers.name', $order);
break;
case 'category':
$licenses = $licenses->leftJoin('categories', 'licenses.category_id', '=', 'categories.id')->orderBy('categories.name', $order);
break;
case 'company':
$licenses = $licenses->leftJoin('companies', 'licenses.company_id', '=', 'companies.id')->orderBy('companies.name', $order);
break;
default:
$allowed_columns = ['id','name','purchase_cost','expiration_date','purchase_order','order_number','notes','purchase_date','serial','company','license_name','license_email','free_seats_count','seats'];
$allowed_columns = ['id','name','purchase_cost','expiration_date','purchase_order','order_number','notes','purchase_date','serial','company','category','license_name','license_email','free_seats_count','seats'];
$sort = in_array($request->input('sort'), $allowed_columns) ? e($request->input('sort')) : 'created_at';
$licenses = $licenses->orderBy($sort, $order);
break;

View file

@ -107,6 +107,7 @@ class LicensesController extends Controller
$license->seats = $request->input('seats');
$license->serial = $request->input('serial');
$license->supplier_id = $request->input('supplier_id');
$license->category_id = $request->input('category_id');
$license->termination_date = $request->input('termination_date');
$license->user_id = Auth::id();
@ -182,6 +183,7 @@ class LicensesController extends Controller
$license->seats = e($request->input('seats'));
$license->manufacturer_id = $request->input('manufacturer_id');
$license->supplier_id = $request->input('supplier_id');
$license->category_id = $request->input('category_id');
if ($license->save()) {
return redirect()->route('licenses.show', ['license' => $licenseId])->with('success', trans('admin/licenses/message.update.success'));
@ -420,7 +422,6 @@ class LicensesController extends Controller
$return_to = Asset::find($licenseSeat->asset_id);
}
\Log::debug($licenseSeat->assigned_to);
// Update the asset data
$licenseSeat->assigned_to = null;
$licenseSeat->asset_id = null;

View file

@ -347,6 +347,7 @@ class SettingsController extends Controller
$setting->default_eula_text = $request->input('default_eula_text');
$setting->thumbnail_max_h = $request->input('thumbnail_max_h');
$setting->privacy_policy_link = $request->input('privacy_policy_link');
if (Input::get('per_page')!='') {
$setting->per_page = $request->input('per_page');

View file

@ -539,9 +539,11 @@ class UsersController extends Controller
{
$this->authorize('update', User::class);
if ((!Input::has('ids')) || (count(Input::has('ids')) == 0)) {
if ((!Input::has('ids')) || (count(Input::get('ids')) == 0)) {
return redirect()->back()->with('error', 'No users selected');
} elseif ((!Input::has('status_id')) || (count(Input::has('status_id')) == 0)) {
} elseif ((!Input::has('status_id')) || (Input::get('status_id')=='')) {
return redirect()->route('users.index')->with('error', 'No status selected');
} else {

View file

@ -34,6 +34,7 @@ class CategoriesTransformer
'accessories_count' => $category->accessories_count,
'consumables_count' => $category->consumables_count,
'components_count' => $category->components_count,
'licenses_count' => $category->licenses_count,
'created_at' => Helper::getFormattedDateObject($category->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($category->updated_at, 'datetime'),
];

View file

@ -38,6 +38,7 @@ class LicensesTransformer
'license_email' => e($license->license_email),
'maintained' => ($license->maintained == 1) ? true : false,
'supplier' => ($license->supplier) ? ['id' => (int) $license->supplier->id,'name'=> e($license->supplier->name)] : null,
'category' => ($license->category) ? ['id' => (int) $license->category->id,'name'=> e($license->category->name)] : null,
'created_at' => Helper::getFormattedDateObject($license->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($license->updated_at, 'datetime'),
'user_can_checkout' => (bool) ($license->free_seats_count > 0),

View file

@ -33,7 +33,7 @@ class Category extends SnipeModel
'name' => 'required|min:1|max:255|unique_undeleted',
'require_acceptance' => 'boolean',
'use_default_eula' => 'boolean',
'category_type' => 'required|in:asset,accessory,consumable,component',
'category_type' => 'required|in:asset,accessory,consumable,component,license',
);
/**
@ -74,6 +74,11 @@ class Category extends SnipeModel
return $this->hasMany('\App\Models\Accessory');
}
public function licenses()
{
return $this->hasMany('\App\Models\License');
}
public function consumables()
{
return $this->hasMany('\App\Models\Consumable');

View file

@ -16,6 +16,14 @@ use Watson\Validating\ValidatingTrait;
class License extends Depreciable
{
protected $presenter = 'App\Presenters\LicensePresenter';
/**
* Set static properties to determine which checkout/checkin handlers we should use
*/
public static $checkoutClass = CheckoutLicenseNotification::class;
public static $checkinClass = CheckinLicenseNotification::class;
use SoftDeletes;
use CompanyableTrait;
use Loggable, Presentable;
@ -41,6 +49,7 @@ class License extends Depreciable
'license_email' => 'email|nullable|max:120',
'license_name' => 'string|nullable|max:100',
'notes' => 'string|nullable',
'category_id' => 'integer',
'company_id' => 'integer|nullable',
);
@ -57,6 +66,7 @@ class License extends Depreciable
'license_name', //actually licensed_to
'maintained',
'manufacturer_id',
'category_id',
'name',
'notes',
'order_number',
@ -83,7 +93,6 @@ class License extends Depreciable
static::updating(function ($license) {
$newSeatCount = $license->getAttributes()['seats'];
$oldSeatCount = isset($license->getOriginal()['seats']) ? $license->getOriginal()['seats'] : 0;
// dd($oldSeatCount.' '.$newSeatCount);
return static::adjustSeatCount($license, $oldSeatCount, $newSeatCount);
});
}
@ -98,7 +107,7 @@ class License extends Depreciable
$change = abs($oldSeats - $newSeats);
if ($oldSeats > $newSeats) {
$license->load('licenseseats.user');
// dd("Here");
// Need to delete seats... lets see if if we have enough.
$seatsAvailableForDelete = $license->licenseseats->reject(function ($seat) {
return (!! $seat->assigned_to) || (!! $seat->asset_id);
@ -176,11 +185,39 @@ class License extends Depreciable
return $this->belongsTo('\App\Models\Company', 'company_id');
}
public function category()
{
return $this->belongsTo('\App\Models\Category', 'category_id');
}
public function manufacturer()
{
return $this->belongsTo('\App\Models\Manufacturer', 'manufacturer_id');
}
public function checkin_email()
{
return $this->model->category->checkin_email;
}
public function requireAcceptance()
{
return $this->category->require_acceptance;
}
public function getEula()
{
$Parsedown = new \Parsedown();
if ($this->category->eula_text) {
return $Parsedown->text(e($this->category->eula_text));
} elseif ($this->category->use_default_eula == '1') {
return $Parsedown->text(e(Setting::getSettings()->default_eula_text));
} else {
return false;
}
}
/**
* Get the assigned user
*/

View file

@ -43,6 +43,7 @@ class Setting extends Model
'audit_warning_days' => 'numeric|nullable',
'audit_interval' => 'numeric|nullable',
'custom_forgot_pass_url' => 'url|nullable',
'privacy_policy_link' => 'nullable|url'
];
protected $fillable = ['site_name','email_domain','email_format','username_format'];

View file

@ -76,7 +76,7 @@ class CheckinAssetNotification extends Notification
$fields = [
trans('general.administrator') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
trans('general.status') => $item->assetstatus->name,
trans('general.location') => $item->location->name,
trans('general.location') => ($item->location) ? $item->location->name : '',
];
return (new SlackMessage)

View file

@ -31,6 +31,7 @@ class CheckinLicenseNotification extends Notification
$this->admin = $params['admin'];
$this->note = '';
$this->settings = $params['settings'];
$this->target_type = $params['target_type'];
if (array_key_exists('note', $params)) {
$this->note = $params['note'];
@ -53,7 +54,10 @@ class CheckinLicenseNotification extends Notification
}
$notifyBy[] = 'mail';
if (($this->target_type == \App\Models\User::class) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula())))
{
$notifyBy[] = 'mail';
}
return $notifyBy;
}

View file

@ -33,6 +33,7 @@ class CheckoutLicenseNotification extends Notification
$this->note = '';
$this->target_type = $params['target_type'];
$this->settings = $params['settings'];
$this->target_type = $params['target_type'];
if (array_key_exists('note', $params)) {
$this->note = $params['note'];
@ -56,7 +57,8 @@ class CheckoutLicenseNotification extends Notification
$notifyBy[] = 'slack';
}
if ($this->target_type == \App\Models\User::class) {
if (($this->target_type == \App\Models\User::class) && (($this->item->requireAcceptance() == '1') || ($this->item->getEula())))
{
$notifyBy[] = 'mail';
}
@ -97,12 +99,18 @@ class CheckoutLicenseNotification extends Notification
public function toMail($notifiable)
{
$eula = method_exists($this->item, 'getEula') ? $this->item->getEula() : '';
$req_accept = method_exists($this->item, 'requireAcceptance') ? $this->item->requireAcceptance() : 0;
return (new MailMessage)->markdown('notifications.markdown.checkout-license',
[
'item' => $this->item,
'admin' => $this->admin,
'note' => $this->note,
'target' => $this->target,
'eula' => $eula,
'req_accept' => $req_accept,
'accept_url' => url('/').'/account/accept-asset/'.$this->log_id,
])
->subject(trans('mail.Confirm_license_delivery'));

View file

@ -69,6 +69,12 @@ class CategoryPresenter extends Presenter
"sortable" => true,
"title" => trans('general.components'),
"visible" => true
], [
"field" => "licenses_count",
"searchable" => false,
"sortable" => true,
"title" => trans('general.licenses'),
"visible" => true
], [
"field" => "eula",
"searchable" => false,

View file

@ -61,6 +61,14 @@ class LicensePresenter extends Presenter
"searchable" => true,
"sortable" => true,
"title" => trans('admin/licenses/form.to_name'),
], [
"field" => "category",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('general.category'),
"visible" => false,
"formatter" => "categoriesLinkObjFormatter"
], [
"field" => "supplier",
"searchable" => true,

View file

@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v4.3.0',
'full_app_version' => 'v4.3.0 - build 3559-g9eab9ad40',
'build_version' => '3559',
'full_app_version' => 'v4.3.0 - build 3586-gec1fa8e90',
'build_version' => '3586',
'prerelease_version' => '',
'hash_version' => 'g9eab9ad40',
'full_hash' => 'v4.3.0-66-g9eab9ad40',
'hash_version' => 'gec1fa8e90',
'full_hash' => 'v4.3.0-4-gec1fa8e90',
'branch' => 'master',
);

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCategoryToLicenses extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('licenses', function (Blueprint $table) {
$table->integer('category_id')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('licenses', function (Blueprint $table) {
$table->dropColumn('category_id');
});
}
}

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Category;
use App\Models\License;
class AddUpdateLicenseCategory extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Create a new software category and assign all of the existing licenses to it
$category = new Category;
$category->name = 'Misc Software';
$category->category_type = 'license';
if ($category->save()) {
License::whereNull('category_id')->withTrashed()
->update(['category_id' => $category->id]);
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
App\Models\Category::where('name', 'Misc Software')->forceDelete();
License::whereNotNull('category_id')
->update(['category_id' => null]);
}
}

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddGdprPrivacyFooter extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->char('privacy_policy_link')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function (Blueprint $table) {
$table->dropColumn('privacy_policy_link');
});
}
}

View file

@ -5,7 +5,8 @@ return array(
'about_categories' => 'Categories help you organize your items. Some example categories might be &quot;Desktops&quot;, &quot;Laptops&quot;, &quot;Mobile Phones&quot;, &quot;Tablets&quot;, and so on, but you can use categories any way that makes sense for you.',
'asset_categories' => 'Asset Categories',
'category_name' => 'Category Name',
'checkin_email' => 'Send email to user on checkin.',
'checkin_email' => 'Send email to user on checkin/checkout.',
'checkin_email_notification' => 'This user will be sent an email on checkin/checkout.',
'clone' => 'Clone Category',
'create' => 'Create Category',
'edit' => 'Edit Category',

View file

@ -4,7 +4,7 @@ return array(
'custom_fields' => 'Custom Fields',
'field' => 'Field',
'about_fieldsets_title' => 'About Fieldsets',
'about_fieldsets_text' => 'Fieldsets allow you to create groups of custom fields that are frequently re-used used for specific asset model types.',
'about_fieldsets_text' => 'Fieldsets allow you to create groups of custom fields that are frequently re-used for specific asset model types.',
'custom_format' => 'Custom regex format...',
'encrypt_field' => 'Encrypt the value of this field in the database',
'encrypt_field_help' => 'WARNING: Encrypting a field makes it unsearchable.',

View file

@ -131,8 +131,11 @@ return array(
'labels_per_page' => 'Labels per page',
'label_dimensions' => 'Label dimensions (inches)',
'next_auto_tag_base' => 'Next auto-increment',
'page_padding' => 'Page margins (inches)',
'purge' => 'Purge Deleted Records',
'page_padding' => 'Page margins (inches)',
'privacy_policy_link' => 'Link to Privacy Policy',
'privacy_policy' => 'Privacy Policy',
'privacy_policy_link_help' => 'If a url is included here, a link to your privacy policy will be included in the app footer and in any emails that the system sends out, in compliance with GDPR. ',
'purge' => 'Purge Deleted Records',
'labels_display_bgutter' => 'Label bottom gutter',
'labels_display_sgutter' => 'Label side gutter',
'labels_fontsize' => 'Label font size',

View file

@ -68,6 +68,15 @@
"fileName": "export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
@elseif ($category->category_type=='license')
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
data-cookie-id-table="categoryLicenseTable"
id="categoryLicenseTable"
data-id-table="categoryLicenseTable"
data-export-options='{
"fileName": "export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
@endif
data-pagination="true"

View file

@ -254,6 +254,7 @@
<th class="col-sm-1" data-visible="true" data-field="accessories_count" data-sortable="true"><i class="fa fa-keyboard-o"></i></th>
<th class="col-sm-1" data-visible="true" data-field="consumables_count" data-sortable="true"><i class="fa fa-tint"></i></th>
<th class="col-sm-1" data-visible="true" data-field="components_count" data-sortable="true"><i class="fa fa-hdd-o"></i></th>
<th class="col-sm-1" data-visible="true" data-field="licenses_count" data-sortable="true"><i class="fa fa-floppy-o"></i></th>
</tr>
</thead>
</table>

View file

@ -21,5 +21,9 @@
</head>
<body>
@yield('content')
@if ($snipeSettings->privacy_policy_link!='')
<a href="{{ $snipeSettings->privacy_policy_link }}">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
</body>
</html>

View file

@ -54,6 +54,12 @@
<div class="text-center" style="padding-top: 100px;">
@if ($snipeSettings->privacy_policy_link!='')
<a target="_blank" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
</div>
</body>
</html>

View file

@ -750,6 +750,11 @@
@endif
@endif
@if ($snipeSettings->privacy_policy_link!='')
<a target="_blank" class="btn btn-default btn-xs" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
</div>
@if ($snipeSettings->footer_text!='')
<div class="pull-right">
@ -757,6 +762,7 @@
</div>
@endif
<a target="_blank" href="https://snipeitapp.com" rel="noopener">Snipe-IT</a> is open source software, made with <i class="fa fa-heart" style="color: #a94442; font-size: 10px"></i> by <a href="https://twitter.com/snipeitapp" rel="noopener">@snipeitapp</a>.
</footer>

View file

@ -57,6 +57,40 @@
</div>
</div>
</div>
@if ($license->requireAcceptance() || $license->getEula() || ($snipeSettings->slack_endpoint!=''))
<div class="form-group notification-callout">
<div class="col-md-8 col-md-offset-3">
<div class="callout callout-info">
@if ($license->requireAcceptance())
<i class="fa fa-envelope"></i>
{{ trans('admin/categories/general.required_acceptance') }}
<br>
@endif
@if ($license->getEula())
<i class="fa fa-envelope"></i>
{{ trans('admin/categories/general.required_eula') }}
<br>
@endif
@if (($license->category) && ($license->category->checkin_email))
<i class="fa fa-envelope"></i>
{{ trans('admin/categories/general.checkin_email_notification') }}
<br>
@endif
@if ($snipeSettings->slack_endpoint!='')
<i class="fa fa-slack"></i>
A slack message will be sent
@endif
</div>
</div>
</div>
@endif
<div class="box-footer">
<a class="btn btn-link" href="{{ route('licenses.index') }}">{{ trans('button.cancel') }}</a>
<button type="submit" class="btn btn-success pull-right"><i class="fa fa-check icon-white"></i> {{ trans('general.checkout') }}</button>

View file

@ -9,7 +9,7 @@
{{-- Page content --}}
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/licenses/form.name')])
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'license'])
<!-- Serial-->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>

View file

@ -45,6 +45,8 @@
<table
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayoutSeats() }}"
data-cookie-id-table="seatsTable"
data-id-table="seatsTable"
id="seatsTable"
data-pagination="true"
data-search="true"
data-side-pagination="server"
@ -53,7 +55,6 @@
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="seatsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.license.seats',['license_id' => $license->id]) }}"
data-export-options='{
@ -126,6 +127,15 @@
</tr>
@endif
@if ($license->category)
<tr>
<td>{{ trans('general.category') }}: </td>
<td style="word-wrap: break-word;overflow-wrap: break-word;word-break: break-word;">
<a href="{{ route('categories.show', $license->category->id) }}">{{ $license->category->name }}</a>
</td>
</tr>
@endif
@if ($license->license_name!='')
<tr>
@ -266,9 +276,10 @@
<table
data-cookie-id-table="licenseUploadsTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-id-table="licenseUploadsTable"
id="licenseUploadsTable"
data-search="true"
data-pagination="true"
data-side-pagination="client"
data-show-columns="true"
data-show-export="true"
@ -277,7 +288,6 @@
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="licenseUploadsTable"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "export-license-uploads-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
@ -285,8 +295,8 @@
}'>
<thead>
<tr>
<th></th>
<th class="col-md-4" data-field="file_name" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.file_name') }}</th>
<th data-visible="true"></th>
<th class="col-md-4" data-field="file_name" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.file_name') }}</th>
<th class="col-md-4" data-field="notes" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.notes') }}</th>
<th class="col-md-2" data-field="created_at" data-visible="true" data-sortable="true" data-switchable="true">{{ trans('general.created_at') }}</th>
<th class="col-md-2" data-field="download" data-visible="true" data-sortable="false" data-switchable="true">Download</th>
@ -294,7 +304,7 @@
</tr>
</thead>
<tbody>
@if ($license->uploads->count()> 0)
@if ($license->uploads->count() > 0)
@foreach ($license->uploads as $file)
<tr>
<td><i class="{{ \App\Helpers\Helper::filetype_icon($file->filename) }} icon-med"></i></td>
@ -322,7 +332,7 @@
@endforeach
@else
<tr>
<td colspan="4">{{ trans('general.no_results') }}</td>
<td colspan="6">{{ trans('general.no_results') }}</td>
</tr>
@endif
</tbody>
@ -336,7 +346,9 @@
<div class="table-responsive">
<table
class="table table-striped snipe-table"
id="historyTable"
data-cookie-id-table="dsffsdflicenseHistoryTable"
data-id-table="dsffsdflicenseHistoryTable"
id="dsffsdflicenseHistoryTable"
data-pagination="true"
data-show-columns="true"
data-side-pagination="server"
@ -347,8 +359,7 @@
"fileName": "export-{{ str_slug($license->name) }}-history-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'
data-url="{{ route('api.activity.index', ['item_id' => $license->id, 'item_type' => 'license']) }}"
data-cookie-id-table="license-history">
data-url="{{ route('api.activity.index', ['item_id' => $license->id, 'item_type' => 'license']) }}">
<thead>
<tr>
@ -358,6 +369,9 @@
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="note">{{ trans('general.notes') }}</th>
@if ($snipeSettings->require_accept_signature=='1')
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
@endif
</tr>
</thead>
</table>

View file

@ -13,6 +13,9 @@
@if ($target->can('update', $item))
| **Key** | {{ $item->serial }} |
@endif
@if (isset($item->category))
| **{{ trans('general.category') }}** | {{ $item->category->name }} |
@endif
@if ($admin)
| **{{ trans('general.administrator') }}** | {{ $admin->present()->fullName() }} |
@endif

View file

@ -13,6 +13,9 @@
@if (isset($item->manufacturer))
| **{{ trans('general.manufacturer') }}** | {{ $item->manufacturer->name }} |
@endif
@if (isset($item->category))
| **{{ trans('general.category') }}** | {{ $item->category->name }} |
@endif
@if ($target->can('update', $item))
| **Key** | {{ $item->serial }} |
@endif
@ -25,6 +28,25 @@
@endcomponent
@if (($req_accept == 1) && ($eula!=''))
{{ trans('mail.read_the_terms_and_click') }}
@elseif (($req_accept == 1) && ($eula==''))
{{ trans('mail.click_on_the_link_asset') }}
@elseif (($req_accept == 0) && ($eula!=''))
{{ trans('mail.read_the_terms') }}
@endif
@if ($eula)
@component('mail::panel')
{!! $eula !!}
@endcomponent
@endif
@if ($req_accept == 1)
**[ {{ trans('mail.i_have_read') }}]({{ $accept_url }})**
@endif
Thanks,
{{ $snipeSettings->site_name }}

View file

@ -267,6 +267,25 @@
</div>
</div>
<!-- /.form-group -->
<!-- Privacy Policy Footer-->
<div class="form-group {{ $errors->has('privacy_policy_link') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('privacy_policy_link', trans('admin/settings/general.privacy_policy_link')) }}
</div>
<div class="col-md-9">
@if (config('app.lock_passwords'))
{{ Form::text('privacy_policy_link', Input::old('privacy_policy_link', $setting->privacy_policy_link), array('class' => 'form-control disabled', 'disabled' => 'disabled')) }}
@else
{{ Form::text('privacy_policy_link', Input::old('privacy_policy_link', $setting->privacy_policy_link), array('class' => 'form-control')) }}
@endif
<span class="help-block">{{ trans('admin/settings/general.privacy_policy_link_help') }}</span>
{!! $errors->first('privacy_policy_link', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
</div>
</div> <!--/.box-body-->

View file

@ -35,14 +35,19 @@
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@endcomponent
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@if ($snipeSettings->privacy_policy_link!='')
<a href="{{ $snipeSettings->privacy_policy_link }}">{{ trans('admin/settings/general.privacy_policy') }}</a>
@endif
@endcomponent
@endslot
@endcomponent

View file

@ -34,14 +34,19 @@
@endslot
@endisset
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@endcomponent
@endslot
{{-- Footer --}}
@slot('footer')
@component('mail::footer')
@if($snipeSettings::setupCompleted())
© {{ date('Y') }} {{ $snipeSettings->site_name }}. All rights reserved.
@else
© {{ date('Y') }} Snipe-it. All rights reserved.
@endif
@if ($snipeSettings->privacy_policy_link!='')
[{{ $snipeSettings->privacy_policy_link }}]({{ trans('admin/settings/general.privacy_policy') }})
@endif
@endcomponent
@endslot
@endcomponent