Hi,
This interface should still work in iTop 3.2. Have you tried debugging/adding trace to ensure your code is interpreted ?
Since iTop 3.0 you can also use this interface to add ready scripts:
/** * Implement this interface to add inline script (JS) to the backoffice pages that will be executed slightly AFTER the DOM is ready (just after the init. scripts). * * @see \iTopWebPage::$a_ready_scripts * @api * @package BackofficeUIExtensibilityAPI * @since 3.0.0 */interfaceiBackofficeReadyScriptExtension{/** * @api * @see \iTopWebPage::$a_ready_scripts * @return string */publicfunctionGetReadyScript():string;}
Hope this helps,
Stephen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i will try iBackofficeReadyScriptExtension interface, it looks well 😊
i have another question about ev_approve stimulus on change class,
this action leads to a form that can no longer be extended with iApplicationUIExtension::OnDisplayProperties(), is there any change from that too?
Ok I think I understand what's going on, OnDisplayProperties is called when the properties are displayed, meaning when the details of an object are displayed.
In iTop 2.7 you had the details displayed under the transition form.
Going forward with iTop 3.0 we removed these properties and only displayed the form, so the OnDisplayProperties method is not called anymore on this page.
We encourage using the iBackofficeXXXExtension as giving direct access to the $oPage element as it allowed developer to do anything on it, which was to complicated for us to maintain and guarantee over time.
Moreover you'll have access to more meta data in the console starting with iTop 3.0 allowing your scripts to do some checks to, example for transitions:
Thank you for your reply, i think you understood what is going on 😃
Please where i could find the documentation of iBackofficeXXXExtension, i couldnt find it to the itop doc. plus
in the form transition i want to access to objects detail in my script to prefill the start_date and end_date with javascript as image below, the iBackofficeXXXExtension combined to meta-data can do so ?
Our documentation on the developers APIs is not that complete yet, I'd recommend going to this page and if you need check examples on how it can be used
For your specific case I think using Form Prefill and more specifically Prefill Transition Form would be easier and really suit your needs (and would also work in the Portal/Kanban board/ and transitions in popups if we add it one day 😁)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone,
i am migrating my itop to 2.7 to 3.2 and i am facing one issue with my custom extension,
it seems like $oPage->add_ready_script() doesnt work anymore, but i havent see a notice about that in changelog.
this code works well in itop2.7
But in itop3.2 it doesn't work,
my question is add_ready_script is deprecated? and how to do the same way in the new version
thank you
Hi,
This interface should still work in iTop 3.2. Have you tried debugging/adding trace to ensure your code is interpreted ?
Since iTop 3.0 you can also use this interface to add ready scripts:
Hope this helps,
Stephen
Hi,
Thanks for your reply,
i will try iBackofficeReadyScriptExtension interface, it looks well 😊
i have another question about ev_approve stimulus on change class,
this action leads to a form that can no longer be extended with iApplicationUIExtension::OnDisplayProperties(), is there any change from that too?
Expected Result: Hello word in the console on the change approval form
is there anything i missed ?
I attach the first image (the button for approve change)
and the second image (the form page which is not extended by OnDisplayProperties)
Ok I think I understand what's going on,
OnDisplayProperties
is called when the properties are displayed, meaning when the details of an object are displayed.In iTop 2.7 you had the details displayed under the transition form.
Going forward with iTop 3.0 we removed these properties and only displayed the form, so the
OnDisplayProperties
method is not called anymore on this page.We encourage using the
iBackofficeXXXExtension
as giving direct access to the$oPage
element as it allowed developer to do anything on it, which was to complicated for us to maintain and guarantee over time.Moreover you'll have access to more meta data in the console starting with iTop 3.0 allowing your scripts to do some checks to, example for transitions:
Hello Stephen,
Thank you for your reply, i think you understood what is going on 😃
Please where i could find the documentation of iBackofficeXXXExtension, i couldnt find it to the itop doc. plus
in the form transition i want to access to objects detail in my script to prefill the start_date and end_date with javascript as image below, the iBackofficeXXXExtension combined to meta-data can do so ?
thank you.
Our documentation on the developers APIs is not that complete yet, I'd recommend going to this page and if you need check examples on how it can be used
For your specific case I think using Form Prefill and more specifically Prefill Transition Form would be easier and really suit your needs (and would also work in the Portal/Kanban board/ and transitions in popups if we add it one day 😁)
Hello Stephen,
the iBackOffice interface works well, and the Prefill Transition form also 😃
thanks you for your help
Glad to see it works! :)
Okay let's check all of that, get you soon
thank you Stephen