Yes. But if the private log is established as mandatory, the change would imply for incidents, requirements. Since the field is in the Ticket class. It could be set only mandatory for Changes? Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to place the private log as mandatory in the change. It's possible? Any guides to get my bearings? Thanks.
You'll need to create an extension to customize iTop's datamodel:
Most useful resources are:
https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Axml_reference
https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Adatamodel#content_of_a_module
Last edit: Jeffrey Bostoen 2022-03-18
Yes. But if the private log is established as mandatory, the change would imply for incidents, requirements. Since the field is in the Ticket class. It could be set only mandatory for Changes? Thanks.
Good question. I think it may be possible to make it mandatory with a bit of PHP code:
https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Amandatory-field-subclass
Thank you. I have a question. I have created the extension but where would I put the PHP code? In the datamodel file?
public function GetAttributeFlags ( $sAttCode , & $aReasons = array ( ) , $sTargetState = '' )
{ if ( $sAttCode == 'private_log' )
{ return ( OPT_ATT_MANDATORY | padre ::GetAttributeFlags ( $sAttCode , $aReasons , $sTargetState ) ) ;
}
return parent :: GetAttributeFlags ( $sAttCode , $aReasons , $sTargetState ) ;
}
public function GetInitialStateAttributeFlags ( $sAttCode , & $aReasons = array ( ) )
{
if ( ( $sAttCode == 'private_log' ) )
{
return ( OPT_ATT_MANDATORY | padre :: GetInitialStateAttributeFlags ( $ sAttCode , $aRazones ) ) ;
}
return parent :: GetInitialStateAttributeFlags ( $sAttCode , $aReasons );
}
Hello Delia,
There are 2 options
Thanks for the information.