Help me for my first plugin: Predefined Title

Hi plugin stars. Firstly thanks for your valuable contributions.
Can you please guide me for my first Plugin?
I want to create a plugin that will override predefined_task_description. Currently, this function sets only the task description from a list of predefined title-description pairs. My plugin will set the task title as well as the description.
I read the Plugin Development documentation, and check the example plugin. But I don’t know where to start.
When editing a task, a dropdown appears under description section and it lists predefined title-description pairs. When selected, it copies the description to the task description. Specifically, I couldn’t find in the repo, where exactly this happens. I will just add the code to copy the title too.

I’m not sure i understand what exactly you are trying to accomplish, so it’s hard to assist.

I can show you where the templates are rendered tho:

Dear creecros, thank you for your help. Let me define my goal a bit more clear.
Predefined descriptions are defined as key-value pairs. Current functionality copies the value to the task description. I want to copy the key to the title field.


My question is: where does exactly the click event to the predefined Template list happens? That way maybe I can add some code to copy the key to the title as well.
If you have a better idea to achieve this goal, that is also appreciated.

The click event is triggered through js.

for instance, look at this line:

if the target was "input[name=title]" then it would auto fill the title line instead. you could also send it via document.getElementById(“form-title”)

so, all you need to do is add a code that also sends the title to the title, using the appropriate target. and line 75 shows you exactly how to get that data to send: $this->helper->text->e($template['title'])

do i need to explain more, or do you think you got it now?

Very well explained. Thank you very much.
I will try it feedback here.
Best regards,

I have applied your directives on my local instance. It is working as requested.
Thank you very much.
Before going into version 1.0 of my first plugin, I want to make a small visual change.
How can I change the order of objects in task form? (as shown below)
plugin1i2

The task creation template calls the helpers.

So, you will need to override the current template, with a new one, ordering the calls in the order you want.

Here is the template you need to override:

I have done the order change on both task_creation and task_modification. Thanks for your guidance.
This is a nice to have feature. Is it a good idea to override these codes?
When new versions release in the future, should I check and update it every time?

Not seeing another option, override. Its a small task to update if there are changes in the future. Its not but a couple overrides. As to how up to date you take the time to keep it, its up to you. Some of my plugins are a nightmare to keep up to date, so I just pray nothing changes…