Pri volitvah je v vabilih onemogoceno naknadno posiljanje.

This commit is contained in:
pero1203 2021-03-24 09:25:14 +01:00
parent 8085a663c3
commit 5cb9555865
2 changed files with 67 additions and 39 deletions

View File

@ -2980,7 +2980,13 @@ class SurveyInvitationsNew {
echo '<div id="inv_send_mail">';
# damo v tabelo zaradi prilagajanja oblike levo/desno
echo '<table><tr><td>';
echo '<table><tr>';
// Pri volitvah vedno posiljamo samo tistim, katerim se nismo poslali
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
echo '<td>';
echo '<div>';
echo $lang['srv_inv_send_who_database'].'<br/>';
@ -2994,26 +3000,31 @@ class SurveyInvitationsNew {
echo '<label><input type="radio" name="mailsource" value="1" onclick="mailToSourceChange();">'.$lang['srv_inv_send_who_archive'].'</label>';
echo '<br/><label><input type="radio" name="mailsource" value="2" onclick="mailToSourceChange();">'.$lang['srv_inv_send_who_lists'].'</label>';
echo '<br/>';
echo '<div id="inv_select_mail_to_source_lists">';
$this->displayMailToSourceLists((int)$_POST['source_type']);
echo '</div>'; #id="inv_select_mail_to_source_lists"
echo '</div>';
# polovimo sporočilo in prejemnike
$sql_string_m = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'";
$sql_query_m = sisplet_query($sql_string_m);
$sql_query_m = sisplet_query("SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
if (mysqli_num_rows($sql_query_m) > 0 ) {
$preview_message = mysqli_fetch_assoc($sql_query_m);
} else {
}
else {
#nimamo še vsebine sporočila skreiramo privzeto.
echo '<span class="inv_error_note">';
echo $lang['srv_invitation_note6'];
echo '</span>';
exit();
}
echo '</td><td>';
echo '</td>';
}
echo '<td>';
// Ce posiljamo preko navadne poste ali smsov, nimamo sporocila
if($noEmailing == 0){
@ -3038,7 +3049,9 @@ class SurveyInvitationsNew {
echo '</div>'; // inv_select_mail_to_respondents
}
echo '</td></tr></table>';
echo '</td>';
echo '</tr></table>';
echo '</div>'; //inv_send_mail
}
@ -3928,6 +3941,17 @@ class SurveyInvitationsNew {
if (!$sqlQuery) {
$error = mysqli_error($GLOBALS['connect_db']);
}
// Pri volitvah za sabo pobrisemo podatke preko katerih bi lahko povezali prejemnike z responsi
if($voting){
$sqlQuery = sisplet_query("UPDATE srv_invitations_recipients
SET cookie='', password=''
WHERE id IN (".implode(',',$send_ok_ids).") AND sent='1' AND last_status='1' AND ank_id='".$this->sid."'
");
if (!$sqlQuery) {
$error = mysqli_error($GLOBALS['connect_db']);
}
}
}
# updejtamo status za errorje
@ -6202,6 +6226,9 @@ class SurveyInvitationsNew {
}
}
// Ce imamo vklopljene volitve potem posiljamo samo tistim, katerim še nismo poslali vabila (ponovno posiljanje ni mogoce)
$sql_voting_condition = (SurveyInfo::getInstance()->checkSurveyModule('voting')) ? " AND i.sent = '0' AND i.cookie != '' AND i.password != ''" : "";
// Ce imamo posiljanje brez emaila, ni potrebno da je email vnesen za posameznega respondenta
if($noEmailing == 1){
$sql_fields = "SELECT DISTINCT i.password, i.id, i.email, i.firstname, i.last_status, i.list_id FROM srv_invitations_recipients AS i";
@ -6230,6 +6257,7 @@ class SurveyInvitationsNew {
$sql_string = $sql_fields
. $advancedConditionJoin
. $sql_main_condition
. $sql_voting_condition
. $advancedCondition
. $sql_sub_condition
. $sub_query

View File

@ -3081,14 +3081,14 @@ $lang = array (
"srv_kviz_interpretacije" => "Different interpretations",
"srv_zakljucek_vprasalnika" => "Survey end",
"srv_kviz_konec_note" => "If no option is selected, only administrator can view results",
"srv_voting" => "Election",
"srv_voting_info" => "The election module allows you to send invitations by turning off all paraadata and without any possibility of associating data with e-mail addresses and other identifiers.<br>After switching on, switching off the module is no longer possible!",
"srv_voting" => "Voting",
"srv_voting_info" => "The Voting module allows you to send invitations by turning off all paraadata and without any possibility of associating data with e-mail addresses and other identifiers.<br>After switching on, switching off the module is no longer possible!",
"srv_voting_edit1" => "You can edit the questionnaire in a tab",
"srv_voting_edit2" => "Edit",
"srv_voting_invitations1" => "Email invitations are edited in",
"srv_voting_invitations2" => "Email invitations interface",
"srv_voting_warning" => "Invitations are individualized for the purpose of sending invitations only. Invitation settings cannot be changed.<br> Once the invitations are sent, the link between the e-mail address and the respondent's answers is not possible.",
"srv_voting_warning_paradata" => "Because you sent email invitations with the Elections module turned on, you can no longer change these settings.",
"srv_voting_warning_paradata" => "Because you sent email invitations with the Voting module turned on, you can no longer change these settings.",
"srv_advanced_paradata" => "Advanced paradata",
"srv_advanced_paradata_collect_post_time" => "Collect \"post time\"",
"srv_json_survey_export" => "JSON survey export",