Fixed absolute/relative path issues in the JS and href places

SVN:trunk[1763]
This commit is contained in:
Denis Flaven
2012-01-12 16:58:26 +00:00
parent 87bf09995d
commit 780fb6dc27
11 changed files with 57 additions and 41 deletions

View File

@@ -660,7 +660,7 @@ function LicenceAcknowledgement($oP, $aParamValues, $iCurrentStep)
$oP->set_title('License agreement');
$oP->add('<h2>iTop is released by <a href="http://www.combodo.com" target="_blank">Combodo SARL</a> under the terms of the GPL V3 license. In order to use iTop you must accept the terms of this license.</h2>');
$oP->add("<iframe style=\"width: 100%; height: 350px; overflow-y:auto; font-size:0.8em;\" src=\"./licence.html\">Next: Database server selection</iframe>\n");
$oP->add("<iframe style=\"width: 100%; height: 350px; overflow-y:auto; font-size:0.8em;\" src=\"../setup/licence.html\">Next: Database server selection</iframe>\n");
$oP->add("<form id=\"theForm\" method=\"post\">\n");
AddParamsToForm($oP, $aParamValues, array('licence_ok'));
@@ -1151,6 +1151,7 @@ function DisplaySummary(SetupPage $oP, $aParamValues, $iCurrentStep, Config $oCo
}
}
$oP->set_title('Installation Summary');
$oP->SetRootUrl($aParamValues['application_path']);
$oP->add("<h3>iTop version ".$aAvailableModules[ROOT_MODULE]['version_code']." will be installed.</h3>");
$oP->add('<div id="summary_content" style="height:350px;overflow-y:auto;border:1px solid #999;padding-left:1em;">');
@@ -1325,7 +1326,7 @@ function DisplaySummary(SetupPage $oP, $aParamValues, $iCurrentStep, Config $oCo
$oP->add("</form>\n");
$oP->add("<div id=\"log\" style=\"color:#F00;\"></div>\n");
$oP->add_linked_script('./jquery.progression.js');
$oP->add_linked_script('../setup/jquery.progression.js');
PopulateDataFilesList($oP, $aParamValues, $oConfig);
$oP->add_ready_script(
<<<EOF

View File

@@ -163,7 +163,7 @@ function DoCompileDataModel()
{
$('#log').html('');
$('#setup').block({message: '<p><span id="setup_msg">Preparing data model...</span><br/><div id=\"progress\">0%</div></p>'});
$('#progress').progression( {Current:5, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000'} );
$('#progress').progression( {Current:5, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000'} );
var sSelectedModules = GetSelectedModules();
var sMode = $(':input[name=mode]').val();
@@ -171,7 +171,7 @@ function DoCompileDataModel()
var sTargetDir = $(':input[name=target_dir]').val();
// Call the asynchronous page that performs the compilation of the data model and the creation of the configuration file
AsyncCompileDataModel(sSelectedModules, sMode, sSourceDir, sTargetDir, function(response, status, xhr) {
AsyncCompileDataModel(sSelectedModules, sMode, sSourceDir, sTargetDir, '', function(response, status, xhr) {
$('#log').html(response);
DoUpdateDBSchema();
});
@@ -181,7 +181,7 @@ function DoUpdateDBSchema()
{
$('#log').html('');
$('#setup').block({message: '<p><span id="setup_msg">Updating DB schema...</span><br/><div id=\"progress\">5%</div></p>'});
$('#progress').progression( {Current:10, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000'} );
$('#progress').progression( {Current:10, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000'} );
var sSelectedModules = GetSelectedModules();
var sMode = $(':input[name=mode]').val();
@@ -204,7 +204,7 @@ function DoUpdateProfiles()
{
$('#log').html('');
$('#setup_msg').text('Updating Profiles...');
$('#progress').progression( {Current:40, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000'} );
$('#progress').progression( {Current:40, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000'} );
var sSelectedModules = GetSelectedModules();
var sMode = $(':input[name=mode]').val();
@@ -249,7 +249,7 @@ function DoLoadDataAsynchronous(response, status, xhr)
{
$('#log').html('');
$('#setup_msg').text('Loading data...');
$('#progress').progression( {Current: 60, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000'} );
$('#progress').progression( {Current: 60, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000'} );
// $('#log').ajaxError(
// function(e, xhr, settings, exception)
// {
@@ -297,9 +297,9 @@ function LoadNextDataFile(response, status, xhr)
iPercent = 60+Math.round((40.0 * (1+iCounter)) / aFilesToLoad.length);
sFileName = aFilesToLoad[iCounter];
//alert('Loading file '+sFileName+' ('+iPercent+' %) - '+sSessionStatus);
$("#progress").progression({ Current: iPercent, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000' });
$("#progress").progression({ Current: iPercent, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000' });
iCounter++;
$('#log').load( 'ajax.dataloader.php',
$('#log').load( GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php',
{
'selected_modules': GetSelectedModules(),
'db_server': $(':input[name=db_server]').val(),
@@ -319,7 +319,7 @@ function LoadNextDataFile(response, status, xhr)
else
{
// We're done
$("#progress").progression({ Current: 100, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000' });
$("#progress").progression({ Current: 100, Maximum: 100, aBackgroundImg: GetAbsoluteUrlAppRoot()+'setup/orange-progress.gif', aTextColor: '#000000' });
//$('#setup').unblock();
$('#GoToNextStep').submit(); // Use the hidden form to navigate to the next step
}

View File

@@ -7,17 +7,18 @@
* @param string sTargetDir The target directory (is created if needed) for compiled modules
* @return void
*/
function AsyncCompileDataModel(sSelectedModules, sMode, sSourceDir, sTargetDir, OnCompleteFn)
function AsyncCompileDataModel(sSelectedModules, sMode, sSourceDir, sTargetDir, sWorkspaceDir, OnCompleteFn)
{
try
{
$.post( 'ajax.dataloader.php',
$.post( GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php',
{
'operation': 'compile_data_model',
'selected_modules': sSelectedModules,
'mode': sMode,
'source_dir': sSourceDir,
'target_dir': sTargetDir
'target_dir': sTargetDir,
'workspace_dir': sWorkspaceDir
},
OnCompleteFn, 'html');
}
@@ -45,7 +46,7 @@ function AsyncUpdateDBSchema(sSelectedModules, sMode, sModulesDir, sDBServer, sD
{
try
{
$.post( 'ajax.dataloader.php',
$.post( GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php',
{
'operation': 'update_db_schema',
'selected_modules': sSelectedModules,
@@ -86,7 +87,7 @@ function AsyncUpdateProfiles(sSelectedModules, sMode, sModulesDir, sDBServer, sD
{
try
{
$.post( 'ajax.dataloader.php',
$.post( GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php',
{
'operation': 'after_db_create',
'selected_modules': sSelectedModules,

View File

@@ -40,8 +40,8 @@ class SetupPage extends NiceWebPage
{
parent::__construct($sTitle);
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script("./setup.js");
$this->add_linked_script("./setup_environment.js");
$this->add_linked_script("../setup/setup.js");
$this->add_linked_script("../setup/setup_environment.js");
$this->add_style("
body {
background-color: #eee;
@@ -425,7 +425,7 @@ function InitDataModel($oConfig, $bModelOnly = true, $bUseCache = false)
SetupPage::log_info("MetaModel::Startup (ModelOnly = $bModelOnly)");
}
if ($bUseCache)
if (!$bUseCache)
{
// Reset the cache for the first use !
MetaModel::ResetCache($oConfig);