Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[Mod] Add survey system

image
Software used: limesurvey

difficulty level: Easy--*----------Hard

FIRST STEP
- Make sure you can use LimeSurvey on your website
- How can I create a database and a user in mysql with command line access?
- After creating the MySQL database open file: /config.php and customize with your settings.
- just hit: http:////admin/install/index.php and you have your LimeSurvey installed.

Comments

  • SECOND STEP
    Configure LimeSurvey at your taste, is not that hard,

    image
    STEP01

    image
    STEP02

    image
    STEP03
  • THIRD STEP
    Adding questions to your survey.

    To start adding questions, you first ust add a survey, this because you can have multiple surveys active.

    image
    STEP01 - Add survey

    image
    STEP02 - add new group
    I personnaly added 3 groups [Global, ticket, staff]
    Global - Abstract questions about the company + helpdesk
    Ticket - Questions specific about that particular ticket [response time, knowledge...]
    Staff - Questions about the staff that answered the ticket
    but you can add just one group... you decide

    you can now start adding your questions for each group...
    image
    STEP03 - Add questions
  • FOURTH STEP
    Showcase of mine



    image
    Look and feel of my survey (portuguese version).
  • FIFTH STEP
    The secret

    Now.. for the osTicket integrate with limesurvey you will need a secret question in your survey, this step is mandatory

    image

    image
    Adding a secret question (ticket number), this will be filled automatically by osTicket later ;)

    Please repeat and add a second secret question (staff id), this will be filled automatically by osTicket later ;)
  • After you finnish setting up your survey you will need to know how to interpret the secret key

    image
    In this case the secret ticket ID will be 73747X4X15 (question 15 in group 4 in survey 73747) this is importatnt!

    - make the same for the staff id!
  • OsTicket Part
    make the following modifications:

    File: include/class.ticket.php.
    FIND ~748 (orginal file)

    if($email && $email->getId()) {
    $email->send($this->getEmail(),$subj,$body,$file);
    }
    }else{
    //We have a big problem...alert admin...

    REPLACE

    if($email && $email->getId()) {
    $email->send($this->getEmail(),$subj,$body,$file);
    // START MOD26 send email of survey
    $body='Hi';
    $body=$body.\"\n\";
    $body=$body.'Your support request with ticket number '.db_input($this->getId()).' was selected for a survey!';
    $body=$body.\"\n\n\n\";
    $body=$body.'This enquiry will only get you seconds and is *VALUBLE* for our process improvement!';
    $body=$body.\"\n\";
    $body=$body.'Please follow the this link http://<your_server>/<your_limesurvey_directory>/index.php?sid=73747&73747X4X15='.$this->getId();
    $body=$body.'&73747X9X99='.db_input($thisuser->getId()).'&ieuaHhhgshadgh';
    $body=$body.\"\n\n\";
    $body=$body.'Please evaluate how our Help Desk solved your request '.$subj;
    $body=$body.\"'\n\n\";
    $body=$body.'thank you,';
    $body=$body.\"\n\";
    $body=$body.'IM - Information Management';
    $subj='[#'.$this->getId().'] :: Ticket survey *PLEASE ANSWER!*';
    $MyRandom=rand()&1;
    // if you want a random system just uncomment the following line
    //if (0 == $MyRandom) $email->send($this->getEmail(),$subj,$body,$file);
    // if you want a random system just Comment the following
    $email->send($this->getEmail(),$subj,$body,$file);
    // END MOD26 send survey
    }
    }else{
    //We have a big problem...alert admin...



    Now the tricky part
    you need to customize the link address to your PARTICULAR settings!

    $body=$body.'Please follow the this link http:////index.php?sid=73747&73747X4X15='.$this->getId();
    $body=$body.'&73747X9X99='.db_input($thisuser->getId()).'&ieuaHhhgshadgh';
    the GREEN link is where your LimeSurvey installation
    the RED numbers must be your secret IDs
    the ORANGE text is just to put the link a litle bit more complex



    That's all


    NOTE: Any questions related with LimeSurvey you must put in LimeSurvey forums this forum is just to osTicket ;)
  • Great job man !

    I tried it and it works but the mail with the link for the survey is send for any response (even if i don't close the ticket).

    I modified the class.ticket.php file with your code.
    In my file, it's in the postResponse function. Does it the same for you ?

    After some tests, the status seem to be updated after sending email and i don't really know how to do.

    Did you try to only send this mail when the ticket is closed ?
  • Nice MOD!

    i put this MOD in RC4 and works great!! but i put it in the close funtion cause its spammy sending a survey every time i answer a ticket.
  • pti_breton;14342 said:
    but the mail with the link for the survey is send for any response (even if i don't close the ticket).
    Thank you for the warning, this will solve the problem ;)



    FILE: helpdesk root\scp\tickets.php

    FIND ~83 (original file)

    //If no error...do the do.
    if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment']))){


    REPLACE BY:

    //If no error...do the do.
    // START MOD26
    if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment'],true,$_POST['ticket_status']))){
    // END MOD26





    FILE: helpdesk root\include\class.ticket.php

    FIND ~684 (original file)

    //Insert Staff Reply
    function postResponse($msgid,$response,$signature='none',$attachment=false,$canalert=true){
    global $thisuser,$cfg;


    REPLACE BY:

    //Insert Staff Reply
    function postResponse($msgid,$response,$signature='none',$attachment=false,$canalert=true,$surveysts='none'){
    global $thisuser,$cfg;



    FILE: helpdesk root\include\class.ticket.php

    FIND ~750 (modded file)

    // START MOD26 send email of survey
    $body='Hi';
    $body=$body.\"\n\";
    $body=$body.'Your support request with ticket number '.db_input($this->getId()).' was selected for a survey!';
    $body=$body.\"\n\n\n\";
    $body=$body.'This enquiry will only get you seconds and is *VALUBLE* for our process improvement!';
    $body=$body.\"\n\";
    $body=$body.'Please follow the this link http://<your_server>/<your_limesurvey_directory>/index.php?sid=73747&73747X4X15='.$this->getId();
    $body=$body.'&73747X9X99='.db_input($thisuser->getId()).'&ieuaHhhgshadgh';
    $body=$body.\"\n\n\";
    $body=$body.'Please evaluate how our Help Desk solved your request '.$subj;
    $body=$body.\"'\n\n\";
    $body=$body.'thank you,';
    $body=$body.\"\n\";
    $body=$body.'IM - Information Management';
    $subj='[#'.$this->getId().'] :: Ticket survey *PLEASE ANSWER!*';
    $MyRandom=rand()&1;
    // if you want a random system just uncomment the following line
    //if (0 == $MyRandom) $email->send($this->getEmail(),$subj,$body,$file);
    // if you want a random system just Comment the following
    $email->send($this->getEmail(),$subj,$body,$file);
    // END MOD26 send survey


    REPLACE BY:

    // START MOD26 send email of survey
    if(strtolower($surveysts)=='close') {
    $body='Hi';
    $body=$body.\"\n\";
    $body=$body.'Your support request with ticket number '.db_input($this->getId()).' was selected for a survey!';
    $body=$body.\"\n\n\n\";
    $body=$body.'This enquiry will only get you seconds and is *VALUBLE* for our process improvement!';
    $body=$body.\"\n\";
    $body=$body.'Please follow the this link http://<your_server>/<your_limesurvey_directory>/index.php?sid=73747&73747X4X15='.$this->getId();
    $body=$body.'&73747X9X99='.db_input($thisuser->getId()).'&ieuaHhhgshadgh';
    $body=$body.\"\n\n\";
    $body=$body.'Please evaluate how our Help Desk solved your request '.$subj;
    $body=$body.\"'\n\n\";
    $body=$body.'thank you,';
    $body=$body.\"\n\";
    $body=$body.'IM - Information Management';
    $subj='[#'.$this->getId().'] :: Ticket survey *PLEASE ANSWER!*';
    $MyRandom=rand()&1;
    // if you want a random system just uncomment the following line
    //if (0 == $MyRandom) $email->send($this->getEmail(),$subj,$body,$file);
    // if you want a random system just Comment the following
    $email->send($this->getEmail(),$subj,$body,$file);
    }
    // END MOD26 send survey




    This fix will ONLY send the Survey when the ticket is closed ;)
  • ozkr;14345 said:
    but i put it in the close funtion cause its spammy sending a survey every time i answer a ticket.
    If you look at my code you will see this peace of code:

    // if you want a random system just uncomment the following line
    //if (0 == $MyRandom) $email->send($this->getEmail(),$subj,$body,$file);
    // if you want a random system just Comment the following
    $email->send($this->getEmail(),$subj,$body,$file);
    // END MOD26 send survey

    Just change to

    // if you want a random system just uncomment the following line
    if (0 == $MyRandom) $email->send($this->getEmail(),$subj,$body,$file);
    // if you want a random system just Comment the following
    //$email->send($this->getEmail(),$subj,$body,$file);
    // END MOD26 send survey


    This will turn it to random (VEEEEEERY RANDOM :cool:)
  • It's nearly perfect !

    I just replace the getId() function by getExtId() in the body of the mail
    the fisrt one return the database id...

    Thanks again !
  • Nice work! but i prefere send the survey every time a staff close a ticket.
    I think its better.

    Why are you sending the survey randomly?
  • ozkr;14443 said:
    Why are you sending the survey randomly?
    Because I am on a Intranet and we deal with a LOT of tickets and some open by the same person...
    Ofcourse we want to deliver better services and we need survey system to improve.. but users will start complaining of the survey system and start to ignore survey requests.

  • Adding a secret question (ticket number), this will be filled automatically by osTicket later

    Please repeat and add a second secret question (staff id), this will be filled automatically by osTicket later
    when? my clients responds my surveys but i dont know if that survey is for the ticket number 1 or number 100

    are you sure this is the complete code?
  • ozkr;14492 said:
    are you sure this is the complete code?
    Ofcourse it his! ...and tested!

    You must think on this as two stages Mod:
    - 1st stage you must set up LimeSurvey (and is clearly documented)
    - 2nd stage make the code modification on osTicket

    Its ALL there, read carefully (and follow) my step-by-step explanation and the replies. And you will understand when and how the ticket number is "injected" on the LimeSurvey system.
  • can you please tell how or where cause my Ticket number and staff id surveys options are allways empty.
  • Nothing? well i know that the ticket id and the staff id is send inside the survey link that the client get but when the client answers the survey it doesnt filled automatically.

    What do i have to change to get it work? someone having the same problem?
  • JoseLuis;14307 said:
    SECOND STEP
    Configure LimeSurvey at your taste, is not that hard,

    image
    STEP01

    image
    STEP02

    image
    STEP03
    Well i´ll answer my own question. the wrong part was in the survey settings.
    when you put the Use CAPTCHA for: Survey Access/---/--- the client will lost the ticket id and the staff id but if you select ---/---/Save and Load the client save automatically the id´s the problem is that any bot can answer a million times the survey. You can block the ip but can i work with the captcha and fill the id´s automatically?

    im trying to add in the end of link the part that the captcha read "&loadsecurity=47" (47 is the security number for captcha)
    the difficult part is to put automatically the security number from the captcha

    any ideas?
  • Thanks!

    Thanks for the great mod. I am using the latest versions of LS and OST and the email never sends.

    Any ideas?
  • juancpena;23042 said:
    Thanks for the great mod. I am using the latest versions of LS and OST and the email never sends.

    Any ideas?
    I have the same problem with Versión 1.91+ Build 10859 and ost 1.6 ST, somebody can help us ?
    Thanks in advance
  • will this mod work for osTicket 1.7?

    Kindest Regards,
    Jeremy
  • Really need to know if this mod works for osTicket 1.7
  • MeanGreen7;33570 said:
    Really need to know if this mod works for osTicket 1.7
    I think is the same cause you are just adding a text with a link in the email.
    try it and it should work.
  • Actually I figured out that on my final response to the client when I close the ticket I just add the link and that should work fine rather than trying to figure out in 1.7 where to modify the code, as the code is very different than 1.6. So not sure what to modify in the code.

    Jeremy
  • Any chance to integrate this survey function in version 1.9?
  • Please, help us to ingrate a solution like this in 1.9.x
  • Hello,

    First of all sorry for my English.

    We are very interested in this mod to version 1.9, we can help to make it work out.

    Thanks in advance.
  • this thread is from 2010.  I doubt that you will get a response.
Sign In or Register to comment.