mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
De-hardcoded against the subdirectory "modules" (excepted the data model sources files)
SVN:trunk[1779]
This commit is contained in:
@@ -542,12 +542,17 @@ EOF
|
||||
public function output()
|
||||
{
|
||||
$sAbsURLAppRoot = addslashes($this->m_sRootUrl);
|
||||
$sAbsURLModulesRoot = addslashes(utils::GetAbsoluteUrlModulesRoot());
|
||||
$this->add_script(
|
||||
<<<EOF
|
||||
function GetAbsoluteUrlAppRoot()
|
||||
{
|
||||
return '$sAbsURLAppRoot';
|
||||
}
|
||||
function GetAbsoluteUrlModulesRoot()
|
||||
{
|
||||
return '$sAbsURLModulesRoot';
|
||||
}
|
||||
EOF
|
||||
);
|
||||
$this->set_base($this->m_sRootUrl.'pages/');
|
||||
|
||||
@@ -60,6 +60,7 @@ class PortalWebPage extends NiceWebPage
|
||||
$this->add_linked_stylesheet("../css/jquery.treeview.css");
|
||||
$this->add_linked_stylesheet("../css/jquery.autocomplete.css");
|
||||
$sAbsURLAppRoot = addslashes(utils::GetAbsoluteUrlAppRoot()); // Pass it to Javascript scripts
|
||||
$sAbsURLModulesRoot = addslashes(utils::GetAbsoluteUrlModulesRoot()); // Pass it to Javascript scripts
|
||||
$oAppContext = new ApplicationContext();
|
||||
$sAppContext = addslashes($oAppContext->GetForLink());
|
||||
if ($sAlternateStyleSheet != '')
|
||||
@@ -172,6 +173,11 @@ EOF
|
||||
return '$sAbsURLAppRoot';
|
||||
}
|
||||
|
||||
function GetAbsoluteUrlModulesRoot()
|
||||
{
|
||||
return '$sAbsURLModulesRoot';
|
||||
}
|
||||
|
||||
function AddAppContext(sURL)
|
||||
{
|
||||
var sContext = '$sAppContext';
|
||||
|
||||
@@ -460,10 +460,8 @@ class utils
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute URL to the server's root path
|
||||
* @param $sCurrentRelativePath string NO MORE USED, kept for backward compatibility only !
|
||||
* @param $bForceHTTPS bool True to force HTTPS, false otherwise
|
||||
* @return string The absolute URL to the server's root, without the first slash
|
||||
* Returns the absolute URL to the application root path
|
||||
* @return string The absolute URL to the application root, without the first slash
|
||||
*/
|
||||
static public function GetAbsoluteUrlAppRoot()
|
||||
{
|
||||
@@ -757,5 +755,14 @@ class utils
|
||||
return APPCONF.self::GetCurrentEnvironment().'/'.ITOP_CONFIG_FILE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute URL to the modules root path
|
||||
* @return string ...
|
||||
*/
|
||||
static public function GetAbsoluteUrlModulesRoot()
|
||||
{
|
||||
$sUrl = self::GetAbsoluteUrlAppRoot().'env-'.self::GetCurrentEnvironment().'/';
|
||||
return $sUrl;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -738,10 +738,6 @@ abstract class MetaModel
|
||||
final static public function GetAttributeDef($sClass, $sAttCode)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
if (!array_key_exists($sAttCode, self::$m_aAttribDefs[$sClass]))
|
||||
{
|
||||
echo "<p>$sAttCode is NOT a valid attribute of class $sClass.</p>";
|
||||
}
|
||||
return self::$m_aAttribDefs[$sClass][$sAttCode];
|
||||
}
|
||||
|
||||
@@ -4033,6 +4029,8 @@ if (!array_key_exists($sAttCode, self::$m_aAttribDefs[$sClass]))
|
||||
|
||||
public static function Startup($config, $bModelOnly = false, $bAllowCache = true, $bTraceSourceFiles = false)
|
||||
{
|
||||
define('MODULESROOT', APPROOT.'env-'.utils::GetCurrentEnvironment().'/');
|
||||
|
||||
self::$m_bTraceSourceFiles = $bTraceSourceFiles;
|
||||
|
||||
// $config can be either a filename, or a Configuration object (volatile!)
|
||||
@@ -4615,6 +4613,10 @@ if (!array_key_exists($sAttCode, self::$m_aAttribDefs[$sClass]))
|
||||
*/
|
||||
static public function ApplyParams($aInput, $aParams)
|
||||
{
|
||||
// Declare magic parameters
|
||||
$aParams['APP_URL'] = utils::GetAbsoluteUrlAppRoot();
|
||||
$aParams['MODULES_URL'] = utils::GetAbsoluteUrlModulesRoot();
|
||||
|
||||
$aSearches = array();
|
||||
$aReplacements = array();
|
||||
foreach($aParams as $sSearch => $replace)
|
||||
|
||||
@@ -238,7 +238,7 @@ EOF
|
||||
{
|
||||
$sIsDeleteEnabled = $this->m_bDeleteEnabled ? 'true' : 'false';
|
||||
$iTransactionId = $oPage->GetTransactionId();
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'modules/itop-attachments/ajaxfileupload.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlModulesRoot().'itop-attachments/ajaxfileupload.js');
|
||||
$sClass = get_class($oObject);
|
||||
$sTempId = session_id().'_'.$iTransactionId;
|
||||
$sDeleteBtn = Dict::S('Attachments:DeleteBtn');
|
||||
@@ -273,7 +273,7 @@ EOF
|
||||
$.ajaxFileUpload
|
||||
(
|
||||
{
|
||||
url: GetAbsoluteUrlAppRoot()+'modules/itop-attachments/ajax.attachment.php?obj_class={$sClass}&temp_id={$sTempId}&operation=add',
|
||||
url: GetAbsoluteUrlModulesRoot()+'itop-attachments/ajax.attachment.php?obj_class={$sClass}&temp_id={$sTempId}&operation=add',
|
||||
secureuri:false,
|
||||
fileElementId:'file',
|
||||
dataType: 'json',
|
||||
@@ -496,7 +496,7 @@ EOF
|
||||
break;
|
||||
}
|
||||
|
||||
return "modules/itop-attachments/icons/$sIcon";
|
||||
return utils::GetAbsoluteUrlModulesRoot()."itop-attachments/icons/$sIcon";
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -91,7 +91,7 @@ a.summary:hover {
|
||||
<div id="menu_1" class="main_container v-resizable">
|
||||
|
||||
<div class="main_header drag_handle" id="config_devices">
|
||||
<img src="../modules/itop-config-mgmt-1.0.0/images/server.png"/>
|
||||
<img src="$MODULES_URL$itop-config-mgmt-1.0.0/images/server.png"/>
|
||||
<itopblock BlockClass="DisplayBlock" type="summary" asynchronous="false" encoding="text/oql" parameters="title[block]:Menu_ConfigManagement_Devices;context_filter:1;label[block]:Menu_ConfigManagement_AllDevices;status[block]:status;status_codes[block]:implementation,production,obsolete">SELECT Device</itopblock>
|
||||
</div><!-- Drag Handle -->
|
||||
|
||||
@@ -125,7 +125,7 @@ a.summary:hover {
|
||||
<div id="menu_2" class="main_container v-resizable">
|
||||
|
||||
<div class="main_header drag_handle" id="config_applications">
|
||||
<img src="../modules/itop-config-mgmt-1.0.0/images/application.png"/>
|
||||
<img src="$MODULES_URL$itop-config-mgmt-1.0.0/images/application.png"/>
|
||||
<h1><itopstring>Menu:ConfigManagement:SWAndApps</itopstring></h1>
|
||||
</div><!-- Drag Handle -->
|
||||
|
||||
@@ -158,7 +158,7 @@ a.summary:hover {
|
||||
<div id="menu_3" class="main_container v-resizable">
|
||||
|
||||
<div class="main_header drag_handle" id="cfg_misc">
|
||||
<img src="../modules/itop-config-mgmt-1.0.0/images/subnet.png"/>
|
||||
<img src="$MODULES_URL$itop-config-mgmt-1.0.0/images/subnet.png"/>
|
||||
<h1><itopstring>Menu:ConfigManagement:Misc</itopstring></h1>
|
||||
</div><!-- drag handle -->
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ a.summary:hover {
|
||||
<div id="menu_1" class="main_container">
|
||||
|
||||
<div class="main_header drag_handle" id="config_devices">
|
||||
<img src="../modules/itop-config-mgmt-1.0.0/images/team.png"/>
|
||||
<img src="$MODULES_URL$itop-config-mgmt-1.0.0/images/team.png"/>
|
||||
<itopblock BlockClass="DisplayBlock" type="summary" asynchronous="false" encoding="text/oql" parameters="title[block]:Menu_Contact;context_filter:1;label[block]:Menu_ConfigManagement_AllContacts;status[block]:status;status_codes[block]:active,inactive">SELECT Contact</itopblock>
|
||||
</div><!-- Drag Handle -->
|
||||
|
||||
|
||||
@@ -17,14 +17,6 @@
|
||||
MetaModel::RegisterRelation("impacts", array("description"=>"Objects impacted by", "verb_down"=>"impacts", "verb_up"=>"depends on"));
|
||||
MetaModel::RegisterRelation("depends on", array("description"=>"That impacts ", "verb_down"=>"depends on", "verb_up"=>"impacts"));
|
||||
|
||||
// Note (RQ) :
|
||||
// After 1.0.1, the welcome page and menus have been removed from the application
|
||||
// and put into a separate module "itop-welcome-itil"
|
||||
// Until we develop a migration utility, and as would like to preserve the
|
||||
// capability to upgrade iTop without any manual operation, we have decided to
|
||||
// implement this dirty workaround that makes it...
|
||||
//////////////require_once(APPROOT.'modules/itop-welcome-itil/model.itop-welcome-itil.php');
|
||||
|
||||
// Starting with iTop 1.2 you can restrict the list of organizations displayed in the drop-down list
|
||||
// by specifying a query as shown below. Note that this is NOT a security settings, since the
|
||||
// choice 'All Organizations' will always be available in the menu
|
||||
|
||||
@@ -90,7 +90,7 @@ a.summary:hover {
|
||||
|
||||
<div class="main_header drag_handle" id="main_cfg">
|
||||
|
||||
<img src="../modules/itop-config-mgmt-1.0.0/images/database.png"/>
|
||||
<img src="$MODULES_URL$itop-config-mgmt-1.0.0/images/database.png"/>
|
||||
<itopblock BlockClass="DisplayBlock" type="summary" asynchronous="false" encoding="text/oql" parameters="title[block]:Menu_ConfigManagement;context_filter:1;label[block]:UI_WelcomeMenu_AllConfigItems;status[block]:status;status_codes[block]:implementation,production,obsolete">SELECT FunctionalCI</itopblock>
|
||||
|
||||
</div>
|
||||
@@ -141,7 +141,7 @@ a.summary:hover {
|
||||
<div id="menu_2" class="main_container v-resizable">
|
||||
|
||||
<div class="main_header drag_handle" id="main_helpdesk">
|
||||
<img src="../modules/itop-request-mgmt-1.0.0/images/user-request-deadline.png"/>
|
||||
<img src="$MODULES_URL$itop-request-mgmt-1.0.0/images/user-request-deadline.png"/>
|
||||
<itopblock BlockClass="DisplayBlock" type="summary" asynchronous="false" encoding="text/oql" parameters="title[block]:Menu_RequestManagement;context_filter:1;label[block]:UI_WelcomeMenu_AllOpenRequests;status[block]:status;status_codes[block]:new,assigned,escalated_tto,escalated_ttr,resolved">SELECT UserRequest WHERE status != "closed"</itopblock>
|
||||
</div>
|
||||
|
||||
@@ -159,7 +159,7 @@ a.summary:hover {
|
||||
<div id="menu_3" class="main_container v-resizable">
|
||||
|
||||
<div class="main_header drag_handle" id="main_incident">
|
||||
<img src="../modules/itop-incident-mgmt-1.0.0/images/incident-escalated.png"/>
|
||||
<img src="$MODULES_URL$itop-incident-mgmt-1.0.0/images/incident-escalated.png"/>
|
||||
<itopblock BlockClass="DisplayBlock" type="summary" asynchronous="false" encoding="text/oql" parameters="title[block]:Menu_IncidentManagement;context_filter:1;label[block]:UI_WelcomeMenu_OpenIncidents;status[block]:status;status_codes[block]:new,assigned,escalated_tto,escalated_ttr,resolved">SELECT Incident WHERE status != "closed"</itopblock>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user