Compare commits

..

20 Commits
0.7 ... 0.7.2

Author SHA1 Message Date
Denis Flaven
4f6af44591 - Bug fix: emailed URL was still wrong for lists of objects
SVN:0.7.2[82]
2009-07-18 13:27:05 +00:00
Denis Flaven
d8c1416162 - Bug fix: added the missing display template
SVN:0.7.2[81]
2009-07-16 06:49:33 +00:00
Denis Flaven
e89c7490a9 - The page was broken because there was no user login !
SVN:0.7.2[78]
2009-07-08 16:09:01 +00:00
Denis Flaven
38e00ab5e0 - Fixed location of the "audit" page in the menu. Was broken if iTop was not installed at the root of the web server.
SVN:0.7.2[77]
2009-07-08 16:07:51 +00:00
Denis Flaven
668e0308d8 Fixed bug #24: choice of organizations was limited to organization in "implementation".
SVN:0.7.2[76]
2009-07-08 15:05:54 +00:00
Denis Flaven
dee460d024 Incremented version number to 0.7.2
SVN:0.7.2[74]
2009-06-27 08:33:47 +00:00
Denis Flaven
d2fb28ed92 - bug fix: Ticket #1 (Life Cycle Schema not displayed)
SVN:0.7.2[73]
2009-06-27 08:32:46 +00:00
Denis Flaven
70bbd07973 - Bug fix: Ticket #2 (User rights not applied properly)
SVN:0.7.2[72]
2009-06-27 08:31:31 +00:00
Denis Flaven
4bdec745d2 - Bug fix: Ticket #2 (User rights not applied properly)
SVN:0.7.2[71]
2009-06-27 08:30:13 +00:00
Denis Flaven
3a99704d85 - Enhancement: display the current user's name in the top part of the window
SVN:0.7.2[70]
2009-06-27 08:28:58 +00:00
Denis Flaven
119755313f - Bug fix: Ticket #3 (email hyperlink was wrong)
SVN:0.7.2[69]
2009-06-27 08:27:44 +00:00
Denis Flaven
bdb000378a Fix for Ticket #22 (impossible to create change or incident tickets)
SVN:0.7.2[67]
2009-06-26 14:32:13 +00:00
Denis Flaven
b3996d150c - Fixed sample data
SVN:0.7.2[66]
2009-06-26 12:56:04 +00:00
Denis Flaven
7fd5007db5 Preparing release 0.7.2
SVN:0.7.2[65]
2009-06-26 12:42:51 +00:00
Romain Quetiez
e073f8bebf CSVImport: Removed calls to deprecated method GetHyperLink
SVN:0.7.1[64]
2009-04-30 16:05:20 +00:00
Denis Flaven
1628525a58 Removed CSVParser since the "old" version is already present in the CSV import page...
SVN:0.7.1[63]
2009-04-30 06:04:38 +00:00
Denis Flaven
20a7aa6d11 Preparing to release 0.7.1
SVN:0.7.1[62]
2009-04-29 20:49:08 +00:00
Denis Flaven
6813c46fa5 Use non realistic persons...
SVN:0.7.1[61]
2009-04-29 20:38:51 +00:00
Denis Flaven
3ff16ad2ec Fixed bugs:
2783651 - New object - finalclass field is editable
2783643 - Number of objects displayed on result lists takes too much space
2783638 - PHP internal class name displayed in templates instead of class label
2783631 - Page "Admin tools/Backup-Restore" not working, removed !
2783629 - Menu "Admin Tools/Export" not working
2783625 - Cosmetics on new object wizard title

SVN:0.7.1[60]
2009-04-29 20:34:00 +00:00
Denis Flaven
871dab7a39 New intermediate version
SVN:0.7.1[59]
2009-04-29 19:39:17 +00:00
34 changed files with 126 additions and 114 deletions

View File

@@ -314,7 +314,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI
$oLogin = $oSet->Fetch();
if ($oLogin->Get('password') == $sPassword)
{
return true;
return $oLogin->Get('userid');
}
// todo: throw an exception?
return false;
@@ -326,7 +326,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI
return $oNullFilter;
}
public function IsActionAllowed($sUserName, $sClass, $iActionCode, dbObjectSet $aInstances)
public function IsActionAllowed($iUserId, $sClass, $iActionCode, dbObjectSet $aInstances)
{
if (!array_key_exists($iActionCode, self::$m_aActionCodes))
{
@@ -334,7 +334,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI
}
$sAction = self::$m_aActionCodes[$iActionCode];
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassGrant WHERE class = '$sClass' AND action = '$sAction' AND login = '$sUserName'"));
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassGrant WHERE class = '$sClass' AND action = '$sAction' AND userid = '$iUserId'"));
if ($oSet->Count() < 1)
{
return UR_ALLOWED_NO;
@@ -354,7 +354,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI
return $iRetCode;
}
public function IsActionAllowedOnAttribute($sUserName, $sClass, $sAttCode, $iActionCode, dbObjectSet $aInstances)
public function IsActionAllowedOnAttribute($iUserId, $sClass, $sAttCode, $iActionCode, dbObjectSet $aInstances)
{
if (!array_key_exists($iActionCode, self::$m_aActionCodes))
{
@@ -362,7 +362,7 @@ class UserRightsMatrix extends UserRightsAddOnAPI
}
$sAction = self::$m_aActionCodes[$iActionCode];
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixAttributeGrant WHERE UserRightsMatrixAttributeGrant.class = '$sClass' AND UserRightsMatrixAttributeGrant.attcode = '$sAttCode' AND UserRightsMatrixAttributeGrant.action = '$sAction' AND UserRightsMatrixAttributeGrant.login = '$sUserName'"));
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixAttributeGrant WHERE UserRightsMatrixAttributeGrant.class = '$sClass' AND UserRightsMatrixAttributeGrant.attcode = '$sAttCode' AND UserRightsMatrixAttributeGrant.action = '$sAction' AND UserRightsMatrixAttributeGrant.userid = '$iUserId'"));
if ($oSet->Count() < 1)
{
return UR_ALLOWED_NO;
@@ -382,9 +382,9 @@ class UserRightsMatrix extends UserRightsAddOnAPI
return $iRetCode;
}
public function IsStimulusAllowed($sUserName, $sClass, $sStimulusCode, dbObjectSet $aInstances)
public function IsStimulusAllowed($iUserId, $sClass, $sStimulusCode, dbObjectSet $aInstances)
{
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassStimulusGrant WHERE class = '$sClass' AND stimulus = '$sStimulusCode' AND login = '$sUserName'"));
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT UserRightsMatrixClassStimulusGrant WHERE class = '$sClass' AND stimulus = '$sStimulusCode' AND userid = '$iUserId'"));
if ($oSet->Count() < 1)
{
return UR_ALLOWED_NO;

View File

@@ -142,7 +142,7 @@ abstract class cmdbAbstractObject extends CMDBObject
if (!empty($sTemplate))
{
$oTemplate = new DisplayTemplate($sTemplate);
$oTemplate->Render($oPage, array('class'=> get_class($this),'pkey'=> $this->GetKey(), 'name' => $this->GetName()));
$oTemplate->Render($oPage, array('class_name'=> MetaModel::GetName(get_class($this)),'class'=> get_class($this),'pkey'=> $this->GetKey(), 'name' => $this->GetName()));
}
else
{
@@ -152,7 +152,7 @@ abstract class cmdbAbstractObject extends CMDBObject
$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");
$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);
@@ -276,13 +276,15 @@ abstract class cmdbAbstractObject extends CMDBObject
}
$oMenuBlock = new MenuBlock($oSet->GetFilter());
$sHtml .= '<table class="listContainer">';
$sColspan = '';
if ($bDisplayMenu)
{
$sHtml .= '<tr class="containerHeader"><td>';
$sColspan = 'colspan="2"';
$sHtml .= '<tr class="containerHeader"><td>&nbsp;'.$oSet->Count().' object(s)</td><td>';
$sHtml .= $oMenuBlock->GetRenderContent($oPage, $sLinkageAttribute);
$sHtml .= '</td></tr>';
}
$sHtml .= '<tr><td>';
$sHtml .= "<tr><td $sColspan>";
$sHtml .= $oPage->GetTable($aAttribs, $aValues, array('class'=>$sClassName, 'filter'=>$oSet->GetFilter()->serialize(), 'preview' => true));
$sHtml .= '</td></tr>';
$sHtml .= '</table>';
@@ -519,14 +521,14 @@ abstract class cmdbAbstractObject extends CMDBObject
{
$sHTMLValue = "<input type=\"text\" size=\"70\" value=\"\" name=\"attr_$sAttCode\" id=\"$iInputId\"/>";
}
else if (count($aAllowedValues) > 20)
else if (count($aAllowedValues) > 50)
{
// too many choices, use an autocomplete
// The input for the auto complete
$sHTMLValue = "<input type=\"text\" id=\"$iInputId\" size=\"50\" name=\"\" value=\"$sDisplayValue\" />";
$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=\"id_ac_$iInputId\" name=\"attr_$sAttCode\" value=\"$value\" />\n";
$oPage->add_ready_script("\$('#$iInputId').autocomplete('./ajax.render.php', { minChars:3, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, autoFill:true, keyHolder:'#id_ac_$iInputId', extraParams:{operation:'autocomplete', sclass:'$sClass',attCode:'".$sAttCode."'}});");
$sHTMLValue .= "<input type=\"hidden\" id=\"$iInputId\" name=\"attr_$sAttCode\" 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
{

View File

@@ -248,10 +248,6 @@ class DisplayBlock
$bDashboardMode = isset($aExtraParams['dashboard']) ? ($aExtraParams['dashboard'] == 'true') : false;
if ( ($this->m_oSet->Count()> 0) && (UserRights::IsActionAllowed($this->m_oSet->GetClass(), UR_ACTION_READ, $this->m_oSet) == UR_ALLOWED_YES) )
{
if (!$bDashboardMode)
{
$sHtml .= $oPage->GetP($this->m_oSet->Count()." object(s).");
}
$sLinkage = isset($aExtraParams['linkage']) ? $aExtraParams['linkage'] : '';
$sHtml .= cmdbAbstractObject::GetDisplaySet($oPage, $this->m_oSet, $sLinkage, !$bDashboardMode /* bDisplayMenu */);
}
@@ -616,7 +612,8 @@ class MenuBlock extends DisplayBlock
}
else
{
$aActions[] = array ('label' => 'eMail', 'url' => "mailto:?subject=".$oSet->GetFilter()->__DescribeHTML()."&body=".urlencode("http://localhost:81/pages/UI.php?operation=search&filter=$sFilter&$sContext"));
$sUrl = self::GetAbsoluteUrl();
$aActions[] = array ('label' => 'eMail', 'url' => "mailto:?subject=".$oSet->GetFilter()->__DescribeHTML()."&body=".urlencode("$sUrl?operation=search&filter=$sFilter&$sContext"));
$aActions[] = array ('label' => 'CSV Export', 'url' => "../pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext");
$aActions[] = array ('label' => 'Bookmark...', 'url' => "../pages/ajax.render.php?operation=create&class=$sClass&filter=$sFilter", 'class' => 'jqmTrigger');
if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New...', 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext"); }
@@ -663,7 +660,8 @@ class MenuBlock extends DisplayBlock
else
{
// many objects in the set, possible actions are: new / modify all / delete all
$aActions[] = array ('label' => 'eMail', 'url' => "mailto:?subject=".$oSet->GetFilter()->__DescribeHTML()."&body=".urlencode("http://localhost:81/pages/UI.php?operation=search&filter=$sFilter&$sContext"));
$sUrl = self::GetAbsoluteUrl();
$aActions[] = array ('label' => 'eMail', 'url' => "mailto:?subject=".$oSet->GetFilter()->__DescribeHTML()."&body=".urlencode("$sUrl?operation=search&filter=$sFilter&$sContext"));
$aActions[] = array ('label' => 'CSV Export', 'url' => "../pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext");
$aActions[] = array ('label' => 'Bookmark...', 'url' => "../pages/ajax.render.php?operation=create&class=$sClass&filter=$sFilter", 'class' => 'jqmTrigger');
if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New...', 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext"); }
@@ -680,7 +678,25 @@ class MenuBlock extends DisplayBlock
$sHtml .= "</ul>\n</li>\n</ul></div>\n";
$oPage->add_ready_script("$(\"ul.jd_menu\").jdMenu();\n");
return $sHtml;
}
}
static public function GetAbsoluteUrl()
{
// Build an absolute URL to this page on this server/port
$sServerName = $_SERVER['SERVER_NAME'];
$sProtocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
if ($sProtocol == 'http')
{
$sPort = ($_SERVER['SERVER_PORT'] == 80) ? '' : ':'.$_SERVER['SERVER_PORT'];
}
else
{
$sPort = ($_SERVER['SERVER_PORT'] == 443) ? '' : ':'.$_SERVER['SERVER_PORT'];
}
$sPath = $_SERVER['REQUEST_URI'];
$sUrl = "$sProtocol://{$sServerName}{$sPort}{$sPath}";
return $sUrl;
}
}
?>

View File

@@ -255,7 +255,8 @@ EOF
$sText = "Your search";
$sOnClick = " onclick=\"this.value='';this.onclick=null;\"";
}
echo "<div id=\"OrganizationSelection\" style=\"position:absolute; top:18px; right:16px; width:400px;\">";
$sUserName = UserRights::GetUser();
echo "<div id=\"OrganizationSelection\" style=\"position:absolute; top:18px; right:16px; width:400px;\">Logged as '$sUserName'&nbsp;&nbsp;&nbsp;";
echo "<form action=\"../pages/UI.php\" style=\"display:inline\"><div style=\"padding:1px; background-color:#fff;display:inline;\"><img src=\"../images/magnifier.gif\"/><input style=\"border:0\" type=\"text\" size=\"15\" title=\"Global Search\" name=\"text\" value=\"$sText\"$sOnClick></input></div><input type=\"Submit\" value=\"Search\">
<input type=\"hidden\" name=\"operation\" value=\"full_text\"></form>\n";
echo "</div>\n";

View File

@@ -61,7 +61,7 @@ class UILinksWidget
}
// Many values (or even a unknown list) display an autocomplete
if ( (count($aAllowedValues) == 0) || (count($aAllowedValues) > 20) )
if ( (count($aAllowedValues) == 0) || (count($aAllowedValues) > 50) )
{
// too many choices, use an autocomplete
// The input for the auto complete

View File

@@ -34,42 +34,45 @@ class UIWizard
$sJSHandlerCode = ''; // Javascript code to be executed each time this step of the wizard is entered
foreach($aStep as $sAttCode)
{
$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode);
$sAttLabel = $oAttDef->GetLabel();
$iOptions = isset($aStates[$this->m_sTargetState]['attribute_list'][$sAttCode]) ? $aStates[$this->m_sTargetState]['attribute_list'][$sAttCode] : 0;
$aPrerequisites = $oAttDef->GetPrerequisiteAttributes();
if ($iOptions & (OPT_ATT_MANDATORY | OPT_ATT_MUSTCHANGE | OPT_ATT_MUSTPROMPT))
if ($sAttCode != 'finalclass') // Do not displa the attribute that stores the actual class name
{
$aFields[$sAttCode] = array();
foreach($aPrerequisites as $sCode)
$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode);
$sAttLabel = $oAttDef->GetLabel();
$iOptions = isset($aStates[$this->m_sTargetState]['attribute_list'][$sAttCode]) ? $aStates[$this->m_sTargetState]['attribute_list'][$sAttCode] : 0;
$aPrerequisites = $oAttDef->GetPrerequisiteAttributes();
if ($iOptions & (OPT_ATT_MANDATORY | OPT_ATT_MUSTCHANGE | OPT_ATT_MUSTPROMPT))
{
$aFields[$sAttCode][$sCode] = '';
$aFields[$sAttCode] = array();
foreach($aPrerequisites as $sCode)
{
$aFields[$sAttCode][$sCode] = '';
}
}
if (count($aPrerequisites) > 0)
{
$aOptions[] = 'Prerequisites: '.implode(', ', $aPrerequisites);
}
$sFieldFlag = ($iOptions & (OPT_ATT_MANDATORY | OPT_ATT_MUSTCHANGE)) ? ' <span class="hilite">*</span>' : '';
$oDefaultValuesSet = $oAttDef->GetDefaultValue(); // @@@ TO DO: get the object's current value if the object exists
$sHTMLValue = cmdbAbstractObject::GetFormElementForField($this->m_oPage, $this->m_sClass, $sAttCode, $oAttDef, $oDefaultValuesSet, '', "att_$iMaxInputId");
$aFieldsMap[$iMaxInputId] = $sAttCode;
$aDetails[] = array('label' => $oAttDef->GetLabel().$sFieldFlag, 'value' => "<div id=\"field_$iMaxInputId\">$sHTMLValue</div>");
if ($oAttDef->GetValuesDef() != null)
{
$sJSHandlerCode .= "\toWizardHelper.RequestAllowedValues('$sAttCode');\n";
}
if ($oAttDef->GetDefaultValue() != null)
{
$sJSHandlerCode .= "\toWizardHelper.RequestDefaultValue('$sAttCode');\n";
}
if ($oAttDef->IsLinkSet())
{
$sJSHandlerCode .= "\toLinkWidgetatt_$iMaxInputId.Init();";
}
$iMaxInputId++;
}
if (count($aPrerequisites) > 0)
{
$aOptions[] = 'Prerequisites: '.implode(', ', $aPrerequisites);
}
$sFieldFlag = ($iOptions & (OPT_ATT_MANDATORY | OPT_ATT_MUSTCHANGE)) ? ' <span class="hilite">*</span>' : '';
$oDefaultValuesSet = $oAttDef->GetDefaultValue(); // @@@ TO DO: get the object's current value if the object exists
$sHTMLValue = cmdbAbstractObject::GetFormElementForField($this->m_oPage, $this->m_sClass, $sAttCode, $oAttDef, $oDefaultValuesSet, '', "att_$iMaxInputId");
$aFieldsMap[$iMaxInputId] = $sAttCode;
$aDetails[] = array('label' => $oAttDef->GetLabel().$sFieldFlag, 'value' => "<div id=\"field_$iMaxInputId\">$sHTMLValue</div>");
if ($oAttDef->GetValuesDef() != null)
{
$sJSHandlerCode .= "\toWizardHelper.RequestAllowedValues('$sAttCode');\n";
}
if ($oAttDef->GetDefaultValue() != null)
{
$sJSHandlerCode .= "\toWizardHelper.RequestDefaultValue('$sAttCode');\n";
}
if ($oAttDef->IsLinkSet())
{
$sJSHandlerCode .= "\toLinkWidgetatt_$iMaxInputId.Init();";
}
$iMaxInputId++;
}
//$aDetails[] = array('label' => '', 'value' => '<input type="button" value="Next &gt;&gt;">');
$this->m_oPage->details($aDetails);

View File

@@ -146,7 +146,7 @@ class logRealObject extends cmdbAbstractObject
MetaModel::Init_Params($aParams);
MetaModel::Init_AddAttribute(new AttributeString("name", array("label"=>"Name", "description"=>"Common name", "allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("status", array("label"=>"Status", "description"=>"Lifecycle status", "allowed_values"=>$oAllowedStatuses, "sql"=>"status", "default_value"=>"implementation", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("org_id", array("targetclass"=>"bizOrganization", "label"=>"Organization Id", "description"=>"ID of the object owner organization", "allowed_values"=>new ValueSetObjects("bizOrganization: status Contains 'implementation'", 'name', array('name'=>true)), "sql"=>"org_id", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalKey("org_id", array("targetclass"=>"bizOrganization", "label"=>"Organization Id", "description"=>"ID of the object owner organization", "allowed_values"=>null, "sql"=>"org_id", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalField("org_name", array("label"=>"Organization", "description"=>"Company / Department owning this object", "allowed_values"=>null, "extkey_attcode"=> 'org_id', "target_attcode"=>"name")));
MetaModel::Init_AddFilterFromAttribute("name");
@@ -1547,6 +1547,7 @@ class lnkClientServer extends logRealObject
"db_table" => "clientserver_links",
"db_key_field" => "link_id",
"db_finalclass_field" => "",
"display_template" => "../business/templates/default.html",
);
MetaModel::Init_Params($aParams);
MetaModel::Init_AddAttribute(new AttributeExternalKey("client_id", array("targetclass"=>"bizApplication", "jointype"=> '', "label"=>"Client", "description"=>"The client part of the link", "allowed_values"=>null, "sql"=>"client_id", "is_null_allowed"=>false, "depends_on"=>array())));

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/WanLinks.jpg" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/software.jpg" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/imageChange.gif" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/erwanContracts.jpg" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/tar.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/folder_documents.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/tar.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/tar.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">bizKnownError: pkey = $pkey$</itopblock>

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/starthere.png" style="margin-top:-20px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/connect_to_network.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/laptop_pcmcia.png" style="margin-top:-20px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/users2-big.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/network-server.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/kservices-big.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/software.jpg" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/users2-big.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -1,6 +1,6 @@
<div class="page_header">
<itopblock blockclass="MenuBlock" type="popup" encoding="text/sibusql" label="Actions">$class$: pkey = $pkey$</itopblock>
<h1>$class$: <span class="hilite">$name$</span></h1>
<h1>$class_name$: <span class="hilite">$name$</span></h1>
<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOpSetAttribute WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
</div>
<img src="../images/messagebox_warning.png" style="margin-top:-10px; margin-right:10px; float:right">

View File

@@ -40,7 +40,7 @@ require_once('dbobjectset.class.php');
require_once('cmdbchange.class.inc.php');
require_once('cmdbchangeop.class.inc.php');
require_once('csvparser.class.inc.php');
//require_once('csvparser.class.inc.php');
require_once('bulkchange.class.inc.php');
require_once('userrights.class.inc.php');

View File

@@ -176,7 +176,7 @@ class UserRights
public static function GetFilter($sClass)
{
if (!MetaModel::HasCategory($sClass, 'bizModel')) return new DBObjectSearch($sClass);
if (!MetaModel::HasCategory($sClass, 'bizmodel')) return new DBObjectSearch($sClass);
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->GetFilter(self::$m_iUserId, $sClass);
@@ -184,7 +184,7 @@ class UserRights
public static function IsActionAllowed($sClass, $iActionCode, dbObjectSet $aInstances)
{
if (!MetaModel::HasCategory($sClass, 'bizModel')) return true;
if (!MetaModel::HasCategory($sClass, 'bizmodel')) return true;
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->IsActionAllowed(self::$m_iUserId, $sClass, $iActionCode, $aInstances);
@@ -192,7 +192,7 @@ class UserRights
public static function IsStimulusAllowed($sClass, $sStimulusCode, dbObjectSet $aInstances)
{
if (!MetaModel::HasCategory($sClass, 'bizModel')) return true;
if (!MetaModel::HasCategory($sClass, 'bizmodel')) return true;
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->IsStimulusAllowed(self::$m_iUserId, $sClass, $sStimulusCode, $aInstances);
@@ -200,7 +200,7 @@ class UserRights
public static function IsActionAllowedOnAttribute($sClass, $sAttCode, $iActionCode, dbObjectSet $aInstances)
{
if (!MetaModel::HasCategory($sClass, 'bizModel')) return true;
if (!MetaModel::HasCategory($sClass, 'bizmodel')) return true;
if (!self::CheckLogin()) return false;
return self::$m_oAddOn->IsActionAllowedOnAttribute(self::$m_iUserId, $sClass, $sAttCode, $iActionCode, $aInstances);

View File

@@ -243,22 +243,17 @@ switch($operation)
$oP->add_linked_script("../js/jquery.blockUI.js");
$oWizard = new UIWizard($oP, $sClass, $sStateCode);
$sStateCode = $oWizard->GetTargetState(); // Will computes the default state if none was supplied
$sClassLabel = MetaModel::GetName($sClass);
$oP->p("<h2>Creation of a new $sClassLabel</h2>");
if (!empty($sStateCode))
{
$aStates = MetaModel::EnumStates($sClass);
$sStateLabel = $aStates[$sStateCode]['label'];
$oP->p("Wizard for creating an object of class '$sClass' in state '$sStateCode'.");
}
else
{
// Stateless object
$oP->p("Wizard for creating an object of class '$sClass'.");
}
$aWizardSteps = $oWizard->GetWizardStructure();
// Display the structure of the wizard
$iStepIndex = 1;
$oP->p("<h2>Wizard Steps for creating an object of class '$sClass' in state '$sStateCode'</h2>\n");
$iMaxInputId = 0;
$aFieldsMap = array();
foreach($aWizardSteps['mandatory'] as $aSteps)

View File

@@ -7,6 +7,9 @@ $currentOrganization = utils::ReadParam('org_id', '');
$operation = utils::ReadParam('operation', '');
$oAppContext = new ApplicationContext();
require_once('../application/loginwebpage.class.inc.php');
login_web_page::DoLogin(); // Check user rights and prompt if needed
$oP = new iTopWebPage("iTop - CMDB Audit", $currentOrganization);
function GetRuleResultSet($iRuleId, $oDefinitionFilter)

View File

@@ -330,11 +330,11 @@ function PrepareObject(&$oTargetObj, $aRowData, $aAttList, $aExtKeys, &$aWarning
// Report it
if (array_key_exists($sAttCode, $oTargetObj->ListChanges()))
{
$aResults[$sAttCode]= "<div class=\"csvimport_ok\">".$oForeignObj->GetHyperLink()."</div>";
$aResults[$sAttCode]= "<div class=\"csvimport_ok\">".$oForeignObj->GetName()."</div>";
}
else
{
$aResults[$sAttCode]= "<div class=\"\">".$oForeignObj->GetHyperLink()."</div>";
$aResults[$sAttCode]= "<div class=\"\">".$oForeignObj->GetName()."</div>";
}
break;
default:
@@ -421,7 +421,7 @@ function CreateObject(&$aResult, $iRow, $sClass, $aRowData, $aAttList, $aExtKeys
if ($oChange)
{
$newID = $oTargetObj->DBInsertTracked($oChange);
$aResult[$iRow]["__STATUS__"] = "Created: ".$oTargetObj->GetHyperLink($newID);
$aResult[$iRow]["__STATUS__"] = "Created: ".$oTargetObj->GetName();
}
else
{
@@ -561,7 +561,7 @@ function ProcessData($oPage, $sClass, $oCSVParser, $aFieldMap, $aIsReconcKey, CM
case 1:
$oTargetObj = $oReconciliationSet->Fetch();
UpdateObject($aResult, $iRow, $oTargetObj, $aRowData, $aAttList, $aExtKeys, $oChange);
$aResult[$iRow]["__RECONCILIATION__"] = "Found a ".$oTargetObj->GetHyperLink("match");
$aResult[$iRow]["__RECONCILIATION__"] = "Found a match: ".$oTargetObj->GetName();
// $aResult[$iRow]["__STATUS__"]=> set in UpdateObject
break;
default:

View File

@@ -160,7 +160,7 @@ function DisplayLifecycle($oPage, $sClass)
{
$aStates = MetaModel::EnumStates($sClass);
$aStimuli = MetaModel::EnumStimuli($sClass);
$oPage->add("<img src=\"/pages/graphviz.php?class=$sClass\">\n");
$oPage->add("<img src=\"../pages/graphviz.php?class=$sClass\">\n");
$oPage->add("<h3>Transitions</h3>\n");
$oPage->add("<ul>\n");
foreach ($aStates as $sStateCode => $aStateDef)

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<Set>
<bizPerson id="21">
<name>Denis</name>
<name>Verne</name>
<status>production</status>
<org_id>3</org_id>
<email>denis.flaven@gmail.com</email>
<email>jules.verne@gmail.com</email>
<phone></phone>
<location_id>29</location_id>
<first_name>Flaven</first_name>
<first_name>Jules</first_name>
<employe_number></employe_number>
</bizPerson>
<bizPerson id="20">
<name>Quetiez</name>
<name>Dumas</name>
<status>production</status>
<org_id>3</org_id>
<email>romain.quetiez@gmail.com</email>
<email>alexandre.dumas@gmail.com</email>
<phone></phone>
<location_id>1</location_id>
<first_name>Romain</first_name>
<first_name>Dumas</first_name>
<employe_number></employe_number>
</bizPerson>
<bizPerson id="7">
<name>Taloc</name>
<name>Hugo</name>
<status>production</status>
<org_id>3</org_id>
<email>erwan.taloc@gmail.com</email>
<email>victor.hugo@gmail.com</email>
<phone>33172382223</phone>
<location_id>1</location_id>
<first_name>Erwan</first_name>
<first_name>Victor</first_name>
<employe_number>e12345</employe_number>
</bizPerson>
</Set>
</Set>

View File

@@ -151,20 +151,11 @@
<parent_id>1</parent_id>
<name>Audit</name>
<label>Audit</label>
<hyperlink>/pages/audit.php</hyperlink>
<hyperlink>./audit.php</hyperlink>
<template></template>
<rank>4</rank>
<type>application</type>
</menuNode>
<menuNode id="44">
<parent_id>17</parent_id>
<name>Backup &amp; Restore</name>
<label>Backup &amp; Restore the whole database</label>
<hyperlink>./db_importer.php</hyperlink>
<template></template>
<rank>998</rank>
<type>application</type>
</menuNode>
<menuNode id="66">
<parent_id>0</parent_id>
<name>Change Management</name>
@@ -367,7 +358,7 @@ td.dashboard {
<parent_id>17</parent_id>
<name>Export</name>
<label>Export any filter in HTML, CSV or XML</label>
<hyperlink>./export.php</hyperlink>
<hyperlink>../webservices/export.php</hyperlink>
<template></template>
<rank>1000</rank>
<type>application</type>
@@ -601,7 +592,7 @@ text-align:center;
&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.7&lt;/i&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.7.2&lt;/i&gt;&lt;/p&gt;
</template>
<rank>1</rank>