mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3905 - Polishing: CSV Import
This commit is contained in:
@@ -35,9 +35,9 @@ $ibo-field--value-decoration--spacing-x: 0.5rem !default;
|
||||
|
||||
/* Avoid value to overflow from its container with very long strings (typically URLs) */
|
||||
/* Note: Some types of attribute must be excluding as it can alter their rendering */
|
||||
&:not([data-attribute-type="AttributeBlob"]):not([data-attribute-type="AttributeFile"]):not([data-attribute-type="AttributeImage"]) {
|
||||
&:not([data-attribute-type="AttributeBlob"]):not([ data-attribute-type = "AttributeFile" ]):not([ data-attribute-type = "AttributeImage" ]):not(.ibo-input-file-select--container) {
|
||||
/* We need the rule to apply for the class and all its descendants */
|
||||
.ibo-field--value {
|
||||
. ibo-field--value {
|
||||
* {
|
||||
word-break: break-word;
|
||||
white-space: pre-wrap;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -120,7 +120,6 @@ function GetMappingForField($sClassName, $sFieldName, $iFieldIndex, $bAdvancedMo
|
||||
$aChoices['id'] = Dict::S('UI:CSVImport:idField');
|
||||
}
|
||||
foreach (MetaModel::ListAttributeDefs($sClassName) as $sAttCode => $oAttDef) {
|
||||
$sStar = '';
|
||||
if ($oAttDef->IsExternalKey()) {
|
||||
if (($sFieldName == $oAttDef->GetLabel()) || ($sFieldName == $sAttCode)) {
|
||||
$sFieldCode = $sAttCode;
|
||||
@@ -128,10 +127,6 @@ function GetMappingForField($sClassName, $sFieldName, $iFieldIndex, $bAdvancedMo
|
||||
if ($bAdvancedMode) {
|
||||
$aChoices[$sAttCode] = $oAttDef->GetLabel();
|
||||
}
|
||||
$oExtKeyAttDef = MetaModel::GetAttributeDef($sClassName, $oAttDef->GetKeyAttCode());
|
||||
if (!$oExtKeyAttDef->IsNullAllowed()) {
|
||||
$sStar = '*';
|
||||
}
|
||||
// Get fields of the external class that are considered as reconciliation keys
|
||||
$sTargetClass = $oAttDef->GetTargetClass();
|
||||
foreach (MetaModel::ListAttributeDefs($sTargetClass) as $sTargetAttCode => $oTargetAttDef) {
|
||||
@@ -151,7 +146,7 @@ function GetMappingForField($sClassName, $sFieldName, $iFieldIndex, $bAdvancedMo
|
||||
$aChoices[$sAttCode.'->'.$sTargetAttCode] = MetaModel::GetLabel($sClassName, $sAttCode.'->'.$sTargetAttCode, true);
|
||||
foreach ($aSignatures as $sSignature) {
|
||||
if (strcasecmp($sFieldName, $sSignature) == 0) {
|
||||
$sFieldCode = $sAttCode.'->'.$sTargetAttCode.$sStar;
|
||||
$sFieldCode = $sAttCode.'->'.$sTargetAttCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,12 +148,25 @@ class StaticTable extends UIContentBlock
|
||||
|
||||
/**
|
||||
* @param array $aOptions
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetOptions($aOptions)
|
||||
{
|
||||
$this->aOptions = $aOptions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aOptions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function AddOption($sName, $sValue)
|
||||
{
|
||||
$this->aOptions[$sName] = $sValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,8 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
},
|
||||
scrollX: true,
|
||||
{% if oUIBlock.GetOption('sMaxHeight') is not empty %}
|
||||
scrollY: "{{ oUIBlock.GetOption('sMaxHeight') }}",
|
||||
scrollCollapse: true,
|
||||
scrollY: {{ oUIBlock.GetOption('sMaxHeight') }},
|
||||
scrollCollapse: true,
|
||||
{% endif %}
|
||||
lengthMenu: [[ {{ iPageSize }}, {{ iPageSize*2 }}, {{ iPageSize*3 }}, {{ iPageSize*4 }}, -1], [ {{ iPageSize }}, {{ iPageSize*2 }}, {{ iPageSize*3 }}, {{ iPageSize*4 }}, "{{ 'UI:Datatables:Language:DisplayLength:All'|dict_s }}"]],
|
||||
dom: "<'ibo-datatable--toolbar'<'ibo-datatable--toolbar-left' pl><'ibo-datatable--toolbar-right' i>>t<'ibo-datatable--toolbar'<'ibo-datatable--toolbar-left' pl><'ibo-datatable--toolbar-right' i>>",
|
||||
|
||||
@@ -7,6 +7,9 @@ var table{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
},
|
||||
scrollX: true,
|
||||
scrollCollapse: true,
|
||||
{% if oUIBlock.GetOption('sMaxHeight') is not empty %}
|
||||
scrollY: {{ oUIBlock.GetOption('sMaxHeight') }},
|
||||
{% endif %}
|
||||
paging: false,
|
||||
filter: false,
|
||||
autoWidth: false,
|
||||
@@ -26,27 +29,34 @@ var table{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
{% endif %}
|
||||
drawCallback: function () {
|
||||
// Hiding pagination if only one page
|
||||
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2) {
|
||||
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').hide();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
|
||||
}
|
||||
},
|
||||
createdRow: function( row, data, dataIndex ) {
|
||||
if (data['@class'] !== undefined) {
|
||||
createdRow: function (row, data, dataIndex) {
|
||||
if (data['@class'] !== undefined)
|
||||
{
|
||||
$(row).addClass(data['@class']);
|
||||
}
|
||||
},
|
||||
});
|
||||
if ($('#{{ oUIBlock.GetId() }}').find('thead').is(':visible')) {
|
||||
|
||||
if ($('#{{ oUIBlock.GetId() }}').find('thead').is(':visible'))
|
||||
{
|
||||
table{{ sListIDForVarSuffix }}.columns.adjust().draw();
|
||||
}
|
||||
|
||||
if(window.ResizeObserver){
|
||||
if (window.ResizeObserver)
|
||||
{
|
||||
let oFromTable{{ sListIDForVarSuffix }}ResizeTimeout = null;
|
||||
const oFromTable{{ sListIDForVarSuffix }}Resize = new ResizeObserver(function(){
|
||||
const oFromTable{{ sListIDForVarSuffix }}Resize = new ResizeObserver(function () {
|
||||
clearTimeout(oFromTable{{ sListIDForVarSuffix }}ResizeTimeout);
|
||||
oFromTable{{ sListIDForVarSuffix }}ResizeTimeout = setTimeout(function(){
|
||||
oFromTable{{ sListIDForVarSuffix }}ResizeTimeout = setTimeout(function () {
|
||||
$('#{{ oUIBlock.GetId() }}').DataTable().columns.adjust();
|
||||
}, 120);
|
||||
});
|
||||
|
||||
@@ -31,8 +31,8 @@ $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
},
|
||||
scrollX: true,
|
||||
{% if oUIBlock.GetOption('sMaxHeight') is not empty %}
|
||||
scrollY: "{{ oUIBlock.GetOption('sMaxHeight') }}",
|
||||
scrollCollapse: true,
|
||||
scrollY: {{ oUIBlock.GetOption('sMaxHeight') }},
|
||||
scrollCollapse: true,
|
||||
{% endif %}
|
||||
order: [],
|
||||
autoWidth: false,
|
||||
|
||||
Reference in New Issue
Block a user