-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thread: Allow edits to the attachments of thread entry #120
base: develop
Are you sure you want to change the base?
thread: Allow edits to the attachments of thread entry #120
Conversation
This allows administrators with access to a thread and staff members access to edit the attachments of a thread entry item. Non administrators can only edit the attachments if they own the thread entry. This is helpful if the incorrect attachments were submitted with a posting, or if the file names should be edited, or if additional attachments should have been added with the posting. Edits to responses will not be resent to the end user. Instead, the posting should be edited afterwards and then resent. Perhaps a note could be added to the amended responses to indicate that the attachments were modified.
Looks pretty good! 👍 |
Hi, i tried to test this in my installation. But not showing in my plugin list Thank's |
This was never released. But I imagine that you would do it like any other plugin, by reading the README and building the plugin. https://github.com/osTicket/osTicket-plugins/blob/develop/README.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test scenario: Attachments storage is configured as database (the default)
Test description:
Given is a PDF attachment attached to a message of a ticket
When I click at the manage attachments button and remove the checkbox in front of the attachment
Then the attachment disappears in the UI
BUT the attachment data still exists in database
After deleting the attachment, I double-checked with these tables:
--following line shows 1 record with id 5113, also used in following sql statements
select *
from ost_file
where name = 'AusweiskopieXY.pdf'
limit 0,10
select *
from ost_file_chunk
where file_id = 5113
limit 0,10
Both tables still contain their record data.
Expected behaviour: the attachment reference at the UI + the real attachment data in database is removed
Finally, I solved my situation with
delete from ost_file_chunk where file_id = 5113;
delete from ost_file where id = 5113;
@ntozier Installing this plugin was just to
|
Has anyone got this to work with 1.12 ? I created the plugin folder, added plugin in osTicket and enabled it. The dropdown menu option on a ticket now shows but when I select it I just get a one line blank popup. This plugin would be very useful to remove the unnecessary attachment signatures and disclaimers that a lot of incoming emails have these days. |
Hi, this is a useful feature, is this waiting for a pull request? |
I tested this plugin and it works for me. cron.php chain calls class.file.php. Here's an excerpt: static function deleteOrphans() {
// XXX: Allow plugins to define filetypes which do not represent
// files attached to tickets or other things in the attachment
// table and are not logos
$files = static::objects()
->filter(array(
'attachments__object_id__isnull' => true,
'ft' => 'T',
'created__lt' => SqlFunction::NOW()->minus(SqlInterval::DAY(1)),
));
foreach ($files as $f) {
if (!$f->delete())
break;
}
return true;
} This plugin is not included in the plugin repo, would someone pull this request please? |
This PR is not about a plugin? |
where did you put this part of code for delete attachements in ost_file and ost_file_chunk? |
using this plugin the attachments are only deleting in ost_attachement on db, there is a way to implement deletion from file and file_chunk that is not on phpmyadmin panel? |
using this plugin the attachments are only deleting in ost_attachement on db, there is a way to implement deletion from file and file_chunk that is not on phpmyadmin panel? |
when i add a plugin it not showing in thread and in ost_attachments appear one lines with name,file_id and lang NULL |
@greezybacon hi can you help me? |
Can not work with osTicket 1.17. When I try add a new plugin instance, the page is empty. |
This allows administrators with access to a thread and staff members access to edit the attachments of a thread entry item. Non administrators can only edit the attachments if they own the thread entry.
This is helpful if the incorrect attachments were submitted with a posting, or if the file names should be edited, or if additional attachments should have been added with the posting.
Edits to responses will not be resent to the end user. Instead, the posting should be edited afterwards and then resent. Perhaps a note could be added to the amended responses to indicate that the attachments were modified.
Outstanding