Merge remote-tracking branch 'origin/master'

This commit is contained in:
Robert 2021-03-18 10:24:09 +01:00
commit 9e9c4778ed
14 changed files with 431 additions and 120 deletions

View File

@ -1392,16 +1392,21 @@ class SurveyAdminSettings {
$browser = SurveySetting::getInstance()->getSurveyMiscSetting('survey_browser');
$referal = SurveySetting::getInstance()->getSurveyMiscSetting('survey_referal');
$date = SurveySetting::getInstance()->getSurveyMiscSetting('survey_date');
// Preverimo ce je vklopljen modul za volitve - potem ne pustimo nobenih preklopov
$voting_disabled = '';
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
$voting_disabled = ' disabled';
}
echo '<fieldset class="wide">';
echo '<legend>'.$lang['srv_sledenje'].'</legend>';
echo '<p>'.$lang['srv_metadata_desc'].'</p>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_browser'].':</label></span> <label for="survey_browser_1"><input type="radio" name="survey_browser" id="survey_browser_1" value="1"'.($browser==1?' checked':'').'>'.$lang['no'].'</label> <label for="survey_browser_0"><input type="radio" name="survey_browser" id="survey_browser_0" value="0"'.($browser==0?' checked':'').'>'.$lang['yes'].'</label><br class="clr"/>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_referal'].':</label></span> <label for="survey_referal_1"><input type="radio" name="survey_referal" id="survey_referal_1" value="1"'.($referal==1?' checked':'').'>'.$lang['no'].'</label> <label for="survey_referal_0"><input type="radio" name="survey_referal" id="survey_referal_0" value="0"'.($referal==0?' checked':'').'>'.$lang['yes'].'</label><br class="clr"/>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_date'].':</label></span> <label for="survey_date_1"><input type="radio" name="survey_date" id="survey_date_1" value="1"'.($date==1?' checked':'').'>'.$lang['no'].'</label> <label for="survey_date_0"><input type="radio" name="survey_date" id="survey_date_0" value="0"'.($date==0?' checked':'').'>'.$lang['yes'].'</label><br class="clr"/>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_browser'].':</label></span> <label for="survey_browser_1"><input type="radio" name="survey_browser" id="survey_browser_1" value="1"'.($browser==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label> <label for="survey_browser_0"><input type="radio" name="survey_browser" id="survey_browser_0" value="0"'.($browser==0?' checked':'').'>'.$lang['yes'].'</label><br class="clr"/>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_referal'].':</label></span> <label for="survey_referal_1"><input type="radio" name="survey_referal" id="survey_referal_1" value="1"'.($referal==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label> <label for="survey_referal_0"><input type="radio" name="survey_referal" id="survey_referal_0" value="0"'.($referal==0?' checked':'').'>'.$lang['yes'].'</label><br class="clr"/>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_date'].':</label></span> <label for="survey_date_1"><input type="radio" name="survey_date" id="survey_date_1" value="1"'.($date==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label> <label for="survey_date_0"><input type="radio" name="survey_date" id="survey_date_0" value="0"'.($date==0?' checked':'').'>'.$lang['yes'].'</label><br class="clr"/>';
echo '</fieldset>';
@ -1412,14 +1417,14 @@ class SurveyAdminSettings {
echo '<fieldset>';
echo '<legend>'.$lang['srv_sledenje_ip_title'].'</legend>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_ip'].':</label></span> <label for="survey_ip_1"><input type="radio" name="survey_ip" id="survey_ip_1" value="1"'.($ip==1?' checked':'').'>'.$lang['no'].'</label> <label for="survey_ip_0"><input type="radio" name="survey_ip" id="survey_ip_0" value="0"'.($ip==0?' checked':'').'>'.$lang['yes'].'</label>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_ip'].':</label></span> <label for="survey_ip_1"><input type="radio" name="survey_ip" id="survey_ip_1" value="1"'.($ip==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label> <label for="survey_ip_0"><input type="radio" name="survey_ip" id="survey_ip_0" value="0"'.($ip==0?' checked':'').'>'.$lang['yes'].'</label>';
if($ip == 0 && $ip_show != 1)
echo '<div class="spaceLeft floatRight red" style="display:inline; width:520px;">'.$lang['srv_sledenje_ip_alert'].'</div>';
echo '<br class="clr"/>';
if($ip == 0 && ($admin_type == 0 || $admin_type == 1)){
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_show_ip'].':</label></span> <label for="survey_show_ip_0"><input type="radio" name="survey_show_ip" id="survey_show_ip_0" value="0"'.($ip_show==0?' checked':'').'>'.$lang['no'].'</label> <label for="survey_show_ip_1"><input type="radio" name="survey_show_ip" id="survey_show_ip_1" value="1"'.($ip_show==1?' checked':'').'>'.$lang['yes'].'</label>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_show_ip'].':</label></span> <label for="survey_show_ip_0"><input type="radio" name="survey_show_ip" id="survey_show_ip_0" value="0"'.($ip_show==0?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label> <label for="survey_show_ip_1"><input type="radio" name="survey_show_ip" id="survey_show_ip_1" value="1"'.($ip_show==1?' checked':'').'>'.$lang['yes'].'</label>';
if($ip_show == 1)
echo '<div class="spaceLeft floatRight red" style="display:inline; width:520px;">'.$lang['srv_show_ip_alert'].'</div>';
}
@ -1433,7 +1438,7 @@ class SurveyAdminSettings {
echo '<fieldset class="wide">';
echo '<legend>'.$lang['srv_sledenje_identifikatorji_title'].' '.Help::display('srv_email_with_data').'</legend>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_identifikatorji'].':</label></span> <label for="show_email_0"><input type="radio" name="show_email" id="show_email_0" value="0"'.($row['show_email']==0?' checked':'').'>'.$lang['no'].'</label> <label for="show_email_1"><input type="radio" name="show_email" id="show_email_1" value="1"'.($row['show_email']==1?' checked':'').'>'.$lang['yes'].'</label>';
echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_identifikatorji'].':</label></span> <label for="show_email_0"><input type="radio" name="show_email" id="show_email_0" value="0"'.($row['show_email']==0?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label> <label for="show_email_1"><input type="radio" name="show_email" id="show_email_1" value="1"'.($row['show_email']==1?' checked':'').'>'.$lang['yes'].'</label>';
if($row['show_email'] == 1)
echo '<div class="spaceLeft floatRight red" style="display:inline; width:520px;">'.$lang['srv_show_mail_with_data3'].'</div>';
@ -8699,6 +8704,12 @@ class SurveyAdminSettings {
}
elseif ($_GET['a'] == 'voting'){
// Ce so vabila ze vklopljena ne pustimo vklopa
if(!isset($modules['voting']) && SurveyInfo::getInstance()->checkSurveyModule('email')){
$disabled = ' disabled="disabled"';
$css_disabled = ' gray';
}
echo '<fieldset><legend>'.$lang['srv_voting'].'</legend>';
echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_voting" name="voting" value="1" '. (isset($modules['voting']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'voting\');" />';
echo $lang['srv_vrsta_survey_type_18'] . '</label>';

View File

@ -1427,7 +1427,7 @@ class SurveyDataCollect{
$_dataLine .= STR_DLMT. (($rowUser['status'] == 5 || $rowUser['status'] == 6) && $rowUser['lurker'] == 0 ? '1' : '0');
# dodamo email (invitation)k podatkom - če je bilo poslano z emailom ali je uporabnik ročno vnesel email
$_dataLine .= STR_DLMT. ((int)$rowUser['inv_res_id'] > 0
$_dataLine .= STR_DLMT. ((int)$rowUser['inv_res_id'] > 0 || (int)$rowUser['inv_res_id'] == -1
# uporabnik je bil dodan z email vabilom
? ((int)$rowUser['status'] == 1 || (int)$rowUser['status'] >= 3
# email je bil odposlan

View File

@ -1110,19 +1110,22 @@ class SurveyDataDisplay{
echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta'].'</label>';
echo '</li>';
// če imamo sistemske podatke katere moramo prikazovati ločeno - IDENTIFIKATORJI
if (!isset(self::$_HEADERS['_settings']['count_system_data_variables']) || (isset(self::$_HEADERS['_settings']['count_system_data_variables']) && (int)self::$_HEADERS['_settings']['count_system_data_variables'] > 0)) {
echo '<li>';
echo ' <label><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
echo '</li>';
}
// Po novem vedno prikazemo checkbox identifikatorji - samo je odkljukan in disablan
else{
echo '<li>';
echo ' <label class="gray"><input type="checkbox" checked="checked" disabled="disabled" id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
echo '</li>';
}
// Preverimo ce je vklopljen modul za volitve - potem nimamo identifikatorjev
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
// če imamo sistemske podatke katere moramo prikazovati ločeno - IDENTIFIKATORJI
if(!isset(self::$_HEADERS['_settings']['count_system_data_variables']) || (isset(self::$_HEADERS['_settings']['count_system_data_variables']) && (int)self::$_HEADERS['_settings']['count_system_data_variables'] > 0)) {
echo '<li>';
echo ' <label><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
echo '</li>';
}
// Po novem vedno prikazemo checkbox identifikatorji - samo je odkljukan in disablan
else{
echo '<li>';
echo ' <label class="gray"><input type="checkbox" checked="checked" disabled="disabled" id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
echo '</li>';
}
}
// datum
echo '<li>';

View File

@ -48,15 +48,13 @@ class SurveyInvitationsNew {
$this->surveySettings = SurveyInfo::getInstance()->getSurveyRow();
#koliko respondentov je že v bazi
$sql_string_all = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
$sql_query_all = sisplet_query($sql_string_all);
# koliko respondentov je že v bazi
$sql_query_all = sisplet_query("SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
$sql_row_all = mysqli_fetch_row($sql_query_all);
$this->count_all = (int)$sql_row_all[0];
#preverimo ali prikazujemo nov ali star način odvisno od nastavitve v misc
$strSelect = "SELECT count(*) FROM srv_anketa AS a WHERE id ='".$this->sid."' AND insert_time > (SELECT value FROM misc WHERE what = 'invitationTrackingStarted' LIMIT 1)";
$sql_query = sisplet_query($strSelect);
# preverimo ali prikazujemo nov ali star način odvisno od nastavitve v misc
$sql_query = sisplet_query("SELECT count(*) FROM srv_anketa AS a WHERE id ='".$this->sid."' AND insert_time > (SELECT value FROM misc WHERE what = 'invitationTrackingStarted' LIMIT 1)");
list($newTracking) = mysqli_fetch_row($sql_query);
$this->newTracking = (int)$newTracking > 0 ? true : false;
@ -274,7 +272,7 @@ class SurveyInvitationsNew {
} else if ($action == 'invListEditSave') {
$this->invListEditSave();
} else if ($action == 'editRecList') {
# $this->editRecList();
$doEdit = $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true' ? true : false;
if ($doEdit) {
$this->showEditRecList();
@ -1302,8 +1300,7 @@ class SurveyInvitationsNew {
function viewRecipients($errors = array(), $msgs = array()) {
global $lang, $site_url, $admin_type;
//echo '<h2>'.$lang['srv_inv_edit_recipients_heading'].'</h2>';
$noEmailing = SurveySession::get('inv_noEmailing');
$noEmailing = SurveySession::get('inv_noEmailing');
$row = $this->surveySettings;
@ -1402,8 +1399,7 @@ class SurveyInvitationsNew {
}
# preštejemo koliko imamo vseh respondentov in koliko jih je brez e-maila
$sql_string_all = "SELECT id FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
$sql_query_all = sisplet_query($sql_string_all);
$sql_query_all = sisplet_query("SELECT id FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
$count_all = mysqli_num_rows($sql_query_all);
$sql_string_withot_email = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0' AND email IS NULL AND sent='0'";
@ -1448,8 +1444,11 @@ class SurveyInvitationsNew {
}
}
}
# dodamo še ostala polja
$fields['last_status'] = 1;
if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
$fields['last_status'] = 1;
$sql_select_fields[] = 'i.last_status';
$fields['date_inserted'] = 1;
$fields['date(date_expired)'] = 1;
@ -1460,9 +1459,6 @@ class SurveyInvitationsNew {
$fields['list_id'] = 1;
$sql_select_fields[] = 'i.list_id';
#štetje vabil
#$fields['count_inv'] = 1;
#$sql_select_fields[] = 'count(siar.arch_id) AS count_inv';
#dodamo paginacijo in poiščemo zapise
$page = isset($_GET['page']) ? $_GET['page'] : '1';
@ -1537,6 +1533,7 @@ class SurveyInvitationsNew {
$lists = array();
$lists['-1'] = array('name'=>$lang['srv_invitation_new_templist']);
$lists['0'] = array('name'=>$lang['srv_invitation_new_templist_author']);
if (count($lids) > 0 ) {
$sql_string_lists = "SELECT * from srv_invitations_recipients_profiles WHERE pid IN(".implode(',',$lids).") ";
$sql_query_lists = sisplet_query($sql_string_lists);
@ -1544,6 +1541,7 @@ class SurveyInvitationsNew {
$lists[$row_lists['pid']] = array('name'=>$row_lists['name']);
}
}
if (count($msgs) > 0) {
echo '<span class="inv_msg_note">';
foreach($msgs as $msg) {
@ -1551,6 +1549,7 @@ class SurveyInvitationsNew {
}
echo '</span>';
}
if (count($errors) > 0) {
echo '<span class="inv_error_note">';
foreach($errors as $error) {
@ -1558,16 +1557,18 @@ class SurveyInvitationsNew {
}
echo '</span>';
}
if ($count_all > 0 ) {
# dodamo filtriranje
echo '<div id="inv_rec_filter">';
echo '<label>'.$lang['srv_invitation_recipients_filter'].'</label> <input id="inv_rec_filter_value" type="text" onchange="inv_filter_recipients(); return false;" value="'.$_SESSION['inv_filter']['value'].'">';
#echo '<img src="'.$site_url.'admin/survey/icons/icons/wand.png">';
echo '&nbsp;&nbsp;&nbsp;<label><input id="inv_rec_filter_on" type="checkbox" onchange="inv_filter_recipients(); return false;"'.(isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ? ' checked="true"' : '').'>';
echo '&nbsp;&nbsp;&nbsp;<label><input id="inv_rec_filter_on" type="checkbox" onchange="inv_filter_recipients(); return false;"'.(isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ? ' checked="true"' : '').'>';
echo $lang['srv_invitation_recipients_filter_advanced'].'</label>';
if (isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ) {
if (isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ) {
echo '&nbsp;';
echo '&nbsp;';
echo '<label>'.$lang['srv_invitation_recipients_filter_sent'];
@ -1604,17 +1605,7 @@ class SurveyInvitationsNew {
echo '</div>';
/* // Prestavljeno na dno
if ($count_without_email > 0) {
# add to database without sending e-mail
echo '<div id="inv_rec_add_to_db" >';
echo '<span>'.$lang['srv_invitation_recipients_activate'].'</span>&nbsp;';
echo '<span class="as_link" onclick="inv_add_rec_to_db(); return false;" target="_blank">'.$lang['srv_invitation_recipients_activate_here'].'</span>';
echo '</div>';
}*/
echo '<form id="frm_inv_rec_export" name="resp_uploader" method="post" autocomplete="off">';
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
echo '<input type="hidden" name="noNavi" id="noNavi" value="true">';
@ -1667,16 +1658,10 @@ class SurveyInvitationsNew {
echo '<table id="tbl_recipients_list">';
echo '<tr>';
# checkbox
echo '<th class="tbl_icon" colspan="'.($this->surveySettings['show_email']==1?'4':'3').'" >&nbsp;</th>';
/*
* # uredi
echo '<th class="tbl_liks">&nbsp;</th>';
# izbrisi
echo '<th class="tbl_liks">&nbsp;</th>';
*/
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
@ -3958,9 +3943,9 @@ class SurveyInvitationsNew {
// Pri volitvah zaradi anonimizacije ignoriramo vse identifikatorje
if($voting){
$_r = sisplet_query("INSERT INTO srv_user
(ank_id, cookie, pass, last_status, time_insert, inv_res_id)
(ank_id, cookie, pass, last_status, inv_res_id)
VALUES
('".$this->sid."', '".$_user_data['cookie']."', '".$_user_data['password']."', '".$_user_data['status']."', NOW(), '".$_user_data['id']."') ON DUPLICATE KEY UPDATE cookie = '".$_user_data['cookie']."', pass='".$_user_data['password']."'
('".$this->sid."', '".$_user_data['cookie']."', '".$_user_data['password']."', '".$_user_data['status']."', '-1') ON DUPLICATE KEY UPDATE cookie = '".$_user_data['cookie']."', pass='".$_user_data['password']."'
");
}
else{
@ -4585,7 +4570,8 @@ class SurveyInvitationsNew {
echo '<th>'.$lang['srv_inv_recipients_password'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
echo '</tr>';
@ -4598,7 +4584,8 @@ class SurveyInvitationsNew {
echo '<td>'.$sql_row['password'].'</td>';
echo '<td>'.$sql_row['firstname'].'</td>';
echo '<td>'.$sql_row['lastname'].'</td>';
echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
echo '<td>'.$lists[$sql_row['list_id']].'</td>';
echo '</tr>';
}
@ -4810,6 +4797,10 @@ class SurveyInvitationsNew {
function addSystemVariables($variables) {
global $site_path, $lang;
// Pri modulu za volitve so responsi anonimni, zato nimamo nobenih sistemskih spremenljivk
if(SurveyInfo::getInstance()->checkSurveyModule('voting'))
return;
$system_fields = array(
'inv_field_email' => 'email',
'inv_field_firstname' => 'ime',
@ -5876,9 +5867,9 @@ class SurveyInvitationsNew {
// Pri volitvah zaradi anonimizacije ignoriramo vse identifikatorje
if($voting){
sisplet_query("INSERT INTO srv_user
(ank_id, cookie, pass, last_status, time_insert, inv_res_id)
(ank_id, cookie, pass, last_status, inv_res_id)
VALUES
('".$this->sid."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', NOW(), '".$user_data['id']."') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status), inv_res_id=VALUES(inv_res_id)
('".$this->sid."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', '-1') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status)
");
}
else{
@ -6736,7 +6727,9 @@ class SurveyInvitationsNew {
echo '</span></span>';
echo '<div id="inv_arch_mail_preview">';
echo '<table id="tbl_recipients_list">';
echo '<tr>';
echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_responded'].'">'.$lang['srv_inv_recipients_responded'].'</th>';
@ -6746,9 +6739,11 @@ class SurveyInvitationsNew {
echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_max_archive_status'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
echo '</tr>';
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
echo '<tr>';
echo '<td><span class="as_link" onclick="showRecipientTracking(\''.$sql_row['res_id'].'\'); return false;"><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></span></td>';
@ -6760,11 +6755,14 @@ class SurveyInvitationsNew {
echo '<td>'.$sql_row['lastname'].'</td>';
$status = $arch_user_max_status[$sql_row['res_id']];
echo '<td>'.$lang['srv_userstatus_'.$status].' ('.$status.')'.'</td>';
echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
echo '<td>'.$lists[$sql_row['list_id']].'</td>';
echo '</tr>';
}
echo '</table>';
echo '</div>'; // inv_select_mail_preview
echo '</div>'; // id="arc_content"
@ -6875,8 +6873,20 @@ class SurveyInvitationsNew {
echo '<table style="width:50%"><tr>';
# nov način z trackingom
if ($this->newTracking == true) {
// Pri volitvah prikazemo samo osnovne stevilke - zaradi anonimizacije ni trackinga
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
$userAccess = UserAccess::getInstance($global_user_id);
// Ce so izklopljena ne prikazemo leve strani
if((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')){
echo '<td style="padding-right:10px;vertical-align: top;">';
$this->displayInvitationStatusVoting();
echo '</td>';
}
}
// Nov način z trackingom
elseif($this->newTracking == true) {
$userAccess = UserAccess::getInstance($global_user_id);
@ -7215,7 +7225,8 @@ class SurveyInvitationsNew {
}
}
function displayInvitationStatusNew() {
// Prikaz statusov posiljanj
private function displayInvitationStatusNew() {
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@ -7230,15 +7241,17 @@ class SurveyInvitationsNew {
echo '<p>';
#koliko je vseh uporabnikov v bazi
$sql_string = "SELECT count(*) as cnt FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted ='0'";
$sql_query = sisplet_query($sql_string);
$sql_query = sisplet_query("SELECT count(*) as cnt FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted ='0'");
list($cnt_all_in_db) = mysqli_fetch_row($sql_query);
#zloopamo skozi posamezna pošiljanja in preštejemo vse potrebno
$sql_string = "SELECT sia.id, sia.tip, rec_in_db, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email FROM srv_invitations_archive AS sia INNER JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' ORDER BY sia.date_send ASC;";
#$sql_string = "SELECT * FROM srv_invitations_archive WHERE ank_id = '".$this->sid."'";
$sql_query = sisplet_query($sql_string);
$sql_query = sisplet_query("SELECT sia.id, sia.tip, rec_in_db, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email
FROM srv_invitations_archive AS sia
INNER JOIN users AS u ON sia.uid = u.id
WHERE ank_id = '".$this->sid."'
ORDER BY sia.date_send ASC;
");
$array_dashboard = array();
$array_archive_subdata = array();
$user_max_status = array();
@ -7678,6 +7691,146 @@ class SurveyInvitationsNew {
}
}
// Prikaz statusov posiljanj pri volitvah
private function displayInvitationStatusVoting() {
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
$userAccess = UserAccess::getInstance($global_user_id);
// Email vabila so omogocena
if ((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')) {
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
#koliko je vseh uporabnikov v bazi in kolkim je bil mail poslan
$sql_count = sisplet_query("SELECT count(id) as cnt, sent
FROM srv_invitations_recipients
WHERE ank_id='".$this->sid."' AND deleted ='0'
GROUP BY sent
");
$cnt_all_in_db = 0;
$cnt_sent_in_db = 0;
while($row_count = mysqli_fetch_array($sql_count)){
$cnt_all_in_db += (int)$row_count['cnt'];
if($row_count['sent'] == '1'){
$cnt_sent_in_db += (int)$row_count['cnt'];
}
}
echo '<table class="inv_dashboard_table">';
// Vsi v bazi
echo '<tr>';
echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
echo '<th>'.(int)$cnt_all_in_db.'</th>';
echo '<th>-</th>';
echo '<th>100%</th>';
echo '</tr>';
// Poslani
echo '<tr>';
echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</td>';
echo '<td>'.(int)$cnt_sent_in_db.'</td>';
echo '<td>'.((int)$cnt_sent_in_db > 0 ? '100%' : '0%').'</td>';
echo '<td>'.$this->formatNumber(((int)$cnt_sent_in_db > 0 ? (int)$cnt_sent_in_db*100/(int)$cnt_all_in_db : 0),0,'%').'</td>';
echo '</tr>';
echo '</table>';
echo '</p>';
echo '</div>';
echo '</fieldset>';
}
// Email vabila niso omogocena
else {
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
echo $lang['srv_inv_dashboard_not_enabled'];
# uporabnik nima pravic omogočit vabil
if (!$userAccess->checkUserAccess($what='invitations')) {
echo '<br/>'.$lang['srv_inv_dashboard_no_permissions'];
}
# uporabnik lahko vklopi email vabila
else {
echo '&nbsp;<a href="#" onclick="enableEmailInvitation(this);">'.$lang['srv_omogoci'].'</a>';
}
echo '</p>';
echo '</div>';
echo '</fieldset>';
}
// predpripravimo podatke za vsa pošiljanja
/*$cnt_by_sendings = array();
$all_units_count = count($cnt_by_user);
if ($all_units_count > 0) {
foreach ($cnt_by_user AS $uid => $ucnt) {
$cnt_by_sendings[$ucnt]++;
}
echo '<br/>';
#pregled po pošiljanjih
echo '<fieldset class="inv_fieldset">';
echo '<legend>';
echo '<span class="pointer" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
echo '<span class="plus strong displayNone blue">+ </span>';
echo '<span class="minus strong blue">- </span>';
echo '<span class="legend blue">'.$lang['srv_inv_nav_email_sending_status'].'</span>';
echo '</span>';
echo Help::display('srv_inv_cnt_by_sending');
echo '</legend>';
echo '<br/>';
echo '<div class="inv_filedset_inline_div">';
echo '<table style="border-spacing:0px; padding:0px; margin:0 0 20px 15px;">';
echo '<colgrup>';
echo '<col style="min-width:150px;"/>';
echo '<col style="min-width:150px;"/>';
echo '<col style="min-width:150px;"/>';
echo '</colgrup>';
echo '<tr>';
echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_cnt'].'</th>';
echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_units'].'</th>';
echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_percentage'].'</th>';
echo '</tr>';
if ($cnt_by_sendings > 0) {
foreach ($cnt_by_sendings AS $cnt => $units) {
echo '<tr>';
echo '<td>'.$cnt.'</td>';
echo '<td>'.$units.'</td>';
$percent = ($all_units_count > 0) ? $units / $all_units_count * 100 : 0;
echo '<td>'.Common::formatNumber ($percent,0,null,'%').'</td>';
echo '</tr>';
}
}
echo '<tr>';
echo '<td class="anl_bt_dot red">'.$lang['srv_inv_sending_overview_sum'].'</td>';
echo '<td class="anl_bt_dot red">'.$all_units_count.'</td>';
$percent = ($all_units_count > 0) ? $all_units_count / $all_units_count * 100 : 0;
echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
echo '</tr>';
echo '</table>';
echo '</div>';
echo '</fieldset>';
}*/
}
function showInvitationSettings() {
global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
@ -7753,6 +7906,12 @@ class SurveyInvitationsNew {
echo '<div class="inv_filedset_inline_div">';
echo '<div id="surveyInvitationSetting">';
// Preverimo ce je vklopljen modul za volitve - potem ne pustimo nobenih preklopov
$voting_disabled = '';
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
$voting_disabled = ' disabled';
}
$individual = (int)$this->surveySettings['individual_invitation'];
@ -7763,8 +7922,8 @@ class SurveyInvitationsNew {
echo ' '.Help::display('srv_user_base_individual_invitaition_note2').' </label>';
else
echo ' '.Help::display('srv_user_base_individual_invitaition_note').' </label>';
echo '<label><input type="radio" name="individual_invitation" value="0" id="individual_invitation_0"'.($individual == 0 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>'.$lang['no1'].'</label>';
echo '<label><input type="radio" name="individual_invitation" value="1" id="individual_invitation_1"'.($individual == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>'.$lang['yes'].'</label>';
echo '<label><input type="radio" name="individual_invitation" value="0" id="individual_invitation_0"'.($individual == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>'.$lang['no1'].'</label>';
echo '<label><input type="radio" name="individual_invitation" value="1" id="individual_invitation_1"'.($individual == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>'.$lang['yes'].'</label>';
echo '</p>';
// Ce niso indvidualizirana imamo samo nacin posiljanja
@ -7773,8 +7932,8 @@ class SurveyInvitationsNew {
// Nacin posiljanja (email, posta, sms...)
echo '<p>';
echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_1"'.($noEmailing == 0 ? ' checked="checked"' : '').' onChange="noEmailingToggle(\'0\');"/>'.$lang['srv_inv_message_noemailing_0'].'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' onChange="noEmailingToggle(\'1\');"/>'.$lang['srv_inv_message_noemailing_1'].'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_1"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');"/>'.$lang['srv_inv_message_noemailing_0'].'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');"/>'.$lang['srv_inv_message_noemailing_1'].'</label>';
echo '</p>';
// Nacin dokumentiranja (posta, sms, drugo)
@ -7782,9 +7941,9 @@ class SurveyInvitationsNew {
$noEmailingType = SurveySession::get('inv_noEmailing_type');
echo '<p>';
echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type_external'].':</label>';
echo '<label><input type="radio" name="noMailType" value="0" id="noMailType1"'.($noEmailingType == 0 ? ' checked="checked"' : '').' onClick="noEmailingType(\'0\');" />'.$lang['srv_inv_message_noemailing_type1'].'</label>';
echo '<label><input type="radio" name="noMailType" value="1" id="noMailType2"'.($noEmailingType == 1 ? ' checked="checked"' : '').' onClick="noEmailingType(\'1\');" />'.$lang['srv_inv_message_noemailing_type2'].'</label>';
echo '<label><input type="radio" name="noMailType" value="2" id="noMailType3"'.($noEmailingType == 2 ? ' checked="checked"' : '').' onClick="noEmailingType(\'2\');" />'.$lang['srv_inv_message_noemailing_type3'].'</label>';
echo '<label><input type="radio" name="noMailType" value="0" id="noMailType1"'.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />'.$lang['srv_inv_message_noemailing_type1'].'</label>';
echo '<label><input type="radio" name="noMailType" value="1" id="noMailType2"'.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />'.$lang['srv_inv_message_noemailing_type2'].'</label>';
echo '<label><input type="radio" name="noMailType" value="2" id="noMailType3"'.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />'.$lang['srv_inv_message_noemailing_type3'].'</label>';
echo '</p>';
}
}
@ -7794,8 +7953,8 @@ class SurveyInvitationsNew {
// Nacin posiljanja (email, posta, sms...)
echo '<p>';
echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_1"'.($noEmailing == 0 ? ' checked="checked"' : '').' onChange="noEmailingToggle(\'0\');"/>'.$lang['srv_inv_message_noemailing_0'].'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' onChange="noEmailingToggle(\'1\');"/>'.$lang['srv_inv_message_noemailing_1'].'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_1"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');"/>'.$lang['srv_inv_message_noemailing_0'].'</label>';
echo '<label><input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');"/>'.$lang['srv_inv_message_noemailing_1'].'</label>';
echo '</p>';
// Nacin dokumentiranja (posta, sms, drugo)
@ -7803,9 +7962,9 @@ class SurveyInvitationsNew {
$noEmailingType = SurveySession::get('inv_noEmailing_type');
echo '<p>';
echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type_external'].':</label>';
echo '<label><input type="radio" name="noMailType" value="0" id="noMailType1"'.($noEmailingType == 0 ? ' checked="checked"' : '').' onClick="noEmailingType(\'0\');" />'.$lang['srv_inv_message_noemailing_type1'].'</label>';
echo '<label><input type="radio" name="noMailType" value="1" id="noMailType2"'.($noEmailingType == 1 ? ' checked="checked"' : '').' onClick="noEmailingType(\'1\');" />'.$lang['srv_inv_message_noemailing_type2'].'</label>';
echo '<label><input type="radio" name="noMailType" value="2" id="noMailType3"'.($noEmailingType == 2 ? ' checked="checked"' : '').' onClick="noEmailingType(\'2\');" />'.$lang['srv_inv_message_noemailing_type3'].'</label>';
echo '<label><input type="radio" name="noMailType" value="0" id="noMailType1"'.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />'.$lang['srv_inv_message_noemailing_type1'].'</label>';
echo '<label><input type="radio" name="noMailType" value="1" id="noMailType2"'.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />'.$lang['srv_inv_message_noemailing_type2'].'</label>';
echo '<label><input type="radio" name="noMailType" value="2" id="noMailType3"'.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />'.$lang['srv_inv_message_noemailing_type3'].'</label>';
echo '</p>';
}
@ -7813,8 +7972,8 @@ class SurveyInvitationsNew {
if($noEmailing != 1){
echo '<p>';
echo '<label class="lbl_email_setting">'.$lang['usercode_required1'].':'.Help::display('usercode_required').'</label>';
echo '<label><input type="radio" name="usercode_required" value="0" id="usercode_required_0"'.($row['usercode_required'] == 0 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_required\',true);"/>'.$lang['usercode_required2'].'</label>';
echo '<label><input type="radio" name="usercode_required" value="1" id="usercode_required_1"'.($row['usercode_required'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_required\',true);"/>'.$lang['usercode_required3'].'</label>';
echo '<label><input type="radio" name="usercode_required" value="0" id="usercode_required_0"'.($row['usercode_required'] == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);"/>'.$lang['usercode_required2'].'</label>';
echo '<label><input type="radio" name="usercode_required" value="1" id="usercode_required_1"'.($row['usercode_required'] == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);"/>'.$lang['usercode_required3'].'</label>';
echo '</p>';
}
@ -7834,7 +7993,7 @@ class SurveyInvitationsNew {
echo '<p>';
echo '<label for="usercode_skip_0" class="lbl_email_setting">'.$lang['srv_user_base_access_check'].' '.Help::display('srv_inv_no_code').'</label>';
echo '<input type="checkbox" name="usercode_skip_checkbox" value="0" id="usercode_skip_0"'.($row['usercode_skip'] != 0 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);" />';
echo '<input type="checkbox" name="usercode_skip_checkbox" value="0" id="usercode_skip_0"'.($row['usercode_skip'] != 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);" />';
echo '</p>';
if($row['usercode_skip'] > 0){
echo '<div style="float: left; margin: -10px 0 0 15px;">';
@ -7872,15 +8031,13 @@ class SurveyInvitationsNew {
// Gorenje tega nima
if (!Common::checkModule('gorenje')){
echo '<td style="padding-right:10px;vertical-align: top;">';
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_email_setting_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<div id="surveyInvitationSettingServer">';
//echo '<p>V delu...</p>';
$this->viewServerSettings();
echo '</div>';
echo '</div>';
@ -9904,6 +10061,7 @@ class SurveyInvitationsNew {
global $global_user_id;
global $mysql_database_name;
global $aai_instalacija;
$row = SurveyInfo::getInstance()->getSurveyRow();
@ -9920,7 +10078,35 @@ class SurveyInvitationsNew {
// Admini na testu, www in virtualkah imajo 1ka smtp
if(($admin_type == 0) && ($mysql_database_name == 'www1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'real1kasi'))
$enabled1ka = true;
// Squalo
$squalo = new SurveyInvitationsSqualo($this->sid);
if($squalo->squaloEnabled()){
// Vklop squalo
echo '<div class="squalo_switch">';
echo '<span class="bold">'.$lang['srv_squalo'].':</span>&nbsp;';
echo '<label><input type="checkbox" name="SqualoMode" value="1" '.($squalo->squaloActive() ? 'checked ="checked" ' : '').' style="vertical-align:-2px;" onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">';
echo $lang['srv_squalo_sending'].' </label>';
echo '</div>';
// Squalo nastavitve...
echo '<div class="squalo_settings '.(!$squalo->squaloActive() ? ' displayNone' : '').'">';
echo $lang['srv_squalo_active'];
echo '</div>';
}
// Izbira streznika
echo '<div class="mail_mode_switch '.($squalo->squaloActive() ? ' displayNone' : '').'">';
// Opozorilo, ce imamo vklopljena vabila, da gre za iste nastavitve
echo '<p class="red bold">'.$lang['srv_email_server_settings_warning'].'</p>';
@ -9948,10 +10134,13 @@ class SurveyInvitationsNew {
echo $lang['srv_email_setting_adapter2'].' </label>';
echo Help :: display('srv_mail_mode');
echo '</div>';
#1KA
$enkaSettings = $MA->get1KASettings($raziskave=true);
echo '<div id="send_mail_mode0" '.(!$MA->is1KA() ? ' class="displayNone"' : '').'>';
echo '<div id="send_mail_mode0" '.(!$MA->is1KA() || $squalo->squaloActive() ? ' class="displayNone"' : '').'>';
echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span>';
echo '<br />';
# from
@ -9982,7 +10171,7 @@ class SurveyInvitationsNew {
#GMAIL - Google
$enkaSettings = $MA->getGoogleSettings();
echo '<div id="send_mail_mode1" '.(!$MA->isGoogle() ? ' class="displayNone"' : '').'>';
echo '<div id="send_mail_mode1" '.(!$MA->isGoogle() || $squalo->squaloActive() ? ' class="displayNone"' : '').'>';
echo '<br /><span class="italic">'.$lang['srv_email_setting_adapter1_note'].'</span><br />';
echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span><br />';
# from
@ -9998,7 +10187,7 @@ class SurveyInvitationsNew {
#SMTP
$enkaSettings = $MA->getSMTPSettings();
echo '<div id="send_mail_mode2" '.(!$MA->isSMTP() ? ' class="displayNone"' : '').'>';
echo '<div id="send_mail_mode2" '.(!$MA->isSMTP() || $squalo->squaloActive() ? ' class="displayNone"' : '').'>';
echo '<br /><span class="italic">'.$lang['srv_email_setting_adapter2_note'].'</span><br />';
echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span><br />';
# from - NICE

View File

@ -1022,12 +1022,12 @@ class LatexSurveyElement{
$numOfAt = substr_count($text, $findAt); //stevilo '@' v besedilu
$posAt = strpos($text, $findAt);
if($posAt){ //ce je prisotna afna
if($posAt && $posSpace1){ //ce je prisotna afna in je prisoten presledek v besedilu
//echo "afna je: $posAt </br>";
//echo "Encoding: ".$text."</br>";
//najdi prvi presledek po afni
//echo substr($text, $posAt) ."</br>";
//echo substr($text, $posAt) ."</br>";
$posSpace1Mail = strpos(substr($text, $posAt), $findSpace); //najdi pozicijo prvega presledka v besedilu po e-naslovu
$posSpace1Mail = $posSpace1Mail+$posAt; //koncna pozicija, ce se gleda celotno besedilo
//echo $posSpace1Mail."</br>";

View File

@ -2,7 +2,7 @@
/**
*
* Class ki vsebuje funkcije APIJA (prijava, registracija v 1ko)
* Class ki vsebuje funkcije Squalo APIJA (dodajanje prejemnikov, posiljanje...)
*
*/
@ -37,15 +37,24 @@ class SqualoApi {
// Decode json response
$response_array = json_decode($response, true);
// Zalogiramo kaj se je dogajalo
$SL = new SurveyLog();
// Error
if($response_array['errorCode'] != '0'){
$result['error'] = $response_array["errorMessage"]. ' (code '.$response_array["errorCode"].')';
$result['success'] = false;
$SL->addMessage(SurveyLog::MAILER, "NAPAKA pri SQUALO API klicu ('.$action.')! ".$result['error']);
}
else{
$result = $response_array;
$result['success'] = true;
$SL->addMessage(SurveyLog::MAILER, "USPEŠEN SQUALO API klic ('.$action.').");
}
$SL->write();
return $result;
}

View File

@ -0,0 +1,64 @@
<?php
/**
*
* Class ki vsebuje funkcije potrebne za posiljanje vabil preko SQUALO
*
*/
class SurveyInvitationsSqualo {
private $anketa;
private $squaloEnabled;
private $squaloActive;
public function __construct($anketa){
$this->anketa = $anketa;
// Preverimo ce je squalo omogocen na tej instalaciji in anketi
$this->squaloEnabled = $this->checkSqualoEnabled() ? true : false;
// Preverimo ce je squalo vklopljen na anketi
$this->squaloActive = $this->checkSqualoActive() ? true : false;
}
public function squaloEnabled(){
return $this->squaloEnabled;
}
public function squaloActive(){
return $this->squaloActive;
}
// Preverimo ce je squalo omogocen na instalaciji
private function checkSqualoEnabled(){
global $mysql_database_name;
global $admin_type;
global $squalo_user;
global $squalo_key;
// Zaenkrat imajo squalo samo admini
if($admin_type != 0)
return false;
// Squalo je omogocen samo na testu, www in virtualkah
if($mysql_database_name != 'www1kasi' && $mysql_database_name != 'test1kasi' && $mysql_database_name != 'real1kasi')
return false;
// Zaenkrat imajo squalo samo admini
if(!isset($squalo_user) || $squalo_user == '' || !isset($squalo_key) || $squalo_key == '')
return false;
return false;
}
// Preverimo ce je squalo vklopljen na anketi
private function checkSqualoActive(){
return false;
}
}

10
composer.lock generated
View File

@ -1912,16 +1912,16 @@
"packages-dev": [
{
"name": "filp/whoops",
"version": "2.9.2",
"version": "2.10.0",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "df7933820090489623ce0be5e85c7e693638e536"
"reference": "6ecda5217bf048088b891f7403b262906be5a957"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536",
"reference": "df7933820090489623ce0be5e85c7e693638e536",
"url": "https://api.github.com/repos/filp/whoops/zipball/6ecda5217bf048088b891f7403b262906be5a957",
"reference": "6ecda5217bf048088b891f7403b262906be5a957",
"shasum": ""
},
"require": {
@ -1969,7 +1969,7 @@
"throwable",
"whoops"
],
"time": "2021-01-24 12:00:00"
"time": "2021-03-16 12:00:00"
},
{
"name": "kint-php/kint",

View File

@ -7406,6 +7406,12 @@ $lang = array (
'srv_export_2_xls_button' => "Izvozi v Excel",
'srv_pc_unavailable' => "Prikaz slike ni mogoč",
// SQUALO //
'srv_squalo' => "Squalo",
'srv_squalo_sending' => "Pošiljaj preko aplikacije Squalo",
'srv_squalo_active' => "Squalo pošiljanje je vklopljeno.",
// NAROCILA //
'srv_narocila' => "Naročila",

View File

@ -7291,6 +7291,14 @@ $lang = array (
'srv_export_2_xls_button' => "Export to Excel",
'srv_pc_unavailable' => "Image unavailable",
// SQUALO //
'srv_squalo' => "Squalo",
'srv_squalo_sending' => "Sending with application Squalo",
'srv_squalo_active' => "Sending with Squalo is turned on.",
// NAROCILA //
'srv_narocila' => "Orders",

View File

@ -800,23 +800,26 @@ class InitClass extends Controller
if (!$sql2) echo mysqli_error($GLOBALS['connect_db']);
$row2 = mysqli_fetch_array($sql2);
if (mysqli_num_rows($sql2) > 0) { // pravilna koda
// Pravilna koda
if (mysqli_num_rows($sql2) > 0) {
// Dodatno preverimo ce koda se ni potekla
$sqlC = sisplet_query("SELECT * FROM srv_invitations_recipients WHERE ank_id='".get('anketa')."' AND TRIM(password)='".$usercode."' AND DATE(NOW())>DATE(date_expired) AND date_expired!='0000-00-00 00:00:00'");
if(mysqli_num_rows($sqlC) > 0){
Display::getInstance()->displayNapaka(self::$lang['srv_expiredcode']);
die();
}
$rand = $row2['cookie'];
// Ce imamo vklopljen modul za volitve preskocimo kar nekaj korakov (anonimizacija)
if(!SurveyInfo::checkSurveyModule('voting')){
# nastavimo še da je uporabnik odgovoril na anketo za nov način e-mail vabil
$sqlString = "UPDATE srv_invitations_recipients SET responded = '1', date_responded = NOW() WHERE ank_id='" . get('anketa') . "' AND TRIM(password) ='$usercode' AND responded = '0'";
sisplet_query($sqlString);
// Dodatno preverimo ce koda se ni potekla
$sqlC = sisplet_query("SELECT * FROM srv_invitations_recipients WHERE ank_id='".get('anketa')."' AND TRIM(password)='".$usercode."' AND DATE(NOW())>DATE(date_expired) AND date_expired!='0000-00-00 00:00:00'");
if(mysqli_num_rows($sqlC) > 0){
Display::getInstance()->displayNapaka(self::$lang['srv_expiredcode']);
die();
}
sisplet_query("COMMIT");
# nastavimo še da je uporabnik odgovoril na anketo za nov način e-mail vabil
sisplet_query("UPDATE srv_invitations_recipients SET responded = '1', date_responded = NOW() WHERE ank_id='" . get('anketa') . "' AND TRIM(password) ='$usercode' AND responded = '0'");
sisplet_query("COMMIT");
}
$rand = $row2['cookie'];
$this->set_cookie('survey-' . get('anketa'), $rand, $this->expire);
@ -1199,12 +1202,16 @@ class InitClass extends Controller
}
# dodamo še tracking arhivov vabil
if (get('user_inv_archive') > 0 && $inv_res_id > 0) {
# ignoriramo podvojene kluče
$updateString = "INSERT IGNORE INTO srv_invitations_tracking (inv_arch_id, time_insert, res_id, status) VALUES ('" . (int)get('user_inv_archive') . "',NOW(),'$inv_res_id','$status')";
$s = sisplet_query($updateString);
$s = sisplet_query("INSERT IGNORE INTO srv_invitations_tracking
(inv_arch_id, time_insert, res_id, status)
VALUES
('" . (int)get('user_inv_archive') . "',NOW(),'$inv_res_id','$status')
");
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
} else {
}
else {
}
# potrebno bo osvežit seznam anket

View File

@ -9471,3 +9471,15 @@ UPDATE srv_gdpr_anketa SET export_legal_eng = export_legal_slo;
UPDATE srv_gdpr_anketa SET note_eng = note_slo;
UPDATE misc SET value='21.02.16' WHERE what="version";
## Squalo nastavitve na anketi
CREATE TABLE srv_squalo_anketa(
id int(11) NOT NULL auto_increment,
ank_id int(11) NOT NULL,
active ENUM('0', '1') NOT NULL DEFAULT '0',
PRIMARY KEY (id),
UNIQUE KEY (ank_id),
CONSTRAINT fk_srv_squalo_anketa_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UPDATE misc SET value='21.03.17' WHERE what="version";

View File

@ -947,6 +947,7 @@ return array(
'SurveyInfo' => $baseDir . '/admin/survey/classes/class.SurveyInfo.php',
'SurveyInspect' => $baseDir . '/admin/survey/classes/class.SurveyInpect.php',
'SurveyInvitationsNew' => $baseDir . '/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php',
'SurveyInvitationsSqualo' => $baseDir . '/admin/survey/modules/mod_squalo/class.SurveyInvitationsSqualo.php',
'SurveyJsonSurveyData' => $baseDir . '/admin/survey/modules/mod_json_survey_export/class.SurveyJsonSurveyData.php',
'SurveyLanguageTechnology' => $baseDir . '/admin/survey/classes/class.SurveyLanguageTechnology.php',
'SurveyList' => $baseDir . '/admin/survey/classes/class.SurveyList.php',

View File

@ -1151,6 +1151,7 @@ class ComposerStaticInit6b03163c371c5541881b55b762b8c779
'SurveyInfo' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyInfo.php',
'SurveyInspect' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyInpect.php',
'SurveyInvitationsNew' => __DIR__ . '/../..' . '/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php',
'SurveyInvitationsSqualo' => __DIR__ . '/../..' . '/admin/survey/modules/mod_squalo/class.SurveyInvitationsSqualo.php',
'SurveyJsonSurveyData' => __DIR__ . '/../..' . '/admin/survey/modules/mod_json_survey_export/class.SurveyJsonSurveyData.php',
'SurveyLanguageTechnology' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyLanguageTechnology.php',
'SurveyList' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyList.php',