Hi Frédérique,
Thank you for waiting, as I carefully reviewed the requirements that you've shared.
What you're trying to achieve is challenging, because there are a number of steps and actions involved, some of which will require code customizations. For this reason, I'll strongly recommend hiring a professional to complete this project, if you're not comfortable with writing custom PHP functions, on your own.
( ref: https://toolset.com/contractors/ )
I'm going to add some notes about the steps that you've shared:
1. The publisher distributes a press service to columnists
I see that you've added a "Services presse" post type to record each task from the publisher.
You've also added a custom field group "Champs pour Services Presse" with the fields that you need. I would also include another field like "Services presse status", which can have possible values:
- Open (default)
- Assigned/In progress
- Completed
As the name indicates, when a new "Services presse" post will be created it will be "Open" for columnists to apply to.
When the editor has accepted any columnist's request, the status of this "Services presse" post will be changed to "Assigned/In progress".
And when this "Services presse" task has been completed, the status will be changed to "Completed".
Note: In place of "Services presse status" field, you can use the default post statuses, like "Pending review", "Draft", "Published", but, I find using a custom field for this more helpful and descriptive since you can control the text of status options.
I would also include a select type custom field "Services presse status assigned to", which will include the list of all the columnists, as options and when this "Services presse" is assigned to a columnist, his/her ID will be saved in this field.
Note: you won't have to add those columnist options, manually for this field and the "wpt_field_options" filter can be used to generate these options, programmatically:
https://toolset.com/documentation/programmer-reference/types-api-filters/#wpt_field_options
2. The columnist offers his column from the press service published by the editor
If we think of "Services presse" as tasks, then we need a post type to collect applications for these tasks. I would add a new custom post type "Services presse applications" for this. This post type will have a "one-to-many" relationship with the "Services presse" post type, so that each "Services presse" can have many "Services presse applications".
This post type will include custom fields like why are you interested, how soon can you deliver, in what formats you can deliver etc. You can also include a "Services presse application status" field, which can have these options:
- Pending approval (default)
- Accepted
- Rejected
3. The editor accepts or rejects the request made by the columnist. If he accepts, he sends the columnist the digital file or asks for the columnist's postal address to send him the Clipboard Service.
When columnists will see an "Open" state "Services presse" post, they can visit that post's single page and then apply to provide their service for this "Services presse" post, using a form to add a new "Services presse applications".
The editor will see all the "Services presse applications" posts that are in the "Pending approval" state and then will be able to "Accept" or "Reject" them, using two separate forms.
The "Reject" form will simply change this post's status field to "Rejected" and the "Accept" form will change it to "Accepted". The "accept" form will also change the related "Services presse" post's "Services presse status" field to "Assigned/In progress" and the "Services presse status assigned to" field to have the value of the columnists, whose application has been accepted.
Note: You can use the "cred_save_data" hook to execute a custom function, when a certain form has been submitted:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
4. The columnist sends his column to the editor for evaluation.
If "Services presse" are tasks, "Services presse applications" are applications for those tasks, then we'll need another post type that will hold the completed product or outcome of that task. This is where your custom post type "Chroniques" comes in. This post type will include the fields related to the actual column's data including fields for any supporting files and the "Chroniques status" field, which can have these options:
- In process (default)
- Submitted for the editor review
- Submitted for the publisher review
- Accepted
- Rejected
After a "Services presse" has been awarded to a columnist, he/she can add a new "Chroniques" post and as the work progress, keep editing it to include and update the relevant information about the column. Once it is ready, a form can be used to send it for the editor's approval, by changing the status to "Submitted for the editor review".
5. The publisher validates or rejects it
Once the editor has approved it, its status can be changed to "Submitted for the publisher review". Using another set of forms, the publisher can either approve or reject it, by changing the status to "Accepted" or "Rejected".
The form that will set this "Chroniques" post's status to "Accepted" will also change the related "Services presse" post's "Services presse status" to "Completed".
I hope this overview of the workflow and steps will make it more clear. If you have any follow-up questions related to this overview, please share them through this ticket.
For questions related to details of how a certain element used at a particular step, will need to be set up, you're welcome to start a new ticket, for each step/element.
regards,
Waqar