From 9d006c279b5ebca61f3577b4dcebb8037492b0af Mon Sep 17 00:00:00 2001 From: acognet Date: Tue, 29 Jun 2021 10:01:19 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03905=20-=20Polishing:=20CSV=20Import=20-?= =?UTF-8?q?=20manage=20friendlyname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/bulkchange.class.inc.php | 19 +++++++++++-------- pages/csvimport.php | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index c03e0ad80..8aad28dff 100644 --- a/core/bulkchange.class.inc.php +++ b/core/bulkchange.class.inc.php @@ -452,20 +452,23 @@ class BulkChange foreach ($this->m_aAttList as $sAttCode => $iCol) { // skip the private key, if any - if ($sAttCode == 'id') continue; + if (($sAttCode == 'id') || ($sAttCode == 'friendlyname')) { + continue; + } $oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode); // skip reconciliation keys - if (!$oAttDef->IsWritable() && in_array($sAttCode, $this->m_aReconcilKeys)){ continue; } + if (!$oAttDef->IsWritable() && in_array($sAttCode, $this->m_aReconcilKeys)) { + continue; + } $aReasons = array(); $iFlags = ($oTargetObj->IsNew()) ? $oTargetObj->GetInitialStateAttributeFlags($sAttCode, $aReasons) : $oTargetObj->GetAttributeFlags($sAttCode, $aReasons); - if ( (($iFlags & OPT_ATT_READONLY) == OPT_ATT_READONLY) && ( $oTargetObj->Get($sAttCode) != $aRowData[$iCol]) ) - { - $aErrors[$sAttCode] = Dict::Format('UI:CSVReport-Value-Issue-Readonly', $sAttCode, $oTargetObj->Get($sAttCode), $aRowData[$iCol]); + if ( (($iFlags & OPT_ATT_READONLY) == OPT_ATT_READONLY) && ( $oTargetObj->Get($sAttCode) != $aRowData[$iCol]) ) { + $aErrors[$sAttCode] = Dict::Format('UI:CSVReport-Value-Issue-Readonly', $sAttCode, $oTargetObj->Get($sAttCode), $aRowData[$iCol]); } else if ($oAttDef->IsLinkSet() && $oAttDef->IsIndirect()) { @@ -1180,16 +1183,16 @@ class BulkChange $oPage->add('

'.$sCollapsedLabel.'  '.$sLinkLabel.'

'); $oPage->add_ready_script( -<<GetForLink(); $oPage->add_script( -<<'); diff --git a/pages/csvimport.php b/pages/csvimport.php index 92cd962ac..3e8076a71 100644 --- a/pages/csvimport.php +++ b/pages/csvimport.php @@ -1586,7 +1586,7 @@ EOF { case 11: // Asynchronous tab - $oPage = new ajax_page(''); + $oPage = new AjaxPage(''); BulkChange::DisplayImportHistory($oPage); $oPage->add_ready_script('$("#CSVImportHistory table.listResults").tableHover();'); $oPage->add_ready_script('$("#CSVImportHistory table.listResults").tablesorter( { widgets: ["myZebra", "truncatedList"]} );');