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,$_POST,$_POST,$_FILES))){
REPLACE BY:
//If no error...do the do.
// START MOD26
if(!$errors && ($respId=$ticket->postResponse($_POST,$_POST,$_POST,$_FILES,true,$_POST))){
// 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=' :: 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=' :: 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 ;)