diff --git a/admin/survey/classes/class.SurveyInvitationsNew.php b/admin/survey/classes/class.SurveyInvitationsNew.php index 2abe389e7..ce2f8aa25 100644 --- a/admin/survey/classes/class.SurveyInvitationsNew.php +++ b/admin/survey/classes/class.SurveyInvitationsNew.php @@ -3050,15 +3050,19 @@ class SurveyInvitationsNew { } function displayMailToSourceLists($source_type) { - global $lang,$site_url; - $canShowSubOption = false; + global $lang, $site_url; + + $canShowSubOption = false; + echo '

'; echo $lang['srv_inv_send_who_create1'].''.$lang['srv_inv_send_who_create2'].'
'; - if ((int)$source_type == 0) { + + if ((int)$source_type == 0) { # vsi respondenti v bazi echo $lang['srv_inv_send_who_database_note']; $canShowSubOption = true; - } elseif ((int)$source_type == 1) { + } + elseif ((int)$source_type == 1) { # Arhivi pošiljanja # poiščemo arhiv mailingov @@ -3067,8 +3071,10 @@ class SurveyInvitationsNew { $sql_query_arc = sisplet_query($sql_string_arc); if (mysqli_num_rows($sql_query_arc) > 0) { - $canShowSubOption = true; - echo $lang['srv_inv_send_who_archive_note']; + + $canShowSubOption = true; + + echo $lang['srv_inv_send_who_archive_note']; echo ''; echo ''; echo ''; @@ -3076,29 +3082,40 @@ class SurveyInvitationsNew { echo ''; echo ''; echo ''; - while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) { + + while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; - } + } + echo '
 '.$lang['srv_inv_send_who_table_respondents'].''.$lang['srv_inv_send_who_table_date_create'].'
'.$row_arc['naslov'].''.((int)$row_arc['cnt_succsess']+(int)$row_arc['cnt_error']).''.$row_arc['ds'].'
'; - } else{ + } + else{ echo $lang['srv_inv_send_who_archive_no_archive']; - } - - } elseif ((int)$source_type == 2) { + } + } + elseif ((int)$source_type == 2) { # seznami respondentov # zloopamo skozi posamezne sezname respondentov - $sql_string_arc ="SELECT list_id as id, COUNT(*) as cnt_succsess, list_id, sirp.name as naslov, DATE_FORMAT(sirp.insert_time,'%d.%m.%Y, %T') AS ds FROM srv_invitations_recipients AS sir LEFT JOIN srv_invitations_recipients_profiles AS sirp ON sir.list_id = sirp.pid WHERE ank_id ='".$this->sid."' AND sir.deleted ='0' group BY list_id"; - #$sql_string_arc = "SELECT sia.*, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' ORDER BY sia.date_send ASC;"; - $sql_query_arc = sisplet_query($sql_string_arc); - if (mysqli_num_rows($sql_query_arc) > 0) { - $canShowSubOption = true; - echo $lang['srv_inv_send_who_all_units_note']; + $sql_string_arc =""; + $sql_query_arc = sisplet_query("SELECT list_id as id, COUNT(*) as cnt_succsess, list_id, sirp.name as naslov, DATE_FORMAT(sirp.insert_time,'%d.%m.%Y, %T') AS ds + FROM srv_invitations_recipients AS sir + LEFT JOIN srv_invitations_recipients_profiles AS sirp + ON sir.list_id = sirp.pid + WHERE ank_id ='".$this->sid."' AND sir.deleted ='0' group BY list_id + "); + + if (mysqli_num_rows($sql_query_arc) > 0) { + + $canShowSubOption = true; + + echo $lang['srv_inv_send_who_all_units_note']; + echo ''; echo ''; echo ''; @@ -3107,20 +3124,26 @@ class SurveyInvitationsNew { echo ''; echo ''; while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) { - if ($row_arc['id'] > 0 && $row_arc['naslov'] == '') { + + if ($row_arc['id'] > 0 && $row_arc['naslov'] == '') { # če ni imena in je id < 0 je bil izbrisan - } else { + } + else { if ($row_arc['id'] > 0) { if ($row_arc['naslov'] != '') { $_naslov = $row_arc['naslov']; - } else { + } + else { $_naslov = $lang['srv_inv_send_who_table_list_deleted']; } - } else if ($row_arc['id'] == 0) { + } + else if ($row_arc['id'] == 0) { $_naslov = $lang['srv_inv_send_who_table_list_temporary']; - } else if ($row_arc['id'] < 0) { + } + else if ($row_arc['id'] < 0) { $_naslov = $lang['srv_inv_send_who_table_list_noname']; - } + } + echo ''; echo ''; echo ''; @@ -3130,14 +3153,15 @@ class SurveyInvitationsNew { } } echo '
 '.$lang['srv_inv_send_who_table_date_create'].'
'.$_naslov.'
'; - } else{ + } + else{ echo $lang['srv_inv_send_who_no_lists']; } - } echo '

'; if ($canShowSubOption == true) { + echo ''; echo ''.$lang['srv_inv_send_note'].'
'; echo '
'; @@ -4477,13 +4501,13 @@ class SurveyInvitationsNew { # po potrebi zamenjamo delimiter iz (;) v (,) // Vejica NI kul, ker se uporablja pri nazivih in v custom poljih Za interni delimiter naj bo recimo " | "... $recipients_list = str_replace ($_POST['recipientsDelimiter'], "|~|", $recipients_list); - - // Dodamo polja - $result = $this->addMassRecipients($recipients_list, $fields); - + // Shranimo v seznam $pid = $this->saveAppendRecipientList($pid=0, $fields, $recipients_list, $profileName='', $profileComment=''); - + + // Dodamo polja + $result = $this->addMassRecipients($recipients_list, $fields, $pid); + // Prikažemo napake $invalid_recipiens_array = $this->displayRecipentsErrors($result); @@ -5084,75 +5108,10 @@ class SurveyInvitationsNew { function getProfileName() { echo 'DEPRECATED'; - /* - global $lang,$site_url, $global_user_id; - - $array_profiles = array(); - #ne vem če je fino da lahko dodaja kar na vse sezname - session_start(); - $_only_this_survey = (isset($_SESSION['inv_rec_only_this_survey']) && $_SESSION['inv_rec_only_this_survey'] == false) ? '' : " AND from_survey = '".$this->sid. "'" ; - - # polovimo še ostale porfile - $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('0', '".$global_user_id."')".$_only_this_survey; - $sql_query = sisplet_query($sql_string); - while ($sql_row = mysqli_fetch_assoc($sql_query)) { - $array_profiles[$sql_row['pid']] = array('name' => $sql_row['name'], 'comment'=>$sql_row['comment']); - } - - #echo '
'; - echo ''; - echo $lang[''].'Izberite seznam kamor želite dodati prejemnike. Izbirate lahko med:
  • \'Nov seznam\' - prejemniki se dodajo v nov seznam, kateremu določite ime
  • \'Začasen seznam\' - seznam obstaja samo v času seje brskalnika
  • ali izberete obstoječ seznam, h kateremu se bodo dodali prejemniki

'; - echo '
'; - echo $lang['srv_invitation_recipients_list_add'].': '; - echo ''; - echo ' 0 ? ' class="displayNone"' : '' ).'>'; - echo '

'; - echo ''; - echo '
'; - echo '

'; - echo $lang['srv_inv_recipient_list_comment']; - - echo ''; - - echo '

'; - echo ''.$lang['srv_cancel'].''; - echo ''.$lang['save'].''; - echo '
'; - #echo '
'; # id="inv_view_arch_recipients" - echo ''; -*/ } function saveRecProfile() { - global $lang,$site_url, $global_user_id; + global $lang, $site_url, $global_user_id; $return = array('error'=>'0'); $profile_id = isset($_POST['profile_id'])? (int)$_POST['profile_id'] : -1;