mirror of
https://github.com/Combodo/iTop.git
synced 2026-06-27 02:06:36 +02:00
* Helper for loading XML localized data during Setup * Refactor existing code * Add new localized structural data
67 lines
1.5 KiB
PHP
Executable File
67 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
SetupWebPage::AddModule(
|
|
__FILE__,
|
|
'itop-tickets/3.3.0',
|
|
[
|
|
// Identification
|
|
//
|
|
'label' => 'Tickets Management',
|
|
'category' => 'business',
|
|
|
|
// Setup
|
|
//
|
|
'dependencies' => [
|
|
'itop-structure/2.7.1 || itop-portal/3.0.0', // itop-portal : module_design_itop_design->module_designs->itop-portal
|
|
],
|
|
'mandatory' => false,
|
|
'visible' => true,
|
|
'installer' => 'TicketsInstaller',
|
|
|
|
// Components
|
|
//
|
|
'datamodel' => [
|
|
'main.itop-tickets.php',
|
|
],
|
|
'data.struct' => [
|
|
// 'data.struct.ta-actions.xml',
|
|
],
|
|
'data.sample' => [
|
|
],
|
|
|
|
// Documentation
|
|
//
|
|
'doc.manual_setup' => '',
|
|
'doc.more_information' => '',
|
|
|
|
// Default settings
|
|
//
|
|
'settings' => [
|
|
],
|
|
]
|
|
);
|
|
|
|
// Module installation handler
|
|
//
|
|
class TicketsInstaller extends ModuleInstallerAPI
|
|
{
|
|
public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
|
|
{
|
|
// Delete all Triggers corresponding to a no more valid class
|
|
CMDBObject::SetTrackInfo('Uninstallation');
|
|
$oSearch = new DBObjectSearch('TriggerOnObject');
|
|
$oSet = new DBObjectSet($oSearch);
|
|
while ($oTrigger = $oSet->Fetch()) {
|
|
try {
|
|
if (!MetaModel::IsValidClass($oTrigger->Get('target_class'))) {
|
|
$oTrigger->DBDelete();
|
|
}
|
|
} catch (Exception $e) {
|
|
utils::EnrichRaisedException($oTrigger, $e);
|
|
}
|
|
}
|
|
// Load localized structural data: predefined query phrases for notifications
|
|
static::LoadLocalizedData($oConfiguration, $sPreviousVersion, $sCurrentVersion, '3.0.0', __DIR__."/data/{{language_code}}.data.itop-tickets.xml");
|
|
}
|
|
}
|