getVersion(), __FILE__, __LINE__, __METHOD__, 9 ); return true; } /** * @return bool */ function postInstall() { Debug::text( 'postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9 ); //Modify all hierarchies with the request object type included, to add new request object types. $hclf = TTnew( 'HierarchyControlListFactory' ); /** @var HierarchyControlListFactory $hclf */ $hclf->getAll(); if ( $hclf->getRecordCount() > 0 ) { foreach ( $hclf as $hc_obj ) { $src_object_types = $hc_obj->getObjectType(); $request_key = array_search( 50, $src_object_types ); if ( $request_key !== false ) { Debug::Text( 'Found request object type, ID: ' . $hc_obj->getId() . ' Company ID: ' . $hc_obj->getCompany(), __FILE__, __LINE__, __METHOD__, 10 ); unset( $src_object_types[$request_key] ); $src_object_types[] = 1010; $src_object_types[] = 1020; $src_object_types[] = 1030; $src_object_types[] = 1040; $src_object_types[] = 1100; $src_object_types = array_unique( $src_object_types ); $hc_obj->setObjectType( $src_object_types ); if ( $hc_obj->isValid() ) { $hc_obj->Save(); } } else { Debug::Text( 'Request object type not found for ID: ' . $hc_obj->getId() . ' Company ID: ' . $hc_obj->getCompany(), __FILE__, __LINE__, __METHOD__, 10 ); } } } return true; } } ?>