I want to clone a ticket attachment and display a popup before attaching the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 11:19 PM
This was written using a translation. Sorry for my poor English.
I want to clone a ticket attachment (ID: widget-ticket-attachments) and display a popup on the client controller side to confirm that the attached file is correct.
The details of the popup we want to display are shown below.
【Display timing】After the file to be attached is selected and before a record is created in the sys_attachment table, we would like to display the popup.
【Displayed contents】Do you want to send this file?
File to be sent: [File name] Yes No
Yes No
【Action】
Click Yes: Send the selected file.
Click No & other: Do not send the selected file.
I would like to display a popup like this, but the client controller only writes the behavior after the file is attached, and I cannot write the behavior before the file is attached.
Therefore, we would like to partially change the popup from the above specification.
【Display timing】
Displayed after file attachment
【Action】
Immediately after the file is attached: The file is made private.
Click Yes: Make the file public.
Clicking No & other: Deletes the file from the private list.
Showing/hiding files will be achieved by changing the status of the corresponding record in the sys_attachment table to available/unavailable.
However, operations on the records in the sys_attachment table cannot be performed from the client controller of the ticket attachment (ID: widget-ticket-attachments).
So, I would like to know how to change the value of the record from the client controller.
Other than that, I would like to know if there is a better solution.
Translated with DeepL.com (free version)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 12:39 AM
This will be near to impossible, because the attachment is created in the attachment table the moment you attach it. Only on saving of the record, the relationship is defined. So you could look into just not making the relation between the ticket and the attachment if 'no' is selected. That way you can have the popup choice decide that the attachment should or shouldn't be part of the record.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark