hello
I would like to create a module for auto numbering of projects.
I would like to include in the project name the value of a field that needs to be entered when the project is created
Hi
Can you please draw a picture and show more detail…?
Have you tried Setup > Modules > Project and click on Settings
thanks,
yesbee
hello,
thank you for your response.
what I highlighted in the image is a field that I added via Setup → Modules → Project → Complementary attributes.
What I would like is that when the save button is pressed, the field is used to generate the project name along with the date or a sequential value (as in the auto numbering module).
something like “PJ-0123456789-230403-001”.
thanks in advance
A quick and dirty way might look like this:
define your mask as follows: {yy}{mm}{dd}-{000}
and then create the projectID (prefix with ‘PJ-{your number}-’) at “add” in project/card.php
name ‘options_ucn’ after the name of your extrafield (here the name of the extrafield is ‘ucn’, ‘options_’ is always been prefixed for extrafields)
If necessary, change this in a similar way also for update
Or define a mask as follows: PJ-placeholder-{yy}{mm}{dd}-{000} and then use str_replace(‘placeholder’, GETPOST(‘options_ucn’), $object_ref);
instead of concatenate the strings.