Hi together, what i like to realize is to create a new custom field in a ticket. As you can se in a attached pick, it should be called "External Ticket No". I know that a have to create a extension for this.
This is how i defined the datamodel.zwettler-fremdticketnr.xml. But the custom field does not appear, when i create a new ticket.
The New Extension is recognized when a run setup (attachement!)
I do NOT get an error during the setup.
I also can see the new defiened field "fremdticketnr" that was added in the database.
This is my datamodel.XML (datamodel.zwettler-fremdticketnr)
Hello Zwetttler,
The Ticket class, is not a final class, so altering its presentation, has no effect. The presentation is not inherited. You have a change the presentation of UserRequest class
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
by now i get this error when i'm running setup (see also attachement)
Failed to process class 'Ticket', from 'C:\inetpub\itopdemo\datamodels\2.x\itop-tickets': Field: 'fremdticketnr', (type: AttributeString), missing (or empty) mandatory tag 'sql' under the tag 'field'
i added a section "<class id="user-content-UserRequest">" in XML now</class>
now i get this error during setup (compling data model):
Progress of the installation
Error loading module "zwettler-fremdticketnr": /itop_design/classes/class[UserRequest] at line 36: could not be found - Loaded modules: dictionaries,core,application,authent-cas,authent-external,authent-ldap,authent-local,combodo-backoffice-darkmoon-theme,combodo-cmdbchange-cleaner,combodo-email-synchro,itop-attachments,itop-backup,itop-config,itop-files-information,itop-portal-base,itop-portal,itop-profiles-itil,itop-sla-computation,itop-standard-email-synchro,itop-structure,itop-themes-compat,itop-tickets,itop-welcome-itil,zwettler-fremdticketnr
20 %
This time, it is a dependency issue in your file "module.zwettler-fremdticketnr.php", which is not mentioning that it relies on the module which brings the UserRequest class
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Of course i trust you/him :-) I'm very glad of you help!
As i found out the dependendies are defined here
- how do i know which dependencies do define?
- how do i know which version of the dependent module to use?
- in my case i only tried it out
Actually this works fine! Attached find a screenshot of my successful implementation of the custom field. The translation will be done.
**
Snip of my module.zwettler-userrequest.php**
Hi together, what i like to realize is to create a new custom field in a ticket. As you can se in a attached pick, it should be called "External Ticket No". I know that a have to create a extension for this.
This is how i defined the datamodel.zwettler-fremdticketnr.xml. But the custom field does not appear, when i create a new ticket.
This is my datamodel.XML (datamodel.zwettler-fremdticketnr)
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
<constants>
</constants>
<classes></classes></itop_design>
<class id="user-content-Ticket"></class>
<menus>
</menus>
<user_rights>
<groups>
</groups>
<profiles>
</profiles>
</user_rights>
Has anyone an idea how t solve this?
Regards,
G.H.
Sorry, this is the right code
Hello Zwetttler,
The Ticket class, is not a final class, so altering its presentation, has no effect. The presentation is not inherited. You have a change the presentation of UserRequest class
Also this tag delta is wrong
It will replace the current definition by your delta :-(
use no delta (which means merge), or delta="must_exist"
Hi Vincent, many thanks ... i'm going further.
by now i get this error when i'm running setup (see also attachement)
Failed to process class 'Ticket', from 'C:\inetpub\itopdemo\datamodels\2.x\itop-tickets': Field: 'fremdticketnr', (type: AttributeString), missing (or empty) mandatory tag 'sql' under the tag 'field'
i removed all the deltas by now
You have left the only wrong delta and removed all the mandatory and correct ones, so it can't work for sure.... :-(
oh sorry, i'm a rooky :-) Setup is complete now - no more errors.
However, the new field is not visible in the ticket entry form.
See @cisou's remark, you need to add the field to t he presentation of the "user request" class.
Thank you, I really appreciate your help!
i added a section "<class id="user-content-UserRequest">" in XML now</class>
Progress of the installation
Error loading module "zwettler-fremdticketnr": /itop_design/classes/class[UserRequest] at line 36: could not be found - Loaded modules: dictionaries,core,application,authent-cas,authent-external,authent-ldap,authent-local,combodo-backoffice-darkmoon-theme,combodo-cmdbchange-cleaner,combodo-email-synchro,itop-attachments,itop-backup,itop-config,itop-files-information,itop-portal-base,itop-portal,itop-profiles-itil,itop-sla-computation,itop-standard-email-synchro,itop-structure,itop-themes-compat,itop-tickets,itop-welcome-itil,zwettler-fremdticketnr
20 %
here is the full code
This time, it is a dependency issue in your file "module.zwettler-fremdticketnr.php", which is not mentioning that it relies on the module which brings the UserRequest class
i my opion ist is defined by "<class id="user-content-UserRequest">"</class>
You can trust @ciso , it's very likely a missing dependency in the PHP file.
In the dependencies array, you'll probably need to add something like
itop-request-mgmt-itil/2.7.0 (assuming you're using ITIL; otherwise it will likely be itop-request-mgmt/2.7.0 )
Of course i trust you/him :-) I'm very glad of you help!
As i found out the dependendies are defined here
- how do i know which dependencies do define?
- how do i know which version of the dependent module to use?
- in my case i only tried it out
Actually this works fine! Attached find a screenshot of my successful implementation of the custom field. The translation will be done.
**
Snip of my module.zwettler-userrequest.php**
Since I could now solve the requirement - with the great help of the forum (!!) - I would like to make the finished extension available here for free.
Accached find a screenshot und a ZIP-file with the extension. Feel free to use an adopt it!