Kayako logo
SupportSuite, eSupport and LiveResponse Discussion, troubleshooting and feedback related to Kayako's flagship support desk products SupportSuite, eSupport and LiveResponse.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1) Old
Chuckler Offline
New Member
 
Posts: 26
Join Date: Apr 2005
Renaming Attachments - 06-11-2006, 10:33 PM

Hi,

We're using SupportSuite 3.04.10, and were sick of the way it handled attachments, so we hacked at it until we came up with this solution.

We wanted the attachments (in the /files directory) to include the date it was received, and the ticketmaskid, and the filename. This would mean that we could archive these attachments offline, and still be able to search on them.

In supportsuite/modules/tickets/functions_attachments.php

find:
Code:
   /**
   * Generates a random store filename
   */
   function generateStoreFilename()
   {
      return $this->storeprefix.buildHash();
   }
and replace it with:
Code:
   /**
   * Generates a random store filename
   */
   function generateStoreFilename($ticketid, $filename)
   {
//      return $this->storeprefix.buildHash();
      $date = date(ymd);
      $rand = rand(1, 999);
      $rand = str_pad($rand, 3, "0", STR_PAD_LEFT);

      $query = "SELECT ticketmaskid FROM swtickets WHERE ticketid = '" . $ticketid . "'";
      $ticketmaskidquery = mysql_query($query);
       $record = mysql_fetch_object($ticketmaskidquery);
       $ticketmaskid = $record->ticketmaskid;

      return $date.'_'.$ticketmaskid.'_'.$rand.'_'.$filename;

   }

also, there are 2 x
Code:
$storefilename = $this->generateStoreFilename();
which need changing to
Code:
$storefilename = $this->generateStoreFilename($ticketid, $filename);
Now, attach_fasjldfhlur348rt3nfiou3 is called things like:
061106_DQI-798509_746_ESale.pdf
which is
date_ticketmaskid_randomnumber_filename.ext

(The random number was to deal with some messages having multiple attachments ... it's a bit lazy, but it works. )

No warranties, implied or otherwise, if you attempt this hack.
   
Reply With Quote
Reply

Tags
attachments, renaming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UNKNOWN System -> Downloads/Attachments -> Must be stored seperately NC Software Feature Requests 2 10-11-2006 10:43 PM
Attachments foobar'd as e-mail attachments (3.0.80) NC Software SupportSuite, eSupport and LiveResponse 9 10-06-2006 08:19 PM
Keep attachments in 2.35 -> 3.00.04 Upgrade Chuckler SupportSuite, eSupport and LiveResponse 30 25-04-2006 11:39 AM



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46