diff --git a/application/datatable.class.inc.php b/application/datatable.class.inc.php index 5fa6e1d73..9de50ee04 100644 --- a/application/datatable.class.inc.php +++ b/application/datatable.class.inc.php @@ -326,6 +326,7 @@ class DataTable $sPagesLinks = implode('', $aPagesToDisplay); $sPagesList = '['.implode(',', array_keys($aPagesToDisplay)).']'; + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); $sSelectionMode = ($iNbPages == 1) ? '' : 'positive'; $sHtml = << - - + + - - + + diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 873a7b4dc..c729092df 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -570,7 +570,7 @@ class DisplayBlock } else { // render it as an Ajax (asynchronous) call $oHtml->AddCSSClass("loading"); - $oHtml->AddHtml("

".Dict::S('UI:Loading').'

'); + $oHtml->AddHtml("

".Dict::S('UI:Loading').'

'); $oPage->add_script(' $.post("ajax.render.php?style='.$this->m_sStyle.'", { operation: "ajax", filter: "'.$sFilter.'", extra_params: "'.$sExtraParams.'" }, diff --git a/application/template.class.inc.php b/application/template.class.inc.php index 7a07f5a65..4964b0d9f 100644 --- a/application/template.class.inc.php +++ b/application/template.class.inc.php @@ -232,12 +232,13 @@ class DisplayTemplate static public function UnitTest() { require_once(APPROOT.'/application/startup.inc.php'); - + + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); $sTemplate = ' - + SELECT Interface AS i WHERE i.device_id = $id$ @@ -350,7 +351,8 @@ class ObjectDetailsTemplate extends DisplayTemplate if ($iFlags & OPT_ATT_SLAVE) { $iSynchroFlags = $this->m_oObj->GetSynchroReplicaFlags($sAttCode, $aReasons); - $sSynchroIcon = " "; + $sAppRooturl = utils::GetAbsoluteUrlAppRoot(); + $sSynchroIcon = " "; $sTip = ''; foreach($aReasons as $aRow) { diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index 03ba6c319..ada67eb26 100644 --- a/core/bulkchange.class.inc.php +++ b/core/bulkchange.class.inc.php @@ -1446,7 +1446,7 @@ EOF <<'); + $('#csv_history_reload').html(''); $.get(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?{$sAppContext}', {operation: 'displayCSVHistory', showall: bShowAll}, function(data) { $('#$sAjaxDivId').html(data); diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index a1d808da4..c0d13d71e 100644 --- a/core/ormstopwatch.class.inc.php +++ b/core/ormstopwatch.class.inc.php @@ -217,7 +217,7 @@ class ormStopWatch } else { - $aProperties['Elapsed'] = 'running '; + $aProperties['Elapsed'] = 'running '; } $aProperties['Started'] = $oAttDef->SecondsToDate($this->iStarted); diff --git a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php index 5ca66bd74..f22dd0fdb 100644 --- a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php @@ -185,6 +185,7 @@ abstract class AbstractAttachmentsRenderer { $sClass = $this->sObjClass; $sId = $this->iObjKey; + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); $iMaxUploadInBytes = AttachmentPlugIn::GetMaxUploadSize(); $sMaxUploadLabel = AttachmentPlugIn::GetMaxUpload(); $sFileTooBigLabel = Dict::Format('Attachments:Error:FileTooLarge', $sMaxUploadLabel); @@ -195,7 +196,7 @@ abstract class AbstractAttachmentsRenderer $oAddButton = FileSelectUIBlockFactory::MakeStandard('file', 'file'); $oAddButton->SetShowFilename(false); $this->oPage->AddUiBlock($oAddButton); - $this->oPage->add(' '.$sMaxUploadLabel); + $this->oPage->add(' ' . $sMaxUploadLabel); $this->oPage->add(''); $this->oPage->add('
'); $this->oPage->add(file_get_contents(APPROOT.'images/illustrations/undraw_upload.svg')); @@ -342,7 +343,7 @@ abstract class AbstractAttachmentsRenderer $('.attachment a[href="'+sSrc+'"]').parent().addClass('image-in-use').find('img').wrap('
'); }); }); - $('.image-in-use-wrapper').append('
'); + $('.image-in-use-wrapper').append('
'); }, 200 ); JS ); diff --git a/pages/UI.php b/pages/UI.php index 673ce2391..2ef41873d 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -651,7 +651,7 @@ try $oP->SetBreadCrumbEntry($sPageId, $sLabel, $sDescription, '', 'fas fa-search', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES); $oP->add("
\n"); $oP->add("
\n"); - $oP->add(' '.Dict::Format('UI:Search:Ongoing', utils::EscapeHtml($sFullText)).''); + $oP->add(' '.Dict::Format('UI:Search:Ongoing', utils::EscapeHtml($sFullText)).''); $oP->add("
\n"); $oP->add("
\n"); $oP->add("
 
\n"); @@ -703,7 +703,7 @@ try break; /////////////////////////////////////////////////////////////////////////////////////////// - + /** @deprecated 3.1.0 Use the "object.new" route instead */ // Kept for backward compatibility case 'new': // Form to create a new object diff --git a/pages/ajax.render.php b/pages/ajax.render.php index 4c7fcb662..6393e21b3 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -1375,7 +1375,7 @@ JS <<'); + $('.search-class-$sClassName h2').append(' '); var oParams = {operation: 'full_text_search_enlarge', class: '$sClassName', text: '$sFullTextJS'}; $.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', oParams, function(data) { $('.search-class-$sClassName').html(data); @@ -1532,6 +1532,7 @@ EOF case 'xlsx_export_dialog': DeprecatedCallsLog::NotifyDeprecatedPhpEndpoint('Use "export_*" operations instead of "'.$operation.'"'); $sFilter = utils::ReadParam('filter', '', false, 'raw_data'); + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); $oPage->SetContentType('text/html'); $oPage->add( << div.closed { padding-left: 16px; - background: url(../images/plus.gif) 0 2px no-repeat; + background: url({$sAppRootUrl}images/plus.gif) 0 2px no-repeat; } .statistics .closed .stats-data { @@ -1594,7 +1595,7 @@ EOF ); $sJSLabels = json_encode($aLabels); $sFilter = addslashes($sFilter); - $sJSPageUrl = addslashes(utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php'); + $sJSPageUrl = addslashes($sAppRootUrl.'pages/ajax.render.php'); $oPage->add_ready_script("$('#XlsxExportDlg').xlsxexporter({filter: '$sFilter', labels: $sJSLabels, ajax_page_url: '$sJSPageUrl'});"); break; @@ -2208,7 +2209,8 @@ EOF $oPage = new NiceWebPage(Dict::S('UI:BrowseInlineImages')); $oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/magnific-popup.css'); $oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.magnific-popup.min.js'); - $sImgUrl = utils::GetAbsoluteUrlAppRoot().INLINEIMAGE_DOWNLOAD_URL; + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); + $sImgUrl = $sAppRootUrl.INLINEIMAGE_DOWNLOAD_URL; /** @noinspection SuspiciousAssignmentsInspection cke_upload_and_browse and cke_browse are chained */ $sTempId = utils::ReadParam('temp_id', '', false, 'transaction_id'); @@ -2236,7 +2238,7 @@ EOF } } - $sPostUrl = utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?CKEditorFuncNum='.$sCKEditorFuncNum; + $sPostUrl = $sAppRootUrl.'pages/ajax.render.php?CKEditorFuncNum='.$sCKEditorFuncNum; $oPage->add_style( <<add_ready_script( <<'); + $('#upload_status').html(''); $('#upload_form').submit(); $(this).prop('disabled', true); }); diff --git a/pages/audit.php b/pages/audit.php index 5aed36d67..1f68083eb 100644 --- a/pages/audit.php +++ b/pages/audit.php @@ -281,7 +281,7 @@ try $oAllCategoriesDashlet ->AddCSSClasses(['ibo-dashlet--is-inline', 'ibo-dashlet-badge']) ->AddSubBlock(DashletFactory::MakeForDashletBadge( - '../images/icons/icons8-audit.svg', + utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-audit.svg', utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=audit", $iCategoryCount, Dict::S('UI:Audit:Interactive:Selection:BadgeAll') @@ -304,7 +304,7 @@ try /** @var AuditDomain $oAuditDomain */ while($oAuditDomain = $oDomainSet->Fetch()) { $sDomainUrl = utils::GetAbsoluteUrlAppRoot()."pages/audit.php?operation=audit&domain=".$oAuditDomain->GetKey(); - $sIconUrl = '../images/icons/icons8-puzzle.svg'; + $sIconUrl = utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-puzzle.svg'; /** @var \ormDocument $oImage */ $oImage = $oAuditDomain->Get('icon'); if (!$oImage->IsEmpty()) { @@ -357,9 +357,9 @@ try $oP->AddUiBlock(TitleUIBlockFactory::MakeForPage($sTitle)); $oP->AddUiBlock(new Text($sSubTitle)); - $oTotalBlock = DashletFactory::MakeForDashletBadge('../images/icons/icons8-audit.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsAudited')); - $oErrorBlock = DashletFactory::MakeForDashletBadge('../images/icons/icons8-delete.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsInError')); - $oWorkingBlock = DashletFactory::MakeForDashletBadge('../images/icons/icons8-checkmark.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsValidated')); + $oTotalBlock = DashletFactory::MakeForDashletBadge(utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-audit.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsAudited')); + $oErrorBlock = DashletFactory::MakeForDashletBadge(utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-delete.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsInError')); + $oWorkingBlock = DashletFactory::MakeForDashletBadge(utils::GetAbsoluteUrlAppRoot().'images/icons/icons8-checkmark.svg', '#', 0, Dict::S('UI:Audit:Dashboard:ObjectsValidated')); $aCSSClasses = ['ibo-dashlet--is-inline', 'ibo-dashlet-badge']; @@ -436,7 +436,7 @@ try foreach ($aErrors as $aErrorRow) { $aObjectsWithErrors[$aErrorRow['id']] = true; } - $aRow['nb_errors'] = ($iErrorsCount == 0) ? '0' : "GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">$iErrorsCount GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">"; + $aRow['nb_errors'] = ($iErrorsCount == 0) ? '0' : "GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">$iErrorsCount GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">"; $aRow['percent_ok'] = sprintf('%.2f', 100.0 * (($iCount - $iErrorsCount) / $iCount)); $aRow['class'] = $oAuditCategory->GetReportColor($iCount, $iErrorsCount); } diff --git a/pages/csvimport.php b/pages/csvimport.php index ff790f07c..d064b7291 100644 --- a/pages/csvimport.php +++ b/pages/csvimport.php @@ -400,6 +400,7 @@ try { $iUnchanged = 0; $aTableData = []; + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); foreach ($aRes as $iLine => $aResRow) { $aTableRow = []; @@ -414,7 +415,7 @@ try { $sFinalClass = $aResRow['finalclass']; $oObj = MetaModel::GetObject($sFinalClass, $aResRow['id']->GetPureValue()); $sUrl = $oObj->GetHyperlink(); - $sStatus = ''; + $sStatus = ''; $sCSSRowClass = 'ibo-csv-import--row-unchanged'; break; @@ -423,7 +424,7 @@ try { $sFinalClass = $aResRow['finalclass']; $oObj = MetaModel::GetObject($sFinalClass, $aResRow['id']->GetPureValue()); $sUrl = $oObj->GetHyperlink(); - $sStatus = ''; + $sStatus = ''; $sCSSRowClass = 'ibo-csv-import--row-modified'; break; @@ -432,7 +433,7 @@ try { $sFinalClass = $aResRow['finalclass']; $oObj = MetaModel::GetObject($sFinalClass, $aResRow['id']->GetPureValue()); $sUrl = $oObj->GetHyperlink(); - $sStatus = ''; + $sStatus = ''; $sCSSRowClass = 'ibo-csv-import--row-modified'; if ($bSimulate) { $sMessage = Dict::S('UI:CSVReport-Object-MissingToUpdate'); @@ -443,7 +444,7 @@ try { case 'RowStatus_NewObj': $iCreated++; - $sStatus = ''; + $sStatus = ''; $sCSSRowClass = 'ibo-csv-import--row-added'; if ($bSimulate) { $sMessage = Dict::S('UI:CSVReport-Object-ToCreate'); @@ -585,21 +586,21 @@ HTML; $oMulticolumn->AddCSSClass('ml-1'); $oForm->AddSubBlock($oMulticolumn); - $oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel(' '.sprintf($aDisplayFilters['unchanged'], $iUnchanged), '', "1", "show_unchanged", "checkbox"); + $oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel(' '.sprintf($aDisplayFilters['unchanged'], $iUnchanged), '', "1", "show_unchanged", "checkbox"); $oCheckBoxUnchanged->GetInput()->SetIsChecked(true); $oCheckBoxUnchanged->SetBeforeInput(false); $oCheckBoxUnchanged->GetInput()->AddCSSClass('ibo-input-checkbox'); $oMulticolumn->AddColumn(ColumnUIBlockFactory::MakeForBlock($oCheckBoxUnchanged)); $oPage->add_ready_script("$('#show_unchanged').on('click', function(){ToggleRows('ibo-csv-import--row-unchanged')})"); - $oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel(' '.sprintf($aDisplayFilters['modified'], $iModified), '', "1", "show_modified", "checkbox"); + $oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel(' '.sprintf($aDisplayFilters['modified'], $iModified), '', "1", "show_modified", "checkbox"); $oCheckBoxUnchanged->GetInput()->SetIsChecked(true); $oCheckBoxUnchanged->SetBeforeInput(false); $oCheckBoxUnchanged->GetInput()->AddCSSClass('ibo-input-checkbox'); $oMulticolumn->AddColumn(ColumnUIBlockFactory::MakeForBlock($oCheckBoxUnchanged)); $oPage->add_ready_script("$('#show_modified').on('click', function(){ToggleRows('ibo-csv-import--row-modified')})"); - $oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel(' '.sprintf($aDisplayFilters['added'], $iCreated), '', "1", "show_created", "checkbox"); + $oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel(' '.sprintf($aDisplayFilters['added'], $iCreated), '', "1", "show_created", "checkbox"); $oCheckBoxUnchanged->GetInput()->SetIsChecked(true); $oCheckBoxUnchanged->SetBeforeInput(false); $oCheckBoxUnchanged->GetInput()->AddCSSClass('ibo-input-checkbox'); diff --git a/pages/preferences.php b/pages/preferences.php index 0eeb4a8af..f89067f65 100644 --- a/pages/preferences.php +++ b/pages/preferences.php @@ -133,7 +133,7 @@ function ValidateOtherSettings() } else { - $('#v_default_page_size').html(''); + $('#v_default_page_size').html(''); $('#ibo-misc-settings-submit').prop('disabled', true); return false; } @@ -417,7 +417,7 @@ JS $oUserPicturePlaceHolderBlock = new Panel(Dict::S('UI:Preferences:ChooseAPlaceholder'), array(), 'grey', 'ibo-user-picture-placeholder'); - $sUserPicturesFolder = '../images/user-pictures/'; + $sUserPicturesFolder = utils::GetAbsoluteUrlAppRoot() . 'images/user-pictures/'; $sUserDefaultPicture = appUserPreferences::GetPref('user_picture_placeholder', 'default-placeholder.png'); $sUserPicturePlaceHolderHtml = ''; $sUserPicturePlaceHolderHtml .= '

'.Dict::S('UI:Preferences:ChooseAPlaceholder+').'

'; diff --git a/sources/Application/Helper/FormHelper.php b/sources/Application/Helper/FormHelper.php index c4425360d..02f40266e 100644 --- a/sources/Application/Helper/FormHelper.php +++ b/sources/Application/Helper/FormHelper.php @@ -55,7 +55,6 @@ class FormHelper */ public static function DisableAttributeBlobInputs(string $sClassName, array &$aExtraParams): void { - // Initialize extra params array if (!array_key_exists('fieldsFlags', $aExtraParams)) { $aExtraParams['fieldsFlags'] = []; @@ -64,13 +63,13 @@ class FormHelper $aExtraParams['fieldsComments'] = []; } - // Iterate throw class attributes... + // Iterate through class attributes... + $sAppRootUrl = utils::GetAbsoluteUrlAppRoot(); foreach (MetaModel::ListAttributeDefs($sClassName) as $sAttCode => $oAttDef) { - // Set attribute blobs in read only if ($oAttDef instanceof AttributeBlob) { $aExtraParams['fieldsFlags'][$sAttCode] = OPT_ATT_READONLY; - $aExtraParams['fieldsComments'][$sAttCode] = ' '; + $aExtraParams['fieldsComments'][$sAttCode] = ' '; } } } diff --git a/sources/Application/WebPage/ErrorPage.php b/sources/Application/WebPage/ErrorPage.php index 87918acd6..bc8370419 100644 --- a/sources/Application/WebPage/ErrorPage.php +++ b/sources/Application/WebPage/ErrorPage.php @@ -58,7 +58,7 @@ class ErrorPage extends NiceWebPage if(utils::IsEasterEggAllowed()) { $this->add('
'.Dict::S('UI:ErrorPage:UnstableVersion').'
'); - $this->add(''); + $this->add(''); $this->add('
'.nl2br(Dict::S('UI:ErrorPage:KittyDisclaimer')).'
'); } $this->log_error($sText); diff --git a/sources/Application/WebPage/iTopWizardWebPage.php b/sources/Application/WebPage/iTopWizardWebPage.php index 9b2de9116..c5486fb00 100644 --- a/sources/Application/WebPage/iTopWizardWebPage.php +++ b/sources/Application/WebPage/iTopWizardWebPage.php @@ -54,7 +54,7 @@ class iTopWizardWebPage extends iTopWebPage $sStyle = ($iIndex == $this->m_iCurrentStep) ? 'wizActiveStep' : 'wizStep'; $aSteps[] = "
$sStepTitle
"; } - $sWizardHeader = "

".utils::EscapeHtml($this->s_title)."

\n".implode("
", $aSteps)."
\n"; + $sWizardHeader = "

".utils::EscapeHtml($this->s_title)."

\n".implode("
", $aSteps)."
\n"; $this->s_content = "$sWizardHeader
".$this->s_content."
"; parent::output(); } diff --git a/sources/Controller/AjaxRenderController.php b/sources/Controller/AjaxRenderController.php index e02a084a7..794c19d84 100644 --- a/sources/Controller/AjaxRenderController.php +++ b/sources/Controller/AjaxRenderController.php @@ -845,7 +845,7 @@ EOF ); $sVersionString = Dict::Format('UI:iTopVersion:Short', ITOP_APPLICATION, ITOP_VERSION); $oPage->add('
'); - $oPage->add('
'); + $oPage->add('
'); $oPage->add('
'.$sVersionString.'
'); $oPage->add("
"); self::DisplayAboutLicenses($oPage); @@ -927,7 +927,7 @@ EOF // Display // $oPage->add('
'); - $oPage->add('
'); + $oPage->add('
'); $oPage->add('
'.$sVersionString.'
'.'MySQL: '.$sMySQLVersion.'
'.'PHP: '.$sPHPVersion.'
'); $oPage->add("
"); diff --git a/templates/application/display-block/block-chart/layout.html.twig b/templates/application/display-block/block-chart/layout.html.twig index c3c0b233c..cbafd0f76 100644 --- a/templates/application/display-block/block-chart/layout.html.twig +++ b/templates/application/display-block/block-chart/layout.html.twig @@ -3,7 +3,7 @@ {% apply spaceless %}
- +
{% endapply %} \ No newline at end of file
$sPagesAAAA $sPagesLinks $sPageSizeCombo