0

In RSTicket, you have the option to add or edit a ticket. But it does not allow you to add personalized files (images or pdf), i.e. files such as invoices, receipts, photos, etc.

I have created this small and simple script that allows me to save the files in the following structure: folder > ticket id > file type ( invoice ) > file.

define('JPATH_BASE', '../');
jimport('joomla.filesystem.file');

$input = JFactory::getApplication()->input;

//  Image
if ($file  = $input->files->get('images')) {

    $filename = JFile::makeSafe(date("Y-m-d").$file['name']);

    $src  = $file['tmp_name'];
    // If it does not exist, create the folder
    if (!JFolder::create($idTicket.'/images/'))
    {
        // 
    }

    $dest = JPATH_BASE .'/RSTickets_files/'.$idTicket.'/images/' . $filename;
}

//  Invoices
if ($file  = $input->files->get('invoices')) {

    $filename = JFile::makeSafe(date("Y-m-d").$file['name']);

    $src  = $file['tmp_name'];
    // If it does not exist, create the folder
    if (!JFolder::create($idTicket.'/invoices/'))
    {
        // 
    }

    $dest = JPATH_BASE .'/RSTickets_files/'.$idTicket.'/invoices/' . $filename;
}

and the html code:

<input type="file" name="images" />


<input type="file" name="invoices" />

This script works, but I would like to know if any of you have done something similar with RSTicket.

Or if someone has an idea of how they could save it in the database and relate it to the ticket id.

I have some idea that I've seen in joomla.stackexchange.com

I thank you in advance for your help and suggestion.

Once I get it, I'll publish the final code, maybe it'll help others.

0

RSTicket supports upload file functionality to ticket. If I understand your problem correctly, Below url can solve your problem https://www.rsjoomla.com/support/documentation/rsticketspro/getting-started/departments.html

Hope this solves your problem without writing script.

| improve this answer | |
  • Thanks, The problem is not uploading the files. The problem I have is that I need to differentiate the files that are uploaded. I know how RSticket works, but it does not have this function. That's why I've opened this post. – Jatniel Guzmán Apr 2 '18 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.