mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
N°2060 [WIP] Initialisation of the portal application: Huge code cleanup
- Rename variables and methods in iTop files to match coding conventions - Format code accordingly to coding conventions - Add / update PHPDoc all over the place - Suppress most of the warnings that did not have a big impact on code's logic
This commit is contained in:
@@ -1,21 +1,24 @@
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2010-2017 Combodo SARL
|
||||
//
|
||||
// This file is part of iTop.
|
||||
//
|
||||
// iTop is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// iTop is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||
/**
|
||||
* Copyright (C) 2013-2019 Combodo SARL
|
||||
*
|
||||
* This file is part of iTop.
|
||||
*
|
||||
* iTop is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* iTop is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Backward Compatibility file for default portal.
|
||||
@@ -37,15 +40,15 @@
|
||||
);
|
||||
|
||||
// Load current environment
|
||||
if (file_exists(__DIR__ . '/../../approot.inc.php'))
|
||||
if (file_exists(__DIR__.'/../../approot.inc.php'))
|
||||
{
|
||||
require_once __DIR__ . '/../../approot.inc.php'; // When in env-xxxx folder
|
||||
require_once __DIR__.'/../../approot.inc.php'; // When in env-xxxx folder
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once __DIR__ . '/../../../approot.inc.php'; // When in datamodels/x.x folder
|
||||
require_once __DIR__.'/../../../approot.inc.php'; // When in datamodels/x.x folder
|
||||
}
|
||||
require_once APPROOT . 'application/startup.inc.php';
|
||||
require_once APPROOT.'application/startup.inc.php';
|
||||
|
||||
// Protection against setup in the following configuration : ITIL Ticket with Enhanced Portal selected but neither UserRequest or Incident. Which would crash the portal.
|
||||
if (!class_exists('UserRequest') && !class_exists('Incident'))
|
||||
@@ -58,4 +61,4 @@ $sDir = basename(__DIR__);
|
||||
define('PORTAL_ID', $sDir);
|
||||
|
||||
// Load frontal
|
||||
require_once MODULESROOT . 'itop-portal-base/index.php';
|
||||
require_once MODULESROOT.'itop-portal-base/index.php';
|
||||
|
||||
@@ -25,14 +25,14 @@ require_once APPROOT.'/lib/composer-vendor/autoload.php';
|
||||
|
||||
/**
|
||||
* iTopPortalEditUrlMaker
|
||||
*
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @author Bruno Da Silva <bruno.dasilva@combodo.com>
|
||||
* @since 2.3.0
|
||||
* @since 2.3.0
|
||||
*/
|
||||
class iTopPortalEditUrlMaker extends AbstractPortalUrlMaker
|
||||
{
|
||||
/** @var string PORTAL_ID */
|
||||
/** @var string PORTAL_ID */
|
||||
const PORTAL_ID = 'itop-portal';
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class iTopPortalEditUrlMaker extends AbstractPortalUrlMaker
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @author Bruno Da Silva <bruno.dasilva@combodo.com>
|
||||
* @since 2.3.0
|
||||
* @since 2.3.0
|
||||
*/
|
||||
class iTopPortalViewUrlMaker extends iTopPortalEditUrlMaker
|
||||
{
|
||||
@@ -52,7 +52,7 @@ class iTopPortalViewUrlMaker extends iTopPortalEditUrlMaker
|
||||
{
|
||||
return static::PrepareObjectURL($sClass, $iId, 'view');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Default portal hyperlink (for notifications) is the edit hyperlink
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'itop-portal/2.7.0', array(
|
||||
|
||||
Reference in New Issue
Block a user