- First version of the setup wizard (fully operational)

SVN:code[17]
This commit is contained in:
Denis Flaven
2009-03-30 10:57:35 +00:00
parent cd3ab73759
commit e07255952a
4 changed files with 901 additions and 56 deletions

View File

@@ -13,15 +13,15 @@ define(MYSQL_MIN_VERSION, '5.0.0');
$sOperation = Utils::ReadParam('operation', 'step1');
$oP = new setup_web_page('iTop configuration wizard');
$oP->no_cache();
/**
* Helper function to check if the current version of PHP
* is compatible with the application
* @return boolean true if this is Ok, false otherwise
*/
function CheckPHPVersion(nice_web_page $oP)
function CheckPHPVersion(setup_web_page $oP)
{
$oP->log('Info - CheckPHPVersion');
if (version_compare(phpversion(), PHP_MIN_VERSION, '>='))
{
$oP->ok("The current PHP Version (".phpversion().") is greater than the minimum required version (".PHP_MIN_VERSION.")");
@@ -31,13 +31,30 @@ function CheckPHPVersion(nice_web_page $oP)
$oP->error("Error: The current PHP Version (".phpversion().") is lower than the minimum required version (".PHP_MIN_VERSION.")");
return false;
}
if (extension_loaded('mysql'))
$aMandatoryExtensions = array('mysql', 'iconv', 'simplexml');
asort($aMandatoryExtensions); // Sort the list to look clean !
$aExtensionsOk = array();
$aMissingExtensions = array();
$aMissingExtensionsLinks = array();
foreach($aMandatoryExtensions as $sExtension)
{
$oP->ok("The required extension 'mysql' is present.");
if (extension_loaded($sExtension))
{
$aExtensionsOk[] = $sExtension;
}
else
{
$aMissingExtensions[] = $sExtension;
$aMissingExtensionsLinks[] = "<a href=\"http://www.php.net/manual/en/book.$sExtension.php\">$sExtension</a>";
}
}
else
if (count($aExtensionsOk) > 0)
{
$oP->error("Error: missing required extension 'mysql'.");
$oP->ok("Required PHP extension(s): ".implode(', ', $aExtensionsOk).".");
}
if (count($aMissingExtensions) > 0)
{
$oP->error("Missing PHP extension(s): ".implode(', ', $aMissingExtensionsLinks).".");
return false;
}
return true;
@@ -48,9 +65,10 @@ function CheckPHPVersion(nice_web_page $oP)
* the existing databases
* @return Array The list of databases found in the server
*/
function CheckServerConnection(nice_web_page $oP, $sDBServer, $sDBUser, $sDBPwd)
function CheckServerConnection(setup_web_page $oP, $sDBServer, $sDBUser, $sDBPwd)
{
$aResult = array();
$oP->log('Info - CheckServerConnection');
try
{
$oDBSource = new CMDBSource;
@@ -66,7 +84,15 @@ function CheckServerConnection(nice_web_page $oP, $sDBServer, $sDBUser, $sDBPwd)
$oP->error("Error: Current MySQL version is ($sDBVersion), minimum required version (".MYSQL_MIN_VERSION.")");
return false;
}
$aResult = $oDBSource->ListDB();
try
{
$aResult = $oDBSource->ListDB();
}
catch(Exception $e)
{
$oP->warning("Warning: unable to enumerate the current databases.");
$aResult = true; // Not an array to differentiate with an empty array
}
}
catch(Exception $e)
{
@@ -76,14 +102,16 @@ function CheckServerConnection(nice_web_page $oP, $sDBServer, $sDBUser, $sDBPwd)
}
return $aResult;
}
/**
* Helper function to create the database structure
* @return boolean true on success, false otherwise
*/
function CreateDatabaseStructure(nice_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
* Helper function to initialize the ORM and load the data model
* from the given file
* @param $sConfigFileName string The name of the configuration file to load
* @param $bAllowMissingDatabase boolean Whether or not to allow loading a data model with no corresponding DB
* @return none
*/
function InitDataModel(setup_web_page $oP, $sConfigFileName, $bAllowMissingDatabase = true)
{
$oP->info("Creating the structure in '$sDBName' (prefix = '$sDBPrefix').");
require_once('../core/coreexception.class.inc.php');
require_once('../core/attributedef.class.inc.php');
require_once('../core/filterdef.class.inc.php');
@@ -96,7 +124,18 @@ function CreateDatabaseStructure(nice_web_page $oP, Config $oConfig, $sDBName, $
require_once('../core/dbobjectsearch.class.php');
require_once('../core/dbobjectset.class.php');
require_once('../core/userrights.class.inc.php');
MetaModel::Startup(TMP_CONFIG_FILE, true); // allow missing DB
$oP->log("Info - MetaModel::Startup from file '$sConfigFileName' (AllowMissingDB = $bAllowMissingDatabase)");
MetaModel::Startup($sConfigFileName, $bAllowMissingDatabase);
}
/**
* Helper function to create the database structure
* @return boolean true on success, false otherwise
*/
function CreateDatabaseStructure(setup_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
{
InitDataModel($oP, TMP_CONFIG_FILE, true); // Allow the DB to NOT exist since we're about to create it !
$oP->log('Info - CreateDatabaseStructure');
$oP->info("Creating the structure in '$sDBName' (prefix = '$sDBPrefix').");
//MetaModel::CheckDefinitions();
if (!MetaModel::DBExists())
{
@@ -106,6 +145,8 @@ function CreateDatabaseStructure(nice_web_page $oP, Config $oConfig, $sDBName, $
else
{
$oP->error("Error: database '$sDBName' (prefix = '$sDBPrefix') already exists.");
$oP->p("Tables with conflicting names already exist in the database.
Try selecting another database instance or specifiy a prefix to prevent conflicting table names.");
return false;
}
return true;
@@ -115,21 +156,10 @@ function CreateDatabaseStructure(nice_web_page $oP, Config $oConfig, $sDBName, $
* Helper function to create and administrator account for iTop
* @return boolean true on success, false otherwise
*/
function CreateAdminAccount(nice_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
function CreateAdminAccount(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
{
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(TMP_CONFIG_FILE, true); // allow missing DB
$oP->log('Info - CreateAdminAccount');
InitDataModel($oP, TMP_CONFIG_FILE, true); // allow missing DB
if (UserRights::CreateAdministrator($sAdminUser, $sAdminPwd))
{
$oP->ok("Administrator account '$sAdminUser' created.");
@@ -143,35 +173,82 @@ function CreateAdminAccount(nice_web_page $oP, Config $oConfig, $sAdminUser, $sA
}
/**
* Helper function to load some sample data into the database
* Helper function to load the standard menus into the database
*/
function LoadSampleData(nice_web_page $oP)
function LoadStandardMenus(setup_web_page $oP)
{
// TO BE IMPLEMENTED
$oP->log('Info - LoadStandardMenus');
$oXml = simplexml_load_file('menus.xml');
$aReplicas = array();
foreach($oXml as $oXmlMenu)
{
$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)
{
if (isset($aReplicas[$iSrcParentId]))
{
$oParentMenu = $aReplicas[$iSrcParentId]['dstObj'];
$oMenu = $aReplica['dstObj'];
$oMenu->Set('parent_id', $oParentMenu->GetKey());
$oMenu->DBUpdate();
}
}
}
$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;
}
/**
* Display the form for the first step of the configuration wizard
* which consists in the database server selection
*/
function DisplayStep1(nice_web_page $oP)
function DisplayStep1(setup_web_page $oP)
{
$sNextOperation = 'step2';
$oP->add("<h1>iTop configuration wizard</h1>\n");
$oP->add("<h2>Checking prerequisites</h2>\n");
if (CheckPHPVersion($oP))
{
$sRedStar = '<span class="hilite">*</span>';
$oP->add("<h2>Step 1: Configuration of the database connection</h2>\n");
$oP->add("<form method=\"post\">\n");
$oP->add("<form method=\"get\" onSubmit=\"return DoSubmit('Connection to the database...', 1)\">\n");
// Form goes here
$oP->add("<fieldset><legend>Database connection</legend>\n");
$aForm = array();
$aForm[] = array('label' => 'Server name:', 'input' => "<input type=\"text\" name=\"db_server\" value=\"\">",
$aForm[] = array('label' => "Server name$sRedStar:", 'input' => "<input id=\"db_server\" type=\"text\" name=\"db_server\" value=\"\">",
'help' => 'E.g. "localhost", "dbserver.mycompany.com" or "192.142.10.23".');
$aForm[] = array('label' => 'User name:', 'input' => "<input type=\"text\" name=\"db_user\" value=\"\">");
$aForm[] = array('label' => 'Password:', 'input' => "<input type=\"password\" name=\"db_pwd\" value=\"\">");
$aForm[] = array('label' => "User name$sRedStar:", 'input' => "<input id=\"db_user\" type=\"text\" name=\"db_user\" value=\"\">");
$aForm[] = array('label' => 'Password:', 'input' => "<input id=\"db_pwd\" type=\"password\" name=\"db_pwd\" value=\"\">");
$oP->form($aForm);
$oP->add("</fieldset>\n");
$oP->add("<input type=\"hidden\" name=\"operation\" value=\"$sNextOperation\">\n");
@@ -186,12 +263,12 @@ function DisplayStep1(nice_web_page $oP)
* 1) Validating the parameters by connecting to the database server
* 2) Prompting to select an existing database or to create a new one
*/
function DisplayStep2(nice_web_page $oP, Config $oConfig, $sDBServer, $sDBUser, $sDBPwd)
function DisplayStep2(setup_web_page $oP, Config $oConfig, $sDBServer, $sDBUser, $sDBPwd)
{
$sNextOperation = 'step3';
$oP->add("<h1>iTop configuration wizard</h1>\n");
$oP->add("<h2>Step 2: Database selection</h2>\n");
$oP->add("<form method=\"post\">\n");
$oP->add("<form method=\"post\" onSubmit=\"return DoSubmit('Creating database structure...', 2);\">\n");
$aDatabases = CheckServerConnection($oP, $sDBServer, $sDBUser, $sDBPwd);
if ($aDatabases === false)
{
@@ -206,18 +283,27 @@ function DisplayStep2(nice_web_page $oP, Config $oConfig, $sDBServer, $sDBUser,
$oConfig->SetDBPwd($sDBPwd);
$oConfig->WriteToFile();
$oP->add("<fieldset><legend>Specify a database</legend>\n");
$oP->add("<fieldset><legend>Specify a database<span class=\"hilite\">*</span></legend>\n");
$aForm = array();
foreach($aDatabases as $sDBName)
if (is_array($aDatabases))
{
$aForm[] = array('label' => "<input type=\"radio\" name=\"db_name\" value=\"$sDBName\" /> $sDBName");
foreach($aDatabases as $sDBName)
{
$aForm[] = array('label' => "<input id=\"db_$sDBName\" type=\"radio\" name=\"db_name\" value=\"$sDBName\" /><label for=\"db_$sDBName\"> $sDBName</label>");
}
}
$aForm[] = array('label' => "<input type=\"radio\" name=\"db_name\" value=\"\" /> create a new database: <input type=\"text\" name=\"new_db_name\" value=\"\" />");
else
{
$aForm[] = array('label' => "<input id=\"current_db\" type=\"radio\" name=\"db_name\" value=\"-1\" /><label for=\"current_db\"> Use the existing database: <input type=\"text\" id=\"current_db_name\" name=\"current_db_name\" value=\"\" maxlength=\"32\"/></label>");
$oP->add_ready_script("$('#current_db_name').click( function() { $('#current_db').attr('checked', true); });");
}
$aForm[] = array('label' => "<input id=\"new_db\" type=\"radio\" name=\"db_name\" value=\"\" /><label for=\"new_db\"> Create a new database: <input type=\"text\" id=\"new_db_name\" name=\"new_db_name\" value=\"\" maxlength=\"32\"/></label>");
$oP->form($aForm);
$oP->add_ready_script("$('#new_db_name').click( function() { $('#new_db').attr('checked', true); });");
$oP->add("</fieldset>\n");
$aForm = array();
$aForm[] = array('label' => "Add a prefix to all the tables: <input type=\"text\" name=\"db_prefix\" value=\"\" />");
$aForm[] = array('label' => "Add a prefix to all the tables: <input id=\"db_prefix\" type=\"text\" name=\"db_prefix\" value=\"\" maxlength=\"32\"/>");
$oP->form($aForm);
$oP->add("<input type=\"hidden\" name=\"operation\" value=\"$sNextOperation\">\n");
@@ -235,24 +321,25 @@ function DisplayStep2(nice_web_page $oP, Config $oConfig, $sDBServer, $sDBUser,
* 2) Creating the database structure
* 3) Prompting for the admin account to be created
*/
function DisplayStep3(nice_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
function DisplayStep3(setup_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
{
$sNextOperation = 'step4';
$oP->add("<h1>iTop configuration wizard</h1>\n");
$oP->add("<h2>Creation of the database structure</h2>\n");
$oP->add("<form method=\"post\">\n");
$oP->add("<form method=\"post\" onSubmit=\"return DoSubmit('Creating user and profiles...', 3);\">\n");
$oConfig->SetDBName($sDBName);
$oConfig->SetDBSubname($sDBPrefix);
$oConfig->WriteToFile(TMP_CONFIG_FILE);
if (CreateDatabaseStructure($oP, $oConfig, $sDBName, $sDBPrefix))
{
$sRedStar = "<span class=\"hilite\">*</span>";
$oP->add("<h2>Step 3: Definition of the administrator account</h2>\n");
// Database created, continue with admin creation
$oP->add("<fieldset><legend>Administrator account</legend>\n");
$aForm = array();
$aForm[] = array('label' => "Login:", 'input' => "<input type=\"text\" name=\"auth_user\" value=\"\">");
$aForm[] = array('label' => "Password:", 'input' => "<input type=\"password\" name=\"auth_pwd\" value=\"\">");
$aForm[] = array('label' => "Retype password:", 'input' => "<input type=\"password\" name=\"auth_pwd2\" value=\"\">");
$aForm[] = array('label' => "Login$sRedStar:", 'input' => "<input id=\"auth_user\" type=\"text\" name=\"auth_user\" value=\"\">");
$aForm[] = array('label' => "Password$sRedStar:", 'input' => "<input id=\"auth_pwd\" type=\"password\" name=\"auth_pwd\" value=\"\">");
$aForm[] = array('label' => "Retype password$sRedStar:", 'input' => "<input id=\"auth_pwd2\" type=\"password\" name=\"auth_pwd2\" value=\"\">");
$oP->form($aForm);
$oP->add("</fieldset>\n");
$oP->add("<input type=\"hidden\" name=\"operation\" value=\"$sNextOperation\">\n");
@@ -274,13 +361,13 @@ function DisplayStep3(nice_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
* 1) Creating the admin user account
* 2) Prompting to load some sample data
*/
function DisplayStep4(nice_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
function DisplayStep4(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
{
$sNextOperation = 'step5';
$oP->add("<h1>iTop configuration wizard</h1>\n");
$oP->add("<h2>Creation of the administrator account</h2>\n");
$oP->add("<form method=\"post\">\n");
$oP->add("<form method=\"post\" onSubmit=\"return DoSubmit('Finalizing configuration and loading data...', 4);\">\n");
if (CreateAdminAccount($oP, $oConfig, $sAdminUser, $sAdminPwd))
{
$oP->add("<h2>Step 4: Loading of sample data</h2>\n");
@@ -309,7 +396,7 @@ function DisplayStep4(nice_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPw
* 1) Creating the final configuration file
* 2) Prompting the user to make the file read-only
*/
function DisplayStep5(nice_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd, $bLoadSampleData)
function DisplayStep5(setup_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd, $bLoadSampleData)
{
try
{
@@ -319,8 +406,7 @@ function DisplayStep5(nice_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd,
$oConfig->WriteToFile(FINAL_CONFIG_FILE);
// Start the application
require_once('../application/application.inc.php');
require_once('../application/startup.inc.php');
InitDataModel($oP, FINAL_CONFIG_FILE, false); // DO NOT allow missing DB
if (UserRights::Login($sAuthUser, $sAuthPwd))
{
$_SESSION['auth_user'] = $sAuthUser;
@@ -328,11 +414,12 @@ function DisplayStep5(nice_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd,
// remove the tmp config file
@unlink(TMP_CONFIG_FILE);
// try to make the final config file read-only
@chmod(FINAL_CONFIG_FILE, "a-w");
@chmod(FINAL_CONFIG_FILE, 0440); // Read-only for owner and group, nothing for others
$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);
@@ -367,6 +454,39 @@ function DisplayStep5(nice_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd,
/**
* Main program
*/
clearstatcache(); // Make sure we know what we are doing !
if (file_exists(FINAL_CONFIG_FILE))
{
// The configuration file already exists
if (is_writable(FINAL_CONFIG_FILE))
{
$oP->warning("<b>Warning:</b> a configuration file '".FINAL_CONFIG_FILE."' already exists, and will be overwritten.");
}
else
{
$oP->add("<h1>iTop configuration wizard</h1>\n");
$oP->add("<h2>Fatal error</h2>\n");
$oP->error("<b>Error:</b> the configuration file '".FINAL_CONFIG_FILE."' already exists and cannot be overwritten.");
$oP->p("The wizard cannot create the configuration file for you. Please remove the file '<b>".realpath(FINAL_CONFIG_FILE)."</b>' or change its access-rights/read-only flag before continuing.");
$oP->output();
exit;
}
}
else
{
// No configuration file yet
// Check that the wizard can write into the root dir to create the configuration file
if (!is_writable(dirname(FINAL_CONFIG_FILE)))
{
$oP->add("<h1>iTop configuration wizard</h1>\n");
$oP->add("<h2>Fatal error</h2>\n");
$oP->error("<b>Error:</b> the directory where to store the configuration file is not writable.");
$oP->p("The wizard cannot create the configuration file for you. Please make sure that the directory '<b>".realpath(dirname(FINAL_CONFIG_FILE))."</b>' is writable for the web server.");
$oP->output();
exit;
}
}
try
{
$oConfig = new Config(TMP_CONFIG_FILE);
@@ -379,10 +499,13 @@ catch(Exception $e)
switch($sOperation)
{
case 'step1':
$oP->log("Info - ========= Wizard step 1 ========");
DisplayStep1($oP);
break;
case 'step2':
$oP->no_cache();
$oP->log("Info - ========= Wizard step 2 ========");
$sDBServer = Utils::ReadParam('db_server');
$sDBUser = Utils::ReadParam('db_user');
$sDBPwd = Utils::ReadParam('db_pwd');
@@ -390,6 +513,8 @@ switch($sOperation)
break;
case 'step3':
$oP->no_cache();
$oP->log("Info - ========= Wizard step 3 ========");
$sDBName = Utils::ReadParam('db_name');
if (empty($sDBName))
{
@@ -400,12 +525,16 @@ switch($sOperation)
break;
case 'step4':
$oP->no_cache();
$oP->log("Info - ========= Wizard step 4 ========");
$sAdminUser = Utils::ReadParam('auth_user');
$sAdminPwd = Utils::ReadParam('auth_pwd');
DisplayStep4($oP, $oConfig, $sAdminUser, $sAdminPwd);
break;
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');

615
setup/menus.xml Normal file
View File

@@ -0,0 +1,615 @@
<?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>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:32px;&quot;&gt;Tools for the iTop consultant&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:14px;&quot;&gt;&lt;i&gt;This section contains links to useful tools for extending or debugging iTop&lt;/i&gt;&lt;/p&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizApplication&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizApplication&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Applications&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizApplication&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizApplication&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizCircuit&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizCircuit&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Circuits&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizCircuit&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizCircuit&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContract&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContract&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizInterface&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Interfaces&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizInterface&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizNetworkDevice&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizNetworkDevice&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Network Devices&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizNetworkDevice&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizNetworkDevice&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizPatch&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizPatch&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Patches&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizPatch&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizPatch&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizPC&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All PCs&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizPC&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizServer&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Servers&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizServer&lt;/itopblock&gt;
&lt;/div&gt;
</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 &amp; Restore</name>
<label>Backup &amp; 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>&lt;img src=&quot;/images/imageChange.gif&quot; style=&quot;float:right&quot;&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;&quot;&gt;Changes Overview&lt;/p&gt;
&lt;table border=&quot;0&quot; padding=&quot;5&quot; class=&quot;layout&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Change by type&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizChangeTicket&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:type&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizChangeTicket&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Changes by status&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizChangeTicket&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:ticket_status;chart_title:Incidents by status&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizChangeTicket&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Changes by Workgroup&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizChangeTicket&quot; type=&quot;count&quot; parameters=&quot;group_by:workgroup_name&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Changes not yet assigned&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizChangeTicket&quot; type=&quot;list&quot; parameters=&quot;dashboard:true&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: ticket_status = &apos;New&apos;&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: ticket_status = &apos;Closed&apos;&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: ticket_status = &apos;Closed&apos;&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizIncidentTicket: ticket_status Contains &apos;Open&apos; AND severity Contains &apos;critical&apos;&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizIncidentTicket: ticket_status = &apos;Closed&apos;&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:left; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:40px;&quot;&gt;&lt;img src=&quot;/images/devices_big.gif&quot; align=&quot;baseline&quot;&gt;Devices Overview&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table border=&quot;0&quot; padding=&quot;5&quot; class=&quot;layout&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:18px;&quot;&gt;Servers&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizServer&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:severity&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizServer&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:18px;&quot;&gt;PCs&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizPC&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:severity&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizPC&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:18px;&quot;&gt;Netword Devices&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizNetworDevice type=&quot;pie_chart&quot; parameters=&quot;group_by:severity&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizNetworkDevice&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:18px;&quot;&gt;Applications&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizApplication&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:severity&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizApplication&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</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>&lt;style&gt;
td.dashboard {
vertical-align:top;
text-align: center;
border: 1px solid #ccc;
-moz-border-radius: 10px;
padding: 10px;
}
&lt;/style&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;&quot;&gt;Infrastructure Overview&lt;/p&gt;
&lt;table border=&quot;0&quot; padding=&quot;5&quot; class=&quot;layout&quot;&gt;
&lt;tr&gt;
&lt;td class=&quot;dashboard&quot;&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;logInfra&quot; type=&quot;open_flash_chart&quot; parameters=&quot;chart_type:pie;group_by:status;chart_title:Infrastructure Objects by status&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT logInfra&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td class=&quot;dashboard&quot;&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;logInfra&quot; type=&quot;open_flash_chart&quot; parameters=&quot;chart_type:bars;group_by:finalclass;chart_title:Infrastructure Objects by type&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT logInfra&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td class=&quot;dashboard&quot;&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Infrastructure Objects by type&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;logInfra&quot; type=&quot;count&quot; parameters=&quot;group_by:finalclass&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;logInfra&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&amp;nbsp;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</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>&lt;img src=&quot;/images/users2-big.png&quot; style=&quot;float:right&quot;&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;&quot;&gt;Contacts Overview&lt;/p&gt;
&lt;table border=&quot;0&quot; padding=&quot;5&quot; class=&quot;layout&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Contacts by Type&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;count&quot; parameters=&quot;group_by:finalclass&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContact&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Contacts by Location&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;count&quot; parameters=&quot;group_by:location_name&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContact&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Contacts by status&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;count&quot; parameters=&quot;group_by:status&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContact&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/table&gt;</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 &apos;Document&apos;</label>
<hyperlink>UI.php</hyperlink>
<template>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizDocument&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Documents&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizDocument&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizInfraGroup&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizInfraGroup&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Groups&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;Infra Group&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizInfraGroup&lt;/itopblock&gt;
&lt;/div&gt;
</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>&lt;img src=&quot;/images/messagebox_warning.png&quot; style=&quot;float:right&quot;&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;&quot;&gt;Incidents Overview&lt;/p&gt;
&lt;table border=&quot;0&quot; padding=&quot;5&quot; class=&quot;layout&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizIncidentTicket&quot; type=&quot;open_flash_chart&quot; parameters=&quot;group_by:severity;chart_title:Incidents by Severity&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizIncidentTicket&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizIncidentTicket&quot; type=&quot;open_flash_chart&quot; parameters=&quot;group_by:ticket_status;chart_title:Incidents by status&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizIncidentTicket&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Incidents by Workgroup&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizIncidentTicket&quot; type=&quot;count&quot; parameters=&quot;group_by:workgroup_name&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizIncidentTicket&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Incidents not yet assigned&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizIncidentTicket&quot; type=&quot;list&quot; parameters=&quot;dashboard:true&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizIncidentTicket: ticket_status = &apos;New&apos;&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizKnownErrort&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizKnownError&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizKnownError&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizKnownError&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizLocation&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizLocation&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:24px;&quot;&gt;All Locations&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizLocation&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizLocation&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:32px;&quot;&gt;My bookmark&lt;/p&gt;
&lt;p style=&quot;text-align:center; font-family:Georgia, &apos;Times New Roman&apos;, Times, serif; font-size:14px;&quot;&gt;&lt;i&gt;This section contains my most favorite search&lt;/i&gt;&lt;/p&gt;
</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>&lt;div id=&quot;TopPane&quot;&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizNetworkDevice: org_id = 3 AND brand Contains &apos;Cisco&apos;&lt;/itopblock&gt;
&lt;/div&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizNetworkDevice: org_id = 3 AND brand Contains &apos;Cisco&apos;&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;div id=&quot;TopPane&quot;&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;lnkClientServer&lt;/itopblock&gt;
&lt;/div&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;lnkClientServer&lt;/itopblock&gt;
&lt;/div&gt;</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>
<template>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContract: status = &apos;Negotiating&apos;&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContract: status = &apos;Negotiating&apos;&lt;/itopblock&gt;
&lt;/div&gt;</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>
<template>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: ticket_status != &apos;Closed&apos;&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: ticket_status != &apos;Closed&apos;&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizIncidentTicket: ticket_status Contains &apos;Open&apos; AND severity Contains &apos;critical&apos;&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizIncidentTicket: ticket_status != &apos;Closed&apos;&lt;/itopblock&gt;
&lt;/div&gt;</template>
<rank>1</rank>
<type>application</type>
</menuNode>
<menuNode id="14">
<parent_id>2</parent_id>
<name>Persons</name>
<label>Any contact of class &apos;Person&apos;</label>
<hyperlink>UI.php</hyperlink>
<template>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizPerson&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizPerson&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizChangeTicket&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: outage = &apos;Yes&apos; AND ticket_status != &apos;Closed&apos;&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizChangeTicket&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizChangeTicket: outage = &apos;Yes&apos; AND ticket_status != &apos;Closed&apos;&lt;/itopblock&gt;
&lt;/div&gt;</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>&lt;img src=&quot;/images/erwanContracts.jpg&quot; style=&quot;float:right&quot;&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:24px;&quot;&gt;Contracts Overview&lt;/p&gt;
&lt;table border=&quot;0&quot; padding=&quot;5&quot; class=&quot;layout&quot;&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Contracts by Service Level&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContract&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:service_level&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContract&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Contracts by Status&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContract&quot; type=&quot;pie_chart&quot; parameters=&quot;group_by:status&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizContract&lt;/itopblock&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;
&lt;p style=&quot;text-align:left; font-family:Verdana, Arial, sans-serif; font-size:16px;&quot;&gt;Contracts end in 30 days&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContract&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT bizContract AS C WHERE (TO_DAYS(NOW()) - TO_DAYS(C.end_prod)) &lt; 31&lt;/itopblock&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</template>
<rank>5</rank>
<type>application</type>
</menuNode>
<menuNode id="43">
<parent_id>2</parent_id>
<name>Teams</name>
<label>Any contact of class &apos;team&apos;</label>
<hyperlink>UI.php</hyperlink>
<template>&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizTeam&lt;/itopblock&gt;
&lt;div id=&quot;BottomPane&quot;&gt;
&lt;p&gt;&lt;/p&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; objectclass=&quot;bizContact&quot; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/sibusql&quot;&gt;bizTeam&lt;/itopblock&gt;
&lt;/div&gt;</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>

83
setup/setup.js Normal file
View File

@@ -0,0 +1,83 @@
function NameIsValid(name)
{
sName = new String(name);
if (sName.match(/^[A-Za-z][A-Za-z0-9_]*$/)) return true;
return false;
}
function DoSubmit(sMsg, iStep)
{
var bResult = true;
switch(iStep)
{
case 1:
if ($('#db_server').val() == '')
{
alert('Please specify a database server. Use "localhost" for a local DB server.');
bResult = false;
}
else if ($('#db_user').val() == '')
{
alert('Please specify a user name to connect to the database.');
bResult = false;
}
break;
case 2:
if ($("input[@type=radio]:checked").length < 1)
{
alert('Please specify a database name');
bResult = false;
}
else if( ($("#new_db:checked").length == 1))
{
if ($('#new_db_name').val() == '')
{
alert('Please specify the name of the database to create');
bResult = false;
}
else if (!NameIsValid($('#new_db_name').val()))
{
alert($('#new_db_name').val()+' is not a valid database name. Please limit yourself to letters, numbers and the underscore character.');
bResult = false;
}
}
else if ($("#current_db:checked").length == 1)
{
// Special case (DB enumeration failed, user must enter DB name)
if ($("#current_db_name").val() == '')
{
alert('Please specify the name of the database.');
bResult = false;
}
else
{
// Copy the typed value as the value of the radio
$("#current_db").val($("#current_db_name").val());
}
}
if( ($('#db_prefix').val() != '') && (!NameIsValid($('#db_prefix').val())) )
{
alert($('#db_prefix').val()+' is not a valid table name. Please limit yourself to letters, numbers and the underscore character.');
bResult = false;
}
break;
case 3:
if ($('#auth_user').val() == '')
{
alert('Please specify a login name for the administrator account');
bResult = false;
}
else if ($('#auth_pwd').val() != $('#auth_pwd2').val())
{
alert('Retyped password does not match! Please verify the password.');
bResult = false;
}
break;
}
if (bResult)
{
$('#setup').block({message: '<img src="../images/indicator.gif">&nbsp;'+sMsg});
}
return bResult;
}

View File

@@ -1,5 +1,6 @@
<?php
require_once("../application/nicewebpage.class.inc.php");
define(INSTALL_LOG_FILE, '../setup.log');
/**
* Web page used for displaying the login form
*/
@@ -8,6 +9,8 @@ class setup_web_page extends nice_web_page
public function __construct($sTitle)
{
parent::__construct($sTitle);
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script("./setup.js");
$this->add_style("
body {
background-color: #eee;
@@ -92,21 +95,25 @@ table.formTable {
public function info($sText)
{
$this->add("<p class=\"info\">$sText</p>\n");
$this->log("Info - ".$sText);
}
public function ok($sText)
{
$this->add("<p class=\"ok\">$sText</p>\n");
$this->log("Ok - ".$sText);
}
public function warning($sText)
{
$this->add("<p class=\"warning\">$sText</p>\n");
$this->log("Warning - ".$sText);
}
public function error($sText)
{
$this->add("<p class=\"error\">$sText</p>\n");
$this->log("Error - ".$sText);
}
public function form($aData)
@@ -145,5 +152,16 @@ table.formTable {
$this->s_content = "<div id=\"setup\">{$this->s_content}\n</div>\n";
return parent::output();
}
public function log($sText)
{
$hLogFile = @fopen(INSTALL_LOG_FILE, 'a');
if ($hLogFile !== false)
{
$sDate = date('Y-m-d H:i:s');
fwrite($hLogFile, "$sDate - $sText\n");
fclose($hLogFile);
}
}
} // End of class
?>