mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
N°6935 - Migrate relative images URLs to absolute ones in order to support pages on different depth levels
This commit is contained in:
@@ -651,7 +651,7 @@ try
|
||||
$oP->SetBreadCrumbEntry($sPageId, $sLabel, $sDescription, '', 'fas fa-search', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES);
|
||||
$oP->add("<div style=\"padding: 10px;\">\n");
|
||||
$oP->add("<div class=\"header_message\" id=\"full_text_progress\" style=\"position: fixed; background-color: #cccccc; opacity: 0.7; padding: 1.5em;\">\n");
|
||||
$oP->add('<img id="full_text_indicator" src="../images/indicator.gif"> <span style="padding: 1.5em;">'.Dict::Format('UI:Search:Ongoing', utils::EscapeHtml($sFullText)).'</span>');
|
||||
$oP->add('<img id="full_text_indicator" src="' . utils::GetAbsoluteUrlAppRoot() . 'images/indicator.gif"> <span style="padding: 1.5em;">'.Dict::Format('UI:Search:Ongoing', utils::EscapeHtml($sFullText)).'</span>');
|
||||
$oP->add("</div>\n");
|
||||
$oP->add("<div id=\"full_text_results\">\n");
|
||||
$oP->add("<div id=\"full_text_progress_placeholder\" style=\"padding: 1.5em;\"> </div>\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
|
||||
|
||||
@@ -1375,7 +1375,7 @@ JS
|
||||
<<<EOF
|
||||
$('.search-class-$sClassName button').prop('disabled', true);
|
||||
|
||||
$('.search-class-$sClassName h2').append(' <img id="indicator" src="../images/indicator.gif">');
|
||||
$('.search-class-$sClassName h2').append(' <img id="indicator" src="' + GetAbsoluteUrlAppRoot() + 'images/indicator.gif">');
|
||||
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(
|
||||
<<<EOF
|
||||
@@ -1561,11 +1562,11 @@ EOF
|
||||
padding-left: 16px;
|
||||
cursor: pointer;
|
||||
font-size: 10pt;
|
||||
background: url(../images/minus.gif) 0 2px no-repeat;
|
||||
background: url({$sAppRootUrl}images/minus.gif) 0 2px no-repeat;
|
||||
}
|
||||
.statistics > 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(
|
||||
<<<EOF
|
||||
@@ -2304,7 +2306,7 @@ EOF
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
$('#upload_button').on('change', function() {
|
||||
$('#upload_status').html('<img src="../images/indicator.gif">');
|
||||
$('#upload_status').html('<img src="{$sAppRootUrl}images/indicator.gif">');
|
||||
$('#upload_form').submit();
|
||||
$(this).prop('disabled', true);
|
||||
});
|
||||
|
||||
@@ -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' : "<a href=\"?operation=errors&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">$iErrorsCount</a> <a href=\"?operation=csv&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\"><img src=\"../images/icons/icons8-export-csv.svg\" class=\"ibo-audit--audit-line--csv-download\"></a>";
|
||||
$aRow['nb_errors'] = ($iErrorsCount == 0) ? '0' : "<a href=\"?operation=errors&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\">$iErrorsCount</a> <a href=\"?operation=csv&category=".$oAuditCategory->GetKey()."&rule=".$oAuditRule->GetKey()."&".$oAppContext->GetForLink()."\"><img src=\"" . utils::GetAbsoluteUrlAppRoot() . "images/icons/icons8-export-csv.svg\" class=\"ibo-audit--audit-line--csv-download\"></a>";
|
||||
$aRow['percent_ok'] = sprintf('%.2f', 100.0 * (($iCount - $iErrorsCount) / $iCount));
|
||||
$aRow['class'] = $oAuditCategory->GetReportColor($iCount, $iErrorsCount);
|
||||
}
|
||||
|
||||
@@ -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 = '<img src="../images/unchanged.png" title="'.Dict::S('UI:CSVReport-Icon-Unchanged').'">';
|
||||
$sStatus = '<img src="' . $sAppRootUrl . 'images/unchanged.png" title="'.Dict::S('UI:CSVReport-Icon-Unchanged').'">';
|
||||
$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 = '<img src="../images/modified.png" title="'.Dict::S('UI:CSVReport-Icon-Modified').'">';
|
||||
$sStatus = '<img src="' . $sAppRootUrl . 'images/modified.png" title="'.Dict::S('UI:CSVReport-Icon-Modified').'">';
|
||||
$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 = '<img src="../images/delete.png" title="'.Dict::S('UI:CSVReport-Icon-Missing').'">';
|
||||
$sStatus = '<img src="' . $sAppRootUrl . 'images/delete.png" title="'.Dict::S('UI:CSVReport-Icon-Missing').'">';
|
||||
$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 = '<img src="../images/added.png" title="'.Dict::S('UI:CSVReport-Icon-Created').'">';
|
||||
$sStatus = '<img src="' . $sAppRootUrl . 'images/added.png" title="'.Dict::S('UI:CSVReport-Icon-Created').'">';
|
||||
$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('<img src="../images/unchanged.png"> '.sprintf($aDisplayFilters['unchanged'], $iUnchanged), '', "1", "show_unchanged", "checkbox");
|
||||
$oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel('<img src="' . $sAppRootUrl . 'images/unchanged.png"> '.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('<img src="../images/modified.png"> '.sprintf($aDisplayFilters['modified'], $iModified), '', "1", "show_modified", "checkbox");
|
||||
$oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel('<img src="' . $sAppRootUrl . 'images/modified.png"> '.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('<img src="../images/added.png"> '.sprintf($aDisplayFilters['added'], $iCreated), '', "1", "show_created", "checkbox");
|
||||
$oCheckBoxUnchanged = InputUIBlockFactory::MakeForInputWithLabel('<img src="' . $sAppRootUrl . 'images/added.png"> '.sprintf($aDisplayFilters['added'], $iCreated), '', "1", "show_created", "checkbox");
|
||||
$oCheckBoxUnchanged->GetInput()->SetIsChecked(true);
|
||||
$oCheckBoxUnchanged->SetBeforeInput(false);
|
||||
$oCheckBoxUnchanged->GetInput()->AddCSSClass('ibo-input-checkbox');
|
||||
|
||||
@@ -133,7 +133,7 @@ function ValidateOtherSettings()
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#v_default_page_size').html('<img src="../images/validation_error.png"/>');
|
||||
$('#v_default_page_size').html('<img src="' + GetAbsoluteUrlAppRoot() + 'images/validation_error.png"/>');
|
||||
$('#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 .= '<p>'.Dict::S('UI:Preferences:ChooseAPlaceholder+').'</p> <div class="ibo-preferences--user-preferences--picture-placeholder">';
|
||||
|
||||
Reference in New Issue
Block a user