I´m using in the Class Software the DisplayBareRelation-Method to show the connection of User and Software.
<methodid="DisplayBareRelations"_delta="define"><static>false</static><access>public</access><type>Overload-cmdbAbstractObject</type><code><![CDATA[ function DisplayBareRelations(WebPage $oPage, $bEditMode = false) { parent::DisplayBareRelations($oPage, $bEditMode); if (!$bEditMode) { if (MetaModel::IsValidClass('Software')) { //Search for User $oPage->SetCurrentTab(Dict::S('Class:Software:UserList')); $iSoftwareID = $this->GetKey();; $oUserSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT si,p FROM SoftwareInstance AS si JOIN PC AS pc ON si.system_id=pc.id JOIN lnkContactToFunctionalCI AS lnk ON lnk.functionalci_id=pc.id JOIN Person AS p ON lnk.contact_id=p.id WHERE si.software_id=$iSoftwareID")); $iNumberU=$oUserSet->count(); if ($iNumberU > 0) { $oPage->SetCurrentTab(Dict::S('Class:Software:UserList')." ($iNumberU)"); } else { $oPage->SetCurrentTab(Dict::S('Class:Software:UserList')); } self::DisplaySet($oPage, $oUserSet, array ('menu' => false)); } } }]]></code></method>
The problem is, that i can see in the Tab only the SoftwareInstance and not the Persons too (SELECT si,p). If I test the Query in Admin-Tools it works perfectly.
Any ideas what I can do?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Put a $oPage->Rewind(); before the if statement. Apparently count leaves the object pointer at the end of the object. The SetCUrrentTab() function has no reference as the pointer is pointing to null. (the end). Maybe :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I´m using in the Class Software the DisplayBareRelation-Method to show the connection of User and Software.
The problem is, that i can see in the Tab only the SoftwareInstance and not the Persons too (SELECT si,p). If I test the Query in Admin-Tools it works perfectly.
Any ideas what I can do?
Put a $oPage->Rewind(); before the if statement. Apparently count leaves the object pointer at the end of the object. The SetCUrrentTab() function has no reference as the pointer is pointing to null. (the end). Maybe :)