mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 23:08:46 +02:00
- Improved version of the setup wizard with asynchronous data load
SVN:code[36]
This commit is contained in:
64
setup/ajax.dataloader.php
Normal file
64
setup/ajax.dataloader.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* This page is called to load "asynchronously" some xml file into the database
|
||||
* parameters
|
||||
* 'file' string Name of the file to load
|
||||
* 'session_status' string 'start', 'continue' or 'end'
|
||||
* 'percent' integer 0..100 the percentage of completion once the file has been loaded
|
||||
*/
|
||||
require_once('../application/utils.inc.php');
|
||||
require_once('../core/config.class.inc.php');
|
||||
require_once('../core/cmdbsource.class.inc.php');
|
||||
require_once('./setuppage.class.inc.php');
|
||||
require_once('./xmldataloader.class.inc.php');
|
||||
|
||||
define('TMP_CONFIG_FILE', '../tmp-config-itop.php');
|
||||
//define('FINAL_CONFIG_FILE', '../config-itop.php');
|
||||
|
||||
// Never cache this page
|
||||
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header("Expires: Fri, 17 Jul 1970 05:00:00 GMT"); // Date in the past
|
||||
|
||||
/**
|
||||
* Main program
|
||||
*/
|
||||
$sFileName = Utils::ReadParam('file', '');
|
||||
$sSessionStatus = Utils::ReadParam('session_status', '');
|
||||
$iPercent = (integer)Utils::ReadParam('percent', 0);
|
||||
setup_web_page::log("Info - Loading file: $sFileName");
|
||||
try
|
||||
{
|
||||
if (empty($sFileName) || !file_exists($sFileName))
|
||||
{
|
||||
throw(new Exception("File $sFileName does not exist"));
|
||||
}
|
||||
|
||||
$oDataLoader = new XMLDataLoader(TMP_CONFIG_FILE); // When called by the wizard, the final config is not yet there
|
||||
if ($sSessionStatus == 'start')
|
||||
{
|
||||
$oChange = MetaModel::NewObject("CMDBChange");
|
||||
$oChange->Set("date", time());
|
||||
$oChange->Set("userinfo", "Initialization");
|
||||
$iChangeId = $oChange->DBInsert();
|
||||
$oDataLoader->StartSession($oChange);
|
||||
}
|
||||
|
||||
$oDataLoader->LoadFile($sFileName);
|
||||
|
||||
if ($sSessionStatus == 'end')
|
||||
{
|
||||
$oDataLoader->EndSession();
|
||||
}
|
||||
$sResult = sprintf("Info - loading of %s done. (Overall %d %% completed).", basename($sFileName), $iPercent);
|
||||
echo $sResult;
|
||||
setup_web_page::log($sResult);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "<p>An error happened while loading the data</p>\n";
|
||||
echo '<p>'.$e."</p>\n";
|
||||
setup_web_page::log("Error - An error happened while loading the data. ".$e);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
15
setup/data/01.organizations.xml
Normal file
15
setup/data/01.organizations.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizOrganization id="3">
|
||||
<name>Demo</name>
|
||||
<code>MCO</code>
|
||||
<status>implementation</status>
|
||||
<parent_id>3</parent_id>
|
||||
</bizOrganization>
|
||||
<bizOrganization id="6">
|
||||
<name>Oracle</name>
|
||||
<code>ORA</code>
|
||||
<status>production</status>
|
||||
<parent_id>6</parent_id>
|
||||
</bizOrganization>
|
||||
</Set>
|
||||
22
setup/data/02.locations.xml
Normal file
22
setup/data/02.locations.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizLocation id="29">
|
||||
<name>Grenoble</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<address>5 Avenue de la Poste</address>
|
||||
<country>France</country>
|
||||
<parent_location_id>1</parent_location_id>
|
||||
</bizLocation>
|
||||
<bizLocation id="1">
|
||||
<name>Paris</name>
|
||||
<status>implementation</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<address>5 rue de la Paroisse
|
||||
15eme arrondissement</address>
|
||||
<country>France</country>
|
||||
<parent_location_id>1</parent_location_id>
|
||||
</bizLocation>
|
||||
</Set>
|
||||
33
setup/data/03.persons.xml
Normal file
33
setup/data/03.persons.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizPerson id="21">
|
||||
<name>Denis</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<email>denis.flaven@gmail.com</email>
|
||||
<phone></phone>
|
||||
<location_id>29</location_id>
|
||||
<first_name>Flaven</first_name>
|
||||
<employe_number></employe_number>
|
||||
</bizPerson>
|
||||
<bizPerson id="20">
|
||||
<name>Quetiez</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<email>romain.quetiez@gmail.com</email>
|
||||
<phone></phone>
|
||||
<location_id>1</location_id>
|
||||
<first_name>Romain</first_name>
|
||||
<employe_number></employe_number>
|
||||
</bizPerson>
|
||||
<bizPerson id="7">
|
||||
<name>Taloc</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<email>erwan.taloc@gmail.com</email>
|
||||
<phone>33172382223</phone>
|
||||
<location_id>1</location_id>
|
||||
<first_name>Erwan</first_name>
|
||||
<employe_number>e12345</employe_number>
|
||||
</bizPerson>
|
||||
</Set>
|
||||
19
setup/data/04.teams.xml
Normal file
19
setup/data/04.teams.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizTeam id="26">
|
||||
<name>Application support</name>
|
||||
<status>implementation</status>
|
||||
<org_id>3</org_id>
|
||||
<email>application@mecanorama.com</email>
|
||||
<phone>33456456788</phone>
|
||||
<location_id>29</location_id>
|
||||
</bizTeam>
|
||||
<bizTeam id="8">
|
||||
<name>ITOP admin team</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<email>combodo@gmail.com</email>
|
||||
<phone>33123453612</phone>
|
||||
<location_id>1</location_id>
|
||||
</bizTeam>
|
||||
</Set>
|
||||
1865
setup/data/05.pcs.xml
Normal file
1865
setup/data/05.pcs.xml
Normal file
File diff suppressed because it is too large
Load Diff
4063
setup/data/06.servers.xml
Normal file
4063
setup/data/06.servers.xml
Normal file
File diff suppressed because it is too large
Load Diff
33
setup/data/07.applications.xml
Normal file
33
setup/data/07.applications.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizApplication id="22">
|
||||
<name>Oracle 10g</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<device_id>5</device_id>
|
||||
<install_date>2008-11-05 00:00:00</install_date>
|
||||
<version>10g</version>
|
||||
<function>Database</function>
|
||||
</bizApplication>
|
||||
<bizApplication id="15">
|
||||
<name>outlook Office</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<device_id>2</device_id>
|
||||
<install_date>2008-12-30 00:00:00</install_date>
|
||||
<version>8.4</version>
|
||||
<function>Mail client</function>
|
||||
</bizApplication>
|
||||
<bizApplication id="14">
|
||||
<name>Outlook server</name>
|
||||
<status>implementation</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<device_id>5</device_id>
|
||||
<install_date>2008-12-20 00:00:00</install_date>
|
||||
<version>8.1</version>
|
||||
<function>Mail Server</function>
|
||||
</bizApplication>
|
||||
</Set>
|
||||
71
setup/data/08.nw-devices.xml
Normal file
71
setup/data/08.nw-devices.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizNetworkDevice id="6">
|
||||
<name>router01</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<location_id>1</location_id>
|
||||
<brand>Cisco</brand>
|
||||
<model>6500</model>
|
||||
<serial_number>S2345985</serial_number>
|
||||
<type>switch</type>
|
||||
<ip_address>10.25.3.45</ip_address>
|
||||
<default_gateway>10.25.3.1</default_gateway>
|
||||
<ios_version>8.2</ios_version>
|
||||
<memory>flash :1=16.48MB</memory>
|
||||
<snmp_read>public</snmp_read>
|
||||
<snmp_write>private</snmp_write>
|
||||
</bizNetworkDevice>
|
||||
<bizNetworkDevice id="323">
|
||||
<name>router02</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<location_id>1</location_id>
|
||||
<brand>Cisco</brand>
|
||||
<model>6500</model>
|
||||
<serial_number>S2345985</serial_number>
|
||||
<type>switch</type>
|
||||
<ip_address>10.25.3.46</ip_address>
|
||||
<default_gateway>10.25.3.1</default_gateway>
|
||||
<ios_version>8.2</ios_version>
|
||||
<memory>flash :1=16.48MB</memory>
|
||||
<snmp_read>public</snmp_read>
|
||||
<snmp_write>private</snmp_write>
|
||||
</bizNetworkDevice>
|
||||
<bizNetworkDevice id="324">
|
||||
<name>router03</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<location_id>1</location_id>
|
||||
<brand>Cisco</brand>
|
||||
<model>6500</model>
|
||||
<serial_number>S2345985</serial_number>
|
||||
<type>switch</type>
|
||||
<ip_address>10.25.3.47</ip_address>
|
||||
<default_gateway>10.25.3.1</default_gateway>
|
||||
<ios_version>8.2</ios_version>
|
||||
<memory>flash :1=16.48MB</memory>
|
||||
<snmp_read>public</snmp_read>
|
||||
<snmp_write>private</snmp_write>
|
||||
</bizNetworkDevice>
|
||||
<bizNetworkDevice id="17">
|
||||
<name>switch01</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<severity>high</severity>
|
||||
<location_id>1</location_id>
|
||||
<brand></brand>
|
||||
<model></model>
|
||||
<serial_number></serial_number>
|
||||
<type>switch</type>
|
||||
<ip_address></ip_address>
|
||||
<default_gateway></default_gateway>
|
||||
<ios_version></ios_version>
|
||||
<memory></memory>
|
||||
<snmp_read></snmp_read>
|
||||
<snmp_write></snmp_write>
|
||||
</bizNetworkDevice>
|
||||
</Set>
|
||||
23
setup/data/09.links_contacts.xml
Normal file
23
setup/data/09.links_contacts.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkContactRealObject id="1">
|
||||
<contact_id>8</contact_id>
|
||||
<object_id>7</object_id>
|
||||
<role>business model expert</role>
|
||||
</lnkContactRealObject>
|
||||
<lnkContactRealObject id="2">
|
||||
<contact_id>21</contact_id>
|
||||
<object_id>2</object_id>
|
||||
<role>owner</role>
|
||||
</lnkContactRealObject>
|
||||
<lnkContactRealObject id="5">
|
||||
<contact_id>7</contact_id>
|
||||
<object_id>5</object_id>
|
||||
<role>Server Owner</role>
|
||||
</lnkContactRealObject>
|
||||
<lnkContactRealObject id="4">
|
||||
<contact_id>8</contact_id>
|
||||
<object_id>21</object_id>
|
||||
<role>Team Leader</role>
|
||||
</lnkContactRealObject>
|
||||
</Set>
|
||||
17
setup/data/10.workgroups.xml
Normal file
17
setup/data/10.workgroups.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizWorkgroup id="19">
|
||||
<name>FLS Desktop</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<team_id>8</team_id>
|
||||
<role>1st level support</role>
|
||||
</bizWorkgroup>
|
||||
<bizWorkgroup id="24">
|
||||
<name>FLS Network</name>
|
||||
<status>production</status>
|
||||
<org_id>3</org_id>
|
||||
<team_id>8</team_id>
|
||||
<role>2nd level support</role>
|
||||
</bizWorkgroup>
|
||||
</Set>
|
||||
132
setup/data/11.incidents.xml
Normal file
132
setup/data/11.incidents.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizIncidentTicket id="1">
|
||||
<name>I-000001</name>
|
||||
<title>PC issue</title>
|
||||
<type>Desktop</type>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>WorkInProgress</ticket_status>
|
||||
<initial_situation>there is an issue with my PC</initial_situation>
|
||||
<current_situation></current_situation>
|
||||
<start_date>2009-02-10 21:30:55</start_date>
|
||||
<last_update></last_update>
|
||||
<next_update></next_update>
|
||||
<end_date></end_date>
|
||||
<caller_id>21</caller_id>
|
||||
<impact>not able to start IE</impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>7</agent_id>
|
||||
<action_log>We are about to connect to your PC via Netmeeting and troubleshoot what's up.
|
||||
|
||||
Then we will try to contact Microsoft to understand if it is a known issue</action_log>
|
||||
<severity>critical</severity>
|
||||
<assignment_count>1</assignment_count>
|
||||
<resolution></resolution>
|
||||
</bizIncidentTicket>
|
||||
<bizIncidentTicket id="2">
|
||||
<name>I-000002</name>
|
||||
<title>Network issue</title>
|
||||
<type>Network</type>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>Assigned</ticket_status>
|
||||
<initial_situation>No more access to the network</initial_situation>
|
||||
<current_situation>Network connectivity lost</current_situation>
|
||||
<start_date>2009-02-19 19:07:25</start_date>
|
||||
<last_update>0000-00-00 00:00:00</last_update>
|
||||
<next_update>0000-00-00 00:00:00</next_update>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<caller_id>7</caller_id>
|
||||
<impact>high</impact>
|
||||
<workgroup_id>24</workgroup_id>
|
||||
<agent_id>21</agent_id>
|
||||
<action_log>need to investigate the network</action_log>
|
||||
<severity>low</severity>
|
||||
<assignment_count>2</assignment_count>
|
||||
<resolution></resolution>
|
||||
</bizIncidentTicket>
|
||||
<bizIncidentTicket id="3">
|
||||
<name>I-000003</name>
|
||||
<title>Disk Failure on Server01</title>
|
||||
<type>Server</type>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>WorkInProgress</ticket_status>
|
||||
<initial_situation>Partition /var is no more accessible.
|
||||
It seems that hard disk is broken</initial_situation>
|
||||
<current_situation>Filesystem is full</current_situation>
|
||||
<start_date>2009-03-21 08:27:46</start_date>
|
||||
<last_update>2009-02-10 22:25:00</last_update>
|
||||
<next_update>2009-02-10 00:25:00</next_update>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<caller_id>20</caller_id>
|
||||
<impact>Really important for the business</impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>7</agent_id>
|
||||
<action_log>There are lot of logs file to be trimed</action_log>
|
||||
<severity>medium</severity>
|
||||
<assignment_count>2</assignment_count>
|
||||
<resolution></resolution>
|
||||
</bizIncidentTicket>
|
||||
<bizIncidentTicket id="4">
|
||||
<name>I-000004</name>
|
||||
<title>Oracle Database down on domino</title>
|
||||
<type>Server</type>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>New</ticket_status>
|
||||
<initial_situation>Database Oracle is no more accessible on Server01</initial_situation>
|
||||
<current_situation>Customer cannot access Order web site.</current_situation>
|
||||
<start_date>2009-03-17 09:31:09</start_date>
|
||||
<last_update>0000-00-00 00:00:00</last_update>
|
||||
<next_update>0000-00-00 00:00:00</next_update>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<caller_id>7</caller_id>
|
||||
<impact>Very critical</impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>0</agent_id>
|
||||
<action_log></action_log>
|
||||
<severity>low</severity>
|
||||
<assignment_count>0</assignment_count>
|
||||
<resolution></resolution>
|
||||
</bizIncidentTicket>
|
||||
<bizIncidentTicket id="5">
|
||||
<name>I-000005</name>
|
||||
<title>Issue with my pc</title>
|
||||
<type>Desktop</type>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>Assigned</ticket_status>
|
||||
<initial_situation>My PC is locked</initial_situation>
|
||||
<current_situation>We have to analyze</current_situation>
|
||||
<start_date>2009-03-01 23:22:38</start_date>
|
||||
<last_update>0000-00-00 00:00:00</last_update>
|
||||
<next_update>0000-00-00 00:00:00</next_update>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<caller_id>7</caller_id>
|
||||
<impact></impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>20</agent_id>
|
||||
<action_log></action_log>
|
||||
<severity>medium</severity>
|
||||
<assignment_count>1</assignment_count>
|
||||
<resolution></resolution>
|
||||
</bizIncidentTicket>
|
||||
<bizIncidentTicket id="6">
|
||||
<name>I-000006</name>
|
||||
<title>Demo</title>
|
||||
<type>Server</type>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>New</ticket_status>
|
||||
<initial_situation>gdfgl</initial_situation>
|
||||
<current_situation></current_situation>
|
||||
<start_date>2009-03-18 22:00:00</start_date>
|
||||
<last_update>0000-00-00 00:00:00</last_update>
|
||||
<next_update>0000-00-00 00:00:00</next_update>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<caller_id>20</caller_id>
|
||||
<impact>personne ne peut acceder au site de paris</impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>0</agent_id>
|
||||
<action_log></action_log>
|
||||
<severity>low</severity>
|
||||
<assignment_count>0</assignment_count>
|
||||
<resolution></resolution>
|
||||
</bizIncidentTicket>
|
||||
</Set>
|
||||
8
setup/data/12.relatedtickets.xml
Normal file
8
setup/data/12.relatedtickets.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkRelatedTicket id="1">
|
||||
<rel_ticket_id>2</rel_ticket_id>
|
||||
<ticket_id>1</ticket_id>
|
||||
<impact>Real cause is a network incident</impact>
|
||||
</lnkRelatedTicket>
|
||||
</Set>
|
||||
33
setup/data/13.infratickets.xml
Normal file
33
setup/data/13.infratickets.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkInfraTicket id="12">
|
||||
<infra_id>125</infra_id>
|
||||
<ticket_id>6</ticket_id>
|
||||
<impact>c'est down</impact>
|
||||
</lnkInfraTicket>
|
||||
<lnkInfraTicket id="13">
|
||||
<infra_id>5</infra_id>
|
||||
<ticket_id>3</ticket_id>
|
||||
<impact>main application is broken</impact>
|
||||
</lnkInfraTicket>
|
||||
<lnkInfraTicket id="5">
|
||||
<infra_id>5</infra_id>
|
||||
<ticket_id>2</ticket_id>
|
||||
<impact>no more access to network</impact>
|
||||
</lnkInfraTicket>
|
||||
<lnkInfraTicket id="4">
|
||||
<infra_id>2</infra_id>
|
||||
<ticket_id>1</ticket_id>
|
||||
<impact>not able to start IE</impact>
|
||||
</lnkInfraTicket>
|
||||
<lnkInfraTicket id="9">
|
||||
<infra_id>28</infra_id>
|
||||
<ticket_id>5</ticket_id>
|
||||
<impact>not able to work</impact>
|
||||
</lnkInfraTicket>
|
||||
<lnkInfraTicket id="10">
|
||||
<infra_id>5</infra_id>
|
||||
<ticket_id>4</ticket_id>
|
||||
<impact>Order web site is no more working</impact>
|
||||
</lnkInfraTicket>
|
||||
</Set>
|
||||
13
setup/data/14.contacttickets.xml
Normal file
13
setup/data/14.contacttickets.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkContactTicket id="1">
|
||||
<contact_id>8</contact_id>
|
||||
<ticket_id>1</ticket_id>
|
||||
<role>Team that need to be informed</role>
|
||||
</lnkContactTicket>
|
||||
<lnkContactTicket id="2">
|
||||
<contact_id>21</contact_id>
|
||||
<ticket_id>3</ticket_id>
|
||||
<role>to be informed</role>
|
||||
</lnkContactTicket>
|
||||
</Set>
|
||||
85
setup/data/15.changetickets.xml
Normal file
85
setup/data/15.changetickets.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizChangeTicket id="1">
|
||||
<name>CM-0000003</name>
|
||||
<title>1st change</title>
|
||||
<type>Routine</type>
|
||||
<domain>Desktop</domain>
|
||||
<reason>reason</reason>
|
||||
<requestor_id>20</requestor_id>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>PlannedScheduled</ticket_status>
|
||||
<creation_date>2009-02-19 21:35:47</creation_date>
|
||||
<last_update>2009-02-18 18:33:14</last_update>
|
||||
<start_date>0000-00-00 00:00:00</start_date>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<close_date>0000-00-00 00:00:00</close_date>
|
||||
<impact>There is no impact</impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>21</agent_id>
|
||||
<supervisorgroup_id>19</supervisorgroup_id>
|
||||
<supervisor_id>20</supervisor_id>
|
||||
<managergroup_id>19</managergroup_id>
|
||||
<manager_id>7</manager_id>
|
||||
<outage>No</outage>
|
||||
<change_request>I would like to install SQL plus on my laptop.
|
||||
Could you make it please</change_request>
|
||||
<change_log>We will push via netmeeting the package and install it at 10:00 tomorrow</change_log>
|
||||
<fallback>If there is any issue we will uninstall it</fallback>
|
||||
<assignment_count>0</assignment_count>
|
||||
</bizChangeTicket>
|
||||
<bizChangeTicket id="2">
|
||||
<name>CM-0000004</name>
|
||||
<title>Oracle upgrade on domino</title>
|
||||
<type>Routine</type>
|
||||
<domain>Application</domain>
|
||||
<reason>Patch Installation for Oracle</reason>
|
||||
<requestor_id>21</requestor_id>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>Approved</ticket_status>
|
||||
<creation_date>2009-03-17 14:50:34</creation_date>
|
||||
<last_update>2009-03-17 14:50:34</last_update>
|
||||
<start_date>2009-02-24 00:00:00</start_date>
|
||||
<end_date>2009-02-24 02:00:00</end_date>
|
||||
<close_date>0000-00-00 00:00:00</close_date>
|
||||
<impact>application impacted</impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>20</agent_id>
|
||||
<supervisorgroup_id>19</supervisorgroup_id>
|
||||
<supervisor_id>21</supervisor_id>
|
||||
<managergroup_id>19</managergroup_id>
|
||||
<manager_id>7</manager_id>
|
||||
<outage>Yes</outage>
|
||||
<change_request>We wan to install last Oracle Patch in order to fix rollback management issues</change_request>
|
||||
<change_log>We will install patch and reboot the server</change_log>
|
||||
<fallback>If not working we will remove this patch</fallback>
|
||||
<assignment_count>0</assignment_count>
|
||||
</bizChangeTicket>
|
||||
<bizChangeTicket id="3">
|
||||
<name>CM-0000005</name>
|
||||
<title>IOS upgrade</title>
|
||||
<type>Routine</type>
|
||||
<domain>Desktop</domain>
|
||||
<reason>security issue</reason>
|
||||
<requestor_id>21</requestor_id>
|
||||
<customer_id>3</customer_id>
|
||||
<ticket_status>New</ticket_status>
|
||||
<creation_date>2009-04-04 23:23:37</creation_date>
|
||||
<last_update>0000-00-00 00:00:00</last_update>
|
||||
<start_date>0000-00-00 00:00:00</start_date>
|
||||
<end_date>0000-00-00 00:00:00</end_date>
|
||||
<close_date>0000-00-00 00:00:00</close_date>
|
||||
<impact></impact>
|
||||
<workgroup_id>19</workgroup_id>
|
||||
<agent_id>21</agent_id>
|
||||
<supervisorgroup_id>19</supervisorgroup_id>
|
||||
<supervisor_id>20</supervisor_id>
|
||||
<managergroup_id>19</managergroup_id>
|
||||
<manager_id>7</manager_id>
|
||||
<outage>No</outage>
|
||||
<change_request>Upgrade to new IOS due to security reason</change_request>
|
||||
<change_log></change_log>
|
||||
<fallback></fallback>
|
||||
<assignment_count>0</assignment_count>
|
||||
</bizChangeTicket>
|
||||
</Set>
|
||||
23
setup/data/16.infrachangetickets.xml
Normal file
23
setup/data/16.infrachangetickets.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkInfraChangeTicket id="7">
|
||||
<infra_id>22</infra_id>
|
||||
<ticket_id>2</ticket_id>
|
||||
<impact>impacted application</impact>
|
||||
</lnkInfraChangeTicket>
|
||||
<lnkInfraChangeTicket id="6">
|
||||
<infra_id>5</infra_id>
|
||||
<ticket_id>2</ticket_id>
|
||||
<impact>impacted server</impact>
|
||||
</lnkInfraChangeTicket>
|
||||
<lnkInfraChangeTicket id="5">
|
||||
<infra_id>2</infra_id>
|
||||
<ticket_id>1</ticket_id>
|
||||
<impact>PC where to install new appli</impact>
|
||||
</lnkInfraChangeTicket>
|
||||
<lnkInfraChangeTicket id="8">
|
||||
<infra_id>6</infra_id>
|
||||
<ticket_id>3</ticket_id>
|
||||
<impact>router not available </impact>
|
||||
</lnkInfraChangeTicket>
|
||||
</Set>
|
||||
23
setup/data/17.contactchangetickets.xml
Normal file
23
setup/data/17.contactchangetickets.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkContactChange id="3">
|
||||
<contact_id>7</contact_id>
|
||||
<change_id>1</change_id>
|
||||
<role>DB admin</role>
|
||||
</lnkContactChange>
|
||||
<lnkContactChange id="4">
|
||||
<contact_id>20</contact_id>
|
||||
<change_id>2</change_id>
|
||||
<role>Db administrator</role>
|
||||
</lnkContactChange>
|
||||
<lnkContactChange id="1">
|
||||
<contact_id>21</contact_id>
|
||||
<change_id>1</change_id>
|
||||
<role>notify me</role>
|
||||
</lnkContactChange>
|
||||
<lnkContactChange id="5">
|
||||
<contact_id>7</contact_id>
|
||||
<change_id>2</change_id>
|
||||
<role>Server Owner for reboot</role>
|
||||
</lnkContactChange>
|
||||
</Set>
|
||||
23
setup/data/18.contracts.xml
Normal file
23
setup/data/18.contracts.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<bizContract id="1">
|
||||
<name>Oracle Support</name>
|
||||
<customer_id>3</customer_id>
|
||||
<provider_id>6</provider_id>
|
||||
<service_name>Software support</service_name>
|
||||
<team_id>8</team_id>
|
||||
<service_level>Gold</service_level>
|
||||
<cost_unit>Global</cost_unit>
|
||||
<cost_freq>Yearly</cost_freq>
|
||||
<cost>30000</cost>
|
||||
<currency>Euros</currency>
|
||||
<description>This contract define Oracle Support contract between Mecanorama and Oracle company.
|
||||
|
||||
Yearly cost is 30.000 euros</description>
|
||||
<move2prod_date>2009-02-22 18:54:14</move2prod_date>
|
||||
<end_prod>2009-03-04 00:01:38</end_prod>
|
||||
<status>Signed</status>
|
||||
<type>Software</type>
|
||||
<version_number>3</version_number>
|
||||
</bizContract>
|
||||
</Set>
|
||||
9
setup/data/19.infracontracts.xml
Normal file
9
setup/data/19.infracontracts.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkInfraContract id="1">
|
||||
<infra_id>22</infra_id>
|
||||
<contract_id>1</contract_id>
|
||||
<coverage>Office Hour</coverage>
|
||||
<service_level>Gold</service_level>
|
||||
</lnkInfraContract>
|
||||
</Set>
|
||||
13
setup/data/20.contactcontracts.xml
Normal file
13
setup/data/20.contactcontracts.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<lnkContactContract id="1">
|
||||
<contact_id>21</contact_id>
|
||||
<contract_id>1</contract_id>
|
||||
<role>Contract Manager</role>
|
||||
</lnkContactContract>
|
||||
<lnkContactContract id="2">
|
||||
<contact_id>8</contact_id>
|
||||
<contract_id>1</contract_id>
|
||||
<role>Team in charge to manage Oracle</role>
|
||||
</lnkContactContract>
|
||||
</Set>
|
||||
8
setup/data/21.auditcategories.xml
Normal file
8
setup/data/21.auditcategories.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<AuditCategory id="1">
|
||||
<name>Devices in production</name>
|
||||
<description>Checking all devices in production</description>
|
||||
<definition_set>bizDevice: status = 'production'</definition_set>
|
||||
</AuditCategory>
|
||||
</Set>
|
||||
17
setup/data/22.auditrules.xml
Normal file
17
setup/data/22.auditrules.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<AuditRule id="1">
|
||||
<name>Devices in production on a Location not in production</name>
|
||||
<description></description>
|
||||
<query>bizDevice: location_id IN (bizLocation: status != 'production')</query>
|
||||
<valid_flag>false</valid_flag>
|
||||
<category_id>1</category_id>
|
||||
</AuditRule>
|
||||
<AuditRule id="2">
|
||||
<name>Devices not attached to a monitoring group</name>
|
||||
<description></description>
|
||||
<query>bizDevice: PKEY IS infra_id IN (lnkInfraGrouping: infra_group_id IN (bizInfraGroup: type = 'Monitoring'))</query>
|
||||
<valid_flag>true</valid_flag>
|
||||
<category_id>1</category_id>
|
||||
</AuditRule>
|
||||
</Set>
|
||||
27
setup/data/export.cmd
Normal file
27
setup/data/export.cmd
Normal file
@@ -0,0 +1,27 @@
|
||||
SET WEBROOT=http://localhost:81
|
||||
SET USER=Erwan
|
||||
SET PWD=Taloc
|
||||
REM The order (numbering) of the files is important since
|
||||
REM it dictates the order to import them back
|
||||
wget --output-document=01.organizations.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizOrganization&format=xml"
|
||||
wget --output-document=02.locations.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizLocation&format=xml"
|
||||
wget --output-document=03.persons.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizPerson&format=xml"
|
||||
wget --output-document=04.teams.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizTeam&format=xml"
|
||||
wget --output-document=05.pcs.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizPC&format=xml"
|
||||
wget --output-document=06.servers.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizServer&format=xml"
|
||||
wget --output-document=07.applications.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizApplication&format=xml"
|
||||
wget --output-document=08.nw-devices.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizNetworkDevice&format=xml"
|
||||
wget --output-document=09.links_contacts.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkContactRealObject&format=xml"
|
||||
wget --output-document=10.workgroups.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizWorkgroup&format=xml"
|
||||
wget --output-document=11.incidents.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizIncidentTicket&format=xml"
|
||||
wget --output-document=12.relatedtickets.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkRelatedTicket&format=xml"
|
||||
wget --output-document=13.infratickets.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkInfraTicket&format=xml"
|
||||
wget --output-document=14.contacttickets.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkContactTicket&format=xml"
|
||||
wget --output-document=15.changetickets.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizChangeTicket&format=xml"
|
||||
wget --output-document=16.infrachangetickets.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkInfraChangeTicket&format=xml"
|
||||
wget --output-document=17.contactchangetickets.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkContactChange&format=xml"
|
||||
wget --output-document=18.contracts.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT bizContract&format=xml"
|
||||
wget --output-document=19.infracontracts.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkInfraContract&format=xml"
|
||||
wget --output-document=20.contactcontracts.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT lnkContactContract&format=xml"
|
||||
wget --output-document=21.auditcategories.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT AuditCategory&format=xml"
|
||||
wget --output-document=22.auditrules.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT AuditRule&format=xml"
|
||||
6
setup/export_menus.cmd
Normal file
6
setup/export_menus.cmd
Normal file
@@ -0,0 +1,6 @@
|
||||
SET WEBROOT=http://localhost:81
|
||||
SET USER=Erwan
|
||||
SET PWD=Taloc
|
||||
REM The order (numbering) of the files is important since
|
||||
REM it dictates the order to import them back
|
||||
wget --output-document=1.menus.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%WEBROOT%/pages/export.php?expression=SELECT menuNode WHERE type%%3D%%27application%%27&format=xml"
|
||||
113
setup/index.php
113
setup/index.php
@@ -8,6 +8,7 @@ require_once('../core/cmdbsource.class.inc.php');
|
||||
require_once('./setuppage.class.inc.php');
|
||||
define('TMP_CONFIG_FILE', '../tmp-config-itop.php');
|
||||
define('FINAL_CONFIG_FILE', '../config-itop.php');
|
||||
define('SETUP_DATA_DIR', './data');
|
||||
define('PHP_MIN_VERSION', '5.2.0');
|
||||
define('MYSQL_MIN_VERSION', '5.0.0');
|
||||
|
||||
@@ -173,60 +174,45 @@ function CreateAdminAccount(setup_web_page $oP, Config $oConfig, $sAdminUser, $s
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to load the standard menus into the database
|
||||
*/
|
||||
function LoadStandardMenus(setup_web_page $oP)
|
||||
* Scans the ./data directory for XML files and output them as a Javascript array
|
||||
*/
|
||||
function PopulateDataFilesList(setup_web_page $oP)
|
||||
{
|
||||
$oP->log('Info - LoadStandardMenus');
|
||||
|
||||
$oXml = simplexml_load_file('menus.xml');
|
||||
$aReplicas = array();
|
||||
foreach($oXml as $oXmlMenu)
|
||||
if ($hDir = @opendir(SETUP_DATA_DIR))
|
||||
{
|
||||
$iPreviousId = (integer)$oXmlMenu['id']; // Mandatory to cast
|
||||
$iParentId = (integer)$oXmlMenu->parent_id; // Mandatory to cast
|
||||
// echo "<p>PreviousId = $iPreviousId; parent_id: $iParentId</p>\n";
|
||||
$oMenuNode = MetaModel::NewObject('menuNode');
|
||||
$oMenuNode->Set('name', $oXmlMenu->name);
|
||||
$oMenuNode->Set('label', $oXmlMenu->label);
|
||||
$oMenuNode->Set('hyperlink', $oXmlMenu->hyperlink);
|
||||
$oMenuNode->Set('template', $oXmlMenu->template);
|
||||
$oMenuNode->Set('rank', $oXmlMenu->rank);
|
||||
$oMenuNode->DBInsert();
|
||||
$iDstId = $oMenuNode->GetKey();
|
||||
$aReplicas[$iPreviousId] = array('dstObj' => $oMenuNode, 'parentId' => $iParentId);
|
||||
}
|
||||
|
||||
foreach($aReplicas as $iKey => $aReplica)
|
||||
{
|
||||
$iSrcParentId = $aReplica['parentId'];
|
||||
if ($iSrcParentId != 0)
|
||||
$aFilesToLoad = array();
|
||||
// This is the correct way to loop over the directory. (according the documentation)
|
||||
while (($sFile = readdir($hDir)) !== false)
|
||||
{
|
||||
if (isset($aReplicas[$iSrcParentId]))
|
||||
$sExtension = pathinfo($sFile, PATHINFO_EXTENSION );
|
||||
if (strcasecmp($sExtension, 'xml') == 0)
|
||||
{
|
||||
$oParentMenu = $aReplicas[$iSrcParentId]['dstObj'];
|
||||
$oMenu = $aReplica['dstObj'];
|
||||
$oMenu->Set('parent_id', $oParentMenu->GetKey());
|
||||
$oMenu->DBUpdate();
|
||||
$aFilesToLoad[] = SETUP_DATA_DIR.'/'.$sFile;
|
||||
}
|
||||
}
|
||||
closedir($hDir);
|
||||
// Load order is important we expect the files to be ordered
|
||||
// like numbered 1.Organizations.xml 2.Locations.xml , etc.
|
||||
asort($aFilesToLoad);
|
||||
// Menus can be loaded any time... like here at the end
|
||||
|
||||
$oP->add("<script type=\"text/javascript\">\n");
|
||||
$oP->add("function PopulateDataFilesList()\n");
|
||||
$oP->add("{\n");
|
||||
$index = 0;
|
||||
foreach($aFilesToLoad as $sFile)
|
||||
{
|
||||
$oP->add("aFilesToLoad[aFilesToLoad.length] = '$sFile';\n");
|
||||
$index++;
|
||||
}
|
||||
$oP->add("}\n");
|
||||
$oP->add("</script>\n");
|
||||
}
|
||||
|
||||
$oP->ok("Standard menus have been created successfully.");
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to load sample data into the database
|
||||
*/
|
||||
function LoadSampleData(setup_web_page $oP)
|
||||
{
|
||||
$oP->log('Info - LoadSampleData');
|
||||
|
||||
$oP->ok("Sample data loaded into the database.");
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$oP->error("Data directory (".SETUP_DATA_DIR.") no found or not readable.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the form for the first step of the configuration wizard
|
||||
@@ -241,7 +227,7 @@ function DisplayStep1(setup_web_page $oP)
|
||||
{
|
||||
$sRedStar = '<span class="hilite">*</span>';
|
||||
$oP->add("<h2>Step 1: Configuration of the database connection</h2>\n");
|
||||
$oP->add("<form method=\"get\" onSubmit=\"return DoSubmit('Connection to the database...', 1)\">\n");
|
||||
$oP->add("<form method=\"post\" onSubmit=\"return DoSubmit('Connection to the database...', 1)\">\n");
|
||||
// Form goes here
|
||||
$oP->add("<fieldset><legend>Database connection</legend>\n");
|
||||
$aForm = array();
|
||||
@@ -367,28 +353,34 @@ function DisplayStep4(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminP
|
||||
$oP->add("<h1>iTop configuration wizard</h1>\n");
|
||||
$oP->add("<h2>Creation of the administrator account</h2>\n");
|
||||
|
||||
$oP->add("<form method=\"post\" onSubmit=\"return DoSubmit('Finalizing configuration and loading data...', 4);\">\n");
|
||||
$oP->add("<form method=\"post\"\">\n");
|
||||
if (CreateAdminAccount($oP, $oConfig, $sAdminUser, $sAdminPwd))
|
||||
{
|
||||
$oP->add("<h2>Step 4: Loading of sample data</h2>\n");
|
||||
$oP->p("<fieldset><legend> Do you want to load sample data into the database ? </legend>\n");
|
||||
$oP->p("<input type=\"radio\" name=\"sample_data\" checked value=\"yes\"> Yes, for testing purposes, populate the database with sample data.\n");
|
||||
$oP->p("<input type=\"radio\" id=\"sample_data\" name=\"sample_data\" checked value=\"yes\"> Yes, for testing purposes, populate the database with sample data.\n");
|
||||
$oP->p("<input type=\"radio\" name=\"sample_data\" unchecked value=\"no\"> No, this is a production system, I will load real data myself.\n");
|
||||
$oP->p("</fieldset>\n");
|
||||
$oP->add("<input type=\"hidden\" name=\"auth_user\" value=\"$sAdminUser\">\n"); // To be compatible with login page
|
||||
$oP->add("<input type=\"hidden\" name=\"auth_pwd\" value=\"$sAdminPwd\">\n"); // To be compatible with login page
|
||||
$oP->add("<input type=\"hidden\" name=\"operation\" value=\"$sNextOperation\">\n");
|
||||
$oP->add("<button onClick=\"window.history.back();\"><< Back</button>\n");
|
||||
$oP->add(" \n");
|
||||
$oP->add("<button type=\"submit\">Finish</button>\n");
|
||||
$oP->add("<button onclick=\"DoSubmit('Finalizing configuration and loading data...', 4);\">Finish</button>\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Creation failed
|
||||
$oP->add("<button onClick=\"window.history.back();\"><< Back</button>\n");
|
||||
}
|
||||
// Form goes here
|
||||
// End of visible form
|
||||
$oP->add("</form>\n");
|
||||
// Hidden form
|
||||
$oP->add("<form id=\"GoToNextStep\" method=\"post\">\n");
|
||||
$oP->add("<input type=\"hidden\" name=\"auth_user\" value=\"$sAdminUser\">\n"); // To be compatible with login page
|
||||
$oP->add("<input type=\"hidden\" name=\"auth_pwd\" value=\"$sAdminPwd\">\n"); // To be compatible with login page
|
||||
$oP->add("<input type=\"hidden\" name=\"operation\" value=\"$sNextOperation\">\n");
|
||||
$oP->add("</form>\n");
|
||||
$oP->add_linked_script('./jquery.progression.js');
|
||||
|
||||
PopulateDataFilesList($oP);
|
||||
}
|
||||
/**
|
||||
* Display the form for the fifth (and final) step of the configuration wizard
|
||||
@@ -396,7 +388,7 @@ function DisplayStep4(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminP
|
||||
* 1) Creating the final configuration file
|
||||
* 2) Prompting the user to make the file read-only
|
||||
*/
|
||||
function DisplayStep5(setup_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd, $bLoadSampleData)
|
||||
function DisplayStep5(setup_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -419,11 +411,7 @@ function DisplayStep5(setup_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd
|
||||
$oP->add("<h1>iTop configuration wizard</h1>\n");
|
||||
$oP->add("<h2>Configuration completed</h2>\n");
|
||||
$oP->add("<form method=\"get\" action=\"../index.php\">\n");
|
||||
LoadStandardMenus($oP);
|
||||
if ($bLoadSampleData)
|
||||
{
|
||||
LoadSampleData($oP);
|
||||
}
|
||||
$oP->ok("The initialization completed successfully.");
|
||||
// Form goes here
|
||||
$oP->add("<button onClick=\"window.history.back();\"><< Back</button>\n");
|
||||
$oP->add(" \n");
|
||||
@@ -535,10 +523,9 @@ switch($sOperation)
|
||||
case 'step5':
|
||||
$oP->no_cache();
|
||||
$oP->log("Info - ========= Wizard step 5 ========");
|
||||
$bLoadSampleData = (Utils::ReadParam('sample_data', 'no') == 'yes');
|
||||
$sAdminUser = Utils::ReadParam('auth_user');
|
||||
$sAdminPwd = Utils::ReadParam('auth_pwd');
|
||||
DisplayStep5($oP, $oConfig, $sAdminUser, $sAdminPwd, $bLoadSampleData);
|
||||
DisplayStep5($oP, $oConfig, $sAdminUser, $sAdminPwd);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
193
setup/jquery.progression.js
Normal file
193
setup/jquery.progression.js
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Progression - jQuery plugin for Progress Bar 1.3
|
||||
*
|
||||
* http://www.anthor.net/fr/jquery-progression.html
|
||||
*
|
||||
* Copyright (c) 2008 FOURNET Loïc
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.fn.progression = function(options) {
|
||||
// Récupération des options par défaut
|
||||
var opts = $.extend({
|
||||
Current: 50,
|
||||
Maximum: 100,
|
||||
Background: '#FFFFFF',
|
||||
TextColor: '#000000',
|
||||
aBackground: '#FF0000',
|
||||
aTextColor: '#FFFFFF',
|
||||
BorderColor: '#000000',
|
||||
Animate: true,
|
||||
AnimateTimeOut: 3000,
|
||||
Easing: 'linear',
|
||||
startFct : null,
|
||||
endFct : null
|
||||
}, $.fn.progression.defaults, options);
|
||||
|
||||
if(options)
|
||||
var newCurrent = options.Current;
|
||||
|
||||
// Boucle sur les éléments appelés
|
||||
return this.each(function() {
|
||||
$this = $(this); // Elément en cours
|
||||
$innerdiv=$this.find(".progress"); // On recherche si l'élément a déjà été traité
|
||||
|
||||
// Options Spécifiques + Métadata ?
|
||||
var o = $.metadata ? $.extend({}, opts, $this.metadata()) : opts;
|
||||
|
||||
// Premier traitement de l'élément, pour la mise en place
|
||||
if($innerdiv.length!=1)
|
||||
BuildBarre($this, o);
|
||||
else
|
||||
{
|
||||
// Si c'est une nouvelle valeur, la fonction doit avoir la priorité sur les métadata
|
||||
if(newCurrent)
|
||||
o.Current = newCurrent;
|
||||
o.Maximum = parseInt($this.attr('pmax'));
|
||||
}
|
||||
|
||||
// Valeur supérieur au maximum ?
|
||||
if( o.Current > o.Maximum )
|
||||
{
|
||||
debug('La valeur demandee doit etre inférieur ou egale a la valeur maximale.')
|
||||
return false;
|
||||
}
|
||||
|
||||
// Calcul du pourcentage actuel
|
||||
var aWidth = Math.round(parseInt($this.attr('pcur'))/o.Maximum*100);
|
||||
// Calcul du nouveaux pourcentage
|
||||
var Width = Math.round(parseInt(o.Current)/o.Maximum*100);
|
||||
|
||||
//Start Callback
|
||||
if (typeof o.startFct == 'function')
|
||||
o.startFct(o);
|
||||
|
||||
if(o.Animate)
|
||||
{
|
||||
var oldCurrent = parseInt($this.attr('pcur'));
|
||||
var Steps = Math.abs(oldCurrent - o.Current);
|
||||
var StepsTimeOut = Math.floor(o.AnimateTimeOut/o.Maximum);
|
||||
|
||||
$innerdiv.queue("fx", []);
|
||||
$innerdiv.stop();
|
||||
$innerdiv.animate({ width: Width+"%" }, {
|
||||
duration: Math.round(StepsTimeOut*(Steps+1)),
|
||||
queue: false,
|
||||
easing: o.Easing,
|
||||
complete: function(){
|
||||
if (typeof o.endFct == 'function')
|
||||
o.endFct(o);
|
||||
}
|
||||
});
|
||||
|
||||
for (i=0; i<=Steps; i++) {
|
||||
$innerdiv.animate({opacity: 1},{
|
||||
duration: Math.round(StepsTimeOut*i),
|
||||
queue: false,
|
||||
complete: function(){
|
||||
if(oldCurrent<=o.Current)
|
||||
$(this).progressionSetTextTo(oldCurrent++);
|
||||
else
|
||||
$(this).progressionSetTextTo(oldCurrent--);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$innerdiv.css({ width: Width+'%' });
|
||||
$innerdiv.progressionSetTextTo(o.Current);
|
||||
|
||||
if (typeof o.endFct == 'function')
|
||||
o.endFct(o);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Fonction de création de la barre
|
||||
function BuildBarre($this, o) {
|
||||
// On vide la barre
|
||||
$this.html('');
|
||||
|
||||
$this.css({
|
||||
textAlign: 'left',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
backgroundColor: o.Background,
|
||||
borderColor: o.BorderColor,
|
||||
color: o.TextColor
|
||||
});
|
||||
// Si largeur Spécifique
|
||||
if(o.Width)
|
||||
$this.css('width', o.Width);
|
||||
// Si hauteur Spécifique
|
||||
if(o.Height)
|
||||
$this.css({ height: o.Height, lineHeight: o.Height });
|
||||
// Si image de fond
|
||||
if(o.BackgroundImg)
|
||||
$this.css({ backgroundImage: 'url(' + o.BackgroundImg + ')' });
|
||||
|
||||
$innerdiv=$("<div class='progress'></div>");
|
||||
|
||||
$("<div class='text'> </div>").css({
|
||||
position: 'absolute',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
textAlign: 'center'
|
||||
}).appendTo($this);
|
||||
|
||||
$("<span class='text'> </span>")
|
||||
.css({
|
||||
position: 'absolute',
|
||||
width: $this.width(),
|
||||
textAlign: 'center'
|
||||
})
|
||||
.appendTo($innerdiv);
|
||||
|
||||
$this.append($innerdiv);
|
||||
|
||||
// On applique le CSS de $innerdiv
|
||||
$innerdiv.css({
|
||||
position: 'absolute',
|
||||
width: 0,
|
||||
height: '100%',
|
||||
overflow: 'hidden',
|
||||
backgroundColor: o.aBackground,
|
||||
color: o.aTextColor
|
||||
});
|
||||
// Si image de fond active
|
||||
if(o.aBackgroundImg)
|
||||
$innerdiv.css({ backgroundImage: 'url(' + o.aBackgroundImg + ')' });
|
||||
|
||||
$this.attr('pmax', o.Maximum);
|
||||
$this.attr('pcur', 0);
|
||||
};
|
||||
|
||||
// Fonction pour aller à une valeur précise
|
||||
$.fn.progressionSetTextTo = function(i) {
|
||||
return this.each(function() {
|
||||
$this = $(this).parent();
|
||||
if($this.attr('pmax')!=100)
|
||||
$this.find(".text").html(i+"/"+$this.attr('pmax'));
|
||||
else
|
||||
$this.find(".text").html(i+" %");
|
||||
|
||||
$this.attr('pcur', i);
|
||||
});
|
||||
};
|
||||
|
||||
// Fonction d'impression dans la console javascript
|
||||
function debug($txt) {
|
||||
if (window.console && window.console.log)
|
||||
window.console.log('jQuery Progression: ' + $txt);
|
||||
};
|
||||
|
||||
|
||||
$.fn.progression.defaults = {};
|
||||
|
||||
})(jQuery);
|
||||
789
setup/menus.xml
789
setup/menus.xml
@@ -1,25 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<menuNode id="17">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Admin Tools</name>
|
||||
<label>iTop consultant tools</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Set>
|
||||
<menuNode id="17">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Admin Tools</name>
|
||||
<label>iTop consultant tools</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><p></p>
|
||||
<p></p>
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:32px;">Tools for the iTop consultant</p>
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:14px;"><i>This section contains links to useful tools for extending or debugging iTop</i></p>
|
||||
|
||||
|
||||
</template>
|
||||
<rank>7</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="59">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Applications</name>
|
||||
<label>All Applications</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>7</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="59">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Applications</name>
|
||||
<label>All Applications</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizApplication" type="search" asynchronous="false" encoding="text/sibusql">bizApplication</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -28,15 +28,15 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizApplication" type="list" asynchronous="false" encoding="text/sibusql">bizApplication</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="47">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Circuits</name>
|
||||
<label>All Circuits</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="47">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Circuits</name>
|
||||
<label>All Circuits</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizCircuit" type="search" asynchronous="false" encoding="text/sibusql">bizCircuit</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -45,28 +45,28 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizCircuit" type="list" asynchronous="false" encoding="text/sibusql">bizCircuit</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="75">
|
||||
<parent_id>64</parent_id>
|
||||
<name>All Contracts</name>
|
||||
<label>All Contracts</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="75">
|
||||
<parent_id>64</parent_id>
|
||||
<name>All Contracts</name>
|
||||
<label>All Contracts</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizContract</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizContract</itopblock>
|
||||
</div></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="48">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Interfaces</name>
|
||||
<label>All Interfaces</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="48">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Interfaces</name>
|
||||
<label>All Interfaces</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizInterface</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -75,15 +75,15 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizInterface</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="46">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Network devices</name>
|
||||
<label>All Network devices</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="46">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Network devices</name>
|
||||
<label>All Network devices</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizNetworkDevice" type="search" asynchronous="false" encoding="text/sibusql">bizNetworkDevice</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -92,15 +92,15 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizNetworkDevice" type="list" asynchronous="false" encoding="text/sibusql">bizNetworkDevice</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="60">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Patches</name>
|
||||
<label>All Patches</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="60">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Patches</name>
|
||||
<label>All Patches</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizPatch" type="search" asynchronous="false" encoding="text/sibusql">bizPatch</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -109,15 +109,15 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizPatch" type="list" asynchronous="false" encoding="text/sibusql">bizPatch</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="6">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All PCs</name>
|
||||
<label>All PCs</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="6">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All PCs</name>
|
||||
<label>All PCs</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizPC</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -126,15 +126,15 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizPC</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="45">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Servers</name>
|
||||
<label>All Servers</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="45">
|
||||
<parent_id>5</parent_id>
|
||||
<name>All Servers</name>
|
||||
<label>All Servers</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizServer</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -143,91 +143,98 @@
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizServer</itopblock>
|
||||
</div>
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="58">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Audit</name>
|
||||
<label>Audit</label>
|
||||
<hyperlink>/pages/audit.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>4</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="44">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Backup & Restore</name>
|
||||
<label>Backup & Restore the whole database</label>
|
||||
<hyperlink>./db_importer.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>998</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="66">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Change Management</name>
|
||||
<label>Change Management</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><img src="/images/imageChange.gif" style="float:right">
|
||||
</template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="58">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Audit</name>
|
||||
<label>Audit</label>
|
||||
<hyperlink>/pages/audit.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>4</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="44">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Backup & Restore</name>
|
||||
<label>Backup & Restore the whole database</label>
|
||||
<hyperlink>./db_importer.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>998</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="66">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Change Management</name>
|
||||
<label>Change Management</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><style>
|
||||
.dashboard {
|
||||
vertical-align:top;
|
||||
width:50%;
|
||||
border:1px solid #000;
|
||||
-moz-border-radius:10px;
|
||||
padding:5px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;">Changes Overview</p>
|
||||
<table border="0" padding="5" class="layout">
|
||||
<table border="0" padding="5">
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Change by type</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="pie_chart" parameters="group_by:type" asynchronous="false" encoding="text/oql">SELECT bizChangeTicket</itopblock>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="open_flash_chart" parameters="chart_type:bars;group_by:type;chart_title:Changes by type" asynchronous="false" encoding="text/oql">SELECT bizChangeTicket</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Changes by status</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="pie_chart" parameters="group_by:ticket_status;chart_title:Incidents by status" asynchronous="false" encoding="text/oql">SELECT bizChangeTicket</itopblock>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="open_flash_chart" parameters="chart_type:pie;group_by:ticket_status;chart_title:Changes by status" asynchronous="false" encoding="text/oql">SELECT bizChangeTicket</itopblock>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<td class="dashboard">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Changes by Workgroup</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="count" parameters="group_by:workgroup_name" asynchronous="false" encoding="text/sibusql">bizChangeTicket</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="count" parameters="group_by:workgroup_name" asynchronous="false" encoding="text/oql">SELECT bizChangeTicket</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<td class="dashboard">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Changes not yet assigned</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="list" parameters="dashboard:true" asynchronous="false" encoding="text/sibusql">bizChangeTicket: ticket_status = 'New'</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="list" parameters="dashboard:true" asynchronous="false" encoding="text/oql">SELECT bizChangeTicket WHERE ticket_status = 'New'</itopblock>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</template>
|
||||
<rank>4</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="74">
|
||||
<parent_id>66</parent_id>
|
||||
<name>Closed Changes</name>
|
||||
<label>Closed Changes</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</template>
|
||||
<rank>4</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="74">
|
||||
<parent_id>66</parent_id>
|
||||
<name>Closed Changes</name>
|
||||
<label>Closed Changes</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizChangeTicket: ticket_status = 'Closed'</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizChangeTicket: ticket_status = 'Closed'</itopblock>
|
||||
</div></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="63">
|
||||
<parent_id>61</parent_id>
|
||||
<name>Closed Incident</name>
|
||||
<label>List of closed ticket</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="63">
|
||||
<parent_id>61</parent_id>
|
||||
<name>Closed Incident</name>
|
||||
<label>List of closed ticket</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizIncidentTicket: ticket_status Contains 'Open' AND severity Contains 'critical'</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizIncidentTicket: ticket_status = 'Closed'</itopblock>
|
||||
</div></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="5">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Configuration Items</name>
|
||||
<label>All about devices</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="5">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Configuration Items</name>
|
||||
<label>All about devices</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><p></p>
|
||||
<p></p>
|
||||
<p style="text-align:left; font-family:Georgia, 'Times New Roman', Times, serif; font-size:40px;"><img src="/images/devices_big.gif" align="baseline">Devices Overview</p>
|
||||
@@ -237,31 +244,31 @@
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Georgia, 'Times New Roman', Times, serif; font-size:18px;">Servers</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizServer" type="pie_chart" parameters="group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizServer</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizServer" type="open_flash_chart" parameters="chart_type:pie;group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizServer</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Georgia, 'Times New Roman', Times, serif; font-size:18px;">PCs</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizPC" type="pie_chart" parameters="group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizPC</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizPC" type="open_flash_chart" parameters="chart_type:pie;group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizPC</itopblock>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Georgia, 'Times New Roman', Times, serif; font-size:18px;">Netword Devices</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizNetworDevice type="pie_chart" parameters="group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizNetworkDevice</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizNetworDevice type="open_flash_chart" parameters="chart_type:pie;group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizNetworkDevice</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Georgia, 'Times New Roman', Times, serif; font-size:18px;">Applications</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizApplication" type="pie_chart" parameters="group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizApplication</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizApplication" type="open_flash_chart" parameters="chart_type:pie;group_by:severity" asynchronous="false" encoding="text/oql">SELECT bizApplication</itopblock>
|
||||
</td>
|
||||
</tr>
|
||||
</table></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="1">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Configuration Management</name>
|
||||
<label>Configuration Management</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</table></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="1">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Configuration Management</name>
|
||||
<label>Configuration Management</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><style>
|
||||
td.dashboard {
|
||||
vertical-align:top;
|
||||
@@ -275,10 +282,10 @@ td.dashboard {
|
||||
<table border="0" padding="5" class="layout">
|
||||
<tr>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="logInfra" type="open_flash_chart" parameters="chart_type:pie;group_by:status;chart_title:Infrastructure Objects by status" asynchronous="false" encoding="text/oql">SELECT logInfra</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="logInfra" type="open_flash_chart" parameters="chart_type:pie;group_by:status;chart_title:Infrastructure Objects by status" asynchronous="false" encoding="text/sibusql">logInfra</itopblock>
|
||||
</td>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="logInfra" type="open_flash_chart" parameters="chart_type:bars;group_by:finalclass;chart_title:Infrastructure Objects by type" asynchronous="false" encoding="text/oql">SELECT logInfra</itopblock>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="logInfra" type="open_flash_chart" parameters="chart_type:bars;group_by:finalclass;chart_title:Infrastructure Objects by type" asynchronous="false" encoding="text/sibusql">logInfra</itopblock>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="dashboard">
|
||||
@@ -289,15 +296,17 @@ td.dashboard {
|
||||
&nbsp;
|
||||
</td>
|
||||
</tr>
|
||||
</table></template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="2">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Contacts</name>
|
||||
<label>Everything about Contacts</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</table>
|
||||
|
||||
</template>
|
||||
<rank>2</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="2">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Contacts</name>
|
||||
<label>Everything about Contacts</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><img src="/images/users2-big.png" style="float:right">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;">Contacts Overview</p>
|
||||
<table border="0" padding="5" class="layout">
|
||||
@@ -316,24 +325,33 @@ td.dashboard {
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Contacts by status</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="count" parameters="group_by:status" asynchronous="false" encoding="text/sibusql">bizContact</itopblock>
|
||||
</td>
|
||||
</table></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="19">
|
||||
<parent_id>17</parent_id>
|
||||
<name>CSV import</name>
|
||||
<label>Bulk creation or update</label>
|
||||
<hyperlink>csvimport.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>998</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="12">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Document</name>
|
||||
<label>Any object of class 'Document'</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</table></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="19">
|
||||
<parent_id>17</parent_id>
|
||||
<name>CSV import</name>
|
||||
<label>Bulk creation or update</label>
|
||||
<hyperlink>csvimport.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>998</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="18">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Data Model</name>
|
||||
<label>Overview of the Data Model</label>
|
||||
<hyperlink>schema.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="12">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Document</name>
|
||||
<label>Any object of class 'Document'</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizDocument</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -341,24 +359,24 @@ td.dashboard {
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:24px;">All Documents</p>
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizDocument</itopblock>
|
||||
</div></template>
|
||||
<rank>6</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="50">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Export</name>
|
||||
<label>Export any filter in HTML, CSV or XML</label>
|
||||
<hyperlink>./export.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>1000</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="49">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Grouping</name>
|
||||
<label>All Groups</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>6</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="50">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Export</name>
|
||||
<label>Export any filter in HTML, CSV or XML</label>
|
||||
<hyperlink>./export.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>1000</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="49">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Grouping</name>
|
||||
<label>All Groups</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizInfraGroup" type="search" asynchronous="false" encoding="text/sibusql">bizInfraGroup</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -370,57 +388,67 @@ td.dashboard {
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<rank>3</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="61">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Incident Management</name>
|
||||
<label>Incident Management</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><img src="/images/messagebox_warning.png" style="float:right">
|
||||
</template>
|
||||
<rank>3</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="61">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Incident Management</name>
|
||||
<label>Incident Management</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><style>
|
||||
.dashboard {
|
||||
vertical-align:top;
|
||||
width:50%;
|
||||
border:1px solid #000;
|
||||
-moz-border-radius:10px;
|
||||
padding:5px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;">Incidents Overview</p>
|
||||
<table border="0" padding="5" class="layout">
|
||||
<table border="0" padding="5">
|
||||
<tr>
|
||||
<td>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizIncidentTicket" type="open_flash_chart" parameters="group_by:severity;chart_title:Incidents by Severity" asynchronous="false" encoding="text/oql">SELECT bizIncidentTicket</itopblock>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizIncidentTicket" type="open_flash_chart" parameters="chart_type:pie;group_by:type;chart_title:Incidents by Type" asynchronous="false" encoding="text/oql">SELECT bizIncidentTicket</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizIncidentTicket" type="open_flash_chart" parameters="group_by:ticket_status;chart_title:Incidents by status" asynchronous="false" encoding="text/oql">SELECT bizIncidentTicket</itopblock>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizIncidentTicket" type="open_flash_chart" parameters="chart_type:bars;group_by:ticket_status;chart_title:Incidents by status" asynchronous="false" encoding="text/oql">SELECT bizIncidentTicket</itopblock>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<td class="dashboard">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Incidents by Workgroup</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizIncidentTicket" type="count" parameters="group_by:workgroup_name" asynchronous="false" encoding="text/sibusql">bizIncidentTicket</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<td class="dashboard">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Incidents not yet assigned</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizIncidentTicket" type="list" parameters="dashboard:true" asynchronous="false" encoding="text/sibusql">bizIncidentTicket: ticket_status = 'New'</itopblock>
|
||||
</td>
|
||||
</tr>
|
||||
</table></template>
|
||||
<rank>3</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="72">
|
||||
<parent_id>61</parent_id>
|
||||
<name>Known Errors</name>
|
||||
<label>Known Errors</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
</table>
|
||||
</template>
|
||||
<rank>3</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="72">
|
||||
<parent_id>61</parent_id>
|
||||
<name>Known Errors</name>
|
||||
<label>Known Errors</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizKnownErrort" type="search" asynchronous="false" encoding="text/sibusql">bizKnownError</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizKnownError" type="list" asynchronous="false" encoding="text/sibusql">bizKnownError</itopblock>
|
||||
</div></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="9">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Locations</name>
|
||||
<label>Any locations</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="9">
|
||||
<parent_id>1</parent_id>
|
||||
<name>Locations</name>
|
||||
<label>Any locations</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizLocation" type="search" asynchronous="false" encoding="text/sibusql">bizLocation</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
@@ -428,188 +456,155 @@ td.dashboard {
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:24px;">All Locations</p>
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizLocation" type="list" asynchronous="false" encoding="text/sibusql">bizLocation</itopblock>
|
||||
</div></template>
|
||||
<rank>5</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="57">
|
||||
<parent_id>0</parent_id>
|
||||
<name>My Bookmarks</name>
|
||||
<label>My Bookmarks</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><p></p>
|
||||
<p></p>
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:32px;">My bookmark</p>
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:14px;"><i>This section contains my most favorite search</i></p>
|
||||
|
||||
|
||||
</template>
|
||||
<rank>7</rank>
|
||||
<type>user</type>
|
||||
</menuNode>
|
||||
<menuNode id="71">
|
||||
<parent_id>57</parent_id>
|
||||
<name>My Cisco Devices</name>
|
||||
<label></label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><div id="TopPane">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizNetworkDevice: org_id = 3 AND brand Contains 'Cisco'</itopblock>
|
||||
</div>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizNetworkDevice: org_id = 3 AND brand Contains 'Cisco'</itopblock>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>user</type>
|
||||
</menuNode>
|
||||
<menuNode id="69">
|
||||
<parent_id>57</parent_id>
|
||||
<name>My Client Server</name>
|
||||
<label>My Client Server</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><div id="TopPane">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">lnkClientServer</itopblock>
|
||||
</div>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">lnkClientServer</itopblock>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>user</type>
|
||||
</menuNode>
|
||||
<menuNode id="65">
|
||||
<parent_id>64</parent_id>
|
||||
<name>Negociating contracts</name>
|
||||
<label>Negociating contracts</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>5</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="65">
|
||||
<parent_id>64</parent_id>
|
||||
<name>Negociating contracts</name>
|
||||
<label>Negociating contracts</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizContract: status = 'Negotiating'</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizContract: status = 'Negotiating'</itopblock>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="18">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Objects Schema</name>
|
||||
<label>Displays the schema of all the objects</label>
|
||||
<hyperlink>schema.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="68">
|
||||
<parent_id>66</parent_id>
|
||||
<name>Open Changes</name>
|
||||
<label>Open Changes</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="68">
|
||||
<parent_id>66</parent_id>
|
||||
<name>Open Changes</name>
|
||||
<label>Open Changes</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizChangeTicket: ticket_status != 'Closed'</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizChangeTicket: ticket_status != 'Closed'</itopblock>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="62">
|
||||
<parent_id>61</parent_id>
|
||||
<name>Open Incidents</name>
|
||||
<label>List of open incidents</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="62">
|
||||
<parent_id>61</parent_id>
|
||||
<name>Open Incidents</name>
|
||||
<label>List of open incidents</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizIncidentTicket: ticket_status Contains 'Open' AND severity Contains 'critical'</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizIncidentTicket: ticket_status != 'Closed'</itopblock>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="14">
|
||||
<parent_id>2</parent_id>
|
||||
<name>Persons</name>
|
||||
<label>Any contact of class 'Person'</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="14">
|
||||
<parent_id>2</parent_id>
|
||||
<name>Persons</name>
|
||||
<label>Any contact of class 'Person'</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizPerson</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizPerson</itopblock>
|
||||
</div></template>
|
||||
<rank>7</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="51">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Run queries</name>
|
||||
<label>Run any query</label>
|
||||
<hyperlink>./sibusql.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>1001</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="73">
|
||||
<parent_id>66</parent_id>
|
||||
<name>Scheduled Outages</name>
|
||||
<label>Scheduled Outages</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
</div></template>
|
||||
<rank>7</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="51">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Run queries</name>
|
||||
<label>Run any query</label>
|
||||
<hyperlink>./sibusql.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>1001</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="73">
|
||||
<parent_id>66</parent_id>
|
||||
<name>Scheduled Outages</name>
|
||||
<label>Scheduled Outages</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="search" asynchronous="false" encoding="text/sibusql">bizChangeTicket: outage = 'Yes' AND ticket_status != 'Closed'</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizChangeTicket" type="list" asynchronous="false" encoding="text/sibusql">bizChangeTicket: outage = 'Yes' AND ticket_status != 'Closed'</itopblock>
|
||||
</div></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="64">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Service Management</name>
|
||||
<label>Service Management</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><img src="/images/erwanContracts.jpg" style="float:right">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;">Contracts Overview</p>
|
||||
<table border="0" padding="5" class="layout">
|
||||
</div></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="64">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Service Management</name>
|
||||
<label>Service Management</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><style>
|
||||
.dashboard {
|
||||
vertical-align:top;
|
||||
width:50%;
|
||||
border:1px solid #000;
|
||||
-moz-border-radius:10px;
|
||||
padding:5px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;">Changes Overview</p>
|
||||
<table border="0" padding="5">
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Contracts by Service Level</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContract" type="pie_chart" parameters="group_by:service_level" asynchronous="false" encoding="text/sibusql">bizContract</itopblock>
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContract" type="open_flash_chart" parameters="chart_type:bars;group_by:type;chart_title:Contract by service level" asynchronous="false" encoding="text/oql">SELECT bizContract</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Contracts by Status</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContract" type="pie_chart" parameters="group_by:status" asynchronous="false" encoding="text/sibusql">bizContract</itopblock>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td>
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Contracts end in 30 days</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContract" type="list" asynchronous="false" encoding="text/oql">SELECT bizContract AS C WHERE (TO_DAYS(NOW()) - TO_DAYS(C.end_prod)) < 31</itopblock>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<td class="dashboard">
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContract" type="open_flash_chart" parameters="chart_type:pie;group_by:status;chart_title:Contracts by status" asynchronous="false" encoding="text/oql">SELECT bizContract</itopblock>
|
||||
</td>
|
||||
</tr>
|
||||
</table></template>
|
||||
<rank>5</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="43">
|
||||
<parent_id>2</parent_id>
|
||||
<name>Teams</name>
|
||||
<label>Any contact of class 'team'</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<tr>
|
||||
<td class="dashboard">
|
||||
<p style="text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;">Contracts ending in 30 days</p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContract" type="list" parameters="dashboard:true" asynchronous="false" encoding="text/oql">SELECT bizContract WHERE bizContract.end_prod = (TO_DAYS(NOW()) + TO_DAYS(30))</itopblock>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</template>
|
||||
<rank>5</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="43">
|
||||
<parent_id>2</parent_id>
|
||||
<name>Teams</name>
|
||||
<label>Any contact of class 'team'</label>
|
||||
<hyperlink>UI.php</hyperlink>
|
||||
<template><itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="search" asynchronous="false" encoding="text/sibusql">bizTeam</itopblock>
|
||||
<div id="BottomPane">
|
||||
<p></p>
|
||||
<itopblock BlockClass="DisplayBlock" objectclass="bizContact" type="list" asynchronous="false" encoding="text/sibusql">bizTeam</itopblock>
|
||||
</div></template>
|
||||
<rank>8</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="16">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Universal Search</name>
|
||||
<label>Search for anything...</label>
|
||||
<hyperlink>UniversalSearch.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
</Set>
|
||||
</div></template>
|
||||
<rank>8</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="16">
|
||||
<parent_id>17</parent_id>
|
||||
<name>Universal Search</name>
|
||||
<label>Search for anything...</label>
|
||||
<hyperlink>UniversalSearch.php</hyperlink>
|
||||
<template></template>
|
||||
<rank>999</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
<menuNode id="76">
|
||||
<parent_id>0</parent_id>
|
||||
<name>Welcome</name>
|
||||
<label>Welcome</label>
|
||||
<hyperlink>./UI.php</hyperlink>
|
||||
<template><p></p>
|
||||
<p></p>
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:32px;">Welcome to iTop</p>
|
||||
<p></p>
|
||||
<p style="text-align:center; font-family:Georgia, 'Times New Roman', Times, serif; font-size:14px;"><i>Version 0.7</i></p>
|
||||
|
||||
</template>
|
||||
<rank>1</rank>
|
||||
<type>application</type>
|
||||
</menuNode>
|
||||
</Set>
|
||||
|
||||
BIN
setup/orange-progress.gif
Normal file
BIN
setup/orange-progress.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -74,6 +74,9 @@ function DoSubmit(sMsg, iStep)
|
||||
bResult = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
bResult = DoLoadDataAsynchronous();
|
||||
}
|
||||
if (bResult)
|
||||
{
|
||||
@@ -81,3 +84,55 @@ function DoSubmit(sMsg, iStep)
|
||||
}
|
||||
return bResult;
|
||||
}
|
||||
|
||||
var aFilesToLoad = new Array();
|
||||
|
||||
function DoLoadDataAsynchronous()
|
||||
{
|
||||
// Check if sample data must be loaded, or just the menus
|
||||
aFilesToLoad[aFilesToLoad.length] = './menus.xml'; // First load the menus
|
||||
if (($("#sample_data:checked").length == 1))
|
||||
{
|
||||
PopulateDataFilesList(); // Function created in PHP to get the list of XML files on the server
|
||||
}
|
||||
$('#setup').block({message: '<p>Loading data...<br/><div id=\"progress\">0%</div></p>'});
|
||||
$('#progress').progression( {Current:0, Maximum: 100, aBackgroundImg: 'orange-progress.gif', aTextColor: '#000000'} );
|
||||
LoadNextDataFile('', '');
|
||||
return false; // Stop here for now
|
||||
}
|
||||
|
||||
var iCounter = 0;
|
||||
|
||||
function LoadNextDataFile(sData, sTextStatus)
|
||||
{
|
||||
//$("#progress").html(sData);
|
||||
if (iCounter < aFilesToLoad.length)
|
||||
{
|
||||
if (iCounter == (aFilesToLoad.length - 1))
|
||||
{
|
||||
// Last file in the list (or only 1 file), this completes the session
|
||||
sSessionStatus = 'end';
|
||||
}
|
||||
else if (iCounter == 0)
|
||||
{
|
||||
// First file in the list, start the session
|
||||
sSessionStatus = 'start';
|
||||
}
|
||||
else
|
||||
{
|
||||
sSessionStatus = 'continue';
|
||||
}
|
||||
iPercent = Math.round((100.0 * (1+iCounter)) / aFilesToLoad.length);
|
||||
sFileName = aFilesToLoad[iCounter];
|
||||
//alert('Loading file '+sFileName+' ('+iPercent+' %) - '+sSessionStatus);
|
||||
$("#progress").progression({ Current: iPercent });
|
||||
iCounter++;
|
||||
$.get( 'ajax.dataloader.php', { 'file': sFileName, 'percent': iPercent, 'session_status': sSessionStatus }, LoadNextDataFile, 'html');
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're done
|
||||
$('#setup').unblock();
|
||||
$('#GoToNextStep').submit(); // Use the hidden form to navigate to the next step
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,14 @@ table.formTable {
|
||||
.wizhelp {
|
||||
color: #333;
|
||||
font-size: 8pt;
|
||||
}
|
||||
#progress {
|
||||
border:1px solid #000000;
|
||||
width: 180px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
margin: 5px;
|
||||
}
|
||||
");
|
||||
}
|
||||
@@ -154,7 +162,7 @@ table.formTable {
|
||||
return parent::output();
|
||||
}
|
||||
|
||||
public function log($sText)
|
||||
public static function log($sText)
|
||||
{
|
||||
$hLogFile = @fopen(INSTALL_LOG_FILE, 'a');
|
||||
if ($hLogFile !== false)
|
||||
|
||||
278
setup/xmldataloader.class.inc.php
Normal file
278
setup/xmldataloader.class.inc.php
Normal file
@@ -0,0 +1,278 @@
|
||||
<?php
|
||||
define ('KEYS_CACHE_FILE', 'keyscache.tmp');
|
||||
/**
|
||||
* Class to load sets of objects from XML files into the database
|
||||
* XML files can be produced by the 'export' web service or by any other means
|
||||
* Here is a simple example:
|
||||
* $oLoader = new XMLDataLoader('../itop-config.php');
|
||||
* $oLoader->StartSession();
|
||||
* $oLoader->LoadFile('./organizations.xml');
|
||||
* $oLoader->LoadFile('./locations.xml');
|
||||
* $oLoader->EndSession();
|
||||
*/
|
||||
class XMLDataLoader
|
||||
{
|
||||
protected $m_aKeys;
|
||||
protected $m_aObjectsCache;
|
||||
protected $m_bSessionActive;
|
||||
protected $m_oChange;
|
||||
protected $m_sCacheFileName;
|
||||
|
||||
public function __construct($sConfigFileName)
|
||||
{
|
||||
$this->m_aKeys = array();
|
||||
$this->m_aObjectsCache = array();
|
||||
$this->m_oChange = null;
|
||||
$this->m_sCacheFileName = dirname(__FILE__).'/'.KEYS_CACHE_FILE;
|
||||
$this->InitDataModel($sConfigFileName);
|
||||
$this->LoadKeysCache();
|
||||
$this->m_bSessionActive = true;
|
||||
|
||||
}
|
||||
|
||||
public function StartSession($oChange)
|
||||
{
|
||||
$this->m_oChange = $oChange;
|
||||
$this->m_bSessionActive = true;
|
||||
}
|
||||
|
||||
public function EndSession()
|
||||
{
|
||||
$this->ResolveExternalKeys();
|
||||
$this->m_bSessionActive = false;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
// Stopping in the middle of a session, let's save the context information
|
||||
if ($this->m_bSessionActive)
|
||||
{
|
||||
$this->SaveKeysCache();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ClearKeysCache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the ORM (MetaModel)
|
||||
*/
|
||||
protected function InitDataModel($sConfigFileName, $bAllowMissingDatabase = true)
|
||||
{
|
||||
require_once('../core/coreexception.class.inc.php');
|
||||
require_once('../core/attributedef.class.inc.php');
|
||||
require_once('../core/filterdef.class.inc.php');
|
||||
require_once('../core/stimulus.class.inc.php');
|
||||
require_once('../core/MyHelpers.class.inc.php');
|
||||
require_once('../core/expression.class.inc.php');
|
||||
require_once('../core/cmdbsource.class.inc.php');
|
||||
require_once('../core/sqlquery.class.inc.php');
|
||||
require_once('../core/dbobject.class.php');
|
||||
require_once('../core/dbobjectsearch.class.php');
|
||||
require_once('../core/dbobjectset.class.php');
|
||||
require_once('../core/userrights.class.inc.php');
|
||||
MetaModel::Startup($sConfigFileName, $bAllowMissingDatabase);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the keys & object cache in a file
|
||||
*/
|
||||
protected function SaveKeysCache()
|
||||
{
|
||||
$hFile = @fopen($this->m_sCacheFileName, 'w');
|
||||
if ($hFile !== false)
|
||||
{
|
||||
$sData = serialize( array('keys' => $this->m_aKeys,
|
||||
'objects' => $this->m_aObjectsCache,
|
||||
'change' => $this->m_oChange));
|
||||
fwrite($hFile, $sData);
|
||||
fclose($hFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<p><strong>Error: Cannot write to file: '{$this->m_sCacheFileName}'!</strong></p>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the keys & object cache from the tmp file
|
||||
*/
|
||||
protected function LoadKeysCache()
|
||||
{
|
||||
$sFileContent = @file_get_contents($this->m_sCacheFileName);
|
||||
if (!empty($sFileContent))
|
||||
{
|
||||
$aCache = unserialize($sFileContent);
|
||||
$this->m_aKeys = $aCache['keys'];
|
||||
$this->m_aObjectsCache = $aCache['objects'];
|
||||
$this->m_oChange = $aCache['change'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the tmp file used to store the keys cache
|
||||
*/
|
||||
protected function ClearKeysCache()
|
||||
{
|
||||
if(is_file($this->m_sCacheFileName))
|
||||
{
|
||||
unlink($this->m_sCacheFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
//echo "<p>Hm, it looks like the file does not exist!!!</p>";
|
||||
}
|
||||
$this->m_aKeys = array();
|
||||
$this->m_aObjectsCache = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to load the objects from a standard XML file into the database
|
||||
*/
|
||||
function LoadFile($sFilePath)
|
||||
{
|
||||
global $aKeys;
|
||||
|
||||
$oXml = simplexml_load_file($sFilePath);
|
||||
|
||||
$aReplicas = array();
|
||||
foreach($oXml as $sClass => $oXmlObj)
|
||||
{
|
||||
$iSrcId = (integer)$oXmlObj['id']; // Mandatory to cast
|
||||
|
||||
// Import algorithm
|
||||
// Here enumerate all the attributes of the object
|
||||
// for all attribute that is neither an external field
|
||||
// not an external key, assign it
|
||||
// Store all external keys for further reference
|
||||
// Create the object an store the correspondence between its newly created Id
|
||||
// and its original Id
|
||||
// Once all the objects have been created re-assign all the external keys to
|
||||
// their actual Ids
|
||||
$oTargetObj = MetaModel::NewObject($sClass);
|
||||
foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode=>$oAttDef)
|
||||
{
|
||||
if (($oAttDef->IsWritable()) && ($oAttDef->IsScalar()) && ($sAttCode != 'finalclass') )
|
||||
{
|
||||
if ($oAttDef->IsExternalKey())
|
||||
{
|
||||
$iDstObj = (integer)($oXmlObj->$sAttCode);
|
||||
$iExtKey = $this->GetObjectKey($oAttDef->GetTargetClass(), $iDstObj);
|
||||
if ($iExtKey == 0)
|
||||
{
|
||||
$iExtKey = -$iDstObj; // Convention: Unresolved keys are stored as negative !
|
||||
}
|
||||
$oTargetObj->Set($sAttCode, $iExtKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
$oTargetObj->Set($sAttCode, (string)$oXmlObj->$sAttCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->StoreObject($sClass, $oTargetObj, $iSrcId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the new ID of an object in the database given its original ID
|
||||
* This may fail (return 0) if the object has not yet been created in the database
|
||||
* This is why the order of the import may be important
|
||||
*/
|
||||
protected function GetObjectKey($sClass, $iSrcId)
|
||||
{
|
||||
if (isset($this->m_aKeys[$sClass]) && isset($this->m_aKeys[$sClass][$iSrcId]))
|
||||
{
|
||||
return $this->m_aKeys[$sClass][$iSrcId];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an object in the database and remember the mapping
|
||||
* between its original ID and the newly created ID in the database
|
||||
*/
|
||||
protected function StoreObject($sClass, $oTargetObj, $iSrcId)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (is_subclass_of($oTargetObj, 'CMDBObject'))
|
||||
{
|
||||
$iObjId = $oTargetObj->DBInsertTracked($this->m_oChange);
|
||||
}
|
||||
else
|
||||
{
|
||||
$iObjId = $oTargetObj->DBInsert();
|
||||
}
|
||||
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo $e->GetHtmlDesc();
|
||||
}
|
||||
$aParentClasses = MetaModel::EnumParentClasses($sClass);
|
||||
$aParentClasses[] = $sClass;
|
||||
foreach($aParentClasses as $sObjClass)
|
||||
{
|
||||
$this->m_aKeys[$sObjClass][$iSrcId] = $iObjId;
|
||||
}
|
||||
$this->m_aObjectsCache[$sClass][$iObjId] = $oTargetObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps an external key to its (newly created) value
|
||||
*/
|
||||
protected function ResolveExternalKeys()
|
||||
{
|
||||
foreach($this->m_aObjectsCache as $sClass => $oObjList)
|
||||
{
|
||||
foreach($oObjList as $oTargetObj)
|
||||
{
|
||||
$bChanged = false;
|
||||
$sClass = get_class($oTargetObj);
|
||||
foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode=>$oAttDef)
|
||||
{
|
||||
if ( ($oAttDef->IsExternalKey()) && ($oTargetObj->Get($sAttCode) < 0) ) // Convention unresolved key = negative
|
||||
{
|
||||
$iExtKey = $this->GetObjectKey($oAttDef->GetTargetClass(), -$oTargetObj->Get($sAttCode));
|
||||
if ($iExtKey == 0)
|
||||
{
|
||||
echo "Warning: unresolved extkey in $sClass::".$oTargetObj->GetName()."(".$oTargetObj->GetKey().")::$sAttCode=".$oAttDef->GetTargetClass()."[".$oTargetObj->Get($sAttCode)."]<br/>\n";
|
||||
echo "<pre>aKeys[".$oAttDef->GetTargetClass()."]:\n";
|
||||
print_r($this->m_aKeys[$oAttDef->GetTargetClass()]);
|
||||
echo "</pre>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$bChanged = true;
|
||||
$oTargetObj->Set($sAttCode, $iExtKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($bChanged)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (is_subclass_of($oTargetObj, 'CMDBObject'))
|
||||
{
|
||||
$oTargetObj->DBUpdateTracked($this->m_oChange);
|
||||
}
|
||||
else
|
||||
{
|
||||
$oTargetObj->DBUpdate();
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo $e->GetHtmlDesc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user