I've got attachments working!The Archive feature is a big hit with the users, I've segmented them based on Department and am including custom data (order number, subject etc) in the filename for ease of searching.You might want to run it a few times, the setup has changed a bit, read the comments, by default it doesn't delete anything.. Caveats: Requires gs/GhostScript to merge PDFs, should disable function if gs not available.Requires GD to convert png's into jpgs, for some reason gs/pdf can't support png's alpha channelsRequires linux! Changes its own priority and the gs calls etc are only designed for linux.
YMMV! Caveat Emptor etc..
Created a GIST for it: https://gist.github.com/clonemeagain/7905624
Save this http://pastebin.com/FvbN7gRt as /include/class.attachment.file.php Save this as http://pastebin.com/yjQbAPqR /remove_obsolete_tickets.php Tested with a few thousand nodes, not super-fast, but it does work.. Added support to convert docx/xlsx etc into text and attach to node, not sure if you want that or not, but as I'm already merging PDF's and inserting images into the exported file, thought why not!* YOU WILL NEED TO CONFIGURE THE FOLLLOWING:* * Specify your osTicket username, probably best to use an Admins username for this. DO NOT NEED PASSWORD. (Haven't tried with non-admin username)*/define ( 'MY_USER_ID', 'Grizly' );/** * Any closed ticket older than this many months will be archived/deleted. */define ( 'DELETEMONTHS', 1 );/** * Which subfolder would you like to start archiving tickets into? */define ( 'BACKUPDIR', getcwd () . DIRECTORY_SEPARATOR . 'backups' . DIRECTORY_SEPARATOR );/** * Change to false to show more output, makes cron send emails which you may not care about. */define ( 'CRONFRIENDLY', true );/** * Change to true to allow anyone on the internet to initiate.. * not recommended unless you have a remote-cron requirement. */define ( 'REMOTECRONENABLED', false );/** * Where do you want your temporary files stored.. * could be /tmp/ostickets/ or anywhere writable by the user. */define ( 'URI_FOLDER', getcwd () . DIRECTORY_SEPARATOR . 'scp' . DIRECTORY_SEPARATOR . 'restricted' );/** * Change this to true, to start deleting. * ;-) This will start actually deleting tickets, so, make sure its backing them up properly first. */define ( 'ACTUALLY_DELETE', false );