diff --git a/admin/remotecontrol/lsrc.helper.php b/admin/remotecontrol/lsrc.helper.php index 9c593127507..2fb2f2cd783 100644 --- a/admin/remotecontrol/lsrc.helper.php +++ b/admin/remotecontrol/lsrc.helper.php @@ -103,7 +103,7 @@ function changeTable($table, $key, $value, $where, $mode='0')//XXX } -/* + /* * Function to send Emails to participants of a specific survey */ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX @@ -115,7 +115,7 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX include("../../classes/core/html_entity_decode_php4.php"); $lsrcHelper= new LsrcHelper(); - // wenn maxmails ber den lsrc gegeben wird das nurtzen, ansonsten die default werte aus der config.php + // wenn maxmails ber den lsrc gegeben wird das nutzen, ansonsten die default werte aus der config.php if($maxLsrcEmails!='') $maxemails = $maxLsrcEmails; @@ -388,8 +388,7 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX $_POST['message_'.$languageRow['surveyls_language']] = $languageRow['surveyls_email_remind']; $_POST['subject_'.$languageRow['surveyls_language']] = $languageRow['surveyls_email_remind_subj']; } - - + //$tokenoutput .= $clang->gT("Sending Reminders")."
\n"; $surveylangs = GetAdditionalLanguagesFromSurveyID($surveyid); @@ -403,18 +402,8 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX } -// if (isset($starttokenid)) {$tokenoutput .= " (".$clang->gT("From Token ID").": {$starttokenid})";} -// if (isset($tokenid)) {$tokenoutput .= " (".$clang->gT("Sending to Token ID").": {$tokenid})";} - -// if (isset($_POST['bypassbademails']) && $_POST['bypassbademails'] == 'Y') -// { - $SQLemailstatuscondition = " AND emailstatus = 'OK'"; -// } -// else -// { -// $SQLemailstatuscondition = ""; -// } - + $SQLemailstatuscondition = " AND emailstatus = 'OK'"; + if (isset($_POST['maxremindercount']) && $_POST['maxremindercount'] != '' && intval($_POST['maxremindercount']) != 0) @@ -466,11 +455,6 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX $emresult = db_select_limit_assoc($emquery, $maxemails); //$emresult = db_execute_assoc($emquery); $emcount = $emresult->RecordCount(); -// $tokenoutput .= "\n" -// ."\t\n" -// ."\t\t\n" -// ."\t\n" -// ."\t" -// ."\t\t\n" -// ."\t\n" -// ."\t\n" -// ."\t\n" -// ."\t\n"; -// foreach ($surveylangs as $language) -// { -// $message = html_escape($_POST['message_'.$language]); -//// $tokenoutput .="\t\t\t\n" -//// ."\t\t\t\n" -//// ."\t\t\t\n"; -// } -// $tokenoutput.="\t\n" -// ."\t\n"; }else{$lefttosend = 0;} } -// else -// { -//// $tokenoutput .= "
".$clang->gT("Warning")."
\n" -//// .$clang->gT("There were no eligible emails to send. This will be because none satisfied the criteria of - having an email address, having been sent an invitation, but not having yet completed the survey.")."\n" -//// ."

\n" -//// ."\t\t\n"; -// } - - if($emcount==0) + else { return "No Reminders to send"; - } + } + if($maxemails>0) { $returnValue = "".$mailsSend." Reminders send. ".$lefttosend." Reminders left to send"; diff --git a/admin/remotecontrol/lsrc.server.php b/admin/remotecontrol/lsrc.server.php index d1187ae6fd2..f68bb716ea5 100644 --- a/admin/remotecontrol/lsrc.server.php +++ b/admin/remotecontrol/lsrc.server.php @@ -143,7 +143,8 @@ function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails='', $subject='' if (isset($tokenid)) {$emquery .= " and tid='{$tokenid}'";} $tokenoutput .= "\n\n\n\n"; - $emresult = db_select_limit_assoc($emquery,$maxemails); + //$emresult = db_select_limit_assoc($emquery,$maxemails); + $emresult = db_execute_assoc($emquery); $emcount = $emresult->RecordCount(); if ($emcount > 0) @@ -159,10 +160,10 @@ function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails='', $subject='' { //$tokenoutput .= ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) failed. Error Message:")." ".$maildebug."
", $fieldsarray); if($n==1) - $failedAddresses .= ",".$to; + $failedAddresses .= ",".$emrow['email']; else { - $failedAddresses = $to; + $failedAddresses = $emrow['email']; $n=1; } @@ -202,28 +203,7 @@ function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails='', $subject='' $emailSenderReturn = $lsrcHelper->emailSender($iVid, $type, $maxLsrcEmails); return $emailSenderReturn; -// if($maxemails != '') -// { -// return $emailSenderReturn; -// if($emailSenderReturn) -// { -// return "Mails send successfully"; -// } -// else -// return $emailSenderReturn; -// } -// else -// { -// if($emailSenderReturn) -// { -// return "Mails send successfully"; -// } -// else -// { -// throw new SoapFault("Sending Mail: ", "".$emailSenderReturn); -// exit; -// } -// } + } else {
\n"; - - if ($emcount > 0) { @@ -561,43 +545,13 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX if ($ctcount > $emcount) { $lefttosend = $ctcount-$maxemails; -// $tokenoutput .= "\t\t
\n" -// ."\t\t\t".$clang->gT("Warning")."

\n" -// .$clang->gT("There are more emails pending than can be sent in one batch. Continue sending emails by clicking below.")."

\n" -// .str_replace("{EMAILCOUNT}", $lefttosend, $clang->gT("There are {EMAILCOUNT} emails still to be sent.")) -// ."
\n" -// ."\t\t\t\n" -// ."\t\t