Finalization of the user management by profile (UI to manage the accounts), and some unrelated changes:

- Using class labels in the UI
- Data model: you may specify a set of allowed values from a query (see caller_id in bizIncident class), still not 100% used in the UI but does not generate any error
- Data model: you may specify a password field (AttributePassword replacing AttributeString)
- Setup: calling UserRight::Setup() right after calling UserRight::CreateAdministrator()
- Setup: administrator account created with "my organization" and a dedicated contact
- Menus: optimized the load of std menus (queries written in OQL to get the benefit of the query cache)
- Menus: admin tools, seen only by people having the "admin" profile
- Object edition: fixed bug with the display of N-N links in the form

SVN:trunk[110]
This commit is contained in:
Romain Quetiez
2009-09-04 15:22:40 +00:00
parent e1be74457a
commit 2f26ebe54c
36 changed files with 3112 additions and 2524 deletions

View File

@@ -178,6 +178,11 @@ class UserRightsMatrix extends UserRightsAddOnAPI
return true;
}
public function IsAdministrator($iUserId)
{
return ($iUserId == 1);
}
public function Setup()
{
// Users must be added manually

View File

@@ -22,6 +22,11 @@ class UserRightsNull extends UserRightsAddOnAPI
return true;
}
public function IsAdministrator($iUserId)
{
return true;
}
public function Setup()
{
return true;

File diff suppressed because it is too large Load Diff

View File

@@ -100,11 +100,71 @@ abstract class cmdbAbstractObject extends CMDBObject
return $sDisplayValue;
}
function DisplayBareHeader(web_page $oPage)
{
// Standard Header with name, actions menu and history block
//
$oPage->add("<div class=\"page_header\">\n");
// action menu
$oSingletonFilter = new DBObjectSearch(get_class($this));
$oSingletonFilter->AddCondition('pkey', array($this->GetKey()));
$oBlock = new MenuBlock($oSingletonFilter, 'popup', false);
$oBlock->Display($oPage, -1);
$oPage->add("<h1>".MetaModel::GetName(get_class($this)).": <span class=\"hilite\">".$this->GetDisplayName()."</span></h1>\n");
// history block (with toggle)
$oHistoryFilter = new DBObjectSearch('CMDBChangeOpSetAttribute');
$oHistoryFilter->AddCondition('objkey', $this->GetKey());
$oBlock = new HistoryBlock($oHistoryFilter, 'toggle', false);
$oBlock->Display($oPage, -1);
$oPage->add("</div>\n");
}
function DisplayBareDetails(web_page $oPage)
{
$oPage->add($this->GetBareDetails($oPage));
}
function DisplayBareRelations(web_page $oPage)
{
// Related objects
$oPage->AddTabContainer('Related Objects');
$oPage->SetCurrentTabContainer('Related Objects');
foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode=>$oAttDef)
{
if ((get_class($oAttDef) == 'AttributeLinkedSetIndirect') || (get_class($oAttDef) == 'AttributeLinkedSet'))
{
$oPage->SetCurrentTab($oAttDef->GetLabel());
$oPage->p($oAttDef->GetDescription());
if (get_class($oAttDef) == 'AttributeLinkedSet')
{
$sTargetClass = $oAttDef->GetLinkedClass();
$oFilter = new DBObjectSearch($sTargetClass);
$oFilter->AddCondition($oAttDef->GetExtKeyToMe(), $this->GetKey()); // @@@ condition has same name as field ??
$oBlock = new DisplayBlock($oFilter, 'list', false);
$oBlock->Display($oPage, 0);
}
else // get_class($oAttDef) == 'AttributeLinkedSetIndirect'
{
$sLinkClass = $oAttDef->GetLinkedClass();
// Transform the DBObjectSet into a CMBDObjectSet !!!
$aLinkedObjects = $this->Get($sAttCode)->ToArray(false);
if (count($aLinkedObjects) > 0)
{
$oSet = CMDBObjectSet::FromArray($sLinkClass, $aLinkedObjects);
$this->DisplaySet($oPage, $oSet, $oAttDef->GetExtKeyToMe(), true, false, $this->GetKey(), $oAttDef->GetExtKeyToRemote());
}
}
}
}
$oPage->SetCurrentTab('');
}
function GetDisplayName()
{
return $this->GetAsHTML(MetaModel::GetNameAttributeCode(get_class($this)));
@@ -152,56 +212,11 @@ abstract class cmdbAbstractObject extends CMDBObject
}
else
{
// Standard Header with name, actions menu and history block
$oPage->add("<div class=\"page_header\">\n");
$oSingletonFilter = new DBObjectSearch(get_class($this));
$oSingletonFilter->AddCondition('pkey', array($this->GetKey()));
$oBlock = new MenuBlock($oSingletonFilter, 'popup', false);
$oBlock->Display($oPage, -1);
$oPage->add("<h1>".Metamodel::GetName(MetaModel::GetName(get_class($this))).": <span class=\"hilite\">".$this->GetDisplayName()."</span></h1>\n");
$oHistoryFilter = new DBObjectSearch('CMDBChangeOpSetAttribute');
$oHistoryFilter->AddCondition('objkey', $this->GetKey());
$oBlock = new HistoryBlock($oHistoryFilter, 'toggle', false);
$oBlock->Display($oPage, -1);
$oPage->add("</div>\n");
// Object's details
// template not found display the object using the *old style*
self::DisplayBareDetails($oPage);
// Related objects
$oPage->AddTabContainer('Related Objects');
$oPage->SetCurrentTabContainer('Related Objects');
foreach(MetaModel::ListAttributeDefs(get_class($this)) as $sAttCode=>$oAttDef)
{
if ((get_class($oAttDef) == 'AttributeLinkedSetIndirect') || (get_class($oAttDef) == 'AttributeLinkedSet'))
{
$oPage->SetCurrentTab($oAttDef->GetLabel());
$oPage->p($oAttDef->GetDescription());
if (get_class($oAttDef) == 'AttributeLinkedSet')
{
$sTargetClass = $oAttDef->GetLinkedClass();
$oFilter = new DBObjectSearch($sTargetClass);
$oFilter->AddCondition($oAttDef->GetExtKeyToMe(), $this->GetKey()); // @@@ condition has same name as field ??
$oBlock = new DisplayBlock($oFilter, 'list', false);
$oBlock->Display($oPage, 0);
}
else // get_class($oAttDef) == 'AttributeLinkedSetIndirect'
{
$sLinkClass = $oAttDef->GetLinkedClass();
// Transform the DBObjectSet into a CMBDObjectSet !!!
$aLinkedObjects = $this->Get($sAttCode)->ToArray(false);
if (count($aLinkedObjects) > 0)
{
$oSet = CMDBObjectSet::FromArray($sLinkClass, $aLinkedObjects);
$this->DisplaySet($oPage, $oSet, $oAttDef->GetExtKeyToMe());
}
}
}
}
$oPage->SetCurrentTab('');
$this->DisplayBareHeader($oPage);
$this->DisplayBareDetails($oPage);
$this->DisplayBareRelations($oPage);
}
}
@@ -218,10 +233,10 @@ abstract class cmdbAbstractObject extends CMDBObject
}
// Comment by Rom: this helper may be used to display objects of class DBObject
// -> I am using this to display the changes history
public static function DisplaySet(web_page $oPage, CMDBObjectSet $oSet, $sLinkageAttribute = '', $bDisplayMenu = true, $bSelectMode = false, $iObjectId = 0)
// -> I am using this to display the changes history
public static function DisplaySet(web_page $oPage, CMDBObjectSet $oSet, $sLinkageAttribute = '', $bDisplayMenu = true, $bSelectMode = false, $iObjectId = 0, $sTargetAttribute = '')
{
$oPage->add(self::GetDisplaySet($oPage, $oSet, array( 'link_attr' => $sLinkageAttribute, 'object_id' => $iObjectId, 'menu' => $bDisplayMenu, 'selection_mode' => $bSelectMode)));
$oPage->add(self::GetDisplaySet($oPage, $oSet, array( 'link_attr' => $sLinkageAttribute, 'object_id' => $iObjectId, 'target_attr' => $sTargetAttribute, 'menu' => $bDisplayMenu, 'selection_mode' => $bSelectMode)));
}
//public static function GetDisplaySet(web_page $oPage, CMDBObjectSet $oSet, $sLinkageAttribute = '', $bDisplayMenu = true, $bSelectMode = false)
@@ -238,7 +253,7 @@ abstract class cmdbAbstractObject extends CMDBObject
{
if($iLinkedObjectId == 0)
{
// if 'links' mode is requested the d of the object to link to must be specified
// if 'links' mode is requested the id of the object to link to must be specified
throw new ApplicationException("Parameter object_id is mandatory when link_attr is specified. Check the definition of the display template.");
}
if($sTargetAttr == '')
@@ -438,9 +453,9 @@ abstract class cmdbAbstractObject extends CMDBObject
$sClassName = $oSet->GetFilter()->GetClass();
$sHtml .= "<div class=\"mini_tabs\" id=\"mini_tabs{$iSearchFormId}\"><ul>
<li><a href=\"#\" onClick=\"$('div.mini_tab{$iSearchFormId}').toggle();$('#mini_tabs{$iSearchFormId} ul li a').toggleClass('selected');\">OQL Query</a></li>
<li><a class=\"selected\" href=\"#\" onClick=\"$('div.mini_tab{$iSearchFormId}').toggle();$('#mini_tabs{$iSearchFormId} ul li a').toggleClass('selected');\">Simple Search</a></li>
</ul></div>\n";
<li><a href=\"#\" onClick=\"$('div.mini_tab{$iSearchFormId}').toggle();$('#mini_tabs{$iSearchFormId} ul li a').toggleClass('selected');\">OQL Query</a></li>
<li><a class=\"selected\" href=\"#\" onClick=\"$('div.mini_tab{$iSearchFormId}').toggle();$('#mini_tabs{$iSearchFormId} ul li a').toggleClass('selected');\">Simple Search</a></li>
</ul></div>\n";
// Simple search form
$sHtml .= "<div id=\"SimpleSearchForm{$iSearchFormId}\" class=\"mini_tab{$iSearchFormId}\">\n";
$sHtml .= "<h1>Search for ".MetaModel::GetName($sClassName)." Objects</h1>\n";
@@ -487,32 +502,33 @@ abstract class cmdbAbstractObject extends CMDBObject
}
}
}
$aAllowedValues = MetaModel::GetAllowedValues_flt($sClassName, $sFilterCode, array(), '');
if ($aAllowedValues != null)
{
//Enum field or external key, display a combo
$sValue = "<select name=\"$sFilterCode\">\n";
$sValue .= "<option value=\"\">* Any *</option>\n";
foreach($aAllowedValues as $key => $value)
{
if ($sFilterValue == $key)
{
$sSelected = ' selected';
}
else
{
$sSelected = '';
}
$sValue .= "<option value=\"$key\"$sSelected>$value</option>\n";
}
$sValue .= "</select>\n";
$sHtml .= "<td><label>".MetaModel::GetFilterLabel($sClassName, $sFilterCode).":</label></td><td>$sValue</td>\n";
}
else
{
// Any value is possible, display an input box
$sHtml .= "<td><label>".MetaModel::GetFilterLabel($sClassName, $sFilterCode).":</label></td><td><input class=\"textSearch\" name=\"$sFilterCode\" value=\"$sFilterValue\"/></td>\n";
}
// #@# todo - add context information, otherwise any value will be authorized for external keys
$aAllowedValues = MetaModel::GetAllowedValues_flt($sClassName, $sFilterCode, array());
if ($aAllowedValues != null)
{
//Enum field or external key, display a combo
$sValue = "<select name=\"$sFilterCode\">\n";
$sValue .= "<option value=\"\">* Any *</option>\n";
foreach($aAllowedValues as $key => $value)
{
if ($sFilterValue == $key)
{
$sSelected = ' selected';
}
else
{
$sSelected = '';
}
$sValue .= "<option value=\"$key\"$sSelected>$value</option>\n";
}
$sValue .= "</select>\n";
$sHtml .= "<td><label>".MetaModel::GetFilterLabel($sClassName, $sFilterCode).":</label></td><td>$sValue</td>\n";
}
else
{
// Any value is possible, display an input box
$sHtml .= "<td><label>".MetaModel::GetFilterLabel($sClassName, $sFilterCode).":</label></td><td><input class=\"textSearch\" name=\"$sFilterCode\" value=\"$sFilterValue\"/></td>\n";
}
$index++;
}
if (($index % $numCols) != 0)
@@ -577,6 +593,10 @@ abstract class cmdbAbstractObject extends CMDBObject
$sHTMLValue = "<input type=\"text\" size=\"20\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" id=\"$iInputId\" class=\"date-pick\"/>";
break;
case 'Password':
$sHTMLValue = "<input type=\"password\" size=\"20\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" id=\"$iInputId\"/>";
break;
case 'Text':
$sHTMLValue = "<textarea name=\"attr_{$sAttCode}{$sNameSuffix}\" rows=\"8\" cols=\"40\" id=\"$iInputId\">$value</textarea>";
break;
@@ -588,39 +608,41 @@ abstract class cmdbAbstractObject extends CMDBObject
case 'String':
default:
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, array(), '');
if ($aAllowedValues !== null)
{
//Enum field or external key, display a combo
if (count($aAllowedValues) == 0)
// #@# todo - add context information (depending on dimensions)
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, array());
if ($aAllowedValues !== null)
{
$sHTMLValue = "<input type=\"text\" size=\"70\" value=\"\" name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\"/>";
}
else if (count($aAllowedValues) > 50)
{
// too many choices, use an autocomplete
// The input for the auto complete
$sHTMLValue = "<input type=\"text\" id=\"label_$iInputId\" size=\"50\" name=\"\" value=\"$sDisplayValue\" />";
// another hidden input to store & pass the object's Id
$sHTMLValue .= "<input type=\"hidden\" id=\"$iInputId\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" />\n";
$oPage->add_ready_script("\$('#label_$iInputId').autocomplete('./ajax.render.php', { minChars:3, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, autoFill:true, keyHolder:'#$iInputId', extraParams:{operation:'autocomplete', sclass:'$sClass',attCode:'".$sAttCode."'}});");
//Enum field or external key, display a combo
if (count($aAllowedValues) == 0)
{
$sHTMLValue = "<input type=\"text\" size=\"70\" value=\"\" name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\"/>";
}
else if (count($aAllowedValues) > 50)
{
// too many choices, use an autocomplete
// The input for the auto complete
$sHTMLValue = "<input type=\"text\" id=\"label_$iInputId\" size=\"50\" name=\"\" value=\"$sDisplayValue\" />";
// another hidden input to store & pass the object's Id
$sHTMLValue .= "<input type=\"hidden\" id=\"$iInputId\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" />\n";
$oPage->add_ready_script("\$('#label_$iInputId').autocomplete('./ajax.render.php', { minChars:3, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, autoFill:true, keyHolder:'#$iInputId', extraParams:{operation:'autocomplete', sclass:'$sClass',attCode:'".$sAttCode."'}});");
}
else
{
// Few choices, use a normal 'select'
$sHTMLValue = "<select name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\">\n";
foreach($aAllowedValues as $key => $display_value)
{
$sSelected = ($value == $key) ? ' selected' : '';
$sHTMLValue .= "<option value=\"$key\"$sSelected>$display_value</option>\n";
}
$sHTMLValue .= "</select>\n";
}
}
else
{
// Few choices, use a normal 'select'
$sHTMLValue = "<select name=\"attr_{$sAttCode}{$sNameSuffix}\" id=\"$iInputId\">\n";
foreach($aAllowedValues as $key => $display_value)
{
$sSelected = ($value == $key) ? ' selected' : '';
$sHTMLValue .= "<option value=\"$key\"$sSelected>$display_value</option>\n";
}
$sHTMLValue .= "</select>\n";
$sHTMLValue = "<input type=\"text\" size=\"50\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" id=\"$iInputId\">";
}
}
else
{
$sHTMLValue = "<input type=\"text\" size=\"50\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" id=\"$iInputId\">";
}
break;
}
}
return $sHTMLValue;

View File

@@ -31,7 +31,7 @@ class InputOutputTask extends cmdbAbstractObject
MetaModel::Init_AddAttribute(new AttributeEnum("source_type", array("label"=>"Source Type", "description"=>"Type of data source", "allowed_values"=>new ValueSetEnum('File, Database, Web Service'), "sql"=>"source_type", "default_value"=>"File", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("source_subtype", array("label"=>"Source Subtype", "description"=>"Subtype of Data Source", "allowed_values"=>new ValueSetEnum('Oracle, MySQL, Postgress, MSSQL, SOAP, HTTP-Get, HTTP-Post, XML/RPC, CSV, XML, Excel'), "sql"=>"source_subtype", "default_value"=>"CSV", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("source_path", array("label"=>"Source Path", "description"=>"Path to the icon o the menu", "allowed_values"=>null, "sql"=>"source_path", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("objects_class", array("label"=>"Objects Class", "description"=>"Class of the objects processed by this task", "allowed_values"=>new ValueSetEnum('bizOrganization, bizContact, bizTeam, bizPerson, bizLocation, bizServer, bizPC, bizNetworkDevice, bizInterface, bizService, bizContract, bizInfraGroup, bizIncidentTicket, bizSoftware, bizApplication, bizPatch, bizWorkgroup, lnkContactRealObject, lnkInterfaces, bizInfraGrouping' ), "sql"=>"objects_class", "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("objects_class", array("label"=>"Objects Class", "description"=>"Class of the objects processed by this task", "allowed_values"=>new ValueSetEnumClasses(), "sql"=>"objects_class", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("test_mode", array("label"=>"Test Mode", "description"=>"If set to 'Yes' the modifications are not applied", "allowed_values"=>new ValueSetEnum('Yes,No'), "sql"=>"test_mode", "default_value"=>'No', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("verbose_mode", array("label"=>"Verbose Mode", "description"=>"If set to 'Yes' extra debug information is added to the log", "allowed_values"=>new ValueSetEnum('Yes,No'), "sql"=>"verbose_mode", "default_value" => 'No', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("options", array("label"=>"Options", "description"=>"Reconciliation options", "allowed_values"=>new ValueSetEnum('Full, Update Only, Creation Only'), "sql"=>"options", "default_value"=> 'Full', "is_null_allowed"=>true, "depends_on"=>array())));

View File

@@ -158,29 +158,44 @@ EOF
$this->AddToMenu("</select></form>\n");
$this->AddToMenu("</div>\n");
$this->AddToMenu("<ul id=\"browser\" class=\"dir\">\n");
$oAppContext = new ApplicationContext();
// Display the menu
// 1) Application defined menus
$oSearchFilter = $oContext->NewFilter("menuNode");
$oSearchFilter->AddCondition('parent_id', 0, '=');
$oSearchFilter->AddCondition('type', 'application', '=');
// There may be more criteria added later to have a specific menu based on the user's profile
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
while ($oRootMenuNode = $oSet->Fetch())
{
$oRootMenuNode->DisplayMenu($this, 'application', $oAppContext->GetAsHash());
}
// 2) User defined menus (Bookmarks)
$oSearchFilter = $oContext->NewFilter("menuNode");
$oSearchFilter->AddCondition('parent_id', 0, '=');
$oSearchFilter->AddCondition('type', 'user', '=');
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
// There may be more criteria added later to have a specific menu based on the user's profile
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
while ($oRootMenuNode = $oSet->Fetch())
{
$oRootMenuNode->DisplayMenu($this, 'user', $oAppContext->GetAsHash());
}
// Display the menu
$oAppContext = new ApplicationContext();
// 1) Application defined menus
$oSearchFilter = $oContext->NewFilter("menuNode");
$oSearchFilter->AddCondition('parent_id', 0, '=');
$oSearchFilter->AddCondition('type', 'application', '=');
// There may be more criteria added later to have a specific menu based on the user's profile
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
while ($oRootMenuNode = $oSet->Fetch())
{
$oRootMenuNode->DisplayMenu($this, 'application', $oAppContext->GetAsHash());
}
// 2) User defined menus (Bookmarks)
$oSearchFilter = $oContext->NewFilter("menuNode");
$oSearchFilter->AddCondition('parent_id', 0, '=');
$oSearchFilter->AddCondition('type', 'user', '=');
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
// There may be more criteria added later to have a specific menu based on the user's profile
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
while ($oRootMenuNode = $oSet->Fetch())
{
$oRootMenuNode->DisplayMenu($this, 'user', $oAppContext->GetAsHash());
}
// 3) Administrator menu
if (userRights::IsAdministrator())
{
$oSearchFilter = $oContext->NewFilter("menuNode");
$oSearchFilter->AddCondition('parent_id', 0, '=');
$oSearchFilter->AddCondition('type', 'administrator', '=');
// There may be more criteria added later to have a specific menu based on the user's profile
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
while ($oRootMenuNode = $oSet->Fetch())
{
$oRootMenuNode->DisplayMenu($this, 'administrator', $oAppContext->GetAsHash());
}
}
$this->AddToMenu("</ul>\n");
}

View File

@@ -42,7 +42,7 @@ class menuNode extends DBObject
MetaModel::Init_AddAttribute(new AttributeString("hyperlink", array("label"=>"Hyperlink", "description"=>"Hyperlink to the page", "allowed_values"=>null, "sql"=>"hyperlink", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("icon_path", array("label"=>"Menu Icon", "description"=>"Path to the icon o the menu", "allowed_values"=>null, "sql"=>"icon_path", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeText("template", array("label"=>"Template", "description"=>"HTML template for the view", "allowed_values"=>null, "sql"=>"template", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("type", array("label"=>"Type", "description"=>"Type of menu", "allowed_values"=>new ValueSetEnum('application,user'), "sql"=>"type", "default_value"=>"application", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("type", array("label"=>"Type", "description"=>"Type of menu", "allowed_values"=>new ValueSetEnum('application,user,administrator'), "sql"=>"type", "default_value"=>"application", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeInteger("rank", array("label"=>"Display rank", "description"=>"Sort order for displaying the menu", "allowed_values"=>null, "sql"=>"rank", "default_value" => 999, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("parent_id", array("label"=>"Parent Menu Item", "description"=>"Parent Menu Item", "allowed_values"=>null, "sql"=>"parent_id", "targetclass"=>"menuNode", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalField("parent_name", array("label"=>"Parent Menu Item", "description"=>"Parent Menu Item", "allowed_values"=>null, "extkey_attcode"=>"parent_id", "target_attcode"=>"name")));
@@ -91,17 +91,25 @@ class menuNode extends DBObject
public function GetChildNodesSet($sType = null)
{
$oSearchFilter = new DBObjectSearch("menuNode");
$oSearchFilter->AddCondition('parent_id', $this->GetKey(), '=');
if ($sType != null)
$aParams = array();
if ($sType == 'user')
{
$oSearchFilter->AddCondition('type', $sType, '=');
if ($sType == 'user')
{
$oSearchFilter->AddCondition('user_id', UserRights::GetUserId(), '=');
}
$sSelectChilds = 'SELECT menuNode AS m WHERE m.parent_id = :parent AND type = :type AND m.user_id = :user';
$aParams = array('parent' => $this->GetKey(), 'type' => $sType, 'user' => UserRights::GetUserId());
}
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true));
elseif ($sType != null)
{
$sSelectChilds = 'SELECT menuNode AS m WHERE m.parent_id = :parent AND type = :type';
$aParams = array('parent' => $this->GetKey(), 'type' => $sType);
}
else
{
$sSelectChilds = 'SELECT menuNode AS m WHERE m.parent_id = :parent';
$aParams = array('parent' => $this->GetKey());
}
$oSearchFilter = DBObjectSearch::FromOQL($sSelectChilds);
$oSet = new CMDBObjectSet($oSearchFilter, array('rank' => true), $aParams);
return $oSet;
}

View File

@@ -21,6 +21,7 @@ class UILinksWidget
{
$sHTMLValue = '';
$sTargetClass = self::GetTargetClass($this->m_sClass, $this->m_sAttCode);
// #@# todo - add context information, otherwise any value will be authorized for external keys
$aAllowedValues = MetaModel::GetAllowedValues_att($this->m_sClass, $this->m_sAttCode, array(), '');
$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $this->m_sAttCode);
$sExtKeyToRemote = $oAttDef->GetExtKeyToRemote();
@@ -120,6 +121,7 @@ class UILinksWidget
*/
static public function Autocomplete(web_page $oPage, UserContext $oContext, $sClass, $sAttCode, $sName, $iMaxCount)
{
// #@# todo - add context information, otherwise any value will be authorized for external keys
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, array() /* $aArgs */, $sName);
if ($aAllowedValues != null)
{
@@ -154,12 +156,13 @@ class UILinksWidget
* This static function is called by the Ajax Page display a set of objects being linked
* to the object being created
* @param $oPage web_page The ajax page used for the put^put (sent back to the browser
* @param $sClass string The name of the class 'linking class' which is the class of the objects to display
* @param $sAttCode string The name of the attribute is the main object being created
* @param $sClass string The name of the 'linking class' which is the class of the objects to display
* @param $sSet JSON serialized set of objects
* @param $sExtKeyToMe Name of the attribute in sClass that is pointing to a given object
* @param $iObjectId The id of the object $sExtKeyToMe is pointing to
* @return void
*/
static public function RenderSet($oPage, $sClass, $sJSONSet, $sExtKeyToMe)
static public function RenderSet($oPage, $sClass, $sJSONSet, $sExtKeyToMe, $sExtKeyToRemote, $iObjectId)
{
$aSet = json_decode($sJSONSet, true); // true means hash array instead of object
$oSet = CMDBObjectSet::FromScratch($sClass);
@@ -182,7 +185,7 @@ class UILinksWidget
}
$oSet->AddObject($oObj);
}
cmdbAbstractObject::DisplaySet($oPage, $oSet, $sExtKeyToMe);
cmdbAbstractObject::DisplaySet($oPage, $oSet, $sExtKeyToMe, true /*menu*/, false /*select*/, $iObjectId, $sExtKeyToRemote);
}

View File

@@ -55,7 +55,9 @@ class bizIncidentTicket extends cmdbAbstractObject
MetaModel::Init_AddAttribute(new AttributeDate("next_update", array("label"=>"Next update", "description"=>"next time the Ticket is expected to be modified", "allowed_values"=>null, "sql"=>"next_update", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeDate("end_date", array("label"=>"Closed Date", "description"=>"Date when the Ticket was closed", "allowed_values"=>null, "sql"=>"closed_date", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("caller_id", array("targetclass"=>"bizPerson", "jointype"=> "", "label"=>"Caller", "description"=>"person that trigger incident", "allowed_values"=>null, "sql"=>"caller_id", "is_null_allowed"=>false, "depends_on"=>array())));
//MetaModel::Init_AddAttribute(new AttributeExternalKey("caller_id", array("targetclass"=>"bizPerson", "jointype"=> "", "label"=>"Caller", "description"=>"person that trigger incident", "allowed_values"=>null, "sql"=>"caller_id", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("caller_id", array("targetclass"=>"bizPerson", "jointype"=> "", "label"=>"Caller", "description"=>"person that trigger incident", "allowed_values"=>new ValueSetObjects('SELECT bizPerson AS p WHERE p.org_id = :this->customer_id'), "sql"=>"caller_id", "is_null_allowed"=>false, "depends_on"=>array('customer_id'))));
//MetaModel::Init_AddAttribute(new AttributeExternalKey("caller_id", array("targetclass"=>"bizPerson", "jointype"=> "", "label"=>"Caller", "description"=>"person that trigger incident", "allowed_values"=>new ValueSetObjects('SELECT bizPerson AS p WHERE p.org_id = 1'), "sql"=>"caller_id", "is_null_allowed"=>false, "depends_on"=>array('customer_id'))));
MetaModel::Init_AddAttribute(new AttributeExternalField("caller_mail", array("label"=>"Caller", "description"=>"Person that trigger this incident", "allowed_values"=>null, "extkey_attcode"=> 'caller_id', "target_attcode"=>"email")));
MetaModel::Init_AddAttribute(new AttributeString("impact", array("label"=>"Impact", "description"=>"Impact of the Incident", "allowed_values"=>null, "sql"=>"impact", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));

View File

@@ -178,6 +178,13 @@ abstract class AttributeDefinition
{
return str_replace($sSeparator, $sSepEscape, $sValue);
}
public function GetAllowedValues($aArgs = array(), $sBeginsWith = '')
{
$oValSetDef = $this->GetValuesDef();
if (!$oValSetDef) return null;
return $oValSetDef->GetValues($aArgs, $sBeginsWith);
}
}
/**
@@ -490,7 +497,10 @@ class AttributeString extends AttributeDBField
}
public function RealValueToSQLValue($value)
{
assert(is_string($value));
if (!is_string($value))
{
throw new CoreWarning('Expected the attribute value to be a string', array('found_type' => gettype($value), 'value' => $value, 'class' => $this->GetCode(), 'attribute' => $this->GetHostClass()));
}
return $value;
}
public function SQLValueToRealValue($value)
@@ -499,6 +509,29 @@ class AttributeString extends AttributeDBField
}
}
/**
* Map a varchar column (size < ?) to an attribute that must never be shown to the user
*
* @package iTopORM
* @author Romain Quetiez <romainquetiez@yahoo.fr>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.itop.com
* @since 1.0
* @version $itopversion$
*/
class AttributePassword extends AttributeString
{
static protected function ListExpectedParams()
{
return parent::ListExpectedParams();
//return array_merge(parent::ListExpectedParams(), array());
}
public function GetEditClass() {return "Password";}
public function GetDBFieldType() {return "VARCHAR(64)";}
}
/**
* Map a text column (size > ?) to an attribute
*
@@ -778,7 +811,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid
}
// overloaded here so that an ext key always have the answer to
// "what are you possible values?"
// "what are your possible values?"
public function GetValuesDef()
{
$oValSetDef = $this->Get("allowed_values");
@@ -788,7 +821,21 @@ class AttributeExternalKey extends AttributeDBFieldVoid
$oValSetDef = new ValueSetObjects($this->GetTargetClass());
}
return $oValSetDef;
}
}
public function GetAllowedValues($aArgs = array(), $sBeginsWith = '')
{
try
{
return parent::GetAllowedValues($aArgs, $sBeginsWith);
}
catch (MissingQueryArgument $e)
{
// Some required arguments could not be found, enlarge to any existing value
$oValSetDef = new ValueSetObjects($this->GetTargetClass());
return $oValSetDef->GetValues($aArgs, $sBeginsWith);
}
}
}
/**

View File

@@ -16,7 +16,6 @@
/**
* Sibusql - value set start
* @package iTopORM
* @info zis is private
*/
define('VS_START', '{');
/**
@@ -465,7 +464,7 @@ class DBObjectSearch
public function RenderCondition()
{
return $this->m_oSearchCondition->Render($this->m_aParams);
return $this->m_oSearchCondition->Render($this->m_aParams, true);
}
public function serialize()
@@ -507,7 +506,15 @@ class DBObjectSearch
$sRelCode = $aRelatedTo['relcode'];
$iMaxDepth = $aRelatedTo['maxdepth'];
$sValue .= "T:".$oFilter->serialize().":$sRelCode:$iMaxDepth";
$sValue .= "T:".$oFilter->serialize().":$sRelCode:$iMaxDepth\n";
}
if (count($this->m_aParams) > 0)
{
foreach($this->m_aParams as $sName => $sArgValue)
{
// G stands for arGument
$sValue .= "G:$sName:$sArgValue\n";
}
}
return base64_encode($sValue);
}
@@ -554,6 +561,11 @@ class DBObjectSearch
$sRelCode = $aCondition[2];
$iMaxDepth = $aCondition[3];
$oFilter->AddCondition_RelatedTo($oSubFilter, $sRelCode, $iMaxDepth);
break;
case "G":
$oFilter->m_aParams[$aCondition[1]] = $aCondition[2];
break;
default:
throw new CoreException("invalid filter definition (cannot unserialize the data, clear text = '$sClearText')");
}
@@ -600,6 +612,22 @@ class DBObjectSearch
public function ToOQL(&$aParams = null)
{
$bRetrofitParams = (!is_null($aParams));
if (is_null($aParams))
{
if (count($this->m_aParams) > 0)
{
$aParams = $this->m_aParams;
}
$bRetrofitParams = false;
}
else
{
if (count($this->m_aParams) > 0)
{
$aParams = array_merge($aParams, $this->m_aParams);
}
$bRetrofitParams = true;
}
$sRes = "SELECT ".$this->GetClass().' AS '.$this->GetClassAlias();
$sRes .= $this->ToOQL_Joins();

View File

@@ -11,6 +11,11 @@
* @since 1.0
* @version 1.1.1.1 $
*/
class MissingQueryArgument extends CoreException
{
}
abstract class Expression
{
// recursive translation of identifiers
@@ -301,7 +306,7 @@ class VariableExpression extends UnaryExpression
// recursive rendering
public function Render(&$aArgs = null, $bRetrofitParams = false)
{
if (is_null($aArgs) || $bRetrofitParams)
if (is_null($aArgs))
{
return ':'.$this->m_sName;
}
@@ -309,9 +314,14 @@ class VariableExpression extends UnaryExpression
{
return CMDBSource::Quote($aArgs[$this->m_sName]);
}
elseif ($bRetrofitParams)
{
//$aArgs[$this->m_sName] = null;
return ':'.$this->m_sName;
}
else
{
throw new CoreException('Missing query argument', array('expecting'=>$this->m_sName, 'available'=>$aArgs));
throw new MissingQueryArgument('Missing query argument', array('expecting'=>$this->m_sName, 'available'=>$aArgs));
}
}
}

View File

@@ -209,7 +209,13 @@ class FilterFromAttribute extends FilterDefinition
{
$oAttDef = $this->Get("refattribute");
return $oAttDef->GetValuesDef();
}
}
public function GetAllowedValues($aArgs = array(), $sBeginsWith = '')
{
$oAttDef = $this->Get("refattribute");
return $oAttDef->GetAllowedValues($aArgs, $sBeginsWith);
}
public function GetOperators()
{
@@ -235,62 +241,4 @@ class FilterFromAttribute extends FilterDefinition
}
}
/**
* Match against a given column (experimental -to be cleaned up later)
*
* @package iTopORM
* @author Romain Quetiez <romainquetiez@yahoo.fr>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.itop.com
* @since 1.0
* @version $itopversion$
*/
class FilterDBValues extends FilterDefinition
{
static protected function ListExpectedParams()
{
return array_merge(parent::ListExpectedParams(), array("dbfield"));
}
public function GetType() {return "Values from DB";}
public function GetTypeDesc() {return "Match against the existing values in a field";}
public function GetLabel()
{
return "enum de valeurs DB";
}
public function GetValuesDef()
{
return null;
}
public function GetOperators()
{
return array(
"IN"=>"in",
);
}
public function GetLooseOperator()
{
return "IN";
}
public function GetFilterSQLExpr($sOpCode, $value)
{
$sFieldName = $this->Get("dbfield");
if (is_array($value) && !empty($value))
{
$sValueList = "'".implode("', '", $value)."'";
return "$sFieldName IN ($sValueList)";
}
return "1=1";
}
public function TemporaryGetSQLCol()
{
return $this->Get("dbfield");
}
}
?>

View File

@@ -665,19 +665,13 @@ abstract class MetaModel
public static function GetAllowedValues_att($sClass, $sAttCode, $aArgs = array(), $sBeginsWith = '')
{
$oAttDef = self::GetAttributeDef($sClass, $sAttCode);
if (!$oAttDef) return null;
$oValSetDef = $oAttDef->GetValuesDef();
if (!$oValSetDef) return null;
return $oValSetDef->GetValues($aArgs, $sBeginsWith);
return $oAttDef->GetAllowedValues($aArgs, $sBeginsWith);
}
public static function GetAllowedValues_flt($sClass, $sFltCode, $aArgs = array(), $sBeginsWith = '')
{
$oFltDef = self::GetClassFilterDef($sClass, $sFltCode);
if (!$oFltDef) return null;
$oValSetDef = $oFltDef->GetValuesDef();
if (!$oValSetDef) return null;
return $oValSetDef->GetValues($aArgs, $sBeginsWith);
return $oFltDef->GetAllowedValues($aArgs, $sBeginsWith);
}
//
@@ -820,6 +814,18 @@ abstract class MetaModel
self::$m_aFilterDefs[$sClass][$sClassAttCode] = $oClassFlt;
self::$m_aFilterOrigins[$sClass][$sClassAttCode] = self::GetRootClass($sClass);
}
// Define defaults values for the standard ZLists
//
foreach (self::$m_aListInfos as $sListCode => $aListConfig)
{
if (!isset(self::$m_aListData[$sClass][$sListCode]))
{
$aAllAttributes = array_keys(self::$m_aAttribDefs[$sClass]);
self::$m_aListData[$sClass][$sListCode] = $aAllAttributes;
//echo "<p>$sClass: $sListCode (".count($aAllAttributes)." attributes)</p>\n";
}
}
}
}

View File

@@ -45,6 +45,8 @@ define('UR_ACTION_APPLICATION_DEFINED', 10000); // Application specific actions
abstract class UserRightsAddOnAPI
{
abstract public function Setup(); // initial installation
abstract public function CreateAdministrator($sAdminUser, $sAdminPwd); // could be used during initial installation
abstract public function Init(); // loads data (possible optimizations)
abstract public function CheckCredentials($sLogin, $sPassword); // returns the id of the user or false
abstract public function GetUserId($sLogin); // returns the id of the user or false
@@ -52,6 +54,7 @@ abstract class UserRightsAddOnAPI
abstract public function IsActionAllowed($iUserId, $sClass, $iActionCode, dbObjectSet $oInstances);
abstract public function IsStimulusAllowed($iUserId, $sClass, $sStimulusCode, dbObjectSet $oInstances);
abstract public function IsActionAllowedOnAttribute($iUserId, $sClass, $sAttCode, $iActionCode, dbObjectSet $oInstances);
abstract public function IsAdministrator($iUserId);
}
@@ -94,6 +97,11 @@ class UserRights
self::$m_iRealUserId = 0;
}
public static function GetModuleInstance()
{
return self::$m_oAddOn;
}
// Installation: create the very first user
public static function CreateAdministrator($sAdminUser, $sAdminPwd)
{
@@ -236,6 +244,20 @@ class UserRights
return self::$m_oAddOn->IsActionAllowedOnAttribute($iUserId, $sClass, $sAttCode, $iActionCode, $oInstances);
}
}
public static function IsAdministrator($iUserId = null)
{
if (!self::CheckLogin()) return false;
if (is_null($iUserId))
{
return self::$m_oAddOn->IsAdministrator(self::$m_iUserId);
}
else
{
return self::$m_oAddOn->IsAdministrator($iUserId);
}
}
}

View File

@@ -19,8 +19,6 @@ abstract class ValueSetDefinition
{
protected $m_bIsLoaded = false;
protected $m_aValues = array();
protected $m_aArgsObj = array();
protected $m_aArgsApp = array();
// Displayable description that could be computed out of the std usage context
@@ -64,15 +62,6 @@ abstract class ValueSetDefinition
return $aRet;
}
public function ListArgsFromContextApp()
{
return $this->m_aArgsObj;
}
public function ListArgsFromContextObj()
{
return $this->m_aArgsApp;
}
abstract protected function LoadValues($aArgs);
}
@@ -109,7 +98,7 @@ class ValueSetObjects extends ValueSetDefinition
if (empty($this->m_sValueAttCode))
{
$this->m_sValueAttCode = MetaModel::GetNameAttributeCode($oFilter->GetClass());
$this->m_sValueAttCode = MetaModel::GetNameAttributeCode($oFilter->GetClass());
}
$oObjects = new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs);
@@ -127,78 +116,6 @@ class ValueSetObjects extends ValueSetDefinition
}
/**
* Set of existing values for an attribute, given a search filter and a relation id
*
* @package iTopORM
* @author Romain Quetiez <romainquetiez@yahoo.fr>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.itop.com
* @since 1.0
* @version $itopversion$
*/
class ValueSetRelatedObjects extends ValueSetObjects
{
public function __construct($sFilterExp, $sRelCode, $sClass, $sValueAttCode = '', $aOrderBy = array())
{
$sFullFilterExp = "$sClass: RELATED ($sRelCode, 1) TO ($sFilterExp)";
parent::__construct($sFullFilterExp, $sValueAttCode, $aOrderBy);
}
}
/**
* Set oof existing values for an attribute, given a set of objects (AttributeLinkedSet)
*
* @package iTopORM
* @author Romain Quetiez <romainquetiez@yahoo.fr>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.itop.com
* @since 1.0
* @version $itopversion$
*/
class ValueSetRelatedObjectsFromLinkedSet extends ValueSetDefinition
{
protected $m_sLinkedSetAttCode;
protected $m_sRelCode;
protected $m_sValueAttCode;
protected $m_aOrderBy;
public function __construct($sLinkedSetAttCode, $sRelCode, $sValueAttCode = '', $aOrderBy = array())
{
$this->m_sLinkedSetAttCode = $sLinkedSetAttCode;
$this->m_sRelCode = $sRelCode;
$this->m_sValueAttCode = $sValueAttCode;
$this->m_aOrderBy = $aOrderBy;
}
protected function LoadValues($aArgs)
{
$this->m_aValues = array();
if (empty($this->m_sValueAttCode))
{
$this->m_sValueAttCode = MetaModel::GetNameAttributeCode($oFilter->GetClass());
}
$oCurrentObject = @$aArgs['*this*'];
if (!is_object($oCurrentObject)) return false;
$oObjects = $oCurrentObject->Get($this->m_sLinkedSetAttCode);
while ($oObject = $oObjects->Fetch())
{
$this->m_aValues[$oObject->GetKey()] = $oObject->Get($this->m_sValueAttCode);
}
return true;
}
public function GetValuesDescription()
{
return 'Objects related ('.$this->m_sRelCode.') to objects linked through '.$this->m_sLinkedSetAttCode;
}
}
/**
* Fixed set values (could be hardcoded in the business model)
*

View File

@@ -29,7 +29,7 @@ function LinksWidget(id, sLinkedClass, sExtKeyToMe, sExtKeyToRemote, aAttributes
{
sLinks = JSON.stringify(this.aLinks);
$('#'+this.id).val(sLinks);
$('#'+this.id+'_values').load('ajax.render.php?operation=ui.linkswidget.linkedset&sclass='+this.sLinkedClass+'&sextkeytome='+this.sExtKeyToMe,
$('#'+this.id+'_values').load('ajax.render.php?operation=ui.linkswidget.linkedset&sclass='+this.sLinkedClass+'&sextkeytome='+this.sExtKeyToMe+'&sextkeytoremote='+this.sExtKeyToRemote+'&myid='+this.id,
{'sset' : sLinks});
}
}

View File

@@ -96,7 +96,7 @@ EOF;
$bChildItem = utils::ReadPostedParam('child_item', false);
$oMenuNode->Set('label', $sDescription);
$oMenuNode->Set('name', $sLabel);
$oMenuNode->Set('icon_path', '/images/std_view.gif');
$oMenuNode->Set('icon_path', '../images/std_view.gif');
$oMenuNode->Set('template', $sMenuNodeContent);
$oMenuNode->Set('hyperlink', 'UI.php');
$oMenuNode->Set('type', 'user');

View File

@@ -84,6 +84,8 @@ switch($operation)
}
foreach($oWizardHelper->GetFieldsForAllowedValues() as $sAttCode)
{
// MetaModel::GetAllowedValues_att() => array(id => value)
// Improvement: what if the list is too long?
$oWizardHelper->SetAllowedValuesHtml($sAttCode, "Possible values ($sAttCode)");
}
$oPage->add($oWizardHelper->ToJSON());
@@ -192,7 +194,9 @@ switch($operation)
$sClass = utils::ReadParam('sclass', 'bizContact');
$sJSONSet = stripslashes(utils::ReadParam('sset', ''));
$sExtKeyToMe = utils::ReadParam('sextkeytome', '');
UILinksWidget::RenderSet($oPage, $sClass, $sJSONSet, $sExtKeyToMe);
$sExtKeyToRemote = utils::ReadParam('sextkeytoremote', '');
$iObjectId = utils::ReadParam('id', -1);
UILinksWidget::RenderSet($oPage, $sClass, $sJSONSet, $sExtKeyToMe, $sExtKeyToRemote, $iObjectId);
break;
case 'autocomplete':
@@ -208,6 +212,7 @@ switch($operation)
if ($oThis = MetaModel::GetObject($sClass, $key))
{
$aArgs['*this*'] = $oThis;
$aArgs['this'] = $oThis;
}
}
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs, $sName);

View File

@@ -87,7 +87,7 @@ function DisplayDetails(web_page $oPage, $sClassName, $sKey)
global $oContext;
//$oObj = MetaModel::GetObject($sClassName, $sKey);
$oObj = $oContext->GetObject($sClassName, $sKey);
$oPage->p("Details of ".get_class($oObj)." - $sKey");
$oPage->p("Details of ".MetaModel::GetName($sClassName)." - $sKey");
$oObj->DisplayDetails($oPage);
@@ -140,7 +140,7 @@ function DisplayChangesLog(web_page $oPage, $sClassName, $sKey)
global $oContext;
//$oObj = MetaModel::GetObject($sClassName, $sKey);
$oObj = $oContext->GetObject($sClassName, $sKey);
$oPage->p("Changes log for ".get_class($oObj)." - $sKey");
$oPage->p("Changes log for ".MetaModel::GetName($sClassName)." - $sKey");
$oObj->DisplayChangesLog($oPage);
@@ -219,7 +219,7 @@ function DisplayEditForm(web_page $oPage, $sClassName, $sKey)
$oPage->p("You are not allowed to edit this object.");
return;
}
$oPage->p("Edition of ".get_class($oObj)." - $sKey\n");
$oPage->p("Edition of ".MetaModel::GetName($sClassName)." - $sKey\n");
$aDetails = array();
$oPage->add("<form method=\"post\">\n");
@@ -332,7 +332,7 @@ function UpdateObject(web_page $oPage, $sClassName, $sKey, $aAttributes)
$iChangeId = $oMyChange->DBInsert();
$oObj->DBUpdateTracked($oMyChange);
$oPage->p(get_class($oObj)." updated\n");
$oPage->p(MetaModel::GetName($sClassName)." updated\n");
}
else
{
@@ -342,13 +342,14 @@ function UpdateObject(web_page $oPage, $sClassName, $sKey, $aAttributes)
// By Rom
// $oObj->DisplayDetails($oPage);
// replaced by...
DisplayDetails($oPage, get_class($oObj), $oObj->GetKey());
DisplayDetails($oPage, $sClassName, $sKey);
$oPage->p("<a href=\"\">Return to main page</a>");
}
function DeleteObject(web_page $oPage, $sClassName, $sKey)
{
global $oContext;
$sClassLabel = MetaModel::GetName($sClassName);
//$oObj = MetaModel::GetObject($sClassName, $sKey);
$oObj = $oContext->GetObject($sClassName, $sKey);
if ($oObj == null)
@@ -356,7 +357,7 @@ function DeleteObject(web_page $oPage, $sClassName, $sKey)
$oPage->p("You are not allowed to delete this object.");
return;
}
$oPage->p("Deletion of $sClassName - $sKey");
$oPage->p("Deletion of $sClassLabel - $sKey");
if ($oObj->CheckToDelete())
{
@@ -368,13 +369,13 @@ function DeleteObject(web_page $oPage, $sClassName, $sKey)
$iChangeId = $oMyChange->DBInsert();
$oObj->DBDeleteTracked($oMyChange);
$oPage->p("$sClassName deleted\n");
$oPage->p("$sClassLabel deleted\n");
}
else
{
$oPage->p("<strong>Error: object can not be deleted!</strong>\n");
// By Rom
DisplayDetails($oPage, get_class($oObj), $oObj->GetKey());
DisplayDetails($oPage, $sClassName, $sKey);
}
$oPage->p("<a href=\"\">Return to main page</a>");
}
@@ -382,7 +383,8 @@ function DeleteObject(web_page $oPage, $sClassName, $sKey)
function CreateObject(web_page $oPage, $sClassName, $aAttributes)
{
$oObj = MetaModel::NewObject($sClassName);
$oPage->p("Creation of ".get_class($oObj)." object.");
$sClassLabel = MetaModel::GetName(get_class($oObj));
$oPage->p("Creation of $sClassLabel object.");
foreach(MetaModel::ListAttributeDefs(get_class($oObj)) as $sAttCode=>$oAttDef)
{
@@ -401,7 +403,7 @@ function CreateObject(web_page $oPage, $sClassName, $aAttributes)
$iChangeId = $oMyChange->DBInsert();
$oObj->DBInsertTracked($oMyChange);
$oPage->p(get_class($oObj)." created\n");
$oPage->p($sClassLabel." created\n");
// By Rom
// $oObj->DisplayDetails($oPage);
@@ -419,6 +421,7 @@ function CreateObject(web_page $oPage, $sClassName, $aAttributes)
function AddLinks($oPage, $sClassName, $sKey, $sLinkClass, $sExtKeyToMe, $sExtKeyToPartner, $sFilter)
{
global $oContext;
$sClassLabel = MetaModel::GetName($sClassName);
//$oObj = MetaModel::GetObject($sClassName, $sKey);
$oObj = $oContext->GetObject($sClassName, $sKey);
if ($oObj == null)
@@ -426,7 +429,7 @@ function AddLinks($oPage, $sClassName, $sKey, $sLinkClass, $sExtKeyToMe, $sExtKe
$oPage->p("You are not allowed to modify (create links on) this object.");
return;
}
$oPage->p("Creating links for $sClassName - $sKey");
$oPage->p("Creating links for $sClassLabel - $sKey");
$oFilter = CMDBSearchFilter::unserialize($sFilter);
$oPage->p("Linking to ".$oFilter->__DescribeHTML());
@@ -447,7 +450,7 @@ function AddLinks($oPage, $sClassName, $sKey, $sLinkClass, $sExtKeyToMe, $sExtKe
$iChangeId = $oMyChange->DBInsert();
$oNewLink->DBInsertTracked($oMyChange);
$oPage->p(get_class($oNewLink)." created\n");
$oPage->p(MetaModel::GetName($sLinkClass)." created\n");
}
else
{
@@ -595,19 +598,21 @@ switch($operation)
$oPage->add("</ul>\n");
foreach( $aTopLevelClasses as $sClassName)
{
$sClassLabel = MetaModel::GetName($sClassName);
$oPage->add("<div id=\"tab_$sClassName\">");
if (count(MetaModel::GetSubclasses($sClassName)) > 0)
{
$sActiveSubclass = ReadParam('subclassname', '');
foreach(MetaModel::GetSubclasses($sClassName) as $sSubclassName)
{
$sSubclassLabel = MetaModel::GetName($sSubclassName);
//$oSearchFilter = new CMDBSearchFilter($sSubclassName);
$oSearchFilter = $oContext->NewFilter($sSubclassName);
$oSearchFilter ->AddCondition('org_id', $sCurrentOrganization, '=');
$oPage->add("<div style=\"border:1px solid #97a5b0; margin-top:0.5em;\">\n");
$oPage->add("<div style=\"padding:0.25em;background-color:#f0f0f0\">\n");
$oPage->p("<strong>$sSubclassName</strong> - ".MetaModel::GetClassDescription($sSubclassName));
$oPage->p("<strong>$sSubclassLabel</strong> - ".MetaModel::GetClassDescription($sSubclassName));
$oPage->add("<form method=\"get\">\n");
$oPage->add("<input type=\"hidden\" name=\"classname\" value=\"$sClassName\">\n");
$oPage->add("<input type=\"hidden\" name=\"subclassname\" value=\"$sSubclassName\">\n");
@@ -634,7 +639,7 @@ switch($operation)
$iMatchesCount = $oSet->Count();
if ($iMatchesCount == 0)
{
$oPage->p("No $sSubclassName matches these criteria.");
$oPage->p("No $sSubclassLabel matches these criteria.");
$oPage->small_p("(".$oSearchFilter->__DescribeHTML().")");
}
else
@@ -642,7 +647,7 @@ switch($operation)
$oPage->p("$iMatchesCount item(s) found.");
cmdbAbstractObject::DisplaySet($oPage, $oSet);
}
$oPage->p("<a href=\"?operation=new&class=$sSubclassName\">Create a new $sSubclassName</a>\n");
$oPage->p("<a href=\"?operation=new&class=$sSubclassName\">Create a new $sSubclassLabel</a>\n");
$oPage->add("</div>\n");
}
}
@@ -655,7 +660,7 @@ switch($operation)
$oPage->add("<div style=\"border:1px solid #97a5b0; margin-top:0.5em;\">\n");
$oPage->add("<div style=\"padding:0.25em;background-color:#f0f0f0\">\n");
$oPage->p("<strong>$sClassName</strong> - ".MetaModel::GetClassDescription($sClassName));
$oPage->p("<strong>$sClassLabel</strong> - ".MetaModel::GetClassDescription($sClassName));
$oPage->add("<form method=\"get\">\n");
$oPage->add("<input type=\"hidden\" name=\"classname\" value=\"$sClassName\">\n");
$oPage->add("<input type=\"hidden\" name=\"org\" value=\"$sCurrentOrganization\">\n");
@@ -681,7 +686,7 @@ switch($operation)
$iMatchesCount = $oSet->Count();
if ($iMatchesCount == 0)
{
$oPage->p("No $sClassName matches these criteria.");
$oPage->p("No $sClassLabel matches these criteria.");
$oPage->small_p("(".$oSearchFilter->__DescribeHTML().")");
}
else
@@ -690,7 +695,7 @@ switch($operation)
cmdbAbstractObject::DisplaySet($oPage, $oSet);
$oPage->small_p("(".$oSearchFilter->__DescribeHTML().")");
}
$oPage->p("<a href=\"?operation=new&ctx=$iContext&class=$sClassName\">Create a new $sClassName</a>\n");
$oPage->p("<a href=\"?operation=new&ctx=$iContext&class=$sClassName\">Create a new $sClassLabel</a>\n");
$oPage->add("</div>\n");
$oPage->add("</div>\n");
}

View File

@@ -333,8 +333,8 @@ function DisplayClassDetails($oPage, $sClass)
{
$sValue = $oAttDef->GetDescription();
}
$sType = $oAttDef->GetType().' ('.$oAttDef->GetTypeDesc().')';
$sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
$sType = $oAttDef->GetType().' ('.$oAttDef->GetTypeDesc().')';
$sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
$sAllowedValues = "";
$oAllowedValuesDef = $oAttDef->GetValuesDef();
$sMoreInfo = "";

View File

@@ -263,6 +263,23 @@ if ($iUser == -1)
}
else
{
$oPage->p('<h2>How is it computing the user rights?</h2>');
$oPage->p('<h3>1st, find the profiles that apply</h3>');
$oPage->p('<p>Project the current object in every existing dimension</p>');
$oPage->p('<p>Project the observed profile in every existing dimension (might depend on the user)</p>');
$oPage->p('<p>If an overlap is found in any dimension, then the profile applies</p>');
$oPage->p('<h3>2nd, interpret the profiles</h3>');
$oPage->p('<p>Note: granting rights for specific attributes is not fully implemented. It is still not taking into account the inheritance of rights AND the UI will not take that information into account!</p>');
$oPage->p('<p>Actions: looks into URP_ActionGrant for a permission (yes or no) and goes up into the class hierarchy until an answer is found, defaults to <em>no</em></p>');
$oPage->p('<p>Stimuli: looks into URP_StimulusGrant for a permission (yes or no), defaults to <em>no</em></p>');
$oPage->p('<h3>3rd, keep the most permissive one</h3>');
$oPage->p('<p>If one profile says YES, then the answer is YES</p>');
$oUser = MetaModel::GetObject('URP_Users', $iUser);
$oPage->p('<h2>Projections for user '.$oUser->GetName().'</h2>');

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Set>
<URP_Profiles id="100">
<name>Delivery Manager France</name>
<description>Persons in charge of the operations for French customers</description>
</URP_Profiles>
</Set>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Set>
<URP_ProfileProjection id="1">
<dimensionid>1</dimensionid>
<profileid>100</profileid>
<value>1;2</value>
<attribute></attribute>
</URP_ProfileProjection>
<URP_ProfileProjection id="3">
<dimensionid>2</dimensionid>
<profileid>100</profileid>
<value>&lt;any&gt;</value>
<attribute></attribute>
</URP_ProfileProjection>
</Set>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<Set>
</Set>

View File

@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<Set>
<URP_StimulusGrant id="1">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_store</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="2">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_ship</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="3">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_plug</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="4">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_configuration_finished</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="5">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_val_failed</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="6">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_mtp</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="7">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_start_change</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="8">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_end_change</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="9">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_decommission</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="10">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_obsolete</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="11">
<profileid>100</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_recycle</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="12">
<profileid>100</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_assign</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="13">
<profileid>100</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_reassign</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="14">
<profileid>100</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_start_working</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="15">
<profileid>100</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_close</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="16">
<profileid>100</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_freeze_version</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="17">
<profileid>100</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_sign</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="18">
<profileid>100</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_begin</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="19">
<profileid>100</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_notice</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="20">
<profileid>100</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_terminate</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="21">
<profileid>100</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_elapsed</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="22">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_validate</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="23">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_reject</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="24">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_reopen</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="25">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_plan</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="26">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_approve</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="27">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_replan</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="28">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_notapprove</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="29">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_implement</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="30">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_monitor</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="31">
<profileid>100</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_finish</stimulus>
</URP_StimulusGrant>
</Set>

View File

@@ -1,6 +1,8 @@
SET WEBROOT=http://localhost:81
SET USER=Erwan
SET PWD=Taloc
SET EXPORT=%WEBROOT%/webservices/export.php
SET USER=admin
SET PWD=admin
REM The order (numbering) of the files is important since
REM it dictates the order to import them back

View File

@@ -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>
<menuNode id="1">
<name>Tools</name>
<label>Advanced tools</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>7</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="59">
<parent_id>5</parent_id>
<menuNode id="2">
<name>All Applications</name>
<label>All Applications</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -29,14 +29,16 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="47">
<parent_id>5</parent_id>
<menuNode id="3">
<name>All Circuits</name>
<label>All Circuits</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -46,27 +48,31 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="75">
<parent_id>64</parent_id>
<menuNode id="4">
<name>All Contracts</name>
<label>All Contracts</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>2</rank>
<parent_id>31</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="48">
<parent_id>5</parent_id>
<menuNode id="5">
<name>All Interfaces</name>
<label>All Interfaces</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -76,14 +82,16 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="46">
<parent_id>5</parent_id>
<menuNode id="6">
<name>All Network devices</name>
<label>All Network devices</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -93,14 +101,16 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="60">
<parent_id>5</parent_id>
<menuNode id="7">
<name>All Patches</name>
<label>All Patches</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -110,14 +120,16 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="6">
<parent_id>5</parent_id>
<menuNode id="8">
<name>All PCs</name>
<label>All PCs</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -127,14 +139,16 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="45">
<parent_id>5</parent_id>
<menuNode id="9">
<name>All Servers</name>
<label>All Servers</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -144,23 +158,27 @@
&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>
<rank>999</rank>
<parent_id>14</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="58">
<parent_id>1</parent_id>
<menuNode id="10">
<name>Audit</name>
<label>Audit</label>
<hyperlink>./audit.php</hyperlink>
<icon_path></icon_path>
<template></template>
<rank>4</rank>
<type>application</type>
<rank>4</rank>
<parent_id>15</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="66">
<parent_id>0</parent_id>
<menuNode id="11">
<name>Change Management</name>
<label>Change Management</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<template>&lt;style&gt;
.dashboard {
vertical-align:top;
@@ -192,43 +210,49 @@ text-align:center;
&lt;/tr&gt;
&lt;/table&gt;
</template>
<rank>4</rank>
<type>application</type>
<rank>4</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="74">
<parent_id>66</parent_id>
<menuNode id="12">
<name>Closed Changes</name>
<label>Closed Changes</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>2</rank>
<parent_id>11</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="63">
<parent_id>61</parent_id>
<menuNode id="13">
<name>Closed Incident</name>
<label>List of closed ticket</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>2</rank>
<parent_id>22</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="5">
<parent_id>1</parent_id>
<menuNode id="14">
<name>Configuration Items</name>
<label>All about devices</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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 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;
@@ -252,14 +276,16 @@ text-align:center;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</template>
<rank>2</rank>
<type>application</type>
<rank>2</rank>
<parent_id>15</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="1">
<parent_id>0</parent_id>
<menuNode id="15">
<name>Configuration Management</name>
<label>Configuration Management</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<template>&lt;style&gt;
td.dashboard {
vertical-align:top;
@@ -290,15 +316,17 @@ td.dashboard {
&lt;/table&gt;
</template>
<rank>2</rank>
<type>application</type>
<rank>2</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="2">
<parent_id>1</parent_id>
<menuNode id="16">
<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;
<icon_path></icon_path>
<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;
@@ -317,32 +345,27 @@ td.dashboard {
&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>
<rank>1</rank>
<parent_id>15</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="19">
<parent_id>17</parent_id>
<menuNode id="17">
<name>CSV import</name>
<label>Bulk creation or update</label>
<hyperlink>csvimport.php</hyperlink>
<icon_path></icon_path>
<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>
<user_id>0</user_id>
</menuNode>
<menuNode id="19">
<name>Document</name>
<label>Any object of class &apos;Document&apos;</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -351,23 +374,17 @@ td.dashboard {
&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>
<type>application</type>
<rank>6</rank>
<type>application</type>
<parent_id>15</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="50">
<parent_id>17</parent_id>
<name>Export</name>
<label>Export any filter in HTML, CSV or XML</label>
<hyperlink>../webservices/export.php</hyperlink>
<template></template>
<rank>1000</rank>
<type>application</type>
</menuNode>
<menuNode id="49">
<parent_id>1</parent_id>
<menuNode id="21">
<name>Grouping</name>
<label>All Groups</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -380,14 +397,16 @@ td.dashboard {
</template>
<rank>3</rank>
<type>application</type>
<rank>3</rank>
<parent_id>15</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="61">
<parent_id>0</parent_id>
<menuNode id="22">
<name>Incident Management</name>
<label>Incident Management</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<template>&lt;style&gt;
.dashboard {
vertical-align:top;
@@ -419,27 +438,31 @@ text-align:center;
&lt;/tr&gt;
&lt;/table&gt;
</template>
<rank>3</rank>
<type>application</type>
<rank>3</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="72">
<parent_id>61</parent_id>
<menuNode id="23">
<name>Known Errors</name>
<label>Known Errors</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>999</rank>
<parent_id>22</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="9">
<parent_id>1</parent_id>
<menuNode id="24">
<name>Locations</name>
<label>Any locations</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;
@@ -448,88 +471,92 @@ text-align:center;
&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>
<rank>5</rank>
<parent_id>15</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="65">
<parent_id>64</parent_id>
<menuNode id="25">
<name>Negociating contracts</name>
<label>Negociating contracts</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>1</rank>
<parent_id>31</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="68">
<parent_id>66</parent_id>
<menuNode id="26">
<name>Open Changes</name>
<label>Open Changes</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>1</rank>
<parent_id>11</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="62">
<parent_id>61</parent_id>
<menuNode id="27">
<name>Open Incidents</name>
<label>List of open incidents</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>1</rank>
<parent_id>22</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="14">
<parent_id>2</parent_id>
<menuNode id="28">
<name>Persons</name>
<label>Any contact of class &apos;Person&apos;</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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>
<type>application</type>
<rank>7</rank>
<type>application</type>
<parent_id>16</parent_id>
<user_id>0</user_id>
</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>
<menuNode id="30">
<name>Scheduled Outages</name>
<label>Scheduled Outages</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<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>
<rank>999</rank>
<parent_id>11</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="64">
<parent_id>0</parent_id>
<menuNode id="31">
<name>Service Management</name>
<label>Service Management</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<template>&lt;style&gt;
.dashboard {
vertical-align:top;
@@ -558,44 +585,160 @@ text-align:center;
&lt;/tr&gt;
&lt;/table&gt;
</template>
<rank>5</rank>
<type>application</type>
<rank>5</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="43">
<parent_id>2</parent_id>
<menuNode id="32">
<name>Teams</name>
<label>Any contact of class &apos;team&apos;</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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>
<type>application</type>
<rank>8</rank>
<type>application</type>
<parent_id>16</parent_id>
<user_id>0</user_id>
</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>
<menuNode id="34">
<name>Welcome</name>
<label>Welcome</label>
<hyperlink>./UI.php</hyperlink>
<icon_path></icon_path>
<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;Welcome to iTop&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:14px;&quot;&gt;&lt;i&gt;Version 0.8&lt;/i&gt;&lt;/p&gt;
</template>
<rank>1</rank>
<type>application</type>
<rank>1</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="100">
<name>Admin tools</name>
<label>Admin tools</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;User management&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:14px;&quot;&gt;&lt;i&gt;User management by profiles&lt;/i&gt;&lt;/p&gt;
</template>
<type>administrator</type>
<rank>1000</rank>
<parent_id>0</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="101">
<name>Data Model</name>
<label>Overview of the Data Model</label>
<hyperlink>schema.php</hyperlink>
<icon_path></icon_path>
<template></template>
<type>administrator</type>
<rank>1500</rank>
<parent_id>100</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="102">
<name>Universal Search</name>
<label>Search for anything...</label>
<hyperlink>UniversalSearch.php</hyperlink>
<icon_path></icon_path>
<template></template>
<type>administrator</type>
<rank>1600</rank>
<parent_id>100</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="110">
<name>User management</name>
<label>User management</label>
<hyperlink>UI.php</hyperlink>
<icon_path></icon_path>
<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;User management&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:14px;&quot;&gt;&lt;i&gt;User management by profiles&lt;/i&gt;&lt;/p&gt;
</template>
<type>administrator</type>
<rank>1</rank>
<parent_id>100</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="111">
<name>User logins</name>
<label>User logins</label>
<hyperlink>UI.php</hyperlink>
<icon_path>../images/std_view.gif</icon_path>
<template>&lt;div id=&quot;TopPane&quot;&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT URP_Users AS URP_Users WHERE 1&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; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT URP_Users AS URP_Users WHERE 1&lt;/itopblock&gt;
&lt;/div&gt;</template>
<type>administrator</type>
<rank>10</rank>
<parent_id>110</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="112">
<name>Profiles</name>
<label>User profiles</label>
<hyperlink>UI.php</hyperlink>
<icon_path>../images/std_view.gif</icon_path>
<template>&lt;div id=&quot;TopPane&quot;&gt;
&lt;itopblock BlockClass=&quot;DisplayBlock&quot; type=&quot;search&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT URP_Profiles AS URP_Profiles WHERE 1&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; type=&quot;list&quot; asynchronous=&quot;false&quot; encoding=&quot;text/oql&quot;&gt;SELECT URP_Profiles AS URP_Profiles WHERE 1&lt;/itopblock&gt;
&lt;/div&gt;</template>
<type>administrator</type>
<rank>11</rank>
<parent_id>110</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="113">
<name>Export</name>
<label>Export any filter in HTML, CSV or XML</label>
<hyperlink>../webservices/export.php</hyperlink>
<icon_path></icon_path>
<template></template>
<type>application</type>
<rank>1001</rank>
<parent_id>100</parent_id>
<user_id>0</user_id>
</menuNode>
<menuNode id="114">
<name>Run queries</name>
<label>Run any query</label>
<hyperlink>./sibusql.php</hyperlink>
<icon_path></icon_path>
<template></template>
<type>application</type>
<rank>1002</rank>
<parent_id>100</parent_id>
<user_id>0</user_id>
</menuNode>
</Set>

View File

@@ -4,8 +4,4 @@
<name>Administrator</name>
<description>Has the rights on everything (ignores the grant records)</description>
</URP_Profiles>
<URP_Profiles id="2">
<name>Delivery Manager France</name>
<description>Persons in charge of the operations for French customers</description>
</URP_Profiles>
</Set>

View File

@@ -2,14 +2,14 @@
<Set>
<URP_ProfileProjection id="1">
<dimensionid>1</dimensionid>
<profileid>2</profileid>
<value>1;2</value>
<profileid>1</profileid>
<value>true</value>
<attribute></attribute>
</URP_ProfileProjection>
<URP_ProfileProjection id="3">
<URP_ProfileProjection id="2">
<dimensionid>2</dimensionid>
<profileid>2</profileid>
<value>&lt;any&gt;</value>
<profileid>1</profileid>
<value>true</value>
<attribute></attribute>
</URP_ProfileProjection>
</Set>

File diff suppressed because it is too large Load Diff

View File

@@ -1,189 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<Set>
<URP_StimulusGrant id="1">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_store</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="2">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_ship</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="3">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_plug</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="4">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_configuration_finished</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="5">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_val_failed</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="6">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_mtp</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="7">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_start_change</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="8">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_end_change</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="9">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_decommission</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="10">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_obsolete</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="11">
<profileid>2</profileid>
<class>bizServer</class>
<permission>no</permission>
<stimulus>ev_recycle</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="12">
<profileid>2</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_assign</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="13">
<profileid>2</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_reassign</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="14">
<profileid>2</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_start_working</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="15">
<profileid>2</profileid>
<class>bizIncidentTicket</class>
<permission>no</permission>
<stimulus>ev_close</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="16">
<profileid>2</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_freeze_version</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="17">
<profileid>2</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_sign</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="18">
<profileid>2</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_begin</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="19">
<profileid>2</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_notice</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="20">
<profileid>2</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_terminate</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="21">
<profileid>2</profileid>
<class>bizContract</class>
<permission>no</permission>
<stimulus>ev_elapsed</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="22">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_validate</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="23">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_reject</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="24">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_reopen</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="25">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_plan</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="26">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_approve</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="27">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_replan</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="28">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_notapprove</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="29">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_implement</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="30">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>no</permission>
<stimulus>ev_monitor</stimulus>
</URP_StimulusGrant>
<URP_StimulusGrant id="31">
<profileid>2</profileid>
<class>bizChangeTicket</class>
<permission>yes</permission>
<stimulus>ev_finish</stimulus>
</URP_StimulusGrant>
</Set>

View File

@@ -1,7 +1,10 @@
SET WEBROOT=http://localhost:81
SET EXPORT=%WEBROOT%/webservices/export.php
SET USER=admin
SET PWD=admin
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"
wget --output-document=1.menus.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%EXPORT%?expression=SELECT menuNode WHERE type%%3D%%27application%%27&format=xml"
pause

View File

@@ -1,4 +1,6 @@
SET WEBROOT=http://localhost:81
SET WEBROOT=http://localhost:81/trunk
SET EXPORT="%WEBROOT%/webservices/export.php"
SET USER=admin
SET PWD=admin
@@ -11,3 +13,4 @@ wget --output-document=13.profileprojection.xml --post-data="auth_user=%USER%&au
wget --output-document=14.actiongrant.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%EXPORT%?expression=SELECT URP_ActionGrant&format=xml"
wget --output-document=15.attributegrant.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%EXPORT%?expression=SELECT URP_AttributeGrant&format=xml"
wget --output-document=16.stimulusgrant.xml --post-data="auth_user=%USER%&auth_pwd=%PWD%&operation=login" "%EXPORT%?expression=SELECT URP_StimulusGrant&format=xml"
pause

View File

@@ -376,7 +376,7 @@ function DisplayStep4(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminP
$oP->add("<h2>Creation of the administrator account</h2>\n");
$oP->add("<form method=\"post\"\">\n");
if (CreateAdminAccount($oP, $oConfig, $sAdminUser, $sAdminPwd))
if (CreateAdminAccount($oP, $oConfig, $sAdminUser, $sAdminPwd) && UserRights::Setup())
{
$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");