diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 89fd76ffe..9e3d70dfc 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -87,7 +87,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay } public static function GetUIPage() { - return '../pages/UI.php'; + return 'UI.php'; } function DisplayBareHeader(WebPage $oPage, $bEditMode = false) @@ -1190,7 +1190,7 @@ EOF $sClassesCombo = MetaModel::GetName($sClassName); } $oUnlimitedFilter = new DBObjectSearch($sClassName); - $sAction = (isset($aExtraParams['action'])) ? $aExtraParams['action'] : '../pages/UI.php'; + $sAction = (isset($aExtraParams['action'])) ? $aExtraParams['action'] : utils::GetAbsoluteUrlAppRoot().'pages/UI.php'; $sHtml .= "
\n"; // Don't use $_SERVER['SCRIPT_NAME'] since the form may be called asynchronously (from ajax.php) $sHtml .= "

".Dict::Format('UI:SearchFor_Class_Objects', $sClassesCombo)."

\n"; $index = 0; @@ -1806,7 +1806,7 @@ EOF $oPage->add("\n"); } // Hook the cancel button via jQuery so that it can be unhooked easily as well if needed - $sDefaultUrl = '../pages/UI.php?operation=cancel'; + $sDefaultUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=cancel&'.$oAppContext->GetForLink(); $oPage->add_ready_script("$('#form_{$this->m_iFormId} button.cancel').click( function() { BackToDetails('$sClass', $iKey, '$sDefaultUrl')} );"); $oPage->add("
\n"); @@ -2030,7 +2030,7 @@ EOF { case 'text/html': case 'text/xml': - $oPage->add("\n"); + $oPage->add("\n"); break; default: @@ -2042,7 +2042,7 @@ EOF switch($oDoc->GetMimeType()) { case 'application/pdf': - $oPage->add("\n"); + $oPage->add("\n"); break; default: @@ -2051,7 +2051,7 @@ EOF break; case 'image': - $oPage->add("\n"); + $oPage->add("\n"); break; default: diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 4c5246d92..2c7470a97 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -349,7 +349,7 @@ class DisplayBlock foreach($aGroupBy as $sValue => $iCount) { $aData[] = array ( 'group' => $sLabels[$sValue], - 'value' => "$iCount"); // TO DO: add the context information + 'value' => "$iCount"); // TO DO: add the context information } $aAttribs =array( 'group' => array('label' => MetaModel::GetLabel($this->m_oFilter->GetClass(), $sGroupByField), 'description' => ''), @@ -528,7 +528,7 @@ class DisplayBlock } } - $sHtml .= $oPage->GetP("".Dict::Format('UI:ClickToCreateNew', Metamodel::GetName($sClass))."\n"); + $sHtml .= $oPage->GetP("".Dict::Format('UI:ClickToCreateNew', Metamodel::GetName($sClass))."\n"); } } } @@ -564,7 +564,7 @@ class DisplayBlock $sDefaults .= '&'.urlencode($sName).'='.urlencode($sValue); } } - $sHtml .= $oPage->GetP("".Dict::Format('UI:ClickToCreateNew', Metamodel::GetName($sClass))."\n"); + $sHtml .= $oPage->GetP("".Dict::Format('UI:ClickToCreateNew', Metamodel::GetName($sClass))."\n"); } } } @@ -600,7 +600,7 @@ class DisplayBlock $this->m_oSet = new CMDBObjectSet($this->m_oFilter, array(), $aQueryParams); } $iCount = $this->m_oSet->Count(); - $sHyperlink = '../pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.$this->m_oFilter->serialize(); + $sHyperlink = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.$this->m_oFilter->serialize(); $sHtml .= '

'; $sHtml .= MetaModel::GetClassIcon($sClass, true, 'float;left;margin-right:10px;'); $sHtml .= MetaModel::GetName($sClass).': '.$iCount.'

'; @@ -608,9 +608,9 @@ class DisplayBlock $sHtml .= '

'; if (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY)) { - $sHtml .= "".Dict::Format('UI:ClickToCreateNew', MetaModel::GetName($sClass))."
\n"; + $sHtml .= "".Dict::Format('UI:ClickToCreateNew', MetaModel::GetName($sClass))."
\n"; } - $sHtml .= "".Dict::Format('UI:SearchFor_Class', MetaModel::GetName($sClass))."\n"; + $sHtml .= "".Dict::Format('UI:SearchFor_Class', MetaModel::GetName($sClass))."\n"; $sHtml .= '

'; break; @@ -661,7 +661,7 @@ class DisplayBlock } else { - $sHyperlink = '../pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.$oFilter->serialize(); + $sHyperlink = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.$oFilter->serialize(); $aCounts[$sStateValue] = "{$aCounts[$sStateValue]}"; } } @@ -670,7 +670,7 @@ class DisplayBlock $sHtml .= ''.implode('', $aCounts).''; // Title & summary $iCount = $this->m_oSet->Count(); - $sHyperlink = '../pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.$this->m_oFilter->serialize(); + $sHyperlink = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=search&'.$oAppContext->GetForLink().'&filter='.$this->m_oFilter->serialize(); $sHtml .= '

'.Dict::S(str_replace('_', ':', $sTitle)).'

'; $sHtml .= ''.Dict::Format(str_replace('_', ':', $sLabel), $iCount).''; break; @@ -726,7 +726,7 @@ EOF $sHtml .= "
If the chart does not display, install Flash
\n"; $oPage->add_script("function ofc_resize(left, width, top, height) { /* do nothing special */ }"); $oPage->add_ready_script("swfobject.embedSWF(\"../images/open-flash-chart.swf\", \"my_chart_{$iChartCounter}\", \"100%\", \"300\",\"9.0.0\", \"expressInstall.swf\", - {\"data-file\":\"".urlencode("../pages/ajax.render.php?operation=open_flash_chart¶ms[group_by]=$sGroupBy{$sGroupByExpr}¶ms[chart_type]=$sChartType¶ms[chart_title]=$sTitle&id=$sId&filter=".$sFilter)."\"}, {wmode: 'transparent'} );\n"); + {\"data-file\":\"".urlencode(utils::GetAbsoluteUrlAppRoot()."pages/ajax.render.php?operation=open_flash_chart¶ms[group_by]=$sGroupBy{$sGroupByExpr}¶ms[chart_type]=$sChartType¶ms[chart_title]=$sTitle&id=$sId&filter=".$sFilter)."\"}, {wmode: 'transparent'} );\n"); $iChartCounter++; if (isset($aExtraParams['group_by'])) { @@ -1042,6 +1042,7 @@ class MenuBlock extends DisplayBlock $sFilterDesc = $this->m_oFilter->ToOql(); $aActions = array(); $sUIPage = cmdbAbstractObject::ComputeStandardUIPage($sClass); + $sRootUrl = utils::GetAbsoluteUrlAppRoot(); // 1:n links, populate the target object as a default value when creating a new linked object if (isset($aExtraParams['target_attr'])) { @@ -1060,7 +1061,7 @@ class MenuBlock extends DisplayBlock case 0: // No object in the set, the only possible action is "new" $bIsModifyAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY) == UR_ALLOWED_YES); - if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "../page/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } + if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "{$sRootUrl}page/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } break; case 1: @@ -1073,9 +1074,9 @@ class MenuBlock extends DisplayBlock // Just one object in the set, possible actions are "new / clone / modify and delete" if (!isset($aExtraParams['link_attr'])) { - if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Modify'), 'url' => "../pages/$sUIPage?operation=modify&class=$sClass&id=$id&$sContext#"); } - if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } - if ($bIsDeleteAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Delete'), 'url' => "../pages/$sUIPage?operation=delete&class=$sClass&id=$id&$sContext"); } + if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Modify'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=modify&class=$sClass&id=$id&$sContext#"); } + if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } + if ($bIsDeleteAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Delete'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=delete&class=$sClass&id=$id&$sContext"); } // Transitions / Stimuli $aTransitions = $oObj->EnumTransitions(); if (count($aTransitions)) @@ -1088,7 +1089,7 @@ class MenuBlock extends DisplayBlock switch($iActionAllowed) { case UR_ALLOWED_YES: - $aActions[] = array('label' => $aStimuli[$sStimulusCode]->GetLabel(), 'url' => "../pages/UI.php?operation=stimulus&stimulus=$sStimulusCode&class=$sClass&id=$id&$sContext"); + $aActions[] = array('label' => $aStimuli[$sStimulusCode]->GetLabel(), 'url' => "{$sRootUrl}pages/UI.php?operation=stimulus&stimulus=$sStimulusCode&class=$sClass&id=$id&$sContext"); break; default: @@ -1103,14 +1104,14 @@ class MenuBlock extends DisplayBlock $this->AddMenuSeparator($aActions); foreach($aRelations as $sRelationCode) { - $aActions[] = array ('label' => MetaModel::GetRelationVerbUp($sRelationCode), 'url' => "../pages/$sUIPage?operation=swf_navigator&relation=$sRelationCode&class=$sClass&id=$id&$sContext"); + $aActions[] = array ('label' => MetaModel::GetRelationVerbUp($sRelationCode), 'url' => "{$sRootUrl}pages/$sUIPage?operation=swf_navigator&relation=$sRelationCode&class=$sClass&id=$id&$sContext"); } } $this->AddMenuSeparator($aActions); // Static menus: Email this page & CSV Export $sUrl = ApplicationContext::MakeObjectUrl($sClass, $id); $aActions[] = array ('label' => Dict::S('UI:Menu:EMail'), 'url' => "mailto:?subject=".$oObj->GetName()."&body=".urlencode($sUrl)); - $aActions[] = array ('label' => Dict::S('UI:Menu:CSVExport'), 'url' => "../pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext"); + $aActions[] = array ('label' => Dict::S('UI:Menu:CSVExport'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext"); } $this->AddMenuSeparator($aActions); foreach (MetaModel::EnumPlugins('iApplicationUIExtension') as $oExtensionInstance) @@ -1136,16 +1137,16 @@ class MenuBlock extends DisplayBlock $oAttDef = MetaModel::GetAttributeDef($sClass, $sTargetAttr); $sTargetClass = $oAttDef->GetTargetClass(); $bIsDeleteAllowed = UserRights::IsActionAllowed($sClass, UR_ACTION_DELETE, $oSet); - if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Add'), 'url' => "../pages/$sUIPage?operation=modify_links&class=$sClass&link_attr=".$aExtraParams['link_attr']."&target_class=$sTargetClass&id=$id&addObjects=true&$sContext"); } - if ($bIsBulkModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Manage'), 'url' => "../pages/$sUIPage?operation=modify_links&class=$sClass&link_attr=".$aExtraParams['link_attr']."&target_class=$sTargetClass&id=$id&sContext"); } + if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Add'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=modify_links&class=$sClass&link_attr=".$aExtraParams['link_attr']."&target_class=$sTargetClass&id=$id&addObjects=true&$sContext"); } + if ($bIsBulkModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:Manage'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=modify_links&class=$sClass&link_attr=".$aExtraParams['link_attr']."&target_class=$sTargetClass&id=$id&sContext"); } //if ($bIsBulkDeleteAllowed) { $aActions[] = array ('label' => 'Remove All...', 'url' => "#"); } } else { // many objects in the set, possible actions are: new / modify all / delete all - if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } - if ($bIsBulkModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:ModifyAll'), 'url' => "../pages/$sUIPage?operation=select_for_modify_all&class=$sClass&filter=$sFilter&sContext"); } - if ($bIsBulkDeleteAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:BulkDelete'), 'url' => "../pages/$sUIPage?operation=select_for_deletion&filter=$sFilter&$sContext"); } + if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } + if ($bIsBulkModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:ModifyAll'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=select_for_modify_all&class=$sClass&filter=$sFilter&sContext"); } + if ($bIsBulkDeleteAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:BulkDelete'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=select_for_deletion&filter=$sFilter&$sContext"); } // Stimuli $aStates = MetaModel::EnumStates($sClass); @@ -1176,7 +1177,7 @@ class MenuBlock extends DisplayBlock { case UR_ALLOWED_YES: case UR_ALLOWED_DEPENDS: - $aActions[] = array('label' => $aStimuli[$sStimulusCode]->GetLabel(), 'url' => "../pages/UI.php?operation=select_bulk_stimulus&stimulus=$sStimulusCode&state=$sState&class=$sClass&filter=$sFilter&$sContext"); + $aActions[] = array('label' => $aStimuli[$sStimulusCode]->GetLabel(), 'url' => "{$sRootUrl}pages/UI.php?operation=select_bulk_stimulus&stimulus=$sStimulusCode&state=$sState&class=$sClass&filter=$sFilter&$sContext"); break; default: @@ -1189,7 +1190,7 @@ class MenuBlock extends DisplayBlock $this->AddMenuSeparator($aActions); $sUrl = utils::GetAbsoluteUrlAppRoot(); $aActions[] = array ('label' => Dict::S('UI:Menu:EMail'), 'url' => "mailto:?subject=$sFilterDesc&body=".urlencode("{$sUrl}pages/$sUIPage?operation=search&filter=$sFilter&$sContext")); - $aActions[] = array ('label' => Dict::S('UI:Menu:CSVExport'), 'url' => "../pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext"); + $aActions[] = array ('label' => Dict::S('UI:Menu:CSVExport'), 'url' => "{$sRootUrl}pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext"); } $this->AddMenuSeparator($aActions); foreach (MetaModel::EnumPlugins('iApplicationUIExtension') as $oExtensionInstance) diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index f0d8e5933..faaf59ccd 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -361,7 +361,7 @@ EOF { if (id > 0) { - window.location.href = './UI.php?operation=details&class='+sClass+'&id='+id; + window.location.href = GetAbsoluteUrlAppRoot()+'pages/UI.php?operation=details&class='+sClass+'&id='+id; } else { @@ -372,7 +372,7 @@ EOF function BackToList(sClass) { - window.location.href = './UI.php?operation=search_oql&oql_class='+sClass+'&oql_clause=WHERE id=0'; + window.location.href = GetAbsoluteUrlAppRoot()+'pages/UI.php?operation=search_oql&oql_class='+sClass+'&oql_clause=WHERE id=0'; } function ShowDebug() @@ -661,11 +661,11 @@ EOF if (utils::CanLogOff()) { //$sLogOffMenu .= "
  • ".Dict::S('UI:LogOffMenu')."
  • \n"; - $sLogOffMenu .= "
  • ".Dict::S('UI:LogOffMenu')."
  • \n"; + $sLogOffMenu .= "
  • ".Dict::S('UI:LogOffMenu')."
  • \n"; } if (UserRights::CanChangePassword()) { - $sLogOffMenu .= "
  • ".Dict::S('UI:ChangePwdMenu')."
  • \n"; + $sLogOffMenu .= "
  • ".Dict::S('UI:ChangePwdMenu')."
  • \n"; } $sLogOffMenu .= "\n\n\n"; @@ -731,7 +731,7 @@ EOF echo '
    '; echo '
    '; echo $sApplicationBanner; - echo ' '; @@ -743,55 +743,7 @@ EOF echo ' '; echo '
    '; echo '
    '; -/* - echo "
    iTop
    \n"; - //echo "
    \n"; - $sText = Utils::ReadParam('text', ''); - $sOnClick = ""; - if (empty($sText)) - { - // if no search text is supplied then - // 1) the search text is filled with "your search" - // 2) clicking on it will erase it - $sText = Dict::S("UI:YourSearch"); - $sOnClick = " onclick=\"this.value='';this.onclick=null;\""; - } - $sUserName = UserRights::GetUser(); - $sIsAdmin = UserRights::IsAdministrator() ? '(Administrator)' : ''; - if (UserRights::IsAdministrator()) - { - $sLogonMessage = Dict::Format('UI:LoggedAsMessage+Admin', $sUserName); - } - else - { - $sLogonMessage = Dict::Format('UI:LoggedAsMessage', $sUserName); - } - $sLogOffBtn = Dict::S('UI:Button:Logoff'); - $sSearchBtn = Dict::S('UI:Button:GlobalSearch'); - echo "
    {$sLogonMessage}  "; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    -
    \n"; - echo "
    \n"; - echo "\n"; - - // Display the menu - echo "
    \n"; - echo "
    \n"; - echo $this->m_sMenu; - echo "
    \n"; - - echo "
    \n"; - - - // Display the page's content - echo $this->s_content; - -*/ // Add the captured output if (trim($s_captured_output) != "") { diff --git a/application/loginwebpage.class.inc.php b/application/loginwebpage.class.inc.php index 242eeabb4..635782c7b 100644 --- a/application/loginwebpage.class.inc.php +++ b/application/loginwebpage.class.inc.php @@ -299,8 +299,7 @@ EOF else { // The user is not part of the allowed groups, => log out - $sUrl = utils::GetAbsoluteUrlAppRoot(); - $sUrl .= 'pages/UI.php'; + $sUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php'; $sCASLogoutUrl = MetaModel::GetConfig()->Get('cas_logout_redirect_service'); if (empty($sCASLogoutUrl)) { @@ -483,14 +482,14 @@ EOF require_once(APPROOT.'/setup/setuppage.class.inc.php'); $oP = new SetupWebPage(Dict::S('UI:PageTitle:FatalError')); $oP->add("

    ".Dict::S('UI:Login:Error:AccessAdmin')."

    \n"); - $oP->p("".Dict::S('UI:LogOffMenu').""); + $oP->p("".Dict::S('UI:LogOffMenu').""); $oP->output(); exit; } elseif ( (!$bIsAllowedToPortalUsers) && (UserRights::IsPortalUser())) { // No rights to be here, redirect to the portal - header('Location: ../portal/index.php'); + header('Location: '.utils::GetAbsoluteUrlAppRoot().'portal/index.php'); } return $sMessage; } diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index 2e2d59612..5b73caaa1 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -327,7 +327,7 @@ abstract class MenuNode public function GetHyperlink($aExtraParams) { $aExtraParams['c[menu]'] = $this->GetIndex(); - return $this->AddParams('../pages/UI.php', $aExtraParams); + return $this->AddParams(utils::GetAbsoluteUrlAppRoot().'pages/UI.php', $aExtraParams); } /** @@ -652,7 +652,7 @@ class NewObjectMenuNode extends MenuNode public function GetHyperlink($aExtraParams) { - $sHyperlink = '../pages/UI.php?operation=new&class='.$this->sClass; + $sHyperlink = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=new&class='.$this->sClass; $aExtraParams['c[menu]'] = $this->GetIndex(); return $this->AddParams($sHyperlink, $aExtraParams); } diff --git a/application/portalwebpage.class.inc.php b/application/portalwebpage.class.inc.php index 4041acd6e..24b759639 100644 --- a/application/portalwebpage.class.inc.php +++ b/application/portalwebpage.class.inc.php @@ -218,7 +218,7 @@ EOF $sMenu = ''; if ($this->m_bEnableDisconnectButton) { - $this->AddMenuButton('logoff', 'Portal:Disconnect', '../pages/logoff.php'); // This menu is always present and is the last one + $this->AddMenuButton('logoff', 'Portal:Disconnect', utils::GetAbsoluteUrlAppRoot().'pages/logoff.php'); // This menu is always present and is the last one } foreach($this->m_aMenuButtons as $aMenuItem) { diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index 4d0d9f1a2..a5cd49a09 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -188,7 +188,7 @@ EOF <<iId} = new ExtKeyWidget('{$this->iId}', '{$this->sTargetClass}', '$sFilter', '$sTitle', false, $sWizHelper); oACWidget_{$this->iId}.emptyHtml = "

    $sMessage

    "; - $('#label_$this->iId').autocomplete('../pages/ajax.render.php', { scroll:true, minChars:{$iMinChars}, autoFill:false, matchContains:true, keyHolder:'#{$this->iId}', extraParams:{operation:'ac_extkey', sTargetClass:'{$this->sTargetClass}',sFilter:'$sFilter', json: function() { return $sWizHelperJSON; } }}); + $('#label_$this->iId').autocomplete(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', { scroll:true, minChars:{$iMinChars}, autoFill:false, matchContains:true, keyHolder:'#{$this->iId}', extraParams:{operation:'ac_extkey', sTargetClass:'{$this->sTargetClass}',sFilter:'$sFilter', json: function() { return $sWizHelperJSON; } }}); $('#label_$this->iId').blur(function() { $(this).search(); } ); $('#label_$this->iId').keyup(function() { if ($(this).val() == '') { $('#$this->iId').val(''); } } ); // Useful for search forms: empty value in the "label", means no value, immediatly ! $('#label_$this->iId').result( function(event, data, formatted) { OnAutoComplete('{$this->iId}', event, data, formatted); } ); diff --git a/application/uiwizard.class.inc.php b/application/uiwizard.class.inc.php index d1268f3f5..d9b12c8e6 100644 --- a/application/uiwizard.class.inc.php +++ b/application/uiwizard.class.inc.php @@ -53,7 +53,7 @@ class UIWizard { if ($iStepIndex == 1) // one big form that contains everything, to make sure that the uploaded files are posted too { - $this->m_oPage->add("
    \n"); + $this->m_oPage->add("\n"); } $this->m_oPage->add("
    \n"); $this->m_oPage->add("\n"); diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 02e835357..459c1b164 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1404,7 +1404,7 @@ class AttributeText extends AttributeString $sText = str_replace($aMatches[0], "$sClassLabel:$sName", $sText); // Later: propose a link to create a new object // Anyhow... there is no easy way to suggest default values based on the given FRIENDLY name - //$sText = preg_replace('/\[\[(.+):(.+)\]\]/', ''.$sName.'', $sText); + //$sText = preg_replace('/\[\[(.+):(.+)\]\]/', ''.$sName.'', $sText); } } } diff --git a/core/ormdocument.class.inc.php b/core/ormdocument.class.inc.php index ad23e6c05..d4f416180 100644 --- a/core/ormdocument.class.inc.php +++ b/core/ormdocument.class.inc.php @@ -105,7 +105,7 @@ class ormDocument */ public function GetDisplayLink($sClass, $Id, $sAttCode) { - return "".$this->GetFileName()."\n"; + return "".$this->GetFileName()."\n"; } /** @@ -114,7 +114,7 @@ class ormDocument */ public function GetDownloadLink($sClass, $Id, $sAttCode) { - return "".$this->GetFileName()."\n"; + return "".$this->GetFileName()."\n"; } } ?> diff --git a/js/utils.js b/js/utils.js index 5817e8abb..c732ec65e 100644 --- a/js/utils.js +++ b/js/utils.js @@ -21,7 +21,7 @@ function ReloadTruncatedList(divId, sSerializedFilter, sExtraParams) console.log('Uh,uh, exception !'); } } - aTruncatedLists[divId] = $.post('../pages/ajax.render.php?style=list', + aTruncatedLists[divId] = $.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?style=list', { operation: 'ajax', filter: sSerializedFilter, extra_params: sExtraParams }, function(data) { diff --git a/js/wizardhelper.js b/js/wizardhelper.js index ef37fc20f..57ca59093 100644 --- a/js/wizardhelper.js +++ b/js/wizardhelper.js @@ -156,7 +156,7 @@ function WizardHelper(sClass, sFormPrefix, sState) { //console.log('data sent:', this.ToJSON()); //console.log('oWizard:', this); - $('#'+divId).load('../pages/ajax.render.php?operation=wizard_helper_preview', + $('#'+divId).load(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?operation=wizard_helper_preview', {'json_obj': this.ToJSON()}, function(responseText, textStatus, XMLHttpRequest){ $('#wizStep'+ G_iCurrentStep).unblock( {fadeOut: 0} ); diff --git a/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php b/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php index 8cc578843..86319b3c1 100644 --- a/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php +++ b/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php @@ -1593,7 +1593,7 @@ require_once(APPROOT.'modules/itop-welcome-itil/model.itop-welcome-itil.php'); $oAdminMenu = new MenuGroup('DataAdministration', 70 /* fRank */, 'Organization', UR_ACTION_MODIFY, UR_ALLOWED_YES|UR_ALLOWED_DEPENDS); $iAdminGroup = $oAdminMenu->GetIndex(); -new WebPageMenuNode('Audit', '../pages/audit.php', $iAdminGroup, 33 /* fRank */); +new WebPageMenuNode('Audit', utils::GetAbsoluteUrlAppRoot().'pages/audit.php', $iAdminGroup, 33 /* fRank */); $oTypologyNode = new TemplateMenuNode('Catalogs', '', $iAdminGroup, 50 /* fRank */); $iTopology = $oTypologyNode->GetIndex(); @@ -1605,10 +1605,10 @@ new OQLMenuNode('DBServer', 'SELECT DBServer', $iTopology, 40 /* fRank */); $oConfigManagementGroup = new MenuGroup('ConfigManagement', 20 /* fRank */); // Create an entry, based on a custom template, for the Configuration management overview, under the top-level group -new TemplateMenuNode('ConfigManagementOverview', '../modules/itop-config-mgmt-1.0.0/overview.html', $oConfigManagementGroup->GetIndex(), 0 /* fRank */); +new TemplateMenuNode('ConfigManagementOverview', utils::GetAbsoluteUrlAppRoot().'modules/itop-config-mgmt-1.0.0/overview.html', $oConfigManagementGroup->GetIndex(), 0 /* fRank */); -$oContactNode = new TemplateMenuNode('Contact', '../modules/itop-config-mgmt-1.0.0/contacts_menu.html', $oConfigManagementGroup->GetIndex(), 1 /* fRank */); +$oContactNode = new TemplateMenuNode('Contact', utils::GetAbsoluteUrlAppRoot().'modules/itop-config-mgmt-1.0.0/contacts_menu.html', $oConfigManagementGroup->GetIndex(), 1 /* fRank */); new NewObjectMenuNode('NewContact', 'Contact', $oContactNode->GetIndex(), 1 /* fRank */); new SearchMenuNode('SearchContacts', 'Contact', $oContactNode->GetIndex(), 2 /* fRank */); @@ -1617,7 +1617,7 @@ new OQLMenuNode('Location', 'SELECT Location', $oConfigManagementGroup->GetIndex new OQLMenuNode('Group', 'SELECT Group', $oConfigManagementGroup->GetIndex(), 4 /* fRank */, true /* bSearch */); -$oCINode = new TemplateMenuNode('ConfigManagementCI', '../modules/itop-config-mgmt-1.0.0/cis_menu.html', $oConfigManagementGroup->GetIndex(), 5 /* fRank */); +$oCINode = new TemplateMenuNode('ConfigManagementCI', utils::GetAbsoluteUrlAppRoot().'modules/itop-config-mgmt-1.0.0/cis_menu.html', $oConfigManagementGroup->GetIndex(), 5 /* fRank */); new NewObjectMenuNode('NewCI', 'FunctionalCI', $oCINode->GetIndex(), 0 /* fRank */); new SearchMenuNode('SearchCIs', 'FunctionalCI', $oCINode->GetIndex(), 1 /* fRank */); diff --git a/modules/itop-welcome-itil/model.itop-welcome-itil.php b/modules/itop-welcome-itil/model.itop-welcome-itil.php index 89f85003c..923d6408e 100644 --- a/modules/itop-welcome-itil/model.itop-welcome-itil.php +++ b/modules/itop-welcome-itil/model.itop-welcome-itil.php @@ -45,7 +45,7 @@ class ItopWelcome extends ModuleHandlerAPI new TemplateMenuNode('WelcomeMenuPage', APPROOT.'modules/itop-welcome-itil/welcome_menu.html', $oWelcomeMenu->GetIndex() /* oParent */, 1 /* fRank */); $oToolsMenu = new MenuGroup('DataAdministration', 70 /* fRank */, 'Organization', UR_ACTION_MODIFY, UR_ALLOWED_YES|UR_ALLOWED_DEPENDS); - new WebPageMenuNode('CSVImportMenu', '../pages/csvimport.php', $oToolsMenu->GetIndex(), 1 /* fRank */); + new WebPageMenuNode('CSVImportMenu', utils::GetAbsoluteUrlAppRoot().'pages/csvimport.php', $oToolsMenu->GetIndex(), 1 /* fRank */); // Add the admin menus if (UserRights::IsAdministrator()) @@ -53,12 +53,12 @@ class ItopWelcome extends ModuleHandlerAPI $oAdminMenu = new MenuGroup('AdminTools', 80 /* fRank */); new OQLMenuNode('UserAccountsMenu', 'SELECT User', $oAdminMenu->GetIndex(), 1 /* fRank */); new OQLMenuNode('ProfilesMenu', 'SELECT URP_Profiles', $oAdminMenu->GetIndex(), 2 /* fRank */); - new TemplateMenuNode('NotificationsMenu', '../application/templates/notifications_menu.html', $oAdminMenu->GetIndex(), 3 /* fRank */); + new TemplateMenuNode('NotificationsMenu', utils::GetAbsoluteUrlAppRoot().'application/templates/notifications_menu.html', $oAdminMenu->GetIndex(), 3 /* fRank */); new OQLMenuNode('AuditCategories', 'SELECT AuditCategory', $oAdminMenu->GetIndex(), 4 /* fRank */); - new WebPageMenuNode('RunQueriesMenu', '../pages/run_query.php', $oAdminMenu->GetIndex(), 8 /* fRank */); - new WebPageMenuNode('ExportMenu', '../webservices/export.php', $oAdminMenu->GetIndex(), 9 /* fRank */); - new WebPageMenuNode('DataModelMenu', '../pages/schema.php', $oAdminMenu->GetIndex(), 10 /* fRank */); - new WebPageMenuNode('UniversalSearchMenu', '../pages/UniversalSearch.php', $oAdminMenu->GetIndex(), 11 /* fRank */); + new WebPageMenuNode('RunQueriesMenu', utils::GetAbsoluteUrlAppRoot().'pages/run_query.php', $oAdminMenu->GetIndex(), 8 /* fRank */); + new WebPageMenuNode('ExportMenu', utils::GetAbsoluteUrlAppRoot().'webservices/export.php', $oAdminMenu->GetIndex(), 9 /* fRank */); + new WebPageMenuNode('DataModelMenu', utils::GetAbsoluteUrlAppRoot().'pages/schema.php', $oAdminMenu->GetIndex(), 10 /* fRank */); + new WebPageMenuNode('UniversalSearchMenu', utils::GetAbsoluteUrlAppRoot().'pages/UniversalSearch.php', $oAdminMenu->GetIndex(), 11 /* fRank */); } } } diff --git a/pages/UI.php b/pages/UI.php index f7679b53a..a8f6ae36e 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1869,7 +1869,7 @@ EOF $oP->SetCurrentTab(Dict::S('UI:RelationshipGraph')); $width = 1000; $height = 700; - $sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode('../pages/UI.php?operation=details')."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation"; + $sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode(utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=details')."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation"; $oP->add(" diff --git a/pages/UniversalSearch.php b/pages/UniversalSearch.php index 12baa07ba..906da7b3e 100644 --- a/pages/UniversalSearch.php +++ b/pages/UniversalSearch.php @@ -105,7 +105,7 @@ if ($oFilter != null) $aExtraParams = $oAppContext->GetAsHash(); $aExtraParams['open'] = true; $aExtraParams['baseClass'] = $sBaseClass; - $aExtraParams['action'] = '../pages/UniversalSearch.php'; + $aExtraParams['action'] = utils::GetAbsoluteUrlAppRoot().'pages/UniversalSearch.php'; //$aExtraParams['class'] = $sClassName; $oBlock->Display($oP, 0, $aExtraParams); diff --git a/pages/ajax.csvimport.php b/pages/ajax.csvimport.php index d9202b725..2d68fb2ab 100644 --- a/pages/ajax.csvimport.php +++ b/pages/ajax.csvimport.php @@ -403,7 +403,7 @@ EOF { $oPage = new ajax_page(""); $oPage->no_cache(); - $oPage->add('


    '.$sClassDisplayName.'.csv

    '); + $oPage->add('


    '.$sClassDisplayName.'.csv

    '); $oPage->add('

    '); } break; diff --git a/pages/navigator.php b/pages/navigator.php index a3530ff94..6eed9cae1 100755 --- a/pages/navigator.php +++ b/pages/navigator.php @@ -40,7 +40,7 @@ try { $width = 1000; $height = 700; - $sDrillUrl = urlencode('../pages/UI.php?operation=details'); + $sDrillUrl = urlencode(utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=details'); // $sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode('../pages/UI.php?operation=details')."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation"; // $oP->add(" diff --git a/pages/opensearch.xml.php b/pages/opensearch.xml.php index c07ee594f..49c043fec 100644 --- a/pages/opensearch.xml.php +++ b/pages/opensearch.xml.php @@ -22,11 +22,15 @@ * @author Denis Flaven * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL */ +require_once('../approot.inc.php'); +require_once(APPROOT.'/application/application.inc.php'); +require_once(APPROOT.'/application/startup.inc.php'); - $sFullUrl = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/UI.php'; - $sICOFullUrl = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.ico'; - $sPNGFullUrl = 'http'.((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../images/iTop-icon.png'; - header('Content-type: text/xml'); + +$sFullUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php'; +$sICOFullUrl = utils::GetAbsoluteUrlAppRoot().'/images/iTop-icon.ico'; +$sPNGFullUrl = utils::GetAbsoluteUrlAppRoot().'images/iTop-icon.png'; +header('Content-type: text/xml'); ?> iTop diff --git a/pages/schema.php b/pages/schema.php index 9193a7e6a..449337940 100644 --- a/pages/schema.php +++ b/pages/schema.php @@ -194,7 +194,7 @@ function DisplayLifecycle($oPage, $sClass) { $aStates = MetaModel::EnumStates($sClass); $aStimuli = MetaModel::EnumStimuli($sClass); - $oPage->add("\n"); + $oPage->add("\n"); $oPage->add("

    ".Dict::S('UI:Schema:LifeCycleTransitions')."

    \n"); $oPage->add("
      \n"); foreach ($aStates as $sStateCode => $aStateDef) diff --git a/test/benchmark.php b/test/benchmark.php index 1d122763a..fdcee00e4 100644 --- a/test/benchmark.php +++ b/test/benchmark.php @@ -689,7 +689,7 @@ class BenchmarkDataCreation foreach($this->m_aCreatedByClass as $sClass => $aClassIds) { $iSample = reset($aClassIds); - $sSample = "sample"; + $sSample = "sample"; $iDuration = number_format(array_sum($this->m_aStatsByClass[$sClass]), 3); $fDurationMin = number_format(min($this->m_aStatsByClass[$sClass]), 3);