mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°8796 - Add PHP code style validation in iTop and extensions - format whole code base
This commit is contained in:
@@ -30,12 +30,12 @@ class ModuleFileReaderTest extends ItopDataTestCase
|
||||
|
||||
public static function ReadModuleFileConfigurationFileNameProvider()
|
||||
{
|
||||
$aUsecases=[];
|
||||
foreach (glob(__DIR__.'/resources/*.php') as $sModuleFilePath){
|
||||
if (false !== strpos($sModuleFilePath, "module.__MODULE__.php")){
|
||||
$aUsecases = [];
|
||||
foreach (glob(__DIR__.'/resources/*.php') as $sModuleFilePath) {
|
||||
if (false !== strpos($sModuleFilePath, "module.__MODULE__.php")) {
|
||||
continue;
|
||||
}
|
||||
$aUsecases[basename($sModuleFilePath)]=[$sModuleFilePath];
|
||||
$aUsecases[basename($sModuleFilePath)] = [$sModuleFilePath];
|
||||
}
|
||||
|
||||
return $aUsecases;
|
||||
@@ -46,8 +46,8 @@ class ModuleFileReaderTest extends ItopDataTestCase
|
||||
*/
|
||||
public function testReadModuleFileConfigurationVsLegacyMethod(string $sModuleFilePath)
|
||||
{
|
||||
$_SERVER=[
|
||||
'SERVER_NAME' => 'titi'
|
||||
$_SERVER = [
|
||||
'SERVER_NAME' => 'titi',
|
||||
];
|
||||
|
||||
$aRes = ModuleFileReader::GetInstance()->ReadModuleFileInformation($sModuleFilePath);
|
||||
@@ -75,8 +75,7 @@ class ModuleFileReaderTest extends ItopDataTestCase
|
||||
file_put_contents($this->sTempModuleFilePath, $sPHpCode);
|
||||
try {
|
||||
return ModuleFileReader::GetInstance()->ReadModuleFileInformation($this->sTempModuleFilePath);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
@unlink($this->sTempModuleFilePath);
|
||||
}
|
||||
}
|
||||
@@ -198,7 +197,7 @@ PHP;
|
||||
|
||||
public function testGetAndCheckModuleInstallerClass()
|
||||
{
|
||||
$sModuleInstallerClass = "TicketsInstaller" . uniqid();
|
||||
$sModuleInstallerClass = "TicketsInstaller".uniqid();
|
||||
$sPHpCode = file_get_contents(__DIR__.'/resources/module.itop-tickets.php');
|
||||
$sPHpCode = str_replace("TicketsInstaller", $sModuleInstallerClass, $sPHpCode);
|
||||
$this->sTempModuleFilePath = tempnam(__DIR__, "test");
|
||||
@@ -211,11 +210,10 @@ PHP;
|
||||
$this->assertFalse(class_exists($sModuleInstallerClass));
|
||||
|
||||
$this->assertEquals($sModuleInstallerClass, ModuleFileReader::GetInstance()->GetAndCheckModuleInstallerClass($aModuleInfo[2]));
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
@unlink($this->sTempModuleFilePath);
|
||||
}
|
||||
|
||||
$this->assertTrue(class_exists($sModuleInstallerClass));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,80 +1,78 @@
|
||||
<?php
|
||||
|
||||
|
||||
// Until we develop a mean to adress this within the setup, let's check that this instance
|
||||
// of PHP has the php_ldap extension
|
||||
//
|
||||
if (function_exists('ldap_connect'))
|
||||
{
|
||||
if (function_exists('ldap_connect')) {
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'authent-ldap/3.3.0',
|
||||
array(
|
||||
// Identification
|
||||
//
|
||||
'label' => 'User authentication based on LDAP',
|
||||
'category' => 'authentication',
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'authent-ldap/3.3.0',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'User authentication based on LDAP',
|
||||
'category' => 'authentication',
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
),
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
'installer' => 'AuthentLDAPInstaller',
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => [
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
'installer' => 'AuthentLDAPInstaller',
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
),
|
||||
'data.struct' => array(
|
||||
//'data.struct.authent-ldap.xml',
|
||||
),
|
||||
'data.sample' => array(
|
||||
//'data.sample.authent-ldap.xml',
|
||||
),
|
||||
// Components
|
||||
//
|
||||
'datamodel' => [
|
||||
],
|
||||
'data.struct' => [
|
||||
//'data.struct.authent-ldap.xml',
|
||||
],
|
||||
'data.sample' => [
|
||||
//'data.sample.authent-ldap.xml',
|
||||
],
|
||||
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '',
|
||||
'doc.more_information' => '',
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '',
|
||||
'doc.more_information' => '',
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
'uri' => 'ldap://localhost', // URI with host or IP address of your LDAP server
|
||||
'default_user' => '', // User and password used for initial "Anonymous" bind to LDAP
|
||||
'default_pwd' => '', // Leave both blank, if anonymous (read-only) bind is allowed
|
||||
'base_dn' => 'dc=yourcompany,dc=com', // Base DN for User queries, adjust it to your LDAP schema
|
||||
'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', // Query used to retrieve each user %1$s => iTop login
|
||||
// For Windows AD use (samaccountname=%1$s) or (userprincipalname=%1$s)
|
||||
// Default settings
|
||||
//
|
||||
'settings' => [
|
||||
'uri' => 'ldap://localhost', // URI with host or IP address of your LDAP server
|
||||
'default_user' => '', // User and password used for initial "Anonymous" bind to LDAP
|
||||
'default_pwd' => '', // Leave both blank, if anonymous (read-only) bind is allowed
|
||||
'base_dn' => 'dc=yourcompany,dc=com', // Base DN for User queries, adjust it to your LDAP schema
|
||||
'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', // Query used to retrieve each user %1$s => iTop login
|
||||
// For Windows AD use (samaccountname=%1$s) or (userprincipalname=%1$s)
|
||||
|
||||
// Some extra LDAP options, refer to: http://www.php.net/manual/en/function.ldap-set-option.php for more info
|
||||
'options' => array(
|
||||
LDAP_OPT_PROTOCOL_VERSION => 3,
|
||||
LDAP_OPT_REFERRALS => 0,
|
||||
),
|
||||
'start_tls' => false,
|
||||
'debug' => false,
|
||||
'servers' => array(),
|
||||
),
|
||||
)
|
||||
);
|
||||
// Some extra LDAP options, refer to: http://www.php.net/manual/en/function.ldap-set-option.php for more info
|
||||
'options' => [
|
||||
LDAP_OPT_PROTOCOL_VERSION => 3,
|
||||
LDAP_OPT_REFERRALS => 0,
|
||||
],
|
||||
'start_tls' => false,
|
||||
'debug' => false,
|
||||
'servers' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Module installation handler
|
||||
//
|
||||
class AuthentLDAPInstaller extends ModuleInstallerAPI
|
||||
{
|
||||
public static function AfterDataLoad(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
|
||||
// Module installation handler
|
||||
//
|
||||
class AuthentLDAPInstaller extends ModuleInstallerAPI
|
||||
{
|
||||
public static function AfterDataLoad(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function BeforeWritingConfig(Config $oConfiguration)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static function BeforeWritingConfig(Config $oConfiguration)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} // if (function_exists('ldap_connect'))
|
||||
|
||||
@@ -3,32 +3,32 @@
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'combodo-email-synchro/3.8.2',
|
||||
array(
|
||||
[
|
||||
// Identification
|
||||
'label' => 'Tickets synchronization via e-mail',
|
||||
'category' => 'business',
|
||||
// Setup
|
||||
'dependencies' => array(
|
||||
'itop-profiles-itil/3.0.0',
|
||||
),
|
||||
'dependencies' => [
|
||||
'itop-profiles-itil/3.0.0',
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
'installer' => 'EmailSynchroInstaller',
|
||||
// Components
|
||||
'datamodel' => array(
|
||||
'datamodel' => [
|
||||
'classes/autoload.php',
|
||||
'model.combodo-email-synchro.php',
|
||||
),
|
||||
'dictionary' => array(),
|
||||
'data.struct' => array(
|
||||
),
|
||||
'data.sample' => array(
|
||||
),
|
||||
],
|
||||
'dictionary' => [],
|
||||
'data.struct' => [
|
||||
],
|
||||
'data.sample' => [
|
||||
],
|
||||
// Documentation
|
||||
'doc.manual_setup' => '', // No manual installation required
|
||||
'doc.more_information' => '', // None
|
||||
// Default settings
|
||||
'settings' => array(
|
||||
'settings' => [
|
||||
'notify_errors_to' => '', // mandatory to track errors not handled by the email processing module
|
||||
'notify_errors_from' => '', // mandatory as well (can be set at the same value as notify_errors_to)
|
||||
'debug' => false, // Set to true to turn on debugging
|
||||
@@ -36,44 +36,42 @@ SetupWebPage::AddModule(
|
||||
'retention_period' => 1, // number of hour we keep the replica
|
||||
'body_parts_order' => 'text/html,text/plain', // Order in which to read the parts of the incoming emails
|
||||
'pop3_auth_option' => 'USER',
|
||||
'imap_options' => array('imap'),
|
||||
'imap_open_options' => array(),
|
||||
'imap_options' => ['imap'],
|
||||
'imap_open_options' => [],
|
||||
'maximum_email_size' => '10M', // Maximum allowed size for incoming emails
|
||||
'big_files_dir' => '',
|
||||
'exclude_attachment_types' => array('application/exe'), // Example: 'application/exe', 'application/x-winexe', 'application/msdos-windows'
|
||||
'exclude_attachment_types' => ['application/exe'], // Example: 'application/exe', 'application/x-winexe', 'application/msdos-windows'
|
||||
// Lines to be removed just above the 'new part' in a reply-to message... add your own patterns below
|
||||
'introductory-patterns' => array(
|
||||
'introductory-patterns' => [
|
||||
'/^le .+ a écrit :$/i', // Thunderbird French
|
||||
'/^on .+ wrote:$/i', // Thunderbird English
|
||||
'|^[0-9]{4}/[0-9]{1,2}/[0-9]{1,2} .+:$|', // Gmail style
|
||||
),
|
||||
],
|
||||
// Some patterns which delimit the previous message in case of a Reply
|
||||
// The "new" part of the message is the text before the pattern
|
||||
// Add your own multi-line patterns (use \\R for a line break)
|
||||
// These patterns depend on the mail client/server used... feel free to add your own discoveries to the list
|
||||
'multiline-delimiter-patterns' => array(
|
||||
'multiline-delimiter-patterns' => [
|
||||
'/\\RFrom: .+\\RSent: .+\\R/m', // Outlook English
|
||||
'/\\R_+\\R/m', // A whole line made only of underscore characters
|
||||
'/\\RDe : .+\\R\\R?Envoyé : /m', // Outlook French, HTML and rich text
|
||||
'/\\RDe : .+\\RDate d\'envoi : .+\\R/m', // Outlook French, plain text
|
||||
'/\\R-----Message d\'origine-----\\R/m',
|
||||
),
|
||||
],
|
||||
'use_message_id_as_uid' => false, // Do NOT change this unless you known what you are doing!!
|
||||
'images_minimum_size' => '100x20', // Images smaller that these dimensions will be ignored (signatures...)
|
||||
'images_maximum_size' => '', // Images bigger that these dimensions will be resized before uploading into iTop
|
||||
'recommended_max_allowed_packet' => 10*1024*1024, // MySQL parameter for attachments
|
||||
),
|
||||
)
|
||||
'recommended_max_allowed_packet' => 10 * 1024 * 1024, // MySQL parameter for attachments
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (!class_exists('EmailSynchroInstaller'))
|
||||
{
|
||||
if (!class_exists('EmailSynchroInstaller')) {
|
||||
|
||||
// Module installation handler
|
||||
//
|
||||
class EmailSynchroInstaller extends ModuleInstallerAPI
|
||||
{
|
||||
|
||||
/**
|
||||
* Handler called after the creation/update of the database schema
|
||||
*
|
||||
@@ -109,10 +107,9 @@ if (!class_exists('EmailSynchroInstaller'))
|
||||
|
||||
// Looping on inboxes to update
|
||||
$oSet = new DBObjectSet($oSearch);
|
||||
while ($oInbox = $oSet->Fetch())
|
||||
{
|
||||
$sUpdateQuery = "UPDATE $sTableName SET $sMailboxColName = " . CMDBSource::Quote($oInbox->Get('mailbox')) . " WHERE $sUidlColName LIKE " . CMDBSource::Quote($oInbox->Get('login') . '_%') . " AND $sMailboxColName IS NULL";
|
||||
SetupLog::Info("Executing query: " . $sUpdateQuery);
|
||||
while ($oInbox = $oSet->Fetch()) {
|
||||
$sUpdateQuery = "UPDATE $sTableName SET $sMailboxColName = ".CMDBSource::Quote($oInbox->Get('mailbox'))." WHERE $sUidlColName LIKE ".CMDBSource::Quote($oInbox->Get('login').'_%')." AND $sMailboxColName IS NULL";
|
||||
SetupLog::Info("Executing query: ".$sUpdateQuery);
|
||||
$iRet = CMDBSource::Query($sUpdateQuery); // Throws an exception in case of error
|
||||
SetupLog::Info("Updated $iRet rows.");
|
||||
}
|
||||
|
||||
@@ -1,51 +1,52 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
// iTop module definition file
|
||||
//
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'itop-admin-delegation-profiles-bridge-for-combodo-email-synchro/1.0.0',
|
||||
array(
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Profiles per admin fonction: Mail inboxes and messages',
|
||||
'category' => 'Datamodel',
|
||||
'itop-admin-delegation-profiles-bridge-for-combodo-email-synchro/1.0.0',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Profiles per admin fonction: Mail inboxes and messages',
|
||||
'category' => 'Datamodel',
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
'itop-admin-delegation-profiles/1.0.0',
|
||||
'itop-admin-delegation-profiles/1.0.0 || combodo-email-synchro/3.7.2 || itop-oauth-client/2.7.7', // Optional dependency to silence the setup to not display a warning if the other module is not present
|
||||
),
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => [
|
||||
'itop-admin-delegation-profiles/1.0.0',
|
||||
'itop-admin-delegation-profiles/1.0.0 || combodo-email-synchro/3.7.2 || itop-oauth-client/2.7.7', // Optional dependency to silence the setup to not display a warning if the other module is not present
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => false,
|
||||
'auto_select' => 'SetupInfo::ModuleIsSelected("itop-admin-delegation-profiles") && SetupInfo::ModuleIsSelected("combodo-email-synchro") && SetupInfo::ModuleIsSelected("itop-oauth-client")',
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
'model.itop-admin-delegation-profiles-bridge-for-combodo-email-synchro.php'
|
||||
),
|
||||
'webservice' => array(
|
||||
|
||||
),
|
||||
'data.struct' => array(
|
||||
'datamodel' => [
|
||||
'model.itop-admin-delegation-profiles-bridge-for-combodo-email-synchro.php',
|
||||
],
|
||||
'webservice' => [
|
||||
|
||||
],
|
||||
'data.struct' => [
|
||||
// add your 'structure' definition XML files here,
|
||||
),
|
||||
'data.sample' => array(
|
||||
],
|
||||
'data.sample' => [
|
||||
// add your sample data XML files here,
|
||||
),
|
||||
|
||||
],
|
||||
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
'settings' => [
|
||||
// Module specific settings go here, if any
|
||||
),
|
||||
)
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -1,52 +1,53 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
// iTop module definition file
|
||||
//
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'itop-admin-delegation-profiles/1.2.1',
|
||||
array(
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Profiles per admin fonction',
|
||||
'category' => 'Datamodel',
|
||||
'itop-admin-delegation-profiles/1.2.1',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Profiles per admin fonction',
|
||||
'category' => 'Datamodel',
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
'itop-config-mgmt/2.7.0' || 'itop-structure/3.0.0',
|
||||
// itop-profiles-itil is here to ensure that the /itop_design/groups/group[@id="History"] alteration comes after those from that module.
|
||||
// This allows to define the missing "History" group in iTop 2.7 / 3.0, while merging smoothly with iTop 3.1+
|
||||
'itop-profiles-itil/2.7.0',
|
||||
),
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => [
|
||||
'itop-config-mgmt/2.7.0' || 'itop-structure/3.0.0',
|
||||
// itop-profiles-itil is here to ensure that the /itop_design/groups/group[@id="History"] alteration comes after those from that module.
|
||||
// This allows to define the missing "History" group in iTop 2.7 / 3.0, while merging smoothly with iTop 3.1+
|
||||
'itop-profiles-itil/2.7.0',
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
'model.itop-admin-delegation-profiles.php'
|
||||
),
|
||||
'webservice' => array(
|
||||
|
||||
),
|
||||
'data.struct' => array(
|
||||
'datamodel' => [
|
||||
'model.itop-admin-delegation-profiles.php',
|
||||
],
|
||||
'webservice' => [
|
||||
|
||||
],
|
||||
'data.struct' => [
|
||||
// add your 'structure' definition XML files here,
|
||||
),
|
||||
'data.sample' => array(
|
||||
],
|
||||
'data.sample' => [
|
||||
// add your sample data XML files here,
|
||||
),
|
||||
|
||||
],
|
||||
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
'settings' => [
|
||||
// Module specific settings go here, if any
|
||||
),
|
||||
)
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -7,35 +7,35 @@
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'itop-full-itil/3.3.0',
|
||||
array(
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Bridge - Request management ITIL + Incident management ITIL',
|
||||
'category' => 'business',
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
'dependencies' => [
|
||||
'itop-request-mgmt-itil/2.3.0',
|
||||
'itop-incident-mgmt-itil/2.3.0',
|
||||
),
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => false,
|
||||
'auto_select' => 'SetupInfo::ModuleIsSelected("itop-request-mgmt-itil") && SetupInfo::ModuleIsSelected("itop-incident-mgmt-itil")',
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(),
|
||||
'webservice' => array(),
|
||||
'data.struct' => array(// add your 'structure' definition XML files here,
|
||||
),
|
||||
'data.sample' => array(// add your sample data XML files here,
|
||||
),
|
||||
'datamodel' => [],
|
||||
'webservice' => [],
|
||||
'data.struct' => [// add your 'structure' definition XML files here,
|
||||
],
|
||||
'data.sample' => [// add your sample data XML files here,
|
||||
],
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(// Module specific settings go here, if any
|
||||
),
|
||||
)
|
||||
'settings' => [// Module specific settings go here, if any
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'itop-global-requests-mgmt/1.6.3',
|
||||
array(
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'iTop Global Requests Management',
|
||||
@@ -19,23 +19,23 @@ SetupWebPage::AddModule(
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
'dependencies' => [
|
||||
'itop-portal-base/3.2.0',
|
||||
),
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
'installer' => GlobalRequestInstaller::class,
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
'datamodel' => [
|
||||
'vendor/autoload.php',
|
||||
),
|
||||
'webservice' => array(),
|
||||
'data.struct' => array(// add your 'structure' definition XML files here,
|
||||
),
|
||||
'data.sample' => array(// add your sample data XML files here,
|
||||
),
|
||||
],
|
||||
'webservice' => [],
|
||||
'data.struct' => [// add your 'structure' definition XML files here,
|
||||
],
|
||||
'data.sample' => [// add your sample data XML files here,
|
||||
],
|
||||
|
||||
// Documentation
|
||||
//
|
||||
@@ -44,15 +44,14 @@ SetupWebPage::AddModule(
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
'settings' => [
|
||||
'target_state' => 'new',
|
||||
'bypass_profiles' => 'Administrator, Service Manager',
|
||||
'reuse_previous_answers' => true,
|
||||
),
|
||||
)
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
class GlobalRequestInstaller extends ModuleInstallerAPI
|
||||
{
|
||||
/**
|
||||
@@ -71,5 +70,3 @@ class GlobalRequestInstaller extends ModuleInstallerAPI
|
||||
//code
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__,
|
||||
'itop-tickets/3.3.0',
|
||||
array(
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Tickets Management',
|
||||
@@ -12,24 +11,24 @@ SetupWebPage::AddModule(
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
'dependencies' => [
|
||||
'itop-structure/2.7.1',
|
||||
),
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
'installer' => 'TicketsInstaller',
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
'datamodel' => [
|
||||
'main.itop-tickets.php',
|
||||
),
|
||||
'data.struct' => array(
|
||||
],
|
||||
'data.struct' => [
|
||||
// 'data.struct.ta-actions.xml',
|
||||
),
|
||||
'data.sample' => array(
|
||||
),
|
||||
|
||||
],
|
||||
'data.sample' => [
|
||||
],
|
||||
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '',
|
||||
@@ -37,9 +36,9 @@ SetupWebPage::AddModule(
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
),
|
||||
)
|
||||
'settings' => [
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Module installation handler
|
||||
@@ -52,17 +51,12 @@ class TicketsInstaller extends ModuleInstallerAPI
|
||||
CMDBObject::SetTrackInfo('Uninstallation');
|
||||
$oSearch = new DBObjectSearch('TriggerOnObject');
|
||||
$oSet = new DBObjectSet($oSearch);
|
||||
while($oTrigger = $oSet->Fetch())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MetaModel::IsValidClass($oTrigger->Get('target_class')))
|
||||
{
|
||||
while ($oTrigger = $oSet->Fetch()) {
|
||||
try {
|
||||
if (!MetaModel::IsValidClass($oTrigger->Get('target_class'))) {
|
||||
$oTrigger->DBDelete();
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
utils::EnrichRaisedException($oTrigger, $e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,80 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
// iTop module definition file
|
||||
//
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'servername-ticket/2.6.2',
|
||||
array(
|
||||
// Identification
|
||||
//
|
||||
'label' => 'I3S Datamodel tickets',
|
||||
'category' => 'business',
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'servername-ticket/2.6.2',
|
||||
[
|
||||
// Identification
|
||||
//
|
||||
'label' => 'I3S Datamodel tickets',
|
||||
'category' => 'business',
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
'itop-attachments/2.5.0',
|
||||
),
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => [
|
||||
'itop-attachments/2.5.0',
|
||||
],
|
||||
'mandatory' => false,
|
||||
'visible' => true,
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
'model.servername-datamodel-ticket.php',
|
||||
'main.servername-datamodel-ticket.php'
|
||||
),
|
||||
'webservice' => array(
|
||||
// Components
|
||||
//
|
||||
'datamodel' => [
|
||||
'model.servername-datamodel-ticket.php',
|
||||
'main.servername-datamodel-ticket.php',
|
||||
],
|
||||
'webservice' => [
|
||||
|
||||
),
|
||||
'data.struct' => array(
|
||||
// add your 'structure' definition XML files here,
|
||||
),
|
||||
'data.sample' => array(
|
||||
// add your sample data XML files here,
|
||||
),
|
||||
],
|
||||
'data.struct' => [
|
||||
// add your 'structure' definition XML files here,
|
||||
],
|
||||
'data.sample' => [
|
||||
// add your sample data XML files here,
|
||||
],
|
||||
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
|
||||
'doc.more_information' => '', // hyperlink to more information, if any
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
// url d'accès au répertoire des traces applicatives liées aux tickets
|
||||
'traces_base_url' => 'file://'.$_SERVER['SERVER_NAME'].'/traces',
|
||||
// répertoire des faqi liées aux tickets
|
||||
'traces_base_dir_faqi' => '/data/i3s-gsit-tt/faqi',
|
||||
// url d'accès au répertoire des faqi liées aux tickets
|
||||
// ce serveur est-il le serveur de consolidation ?
|
||||
'consolidation_server' => false,
|
||||
// restriction des franchissements
|
||||
'max_allowed_transitions' => array(
|
||||
// Les noms des transitions sont visibles dans Outils d'admin => Modèle de données => Incident => Cycle de vie
|
||||
// Les transitions qui ne sont pas présentes dans ce tableau sont considérées comme étant à 0
|
||||
/* 'nom technique de la transition' => nombre maximal autorisé */
|
||||
'ev_askinfo' => 0, // Demander des informations (au demandeur)
|
||||
'ev_assign' => 0, // Assigner
|
||||
'ev_cancel_by_user' => 0, // Annuler (par le demandeur)
|
||||
'ev_cancel' => 0, // Annuler
|
||||
'ev_close' => 0, // Clore
|
||||
'ev_escalate' => 0, // Escalader
|
||||
'ev_giveinfo' => 0, // Envoyer les informations
|
||||
'ev_monitor' => 0, // Surveiller
|
||||
'ev_pending' => 0, // En attente
|
||||
'ev_reassign' => 0, // Ré-assigner
|
||||
'ev_refuse_reject' => 0, // Refuser le rejet
|
||||
'ev_refuse_solution' => 0, // Refuser la solution
|
||||
'ev_reject' => 0, // Rejeter
|
||||
'ev_resolve' => 0, // Marquer comme résolu
|
||||
'ev_suspend' => 0, // Suspendre
|
||||
'ev_terminate' => 0, // Solder
|
||||
'ev_verify' => 0, // Accepter la solution / Confirmer la résolution
|
||||
),
|
||||
),
|
||||
)
|
||||
// Default settings
|
||||
//
|
||||
'settings' => [
|
||||
// url d'accès au répertoire des traces applicatives liées aux tickets
|
||||
'traces_base_url' => 'file://'.$_SERVER['SERVER_NAME'].'/traces',
|
||||
// répertoire des faqi liées aux tickets
|
||||
'traces_base_dir_faqi' => '/data/i3s-gsit-tt/faqi',
|
||||
// url d'accès au répertoire des faqi liées aux tickets
|
||||
// ce serveur est-il le serveur de consolidation ?
|
||||
'consolidation_server' => false,
|
||||
// restriction des franchissements
|
||||
'max_allowed_transitions' => [
|
||||
// Les noms des transitions sont visibles dans Outils d'admin => Modèle de données => Incident => Cycle de vie
|
||||
// Les transitions qui ne sont pas présentes dans ce tableau sont considérées comme étant à 0
|
||||
/* 'nom technique de la transition' => nombre maximal autorisé */
|
||||
'ev_askinfo' => 0, // Demander des informations (au demandeur)
|
||||
'ev_assign' => 0, // Assigner
|
||||
'ev_cancel_by_user' => 0, // Annuler (par le demandeur)
|
||||
'ev_cancel' => 0, // Annuler
|
||||
'ev_close' => 0, // Clore
|
||||
'ev_escalate' => 0, // Escalader
|
||||
'ev_giveinfo' => 0, // Envoyer les informations
|
||||
'ev_monitor' => 0, // Surveiller
|
||||
'ev_pending' => 0, // En attente
|
||||
'ev_reassign' => 0, // Ré-assigner
|
||||
'ev_refuse_reject' => 0, // Refuser le rejet
|
||||
'ev_refuse_solution' => 0, // Refuser la solution
|
||||
'ev_reject' => 0, // Rejeter
|
||||
'ev_resolve' => 0, // Marquer comme résolu
|
||||
'ev_suspend' => 0, // Suspendre
|
||||
'ev_terminate' => 0, // Solder
|
||||
'ev_verify' => 0, // Accepter la solution / Confirmer la résolution
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user