N°1024 Portal: New portal instances can now be XML only (through ITSM Designer), no more need for a dedicated module !

SVN:trunk[4900]
This commit is contained in:
Guillaume Lajarige
2017-09-07 16:03:55 +00:00
parent 6f474686ad
commit d6707743a9
6 changed files with 89 additions and 13 deletions

View File

@@ -3,7 +3,7 @@
<portals>
<portal id="legacy_portal" _delta="delete" /> <!-- TODO: voir si opportun de renommer au lieu de delete+define -->
<portal id="itop-portal" _delta="define"><!-- ID must match module_design[id] -->
<url>pages/exec.php?exec_module=itop-portal&amp;exec_page=index.php</url><!-- exec_module must match module_design[id] -->
<url>pages/exec.php?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal</url><!-- portal_id must match module_design[id] -->
<rank>1.0</rank>
<handler />
<allow>

View File

@@ -1,6 +1,6 @@
<?php
// Copyright (C) 2016 Combodo SARL
// Copyright (C) 2010-2017 Combodo SARL
//
// This file is part of iTop.
//
@@ -17,6 +17,18 @@
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* Backward Compatibility file for default portal.
* Needed when:
* - PortalDispatcher uses the old url "pages/exec.php?exec_module=itop-portal&amp;exec_page=index.php"
* - Portal xml has no //properties/urlmaker_class tag
* - Checks are necessary (eg. UserRequest/Incident class detection)
*
* NOT needed when:
* - PortalDispatcher uses the new url "pages/exec.php?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal"
* - Portal xml has a //properties/urlmaker_class tag (or doesn't need to register a UrlMakerClass)
*/
if (file_exists(__DIR__ . '/../../approot.inc.php'))
{
require_once __DIR__ . '/../../approot.inc.php'; // When in env-xxxx folder
@@ -33,9 +45,9 @@ if (!class_exists('UserRequest') && !class_exists('Incident'))
die('iTop has neither been installed with User Request nor Incident tickets. Please contact your administrator.');
}
// Defining portal constants
$sDir = basename(__DIR__);
define('PORTAL_MODULE_ID', $sDir);
define('PORTAL_ID', $sDir);
ApplicationContext::SetUrlMakerClass('iTopPortalViewUrlMaker');
require_once APPROOT . '/env-' . utils::GetCurrentEnvironment() . '/itop-portal-base/portal/web/index.php';
require_once APPROOT . '/env-' . utils::GetCurrentEnvironment() . '/itop-portal-base/index.php';