Merge pull request #10345 from leitwerk-ag/master

Fixed #10344 and #9135: don't prepand fields with a whitespace in text based export formats
This commit is contained in:
snipe 2021-11-24 19:43:21 -08:00 committed by GitHub
commit 3b68a6f1be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,7 @@
function genericRowLinkFormatter(destination) { function genericRowLinkFormatter(destination) {
return function (value,row) { return function (value,row) {
if (value) { if (value) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '"> ' + value + '</a>'; return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '">' + value + '</a>';
} }
}; };
} }
@ -196,7 +196,7 @@
var dpolymorphicItemFormatterest = 'fields/'; var dpolymorphicItemFormatterest = 'fields/';
} }
return '<nobr><a href="{{ url('/') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '"> ' + value.name + '</a></span>'; return '<nobr><a href="{{ url('/') }}/' + dpolymorphicItemFormatterest + dest + '/' + value.id + '">' + value.name + '</a></span>';
} }
}; };
} }
@ -466,7 +466,7 @@
if (value) { if (value) {
var groups = ''; var groups = '';
for (var index in value.rows) { for (var index in value.rows) {
groups += '<a href="{{ url('/') }}/admin/groups/' + value.rows[index].id + '" class="label label-default"> ' + value.rows[index].name + '</a> '; groups += '<a href="{{ url('/') }}/admin/groups/' + value.rows[index].id + '" class="label label-default">' + value.rows[index].name + '</a> ';
} }
return groups; return groups;
} }
@ -495,20 +495,20 @@
function deployedLocationFormatter(row, value) { function deployedLocationFormatter(row, value) {
if ((row) && (row!=undefined)) { if ((row) && (row!=undefined)) {
return '<a href="{{ url('/') }}/locations/' + row.id + '"> ' + row.name + '</a>'; return '<a href="{{ url('/') }}/locations/' + row.id + '">' + row.name + '</a>';
} else if (value.rtd_location) { } else if (value.rtd_location) {
return '<a href="{{ url('/') }}/locations/' + value.rtd_location.id + '" data-toggle="tooltip" title="Default Location"> ' + value.rtd_location.name + '</a>'; return '<a href="{{ url('/') }}/locations/' + value.rtd_location.id + '" data-toggle="tooltip" title="Default Location">' + value.rtd_location.name + '</a>';
} }
} }
function groupsAdminLinkFormatter(value, row) { function groupsAdminLinkFormatter(value, row) {
return '<a href="{{ url('/') }}/admin/groups/' + row.id + '"> ' + value + '</a>'; return '<a href="{{ url('/') }}/admin/groups/' + row.id + '">' + value + '</a>';
} }
function assetTagLinkFormatter(value, row) { function assetTagLinkFormatter(value, row) {
if ((row.asset) && (row.asset.id)) { if ((row.asset) && (row.asset.id)) {
return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '"> ' + row.asset.asset_tag + '</a>'; return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '">' + row.asset.asset_tag + '</a>';
} }
return ''; return '';
@ -516,14 +516,14 @@
function departmentNameLinkFormatter(value, row) { function departmentNameLinkFormatter(value, row) {
if ((row.assigned_user) && (row.assigned_user.department) && (row.assigned_user.department.name)) { if ((row.assigned_user) && (row.assigned_user.department) && (row.assigned_user.department.name)) {
return '<a href="{{ url('/') }}/department/' + row.assigned_user.department.id + '"> ' + row.assigned_user.department.name + '</a>'; return '<a href="{{ url('/') }}/department/' + row.assigned_user.department.id + '">' + row.assigned_user.department.name + '</a>';
} }
} }
function assetNameLinkFormatter(value, row) { function assetNameLinkFormatter(value, row) {
if ((row.asset) && (row.asset.name)) { if ((row.asset) && (row.asset.name)) {
return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '"> ' + row.asset.name + '</a>'; return '<a href="{{ url('/') }}/hardware/' + row.asset.id + '">' + row.asset.name + '</a>';
} }
} }
@ -550,31 +550,31 @@
function emailFormatter(value) { function emailFormatter(value) {
if (value) { if (value) {
return '<a href="mailto:' + value + '"> ' + value + '</a>'; return '<a href="mailto:' + value + '">' + value + '</a>';
} }
} }
function linkFormatter(value) { function linkFormatter(value) {
if (value) { if (value) {
return '<a href="' + value + '"> ' + value + '</a>'; return '<a href="' + value + '">' + value + '</a>';
} }
} }
function assetCompanyFilterFormatter(value, row) { function assetCompanyFilterFormatter(value, row) {
if (value) { if (value) {
return '<a href="{{ url('/') }}/hardware/?company_id=' + row.id + '"> ' + value + '</a>'; return '<a href="{{ url('/') }}/hardware/?company_id=' + row.id + '">' + value + '</a>';
} }
} }
function assetCompanyObjFilterFormatter(value, row) { function assetCompanyObjFilterFormatter(value, row) {
if ((row) && (row.company)) { if ((row) && (row.company)) {
return '<a href="{{ url('/') }}/hardware/?company_id=' + row.company.id + '"> ' + row.company.name + '</a>'; return '<a href="{{ url('/') }}/hardware/?company_id=' + row.company.id + '">' + row.company.name + '</a>';
} }
} }
function usersCompanyObjFilterFormatter(value, row) { function usersCompanyObjFilterFormatter(value, row) {
if (value) { if (value) {
return '<a href="{{ url('/') }}/users/?company_id=' + row.id + '"> ' + value + '</a>'; return '<a href="{{ url('/') }}/users/?company_id=' + row.id + '">' + value + '</a>';
} else { } else {
return value; return value;
} }
@ -583,13 +583,13 @@
function employeeNumFormatter(value, row) { function employeeNumFormatter(value, row) {
if ((row) && (row.assigned_to) && ((row.assigned_to.employee_number))) { if ((row) && (row.assigned_to) && ((row.assigned_to.employee_number))) {
return '<a href="{{ url('/') }}/users/' + row.assigned_to.id + '"> ' + row.assigned_to.employee_number + '</a>'; return '<a href="{{ url('/') }}/users/' + row.assigned_to.id + '">' + row.assigned_to.employee_number + '</a>';
} }
} }
function orderNumberObjFilterFormatter(value, row) { function orderNumberObjFilterFormatter(value, row) {
if (value) { if (value) {
return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '"> ' + row.order_number + '</a>'; return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '">' + row.order_number + '</a>';
} }
} }