summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php')
-rw-r--r--admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php4561
1 files changed, 2348 insertions, 2213 deletions
diff --git a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
index 00ec13f..b186c9e 100644
--- a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
+++ b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
@@ -1,11 +1,8 @@
<?php
# mysql_real_unescape_string
/** Class ki skrbi za različna vabila
- * Julij 2011
- *
- *
- * Enter description here ...
- * @author Gorazd_Veselic
+ * Januar 2024
+ * @author Uroš Podkrižnik
*
*/
@@ -17,13 +14,13 @@ define('NOTIFY_INFO1KA', 5); # Nad koliko emaili obveščamo info@1ka.si
set_time_limit(2400); # 30 minut
class SurveyInvitationsNew {
+
+
private $sid;
private $count_all = 0; # koliko prejemnikov je v bazi
private $surveySettings; # zakeširamo nastavitve ankete
private $rec_send_page_limit = 20; # Koliko zapisov imamo za paginacijo
- private $newTracking = false; # Ali imamo podroben tracking za anketo
-
private $inv_variables = array('email','password','ime','priimek','naziv','telefon','drugo','odnos');
private $inv_variables_link = array('email'=>'email','geslo'=>'password','ime'=>'firstname','priimek'=>'lastname','naziv'=>'salutation','telefon'=>'phone','drugo'=>'custom','odnos'=>'relation','last_status'=>'last_status','sent'=>'sent','responded'=>'responded','unsubscribed'=>'unsubscribed');
private $inv_variables_excel = array('email'=>'email','geslo'=>'password','ime'=>'firstname','priimek'=>'lastname','naziv'=>'salutation','telefon'=>'phone','drugo'=>'custom','odnos'=>'relation','last_status'=>'last_status','sent'=>'sent','responded'=>'responded','unsubscribed'=>'unsubscribed'
@@ -34,18 +31,19 @@ class SurveyInvitationsNew {
#private $inv_sys_db_map = array('email'=>'email','password'=>'geslo','firstname'=>'ime','lastname'=>'priimek','salutation'=>'naziv','phone'=>'telefon','custom'=>'drugo');
private $invitationAdvancedConditionId = 0;
+ private $invitationAdvancedConditionProfileId = 0;
private $user_inv_ids = array();
private $db_table = '';
+
function __construct($sid) {
$this->sid = $sid;
SurveyInfo::SurveyInit($this->sid);
- if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
- $this->db_table = '_active';
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->surveySettings = SurveyInfo::getInstance()->getSurveyRow();
@@ -53,22 +51,22 @@ class SurveyInvitationsNew {
$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
- $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;
-
+
SurveyDataSettingProfiles :: Init($this->sid);
if (isset($_SESSION['rec_on_send_page']) && (int)$_SESSION['rec_on_send_page'] > 0) {
$this->rec_send_page_limit = (int)$_SESSION['rec_on_send_page'];
- } else {
+ }
+ else {
$this->rec_send_page_limit = REC_ON_SEND_PAGE;
}
+ $this->invitationAdvancedConditionProfileId = SurveyUserSetting :: getInstance()->getSettings('default_condition_profile');
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ $this->invitationAdvancedConditionId = $scp->getProfileConditionId($this->invitationAdvancedConditionProfileId);
+
SurveySession::sessionStart($this->sid);
- $this->invitationAdvancedConditionId = (int)SurveySession::get('invitationAdvancedConditionId');
}
function ajax() {
@@ -93,10 +91,9 @@ class SurveyInvitationsNew {
function action($action) {
global $lang;
global $site_url;
- global $app_settings;
global $global_user_id;
- $NoNavi = $_POST['noNavi'];
+ $NoNavi = isset($_POST['noNavi']) ? $_POST['noNavi'] : '';
if ($action == 'inv_lists') {
#$NoNavi = true;
@@ -106,9 +103,7 @@ class SurveyInvitationsNew {
}
if ($NoNavi == false) {
- echo '<div id="inv_top_navi">';
$this->displayNavigation();
- echo '</div>';
}
// Warning za nastavitev streznika
@@ -133,10 +128,12 @@ class SurveyInvitationsNew {
// Pri ajax klicih nikoli tega ne izpišemo, ravno tako ne izpisujemo, ce imamo vklopljeno posiljanje brez emaila (navadna posta, sms)
$noEmailing = SurveySession::get('inv_noEmailing');
if($NoNavi == false && $noEmailing != 1){
- echo '<div id="email_server_warning">';
- echo '<span class="faicon warning icon-orange"></span> '.$lang['srv_invitation_server_warning'].'!';
- if($action != 'inv_server')
+ echo '<div id="email_server_warning" class="top_note">';
+
+ echo '<div class="title"><span class="faicon warning icon-orange"></span> '.$lang['srv_invitation_server_warning'].'</div>';
+ //if($action != 'inv_settings')
echo '<span class="spaceLeft"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a></span>';
+
echo '</div>';
}
}
@@ -156,13 +153,16 @@ class SurveyInvitationsNew {
$this->viewRecipients();
}
else if ($action == 'view_message') {
- $this->viewMessage($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->viewMessage($mid);
}
else if ($action == 'make_default') {
- $this->makeDefaultMessage($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->makeDefaultMessage($mid);
}
else if ($action == 'make_default_from_preview') {
- $this->makeDefaultFromPreview($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->makeDefaultFromPreview($mid);
}
else if ($action == 'save_message_simple') {
$this->save_message_simple();
@@ -171,10 +171,11 @@ class SurveyInvitationsNew {
$this->save_message_simple_noEmail();
}
else if ($action == 'send_message') {
- $this->sendMessage($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->sendMessage($mid);
}
else if ($action == 'view_archive') {
- $this->viewAarchive($_POST['mid']);
+ $this->viewAarchive();
}
else if ($action == 'view_send_recipients') {
if(isset($_POST['noMailing']) && $_POST['noMailing'] == '1')
@@ -223,6 +224,9 @@ class SurveyInvitationsNew {
else if ($action == 'export_recipients_all') {
$this->exportRecipients_all();
}
+ else if ($action == 'export_recipients_qr_codes') {
+ $this->exportRecipients_qr_codes();
+ }
else if ($action == 'use_recipients_list') {
$this->useRecipientsList();
}
@@ -329,7 +333,7 @@ class SurveyInvitationsNew {
}
else if ($action == 'editRecList') {
- $doEdit = $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true' ? true : false;
+ $doEdit = (isset($_SESSION['inv_edit_rec_profile'][$this->sid]) && $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true') ? true : false;
if ($doEdit) {
$this->showEditRecList();
@@ -375,7 +379,7 @@ class SurveyInvitationsNew {
$this->showAdvancedConditions();
}
else if ($action == 'setAdvancedCondition') {
- $this->setAdvancedCondition();
+ $this->setAdvancedConditionProfile($_POST['pid']);
}
else if ($action == 'inv_server') {
$this->viewServerSettings();
@@ -513,15 +517,16 @@ class SurveyInvitationsNew {
function addRecipientsView( $fields = array(), $recipients_list=null) {
global $lang;
global $site_url;
-
- //echo '<h2>'.$lang['srv_inv_add_recipients_heading'].'</h2>';
+
$noEmailing = SurveySession::get('inv_noEmailing');
$row = $this->surveySettings;
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+
+ echo '<div class="invitations_top_settings">';
+
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
@@ -557,17 +562,18 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= ' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
echo $settings_text;
- echo '</h2>';
-
- echo '<div id="srv_invitation_note">';
+ echo '<div id="srv_invitation_note">';
echo $lang['srv_invitation_num_respondents'].(int)$this->count_all;
echo '</div>';
+
+ echo '</div>';
- echo '<div id="inv_import">';
+
+ echo '<div id="inv_import" class="invitations_holder left-menu invitations_add">';
$this->displayAddRecipientsView($fields, $recipients_list);
echo '</div>'; # id="inv_import"
}
@@ -630,44 +636,99 @@ class SurveyInvitationsNew {
session_start();
$checked = (isset($_SESSION['inv_rec_only_this_survey']) && (int)$_SESSION['inv_rec_only_this_survey'] == 1) ? '1' : '0';
+
# profili respondentov
- echo '<div id="inv_recipients_profiles_holder">';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="0" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '0' ? ' checked="checked"':'').' autocomplete="off">'.$lang['srv_inv_list_edit_from_this_survey'].'</label><br/>';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="1" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '1' ? ' checked="checked"':'').' autocomplete="off">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label><br/>';
-
- echo '<span>'.$lang['srv_inv_recipient_select_list'].'</span><br/>';
+ echo '<fieldset id="inv_recipients_profiles_holder" class="left_holder">';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_item">';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="0" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '0' ? ' checked="checked"':'').' autocomplete="off"><label for="inv_show_list_type1">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
+ echo ' </div>';
+ echo ' <div class="setting_item">';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="1" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '1' ? ' checked="checked"':'').' autocomplete="off"><label for="inv_show_list_type2">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<span>'.$lang['srv_inv_recipient_select_list'].'</span>';
$this->listRecipientsProfiles();
- echo '</div>'; # id=inv_recipients_profiles_holder
- echo '<div id="inv_import_list_container">';
+ # podatki o profilu
+ $ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
+
+ echo '<div class="info">';
+
+ if ((int)$ppid > 0) {
+ # polovimo podatke profila
+ $sql_string = "SELECT rp.*, u.name, u.surname FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE rp.pid = '".(int)$ppid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_inv_recipiens_list_created_by'].implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_inv_recipiens_list_created_day'].date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ echo '<div title="'.$sql_row['comment'].'" style="max-width:202px;">'.$lang['srv_inv_recipiens_list_comment'].trim (strip_tags($sql_row['comment'])).'</div>';
+
+ }
+ else {
+ echo '<div>'.$lang['srv_inv_recipiens_temporary_list'].'</div>';
+ }
+
+ echo '</div>';
+ echo '</fieldset>'; # id=inv_recipients_profiles_holder
+
+
+ echo '<fieldset id="inv_import_list_container" class="right_holder">';
+
+ $sysUserToAdd = 0;
$sqlSysMapping = sisplet_query("SELECT * FROM srv_invitations_mapping WHERE sid = '$this->sid'");
if (mysqli_num_rows($sqlSysMapping) > 0) {
$sysUserToAddQuery = sisplet_query("SELECT count(*) FROM srv_user where ank_id='".$this->sid."' AND inv_res_id IS NULL AND deleted='0'");
list($sysUserToAdd) = mysqli_fetch_row($sysUserToAddQuery);
}
- echo '<span><input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label></span>';
- echo '<span><input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="inv_change_import_type();"'.($import_type == 1 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type1">'.$lang['srv_inv_recipiens_from_file'].'</label></span>';
- echo '<span><input name="inv_import_type" id="inv_import_type3" type="radio" value="3" onclick="inv_change_import_type();"'.($import_type == 3 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type3">'.$lang['srv_inv_recipiens_from_system']
- .($sysUserToAdd > 0 ? ' ('.$sysUserToAdd.')' : '').'</label></span>';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_title">'.$lang['srv_inv_recipiens_from'].' '.Help::display('inv_recipiens_from_system').':</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="inv_change_import_type();"'.($import_type == 1 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type1">'.$lang['srv_inv_recipiens_from_file'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type3" type="radio" value="3" onclick="inv_change_import_type();"'.($import_type == 3 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type3">'.$lang['srv_inv_recipiens_from_system'].($sysUserToAdd > 0 ? ' ('.$sysUserToAdd.')' : '').'</label>';
+ echo '</div>';
+
+ echo '</div>';
- echo Help::display('inv_recipiens_from_system');
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
if ($import_type == 3) {
- $this->createSystemVariablesMapping();
+ $this->createSystemVariablesMapping();
}
else {
-
-
- # sporočilo za personalizirana e-vabila in respondente iz baze
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_field_note'].'</span>';
-
- echo '<br >';
+
+ # sporočilo za personalizirana e-vabila in respondente iz baze
+ echo '<div class="setting_holder">';
+ echo '<span>'.$lang['srv_inv_recipiens_field_note'].'</span>';
+ echo '</div>';
+
echo '<div id="inv_field_container">';
@@ -687,7 +748,7 @@ class SurveyInvitationsNew {
echo '<br />';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
@@ -698,145 +759,119 @@ class SurveyInvitationsNew {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize:'true', tolerance:'pointer', placeholder:'inv_field_placeholder', cancel:'#inv_field_relation'});";
- echo '</script>';
-
- # iz seznama
- echo '<div id="inv_import_list"'.($import_type != 1 ? '' : ' class="hidden"').'>' ;
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_email_note'];
- echo '<br class="clr" /><span class="inv_sample" >';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_inv_recipiens_sample1'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '</span>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_0">';
- echo implode(',',$field_lang);
- echo '</span>';
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
+
+ # IZ SEZNAMA
+ echo '<div id="inv_import_list" '.($import_type != 1 ? '' : 'class="displayNone"').'>' ;
+
+ echo '<div class="setting_line inv_note">'.$lang['srv_inv_recipiens_email_note'].'</div>';
+
+ echo '<div class="setting_line inv_sample">';
+ echo '<div class="semi-bold">'.$lang['srv_inv_recipiens_sample'].'</div>';
+ echo '<div class="italic">'.$lang['srv_inv_recipiens_sample1'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="semi-bold inv_type_0">'.implode(',',$field_lang).'</span>';
+ echo '</div>';
// Opozorilo za limit znakov pri passwordu (20)
- echo '<span id="inv_field_list_warning" class="red" style="display:none;">';
- echo '<br class="clr" /><br class="clr" />';
+ echo '<div id="inv_field_list_warning" class="setting_line red" style="display:none;">';
echo $lang['srv_inv_recipiens_pass_warning'];
- echo '</span>';
-
- echo '<br class="clr" /><br class="clr" />';
-
+ echo '</div>';
+
// delimiter
- echo $lang['srv_inv_recipient_list_delimiter']
- .'<label for="recipientsDelimiter1"><input id="recipientsDelimiter1" type="radio" ' .(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'') .' value="," name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_comma'] .' (,)</label>&nbsp;&nbsp;&nbsp;'
- .'<label for="recipientsDelimiter4"><input id="recipientsDelimiter4" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'') .' value="|~|" name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_1KA'] .' (|~|)</label>&nbsp;&nbsp;&nbsp;'
- .'<label for="recipientsDelimiter2"><input id="recipientsDelimiter2" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'') .' value=";" name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_semicolon'] .' (;) </label>&nbsp;&nbsp;&nbsp;'
- .'<label for="recipientsDelimiter3"><input id="recipientsDelimiter3" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'') .' value="|" name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_pipe'] .' (|)</label>&nbsp;&nbsp;&nbsp;';
-
- echo '</span>';
-
- echo '<br class="clr" /><br class="clr" />';
-
- echo '<textarea id="inv_recipients_list" cols="50" rows="9" name="inv_recipients_list">';
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_inv_recipient_list_delimiter'].'</label>';
+ echo ' <input id="recipientsDelimiter1" type="radio" ' .(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'') .' value="," name="recipientsDelimiter"><label for="recipientsDelimiter1">' .$lang['srv_inv_recipient_delimiter_comma'] .' (,)</label>';
+ echo ' <input id="recipientsDelimiter2" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'') .' value=";" name="recipientsDelimiter"><label for="recipientsDelimiter2">' .$lang['srv_inv_recipient_delimiter_semicolon'] .' (;) </label>';
+ echo ' <input id="recipientsDelimiter3" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'') .' value="|" name="recipientsDelimiter"><label for="recipientsDelimiter3">' .$lang['srv_inv_recipient_delimiter_pipe'] .' (|)</label>';
+ echo ' <input id="recipientsDelimiter4" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'') .' value="|~|" name="recipientsDelimiter"><label for="recipientsDelimiter4">' .$lang['srv_inv_recipient_delimiter_1KA'] .' (|~|)</label>';
+ echo '</div>';
+
+ // Vnosno polje
+ echo '<div class="setting_line">';
+ echo ' <label for="inv_recipients_list">'.$lang['srv_inv_recipiens_insert'].':</label>';
+ echo ' <textarea id="inv_recipients_list" name="inv_recipients_list">';
if (is_array($recipients_list) && count($recipients_list) > 0 ) {
echo implode("\n",$recipients_list);
}
- echo '</textarea>';
-
- echo '<br class="clr"/>';
-
-
- #podatki o profilu
- echo '<br class="clr"/>';
- $ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
-
- echo '<span class="floatLeft" style="min-width:200px;">';
- if ((int)$ppid > 0) {
- # polovimo podatke profila
- $sql_string = "SELECT rp.*, u.name, u.surname FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE rp.pid = '".(int)$ppid."'";
- $sql_query = sisplet_query($sql_string);
- $sql_row = mysqli_fetch_assoc($sql_query);
-
- $avtor = array();
- if (trim($sql_row['name'])) {
- $avtor[] = trim ($sql_row['name']);
- }
- if (trim($sql_row['surname'])) {
- $avtor[] = trim ($sql_row['surname']);
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray">'.$lang['srv_inv_recipiens_list_created_by'].implode(' ',$avtor).'</div>';
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_inv_recipiens_list_created_day'].date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
- echo '<div class="gray" title="'.$sql_row['comment'].'" style="max-width:202px;">'.$lang['srv_inv_recipiens_list_comment'].trim (strip_tags($sql_row['comment'])).'</div>';
-
- } else {
- echo '<div class="gray">'.$lang['srv_inv_recipiens_temporary_list'].'</div>';
- }
- echo '</span>';
-
- echo '<div class="floatLeft spaceLeft">';
-
- echo '<div>';
- echo '<label class="spaceRight"><input type="checkbox" id="inv_recipients_add" value="1" checked="checked">'.$lang['srv_invitation_recipients_add_type4'].'</label>';
- /*echo '<label class="spaceRight"><input type="checkbox" id="inv_recipients_rename_profile" onchange="invRenameRecipientsChange();">'.$lang['srv_inv_recipients_rename_list'].'</label>';
- echo Help::display('srv_invitation_rename_profile');*/
- #echo '&nbsp;';
- #echo '<label class="spaceLeft"><input type="checkbox" id="inv_recipients_add_type2" value="2" >'.$lang['srv_invitation_recipients_add_type5'].'</label>';
+ echo ' </textarea>';
+ echo '</div>';
+
+
+ // Checkbox dodaj seznam v anketo
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="inv_recipients_add" value="1" checked="checked"><label for="inv_recipients_add">'.$lang['srv_invitation_recipients_add_type4'].'</label>';
echo '</div>';
- echo '<div id="div_inv_recipients_rename_list_type" class="displayNone">';
+
+ echo '<div id="div_inv_recipients_rename_list_type" class="displayNone setting_line">';
$this->saveRecipientListName();
echo '</div>';
- echo '</div>';
-
- echo '<br />';
# če že imamo prejemnike v bazi ponudimo gumb naprej
- echo '<span class="buttonwrapper floatRight spaceLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="invRecipientsForward(); return false;"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- echo '<br /><br />';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="blue medium" onclick="invRecipientsForward(); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
echo '</div>'; # id=inv_import_list
- # iz datoteke
- echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' class="hidden"').'>' ;
+
+ # IZ DATOTEKE
+ echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' class="displayNone"').'>' ;
+
echo '<form id="inv_recipients_upload_form" name="resp_uploader" method="post" enctype="multipart/form-data" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=upload_recipients" autocomplete="off">';
echo '<input type="hidden" name="fields" id="inv_recipients_upoad_fields" value="'.implode(',',$fields).'" />';
echo '<input type="hidden" name="posted" value="1" />';
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_file_note_1'].'</span>';
+
+ echo '<div class="setting_line inv_note">'.$lang['srv_inv_recipiens_file_note_1'].'</div>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_1">';
- echo implode(',',$field_lang);
- echo '</span>';
- echo '<br class="clr" />';
+ echo '<div class="setting_line">';
+ echo $lang['srv_inv_recipiens_fields'];
+ echo ' <span id="inv_field_list" class="inv_type_1">'.implode(',',$field_lang).'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
echo $lang['srv_mailing_upload_list'];
- echo '<input type="file" name="recipientsFile" id="recipientsFile" size="42" >';
- if (count($errors) > 0) {
+ echo '<br><input type="file" name="recipientsFile" id="recipientsFile" size="42">';
+ /* if (count($errors) > 0) {
echo '<br class="clr" />';
echo '<span class="inv_error_note">';
foreach($errors as $error) {
echo '* '.$error.'<br />';
}
echo '</span>';
- }
- echo '<br/><br/><label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label> <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1" value="," checked><label for="recipientsDelimiter1">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
- echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2" value=";"><label for="recipientsDelimiter2">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
- echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter3" value="|"><label for="recipientsDelimiter3">'.$lang['srv_inv_recipient_delimiter_pipe'].' (|)</label>';
- echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter4" value="|~|"><label for="recipientsDelimiter4">'.$lang['srv_inv_recipient_delimiter_1KA'].' (|~|)</label>';
- echo '</form>';
- echo '<br class="clr" /><span class="inv_sample" >';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_inv_recipiens_sample1'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '<br class="clr" />';
- echo '<span id="inv_upload_recipients" class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_inv_btn_add_recipients_add'].'</span></a></span>';
- echo '</div>'; # id=inv_import_file
+ } */
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1_import" value="," '.(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'').'><label for="recipientsDelimiter1_import">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2_import" value=";" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'').'><label for="recipientsDelimiter2_import">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter3_import" value="|" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'').'><label for="recipientsDelimiter3_import">'.$lang['srv_inv_recipient_delimiter_pipe'].' (|)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter4_import" value="|~|" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'').'><label for="recipientsDelimiter4_import">'.$lang['srv_inv_recipient_delimiter_1KA'].' (|~|)</label>';
+ echo '</div>';
+
+ echo '</form>';
+
+ echo '<div class="setting_line inv_sample">';
+ echo ' <div class="semi-bold">'.$lang['srv_inv_recipiens_sample'].'</div>';
+ echo ' <div class="italic">'.$lang['srv_inv_recipiens_sample1'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button id="inv_upload_recipients" class="blue medium">'.$lang['srv_inv_btn_add_recipients_add'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; # id=inv_import_file
}
- echo '</div>'; # id=inv_import_list_container
- echo '<br class="clr"/>';
+ echo '</fieldset>'; # id=inv_import_list_container
}
@@ -852,259 +887,273 @@ class SurveyInvitationsNew {
# vabila z e-maili naredimo tukaj, brez e-mailov pa s podebno funkcijo
if (in_array('inv_field_email',$fields)) {
# vabila z emaili
- $inv_iid = $this->inv_iid;
- # povezava imena polji iz forem, z imeni polji v bazi
- $db_vs_form_array = array(
- 'inv_field_email' => 'email',
- 'inv_field_firstname' => 'firstname',
- 'inv_field_lastname' => 'lastname',
- 'inv_field_password' => 'password',
- 'inv_field_cookie' => 'cookie',
- 'inv_field_salutation' => 'salutation',
- 'inv_field_phone' => 'phone',
- 'inv_field_custom' => 'custom',
- 'inv_field_relation' => 'relation',
- );
-
- #dodamo potrebna sistemska polja
- $this->addSystemVariables($fields);
-
- # dodamo ustrezne uporabnike, neustrezne izpišemo še enkrat da se lahko popravijo
- $_recipients = str_replace("\n\r", "\n", $_recipients);
- $recipients_list = explode("\n",$_recipients);
- $num_recipients_list = count($recipients_list);
-
- # katero polje je za e-mail
- if (in_array('inv_field_email',$fields)) {
- $user_email = true;
- } else {
- #za tip 0 - Personalizirano e-poštno vabilo kjer je polje e-mail obvezno
- # dodamo polje email
- $user_email = true;
- $fields[] = 'inv_field_email';
- }
- # polje cookie mora bit zraven
- if (!in_array('inv_field_cookie',$fields)) {
- $fields[] = 'inv_field_cookie';
- }
+ # povezava imena polji iz forem, z imeni polji v bazi
+ $db_vs_form_array = array(
+ 'inv_field_email' => 'email',
+ 'inv_field_firstname' => 'firstname',
+ 'inv_field_lastname' => 'lastname',
+ 'inv_field_password' => 'password',
+ 'inv_field_cookie' => 'cookie',
+ 'inv_field_salutation' => 'salutation',
+ 'inv_field_phone' => 'phone',
+ 'inv_field_custom' => 'custom',
+ 'inv_field_relation' => 'relation',
+ );
- /* brez preverjanja unikatnosti
- # polovimo že dodane prejemnike iz baze
- $email_in_db = array();
- $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
- $sql_query = sisplet_query($sql_string);
+ #dodamo potrebna sistemska polja
+ $this->addSystemVariables($fields);
- if (mysqli_num_rows($sql_query) > 0 ) {
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $email_in_db[] = strtolower($sql_row['email']);
- }
- }
- */
-
- # katero polje je za password
- if (in_array('inv_field_password',$fields)) {
- $user_password = true;
- } else {
- $user_password = false;
- # dodamo polje password
- $fields[] = 'inv_field_password';
- }
+ # dodamo ustrezne uporabnike, neustrezne izpišemo še enkrat da se lahko popravijo
+ $_recipients = str_replace("\n\r", "\n", $_recipients);
+ $recipients_list = explode("\n",$_recipients);
+ $num_recipients_list = count($recipients_list);
- # polja za bazo
- $db_fields = '';
- foreach ($fields as $field) {
- $db_fields .= ', '.$db_vs_form_array[$field];
- }
+ # katero polje je za e-mail
+ if (in_array('inv_field_email',$fields)) {
+ $user_email = true;
+ }
+ else {
+ #za tip 0 - Personalizirano e-poštno vabilo kjer je polje e-mail obvezno
+ # dodamo polje email
+ $user_email = true;
+ $fields[] = 'inv_field_email';
+ }
- # katera gesla (code) že imamo v bazi za to anketo
- $password_in_db = array();
- $sql_string = "SELECT password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
- $sql_query = sisplet_query($sql_string);
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $password_in_db[$sql_row['password']] = $sql_row['password'];
- }
+ # polje cookie mora bit zraven
+ if (!in_array('inv_field_cookie',$fields)) {
+ $fields[] = 'inv_field_cookie';
+ }
- $unsubscribed = array();
- #polovimo prejemnike ki ne želijo prejemati obvestil
- $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND unsubscribed = '1'";
- $sql_query = sisplet_query($sql_string);
- $unsubscribed = array();
- if (mysqli_num_rows($sql_query) > 0 ) {
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $unsubscribed[] = $sql_row['email'];
- }
- }
+ /* brez preverjanja unikatnosti
+ # polovimo že dodane prejemnike iz baze
+ $email_in_db = array();
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
+ $sql_query = sisplet_query($sql_string);
- #polovimo prejemnike ki ne želijo prejemati obvestil i datoteje srv_survey_unsubscribed
- $condition = (count($unsubscribed) > 0 ) ? " AND email NOT IN('".implode('\',\'',$unsubscribed)."')" : '';
- $sql_string = "SELECT email FROM srv_survey_unsubscribe WHERE ank_id = '".$this->sid."'".$condition;
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0 ) {
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $unsubscribed[] = $sql_row['email'];
- }
- }
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $email_in_db[] = strtolower($sql_row['email']);
+ }
+ }
+ */
- #array z veljavnimi zapisi
- $valid_recipiens_array = array();
- # array z zapisi kjer so napake v geslih
- $invalid_password_array = array();
- #array z zapisi kjer so neveljavna gesla
- $invalid_email_array = array();
- #array z podvojenimi zapisi
- $duplicate_email_array = array();
- #aray z zapisi kjer so uporabniki izbrali da ne želijo prejemat e-mailov
- $unsubscribed_recipiens_array = array();
- if ( $num_recipients_list > 0 ) {
- foreach ($recipients_list AS $recipient_line) {
- $recipient_line = trim($recipient_line);
- if ($recipient_line != null && $recipient_line != '') {
-
-
- // interni delimiter in ne vejicaa!!!!
- $line_array = explode('|~|',$recipient_line);
-
- //$line_array = explode(',',$recipient_line);
- # predpostavljamo da je vrstica vredu
- $invalid_line = false;
-
- #prilagodimo izbrana polja
- $recipent_array = array();
- $i = 0;
- foreach ($fields AS $field) {
- $recipent_array[$field] = $line_array[$i];
- $i++;
- }
-
- # izvedemo validacijo posameznih polij
-
- # najprej preverimo gesla, če niso uporabniško določena, jih dodelimo sami
- if ( $invalid_line == false ) {
- # če še ni bilo napake ( da ne podvajamo zapisov pri katerih je več napak)
- if ($user_password == false) {
- # gesla določamo avtomatsko, (ne bo problemov :] )
-
- # Izberemo random hash, ki se ni v bazi
- do {
- list($code,$cookie) = $this->generateCode();
- #} while (in_array($code,$password_in_db) && !is_numeric($code));
- } while (in_array($code,$password_in_db)); # je bil problem kadar so same številke
- # polje za geslo je na zadnjem mestu (smo ga dodali zgoraj)
- $recipent_array['inv_field_password'] = $code;
- $recipent_array['inv_field_cookie'] = $cookie;
-
- # če je vse ok, geslo dodamo v seznam že uporabljenih
- $password_in_db[$code] = $code;
- } else {
- # gesla je določil uporabnik, (dajmo ga malo preverit)
- $user_password = trim($recipent_array['inv_field_password']);
-
- # preverimo ali je geslo že v bazi
- if ($user_password == null || $user_password == '' || in_array($user_password,$password_in_db)) {
- $invalid_password_array[] = $recipient_line;
- $invalid_line = true;
- }
-
- # če je vse ok, geslo dodamo v seznam že uporabljenih
- if ($invalid_line == false) {
- $password_in_db[$user_password] = $user_password;
- #dodamo še piškotek
- list($code,$cookie) = $this->generateCode();
- $recipent_array['inv_field_cookie'] = $cookie;
- }
- }
- }
-
- # če imamo emaile naredimo validacijo, preverimo zavrnitve.. itd
- if ($user_email == true && $invalid_line == false) {
- # preberemo uporabniški email
- $email_field = trim($recipent_array['inv_field_email']);
-
- #ali je email veljaven
- if (!$this->validEmail($email_field) && $invalid_line == false) {
- $invalid_email_array[] = $recipient_line;
- $invalid_line = true;
- }
-
- # ali je email podvojen
- /* brez preverjanja unikatnosti
- if (in_array(strtolower($email_field),$email_in_db) && $invalid_line == false) {
- $duplicate_email_array[] = strtolower($recipient_line);
- $invalid_line = true;
- }
- */
-
- # ali uporabnik ne želi prejemati sporočil (opted out)
- if (in_array($email_field,$unsubscribed) && $invalid_line == false) {
- $unsubscribed_recipiens_array[] = $recipient_line;
- $invalid_line = true;
- }
-
- # če je vse ok, email dodamo v seznam že uporabljenih
- if ( $invalid_line == false) {
- $email_in_db[] = strtolower($email_field);
- }
- }
- # če je vse ok dodamo userja k veljavnim
- if ( $invalid_line == false) {
- $valid_recipiens_array[] = $recipent_array;
- }
- }
- }
- }
+ # katero polje je za password
+ if (in_array('inv_field_password',$fields)) {
+ $user_password = true;
+ }
+ else {
+ $user_password = false;
+ # dodamo polje password
+ $fields[] = 'inv_field_password';
+ }
- if ($new_profile_id == null) {
- $list_id = (int)$_POST['pid'];
- } else {
- $list_id = $new_profile_id;
- }
+ # polja za bazo
+ $db_fields = '';
+ foreach ($fields as $field) {
+ $db_fields .= ', '.$db_vs_form_array[$field];
+ }
- # pripravimo sql stavek za vstavljanje
- if (count($valid_recipiens_array ) > 0) {
- $sql_insert_start = "INSERT INTO srv_invitations_recipients (ank_id".$db_fields.",sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id) VALUES ";
- $count = 0;
-
- $sql_insert_array = array();
- $cnt = 0;
- $max_in_array = 1000; # po koliko respondentov dodajamo naenkeat
- $array_loop = 0;
- foreach ( $valid_recipiens_array AS $recipent_fields) {
- $cnt++;
- $sql_insert = "('".$this->sid."'";
- foreach ($recipent_fields as $field) {
- $sql_insert .= ", '" .str_replace (array('\\', "'"), array('', '&#39;'), $field) ."'";
- }
- $sql_insert .= ",'0','0','0','0',NOW(),'".$global_user_id."','".$list_id."')";
- $sql_insert_array[$array_loop][] = $sql_insert;
- if ($cnt >= $max_in_array) {
- $array_loop++;
- $cnt = 0;
- }
- }
- $sql_insert_end = " ON DUPLICATE KEY UPDATE firstname=VALUES(firstname), lastname=VALUES(lastname), salutation=VALUES(salutation), phone=VALUES(phone), custom=VALUES(custom), relation=VALUES(relation), deleted='0', date_inserted=NOW()";
+ # katera gesla (code) že imamo v bazi za to anketo
+ $password_in_db = array();
+ $sql_string = "SELECT password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $password_in_db[$sql_row['password']] = $sql_row['password'];
+ }
+
+ $unsubscribed = array();
+ #polovimo prejemnike ki ne želijo prejemati obvestil
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND unsubscribed = '1'";
+ $sql_query = sisplet_query($sql_string);
+ $unsubscribed = array();
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $unsubscribed[] = $sql_row['email'];
+ }
+ }
- # v loopu dodamo posamezne respondente po skupinah (ker kadar je respondentov veliko mysql crkne)
- if (count($sql_insert_array) > 0) {
+ #polovimo prejemnike ki ne želijo prejemati obvestil i datoteje srv_survey_unsubscribed
+ $condition = (count($unsubscribed) > 0 ) ? " AND email NOT IN('".implode('\',\'',$unsubscribed)."')" : '';
+ $sql_string = "SELECT email FROM srv_survey_unsubscribe WHERE ank_id = '".$this->sid."'".$condition;
+ $sql_query = sisplet_query($sql_string);
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $unsubscribed[] = $sql_row['email'];
+ }
+ }
- foreach ($sql_insert_array AS $sub_insert_array) {
- $query_insert = $sql_insert_start. implode(',',$sub_insert_array) .$sql_insert_end;
- $sqlQuery = sisplet_query($query_insert);
- $rows = mysqli_affected_rows($GLOBALS['connect_db']);
- if (!$sqlQuery) {
- $error = mysqli_error($GLOBALS['connect_db']);
- }
- }
- sisplet_query("COMMIT");
+ #array z veljavnimi zapisi
+ $valid_recipiens_array = array();
+ # array z zapisi kjer so napake v geslih
+ $invalid_password_array = array();
+ #array z zapisi kjer so neveljavna gesla
+ $invalid_email_array = array();
+ #array z podvojenimi zapisi
+ $duplicate_email_array = array();
+ #aray z zapisi kjer so uporabniki izbrali da ne želijo prejemat e-mailov
+ $unsubscribed_recipiens_array = array();
- }
- }
- return array( 'valid_recipiens' => $valid_recipiens_array,
- 'invalid_password' => $invalid_password_array,
- 'invalid_email' => $invalid_email_array,
- 'duplicate_email' => $duplicate_email_array,
- 'unsubscribed' => $unsubscribed_recipiens_array);
- } else {
+ if ( $num_recipients_list > 0 ) {
+
+ foreach ($recipients_list AS $recipient_line) {
+ $recipient_line = trim($recipient_line);
+
+ if ($recipient_line != null && $recipient_line != '') {
+
+ // interni delimiter in ne vejicaa!!!!
+ $line_array = explode('|~|',$recipient_line);
+
+ //$line_array = explode(',',$recipient_line);
+ # predpostavljamo da je vrstica vredu
+ $invalid_line = false;
+
+ #prilagodimo izbrana polja
+ $recipent_array = array();
+ $i = 0;
+ foreach ($fields AS $field) {
+ $recipent_array[$field] = isset($line_array[$i]) ? $line_array[$i] : '';
+
+ $i++;
+ }
+
+ # izvedemo validacijo posameznih polij
+
+ # najprej preverimo gesla, če niso uporabniško določena, jih dodelimo sami
+ if ( $invalid_line == false ) {
+
+ # če še ni bilo napake ( da ne podvajamo zapisov pri katerih je več napak)
+ if ($user_password == false) {
+ # gesla določamo avtomatsko, (ne bo problemov :] )
+
+ # Izberemo random hash, ki se ni v bazi
+ do {
+ list($code,$cookie) = $this->generateCode();
+ #} while (in_array($code,$password_in_db) && !is_numeric($code));
+ }
+ while (in_array($code,$password_in_db)); # je bil problem kadar so same številke
+
+ # polje za geslo je na zadnjem mestu (smo ga dodali zgoraj)
+ $recipent_array['inv_field_password'] = $code;
+ $recipent_array['inv_field_cookie'] = $cookie;
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ $password_in_db[$code] = $code;
+ }
+ else {
+ # gesla je določil uporabnik, (dajmo ga malo preverit)
+ $user_password = trim($recipent_array['inv_field_password']);
+
+ # preverimo ali je geslo že v bazi
+ if ($user_password == null || $user_password == '' || in_array($user_password,$password_in_db)) {
+ $invalid_password_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ if ($invalid_line == false) {
+ $password_in_db[$user_password] = $user_password;
+ #dodamo še piškotek
+ list($code,$cookie) = $this->generateCode();
+ $recipent_array['inv_field_cookie'] = $cookie;
+ }
+ }
+ }
+
+ # če imamo emaile naredimo validacijo, preverimo zavrnitve.. itd
+ if ($user_email == true && $invalid_line == false) {
+ # preberemo uporabniški email
+ $email_field = trim($recipent_array['inv_field_email']);
+
+ #ali je email veljaven
+ if (!$this->validEmail($email_field) && $invalid_line == false) {
+ $invalid_email_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # ali je email podvojen
+ /* brez preverjanja unikatnosti
+ if (in_array(strtolower($email_field),$email_in_db) && $invalid_line == false) {
+ $duplicate_email_array[] = strtolower($recipient_line);
+ $invalid_line = true;
+ }
+ */
+
+ # ali uporabnik ne želi prejemati sporočil (opted out)
+ if (in_array($email_field,$unsubscribed) && $invalid_line == false) {
+ $unsubscribed_recipiens_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, email dodamo v seznam že uporabljenih
+ if ( $invalid_line == false) {
+ $email_in_db[] = strtolower($email_field);
+ }
+ }
+
+ # če je vse ok dodamo userja k veljavnim
+ if ( $invalid_line == false) {
+ $valid_recipiens_array[] = $recipent_array;
+ }
+ }
+ }
+ }
+
+ if ($new_profile_id == null) {
+ $list_id = (int)$_POST['pid'];
+ }
+ else {
+ $list_id = $new_profile_id;
+ }
+
+ # pripravimo sql stavek za vstavljanje
+ if (count($valid_recipiens_array ) > 0) {
+ $sql_insert_start = "INSERT INTO srv_invitations_recipients (ank_id".$db_fields.",sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id) VALUES ";
+ $count = 0;
+
+ $sql_insert_array = array();
+ $cnt = 0;
+ $max_in_array = 1000; # po koliko respondentov dodajamo naenkeat
+ $array_loop = 0;
+ foreach ( $valid_recipiens_array AS $recipent_fields) {
+ $cnt++;
+ $sql_insert = "('".$this->sid."'";
+
+ foreach ($recipent_fields as $field) {
+ $sql_insert .= ", '" .str_replace (array('\\', "'"), array('', '&#39;'), $field) ."'";
+ }
+
+ $sql_insert .= ",'0','0','0','0',NOW(),'".$global_user_id."','".$list_id."')";
+ $sql_insert_array[$array_loop][] = $sql_insert;
+
+ if ($cnt >= $max_in_array) {
+ $array_loop++;
+ $cnt = 0;
+ }
+ }
+ $sql_insert_end = " ON DUPLICATE KEY UPDATE firstname=VALUES(firstname), lastname=VALUES(lastname), salutation=VALUES(salutation), phone=VALUES(phone), custom=VALUES(custom), relation=VALUES(relation), deleted='0', date_inserted=NOW()";
+
+ # v loopu dodamo posamezne respondente po skupinah (ker kadar je respondentov veliko mysql crkne)
+ if (count($sql_insert_array) > 0) {
+
+ foreach ($sql_insert_array AS $sub_insert_array) {
+ $query_insert = $sql_insert_start. implode(',',$sub_insert_array) .$sql_insert_end;
+ $sqlQuery = sisplet_query($query_insert);
+ $rows = mysqli_affected_rows($GLOBALS['connect_db']);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ sisplet_query("COMMIT");
+ }
+ }
+ return array( 'valid_recipiens' => $valid_recipiens_array,
+ 'invalid_password' => $invalid_password_array,
+ 'invalid_email' => $invalid_email_array,
+ 'duplicate_email' => $duplicate_email_array,
+ 'unsubscribed' => $unsubscribed_recipiens_array);
+ }
+ else {
# vabila brez emailov
return $this->addMassRecipientsWithoutEmail($_recipients, $fields, $new_profile_id);
}
@@ -1114,8 +1163,6 @@ class SurveyInvitationsNew {
function addMassRecipientsWithoutEmail($_recipients='', $fields=array(), $new_profile_id=null) {
global $global_user_id;
- $inv_iid = $this->inv_iid;
-
# povezava imena polji iz forem, z imeni polji v bazi
$db_vs_form_array = array(
'inv_field_email' => 'email',
@@ -1375,15 +1422,16 @@ class SurveyInvitationsNew {
#preglej prejemnike
function viewRecipients($errors = array(), $msgs = array()) {
- global $lang, $site_url, $admin_type;
+ global $lang, $site_url, $admin_type, $site_domain;
$noEmailing = SurveySession::get('inv_noEmailing');
$row = $this->surveySettings;
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+ echo '<div class="invitations_top_settings">';
+
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
@@ -1419,17 +1467,19 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
echo $settings_text;
- echo '</h2>';
+
+ echo '</div>';
+
#polovimo prejemnike ki ne želijo prejemati obvestil
-
+ $mysql_filter = '';
# nastavimo filter
session_start();
- $filter_duplicated = $_SESSION['inv_filter']['duplicated'];
- $filter = $_SESSION['inv_filter']['value'];
+ $filter_duplicated = isset($_SESSION['inv_filter']['duplicated']) ? $_SESSION['inv_filter']['duplicated'] : false;
+ $filter = isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value'] : '';
if ($filter != '') {
$mysql_filter = " AND ("
. "i.email LIKE '%".$filter."%'"
@@ -1504,7 +1554,7 @@ class SurveyInvitationsNew {
// Volitve nimajo nekaterih polj
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
- $default_fields['responded'] = 1;
+ //$default_fields['responded'] = 1;
$default_fields['unsubscribed'] = 1;
$default_fields['password'] = 1;
}
@@ -1516,10 +1566,11 @@ class SurveyInvitationsNew {
# pogledamo katera polja dejansko prikazujemo
$sql_select_fields = array();
+ $fields = array();
while ($sql_row = mysqli_fetch_assoc($sql_query_filterd_all)) {
foreach ($default_fields AS $key => $value) {
# če polje še ni dodano in če ni prazno, ga dodamo
- if ($fields[$key] == 0 && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
+ if ((!isset($fields[$key]) || $fields[$key] == 0) && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
$fields[$key] = 1;
$sql_select_fields[] = 'i.'.$key;
}
@@ -1642,157 +1693,174 @@ class SurveyInvitationsNew {
echo '</span>';
}
- if ($count_all > 0 ) {
- # dodamo filtriranje
+ # dodamo filtriranje
+ if ($count_all > 0 ) {
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 '&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>';
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_value">'.$lang['srv_invitation_recipients_filter'].'</label><input id="inv_rec_filter_value" class="small" type="text" onchange="inv_filter_recipients(); return false;" value="'.(isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value']:'').'">';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <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 ' <label for="inv_rec_filter_on">'.$lang['srv_invitation_recipients_filter_advanced'].'</label>';
+ echo '</div>';
if (isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ) {
- echo '&nbsp;';
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_sent'];
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_send">'.$lang['srv_invitation_recipients_filter_sent'].'</label>';
$selected = (int)(isset($_SESSION['inv_filter']['send']) ? (int)$_SESSION['inv_filter']['send'] : 0);
- echo ' <select id="inv_rec_filter_send" onchange="inv_filter_recipients();">';
- echo '<option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
- echo '<option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
- echo '<option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
- echo '</select></label>';
-
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_answered'];
+ echo ' <select id="inv_rec_filter_send" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_respondet">'.$lang['srv_invitation_recipients_filter_answered'].'</label>';
$selected = (int)(isset($_SESSION['inv_filter']['respondet']) ? (int)$_SESSION['inv_filter']['respondet'] : 0);
- echo ' <select id="inv_rec_filter_respondet" onchange="inv_filter_recipients();">';
- echo '<option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
- echo '<option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
- echo '<option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
- echo '</select></label>';
-
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_unsubscribed'];
+ echo ' <select id="inv_rec_filter_respondet" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_unsubscribed">'.$lang['srv_invitation_recipients_filter_unsubscribed'].'</label>';
$selected = (int)(isset($_SESSION['inv_filter']['unsubscribed']) ? (int)$_SESSION['inv_filter']['unsubscribed'] : 0);
- echo ' <select id="inv_rec_filter_unsubscribed" onchange="inv_filter_recipients();">';
- echo '<option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
- echo '<option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
- echo '<option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
- echo '</select></label>';
-
+ echo ' <select id="inv_rec_filter_unsubscribed" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
$this->listCondition();
$this->advancedCondition();
}
-
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">';
- echo '<br class="clr"/>';
if ($filter != '') {
- echo '<span class="red strong">';
- printf($lang['srv_inv_list_no_recipients_filter'],$filter);
- #Podatki so filtrirani: "'.$filter.'"<br/>';
- echo '</span>';
+ echo '<div class="filter_note">';
+ printf($lang['srv_inv_list_no_recipients_filter'], $filter);
+ echo '</div>';
}
+
+ echo '<div id="srv_invitation_note">';
+
if ($count_all > 0 && mysqli_num_rows($sql_query_filterd) != $count_all ) {
- echo '<div id="srv_invitation_note" class="floatLeft spaceRight">';
- echo $lang['srv_invitation_num_respondents_filtred'].(int)mysqli_num_rows($sql_query_filterd);
- echo '</div>';
- } else {
- echo '<div id="srv_invitation_note" class="floatLeft spaceRight">';
- echo $lang['srv_invitation_num_respondents'].(int)$this->count_all;
- echo '</div>';
+ echo '<span>'.$lang['srv_invitation_num_respondents_filtred'].(int)mysqli_num_rows($sql_query_filterd).'</span>';
+ }
+ else {
+ echo '<span>'.$lang['srv_invitation_num_respondents'].(int)$this->count_all.'</span>';
}
+ # duplicated
+ echo '<input type="checkbox" id="inv_rec_filter_duplicates" onchange="inv_filter_recipients(); return false" '. ($filter_duplicated ?' checked="checked"':'') .'><label for="inv_rec_filter_duplicates">'.$lang['srv_inv_recipient_show_only_duplicates'] .'</label>';
+
+ echo '</div>';
-
- # duplicated
- echo '<label><input type="checkbox" id="inv_rec_filter_duplicates" onchange="inv_filter_recipients(); return false" '. ($filter_duplicated ?' checked="checked"':'') .'>' . $lang['srv_inv_recipient_show_only_duplicates'] .'</label><br class="clr"/>';
if (mysqli_num_rows($sql_query_filterd) > 0 && $count_all > 0) {
-
- echo '<br class="clr"/>';
-
+
$this->displayPagination($filtred_all);
-
- echo '<br class="clr"/>';
-
-
- echo '<div style="display:inline-block; margin-right: 20px;">';
-
- # če že imamo prejemnike v bazi več kot 20 ponudimo gumb naprej tudi zgoraj
- if ($this->count_all > 20) {
- echo '<span class="buttonwrapper floatRight spaceLeft" style="margin-bottom:10px;"><a class="ovalbutton ovalbutton_orange" href="'.$this->addUrl('view_message').'"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- }
-
+
// Izvoz vseh v excel
- echo '<span class="floatLeft" style="line-height:45px; padding-left:10px;">';
- echo '<a onclick="inv_recipients_form_action(\'export_all\');" href="#">';
- echo '<span class="faicon xls" title="'.$lang['srv_invitation_recipients_export_all'].'" style="height:14px; width:16px;"></span>';
- echo ' '.$lang['srv_invitation_recipients_export_all'];
- echo '</a>';
- echo '</span>';
+ echo '<div class="excel_export">';
+ echo ' <a href="#" class="noline" title="'.$lang['srv_invitation_recipients_export_all'].'" onclick="inv_recipients_form_action(\'export_all\');">';
+ echo ' <span class="faicon xls"></span>'.$lang['srv_invitation_recipients_export_all'];
+ echo ' </a>';
+ echo '</div>';
+
+ // Izvoz QR kod za NIJZ
+ if($site_domain == 'anketa.nijz.si'){
+ echo '<div class="excel_export" style="margin: 16px 0;">';
+ echo ' <a href="#" class="noline" onclick="inv_recipients_form_action(\'export_qr_codes\');" >';
+ echo $lang['srv_invitation_recipients_export_qr'];
+ echo ' </a>';
+ echo '</div>';
+ }
+ echo '<div class="table_holder">';
+
echo '<table id="tbl_recipients_list">';
echo '<tr>';
+
# checkbox
- echo '<th class="tbl_icon" colspan="'.($this->surveySettings['show_email']==1?'4':'3').'" >&nbsp;</th>';
+ echo '<th class="tbl_icon" colspan="'.($this->surveySettings['show_email'] == 1 ? '4' : '3').'">';
+ echo ' <input type="checkbox" id="inv_switch" onClick="inv_selectAll(this);"><label for="inv_switch"></label>';
+ echo '</th>';
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
- if ($fkey == 'sent' || $fkey == 'responded' || $fkey == 'unsubscribed' ) {
- #echo '<th class="anl_ac tbl_icon_'.$fkey.' inv_'.$fkey.'_1" title="'.$lang['srv_inv_recipients_'.$fkey].'">&nbsp;</th>';
+
+ if ($fkey == 'sent' || $fkey == 'responded' || $fkey == 'unsubscribed' ) {
echo '<th'.$this->addSortField($fkey).' class="anl_ac pointer tbl_icon_'.$fkey.'" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
- } else if ($fkey == 'last_status' ) {
+ }
+ else if ($fkey == 'last_status' ) {
echo '<th'.$this->addSortField($fkey).' class="anl_ac pointer" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
- } else {
+ }
+ else {
echo '<th'.$this->addSortField($fkey).' class="pointer" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
}
}
}
echo '</tr>';
+
while ($sql_row = mysqli_fetch_assoc($sql_query_filterd)) {
echo '<tr>';
- # checkbox
-
- echo '<td><input type="checkbox" name="inv_rids[]" value="'.$sql_row['id'].'"></td>';
- #izbriši
- #echo '<td class="tbl_inv_left"><span class="as_link rec_delete_confirm" inv_rid="'.$sql_row['id'].'">'.$lang['srv_inv_list_profiles_delete'].'</span></td>';
- echo '<td class="tbl_inv_left"><span class="faicon delete_circle icon-orange_link" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span></td>';
- #uredi
- #echo '<td class="tbl_inv_left"><span class="as_link rec_edit" inv_rid="'.$sql_row['id'].'">'.$lang['srv_inv_list_profiles_edit'].'</span></td>';
- echo '<td class="tbl_inv_left"><span class="faicon edit smaller icon-as_link" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span></td>';
+
+
+ echo '<td colspan="3">';
+
+ # checkbox
+ echo '<input type="checkbox" id="inv_rids'.$sql_row['id'].'" name="inv_rids[]" value="'.$sql_row['id'].'"><label for="inv_rids'.$sql_row['id'].'"></label>';
+
+ #izbriši
+ echo '<span class="faicon delete" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
+ #uredi
+ echo '<span class="faicon edit" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span>';
+
+ echo '</td>';
+
+
// Skoci na urejanje odgovorov - ce imamo identifikatorje povezane s podatki
if($this->surveySettings['show_email'] == 1)
- echo '<td class="tbl_inv_left"><span class="icon-grey_dark_link" onclick="window.open(\''.$site_url.'/main/survey/edit_anketa.php?anketa='.$this->sid.'&usr_id='.$sql_row['id'].'&code='.$sql_row['password'].'\', \'blank\')" title="'.$lang['srv_edit_data_row'].'"></span></td>';
+ echo '<td class="tbl_inv_left"><span class="icon-grey_dark_link" onclick="window.open(\''.$site_url.'/main/survey/edit_anketa.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&usr_id='.$sql_row['id'].'&code='.$sql_row['password'].'\', \'blank\')" title="'.$lang['srv_edit_data_row'].'"></span></td>';
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
switch ($fkey) {
case 'sent':
- echo '<td class="anl_ac pointer" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
- echo '<span class="faicon '.((int)$sql_row['sent'] == 1 ? ('inv_sent_1') : 'inv_sent_0').' icon-as_link" title="'.((int)$sql_row['sent'] == 1 ? $lang['sent'] : $lang['not_sent']).'"></span>';
+ echo '<td class="pointer" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
+ echo ((int)$sql_row['sent'] == 1 ? $lang['sent'] : $lang['not_sent']);
echo '</td>';
break;
case 'responded':
- echo '<td class="anl_ac">';
+ echo '<td class="">';
echo '<span class="faicon '.((int)$sql_row['responded'] == 1 ? ('inv_responded_1') : 'inv_responded_0').' icon-orange"></span>';
echo '</td>';
break;
case 'unsubscribed':
- echo '<td class="anl_ac ">';
- echo '<span class="faicon '.((int)$sql_row['unsubscribed'] == 1 ? ('inv_unsubscribed_1') : 'inv_unsubscribed_0').'"></span>';
+ echo '<td class="">';
+ echo ((int)$sql_row['unsubscribed'] == 1 ? $lang['unsubscribed'] : $lang['not_unsubscribed']);
echo '</td>';
break;
case 'last_status':
@@ -1837,37 +1905,48 @@ class SurveyInvitationsNew {
}
}
+
echo '</tr>';
+
@ob_flush();
}
+
echo '</table>';
+
+ echo '</div>';
+
echo '<div id="inv_bottom_edit">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="inv_switch_on"><a href="javascript:inv_selectAll(true);">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="inv_switch_off" style="display:none;"><a href="javascript:inv_selectAll(false);">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_invitation_recipients_delete_selected'].'"></span>&nbsp;'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'export\');"><span class="faicon xls delete" style="height:14px; width:16px;" title="'.$lang['srv_invitation_recipients_export_selected'].'"></span>&nbsp;'.$lang['srv_invitation_recipients_export_selected'].'</a>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'add\');">&nbsp;'.$lang['srv_invitation_recipients_activate3'].'</a>';
+
+ echo '<div class="bottom_actions">';
+ echo ' <a href="#" class="noline" class="noline" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon delete" title="'.$lang['srv_invitation_recipients_delete_selected'].'"></span>'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
+ echo ' <a href="#" class="noline" onClick="inv_recipients_form_action(\'export\');"><span class="faicon xls" title="'.$lang['srv_invitation_recipients_export_selected'].'"></span>'.$lang['srv_invitation_recipients_export_selected'].'</a>';
+ echo ' <a href="#" class="noline" onClick="inv_recipients_form_action(\'add\');">'.$lang['srv_invitation_recipients_activate3'].'</a>';
+ echo '</div>';
// Aktivira vse v seznamu (jih doda v podatke, kot da so poslani)
- echo '<br /><span style="line-height:40px;"><a href="#" onclick="inv_add_rec_to_db(); return false;" target="_blank">'.$lang['srv_invitation_recipients_activate2'].'</a></span>';
+ echo '<div class="bottom_activate">';
+ echo ' <a href="#" class="noline" onclick="inv_add_rec_to_db(); return false;" target="_blank">'.$lang['srv_invitation_recipients_activate2'].'</a>';
+ echo '</div>';
echo '</div>';
+
# če že imamo prejemnike v bazi ponudimo gumb naprej
if ($count_all > 0) {
- echo '<div class="buttonwrapper floatRight spaceLeft" style="margin-top:-30px;"><a class="ovalbutton ovalbutton_orange" href="'.$this->addUrl('view_message').'"><span>'.$lang['srv_invitation_forward'].'</span></a></div>';
- echo '<br class="clr"/><br>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <a href="'.$this->addUrl('view_message').'"><button type="button" class="medium blue">'.$lang['srv_invitation_forward'].'</div></a>';
+ echo '</div>';
}
- echo '</div>';
-
- } else {
- echo $lang['srv_inv_list_no_recipients_filtred'].'<br class="clr">';
}
+ else {
+ echo '<span class="search_count">'.$lang['srv_inv_list_no_recipients_filtred'].'</span>';
+ }
+
echo '</form>';
- } else {
- echo $lang['srv_inv_list_no_recipients'].'<br class="clr">';
+ }
+ else {
+ echo '<span>'.$lang['srv_inv_list_no_recipients'].'</span>';
}
}
@@ -1876,28 +1955,28 @@ class SurveyInvitationsNew {
$row = $this->surveySettings;
-
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+
+ echo '<div class="invitations_top_settings">';
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span class="semi-bold">'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_1'].'</span>';
}
$settings_text .= ' - ';
$noEmailing = SurveySession::get('inv_noEmailing');
if($noEmailing == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_1'].'</span>';
}
$settings_text .= ' - ';
@@ -1917,25 +1996,23 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
echo $settings_text;
+
+ echo '</div>';
- //echo '<span style="padding-left:15px; padding-right:15px;"><input type="radio" name="inv_messages_noEmailing" id="inv_messages_noEmailing_1" '.($noEmailing == 0 ? ' checked="checked"' : '').' style="margin-bottom:4px;" onClick="noEmailingToggle(\'0\');" /> <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_0'].'</label></span>';
- //echo '<span><input type="radio" name="inv_messages_noEmailing" id="inv_messages_noEmailing_2" '.($noEmailing == 1 ? ' checked="checked"' : '').' style="margin-bottom:4px;" onClick="noEmailingToggle(\'1\');" /> <label for="inv_messages_noEmailing_2">'.$lang['srv_inv_message_noemailing_1'].'</label></span>';
-
- echo '</h2>';
-
-
+
// Ce posiljamo preko emaila
if($noEmailing != 1){
- echo '<div id="inv_messages_holder">';
+ echo '<div id="inv_messages_holder" class="invitations_holder three-part invitations_message">';
if ($this->checkDefaultMessage() == false) {
echo '<span class="inv_error_note">';
echo $lang['srv_invitation_note6'];
echo '</span>';
- } else {
+ }
+ else {
$sql_string = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
$sql_query = sisplet_query($sql_string);
$array_messages = array();
@@ -1950,135 +2027,173 @@ class SurveyInvitationsNew {
}
$preview_message = $array_messages[$mid];
- echo '<div id="inv_messages_profiles_holder" class="floatLeft">';
+
+ echo '<fieldset id="inv_messages_profiles_holder" class="left_holder">';
+
echo '<span>'.$lang['srv_invitation_message_choose'].':</span><br/>';
- echo '<div id="invitation_messages" >';
+
+
+ echo '<div id="invitation_messages" >';
+
echo '<ol>';
foreach ($array_messages AS $_m => $message) {
- echo '<li mid="'.$message['id'].'" class="'
- .($message['id'] == $mid ? ' active' : '')
- .'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+ echo '<li mid="'.$message['id'].'" class="'.($message['id'] == $mid ? ' active' : '').'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
echo $message['naslov'];
+
+ if($message['id'] == $mid){
+
+ echo '<div class="icons">';
+
+ if (count($array_messages) > 1)
+ echo '<span class="faicon delete_circle" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'"></span>';
+
+ echo '<span class="faicon edit" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'"></span>';
+
+ echo '</div>';
+ }
+
echo '</li>';
}
echo '</ol>';
+
echo '</div>'; #invitation_messages
- echo '<br class="clr" />';
- if (count($array_messages) > 1) {
- echo '<span class="as_link" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'">'.$lang['srv_inv_message_delete_profile'].'</span><br/>';
- }
- echo '<span class="as_link" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'">'.$lang['srv_inv_message_rename_profile'].'</span>';
- {
- # polovimo podatke profila
- $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
- $sql_query = sisplet_query($sql_string);
- $sql_row = mysqli_fetch_assoc($sql_query);
+
+
+ # polovimo podatke profila
+ $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ $edit = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
- $avtor = array();
- $edit = array();
- if (trim($sql_row['name'])) {
- $avtor[] = trim ($sql_row['name']);
- }
- if (trim($sql_row['surname'])) {
- $avtor[] = trim ($sql_row['surname']);
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray">'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
- if (trim($sql_row['ename'])) {
- $edit[] = trim ($sql_row['ename']);
- }
- if (trim($sql_row['esurname'])) {
- $edit[] = trim ($sql_row['esurname']);
- }
+ echo '<div class="info">';
- if ( count($edit) > 0 && $edit != $avtor) {
- echo '<div class="gray">'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
- }
- if ($sql_row['insert_time'] != $sql_row['edit_time']) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
-
- echo '<div class="gray" style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
- }
-
- echo '</div>'; #inv_messages_profiles_holder
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ if (trim($sql_row['ename'])) {
+ $edit[] = trim ($sql_row['ename']);
+ }
+ if (trim($sql_row['esurname'])) {
+ $edit[] = trim ($sql_row['esurname']);
+ }
+
+ if ( count($edit) > 0 && $edit != $avtor) {
+ echo '<div>'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
+ }
+ if ($sql_row['insert_time'] != $sql_row['edit_time']) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+
+ echo '<div style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
+
+ echo '</div>';
+
+
+ echo '</fieldset>'; #inv_messages_profiles_holder
+
$MA = new MailAdapter($this->sid, $type='invitation');
+
# zlistamo seznam vseh sporočil
# izpišemo primer besedila
- echo '<div id="inv_msg_preview_hld" class="floatLeft">';
- echo '<span class="h2 spaceRight floatLeft">'.$lang['srv_inv_message_draft_content_heading'].'</span> '.Help::display('srv_inv_message_title');
+ echo '<fieldset id="inv_msg_preview_hld" class="middle">';
+
+ echo '<legend>'.$lang['message'].' '.Help::display('srv_inv_message_title').'</legend>';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
+
- //echo '<span class="spaceRight floatRight"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_server&show_back=true">'.$lang['srv_inv_message_draft_settings'].'</a></span>';
- echo '<br class="clr"/>';
- echo '<div id="inv_error_note" class="hidden"></div>';
echo '<div id="inv_msg_preview">';
- echo '<table>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_from'].':</th>';
- echo '<td class="inv_bt">';
+
+
+ echo '<div class="setting_row">';
+
+ echo ' <div class="setting_item">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_from'].':</label>';
if($MA->getMailFrom() == '')
- echo '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a>';
+ echo ' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a>';
else
echo $MA->getMailFrom();
- echo '<input type="hidden" id="inv_message_replyto" value="'.$MA->getMailFrom().'" autocomplete="off" readonly>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_reply'].':</th>';
- echo '<td class="inv_bt">';
+ echo ' <input type="hidden" id="inv_message_replyto" value="'.$MA->getMailFrom().'" autocomplete="off" readonly>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_reply'].':</label>';
echo $MA->getMailReplyTo();
- echo '<input type="hidden" id="inv_message_replyto" value="'.$MA->getMailReplyTo().'" autocomplete="off" readonly>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_subject'].':</th>';
- echo '<td class="inv_bt">';
- echo '<input type="text" id="inv_message_subject" value="'.$preview_message['subject_text'].'" autocomplete="off">';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
- echo '<td ><div class="msgBody">';
- echo '<textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo ' <input type="hidden" id="inv_message_replyto" value="'.$MA->getMailReplyTo().'" autocomplete="off" readonly>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <input type="text" id="inv_message_subject" class="medium" value="'.$preview_message['subject_text'].'" autocomplete="off">';
echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo '</div>';
+
?>
- <script type="text/javascript">
- create_inv_editor('inv_message_body', false);
- </script><?php
- echo '</td></tr>';
+ <script type="text/javascript"> create_editor('inv_message_body', false); </script>
+ <?php
+
$urls = $this->getUrlLists();
-
if (count($urls) > 0) {
- echo '<tr><th>'.$lang['srv_inv_message_draft_url'].'</th>';
- echo '<td>';
- echo '<select id="inv_message_url">';
+
+ echo '<div class="setting_item">';
+
+ echo '<label>'.$lang['srv_inv_message_draft_url'].'</label>';
+
+ echo '<select id="inv_message_url" class="dropdown medium">';
foreach ($urls AS $url) {
- $selected = '';
+ $selected = '';
if ($preview_message['url'] == '') {
- if ($preview_message['dc'] == true) {
- $selected = ' selected="selected"';
+ if (isset($preview_message['dc']) && $preview_message['dc'] == true) {
+ $selected = ' selected="selected"';
}
} else if ($preview_message['url'] == $url['url']) {
- $selected = ' selected="selected"';
+ $selected = ' selected="selected"';
}
echo '<option value="'.$url['url'].'"'.$selected.'>'.$url['name'].'</option>';
}
echo '</select>';
- echo '</td>';
- echo '</tr>';
+
+ echo '</div>';
}
- echo '</table>';
+
echo '</div>';
- echo '<br class="clr"/>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton" href="#" onclick="inv_message_save_forward(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="if(inv_message_save_simple(\''.$mid.'\')) { window.location.reload() }; return false;"><span>'.$lang['srv_inv_message_save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_message_saveNew'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_message_saveNew'].'</span></a></span>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['srv_invitation_message_saveNew'].'" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;">'.$lang['srv_invitation_message_saveNew'].'</button>';
+ echo ' <button class="white-blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="if(inv_message_save_simple(\''.$mid.'\')) { window.location.reload() }; return false;">'.$lang['srv_inv_message_save'].'</button>';
+ echo ' <button class="blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="inv_message_save_forward(\''.$mid.'\'); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
- echo '</div>';
+ echo '</fieldset>';
+
- echo '<div id="invitation_profile_notes"><p>';
+ echo '<fieldset id="invitation_profile_notes" class="right_holder">';
+ echo '<p class="semi-bold caps">'.$lang['srv_inv_message_help_title'].'</p>';
+
$_indicators = $this->getAvailableIndicators();
$_sysVars = $this->getAvailableSysVars();
@@ -2090,7 +2205,11 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_message_help_identifikators'];
foreach ($_indicators AS $_identifikator) {
- echo $prefix.'<br/>#'.strtoupper($_identifikator).'#'.$lang['srv_inv_message_help_system_'.strtolower($_identifikator)];
+ echo $prefix.'<br/>#'.strtoupper($_identifikator).'#';
+
+ if(isset($lang['srv_inv_message_help_system_'.strtolower($_identifikator)]))
+ echo $lang['srv_inv_message_help_system_'.strtolower($_identifikator)];
+
$prefix = ', ';
}
@@ -2109,46 +2228,27 @@ class SurveyInvitationsNew {
echo $lang['srv_invitation_note12'];
}
- echo '</p></div>';
+ echo '</fieldset>';
}
echo '</div>';
}
// Ce samo dokumentiramo - navadna posta, SMS...
else{
- echo '<div id="inv_messages_holder_noEmailing">';
-
- echo $lang['srv_inv_message_noemailing_text'];
-
- // Izbira nacina posiljanja (navadna posta, sms...) - prestavljeno pod nastavitve
- /*echo '<div id="inv_select_noMail_type">';
-
- $noEmailingType = SurveySession::get('inv_noEmailing_type');
- echo '<span class="bold">'.$lang['srv_inv_message_noemailing_type'].':</span>';
-
- echo '<span class="inv_send_span spaceLeft"><input name="noMailType" id="noMailType1" value="0" type="radio" '.($noEmailingType == 0 ? ' checked="checked"' : '').' onClick="noEmailingType(\'0\');"><label for="noMailType1">' . $lang['srv_inv_message_noemailing_type1'] . '</label></span>';
- echo '<span class="inv_send_span spaceLeft"><input name="noMailType" id="noMailType2" value="1" type="radio" '.($noEmailingType == 1 ? ' checked="checked"' : '').' onClick="noEmailingType(\'1\');"><label for="noMailType2">' . $lang['srv_inv_message_noemailing_type2'] . '</label></span>';
- echo '<span class="inv_send_span spaceLeft"><input name="noMailType" id="noMailType3" value="2" type="radio" '.($noEmailingType == 2 ? ' checked="checked"' : '').' onClick="noEmailingType(\'2\');"><label for="noMailType3">' . $lang['srv_inv_message_noemailing_type3'] . '</label></span>';
-
- echo '</div>';*/
- // Gumb naprej
- /*echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'">';
- echo '<a class="ovalbutton ovalbutton_orange" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_message&noemailing=1"><span>'.$lang['srv_invitation_forward'];
- echo '</span></a></span>';
-
- echo '<br class="clr"/>';*/
-
+ echo '<div id="inv_messages_holder_noEmailing">';
+ echo $lang['srv_inv_message_noemailing_text'];
echo '</div>';
-
-
- echo '<div id="inv_messages_holder">';
+
+
+ echo '<div id="inv_messages_holder" class="invitations_holder left-menu invitations_message">';
if ($this->checkDefaultMessage() == false) {
echo '<span class="inv_error_note">';
echo $lang['srv_invitation_note6'];
echo '</span>';
- } else {
+ }
+ else {
$sql_string = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
$sql_query = sisplet_query($sql_string);
$array_messages = array();
@@ -2163,124 +2263,153 @@ class SurveyInvitationsNew {
}
$preview_message = $array_messages[$mid];
- echo '<div id="inv_messages_profiles_holder" class="floatLeft">';
+
+ echo '<fieldset id="inv_messages_profiles_holder" class="left_holder">';
+
echo '<span>'.$lang['srv_invitation_message_choose'].':</span><br/>';
- echo '<div id="invitation_messages" >';
+
+
+ echo '<div id="invitation_messages">';
+
echo '<ol>';
foreach ($array_messages AS $_m => $message) {
- echo '<li mid="'.$message['id'].'" class="'
- .($message['id'] == $mid ? ' active' : '')
- .'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
+ echo '<li mid="'.$message['id'].'" class="'.($message['id'] == $mid ? ' active' : '').'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
echo $message['naslov'];
+
+ if($message['id'] == $mid){
+
+ echo '<div class="icons">';
+
+ if (count($array_messages) > 1)
+ echo '<span class="faicon delete_circle" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'"></span>';
+
+ echo '<span class="faicon edit" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'"></span>';
+
+ echo '</div>';
+ }
+
echo '</li>';
}
echo '</ol>';
+
echo '</div>'; #invitation_messages
- echo '<br class="clr" />';
- if (count($array_messages) > 1) {
- echo '<span class="as_link" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'">'.$lang['srv_inv_message_delete_profile'].'</span><br/>';
- }
- echo '<span class="as_link" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'">'.$lang['srv_inv_message_rename_profile'].'</span>';
- {
- # polovimo podatke profila
- $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
- $sql_query = sisplet_query($sql_string);
- $sql_row = mysqli_fetch_assoc($sql_query);
- $avtor = array();
- $edit = array();
- if (trim($sql_row['name'])) {
- $avtor[] = trim ($sql_row['name']);
- }
- if (trim($sql_row['surname'])) {
- $avtor[] = trim ($sql_row['surname']);
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray">'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
- if (trim($sql_row['ename'])) {
- $edit[] = trim ($sql_row['ename']);
- }
- if (trim($sql_row['esurname'])) {
- $edit[] = trim ($sql_row['esurname']);
- }
+ # polovimo podatke profila
+ $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ $edit = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+
+
+ echo '<div class="info">';
+
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ if (trim($sql_row['ename'])) {
+ $edit[] = trim ($sql_row['ename']);
+ }
+ if (trim($sql_row['esurname'])) {
+ $edit[] = trim ($sql_row['esurname']);
+ }
+
+ if ( count($edit) > 0 && $edit != $avtor) {
+ echo '<div>'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
+ }
+ if ($sql_row['insert_time'] != $sql_row['edit_time']) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+
+ echo '<div style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
+
+ echo '</div>';
- if ( count($edit) > 0 && $edit != $avtor) {
- echo '<div class="gray">'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
- }
- if ($sql_row['insert_time'] != $sql_row['edit_time']) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
-
- echo '<div class="gray" style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
- }
- echo '</div>'; #inv_messages_profiles_holder
+ echo '</fieldset>'; #inv_messages_profiles_holder
+
$MA = new MailAdapter($this->sid, $type='invitation');
+
# zlistamo seznam vseh sporočil
# izpišemo primer besedila
- echo '<div id="inv_msg_preview_hld" class="floatLeft">';
- echo '<span class="h2 spaceRight floatLeft">'.$lang['srv_inv_message_draft_content_heading'].'</span> '.Help::display('srv_inv_message_title_noEmail');
+ echo '<fieldset id="inv_msg_preview_hld" class="right_holder">';
+
+ echo '<legend>'.$lang['message'].' '.Help::display('srv_inv_message_title_noEmail').'</legend>';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
- //echo '<span class="spaceRight floatRight"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_server&show_back=true">'.$lang['srv_inv_message_draft_settings'].'</a></span>';
- echo '<br class="clr"/>';
- echo '<div id="inv_error_note" class="hidden"></div>';
+
echo '<div id="inv_msg_preview">';
- echo '<table>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_subject'].':</th>';
- echo '<td class="inv_bt">';
- echo '<input type="text" id="inv_message_subject" value="'.$preview_message['subject_text'].'" autocomplete="off">';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
- echo '<td ><div class="msgBody">';
- echo '<textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
- echo '</div>';
- ?>
- <script type="text/javascript">
- create_inv_editor('inv_message_body', false);
- </script><?php
- echo '</td></tr>';
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <input type="text" id="inv_message_subject" class="medium" value="'.$preview_message['subject_text'].'" autocomplete="off">';
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo '</div>';
+
+
+ ?>
+ <script type="text/javascript"> create_editor('inv_message_body', false); </script>
+ <?php
+
+ $urls = $this->getUrlLists();
if (count($urls) > 0) {
- echo '<tr><th>'.$lang['srv_inv_message_draft_url'].'</th>';
- echo '<td>';
- echo '<select id="inv_message_url">';
+
+ echo '<div class="setting_item">';
+
+ echo '<label>'.$lang['srv_inv_message_draft_url'].'</label>';
+
+ echo '<select id="inv_message_url" class="dropdown medium">';
foreach ($urls AS $url) {
- $selected = '';
+ $selected = '';
if ($preview_message['url'] == '') {
- if ($preview_message['dc'] == true) {
- $selected = ' selected="selected"';
+ if ($preview_message['dc'] == true) {
+ $selected = ' selected="selected"';
}
} else if ($preview_message['url'] == $url['url']) {
- $selected = ' selected="selected"';
+ $selected = ' selected="selected"';
}
echo '<option value="'.$url['url'].'"'.$selected.'>'.$url['name'].'</option>';
}
echo '</select>';
- echo '</td>';
- echo '</tr>';
+
+ echo '</div>';
}
- echo '</table>';
- echo '</div>';
-
- echo '<br class="clr"/>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton" href="#" onclick="inv_message_save_forward_noEmail(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="if(inv_message_save_simple_noEmail(\''.$mid.'\')) { window.location.reload() }; return false;"><span>'.$lang['srv_inv_message_save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_message_saveNew'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_message_saveNew'].'</span></a></span>';
-
echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['srv_invitation_message_saveNew'].'" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;">'.$lang['srv_invitation_message_saveNew'].'</button>';
+ echo ' <button class="white-blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="if(inv_message_save_simple_noEmail(\''.$mid.'\')) { window.location.reload() }; return false;">'.$lang['srv_inv_message_save'].'</button>';
+ echo ' <button class="blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="inv_message_save_forward_noEmail(\''.$mid.'\'); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
+
+
+ echo '</fieldset>';
}
echo '</div>';
}
-
- echo '<br class="clr"/>';
}
function checkDefaultMessage() {
@@ -2403,6 +2532,10 @@ class SurveyInvitationsNew {
$return['inv_message_body'] = '1';
$newline= '<br/>';
}
+
+
+ $sql_string = '';
+
# če ni napak shranim:
if ( $return['error'] == '0') {
@@ -2423,8 +2556,11 @@ class SurveyInvitationsNew {
}
sisplet_query("COMMIT");
}
- $return['msg'].=' '.$sql_string.$sql_insert;
+
+ $return['msg'] .= ' '.$sql_string;
+
echo json_encode($return);
+
exit;
}
@@ -2476,7 +2612,7 @@ class SurveyInvitationsNew {
}
sisplet_query("COMMIT");
}
- $return['msg'].=' '.$sql_string.$sql_insert;
+ $return['msg'].=' '.$sql_string;
echo json_encode($return);
exit;
}
@@ -2485,14 +2621,15 @@ class SurveyInvitationsNew {
global $lang, $global_user_id;
$return = array('msg'=>'', 'error'=>'0');
- $mid = (int)$POST['mid'];
-
#če so kakšne napake jih prikažemo v float oknu
$subject = trim($_POST['subject']);
$replyto = trim($_POST['replyto']);
$body = trim($_POST['body']);
$url = trim($_POST['url']);
+ $sql_string = '';
+ $sql_insert = '';
+
$newline = '';
if ($replyto == null || $replyto == '' ) {
$return['error'] = '1';
@@ -2533,7 +2670,7 @@ class SurveyInvitationsNew {
# shranjujemo v novo sporočilo
$naslov = $this->generateMessageName();
$sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, reply_to, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) ".
- "VALUES ('$this->sid', '$naslov', '$subject', '$body', '$replyto', '1', '$global_user_id', NOW(), '$comment', '$global_user_id', NOW(), '$url')";
+ "VALUES ('$this->sid', '$naslov', '$subject', '$body', '$replyto', '1', '$global_user_id', NOW(), '', '$global_user_id', NOW(), '$url')";
$sqlQuery = sisplet_query($sql_insert);
$newID = mysqli_insert_id($GLOBALS['connect_db']);
@@ -2562,8 +2699,6 @@ class SurveyInvitationsNew {
global $lang, $global_user_id;
$return = array('msg'=>'', 'error'=>'0');
- $mid = (int)$POST['mid'];
-
#če so kakšne napake jih prikažemo v float oknu
$subject = trim($_POST['subject']);
$body = trim($_POST['body']);
@@ -2597,7 +2732,7 @@ class SurveyInvitationsNew {
# shranjujemo v novo sporočilo
$naslov = $this->generateMessageName();
$sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) ".
- "VALUES ('$this->sid', '$naslov', '$subject', '$body', '1', '$global_user_id', NOW(), '$comment', '$global_user_id', NOW(), '$url')";
+ "VALUES ('$this->sid', '$naslov', '$subject', '$body', '1', '$global_user_id', NOW(), '', '$global_user_id', NOW(), '$url')";
$sqlQuery = sisplet_query($sql_insert);
$newID = mysqli_insert_id($GLOBALS['connect_db']);
@@ -2661,10 +2796,10 @@ class SurveyInvitationsNew {
$text = '';
$text .= mb_strtolower($fields['inv_field_email']);
- if (trim($fields['inv_field_firstname']) != '') {
+ if (isset($fields['inv_field_firstname']) && trim($fields['inv_field_firstname']) != '') {
$text .= ', '.str_replace("|~|", ",", mb_strtolower($fields['inv_field_firstname'], 'UTF-8'));
}
- if (trim($fields['inv_field_lastname']) != '') {
+ if (isset($fields['inv_field_lastname']) && trim($fields['inv_field_lastname']) != '') {
$text .= ', '.str_replace("|~|", ",", mb_strtolower($fields['inv_field_lastname'], 'UTF-8'));
}
@@ -2789,7 +2924,7 @@ class SurveyInvitationsNew {
}
function displayNavigation() {
- global $lang, $admin_type, $global_user_id, $app_settings;
+ global $lang, $admin_type, $global_user_id;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@@ -2803,7 +2938,7 @@ class SurveyInvitationsNew {
}
if (!isset($_POST['noNavi']) || (isset($_POST['noNavi']) && $_POST['noNavi'] != 'true')) {
- $_sub_action = $_GET['m'];
+ $_sub_action = isset($_GET['m']) ? $_GET['m'] : null;
if ($_sub_action == null && $_GET['t'] == 'invitations') {
if ($_GET['a'] == 'use_recipients_list') {
@@ -2835,7 +2970,7 @@ class SurveyInvitationsNew {
$_sub_action = 'send_message';
}
- $active_step[] = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'');
+ $active_step = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'',9=>'');
switch ($_sub_action) {
case 'inv_settings':
$active_step['1'] = ' active';
@@ -2877,111 +3012,115 @@ class SurveyInvitationsNew {
$active_step['1'] = ' active';
break;
}
+
if (SurveyInfo::getInstance()->checkSurveyModule('email') || SurveyInfo::getInstance()->checkSurveyModule('phone')) {
$disabled = false;
$css_disabled = '';
- } else {
+ }
+ else {
$disabled = true;
- $css_disabled = '_disabled';
+ $css_disabled = 'disabled';
}
if($isEmail) {
- #$spaceChar = '&#187;';
- $spaceChar = '&nbsp;';
- echo '<div id="inv_step_nav">';
- echo '<div class="inv_step'.$active_step[1].'">';
- echo '<a href="'.$this->addUrl('inv_settings').'">';
- //echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_email_settings'].'</span>';
- echo '</a>';
- echo '</div>';
+
+ echo '<div id="inv_top_navi">';
+
+
+ // Step 1 - nastavitve
+ echo '<div class="inv_step '.$active_step[1].'">';
+ echo ' <a href="'.$this->addUrl('inv_settings').'" class="noline">';
+ echo ' <span class="number">1</span>'.$lang['srv_inv_nav_email_settings'];
+ echo ' </a>';
echo '</div>';
- #space
- echo '<div class="inv_space">&nbsp;</div>';
- echo '<div id="inv_step_nav" class="yellow">';
-
- $class_yellow = ' yellow';
+
+ // Space
+ echo '<div class="inv_space"></div>';
- #navigacija
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[2].'">';
+
+ // Step 2 - dodaj
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[2].'">';
if ($disabled == false) {
- echo '<a href="'.$this->addUrl('add_recipients_view').'">';
+ echo ' <a href="'.$this->addUrl('add_recipients_view').'" class="noline">';
}
- echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_add_recipients'].'</span>';
+ echo ' <span class="number">2</span>'.$lang['srv_inv_nav_add_recipients'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
- echo '<div class="inv_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[3].'">';
+
+ // Step 3 - preglej
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[3].'">';
if ($disabled == false) {
- echo '<a href="'.$this->addUrl('view_recipients').'">';
+ echo ' <a href="'.$this->addUrl('view_recipients').'" class="noline">';
}
- echo '<span class="circle">2</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_edit_recipiens'].'</span>';
+ echo ' <span class="number">3</span>'.$lang['srv_inv_nav_edit_recipiens'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
- echo '<div class="inv_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
- if ($disabled == false) {
- echo '<a href="'.$this->addUrl('view_message').'">';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 4 - sporocilo
+
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[4].'">';
+ if ($disabled == false) {
+ echo ' <a href="'.$this->addUrl('view_message').'" class="noline">';
}
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[4].'">';
- echo '<span class="circle">3</span>';
- echo '<span class="label" >'.$lang['srv_inv_nav_edit_message'].'</span>';
+ echo ' <span class="number">4</span>'.$lang['srv_inv_nav_edit_message'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
- echo '<div class="inv_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[5].'">';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 5 - poslji
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[5].'">';
if ($disabled == false) {
- echo '<a href="'.$this->addUrl('send_message').'">';
+ echo ' <a href="'.$this->addUrl('send_message').'" class="noline">';
}
- echo '<span class="circle">4</span>';
- echo '<span class="label" >'.$lang['srv_inv_nav_send_message'].'</span>';
+ echo ' <span class="number">5</span>'.$lang['srv_inv_nav_send_message'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
- echo '</div>';
-
-
- // Pregled
- #space
- echo '<div class="inv_space">&nbsp;</div>';
- echo '<div id="inv_step_nav">';
- echo '<div class="inv_step'.$active_step[9].'">';
- echo '<a href="'.$this->addUrl('inv_status').'">';
- //echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_email_review'].'</span>';
- echo '</a>';
- echo '</div>';
+ // Nastavitve zgoraj desno
+ echo '<div class="inv_nav_settings">';
+
+ // Pregled
+ echo '<div class="inv_step '.$active_step[9].'">';
+ echo ' <a href="'.$this->addUrl('inv_status').'" class="noline">';
+ echo ' <span class="faicon chart"></span>'.$lang['srv_inv_nav_email_review'];
+ echo ' </a>';
echo '</div>';
-
- // Seznami
- #space
- echo '<div class="inv_space">&nbsp;</div>';
-
- echo '<div id="inv_step_nav">';
- echo '<div class="inv_step'.$active_step[7].'">';
- echo '<a href="'.$this->addUrl('inv_lists').'">';
- //echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_email_lists'].'</span>';
- echo '</a>';
- echo '</div>';
+ // Seznami
+ echo '<div class="inv_step '.$active_step[7].'">';
+ echo ' <a href="'.$this->addUrl('inv_lists').'" class="noline">';
+ echo ' <span class="faicon phonebook"></span>'.$lang['srv_inv_nav_email_lists'];
+ echo ' </a>';
echo '</div>';
-
- echo '<br class="clr" />';
- echo '<br class="clr" />';
+ echo '</div>';
+
+
+ echo '</div>';
}
}
@@ -2996,37 +3135,38 @@ class SurveyInvitationsNew {
$row = $this->surveySettings;
+
# Pripravimo izbor komu lahko pošiljamo
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+ echo '<div class="invitations_top_settings">';
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_1'].'</span>';
}
$settings_text .= ' - ';
if($noEmailing == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_1'].'</span>';
}
$settings_text .= ' - ';
if($row['usercode_required'] == 0 && $individual != 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_0'];
+ $settings_text .= '<span>'.$lang['srv_inv_settings_URL_0'];
$settings_text .= ' ('.$lang['srv_inv_settings_code_0'].')</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_1'];
+ $settings_text .= '<span>'.$lang['srv_inv_settings_URL_1'];
if($row['usercode_skip'] == 1 || $individual == 0){
$settings_text .= ' ('.$lang['srv_inv_settings_code_2'].')</span>';
@@ -3036,49 +3176,51 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings" title="'.$lang['edit4'].'"><span class="faicon edit"></span></a>';
echo $settings_text;
- echo '</h2>';
+
+ echo '</div>';
if ($this->checkDefaultMessage() == false) {
- echo '<span class="inv_error_note">';
+ echo '<div class="inv_error_note">';
echo $lang['srv_invitation_note6'];
- echo '</span>';
+ echo '</div>';
+
exit();
}
- echo '<div id="inv_send_mail">';
+ echo '<div id="inv_send_mail" class="invitations_holder half-half invitations_send">';
# damo v tabelo zaradi prilagajanja oblike levo/desno
- echo '<table><tr>';
+ echo '<div class="left_holder">';
// Pri volitvah vedno posiljamo samo tistim, katerim se nismo poslali
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<td>';
+ echo '<fieldset><legend>'.$lang['srv_notifications_send_reciever2'].'</legend>';
- echo '<div>';
+ echo '<div class="setting_item ver">';
- echo $lang['srv_inv_send_who_database'].'<br/>';
- echo '<span class="floatLeft">';
- echo '<label><input type="radio" name="mailsource" value="0" onclick="mailToSourceChange();" checked="checked">'.$lang['srv_inv_send_who_all_units'].'</label>';
- echo '</span>';
-
+ echo ' <span>'.$lang['srv_inv_send_who_database'].'</span>';
+
+ echo '<div class="flex_row">';
+ echo ' <input type="radio" name="mailsource" id="mailsource_0" value="0" onclick="mailToSourceChange();" checked="checked"><label for="mailsource_0">'.$lang['srv_inv_send_who_all_units'].'</label>';
$this->advancedCondition();
- echo '<br class="clr"/>';
+ echo '</div>';
- 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 ' <input type="radio" name="mailsource" id="mailsource_1" value="1" onclick="mailToSourceChange();"><label for="mailsource_1">'.$lang['srv_inv_send_who_archive'].'</label>';
+ echo ' <input type="radio" name="mailsource" id="mailsource_2" value="2" onclick="mailToSourceChange();"><label for="mailsource_2">'.$lang['srv_inv_send_who_lists'].'</label>';
+
+ echo '</div>';
+
echo '<div id="inv_select_mail_to_source_lists">';
- $this->displayMailToSourceLists((int)$_POST['source_type']);
+ $source_type = isset($_POST['source_type']) ? (int)$_POST['source_type'] : 0;
+ $this->displayMailToSourceLists($source_type);
echo '</div>'; #id="inv_select_mail_to_source_lists"
- echo '</div>';
-
# polovimo sporočilo in prejemnike
$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 ) {
@@ -3093,37 +3235,42 @@ class SurveyInvitationsNew {
exit();
}
- echo '</td>';
+ echo '</fieldset>';
}
- echo '<td>';
-
+ echo '</div>';
+
+
+ // Desna stran
+ echo '<div class="right_holder">';
+
// Ce posiljamo preko navadne poste ali smsov, nimamo sporocila
if($noEmailing == 0){
- echo '<input type="hidden" name="noMailing" value="0" />';
- echo '<div id="inv_select_mail_preview">';
+ echo '<fieldset id="inv_select_mail_preview"><legend>'.$lang['message'].'</legend>';
+ echo '<input type="hidden" name="noMailing" value="0" />';
$this->displayMessagePreview();
- echo '</div>'; // inv_select_mail_preview
- echo '<br class="clr"/>';
-
- echo '<div id="inv_select_mail_to_respondents">';
+ echo '</fieldset>';
+
+ echo '<fieldset id="inv_select_mail_to_respondents"><legend>'.$lang['srv_inv_nav_email_invitations'].'</legend>';
$this->selectSendTo();
- echo '</div>'; // inv_select_mail_to_respondents
+ echo '</fieldset>';
}
else{
- echo '<input type="hidden" name="noMailing" value="1" />';
+ echo '<fieldset id="inv_select_mail_to_respondents"><legend>'.$lang['srv_inv_nav_email_invitations'].'</legend>';
+
+ echo '<input type="hidden" name="noMailing" value="1" />';
+
$noEmailingType = SurveySession::get('inv_noEmailing_type');
echo '<input type="hidden" name="noMailingType" value="'.$noEmailingType.'" />';
-
- echo '<div id="inv_select_mail_to_respondents">';
+
$this->selectSendToNoEmailing();
- echo '</div>'; // inv_select_mail_to_respondents
+
+ echo '</fieldset>';
}
-
- echo '</td>';
- echo '</tr></table>';
+ echo '</div>';
+
echo '</div>'; //inv_send_mail
}
@@ -3133,9 +3280,13 @@ class SurveyInvitationsNew {
$canShowSubOption = false;
- echo '<p style="margin-left:25px;">';
- echo $lang['srv_inv_send_who_create1'].'<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_lists">'.$lang['srv_inv_send_who_create2'].'</a><br/>';
-
+ echo '<div class="setting_item ver">';
+ echo ' <span>'.$lang['srv_inv_send_who_create1'].'<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_lists" class="noline">'.$lang['srv_inv_send_who_create2'].'</a></span>';
+ echo '</div>';
+
+
+ echo '<div class="setting_item ver">';
+
if ((int)$source_type == 0) {
# vsi respondenti v bazi
echo $lang['srv_inv_send_who_database_note'];
@@ -3154,20 +3305,27 @@ class SurveyInvitationsNew {
$canShowSubOption = true;
echo $lang['srv_inv_send_who_archive_note'];
+
echo '<table id="tbl_recipients_source_list">';
+
echo '<tr>';
- echo '<th class="tbl_icon">&nbsp;</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_address'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
+ echo ' <th class="tbl_icon">&nbsp;</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_address'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
echo '</tr>';
while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
echo '<tr>';
- echo '<td class="tbl_icon"><input type="checkbox" name="mailsource_lists[]" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"></td>';
- echo '<td>'.$row_arc['naslov'].'</td>';
- echo '<td class="anl_ac">'.((int)$row_arc['cnt_succsess']+(int)$row_arc['cnt_error']).'</td>';
- echo '<td>'.$row_arc['ds'].'</td>';
+ echo ' <td class="tbl_icon">';
+ echo ' <input type="checkbox" name="mailsource_lists[]" id="mailsource_lists_'.$row_arc['id'].'" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"><label for="mailsource_lists_'.$row_arc['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$row_arc['naslov'].'</td>';
+
+ echo ' <td class="anl_ac">'.((int)$row_arc['cnt_succsess']+(int)$row_arc['cnt_error']).'</td>';
+
+ echo ' <td>'.$row_arc['ds'].'</td>';
echo '</tr>';
}
@@ -3196,12 +3354,14 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_send_who_all_units_note'];
echo '<table id="tbl_recipients_source_list">';
+
echo '<tr>';
- echo '<th class="tbl_icon">&nbsp;</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_list_name'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
+ echo ' <th class="tbl_icon">&nbsp;</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_list_name'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
echo '</tr>';
+
while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
if ($row_arc['id'] > 0 && $row_arc['naslov'] == '') {
@@ -3224,10 +3384,15 @@ class SurveyInvitationsNew {
}
echo '<tr>';
- echo '<td class="tbl_icon"><input type="checkbox" name="mailsource_lists[]" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"></td>';
- echo '<td>'.$_naslov.'</td>';
- echo '<td class="anl_ac">'.$row_arc['cnt_succsess'].'</td>';
- echo '<td>'.$row_arc['ds'].'</td>';
+ echo ' <td class="tbl_icon">';
+ echo ' <input type="checkbox" name="mailsource_lists[]" id="mailsource_lists_'.$row_arc['id'].'" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"><label for="mailsource_lists_'.$row_arc['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$_naslov.'</td>';
+
+ echo ' <td class="anl_ac">'.$row_arc['cnt_succsess'].'</td>';
+
+ echo ' <td>'.$row_arc['ds'].'</td>';
echo '</tr>';
}
}
@@ -3237,35 +3402,41 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_send_who_no_lists'];
}
}
- echo '</p>';
+
+ echo '</div>';
+
if ($canShowSubOption == true) {
- echo '<span id="inv_select_mail_to">';
- echo '<span class="bold">'.$lang['srv_inv_send_note'].'</span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto0" value="0" type="radio" checked="checked" onclick="mailToRadioChange();"><label for="mailto0">' . $lang['srv_inv_send_recipients0'] . '</label></span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto1" value="1" type="radio" onclick="mailToRadioChange();"><label for="mailto1">' . $lang['srv_inv_send_recipients1'] . '</label></span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto2" value="2" type="radio" onclick="mailToRadioChange();"><label for="mailto2">' . $lang['srv_inv_send_recipients2'] . '</label></span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto3" value="3 " type="radio" onclick="mailToRadioChange();"><label for="mailto3">' . $lang['srv_inv_send_recipients3'] . '</label></span><br/>';
-
- echo '<span class="inv_send_span">'.$lang['srv_invitation_send_advanced'].'</span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto4" value="4 " type="radio" onclick="mailToRadioChange();"><label for="mailto4">' . $lang['srv_inv_send_recipients4'] . '</label></span><br/>';
- echo '<div id="inv_send_advanced_div" >';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="0" type="checkbox" id="mailto_status_0" onclick="mailTocheCheckboxChange();" disabled="disabled">0 - ' . $lang['srv_userstatus_0'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="1" type="checkbox" id="mailto_status_1" onclick="mailTocheCheckboxChange();" disabled="disabled">1 - ' . $lang['srv_userstatus_1'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="2" type="checkbox" id="mailto_status_2" onclick="mailTocheCheckboxChange();" disabled="disabled">2 - ' . $lang['srv_userstatus_2'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="3" type="checkbox" id="mailto_status_3" onclick="mailTocheCheckboxChange();" disabled="disabled">3 - ' . $lang['srv_userstatus_3'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="4" type="checkbox" id="mailto_status_4" onclick="mailTocheCheckboxChange();" disabled="disabled">4 - ' . $lang['srv_userstatus_4'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="5" type="checkbox" id="mailto_status_5" onclick="mailTocheCheckboxChange();" disabled="disabled">5 - ' . $lang['srv_userstatus_5'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="6" type="checkbox" id="mailto_status_6" onclick="mailTocheCheckboxChange();" disabled="disabled">6 - ' . $lang['srv_userstatus_6'] . '</label></span><br/>';
+ echo '<div id="inv_select_mail_to" class="setting_item ver">';
+
+ echo '<span class="semi-bold">'.$lang['srv_inv_send_note'].'</span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto0" value="0" type="radio" checked="checked" onclick="mailToRadioChange();"><label for="mailto0">' . $lang['srv_inv_send_recipients0'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto1" value="1" type="radio" onclick="mailToRadioChange();"><label for="mailto1">' . $lang['srv_inv_send_recipients1'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto2" value="2" type="radio" onclick="mailToRadioChange();"><label for="mailto2">' . $lang['srv_inv_send_recipients2'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto3" value="3 " type="radio" onclick="mailToRadioChange();"><label for="mailto3">' . $lang['srv_inv_send_recipients3'] . '</label></span>';
+
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto4" value="4 " type="radio" onclick="mailToRadioChange();"><label for="mailto4">' . $lang['srv_inv_send_recipients4'] . '</label></span>';
+
+ echo '<div id="inv_send_advanced_div" class="setting_item ver">';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="0" type="checkbox" id="mailto_status_0" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_0">0 - ' . $lang['srv_userstatus_0'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="1" type="checkbox" id="mailto_status_1" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_1">1 - ' . $lang['srv_userstatus_1'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="2" type="checkbox" id="mailto_status_2" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_2">2 - ' . $lang['srv_userstatus_2'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="3" type="checkbox" id="mailto_status_3" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_3">3 - ' . $lang['srv_userstatus_3'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="4" type="checkbox" id="mailto_status_4" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_4">4 - ' . $lang['srv_userstatus_4'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="5" type="checkbox" id="mailto_status_5" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_5">5 - ' . $lang['srv_userstatus_5'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="6" type="checkbox" id="mailto_status_6" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_6">6 - ' . $lang['srv_userstatus_6'] . '</label></span>';
echo '</div>';
- echo '</span>'; // inv_select_mail_to
+
+ echo '</div>';
}
}
function selectSendTo($send_type = 0, $checkboxes = array()) {
global $lang, $site_url, $global_user_id;
+ $_msg = '';
+ $cnt = 0;
if ((int)$this->surveySettings['active'] !== 1) {
$activity = SurveyInfo:: getSurveyActivity();
@@ -3303,8 +3474,8 @@ class SurveyInvitationsNew {
$checkboxes = explode(',',$_POST['checkboxes']);
}
- $source_type = (int)$_POST['source_type'];
- $source_lists = trim($_POST['source_lists']);
+ $source_type = isset($_POST['source_type']) ? (int)$_POST['source_type'] : 0;
+ $source_lists = isset($_POST['source_lists']) ? trim($_POST['source_lists']) : '';
$respondents = $this->getRespondents2Send($send_type, $checkboxes, $source_type, $source_lists);
#koliko strani imamp
@@ -3312,53 +3483,56 @@ class SurveyInvitationsNew {
$pages = ceil($numRespondents / $this->rec_send_page_limit);
if (count($respondents) > 0) {
- echo '<div class="inv_send_mail_send_type">';
+ echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail" method="post">';
+
+ echo '<div class="inv_send_mail_send_type">';
// Način pošiljanja
- echo '<span class="bold">';
- echo $lang['srv_inv_message_type'].': ';
- echo $lang['email'];
- echo '</span><br /><br />';
+ echo '<div class="setting_item ver">';
+ echo ' <span class="semi-bold">'.$lang['srv_inv_message_type'].': '.$lang['email'].'</span>';
+ echo '</div>';
- echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail" method="post">';
// Komentar pri posiljanju
- echo '<label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').': ';
- echo '<input type="text" name="comment" id="msg_comment" value="'.$comment.'">';
- echo '</label><br class="clr"><br />';
+ echo '<div class="setting_item ver">';
+ echo ' <label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').':</label>';
+ echo ' <input type="text" class="medium" name="comment" id="msg_comment" value="'.$comment.'">';
+ echo '</div>';
// Pobrisi podvojene maile
- echo '<label><input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">'.$lang['srv_inv_send_remove_duplicates'].'</label></span> '.Help::display('srv_inv_sending_double').'<br />';
-
+ echo '<div class="setting_item ver">';
+ echo ' <input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">';
+ echo ' <label for="dont_send_duplicated">'.$lang['srv_inv_send_remove_duplicates'].' '.Help::display('srv_inv_sending_double').'</label>';
+ echo '</div>';
+
// Gumb Poslji
- echo '<br /><div id="inv_send_mail_btn"><span class="buttonwrapper floatLeft"><a href="#" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();" class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_inv_send'].'</span></a></span>';
- echo '<br class="clr"/><br /></div>';
+ echo '<div id="inv_send_mail_btn" class="setting_item ver">';
+ echo ' <button class="blue medium" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();">'.$lang['srv_inv_send'].'</button>';
+ echo '</div>';
- // Komentiram kot workaround (če ni zakomentiran, ob ajaxu tu vrine konec forme) - MISLIM DA JE TA POPRAVEK ŠE VEDNO POTREBEN (v kombinaciji z Robertovim)
- //echo '</div>';
-
+
// Seznam mailov na katere bomo poslali
- if ((int)$this->invitationAdvancedConditionId > 0)
- {
- //if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
- {
- echo '<span class="floatLeft">';
- $scp = new SurveyCondition($this->sid);
- $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
- echo $note;
- #$scp -> displayConditionNote($this->invitationAdvancedConditionId );
- echo '</span>';
- echo '<br/>';
- }
+ if ((int)$this->invitationAdvancedConditionId > 0){
+ echo '<div class="setting_item ver">';
+ $scp = new SurveyCondition($this->sid);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+ echo '</div>';
}
+
# izpišemo seznam e-mailov in dodamo checkboxe
- echo '<div class="strong">'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></div>';
+ echo '<div class="setting_item ver">';
+ echo '<span>'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></span>';
+ echo '</div>';
# izpišemo opozorilo kadar pošiljamo na več kakor 5000 naslovov
$text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
- echo '<div id="inv_send_mail_limit" class="red strong'.(count($respondents) > 4999?'':' hidden').'">'.$text.'</div>';
+ echo '<div id="inv_send_mail_limit" class="setting_item ver red semi-bold '.(count($respondents) > 4999?'':' displayNone').'">';
+ echo $text;
+ echo '</div>';
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+
# da preprečimo večkratno pošiljanje
session_start();
list($short,$long) = $this->generateCode();
@@ -3380,33 +3554,47 @@ class SurveyInvitationsNew {
$lists['-1'] = $lang['srv_invitation_new_templist'];
$lists['0'] = $lang['srv_invitation_new_templist_author'];
-
- echo '<div id="inv_send_note">Pošiljam . . . Prosimo počakajte.</div>';
- echo '<br/><table id="tbl_recipients_send_list">';
+
+ echo '<table id="tbl_recipients_send_list">';
+
echo '<tr>';
- echo '<th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
- echo '<th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
- echo '<th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
- echo '<th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_list_id'].'</th>';
+ echo ' <th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_list_id'].'</th>';
echo '</tr>';
+
$cnt=1;
foreach ($respondents as $pass => $respondent) {
echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
- echo '<td><input type="checkbox" name="rids[]" value="'.$respondent['id'].'" checked="checekd"></td>';
- echo '<td>'.$respondent['email'].'</td>';
- echo '<td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
- if ($lists[$respondent['list_id']] != '') {
- echo '<td>'.$lists[$respondent['list_id']].'</td>';
- } else {
- echo '<td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
+
+ echo ' <td>';
+ echo ' <input type="checkbox" name="rids[]" id="rids_'.$respondent['id'].'" value="'.$respondent['id'].'" checked="checekd">';
+ echo ' <label for="rids_'.$respondent['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$respondent['email'].'</td>';
+
+ echo ' <td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
+
+ if ($lists[$respondent['list_id']] != '') {
+ echo ' <td>'.$lists[$respondent['list_id']].'</td>';
+ }
+ else {
+ echo ' <td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
}
+
echo '</tr>';
+
$cnt++;
}
echo '</table>';
- echo '</form>';
+
+
echo '</div>';
+
+ echo '</form>';
}
}
if ($cnt == 0) {
@@ -3464,54 +3652,64 @@ class SurveyInvitationsNew {
// Način pošiljanja
$noEmailingType = SurveySession::get('inv_noEmailing_type');
- echo '<span class="bold">';
- echo $lang['srv_inv_message_type_external'].': </span>';
+ echo '<div class="setting_item ver">';
+ echo ' <span class="semi-bold">'.$lang['srv_inv_message_type_external'].': ';
if($noEmailingType == 1)
- echo $lang['srv_inv_message_noemailing_type2'];
+ echo $lang['srv_inv_message_noemailing_type2'];
elseif($noEmailingType == 2)
- echo $lang['srv_inv_message_noemailing_type3'];
+ echo $lang['srv_inv_message_noemailing_type3'];
else
- echo $lang['srv_inv_message_noemailing_type1'];
- echo '<br /><br />';
+ echo $lang['srv_inv_message_noemailing_type1'];
+ echo ' </span>';
+
+ echo '</div>';
+
echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail&noemailing=1" method="post">';
- // Komentar pri posiljanju
- echo '<label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').': ';
- echo '<input type="text" name="comment" id="msg_comment" value="'.$comment.'">';
- echo '</label><br class="clr"><br />';
+ // Komentar pri posiljanju
+ echo '<div class="setting_item ver">';
+ echo ' <label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').':</label>';
+ echo ' <input type="text" class="medium" name="comment" id="msg_comment" value="'.$comment.'">';
+ echo '</div>';
// Pobrisi podvojene maile
- echo '<label><input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">'.$lang['srv_inv_send_remove_duplicates'].'</label></span> '.Help::display('srv_inv_sending_double').'<br />';
-
- // Gumb poslji
- echo '<br /><div id="inv_send_mail_btn"><span class="buttonwrapper floatLeft"><a href="#" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();" class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_inv_nav_send_noEmailing'].'</span></a></span>';
- echo '<br class="clr"/><br /></div>';
-
+ echo '<div class="setting_item ver">';
+ echo ' <input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">';
+ echo ' <label for="dont_send_duplicated">'.$lang['srv_inv_send_remove_duplicates'].' '.Help::display('srv_inv_sending_double').'</label>';
echo '</div>';
+
+ // Gumb Poslji
+ echo '<div id="inv_send_mail_btn" class="setting_item hor">';
+ echo ' <button class="blue medium" style="width:auto;" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();">'.$lang['srv_inv_nav_send_noEmailing'].'</button>';
+ echo '</div>';
+
// Seznam mailov na katere bomo poslali
- if ((int)$this->invitationAdvancedConditionId > 0)
- {
- #if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
- {
- echo '<span class="floatLeft">';
- $scp = new SurveyCondition($this->sid);
- $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
- echo $note;
- #$scp -> displayConditionNote($this->invitationAdvancedConditionId );
- echo '</span>';
- echo '<br/>';
- }
+ if ((int)$this->invitationAdvancedConditionId > 0){
+
+ echo '<div class="setting_item ver">';
+
+ $scp = new SurveyCondition($this->sid);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+
+ echo '</div>';
}
+
# izpišemo seznam e-mailov in dodamo checkboxe
- echo '<div class="strong">'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></div>';
+ echo '<div class="setting_item ver">';
+ echo '<span>'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></span>';
+ echo '</div>';
# izpišemo opozorilo kadar pošiljamo na več kakor 5000 naslovov
- $text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
- echo '<div id="inv_send_mail_limit" class="red strong'.(count($respondents) > 4999?'':' hidden').'">'.$text.'</div>';
+ $text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
+ echo '<div id="inv_send_mail_limit" class="setting_item ver red semi-bold '.(count($respondents) > 4999?'':' displayNone').'">';
+ echo $text;
+ echo '</div>';
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+
# da preprečimo večkratno pošiljanje
session_start();
list($short,$long) = $this->generateCode();
@@ -3534,9 +3732,8 @@ class SurveyInvitationsNew {
$lists['-1'] = $lang['srv_invitation_new_templist'];
$lists['0'] = $lang['srv_invitation_new_templist_author'];
- echo '<div id="inv_send_note">Pošiljam . . . Prosimo počakajte.</div>';
- echo '<br/><table id="tbl_recipients_send_list">';
+ echo '<table id="tbl_recipients_send_list">';
echo '<tr>';
echo '<th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
echo '<th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
@@ -3546,20 +3743,34 @@ class SurveyInvitationsNew {
echo '</tr>';
$cnt=1;
foreach ($respondents as $pass => $respondent) {
- echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
- echo '<td><input type="checkbox" name="rids[]" value="'.$respondent['id'].'" checked="checekd"></td>';
- echo '<td>'.$respondent['email'].'</td>';
- echo '<td>'.$respondent['firstname'].'</td>';
- echo '<td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
- if ($lists[$respondent['list_id']] != '') {
- echo '<td>'.$lists[$respondent['list_id']].'</td>';
- } else {
- echo '<td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
+
+ echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
+
+ echo ' <td>';
+ echo ' <input type="checkbox" name="rids[]" id="rids_'.$respondent['id'].'" value="'.$respondent['id'].'" checked="checekd">';
+ echo ' <label for="rids_'.$respondent['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$respondent['email'].'</td>';
+
+ echo ' <td>'.$respondent['firstname'].'</td>';
+
+ echo ' <td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
+
+ if ($lists[$respondent['list_id']] != '') {
+ echo ' <td>'.$lists[$respondent['list_id']].'</td>';
+ }
+ else {
+ echo ' <td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
}
+
echo '</tr>';
+
$cnt++;
}
+
echo '</table>';
+
echo '</form>';
}
}
@@ -3590,69 +3801,58 @@ class SurveyInvitationsNew {
$SSMI = new SurveySimpleMailInvitation($this->sid);
$simple_recipents = $SSMI -> getRecipients();
+
+ echo '<fieldset><legend>'.$lang['srv_archive_invitation'].'</legend>';
+
if (mysqli_num_rows($sql_query) > 0 || count($simple_recipents) > 0) {
- echo '<h2>'.$lang['srv_archive_invitation'].'</h2>';
+ echo '<p class="bottom16">'.$lang['srv_archive_invitation_text'].'</p>';
+
+ echo '<p class="bold">'.$lang['srv_archive_invitation_text2'].'</p>';
+
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tbl_archive_list">';
echo '<tr>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_date_send'].'">'.$lang['srv_inv_archive_date_send'].'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_hour_send'].'">'.$lang['srv_inv_archive_hour_send'].'</th>';
+ echo '<th class="lead_column" title="'.$lang['srv_inv_archive_date_send'].'">'.$lang['srv_inv_archive_date_send'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_subject_text'].'">'.$lang['srv_inv_archive_naslov'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_subject_text'].'">'.$lang['srv_inv_archive_subject_text'].'</th>';
- #echo '<th title="'.$lang['srv_inv_archive_body_text'].'">'.$lang['srv_inv_archive_body_text'].'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_message_type'].'">'.$lang['srv_inv_message_type'].'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_cnt_succsess'].'">'.$lang['srv_inv_archive_cnt_succsess'].' '.Help::display('srv_inv_archive_sent').'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_cnt_error'].'">'.$lang['srv_inv_archive_cnt_error'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_cnt_succsess'].'">'.$lang['srv_inv_archive_cnt_succsess'].' '.Help::display('srv_inv_archive_sent').'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_cnt_error'].'">'.$lang['srv_inv_archive_cnt_error'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_sender'].'">'.$lang['srv_inv_archive_sender'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_comment'].'">'.$lang['srv_inv_archive_comment'].'</th>';
- #echo '<th >&nbsp;</th>';
echo '</tr>';
+
while ($row = mysqli_fetch_assoc($sql_query)) {
echo '<tr>';
- // Datum
- echo '<td class="tbl_inv_center">'.$row['ds'].'</td>';
-
- // Ura
- echo '<td class="tbl_inv_center">'.$row['hs'].'</td>';
+ // Datum in ura
+ echo '<td class="lead_column">'.$row['ds'].' '.$row['hs'].'</td>';
// Email sporocilo
- echo '<td class="tbl_inv_lef inv_arch_subject" title="'.$row['naslov'].'">';
+ echo '<td title="'.$row['naslov'].'">';
echo '<a href="#" onclick="inv_arch_edit_details(\''.$row['id'].'\'); return false;">'.$row['naslov'].'</a>';
echo '</td>';
// Subject
- echo '<td class="tbl_inv_lef inv_arch_subject" title="'.$row['naslov'].'">';
+ echo '<td title="'.$row['naslov'].'">';
echo $row['subject_text'];
echo '</td>';
- #echo '<td class="tbl_inv_left inv_arch_text" title="'.$row['body_text'].'">'.$row['body_text'].'</td>';
-
- // Nacin posiljanja (email, posta, sms...)
- echo '<td class="tbl_inv_center">';
- if ($row['tip'] == '0')
- echo '<span>'.$lang['srv_inv_message_noemailing_type1'].'</span>';
- elseif($row['tip'] == '1')
- echo '<span>'.$lang['srv_inv_message_noemailing_type2'].'</span>';
- elseif($row['tip'] == '2')
- echo '<span>'.$lang['srv_inv_message_noemailing_type3'].'</span>';
- else
- echo '<span>'.$lang['email'].'</span>';
- echo '</td>';
# uspešno poslani
- echo '<td class="tbl_inv_center">';
+ echo '<td class="right">';
if ((int)$row['cnt_succsess'] > 0 ) {
- echo '<span class="as_link as_view strong" id="inv_arch_1_'.$row['id'].'" data-archtype="succ">'.$row['cnt_succsess'].'</span>';
+ echo '<span class="as_link as_view" id="inv_arch_1_'.$row['id'].'" data-archtype="succ">'.$row['cnt_succsess'].'</span>';
} else {
echo '<span>'.$row['cnt_succsess'].'</span>';
}
echo '</td>';
# neuspešno poslani
- echo '<td class="tbl_inv_center">';
+ echo '<td class="right">';
if ((int)$row['cnt_error'] > 0 ) {
- echo '<span class="as_link as_view strong" id="inv_arch_0_'.$row['id'].'" data-archtype="err">'.$row['cnt_error'].'</span>';
+ echo '<span class="as_link as_view" id="inv_arch_0_'.$row['id'].'" data-archtype="err">'.$row['cnt_error'].'</span>';
} else {
echo '<span>'.$row['cnt_error'].'</span>';
}
@@ -3673,13 +3873,16 @@ class SurveyInvitationsNew {
# komentar
echo '<td>';
- echo '<a href="#" onclick="inv_arch_edit_details(\''.$row['id'].'\'); return false;">'.$row['comment'];
+ echo (($row['comment'] == "") ? '/' : $row['comment']);
echo '</td>';
echo '</tr>';
}
echo '</tr>';
echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
# dodamo simpl pošiljanje
if ( count($simple_recipents) > 0 ) {
@@ -3719,26 +3922,21 @@ class SurveyInvitationsNew {
echo '</table>';
}
- } else {
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_archive_invitation'].'</legend>';
-
- echo $lang['srv_invitation_note4'].'';
-
- echo '</fieldset>';
+ }
+ //Če ni še nobenih poslanih vabil
+ else {
+ echo '<p>'.ucfirst($lang['srv_survey_archives_tracking_survey_text1b']).' <a href="index.php?anketa=' . $this->sid . '&a=invitations">\'<span class="caps">'.$lang['navigation_NAVI_OBJAVA'].'</span>\' - \''.$lang['navigation_invitations'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1e'].'.</p>';
}
-
+ echo '</fieldset>';
echo '</div>'; # id="div_archive_content">';
- echo '<br class="clr">';
-
}
// Glavno posiljanje mail vabil
function sendMail() {
- global $lang, $site_path, $site_url, $global_user_id, $lastna_instalacija;
+ global $lang, $site_path, $site_url, $global_user_id;
Common::getInstance()->Init($this->sid);
@@ -3756,17 +3954,14 @@ class SurveyInvitationsNew {
unset($_SESSION['snd_inv_token'][$this->sid]);
session_commit();
-
- $dont_send_duplicated = false;
- if (isset($_POST['dont_send_duplicated']) && $_POST['dont_send_duplicated'] == 'on') {
- $dont_send_duplicated = true;
- }
$rids = $_POST['rids'];
+ $comment = '';
+
$return = array();
$return['error'] = '0';
- $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note5'].'</div>';
+ $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note5'].'</div><br>';
// Shranimo komentar h posiljanju
if(isset($_POST['comment']) && $_POST['comment'] != ''){
@@ -3824,7 +4019,7 @@ class SurveyInvitationsNew {
$numRows = mysqli_num_rows($sql_query);
# če pošiljamo na večje število reposndentov obvestimo info@1ka.si
- if ($numRows > NOTIFY_INFO1KA && (!isset($lastna_instalacija) || $lastna_instalacija == false)) {
+ if ($numRows > NOTIFY_INFO1KA && !isLastnaInstalacija()) {
// Gorenje tega nima
if (!Common::checkModule('gorenje')){
@@ -3834,9 +4029,11 @@ class SurveyInvitationsNew {
list($infoEmail,$infoName,$infoSurname) = mysqli_fetch_row($sqlinfo_query);
$infourl = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'">anketi</a>';
+ $preview_url = '<a href="'.SurveyInfo::getSurveyLink().'?preview=on">'.$lang['srv_poglejanketo'].'</a>';
+
$format = $lang['srv_inv_send_finish_note'];
- $info1ka_mass_email_note = sprintf($format, $infoName, $infoSurname, $infoEmail, $infourl, $numRows);
+ $info1ka_mass_email_note = sprintf($format, $infoName, $infoSurname, $infoEmail, $infourl, $numRows, $preview_url);
try{
$MA = new MailAdapter($this->sid, $type='admin');
@@ -3969,7 +4166,7 @@ class SurveyInvitationsNew {
$return['error'] = '0';
// Uspesno poslano sporocilo
- $return['msg'] = '<br /><span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8a'].'</span><br />';
+ //$return['msg'] = '<br /><span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8a'].'</span><br />';
$return['msg'] .= '<div class="inv_send_message">';
$return['msg'] .= '<table id="inv_send_mail_preview">';
$return['msg'] .= '<tr><th><span>'.$lang['srv_inv_message_draft_content_subject'].':</span></th>';
@@ -3984,14 +4181,15 @@ class SurveyInvitationsNew {
$return['msg'] .= '</div>';
// Je uporabnik poslal na ...
- $return['msg'] .= sprintf($lang['srv_invitation_note8b'], $who, date("d.m.y", time()));
- $return['msg'] .= '<span class="bold" style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok)).'</span><br />';
+ /* $return['msg'] .= sprintf($lang['srv_invitation_note8b'], $who, date("d.m.y", time()));
+ $return['msg'] .= '<span class="bold" style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok)).'</span><br />'; */
+ $return['msg'] .= '<span style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok), $who, date("d.m.y", time())).'</span><br />';
// Arhivi
- $return['msg'] .= '<span class="bold" style="line-height:20px;">'.sprintf($lang['srv_invitation_note8c'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_archive').'</span><br />';
+ $return['msg'] .= '<span style="line-height:30px;">'.sprintf($lang['srv_invitation_note8c'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_archive').'</span><br />';
// Seznam emailov...
- $return['msg'] .= '<span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8d'].'</span><br />';
+ $return['msg'] .= '<span style="line-height:30px;">'.$lang['srv_invitation_note8d'].'</span><br />';
// Seznam mailov na katere je bilo uspesno poslano
if (count($send_ok) > 0) {
@@ -4019,8 +4217,14 @@ class SurveyInvitationsNew {
$return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note14'].'</div>';
}
+
+ // Preverimo ce smo presegli limit za posiljanje vabil
+ $check = new SurveyCheck($this->sid);
+ $check->checkLimitVabila();
+
+
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init($this->sid);
Common::getInstance()->updateEditStamp();
#$this->viewAarchive($return['msg']);
@@ -4031,6 +4235,7 @@ class SurveyInvitationsNew {
private function sendMailToUsers($sql_recipients_query, $sending_data){
global $global_user_id;
global $site_url;
+ global $lang;
// Preverimo ce je vklopljen modul za volitve
@@ -4052,6 +4257,11 @@ class SurveyInvitationsNew {
}
}
+ $dont_send_duplicated = false;
+ if (isset($_POST['dont_send_duplicated']) && $_POST['dont_send_duplicated'] == 'on') {
+ $dont_send_duplicated = true;
+ }
+
$duplicated = array();
# array za rezultate
@@ -4088,7 +4298,7 @@ class SurveyInvitationsNew {
$url = $nice_url . ($individual == 1 ? '&code='.$password : '');
}
- $url .= '&ai='.(int)$sending_data['$arch_id'];
+ $url .= '&ai='.(int)$sending_data['arch_id'];
// odjava
$unsubscribe = $site_url . 'admin/survey/unsubscribe.php?anketa=' . $this->sid . '&code='.$password;
@@ -4234,7 +4444,7 @@ class SurveyInvitationsNew {
$_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
- if (trim($_user_data[$_user_variable]) != '' && $_user_data[$_user_variable] != null) {
+ if ($_user_variable !== null && trim($_user_data[$_user_variable]) != '' && $_user_data[$_user_variable] != null) {
if($spremenljivka['variable'] == 'odnos')
$strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($_user_data[$_user_variable])]."','".$usr_id."')";
else
@@ -4569,7 +4779,7 @@ class SurveyInvitationsNew {
}
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init();
Common::getInstance()->updateEditStamp();
$this->viewSendMailFinish($return['msg']);
@@ -4630,21 +4840,18 @@ class SurveyInvitationsNew {
# če so napake jih prikažemo če ne obdelamo datoteko
if (count($errors) > 0) {
-
- echo '<br class="clr" />';
- echo '<span class="inv_message_errors">'.$lang['srv_inv_recipiens_upload_error'].'</span>';
-
- echo '<br class="clr" />';
- echo '<br class="clr" />';
-
- echo '<span class="inv_error_note">';
+ echo '<div id="inv_message_errors">';
+
+ echo '<span>'.$lang['srv_inv_recipiens_upload_error'].'</span>';
+
foreach($errors as $error) {
- echo '* '.$error.'<br />';
+ echo '<span class="inv_error_note">* '.$error.'</span>';
}
- echo '</span>';
+
+ echo '</div>';
- $this->addRecipientsView($fields, $invalid_recipiens_array);
+ $this->addRecipientsView($fields);
}
else {
@@ -4679,101 +4886,9 @@ class SurveyInvitationsNew {
$_arch_id = $data[3];
$archType = $_POST['archType'];
- # za novejše ankete prikažemo nov način
- if ($this->newTracking) {
- $this->showArchiveRecipients($_arch_id, $archType);
- return;
- }
- global $lang,$site_url,$global_user_id;
- echo '<div id="inv_view_arch_recipients">';
- # polovimo sezname
- $lists = array();
- $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
- $sql_query = sisplet_query($sql_string);
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $lists[$sql_row['pid']] = $sql_row['name'];
- }
-
- $lists['-1'] = $lang['srv_invitation_new_templist'];
- $lists['0'] = $lang['srv_invitation_new_templist_author'];
-
-
- $data = explode('_',$_POST['arch_to_view']);
- $_success = (int)$data[2];
- $_arch_id = $data[3];
- $sql_string = "SELECT * FROM srv_invitations_archive WHERE id = '$_arch_id'";
- $sql_query = sisplet_query($sql_string);
- $sql_a_row = mysqli_fetch_assoc($sql_query);
-
- $sql_string = "SELECT email,firstname,lastname, password,salutation,phone,custom,relation,sent,responded,unsubscribed,deleted,last_status,list_id FROM srv_invitations_archive_recipients AS siar LEFT JOIN srv_invitations_recipients AS sir on siar.rec_id = sir.id WHERE arch_id = '$_arch_id' AND success = '$_success'";
- $sql_query = sisplet_query($sql_string);
-
-
- echo '<div class="inv_FS_content">';
+ $this->showArchiveRecipients($_arch_id, $archType);
- echo '<table id="tbl_recipients_list">';
-
- echo '<tr>';
-
- // Pri volitvah ne prikazemo nekaterih stolpcev
- if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
- echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
- }
- else{
- 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>';
- echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_unsubscribed'].'">'.$lang['srv_inv_recipients_unsubscribed'].'</th>';
- echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
- 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>';
- echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
- }
-
- echo '</tr>';
-
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- echo '<tr>';
-
- // Pri volitvah ne prikazemo nekaterih stolpcev
- if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></td>';
- echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
- echo '<td>'.$sql_row['firstname'].'</td>';
- echo '<td>'.$sql_row['lastname'].'</td>';
- echo '<td>'.$lists[$sql_row['list_id']].'</td>';
- }
- else{
- echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></td>';
- echo '<td><img src="'.$site_url.'admin/survey/icons/icons/'.((int)$sql_row['responded'] == 1 ? 'star_on.png' : 'star_off.png').'"></td>';
- echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['unsubscribed'] == 1 ? 'opdedout_on.png' : 'opdedout_off.png').'"></td>';
- echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
- 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>';
- echo '<td>'.$lists[$sql_row['list_id']].'</td>';
- }
-
-
- echo '</tr>';
- }
-
- echo '</table>';
-
- echo '</div>'; // id="arc_content"
- echo '<div class="inv_FS_btm">';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
- echo '</div>';
-
- echo '</div>';
+ return;
}
function editArchiveComment() {
@@ -4797,9 +4912,11 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="inv_arch_save_comment(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -4810,20 +4927,22 @@ class SurveyInvitationsNew {
global $lang;
if (isset($_POST['inv_rid']) && trim($_POST['inv_rid']) != '') {
+
$rid = $_POST['inv_rid'];
- echo '<div id="inv_delete_rec_confirm">';
+ echo '<div id="inv_delete_rec_confirm" class="divPopUp">';
- echo '<span class="h2">Ali ste prepričani da želite izbrisati respondenta:</span>';
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
+ echo '<h2>'.$lang['srv_inv_recipient_delete'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ echo '<p class="bottom16">'.$lang['srv_inv_recipient_delete_text'].'</p>';
# polovimo podatke respondenta
$sql_string = "SELECT * FROM srv_invitations_recipients WHERE id = '".(int)$_POST['inv_rid']."'";
$sql_query = sisplet_query($sql_string);
$sql_row = mysqli_fetch_assoc($sql_query);
- echo '<div id="inv_error_note" class="hidden"/>';
+ echo '<div id="inv_error_note" class="displayNone"/>';
echo '<input type="hidden" id="inv_rid" value="'.$sql_row['id'].'">';
echo '<table id="inv_edit_recipient">';
@@ -4878,13 +4997,11 @@ class SurveyInvitationsNew {
}
}
echo '</table>';
-
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
- echo '<span id="inv_delete_recipent" class="buttonwrapper floatRight" title="'.$lang['srv_inv_list_profiles_delete'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_delete_recipient();return false;" ><span>'.$lang['srv_inv_list_profiles_delete'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr"/>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_inv_list_profiles_delete'].'" onclick="inv_delete_recipient(); return false;">'.$lang['srv_inv_list_profiles_delete'].'</button>';
+ echo '</div>';
echo '</div>'; # id="inv_delete_rec_confirm"
}
@@ -5079,34 +5196,37 @@ class SurveyInvitationsNew {
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
$array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
}
+
+
echo '<div id="inv_import_list_profiles">';
echo '<ol>';
foreach ($array_profiles AS $_pid => $profile) {
- echo '<li pid="'.$_pid.'" class="'
- # .($_pid['isdefault'] == 1 ? ' strong' : '')
- .($ppid === $_pid ? ' active' : '')
- .'">';
- echo $profile['name'];
+ echo '<li pid="'.$_pid.'" class="'.($ppid === $_pid ? ' active' : '').'">';
+
+ echo '<span>'.$profile['name'].'</span>';
+
+ if ((int)$ppid > 0 && $ppid === $_pid) {
+ # polovimo še ostale porfile
+ $sql_query = sisplet_query("SELECT * FROM srv_invitations_recipients_profiles WHERE pid='".(int)$ppid."' AND from_survey ='".$this->sid."' ");
+
+ if (mysqli_num_rows($sql_query) > 0) {
+
+ echo '<div class="icons">';
+
+ # če je iz iste ankete, potem lahko urejamo
+ echo '<a href="#" onclick="inv_del_rec_profile();" title="'.$lang['srv_inv_recipients_delete_profile'].'"><span class="faicon delete_circle"></span></a>';
+ echo '<a href="#" onclick="inv_edit_rec_profile();" title="'.$lang['srv_inv_recipients_edit_profile'].'"><span class="faicon edit"></span></a>';
+
+ echo '</div>';
+ }
+ }
+
echo '</li>';
}
echo '</ol>';
- echo '</div>';
- echo '<br class="clr" />';
- if ((int)$ppid > 0) {
- # polovimo še ostale porfile
- $sql_string = "SELECT * FROM srv_invitations_recipients_profiles WHERE pid='".(int)$ppid."' AND from_survey ='".$this->sid."' ";
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0) {
- # če je iz iste ankete, potem lahko urejamo
- echo '<a href="#" onclick="inv_del_rec_profile();" title="'.$lang['srv_inv_recipients_delete_profile'].'">'.$lang['srv_inv_recipients_delete_profile'].'</a><br/>';
- echo '<a href="#" onclick="inv_edit_rec_profile();" title="'.$lang['srv_inv_recipients_edit_profile'].'">'.$lang['srv_inv_recipients_edit_profile'].'</a><br/>';
- echo '<br class="clr"/>';
- }
- }
-
- echo '<br class="clr" />';
+ echo '</div>';
}
function getRecipientsProfile($pid) {
@@ -5415,29 +5535,22 @@ class SurveyInvitationsNew {
echo '<div id="inv_recipients_profile_name">';
- echo '<div id="inv_error_note" class="hidden"></div>';
+ echo '<div id="inv_error_note" class="displayNone"></div>';
- echo '<table>';
- echo '<tr><td class="bold">'.$lang['srv_inv_recipient_list_name'].'</td>';
- echo '<td>';
- echo '<input type="text" id="rec_profile_name" value="'.$sqlRow['name'].'" autofocus="autofocus" style="width: 200px;">';
- echo '</td></tr>';
- echo '</table>';
-
+ echo '<p>'.$lang['srv_inv_recipient_list_name'].'</p>';
+ echo '<input type="text" id="rec_profile_name" class="text large" value="'.$sqlRow['name'].'" autofocus="autofocus">';
echo '<input type="hidden" id="rec_profile_pid" value="'.$pid.'" >';
- echo '<br class="clr" />';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_update_rec_profile(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<br class="clr" />';
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" >'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" onclick="inv_update_rec_profile(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
echo '</div>'; # id="inv_view_arch_recipients"
sisplet_query("COMMIT");
}
- echo json_encode($return);
-
exit;
}
@@ -5485,29 +5598,35 @@ class SurveyInvitationsNew {
$mid = (int)$_POST['mid'];
echo '<div id="inv_recipients_profile_name">';
- echo $lang['srv_inv_message_rename_new_name'].'&nbsp;';
+
+ echo '<h2>'.$lang['message'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
# polovimo vsa sporočila
$sql_string = "SELECT naslov, comment FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND id = '$mid'";
list($naslov, $comment) = mysqli_fetch_row(sisplet_query($sql_string));
- echo '<input type="text" id="inv_message_profile_name" value="'.$naslov.'" tabindex="1" autofocus="autofocus">';
- echo '<br/><br/>';
- echo $lang['srv_inv_message_draft_list_comment'];
- echo '<textarea id="inv_message_comment" tabindex="3" rows="2" style="width:200px;">'.($comment).'</textarea>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_inv_message_rename_new_name'].'</span>';
+ echo '<input type="text" class="text medium" id="inv_message_profile_name" value="'.$naslov.'" tabindex="1" autofocus="autofocus">';
+ echo '</div>';
-
- echo '<br class="clr" /><br class="clr" />';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="invMessageRename(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_inv_message_draft_list_comment'].'</span>';
+ echo '<textarea id="inv_message_comment" tabindex="3">'.($comment).'</textarea>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="invMessageRename(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
- echo '<br class="clr" />';
echo '</div>';
}
function messageRename() {
- global $lang;
+ global $lang, $global_user_id;
$return = array('msg'=>'', 'error'=>'0');
@@ -5528,13 +5647,13 @@ class SurveyInvitationsNew {
if ( $sqlQuery != 1) {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
sisplet_query("COMMIT");
} else {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
echo json_encode($return);
@@ -5546,63 +5665,66 @@ class SurveyInvitationsNew {
echo '<div id="inv_recipient_edit">';
- echo '<h2>Urejanje respondenta</h2>';
-
+ echo '<h2>'.$lang['srv_inv_recipient_edit'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ $button_check = 0;
+
if ((int)$_POST['inv_rid'] > 0) {
# polovimo podatke respondenta
$sql_string = "SELECT * FROM srv_invitations_recipients WHERE id = '".(int)$_POST['inv_rid']."'";
$sql_query = sisplet_query($sql_string);
$sql_row = mysqli_fetch_assoc($sql_query);
- echo '<div id="inv_error_note" class="hidden"/>';
+ echo '<div id="inv_error_note" class="displayNone"/>';
echo '<input type="hidden" id="inv_rid" value="'.$sql_row['id'].'">';
echo '<table id="inv_edit_recipient">';
#email
echo '<tr><th>'.$lang['srv_inv_field_email'].'</th><td>';
- echo '<input type="text" id="rec_email" value="'.$sql_row['email'].'" autocomplete="off" maxlength="100">';
+ echo '<input type="text" class="text medium" id="rec_email" value="'.$sql_row['email'].'" autocomplete="off" maxlength="100">';
echo '</td></tr>';
#geslo
echo '<tr><th>'.$lang['srv_inv_field_password'].'</th><td>';
- echo '<input type="text" id="rec_password" value="'.$sql_row['password'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_password" value="'.$sql_row['password'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#ime
echo '<tr><th>'.$lang['srv_inv_field_firstname'].'</th><td>';
- echo '<input type="text" id="rec_firstname" value="'.$sql_row['firstname'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_firstname" value="'.$sql_row['firstname'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#priimek
echo '<tr><th>'.$lang['srv_inv_field_lastname'].'</th><td>';
- echo '<input type="text" id="rec_lastname" value="'.$sql_row['lastname'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_lastname" value="'.$sql_row['lastname'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#naziv
echo '<tr><th>'.$lang['srv_inv_field_salutation'].'</th><td>';
- echo '<input type="text" id="rec_salutation" value="'.$sql_row['salutation'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_salutation" value="'.$sql_row['salutation'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#telefon
echo '<tr><th>'.$lang['srv_inv_field_phone'].'</th><td>';
- echo '<input type="text" id="rec_phone" value="'.$sql_row['phone'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_phone" value="'.$sql_row['phone'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#drugo
echo '<tr><th>'.$lang['srv_inv_field_custom'].'</th><td>';
- echo '<input type="text" id="rec_custom" value="'.$sql_row['custom'].'" autocomplete="off" maxlength="100">';
+ echo '<input type="text" class="text medium" id="rec_custom" value="'.$sql_row['custom'].'" autocomplete="off" maxlength="100">';
echo '</td></tr>';
#odnos
if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
echo '<tr><th>'.$lang['srv_inv_field_relation'].'</th><td>';
- echo '<input type="text" id="rec_relation" value="'.$sql_row['relation'].'" autocomplete="off" maxlength="100">';
+ echo '<input type="text" class="text medium" id="rec_relation" value="'.$sql_row['relation'].'" autocomplete="off" maxlength="100">';
echo '</td></tr>';
}
echo '</table>';
-
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
- echo '<span id="save_recipients" class="buttonwrapper floatRight" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_save_recipient();return false;" ><span>'.$lang['srv_inv_recipient_save'].'</span></a></span>';
+ $button_check = 1;
}
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr"/>';
- echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_cancel'].'" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['edit1338'].'</button>';
+ if($button_check)
+ echo '<button class="medium blue" onclick="inv_save_recipient(); return false;">'.$lang['srv_inv_recipient_save'].'</button>';
+ echo '</div>';
}
function saveRecipient() {
@@ -5948,6 +6070,14 @@ class SurveyInvitationsNew {
ob_flush();
}
+
+ // Izvozimo paket qr kod - NIJZ
+ private function exportRecipients_qr_codes(){
+ global $lang;
+
+ $qr = new SurveyNIJZQR($this->sid);
+ $qr->getQRCodes();
+ }
function onlyThisSurvey() {
session_start();
@@ -5977,6 +6107,7 @@ class SurveyInvitationsNew {
// Dodamo vse userje v bazo podatkov kot respondente
function add_users_to_database() {
+ global $lang, $global_user_id;
// Preverimo ce je vklopljen modul za volitve
$voting = SurveyInfo::getInstance()->checkSurveyModule('voting');
@@ -6035,6 +6166,10 @@ class SurveyInvitationsNew {
$strInsertDataText = array();
$strInsertUserbase = array();
$strInsertUserstatus = array();
+ $send_ok_ids = array();
+ $send_error_ids = array();
+ $strInsertDataVrednost = array();
+ $strInsertDataText = array();
foreach ($send_users_data AS $user_data) {
// Pri volitvah zaradi anonimizacije ignoriramo vse identifikatorje
@@ -6074,8 +6209,8 @@ class SurveyInvitationsNew {
# dodamo še podatke za posameznega userja za sistemske spremenljivke
foreach ($sys_vars AS $sid => $spremenljivka) {
- $_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
- if (trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
+ $_user_variable = isset($this->inv_variables_link[$spremenljivka['variable']]) ? $this->inv_variables_link[$spremenljivka['variable']] : null;
+ if ($_user_variable !== null && trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
if($spremenljivka['variable'] == 'odnos')
$strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($user_data[$_user_variable])]."','".$usr_id."')";
else
@@ -6103,13 +6238,13 @@ class SurveyInvitationsNew {
if(!$voting){
# vstavimo v srv_data_text
- if (count($strInsertDataText) > 0) {
+ if (is_countable($strInsertDataText) && count($strInsertDataText) > 0) {
$strInsert = "INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ";
$strInsert .= implode(',',$strInsertDataText);
sisplet_query($strInsert);
}
# vstavimo v srv_data_vrednost
- if (count($strInsertDataVrednost) > 0) {
+ if (is_countable($strInsertDataVrednost) && count($strInsertDataVrednost) > 0) {
$strInsert = "INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES ";
$strInsert .= implode(',',$strInsertDataVrednost);
sisplet_query($strInsert);
@@ -6143,7 +6278,7 @@ class SurveyInvitationsNew {
}
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init();
Common::getInstance()->updateEditStamp();
$this->viewRecipients(/*array(),$msg*/);
@@ -6151,7 +6286,7 @@ class SurveyInvitationsNew {
// Dodamo samo izbrane userje v bazo podatkov kot respondente
function add_checked_users_to_database() {
- global $site_url;
+ global $lang, $site_url, $global_user_id;
// Prejemniki, ki jih ročno dodajamo med respondente
$inv_rids = $_POST['inv_rids'];
@@ -6170,14 +6305,17 @@ class SurveyInvitationsNew {
$sys_vars_ids[] =$row['id'];
}
$sqlVrednost = sisplet_query("SELECT spr_id, id AS vre_id, vrstni_red, variable FROM srv_vrednost WHERE spr_id IN(".implode(',',$sys_vars_ids).") ORDER BY vrstni_red ASC ");
- while ($row = mysqli_fetch_assoc($sqlVrednost)) {
- // Ce gre za odnos imamo radio
- if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
- if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
- $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
- }
- elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
- $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+
+ if($sqlVrednost !== false){
+ while ($row = mysqli_fetch_assoc($sqlVrednost)) {
+ // Ce gre za odnos imamo radio
+ if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
+ if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
+ $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
+ }
+ elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
+ $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+ }
}
}
@@ -6196,6 +6334,9 @@ class SurveyInvitationsNew {
$strInsertDataText = array();
$strInsertUserbase = array();
$strInsertUserstatus = array();
+ $strInsertDataVrednost = array();
+ $send_ok_ids = array();
+ $send_error_ids = array();
foreach ($send_users_data AS $user_data) {
$strInsert = "INSERT INTO srv_user (ank_id, email, cookie, pass, last_status, time_insert, inv_res_id) VALUES ('".$this->sid."', '".$user_data['email']."', '".$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)";
@@ -6213,8 +6354,8 @@ class SurveyInvitationsNew {
# dodamo še podatke za posameznega userja za sistemske spremenljivke
foreach ($sys_vars AS $sid => $spremenljivka) {
- $_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
- if (trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
+ $_user_variable = isset($this->inv_variables_link[$spremenljivka['variable']]) ? $this->inv_variables_link[$spremenljivka['variable']] : null;
+ if ($_user_variable !== null && $user_data[$_user_variable] != null && trim($user_data[$_user_variable]) != '') {
if($spremenljivka['variable'] == 'odnos')
$strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($user_data[$_user_variable])]."','".$usr_id."')";
else
@@ -6277,7 +6418,7 @@ class SurveyInvitationsNew {
print_r("</pre>");
}
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init();
Common::getInstance()->updateEditStamp();
header('location: ' . $site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients');
@@ -6289,6 +6430,9 @@ class SurveyInvitationsNew {
# če imamo dodatne omejitve source_type > 0 (arhivi, seznami) dodamo dodatno kontrolo na id-je respondentov
$advancedConditionJoin = '';
$advancedCondition = '';
+ $sql_sub_condition = '';
+ $sub_query = '';
+
if ($source_type == 0)
{
$this->user_inv_ids = array();
@@ -6453,75 +6597,65 @@ class SurveyInvitationsNew {
#trenutna stran
$page = isset($_GET['page']) ? $_GET['page'] : '1';
- $current = is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
+ $current = isset($_GET['page']) && is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
$all = ceil($all_records / REC_ON_PAGE);
# current nastavimo na zadnji element
if ( $all > 1) {
+ echo '<div class="pagination_holder">';
+
echo '<div id="pagination">';
- $baseUrl = $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients&page=';
- # povezava -10
- if ($all > 10) {
- if ($current - 10 >= 0) {
- echo('<div><a href="'.$baseUrl.($current - 10).'">-10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">-10</div>');
- }
- }
+ $baseUrl = $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients&page=';
# povezava na prejšnjo stran
$prev_page = $current - 1 ? $current - 1 :$current;
if( ($current - 1) >= 1) {
- echo('<div><a href="'.$baseUrl.$prev_page.'">'.$lang['previous_page_short'].'</a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$prev_page.'" title="'.$lang['previous_page_short'].'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage">'.$lang['previous_page_short'].'</div>');
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
}
# povezave za vmesne strani
$middle = $all / 2;
$skipped = false;
for($a = 1; $a <= $all; $a++) {
- if ($all < ((GROUP_PAGINATE+1) * 2) || $a <= GROUP_PAGINATE || $a > ($all-GROUP_PAGINATE)
-
- || ( abs($a-$current) < GROUP_PAGINATE)) {
+
+ if ($all < ((GROUP_PAGINATE+1) * 2) || $a <= GROUP_PAGINATE || $a > ($all-GROUP_PAGINATE) || ( abs($a-$current) < GROUP_PAGINATE)){
if ($skipped == true) {
- echo '<div class="spacePage">.&nbsp;.&nbsp;.</div>';
+ echo '<div class="page_space">...</div>';
$skipped = false;
}
+
if($a == $current) {
# brez href povezave
- echo('<div class="currentPage">'.($a).'</div>');
- } else {
- echo('<div><a href="'.$baseUrl.$a.'">'.($a).'</a></div>');
+ echo '<div class="page_number currentPage">'.$a.'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$a.'"><div class="page_number">'.$a.'</div></a>';
}
- } else {
+ }
+ else {
$skipped = true;
}
}
+
# povezava na naslednjo stran
$next_page = ($current + 1) ? ($current + 1) : $current;
if(($current ) < $all) {
- echo('<div><a href="'.$baseUrl.$next_page.'">'.$lang['next_page_short'].'</a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$next_page.'" title="'.$lang['next_page_short'].'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage">'.$lang['next_page_short'].'</div>');
- }
- if ($all > 10) {
- if ($current + 10 < $all) {
- echo('<div><a href="'.$baseUrl.($current + 10).'">+10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">+10</div>');
- }
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
}
- $rec_on_page = $all != $current ? REC_ON_PAGE : ( $all_records - ($all-1)*REC_ON_PAGE);
- echo '<div class="justtext">'.$lang['srv_inv_pagination_shown'].$rec_on_page.$lang['srv_inv_pagination_shown_records'].'</div>';
+ echo '</div>';
+
echo '</div>';
}
}
@@ -6561,39 +6695,49 @@ class SurveyInvitationsNew {
global $lang;
echo '<div id="inv_recipients_profile_name">';
- echo $lang['srv_inv_message_draft_new_save'].':&nbsp;';
- # polovimo vsa sporočila
- $sql_string = "SELECT * FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
- $sql_query = sisplet_query($sql_string);
+ echo '<h2>'.$lang['message'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
- echo '<select onchange="inv_new_message_list_change(this);" autofocus="autofocus" tabindex="2">';
- echo '<option value="0" selected="selected" class="gray bold">'.$lang['srv_inv_message_draft_new'].'</option>';
- $messages = array();
- while ( $row = mysqli_fetch_assoc($sql_query) ) {
- $messages[$row['id']] = $row;
- #'.((int)$_POST['mid'] == $row['id'] ? ' selected="selected"' : '').'
- echo '<option value="'.$row['id'].'" comment="'.$row['comment'].'">'.$row['naslov'].'</option>';
- }
- echo '</select>';
- #'.((int)$_POST['mid'] > 0 ? ' class="displayNone"' : '').'
- echo '<span id="new_message_list_span">';
- echo '<br><br/>';
- echo '<label>'.$lang['srv_inv_message_rename_new_name'];
+
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_draft_new_save'].':</span>';
+
+ # polovimo vsa sporočila
+ $sql_string = "SELECT * FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+
+ echo ' <select onchange="inv_new_message_list_change(this);" class="dropdown medium" autofocus="autofocus" tabindex="2">';
+ echo ' <option value="0" selected="selected" class="gray bold">'.$lang['srv_inv_message_draft_new'].'</option>';
+ $messages = array();
+ while ( $row = mysqli_fetch_assoc($sql_query) ) {
+ $messages[$row['id']] = $row;
+ echo ' <option value="'.$row['id'].'" comment="'.$row['comment'].'">'.$row['naslov'].'</option>';
+ }
+ echo ' </select>';
+ echo '</div>';
+
+
+ echo '<div id="new_message_list_span" class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_rename_new_name'].'</span>';
$newName = $this->generateMessageName();
+ echo ' <input type="text" id="rec_profile_name" class="text medium" value="'.$newName.'" tabindex="1" autofocus="autofocus">';
+ echo '</div>';
- echo '<input type="text" id="rec_profile_name" value="'.$newName.'" tabindex="1" autofocus="autofocus">';
- echo '</label>';
- echo '</span>';
- echo '<br/><br/>';
- echo $lang['srv_inv_message_draft_list_comment'];
- #.((int)$_POST['mid'] > 0 ? $messages[(int)$_POST['mid']]['comment'] : '').
- echo '<textarea id="inv_message_comment" tabindex="3" rows="2" style="width:200px;"></textarea>';
- echo '<br class="clr" /><br class="clr" />';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_message_save_details(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr" />';
- echo '</div>'; # id="inv_view_arch_recipients"
+
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_draft_list_comment'].'</span>';
+ echo ' <textarea id="inv_message_comment" tabindex="3" rows="2"></textarea>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" >'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" onclick="inv_message_save_details(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+
+ echo '</div>';
}
@@ -6619,7 +6763,7 @@ class SurveyInvitationsNew {
if ( $sqlQuery != 1) {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
sisplet_query("COMMIT");
@@ -6638,7 +6782,7 @@ class SurveyInvitationsNew {
$sqlQuery = sisplet_query($sql_string);
} else {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
sisplet_query("COMMIT");
}
@@ -6806,9 +6950,9 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- #echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -6816,7 +6960,9 @@ class SurveyInvitationsNew {
}
function showArchiveRecipients($_arch_id = null, $archType = 'all') {
global $lang,$site_url,$global_user_id;
- echo '<div id="inv_view_arch_recipients" class="fromArchive">';
+
+ echo '<div id="inv_view_arch_recipients" class="fromArchive" style="max-height:90vh;overflow:scroll;">';
+
if ($_arch_id == null) {
$_arch_id = $_POST['aid'];
}
@@ -6984,9 +7130,9 @@ class SurveyInvitationsNew {
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- #echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -7029,9 +7175,10 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="inv_arch_save_comment(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -7070,21 +7217,20 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- #echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
echo '</div>';
-
echo '</div>';
}
function showInvitationStatus() {
- global $admin_type, $app_settings, $global_user_id;
+ global $admin_type, $global_user_id;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
$d = new Dostop();
- echo '<table style="width:50%"><tr>';
+ echo '<div class="invitations_holder half-half invitations_status">';
// Pri volitvah prikazemo samo osnovne stevilke - zaradi anonimizacije ni trackinga
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
@@ -7093,354 +7239,25 @@ class SurveyInvitationsNew {
// 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) {
+ else{
$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->displayInvitationStatusNew();
- echo '</td>';
}
}
- # star način brez trackinga
- else {
- echo '<td style="padding-right:10px;vertical-align: top;">';
- $this->displayInvitationStatusOld();
- echo '</td>';
- }
- echo '</tr></table>';
- }
-
- function displayInvitationStatusOld() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path;
-
- $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
-
- # polovimo lurkerje
- echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
- echo '<div class="inv_filedset_inline_div">';
- echo '<p>';
- if ((int)$isEmail > 0) {
-
- # preštejemo respondente po statusu
- $recipients_by_status = array();
- $sql_string = "SELECT count(*) as cnt, last_status FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' GROUP BY last_status";
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0) {
- while($row = mysqli_fetch_assoc($sql_query)) {
- $recipients_by_status['all'] += (int)$row['cnt'];
- switch ((int)$row['last_status']) {
- # 0 - E-pošta - ni poslana
- case 0:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- break;
- # 1 - E-pošta - neodgovor
- case 1:
- $recipients_by_status['send'] += (int)$row['cnt'];
- break;
- # 2 - E-pošta - napaka
- case 2:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- $recipients_by_status['error'] += (int)$row['cnt'];
- break;
- # 3 - klik na nagovor
- case 3:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 4 - klik na anketo
- case 4:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 5 - delno prazna
- case 5:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 6 - končana
- case 6:
- $recipients_by_status['send'] += (int)$row['cnt'];
- #$recipients_by_status['clicked'] += (int)$row['cnt'];
- $recipients_by_status['finished'] += (int)$row['cnt'];
- break;
- # null - neznan
- default:
- $recipients_by_status['unknown'] += (int)$row['cnt'];
- break;
- }
- }
- $all_rec_in_survey = (int)$recipients_by_status['all'];
-
- echo '<table class="inv_dashboard_table">';
- echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
- echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>-</th>';
- echo '<th>100%</th>';
- echo '</tr>';
- #popslano enotam
- echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
- echo '<th>'.(int)$recipients_by_status['send'].'</th>';
- echo '<th>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
- echo '<th>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
- echo '</tr>';
-
- #neodgovori
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
- $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
- echo '<td>'.$unanswered.'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
- echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
-
- #če se slučajno pojavijo kaki neznani statusi
- if ((int)$recipients_by_status['unknown'] > 0) {
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
- echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
- }
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
- echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
- echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
- echo '</table>';
- echo '<br>';
- # zloopamo še po posameznih pošiljanjih
- $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."' AND cnt_succsess > 0 ORDER BY sia.date_send ASC;";
- $sql_query_arc = sisplet_query($sql_string_arc);
-
- if (mysqli_num_rows($sql_query_arc) > 1) {
- $cnt=0;
- while($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
- $cnt++;
- # preštejemo respondente po statusu
- $recipients_by_status = array();
- $sql_string = "SELECT count(*) as cnt, last_status FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' AND id IN (select rec_id from srv_invitations_archive_recipients where arch_id = ".$row_arc['id']." AND success !='0') GROUP BY last_status";
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0) {
- while($row = mysqli_fetch_assoc($sql_query)) {
- $recipients_by_status['all'] += (int)$row['cnt'];
- switch ((int)$row['last_status']) {
- # 0 - E-pošta - ni poslana
- case 0:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- break;
- # 1 - E-pošta - neodgovor
- case 1:
- $recipients_by_status['send'] += (int)$row['cnt'];
- break;
- # 2 - E-pošta - napaka
- case 2:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- $recipients_by_status['error'] += (int)$row['cnt'];
- break;
- # 3 - klik na nagovor
- case 3:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 4 - klik na anketo
- case 4:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 5 - delno prazna
- case 5:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 6 - končana
- case 6:
- $recipients_by_status['send'] += (int)$row['cnt'];
- #$recipients_by_status['clicked'] += (int)$row['cnt'];
- $recipients_by_status['finished'] += (int)$row['cnt'];
- break;
- # null - neznan
- default:
- $recipients_by_status['unknown'] += (int)$row['cnt'];
- break;
- }
- }
- $avtor_email = iconv("iso-8859-2", "utf-8",trim ($row_arc['email']));
- $avtor = array();
- if (trim($row_arc['name'])) {
- $avtor[] = trim ($row_arc['name']);
- }
- if (trim($row_arc['surname'])) {
- $avtor[] = trim ($row_arc['surname']);
- }
- if ( count($avtor) > 0 ) {
- $avtor_name = implode(' ',$avtor);
- } else {
- $avtor_name = $avtor_email;
- }
-
- echo '<span class="pointer span_list_archive" onClick="$(this).next().next().next().toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle(); $(this).next(\'.link_archive\').toggle();">';
- echo '<span class="inv_dashboard_sub_title as_link">';
- echo '<span class="plus" style="color: inherit;">+ </span>';
- echo '<span class="minus displayNone" style="color: inherit;">- </span>';
- echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
- echo '</span>';
- echo '<span class="inv_dashboard_sub_detail" title="'.$avtor_email.'">'.$avtor_name.'</span>';
- echo ', ';
- echo '<span class="inv_dashboard_sub_detail" >'.$row_arc['ds'].'</span>';
- echo '</span>';
- echo '<span class="link_archive as_link displayNone" ><a href="#" onclick="inv_arch_show_details(\''.$row_arc['id'].'\'); return false;"> arhiv </a></span>';
- echo '<br/>';
-
- echo '<table class="inv_dashboard_table sub displayNone">';
- echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
-
- echo '<th>'.(int)$all_rec_in_survey.'</th>';
- #echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>&nbsp;</th>';
- echo '<th>100%</th>';
- echo '</tr>';
- #popslano enotam
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</td>';
- echo '<td>'.(int)$recipients_by_status['send'].'</td>';
- echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
-
-
- #neodgovori
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
- $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
- echo '<td>'.$unanswered.'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
- echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
-
- #če se slučajno pojavijo kaki neznani statusi
- if ((int)$recipients_by_status['unknown'] > 0) {
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
- echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
- }
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
- echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
- echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
- echo '</table>';
- }
-
- }
-
- }
- } else {
- #Vabil še nismo pošiljali
- echo $lang['srv_inv_dashboard_empty'].' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=add_recipients_view">'.$lang['srv_inv_dashboard_add_link'].'</a>';
- }
-
- } else {
- echo $lang['srv_inv_dashboard_not_enabled'];
- }
- echo '</p>';
echo '</div>';
- echo '</fieldset>';
-
- #pošiljanje po enotah
- $cnt_by_sendings = array();
- $all_units_count = 0;
- # najprej koliko enotam še ni bilo poslano
- $sel = "select count(*) FROM srv_invitations_recipients WHERE ank_id='$this->sid' AND sent = '0'";
- $query = sisplet_query($sel);
- list($count) = mysqli_fetch_row($query);
- if ($count > 0) {
- $cnt_by_sendings[0] = (int)$count;
- }
- $all_units_count = (int)$count;
- $sel1 = "select count(*) as cnt, rec_id FROM srv_invitations_archive_recipients WHERE arch_id in (select id from srv_invitations_archive where ank_id = '".$this->sid."') AND success !='0' group by rec_id ORDER BY cnt ASC;";
- $query1 = sisplet_query($sel1);
-
- while (list($count, $rec_id) = mysqli_fetch_row($query1)) {
- $cnt_by_sendings[(int)$count] ++;
- $all_units_count++;
- }
- if (count($cnt_by_sendings) > 0) {
- echo '<fieldset class="inv_fieldset">';
- echo '<legend >';
- echo '<span class="pointer legend" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
- echo '<span class="plus red strong">+ </span>';
- echo '<span class="minus red strong displayNone">- </span>';
- echo $lang['srv_inv_nav_email_sending_status'];
- echo '</span>';
- echo Help::display('srv_inv_cnt_by_sending');
- echo '</legend>';
- echo '<br/>';
- echo '<div class="inv_filedset_inline_div displayNone">';
- echo '<table style="border-spacing: 0px;padding: 0px;margin: 0px;">';
- 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>';
- 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>';
- }
}
// Prikaz statusov posiljanj
private function displayInvitationStatusNew() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@@ -7449,9 +7266,9 @@ class SurveyInvitationsNew {
// 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>';
+ echo '<fieldset class="left_holder inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+
+ echo '<div class="inv_filedset_inline_div">';
#koliko je vseh uporabnikov v bazi
$sql_query = sisplet_query("SELECT count(*) as cnt FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted ='0'");
@@ -7566,31 +7383,43 @@ class SurveyInvitationsNew {
break;
}
}
- echo '<table class="inv_dashboard_table">';
+
+
+ echo '<table class="inv_dashboard_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleOdstotek'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleKumulativa'].'</th>';
+ echo '</tr>';
+
echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
- echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>-</th>';
- echo '<th>100%</th>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<td>'.(int)$recipients_by_status['all'].'</th>';
+ echo '<td>-</th>';
+ echo '<td>100%</th>';
echo '</tr>';
+
#popslano enotam
echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
- echo '<th>'.(int)$recipients_by_status['send'].'</th>';
- echo '<th>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
- echo '<th>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
+ echo '<td>'.(int)$recipients_by_status['send'].'</th>';
+ echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
echo '</tr>';
#neodgovori
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
$unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
echo '<td>'.$unanswered.'</td>';
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
echo '</tr>';
+
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
@@ -7599,20 +7428,21 @@ class SurveyInvitationsNew {
#če se slučajno pojavijo kaki neznani statusi
if ((int)$recipients_by_status['unknown'] > 0) {
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
echo '</tr>';
}
+
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
echo '</tr>';
+
echo '</table>';
- echo '<br>';
# POSAMEZNA pošiljanja
@@ -7622,9 +7452,11 @@ class SurveyInvitationsNew {
foreach ($archive_data AS $uid => $status) {
if ((int)$status == 6 && $user_lurker[$uid] == 1) {
$user_by_status_for_archive[$archive_id]['6l']++;
- } else if ((int)$status == 5 && $user_lurker[$uid] == 1) {
+ }
+ elseif ((int)$status == 5 && $user_lurker[$uid] == 1) {
$user_by_status_for_archive[$archive_id]['5l']++;
- } else {
+ }
+ else {
$user_by_status_for_archive[$archive_id][$status]++;
}
@@ -7637,8 +7469,10 @@ class SurveyInvitationsNew {
foreach ($user_by_status_for_archive AS $arch_id => $archive_data) {
$cnt++;
if (count($archive_data ) > 0) {
+
$recipients_by_status = array();
$recipients_by_status['all']=(int)$array_archive_subdata[$arch_id]['rec_in_db'];
+
foreach ($archive_data AS $status => $cntUsers) {
# 0 - E-pošta - ni poslana
if( $status == '0') {
@@ -7696,24 +7530,21 @@ class SurveyInvitationsNew {
}
$all_rec_in_survey = (int)$recipients_by_status['all'];
- echo '<span class="pointer span_list_archive" onClick="$(this).next().next().next().toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle(); $(this).next(\'.link_archive\').toggle();">';
-
- echo '<span class="inv_dashboard_sub_title as_link">';
- echo '<span class="plus" style="color: inherit;">+ </span>';
- echo '<span class="minus displayNone" style="color: inherit;">- </span>';
- echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
- echo '</span>';
-
- // avtor
- echo '<span style="font-size: 13px;" title="'.$avtor_email.'">'.$avtor_name.'</span>';
+
+ echo '<div class="arhiv_holder">';
+
+
+ echo '<div class="arhiv_info_holder" >';
- // datum
- echo ', ';
- echo '<span style="font-size: 13px;">'.$array_archive_subdata[$arch_id]['ds'].'</span>';
+ echo '<span class="inv_dashboard_sub_title as_link" onClick="$(this).parent().next().toggleClass(\'displayNone\'); $(this).find(\'.plus\').toggleClass(\'displayNone\'); $(this).find(\'.minus\').toggleClass(\'displayNone\');">';
+ echo ' <span class="plus">+ </span>';
+ echo ' <span class="minus displayNone">- </span>';
+ echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
+ echo '</span> ';
+ echo $lang['sent_by2'].': '.$avtor_name.', '.$array_archive_subdata[$arch_id]['ds'].', ';
+
// nacin posiljanja
- echo ', ';
- echo '<span style="font-size: 13px;">';
if ($array_archive_subdata[$arch_id]['tip'] == '0')
echo '<span>'.$lang['srv_inv_message_noemailing_type1'].'</span>';
elseif($array_archive_subdata[$arch_id]['tip'] == '1')
@@ -7722,23 +7553,30 @@ class SurveyInvitationsNew {
echo '<span>'.$lang['srv_inv_message_noemailing_type3'].'</span>';
else
echo '<span>'.$lang['email'].'</span>';
- echo '</span>';
-
- echo '</span>';
+
+ echo '</div>';
+
+ // Skriti spodnji del (arhiv link + tabela)
+ echo '<div class="arhiv_sub_holder displayNone">';
+
// arhiv
- echo '<span class="link_archive as_link displayNone" style="margin-left:10px;"><a href="#" onclick="inv_arch_show_recipients(\''.$array_archive_subdata[$arch_id]['id'].'\'); return false;"> arhiv </a></span>';
- echo '<br/>';
+ echo '<a href="#" class="noline" onclick="inv_arch_show_recipients(\''.$array_archive_subdata[$arch_id]['id'].'\'); return false;">'.$lang['srv_archive'].'</a>';
-
- echo '<table class="inv_dashboard_table sub displayNone">';
+ echo '<table class="inv_dashboard_table sub">';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleOdstotek'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleKumulativa'].'</th>';
+ echo '</tr>';
+
echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
- echo '<th>'.(int)$all_rec_in_survey.'</th>';
- #echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>&nbsp;</th>';
- echo '<th>100%</th>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<td>'.(int)$all_rec_in_survey.'</th>';
+ echo '<td>&nbsp;</th>';
+ echo '<td>100%</th>';
echo '</tr>';
# poslano enotam
@@ -7792,41 +7630,39 @@ class SurveyInvitationsNew {
}
echo '</table>';
-
+
+ echo '</div>';
+
+ echo '</div>';
}
}
}
- } else {
+ }
+ else {
// Imamo sezname, ni pa poslanih vabil
if ((int)$cnt_all_in_db > 0){
echo $lang['srv_inv_dashboard_has_list2'];
- //echo '<p class="spaceLeft bold"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=add_recipients_view">'.$lang['srv_inv_dashboard_add_list'].'</a></p>';
echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_message">'.$lang['srv_inv_message_draft_send'].'</a></div>';
- echo '<br />';
-
- //echo '<p class="spaceLeft bold"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=view_recipients">'.$lang['srv_inv_dashboard_view_list'].'</a></p>';
}
// Ni seznamov in ni poslanih vabil
else{
echo $lang['srv_inv_dashboard_empty'];
- //echo '<p class="spaceLeft bold"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=add_recipients_view">'.$lang['srv_inv_dashboard_add_list'].'</a></p>';
echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
- echo '<br /><br />';
}
}
-
- 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 '<fieldset class="left_holder 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'];
@@ -7838,9 +7674,9 @@ class SurveyInvitationsNew {
else {
echo '&nbsp;<a href="#" onclick="enableEmailInvitation(this);">'.$lang['srv_omogoci'].'</a>';
}
-
- echo '</p>';
+
echo '</div>';
+
echo '</fieldset>';
}
@@ -7850,14 +7686,13 @@ class SurveyInvitationsNew {
$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 '<fieldset class="right_holder 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();">';
@@ -7868,9 +7703,9 @@ class SurveyInvitationsNew {
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;"/>';
@@ -7899,14 +7734,16 @@ class SurveyInvitationsNew {
echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
echo '</tr>';
echo '</table>';
+
echo '</div>';
+
echo '</fieldset>';
}
}
// Prikaz statusov posiljanj pri volitvah
private function displayInvitationStatusVoting() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@@ -8046,19 +7883,11 @@ class SurveyInvitationsNew {
function showInvitationSettings() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
$row = $this->surveySettings;
$_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
- $sqlu = sisplet_query("SELECT email FROM users WHERE id='".$global_user_id."'");
- $rowu = mysqli_fetch_array($sqlu);
- if ($rowu['email'] == '') {
- $sqlm = sisplet_query("SELECT * FROM misc WHERE what = 'AlertFrom'");
- $rowm = mysqli_fetch_array($sqlm);
- $rowu['email'] = $rowm['value'];
- }
-
$userAccess = UserAccess::getInstance($global_user_id);
$noEmailing = SurveySession::get('inv_noEmailing');
@@ -8069,7 +7898,9 @@ class SurveyInvitationsNew {
// Vklop vabil
if ($_email == 0) {
- echo '<fieldset class="inv_fieldset" style="max-width:800px; padding-bottom:15px;"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
+ echo '<div class="invitations_holder fullwidth invitations_switch">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
@@ -8089,32 +7920,35 @@ class SurveyInvitationsNew {
echo $text3;
echo '</p>';
+
// Gumb OMOGOCI VABILA
+ echo '<div class="button_holder below">';
+
$text_button = (Common::checkModule('gorenje')) ? str_replace('1KA', 'ESurvey', $lang['srv_invitation_nonActivated_button_activate']) : $lang['srv_invitation_nonActivated_button_activate'];
- echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="enableEmailInvitation(\'1\');">'.$text_button.'</a></span>';
- //echo '<span class="spaceLeft bold" style="line-height:25px;"><a href="https://www.1ka.si/c/804/Email_vabila/?preid=793&from1ka=1">'.$lang['srv_invitation_nonActivated_more'].'</a></span>';
- echo '<br />';
+ echo '<button class="blue medium" onclick="enableEmailInvitation(\'1\');">'.$text_button.'</button>';
+
+ echo '</div>';
+
echo '</div>';
echo '</fieldset>';
+
+ echo '</div>';
}
// Vabila so vklopljena - NASTAVITVE
else{
if($noEmailing == 1){
- echo '<table class="invitations_settings" style="width:50%;">';
+ echo '<div class="invitations_holder fullwidth invitations_settings">';
}
else{
- echo '<table class="invitations_settings" style="width:100%;">';
- echo '<colgroup style="width:48%;"></colgroup>';
- echo '<colgroup style="width:48%;"></colgroup>';
+ echo '<div class="invitations_holder half-half invitations_settings">';
}
- echo '<tr>';
-
-
+
// Leva stran - navadne nastavitve
- echo '<td style="padding-right:20px;vertical-align: top;">';
+ echo '<div class="left_holder">';
+
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_invitations_settings_general'].' '.Help::display('srv_inv_general_settings').'</legend>';
echo '<div class="inv_filedset_inline_div">';
@@ -8126,120 +7960,209 @@ class SurveyInvitationsNew {
$voting_disabled = ' disabled';
// Warning za volitve
- echo '<p class="red bold">'.$lang['srv_voting_warning'].'</p>';
+ echo '<div class="setting_holder red bold">'.$lang['srv_voting_warning'].'</div>';
}
+
$individual = (int)$this->surveySettings['individual_invitation'];
// Individualizirana vabila - GLAVNA NASTAVITEV
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_user_base_individual_invitaition'];
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_user_base_individual_invitaition'];
if($individual == 0)
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"' : '').' '.$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>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="individual_invitation" value="0" id="individual_invitation_0"'.($individual == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>';
+ echo ' <label for="individual_invitation_0">'.$lang['no1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="individual_invitation" value="1" id="individual_invitation_1"'.($individual == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>';
+ echo ' <label for="individual_invitation_1">'.$lang['yes'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Ce niso indvidualizirana imamo samo nacin posiljanja
if ($individual == 0) {
// 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"' : '').' '.$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>';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_0" '.($noEmailing == 0 ? 'checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');">';
+ echo ' <label for="inv_messages_noEmailing_0">'.$lang['srv_inv_message_noemailing_0'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1" '.($noEmailing == 1 ? 'checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');">';
+ echo ' <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Nacin dokumentiranja (posta, sms, drugo)
if($noEmailing == 1){
$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"' : '').' '.$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>';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type_external'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="0" id="noMailType1" '.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />';
+ echo ' <label for="noMailType1">'.$lang['srv_inv_message_noemailing_type1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="1" id="noMailType2" '.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />';
+ echo ' <label for="noMailType2">'.$lang['srv_inv_message_noemailing_type2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="2" id="noMailType3" '.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />';
+ echo ' <label for="noMailType3">'.$lang['srv_inv_message_noemailing_type3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
}
# Normalna vabila z unikatinim URL
else {
// 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"' : '').' '.$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>';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_0"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');">';
+ echo ' <label for="inv_messages_noEmailing_0">'.$lang['srv_inv_message_noemailing_0'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');">';
+ echo ' <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Nacin dokumentiranja (posta, sms, drugo)
if($noEmailing == 1){
$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"' : '').' '.$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>';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type_external'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="0" id="noMailType1" '.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />';
+ echo ' <label for="noMailType1">'.$lang['srv_inv_message_noemailing_type1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="1" id="noMailType2" '.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />';
+ echo ' <label for="noMailType2">'.$lang['srv_inv_message_noemailing_type2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="2" id="noMailType3" '.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />';
+ echo ' <label for="noMailType3">'.$lang['srv_inv_message_noemailing_type3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// Vnos kode - samo ce je email (drugace itak vedno rocni vnos)
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"' : '').' '.$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>';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['usercode_required1'].':'.Help::display('usercode_required').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <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);">';
+ echo ' <label for="usercode_required_0">'.$lang['usercode_required2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <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);">';
+ echo ' <label for="usercode_required_1">'.$lang['usercode_required3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
if ($row['usercode_required'] != 0) {
- echo '<p>';
+
+ echo '<div class="setting_holder">';
+
if($noEmailing == 1)
- echo '<label class="lbl_email_setting">'.$lang['usercode_text2'].': </label><br />';
+ echo '<label>'.$lang['usercode_text2'].':</label>';
else
- echo '<label class="lbl_email_setting">'.$lang['usercode_text'].': </label><br />';
+ echo '<label>'.$lang['usercode_text'].':</label>';
+
$nagovorText = ($row['usercode_text'] && $row['usercode_text'] != null && $row['usercode_text'] != "") ? $row['usercode_text'] : $lang['srv_basecode'];
- echo '<textarea style="width:430px; margin-left:15px; margin-top:5px;" name="usercode_text" onblur="surveyBaseSettingText(\'usercode_text\',false);return false;">'.$nagovorText.'</textarea>';
- echo '</p>';
+ echo ' <textarea style="width:100%; height:65px;" name="usercode_text" onblur="surveyBaseSettingText(\'usercode_text\',false);return false;">'.$nagovorText.'</textarea>';
+
+ echo '</div>';
}
+
// Dostop brez kode
-
-
- echo '<p><label for="usercode_skip_0" class="lbl_email_setting">';
- echo $lang['srv_user_base_access_check'].' '.Help::display('srv_inv_no_code');
- 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 '</label></p>';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_item">';
+ 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 ' <label for="usercode_skip_0" class="lbl_email_setting">'.$lang['srv_user_base_access_check'].' '.Help::display('srv_inv_no_code');
+ echo ' </div>';
+
+ echo '</div>';
+
if($row['usercode_skip'] > 0){
- echo '<div style="float: left; margin: -10px 0 0 15px;">';
- echo '<label class="lbl_email_setting">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </label>';
- echo '<label><input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['srv_vsi'].'</label>';
- echo '<label><input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['srv_setting_onlyAuthor'].'</label>';
- echo '</div>';
- }
+
+ echo '<div class="setting_holder">';
- /*echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </label>';
- echo '<label><input type="radio" name="usercode_skip" value="0" id="usercode_skip_0"'.($row['usercode_skip'] == 0 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['no1'].'</label>';
- echo '<label><input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['yes'].'</label>';
- echo '<label><input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['srv_setting_onlyAuthor'].'</label>';
- echo '<br/><i class="small">* '.$lang['srv_user_base_access_alert_'.$row['usercode_skip'].''].'</i>';
- echo '</p>';*/
+ echo ' <div class="setting_title">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);">';
+ echo ' <label for="usercode_skip_1">'.$lang['srv_vsi'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);">';
+ echo ' <label for="usercode_skip_2">'.$lang['srv_setting_onlyAuthor'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
- echo '<br />';
-
// Gumb shrani - samo provizorično
- echo '<div class="buttonwrapper"><a class="ovalbutton floatRight" href="#" title="'.$lang['save'].'">'.$lang['save'].'</a></div>';
- echo '<div class="buttonwrapper"><a class="ovalbutton floatRight spaceRight" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['save'].'">'.$lang['save'].'</button>';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view"><button class="blue medium">'.$lang['next1'].'</button></a>';
+ echo '</div>';
echo '</div>';
- echo '</div>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '</td>';
+
+ echo '</div>';
// desna stran - nastavitve streznika - samo ce imamo posiljanje preko emaila
@@ -8248,7 +8171,8 @@ class SurveyInvitationsNew {
// Gorenje tega nima
if (!Common::checkModule('gorenje')){
- echo '<td style="padding-right:10px;vertical-align: top;">';
+ echo '<div class="right_holder">';
+
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_email_setting_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
@@ -8256,19 +8180,23 @@ class SurveyInvitationsNew {
$this->viewServerSettings();
echo '</div>';
- echo '</div>';
+ echo '</div>';
echo '</fieldset>';
- echo '</td>';
+
+ echo '</div>';
}
}
- echo '</tr></table>';
+ echo '</div>';
}
}
# navadni uporabniki, ki nimajo dostopa - text kako lahko pridobijo dostop
else {
- echo '<fieldset class="inv_fieldset" style="max-width:800px; padding-bottom: 15px;"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
+
+ echo '<div class="invitations_holder fullwidth invitations_switch">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
@@ -8287,13 +8215,19 @@ class SurveyInvitationsNew {
echo $lang['srv_invitation_nonActivated_text3'];
echo '</p>';
+
// Gumb ZAPROSI ZA DOSTOP DO VABIL
- echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/objava/1ka-vabila/?from1ka=1">'.$lang['srv_invitation_nonActivated_button_details'].'</a></span>';
- //echo '<span class="spaceLeft bold" style="line-height:25px;"><a href="https://www.1ka.si/c/804/Email_vabila/?preid=793&from1ka=1">'.$lang['srv_invitation_nonActivated_more'].'</a></span>';
- echo '<br />';
+ echo '<div class="button_holder below">';
+ echo ' <a href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/objava/1ka-vabila/?from1ka=1" target="_blank">';
+ echo ' <button class="blue medium">'.$lang['srv_invitation_nonActivated_button_details'].'</button>';
+ echo ' </a>';
+ echo '</div>';
+
echo '</div>';
echo '</fieldset>';
+
+ echo '</div>';
}
}
@@ -8316,31 +8250,39 @@ class SurveyInvitationsNew {
function showInvitationLists($profile_id=null) {
global $lang,$global_user_id;
- echo '<h2>'.$lang['srv_inv_list_edit_header'].'</h2>';
+ echo '<div class="invitations_holder half-half invitation_lists">';
+
+
+ echo '<div class="left_holder">';
+ echo ' <div class="top_settings">';
+ echo ' <label>'.$lang['srv_inv_list_edit_list'].':</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="1" onclick="showInvitationListsNames();" checked="checked" autocomplete="off"><label for="inv_show_list_type1">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="0" onclick="showInvitationListsNames();" autocomplete="off"><label for="inv_show_list_type2">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type3" type="radio" value="2" onclick="showInvitationListsNames();" autocomplete="off"><label for="inv_show_list_type3">'.$lang['srv_inv_list_edit_from_archive'].'</label>';
+ echo ' </div>';
- echo '<table>';
- echo '<tr>';
- echo '<td style="vertical-align:top;min-height:500px; min-width:550px;">';
- echo '<div style="height:25px; width:100%; ">';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="1" onclick="showInvitationListsNames();" checked="checked" autocomplete="off">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="0" onclick="showInvitationListsNames();" autocomplete="off">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type3" type="radio" value="2" onclick="showInvitationListsNames();" autocomplete="off">'.$lang['srv_inv_list_edit_from_archive'].'</label>';
- echo '<label class="as_link spaceLeft" onclick="inv_upload_list();">'.$lang['srv_inv_list_upload_file'].'</label>';
- echo '</div>';
- echo '<div id="inv_edit_rec_list">';
+ echo ' <div class="setting_item">';
+ echo ' <a href="#" onclick="inv_upload_list();" class="noline">'.$lang['srv_inv_list_upload_file'].'</a>';
+ echo ' </div>';
+
+ echo ' <div id="inv_edit_rec_list">';
$this->showInvitationListsNames($profile_id);
+ echo ' </div>';
echo '</div>';
- echo '</td><td style="padding-left:20px; vertical-align:top;">';
- echo '<div id="inv_selected_rec_list">';
- $doEdit = $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true' ? true : false;
+
+
+ echo '<div id="inv_selected_rec_list" class="right_holder">';
+ $doEdit = (isset($_SESSION['inv_edit_rec_profile'][$this->sid]) && $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true') ? true : false;
if ($doEdit) {
$this->showEditRecList($profile_id);
- } else {
+ }
+ else {
$this->showNoEditRecList($profile_id);
}
echo '</div>';
- echo '</td></tr>';
- echo '</table>';
+
+
+ echo '</div>';
}
function showInvitationListsNames($profile_id=null) {
@@ -8348,7 +8290,7 @@ class SurveyInvitationsNew {
$onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 1;
if ($profile_id == null) {
- $pids = explode(',',$_POST['pids']);
+ $pids = explode(',',$this->invitationAdvancedConditionId);
} else {
$pids = explode(',',$profile_id);
}
@@ -8358,6 +8300,7 @@ class SurveyInvitationsNew {
$accPid = '';
$accStr = "SELECT DISTINCT pid FROM srv_invitations_recipients_profiles_access where uid = '$global_user_id'";
$accQry = sisplet_query($accStr);
+ $prefix = '';
while (list($pid) = mysqli_fetch_row($accQry)) {
$accPid .= $prefix ."'".$pid."'";
$prefix = ',';
@@ -8376,14 +8319,22 @@ class SurveyInvitationsNew {
$sql_query = sisplet_query($sql_string);
}
- if (mysqli_num_rows($sql_query)>0) {
+ if (mysqli_num_rows($sql_query) > 0) {
echo '<table class="inv_edit_rec_list">';
+
echo '<tr>';
- echo '<th>&nbsp;</th>';
- if ($onlyThisSurvey != 2) {
- echo '<th>&nbsp;</th>';
- echo '<th>&nbsp;</th>';
+
+ if ($onlyThisSurvey != 2) {
+ echo '<th class="edit">';
+ echo ' <input type="checkbox" id="inv_list_chck_all" onclick="inv_list_selectAll(this.checked);">';
+ echo ' <label for="inv_list_chck_all"></label>';
+ echo ' <a href="#" title="'.$lang['srv_invitation_recipients_delete_selected'].'" onclick="inv_recipients_list_action(\'delete\');"><span class="faicon delete"></span></a>';
+ echo '</th>';
}
+ else{
+ echo '<th></th>';
+ }
+
echo '<th>';
echo $lang['srv_inv_list_table_name'];
echo '</th>';
@@ -8400,24 +8351,34 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_list_table_author'];
echo '</th>';
echo '</tr>';
+
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
echo '<tr>';
- echo '<td>';
- echo '<input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'],$pids) ? ' checked="checked"' : '').'autocomplete="off">';
- echo '</td>';
- if ($onlyThisSurvey != 2) {
- echo '<td>';
- echo '<span class="faicon delete_circle icon-orange_link" onclick="deleteRecipientsList_confirm(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
- echo '</td>';
- echo '<td>';
- echo '<span class="faicon quick_edit user smaller icon-as_link" onclick="inv_list_edit(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit_access'].'"></span>';
+
+ if ($onlyThisSurvey != 2) {
+
+ echo '<td class="edit">';
+ echo ' <input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'], $pids) ? ' checked="checked"' : '').'autocomplete="off">';
+ echo ' <label for="inv_list_chck_'.$sql_row['pid'].'"></label>';
+
+ echo ' <span class="faicon delete" onclick="deleteRecipientsList_confirm(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
+
+ echo ' <span class="faicon quick_edit users" onclick="inv_list_edit(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit_access'].'"></span>';
echo '</td>';
}
+ else{
+ echo '<td>';
+ echo ' <input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'], $pids) ? ' checked="checked"' : '').'autocomplete="off">';
+ echo ' <label for="inv_list_chck_'.$sql_row['pid'].'"></label>';
+ echo '</td>';
+ }
+
echo '<td>';
echo '<label for="inv_list_chck_'.$sql_row['pid'].'">';
echo $sql_row['name'];
echo '</label>';
echo '</td>';
+
echo '<td>';
if (isset($sql_row['respondents'])) {
$_recipients = str_replace("\n\r", "\n", $sql_row['respondents']);
@@ -8427,107 +8388,114 @@ class SurveyInvitationsNew {
echo (int)$sql_row['cnt_succsess']+(int)$sql_row['cnt_error'];
}
echo '</td>';
- #echo '<td>';
- #$_fields = explode(",",$sql_row['fields']);
- #$_fields_lang = array();
- #foreach ($_fields as $_field) {
- # $_fields_lang[] = $lang['srv_inv_field_'.$_field];
- #}
- #echo implode(',',$_fields_lang);
- #echo '</td>';
+
echo '<td>';
echo $sql_row['comment'];
echo '</td>';
+
echo '<td>';
echo $sql_row['ds'];
echo '</td>';
+
echo '<td title="'.$sql_row['email'].'">';
echo $sql_row['firstname'];
- echo ' '.$sql_row['surname'];
+ echo ' '.(isset($sql_row['surname']) ? $sql_row['surname'] : '');
echo '</td>';
+
echo '</tr>';
}
+
echo '</table>';
- /*
- * Osznačevanje vseh seznamov in brisanje le teh*/
- echo '<div id="inv_bottom_edit">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="inv_switch_on"><a href="#" onClick="inv_list_selectAll(true)">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="inv_switch_off" style="display:none;"><a href="#" onClick="inv_list_selectAll(false)">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onclick="inv_recipients_list_action(\'delete\');"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_invitation_recipients_delete_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
- //echo '&nbsp;&nbsp;<a href="#" onclick="inv_recipients_form_action(\'export\');"><span class="sprites xls delete" style="height:14px; width:16px;" title="'.$lang['srv_invitation_recipients_export_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_export_selected'].'</a>';
- echo '</div>';
- } else {
+ }
+ else {
echo $lang['srv_inv_list_no_lists'];
}
+
return (int)mysqli_num_rows($sql_query);
}
function showNoEditRecList($profile_id = null) {
global $lang;
+
$pids=array();
- $onlyThisSurvey = (int)$_POST['onlyThisSurvey'];
- if ($profile_id == null)
- {
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 0;
+
+ if($profile_id == null){
+
# preberemo id-je profilov in respondente
- if ($_POST['pids'] != '')
- {
+ if ($this->invitationAdvancedConditionId != '' && $this->invitationAdvancedConditionId != '0'){
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ }
+ elseif ($_POST['pids'] != '') {
$pids = explode(',',$_POST['pids']);
}
- } else
- {
+ }
+ else{
# preberemo id-je profilov in respondente
- if ($profile_id != '')
- {
+ if ($profile_id != ''){
$pids = explode(',',$profile_id);
}
}
- if (empty($pids))
- {
+ if (is_array($pids) && count($pids) == 0) {
echo $lang['srv_inv_list_choose_left'].'<br>';
}
session_start();
$infoBox = null;
- if (is_array($pids) && count($pids) > 0)
- {
- echo '<div style="width:100%; height:25px;"><label><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" autocomplete="off">'.$lang['srv_inv_list_edit'].'</label></div>';
- $respondents = array();
+
+ if (is_array($pids) && !empty($pids)){
+
+ echo '<div><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();"><label for="inv_show_list_edit">'.$lang['srv_inv_list_edit'].'</label></div>';
+
+ $respondents = array();
$fields = array();
+
# info box prikazujemo samo ko imamo izbran 1 seznam
- if ($onlyThisSurvey <= 1)
- {
+ if ($onlyThisSurvey <= 1){
# če imamo normalne sezname
if (is_array($pids) && count($pids) == 1) {
$sql_string = "SELECT rp.respondents, fields,rp.name, rp.comment, u.email AS iemail, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS fitime, e.email AS eemail, DATE_FORMAT(rp.edit_time,'%d.%m.%Y, %T') AS fetime FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id LEFT JOIN users AS e ON rp.uid = e.id WHERE rp.pid IN(".(implode(',',$pids)).")";
- } else {
+ }
+ else {
$sql_string = "SELECT rp.respondents, fields FROM srv_invitations_recipients_profiles AS rp WHERE rp.pid IN(".(implode(',',$pids)).")";
}
-
+
$sql_query = sisplet_query($sql_string);
- while ($sql_row = mysqli_fetch_assoc($sql_query))
- {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)){
+
# info box prikazujemo samo ko imamo izbran 1 seznam
- if (is_array($pids) && count($pids) == 1)
- {
- $infoBox .= '<span class="gray" style="display:inline-block; margin:10px;5px;">';
- $infoBox .= $lang['srv_inv_list_edit_added'];
+ if (is_array($pids) && count($pids) == 1){
+
+ $infoBox .= '<div class="info_box">';
+
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_added'].' ';
$infoBox .= trim($sql_row['iemail']) != '' ? $sql_row['iemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fitime'];
+ $infoBox .= '</span>';
+
if ($sql_row['fitime'] != $sql_row['fetime']) {
- $infoBox .= '<br/>'.$lang['srv_inv_list_edit_changed'];
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_changed'].' ';
$infoBox .= trim($sql_row['eemail']) != '' ? $sql_row['eemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fetime'];
+ $infoBox .= '</span>';
}
-
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_name'].$sql_row['name'].'</label>';
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_comment'].$sql_row['comment'].'</label>';
-
+
+ $infoBox .= '<span>';
+ $infoBox .= ' <label>'.$lang['srv_inv_list_edit_name'].$sql_row['name'].'</label>';
+ $infoBox .= '</span>';
+
+ $infoBox .= '<span>';
+ $infoBox .= ' <label>'.$lang['srv_inv_list_edit_comment'].$sql_row['comment'].'</label>';
+ $infoBox .= '</span>';
+
+ $infoBox .= '</div>';
}
- #$array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
$respondents_list = str_replace("\n\r", "\n", $sql_row['respondents']);
$respondents_list = explode("\n",$respondents_list);
@@ -8542,8 +8510,7 @@ class SurveyInvitationsNew {
}
} # end-while
}
- else
- {
+ else{
# imamo arhive
$fields = array();
$_recipients = array();
@@ -8572,7 +8539,7 @@ class SurveyInvitationsNew {
}
}
-
+
# pohandlamo polja
$field_list = array();
$default_fields = array(
@@ -8600,30 +8567,33 @@ class SurveyInvitationsNew {
}
}
- if (count($default_fields) > 0)
- {
+ if (count($default_fields) > 0){
foreach ($default_fields as $key =>$field) {
$field_list[$key] = $field;
unset($default_fields[$key]);
}
}
$respondents = array_unique($respondents);
+
+
echo '<table class="inv_edit_rec_list">';
+
echo '<tr>';
$fields_cnt = 0;
- foreach ($field_list AS $field => $checked)
- {
+ foreach ($field_list AS $field => $checked){
if ($checked == 1) {
$fields_cnt++;
- echo '<th title="'.$lang['srv_inv_recipients_'.$field].'">'.$lang['srv_'.$field].'</th>';
+ echo '<th title="'.$lang['srv_'.$field].'">'.$lang['srv_'.$field].'</th>';
}
}
echo '</tr>';
- if (is_array($respondents) && count($respondents) > 0 )
- {
- foreach ($respondents AS $respondent_data) {
+
+ if (is_array($respondents) && count($respondents) > 0 ){
+ foreach ($respondents AS $respondent_data){
$row_cnt = 0;
+
echo '<tr>';
+
$respondent_data_array = explode('|~|',$respondent_data);
if (count($respondent_data_array) > 0) {
foreach ($respondent_data_array AS $tekst) {
@@ -8633,42 +8603,56 @@ class SurveyInvitationsNew {
}
}
}
+
echo '</tr>';
}
}
+
echo '</table>';
}
+
echo $infoBox;
}
- function showEditRecList($profile_id = null)
- {
+ function showEditRecList($profile_id = null){
global $lang;
+
$pids=array();
- $onlyThisSurvey = (int)$_POST['onlyThisSurvey'];
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 0;
+
if ($profile_id == null) {
+
# preberemo id-je profilov in respondente
- if ($_POST['pids'] != '') {
- $pids = explode(',',$_POST['pids']);
- }
- } else {
+ if ($this->invitationAdvancedConditionId != '' && $this->invitationAdvancedConditionId != '0'){
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ }
+ elseif ($_POST['pids'] != '') {
+ $pids = explode(',',$_POST['pids']);
+ }
+ }
+ else {
# preberemo id-je profilov in respondente
if ($profile_id != '') {
- $pids = explode(',',$profile_id);
- }
+ $pids = explode(',',$profile_id);
+ }
}
+
if (is_array($pids) && count($pids) == 0) {
echo $lang['srv_inv_list_choose_left'].'<br>';
}
+
session_start();
- if (is_array($pids) && !empty($pids))
- {
- echo '<div style="height:25px;width:100%;"><label><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" checked="checked" autocomplete="off">'.$lang['srv_inv_list_edit'].'</label></div>';
- $respondents = array();
+
+ if (is_array($pids) && !empty($pids)){
+
+ echo '<div><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" checked="checked"><label for="inv_show_list_edit">'.$lang['srv_inv_list_edit'].'</label></div>';
+
+ $respondents = array();
$fields = array();
$infoBox = null;
- if ($onlyThisSurvey <= 1)
- {
+ if ($onlyThisSurvey <= 1){
+
# če imamo normalne sezname
if (is_array($pids) && count($pids) == 1) {
$sql_string = "SELECT rp.respondents, fields,rp.name, rp.comment, u.email AS iemail, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS fitime, e.email AS eemail, DATE_FORMAT(rp.edit_time,'%d.%m.%Y, %T') AS fetime FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id LEFT JOIN users AS e ON rp.uid = e.id WHERE rp.pid IN(".(implode(',',$pids)).")";
@@ -8681,22 +8665,44 @@ class SurveyInvitationsNew {
while ($sql_row = mysqli_fetch_assoc($sql_query))
{
# info box prikazujemo samo ko imamo izbran 1 seznam
- if (is_array($pids) && count($pids) == 1)
- {
- $infoBox = '<span class="gray" style="display:inline-block; margin:10px;5px;">';
- $infoBox .= $lang['srv_inv_list_edit_added'];
+ if (is_array($pids) && count($pids) == 1){
+
+ $infoBox = '<div class="info_box">';
+
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_added'].' ';
$infoBox .= trim($sql_row['iemail']) != '' ? $sql_row['iemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fitime'];
- if ($sql_row['fitime'] != $sql_row['fetime'])
- {
- $infoBox .= '<br/>'.$lang['srv_inv_list_edit_changed'];
+ $infoBox .= '</span>';
+
+ if ($sql_row['fitime'] != $sql_row['fetime']){
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_changed'].' ';
$infoBox .= trim($sql_row['eemail']) != '' ? $sql_row['eemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fetime'];
+ $infoBox .= '</span>';
}
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_name'].'<input type="text" id="rec_profile_name" value="'.$sql_row['name'].'" tabindex="1" ></label>';
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_comment'].'<input type="text" id="rec_profile_comment" value="'.$sql_row['comment'].'" tabindex="2"></label>';
+
+ $infoBox .= '<div class="setting_item">';
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_name'];
+ $infoBox .= '</span>';
+ $infoBox .= '<span>';
+ $infoBox .= ' <input type="text" class="medium" id="rec_profile_name" value="'.$sql_row['name'].'" tabindex="1">';
+ $infoBox .= '</span>';
+ $infoBox .= '</div>';
+
+ $infoBox .= '<div class="setting_item">';
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_comment'];
+ $infoBox .= '</span>';
+ $infoBox .= '<span>';
+ $infoBox .= ' <input type="text" class="medium w400" id="rec_profile_comment" value="'.$sql_row['comment'].'" tabindex="2">';
+ $infoBox .= '</span>';
+ $infoBox .= '</div>';
+
+ $infoBox .= '</div>';
}
- #$array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
$respondents_list = str_replace("\n\r", "\n", $sql_row['respondents']);
$respondents_list = explode("\n",$respondents_list);
@@ -8791,7 +8797,7 @@ class SurveyInvitationsNew {
# ali labela sproži klik checkboxa
$label_for = ' for="'.$field.'_chk"';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
}
@@ -8801,10 +8807,10 @@ class SurveyInvitationsNew {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
+
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
echo '<div>';
echo '<textarea id="inv_recipients_list" name="inv_recipients_list">';
if (is_array($respondents) && count($respondents) > 0 ) {
@@ -8814,14 +8820,15 @@ class SurveyInvitationsNew {
echo '</div>';
echo $infoBox;
- echo '<br class="clr" />';
- echo '<br class="clr" />';
- if (count($pids) <= 1 ) {
- echo '<span class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_list_save_old(\''.implode('',$pids).'\'); return false;"><span>'.$lang['srv_inv_list_save_old'].'</span></a></span>';
- }
- echo '<span class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_get_name(\'true\'); return false;"><span>'.$lang['srv_inv_list_save_new'].'</span></a></span>';
- echo '<br class="clr" />';
+
+ echo '<div class="button_holder below">';
+
+ if (count($pids) <= 1 )
+ echo '<button class="medium white-black" onclick="inv_list_save_old(\''.implode('',$pids).'\'); return false;">'.$lang['srv_inv_list_save_old'].'</button>';
+ echo '<button class="medium white-blue" onclick="inv_list_get_name(\'true\'); return false;">'.$lang['srv_inv_list_save_new'].'</button>';
+
+ echo '</div>';
}
}
@@ -8829,44 +8836,35 @@ class SurveyInvitationsNew {
function invListEdit() {
global $lang,$site_url, $global_user_id;
+ echo '<h2>'.$lang['access'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
# polovimo podatke profila
$sql_string = "SELECT pid, name, comment, uid FROM srv_invitations_recipients_profiles WHERE pid='".$_POST['pid']."'";
$sql_query = sisplet_query($sql_string);
list($pid, $name, $comment, $uid) = mysqli_fetch_row($sql_query);
echo '<div id="inv_recipients_profile_name" class="access">';
echo '<form id="inv_list_edit_form" name="inv_list_edit_form" autocomplete="off">';
- /*
- echo '<span id="new_recipients_list_span" >';
- echo '<label>'.$lang['srv_inv_recipient_list_name'];
- echo '<input type="text" id="rec_profile_name" name="rec_profile_name" value="'.$name.'" tabindex="1" autofocus="autofocus">';
- echo '</label>';
- echo '</span>';
-
- echo '<br/><br/>';
- echo $lang['srv_inv_recipient_list_comment'];
- echo '<textarea id="rec_profile_comment" name="rec_profile_comment" tabindex="3" rows="5" >'.$comment.'</textarea>';
- echo '<br/>';
- */
$this->displayListAccess($pid);
+
# skrita polja za respondente in polja
echo '<input id="profile_id" name="profile_id" type="hidden" value="'.($_POST['pid']).'" >';
- echo '<br class="clr" /><br/>';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_edit_save(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="inv_list_edit_save(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
echo '</form>';
echo '</div>'; # id="inv_view_arch_recipients"
- /* echo '<script type="text/javascript">';
- echo "$('#rec_profile_name').focus();";
- echo '</script>';
- */
}
function listGetName() {
global $lang,$site_url, $global_user_id;
$saveNew = $_POST['saveNew'] == 'true' ? true : false;
+ $pid = isset($_POST['pid']) ? isset($_POST['pid']) : '';
$array_profiles = array();
#ne vem če je fino da lahko dodaja kar na vse sezname
@@ -8905,7 +8903,7 @@ class SurveyInvitationsNew {
} else {
echo '<span id="new_recipients_list_span" >';
echo '<label>'.$lang['srv_inv_recipient_list_name'];
- echo '<input type="text" id="rec_profile_name" value="'.$array_profiles[$_POST['pid']]['name'].'" tabindex="1" autofocus="autofocus">';
+ echo '<input type="text" id="rec_profile_name" value="'.isset($array_profiles[$pid]['name']) ? $array_profiles[$pid]['name'] : ''.'" tabindex="1" autofocus="autofocus">';
echo '</label>';
echo '</span>';
}
@@ -8913,13 +8911,13 @@ class SurveyInvitationsNew {
echo '<br/><br/>';
echo $lang['srv_inv_recipient_list_comment'];
- echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >'.$array_profiles[$_POST['pid']]['comment'].'</textarea>';
+ echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >'.isset($array_profiles[$pid]['comment']) ? $array_profiles[$pid]['comment'] : ''.'</textarea>';
# skrita polja za respondente in polja
$_fields = str_replace('inv_field_','',implode(',',$_POST['fields']));
echo '<input id="inv_prof_field_list" type="hidden" value="'.$_fields.'" >';
echo '<input id="inv_prof_recipients_list" type="hidden" value="'.$this->getCleanString($_POST['recipients_list']).'" >';
echo '<input id="saveNew" type="hidden" value="'.($saveNew == true ? 'true' : 'false').'" >';
- echo '<input id="profile_id" type="hidden" value="'.($_POST['pid']).'" >';
+ echo '<input id="profile_id" type="hidden" value="'.($pid).'" >';
echo '<br class="clr" /><br/>';
echo '<span class="buttonwrapper floatLeft spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_save(); return false;"><span>'.$lang['save'].'</span></a></span>';
@@ -9074,7 +9072,7 @@ class SurveyInvitationsNew {
function deleteRecipientsListMulti() {
$return = array('success'=>'0');
- global $global_user_id;
+ global $global_user_id, $lang;
$ids = $_POST['ids'];
@@ -9148,13 +9146,12 @@ class SurveyInvitationsNew {
while ($row1 = mysqli_fetch_assoc($sqlQuery)) {
- $checked = ( in_array($row1[id],$accessArray) ||$uid == $row1['id']) ? ' checked="checked"' : '';
+ $checked = ( in_array($row1['id'],$accessArray) ||$uid == $row1['id']) ? ' checked="checked"' : '';
$_css_hidden = ($checked != '' ? '' : ' displayNone');
echo '<div id="div_for_uid_' . $row1['id'] . '" name="listAccess" class="floatLeft listAccess_uid'.$_css_hidden.'">';
- echo '<label nowrap title="' . $row1['email'] . '"'.($uid == $row1['id']?' class="gray"':'').'>';
echo '<input type="checkbox" name="uid[]" value="' . $row1['id'] . '" id="uid_' . $row1['id'] . '"' . $checked .($uid == $row1['id'] ? ' disabled="disabled"' : ''). ' autocomplete="off"/>';
- echo $row1['name'] . ($uid == $row1['id'] ? ' (' . $lang['author'] . ')' : '') . '</label>';
+ echo '<label nowrap title="' . $row1['email'] . '"'.($uid == $row1['id']?' class="gray"':'').'>'.$row1['name'] . ($uid == $row1['id'] ? ' (' . $lang['author'] . ')' : '') . '</label>';
echo '</div>';
}
@@ -9201,7 +9198,7 @@ class SurveyInvitationsNew {
}
}
- $link1 = $site_url.'a/'.Common::encryptAnketaID($this->sid);
+ $link1 = $site_url.'a/'.SurveyInfo::getInstance()->getSurveyHash();
# normalen link
$result[$cnt] = array('url'=>$link1, 'name'=>$link1.(count($lang_array) > 0 ? ' - '.$lang['language'] : ''));
if ($default_checked == false) {
@@ -9296,7 +9293,7 @@ class SurveyInvitationsNew {
$label_for = ' for="'.$field.'_chk"';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
if ($is_selected == 1) {
@@ -9306,10 +9303,8 @@ class SurveyInvitationsNew {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
echo '<form id="inv_recipients_upload_form" name="resp_uploader" method="post" enctype="multipart/form-data" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_upload_list" autocomplete="off">';
echo '<input type="hidden" name="fields" id="inv_recipients_upoad_fields" value="'.implode(',',$fields).'" />';
@@ -9322,14 +9317,14 @@ class SurveyInvitationsNew {
echo '<br class="clr" />';
echo $lang['srv_mailing_upload_list'];
echo '<input type="file" name="invListFile" id="invListFile" size="42" >';
- if (count($errors) > 0) {
+ /* if (count($errors) > 0) {
echo '<br class="clr" />';
echo '<span class="inv_error_note">';
foreach($errors as $error) {
echo '* '.$error.'<br />';
}
echo '</span>';
- }
+ } */
echo '<br/><br/><label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label> <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1" value="," checked><label for="recipientsDelimiter1">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2" value=";"><label for="recipientsDelimiter2">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
echo '</form>';
@@ -9394,17 +9389,19 @@ class SurveyInvitationsNew {
# če so napake jih prikažemo če ne obdelamo datoteko
if (count($errors) > 0) {
- echo '<br class="clr" />';
- echo '<span class="inv_message_errors">'.$lang['srv_inv_recipiens_upload_error'].'</span>';
- echo '<br class="clr" />';
- echo '<br class="clr" />';
- echo '<span class="inv_error_note">';
+ echo '<div id="inv_message_errors">';
+
+ echo '<span>'.$lang['srv_inv_recipiens_upload_error'].'</span>';
+
foreach($errors as $error) {
- echo '* '.$error.'<br />';
+ echo '<span class="inv_error_note">* '.$error.'</span>';
}
- echo '</span>';
+
+ echo '</div>';
+
#$this->addRecipientsView($fields, $invalid_recipiens_array);
- } else {
+ }
+ else {
$fh = @fopen($file_tmp, "rb");
if ($fh) {
@@ -9447,20 +9444,7 @@ class SurveyInvitationsNew {
$this->showInvitationLists();
}
- /*
- function strpos_index($haystack = '',$needle = '',$offset = 0,$limit = 99,$return = null)
- {
- $length = strlen($needle);
- $occurances = array();
- while((($count = count($occurances)) < $limit) && (false !== ($offset = strpos($haystack,$needle,$offset))))
- {
- $occurances[$count]['length'] = $length;
- $occurances[$count]['start'] = $offset;
- $occurances[$count]['end'] = $offset = $offset + $length;
- }
- return $return === null ? $occurances : $occurances[$return];
- }
- */
+
/**
* Find position of Nth $occurrence of $needle in $haystack
* Starts from the beginning of the string
@@ -9494,37 +9478,37 @@ class SurveyInvitationsNew {
function displayMessagePreview() {
global $lang;
- $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'");
$preview_message = mysqli_fetch_assoc($sql_query_m);
- # polovimo imena vseh sporocil
- $sql_string_m = "SELECT id, naslov FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
- echo '<table id="inv_send_mail_preview">';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_name'].':</th>';
- echo '<td class="inv_bt">';
- echo '<span>';
- $sql_query_m = sisplet_query($sql_string_m);
+ # polovimo imena vseh sporocil
+
+ echo '<div id="inv_send_mail_preview">';
+
+ echo '<div class="setting_item hor">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_name'].':</label>';
+ $sql_query_m = sisplet_query("SELECT id, naslov FROM srv_invitations_messages WHERE ank_id = '$this->sid'");
if (mysqli_num_rows($sql_query_m) > 0 ) {
- echo '<select onchange="mailSourceMesageChange(this);">';
+ echo ' <select class="dropdown medium" onchange="mailSourceMesageChange(this);">';
while ($row = mysqli_fetch_assoc($sql_query_m)) {
- echo '<option value="'.$row['id'].'"'.($row['id'] ==$preview_message['id']?' selected="selected"':'' ).'>'.$row['naslov'].'</option>';
+ echo ' <option value="'.$row['id'].'"'.($row['id'] ==$preview_message['id']?' selected="selected"':'' ).'>'.$row['naslov'].'</option>';
}
- echo '</select>';
+ echo ' </select>';
}
- #.$preview_message['naslov'];
- echo '</span>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_subject'].':</th>';
- echo '<td class="inv_bt">';
- echo '<span>'.$preview_message['subject_text'].'</span>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
- echo '<td >';
- echo '<span class="nl2br">'.($preview_message['body_text']).'</span>';
- echo '</td></tr>';
- echo '</table>';
+ echo '</div>';
+
+ echo '<div class="setting_item hor">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <span>'.$preview_message['subject_text'].'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_item hor align-top">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <span>'.$preview_message['body_text'].'</span>';
+ echo '</div>';
+
+ echo '</div>';
+
// Opozorilo ce manjka #URL# v besedilu maila in imamo individualizirano vabilo
if(strpos($preview_message['body_text'], '#URL#') == false && $this->surveySettings['usercode_required'] == 0 && $this->surveySettings['individual_invitation'] != 0)
@@ -9535,13 +9519,13 @@ class SurveyInvitationsNew {
echo '<span class="red">'.$lang['srv_inv_message_draft_url_warning'].'</span><br />';
// Popravi sporocilo
- echo '<a href="'.$this->addUrl('view_message').'">'.$lang['srv_invitation_reedit_message'].'</a>';
+ echo '<a href="'.$this->addUrl('view_message').'" class="noline">'.$lang['srv_invitation_reedit_message'].'</a>';
}
function addSortField($field){
$type = 'ASC';
session_start();
- if ($_SESSION['rec_sort_field'] == $field) {
+ if (isset($_SESSION['rec_sort_field']) && $_SESSION['rec_sort_field'] == $field) {
if ($_SESSION['rec_sort_type'] == 'DESC') {
$type = 'ASC';
} else {
@@ -9554,7 +9538,7 @@ class SurveyInvitationsNew {
}
function addSortIcon($field){
session_start();
- if ($_SESSION['rec_sort_field'] == $field) {
+ if (isset($_SESSION['rec_sort_field']) && $_SESSION['rec_sort_field'] == $field) {
if ($_SESSION['rec_sort_type'] == 'DESC') {
return ' <span class="faicon sort_descending icon-blue"></span>';
@@ -9650,29 +9634,34 @@ class SurveyInvitationsNew {
$sqlSpremenlivka = sisplet_query($qryString);
if (mysqli_num_rows($sqlSpremenlivka) > 0) {
+
echo '<form id="inv_ValidateSysVarsMappingFrm" name="inv_ValidateSysVarsMappingFrm">';
+
echo $lang['srv_invitation_system_email_choose'];
- echo '<table>';
+
+ echo '<div class="setting_holder">';
while ($row = mysqli_fetch_assoc($sqlSpremenlivka)) {
- $system_variables[$row['id']] = $row;
- echo '<tr>';
- echo '<td>';
+ $system_variables[$row['id']] = $row;
+
+ echo '<div class="setting_item">';
+
$checked = (isset($mappingArray[$row['id']]) && $mappingArray[$row['id']] == 'email' )?' checked="checked"':'';
+
echo '<input type="radio" name="sysVarMap" id="sysVarMap_'.$row['id'].'" value="'.$row['id'].'"'.$checked.'>';
- echo '</td>';
- echo '<td><label for="sysVarMap_'.$row['id'].'"><span style="color: #78a971;">'.$row['variable'].'</span></label></td>';
- echo '<td><label for="sysVarMap_'.$row['id'].'">'.$row['naslov'].'</label></td>';
-
- echo '</tr>';
+ echo '<label for="sysVarMap_'.$row['id'].'"><span>'.$row['variable'].'</span>'.$row['naslov'].'</label>';
+
+ echo '</div>';
}
- echo '</table>';
- echo '<form/>';
- echo '<br/>';
- echo '<div id="inv_ValidateSysVarsMappingDiv">';
- echo '<span onclick="inv_ValidateSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_invitation_system_validate'].'</span></a></span>';
+ echo '</div>';
+
+ echo '</form>';
+
+ echo '<div id="inv_ValidateSysVarsMappingDiv" class="button_holder below">';
+ echo ' <button class="medium white-blue" onclick="inv_ValidateSysVarsMapping();">'.$lang['srv_invitation_system_validate'].'</button>';
echo '</div>';
- } else {
+ }
+ else {
echo '<span>'.$lang['srv_invitation_system_error3'].'</span>';
}
}
@@ -9718,7 +9707,8 @@ class SurveyInvitationsNew {
} else {
$errors[] = $lang['srv_invitation_system_error2'];
}
- } else {
+ }
+ else {
if ((int)$cntSistemske == 0) {
# ni sistemskih spremenljivk
@@ -9728,18 +9718,25 @@ class SurveyInvitationsNew {
$errors[] = $lang['srv_invitation_system_error4'];
}
}
- echo '<span onclick="inv_ValidateSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft spaceRight" ><a class="ovalbutton ovalbutton_gray" ><span>'.$lang['srv_invitation_system_validate'].'</span></a></span>';
- if (count($emailsToAdd)) {
- echo '<span onclick="inv_addSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft spaceRight" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_invitation_system_validateAndAdd'].'</span></a></span>';
+
+
+ echo '<button class="medium white-blue" onclick="inv_ValidateSysVarsMapping();">'.$lang['srv_invitation_system_validate'].'</button>';
+
+ if (count($emailsToAdd)) {
+ echo '<button class="medium white-blue" onclick="inv_addSysVarsMapping();">'.$lang['srv_invitation_system_validateAndAdd'].'</button>';
}
- if (mysqli_num_rows($queryUser) > 0)
- { # če je kaj novih zapisov v bazi
-
- # če že imamo prejemnike v bazi ponudimo gumb naprej
- echo '<span class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" href="'.$this->addUrl('view_recipients').'"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
+
+ # če že imamo prejemnike v bazi ponudimo gumb naprej
+ if (mysqli_num_rows($queryUser) > 0){
+ echo '<a href="'.$this->addUrl('view_recipients').'"><button class="medium blue">'.$lang['srv_invitation_forward'].'</button></a>';
+ }
+
+
+ echo '<div class="setting_holder">';
+
+ # če je kaj novih zapisov v bazi
+ if (mysqli_num_rows($queryUser) > 0){
- echo '<br class="clr"/>';
- echo '<br/>';
echo '<span class="strong">';
printf($lang['srv_invitation_system_found'],mysqli_num_rows($queryUser));
echo '</span>';
@@ -9757,12 +9754,13 @@ class SurveyInvitationsNew {
echo $lang['srv_invitation_system_from_this_invalid'].(int)count($invalidEmails);
}
}
- else
- {
+ else{
echo '<br class="clr"/>';
echo '<br/>';
echo $lang['srv_invitation_system_not_found'];
}
+
+ echo '</div>';
}
function addSysVarsMapping() {
global $lang,$global_user_id;
@@ -9803,7 +9801,7 @@ class SurveyInvitationsNew {
#dodamo respondenra in naredimo povezav
$sql_insert = "INSERT IGNORE INTO srv_invitations_recipients (ank_id,email,password,cookie,sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id,last_status) VALUES ";
$sql_insert .= "('".$this->sid."','$email','$pass','".$row['cookie']."'";
- $sql_insert .= ",'0','0','".(int)$row['unsubscribed']."','0',NOW(),'".$global_user_id."','".$list_id."','".$row['last_status']."')";
+ $sql_insert .= ",'0','0','".(int)$row['unsubscribed']."','0',NOW(),'".$global_user_id."','','".$row['last_status']."')";
$sqlQuery = sisplet_query($sql_insert);
if (!$sqlQuery) {
$error = mysqli_error($GLOBALS['connect_db']);
@@ -9911,22 +9909,22 @@ class SurveyInvitationsNew {
# echo '</span>';
echo $lang['srv_invitation_recipients_list_add'].':&nbsp;';
echo '<select id="sel_inv_list_type" onchange="inv_new_recipients_list_change(this);" autofocus="autofocus">';
- echo '<option value="0" class="gray bold"'.((int)$_POST['pid'] > 0 ? '' : ' selected="selected"' ).'>'.$lang['srv_invitation_new_list'].'</option>';
+ echo '<option value="0" class="gray bold"'.(isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? '' : ' selected="selected"' ).'>'.$lang['srv_invitation_new_list'].'</option>';
echo '<option value="-1" class="gray bold">'.$lang['srv_invitation_new_templist'].'</option>';
if (count($array_profiles) > 0){
foreach($array_profiles AS $key => $profile) {
- echo '<option value="'.$key.'" comment="'.$profile['comment'].'"'.($_POST['pid'] == $key ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
+ echo '<option value="'.$key.'" comment="'.$profile['comment'].'"'.(isset($_POST['pid']) && $_POST['pid'] == $key ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
}
}
echo '</select>';
- echo '<span id="new_recipients_list_span_note" '.((int)$_POST['pid'] < 1 ? ' class="displayNone"' : '' ).'>';
+ echo '<span id="new_recipients_list_span_note" '.(isset($_POST['pid']) && (int)$_POST['pid'] < 1 ? ' class="displayNone"' : '' ).'>';
echo '<br>';
echo '<br>';
- echo $lang[''].'Uporabniki bodo dodani v seznam: ';
- echo $array_profiles[$_POST['pid']]['name'];
+ echo 'Uporabniki bodo dodani v seznam: ';
+ echo (isset($_POST['pid']) && isset($array_profiles[$_POST['pid']]['name']) ? $array_profiles[$_POST['pid']]['name'] : '');
echo '<span id="new_recipients_list_span_note_name"></span>';
echo '</span>';
- echo '<span id="new_recipients_list_span" '.((int)$_POST['pid'] > 0 ? ' class="displayNone"' : '' ).'>';
+ echo '<span id="new_recipients_list_span" '.(isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? ' class="displayNone"' : '' ).'>';
echo '<br>';
echo '<br>';
@@ -9953,7 +9951,7 @@ class SurveyInvitationsNew {
echo '<br/><br/>';
echo $lang['srv_inv_recipient_list_comment'];
echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >';
- echo $array_profiles[$_POST['pid']]['comment'];
+ echo (isset($_POST['pid']) && isset($array_profiles[$_POST['pid']]['comment']) ? $array_profiles[$_POST['pid']]['comment'] : '');
echo '</textarea>';
echo '</div>';
@@ -10033,7 +10031,7 @@ class SurveyInvitationsNew {
#zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
$profileName = $lang['srv_inv_recipient_list_new'];
$names = array();
- $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%".$new_name."%' AND uid='$global_user_id'";
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%%' AND uid='$global_user_id'";
$q = sisplet_query($s);
while ($r = mysqli_fetch_assoc($q))
{
@@ -10134,12 +10132,13 @@ class SurveyInvitationsNew {
}
- function setAdvancedCondition()
+ public function setAdvancedConditionProfile($pid)
{
- global $lang;
- SurveySession::sessionStart($this->sid);
- SurveySession::set('invitationAdvancedConditionId', (int)$_POST['cid']);
- $this->invitationAdvancedConditionId = (int)$_POST['cid'];
+ $this->invitationAdvancedConditionProfileId = (int)$pid;
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ $this->invitationAdvancedConditionId = $scp->getProfileConditionId($this->invitationAdvancedConditionProfileId);
+
$this->viewRecipients();
}
@@ -10188,7 +10187,7 @@ class SurveyInvitationsNew {
unlink($dataFileName.'.tmp');
}
- if (is_array($invUsrId) && count($invUsrId) > 0){
+ if (isset($invUsrId) && is_array($invUsrId) && count($invUsrId) > 0){
return $invUsrId;
}
}
@@ -10200,17 +10199,20 @@ class SurveyInvitationsNew {
return array();
}
- function advancedCondition()
- {
+ function advancedCondition(){
global $lang;
- echo '<span id="conditionProfileNote" class="simple">';
+
+ echo '<div class="condition_holder" class="setting">';
+
+ echo '<div id="conditionProfileNote">';
+
echo $lang['srv_inv_condition_filter'].' ';
-
- if ((int)$this->invitationAdvancedConditionId > 0)
- {
- $scp = new SurveyCondition($this->sid);
- echo ' <strong>'.$scp->getConditionName((int)$this->invitationAdvancedConditionId).'</strong> ';
- $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
+
+ if ($this->invitationAdvancedConditionProfileId > 0){
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ echo '&nbsp;<strong>'.$scp->getCurentProfile()['name'].'</strong>&nbsp;';
+ /* $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
$note = $scp -> getConditionString($this->invitationAdvancedConditionId );
echo $note;
if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
@@ -10219,32 +10221,40 @@ class SurveyInvitationsNew {
else
{
}
- echo '<span class="as_link spaceLeft" onclick="showInvitationAdvancedConditions(\''.(int)$this->invitationAdvancedConditionId.'\'); return false;">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="invitationSetCondition(\'0\'); return false;">'.$lang['srv_profile_remove'].'</span>';
+ echo '<span onclick="showInvitationAdvancedConditions(\''.(int)$this->invitationAdvancedConditionId.'\'); return false;" title=""'.$lang['srv_profile_edit'].'"><span class="faicon edit"></span></span>';
+ echo '<span onclick="invitationSetCondition(\'0\'); return false;" title="'.$lang['srv_profile_remove'].'"><span class="faicon delete"></span></span></span>';
+ */
}
- else
- {
- echo '<strong>'.$lang['srv_inv_condition_no_filter'].'</strong>';
- echo '<a href="#" class="faicon if_add" onclick="showInvitationAdvancedConditions(); return false;" data-cid="'.(int)$this->invitationAdvancedConditionId.'">&nbsp;</a>';
+ else{
+ echo '<span>'.$lang['srv_inv_condition_no_filter'].'</span>';
}
- echo '</span>';
+
+ echo '<a href="#" class="faicon if_add" onclick="conditionProfileAction(\'showProfiles\');" data-cid="'.(int)$this->invitationAdvancedConditionId.'"></a>';
+
+
+ echo '</div>';
+
+ echo '</div>';
}
- function listCondition()
- {
+ function listCondition(){
global $lang;
+
# get all lists
$lists = $this->getSurveyInvitationLists(true);
$selected = (int)(isset($_SESSION['inv_filter']['list']) ? (int)$_SESSION['inv_filter']['list'] : -2);
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_list'];
- echo '<select id="inv_rec_filter_list" onchange="inv_filter_recipients();">';
- foreach ($lists AS $list_id => $list)
- {
+
+ echo '<div class="setting">';
+
+ echo '<label>'.$lang['srv_invitation_recipients_filter_list'].'</label>';
+ echo '<select id="inv_rec_filter_list" class="dropdown small" onchange="inv_filter_recipients();">';
+ foreach ($lists AS $list_id => $list){
echo '<option value="'.$list_id.'"'.((int)$selected == $list_id ? ' selected="selected"' : '').'>'.$list['name'].'</option>';
}
- echo '</select></label>';
+ echo '</select>';
+
+ echo '</div>';
}
function getSurveyInvitationLists($add_all = false)
@@ -10268,7 +10278,7 @@ class SurveyInvitationsNew {
}
- function viewServerSettings(){
+ private function viewServerSettings(){
global $lang;
global $site_url;
global $site_url;
@@ -10276,7 +10286,6 @@ class SurveyInvitationsNew {
global $admin_type;
global $global_user_id;
global $mysql_database_name;
- global $aai_instalacija;
$row = SurveyInfo::getInstance()->getSurveyRow();
@@ -10301,15 +10310,17 @@ class SurveyInvitationsNew {
if($squalo->getSqualoEnabled()){
// Vklop squalo
- echo '<div class="squalo_switch"><p>';
+ echo '<div class="setting_holder squalo_switch">';
- echo '<span class="bold">'.$lang['srv_squalo'].':</span>&nbsp;';
+ echo ' <div class="setting_title">'.$lang['srv_squalo'].':</div>';
- echo '<input type="hidden" name="squalo_mode" value="0">';
- echo '<label><input type="checkbox" name="squalo_mode" id="squalo_mode" value="1" '.($squalo->getSqualoActive() ? 'checked ="checked" ' : '').' style="vertical-align:-2px;" onclick="squaloSwitch();">';
- echo $lang['srv_squalo_sending'].' </label>';
+ echo ' <div class="setting_item">';
+ echo ' <input type="hidden" name="squalo_mode" value="0">';
+ echo ' <input type="checkbox" name="squalo_mode" id="squalo_mode" value="1" '.($squalo->getSqualoActive() ? 'checked ="checked" ' : '').' onclick="squaloSwitch();">';
+ echo ' <label for="squalo_mode">'.$lang['srv_squalo_sending'].'</label>';
+ echo ' </div>';
- echo '</p></div>';
+ echo '</div>';
// Squalo nastavitve...
@@ -10325,55 +10336,78 @@ class SurveyInvitationsNew {
echo '<div class="mail_mode_switch '.($squalo->getSqualoActive() ? ' displayNone' : '').'">';
// Opozorilo, ce imamo vklopljena vabila, da gre za iste nastavitve
- echo '<p class="red bold">'.$lang['srv_email_server_settings_warning'].'</p>';
+
+ echo '<div class="setting_holder red">'.$lang['srv_email_server_settings_warning'].'</div>';
+
// Izbira SMTP streznika
- echo '<span class="bold">'.$lang['srv_email_setting_select_server'].'</span>&nbsp;';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_email_setting_select_server'].'</div>';
// AAI ima Arnesov smtp
- if($aai_instalacija){
- echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
- echo $lang['srv_email_setting_adapter0_aai']. ' </label>';
+ if(isAAI()){
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_0" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
+ echo ' <label for="SMTPMailMode_0">'.$lang['srv_email_setting_adapter0_aai'].'</label>';
+ echo ' </div>';
}
else{
- echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').hide();$(\'#send_mail_mode0\').show();">';
- echo $lang['srv_email_setting_adapter0']. ' </label>';
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_0" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2, #send_mail_mode_test\').addClass(\'displayNone\'); $(\'#send_mail_mode0\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_0">'.$lang['srv_email_setting_adapter0'].'</label>';
+ echo ' </div>';
}
-
+
// Google smtp je viden samo starim, kjer je ze vklopljen
if($MA->isGoogle()){
- echo '<label><input type="radio" name="SMTPMailMode" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').hide(); $(\'#send_mail_mode1\').show();">';
- echo $lang['srv_email_setting_adapter1'].' </label>';
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_1" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').addClass(\'displayNone\'); $(\'#send_mail_mode1\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_1">'.$lang['srv_email_setting_adapter1'].'</label>';
+ echo ' </div>';
}
// Lastni smtp
- echo '<label><input type="radio" name="SMTPMailMode" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">';
- echo $lang['srv_email_setting_adapter2'].' </label>';
-
- echo Help :: display('srv_mail_mode');
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_2" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').addClass(\'displayNone\'); $(\'#send_mail_mode2, #send_mail_mode_test\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_2">'.$lang['srv_email_setting_adapter2'].' '.Help::display('srv_mail_mode').'</label>';
+ echo ' </div>';
echo '</div>';
#1KA
$enkaSettings = $MA->get1KASettings($raziskave=true);
+
echo '<div id="send_mail_mode0" '.(!$MA->is1KA() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
- echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span>';
- echo '<br />';
+
+ echo ' <div class="setting_holder semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<span>'.$enkaSettings['SMTPFrom'].'</span><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" class="medium" disabled="disabled" value="'.$enkaSettings['SMTPFrom'].'"><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo ' </div>';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" class="medium" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#delay
- echo '<p><label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').': <select name="SMTPDelay0">'
- /*. '<option value="0" '.($enkaSettings['SMTPDelay']=="0"?'selected="selected"':'') .'>0 </option>'
- . '<option value="10000" '.($enkaSettings['SMTPDelay']=="10000"?'selected="selected"':'') .'>0.01 sec (max 100 / sec)</option>'
- . '<option value="20000" '.($enkaSettings['SMTPDelay']=="20000"?'selected="selected"':'') .'>0.02 sec (max 50 / sec)</option>'
- . '<option value="50000" '.($enkaSettings['SMTPDelay']=="50000"?'selected="selected"':'') .'>0.05 sec (max 20 / sec)</option>'
- . '<option value="100000" '.($enkaSettings['SMTPDelay']=="100000"?'selected="selected"':'') .'>0.1 sec (max 10 / sec)</option>'
- . '<option value="200000" '.($enkaSettings['SMTPDelay']=="200000"?'selected="selected"':'') .'>0.2 sec (max 5 / sec)</option>'*/
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</label>';
+ echo ' <select class="dropdown medium" name="SMTPDelay0">'
. '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
. '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
. '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
@@ -10382,80 +10416,168 @@ class SurveyInvitationsNew {
. '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
. '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
. '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
- . '</select></label>';
- echo '</p>';
+ . '</select>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
echo '</div>';
+
#GMAIL - Google
$enkaSettings = $MA->getGoogleSettings();
+
echo '<div id="send_mail_mode1" '.(!$MA->isGoogle() || $squalo->getSqualoActive() ? ' 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 />';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="setting_item italic">'.$lang['srv_email_setting_adapter1_note'].'</div>';
+ echo ' <div class="setting_item semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom1" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" name="SMTPFrom1" value="'.(isset($enkaSettings['SMTPFrom'])?$enkaSettings['SMTPFrom']:'').'">';
+ echo ' </div>';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo1" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" name="SMTPReplyTo1" value="'.(isset($enkaSettings['SMTPReplyTo'])?$enkaSettings['SMTPReplyTo']:'').'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#Password
- echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_password'].'</label>';
+ echo ' <input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
echo '</div>';
+
#SMTP
$enkaSettings = $MA->getSMTPSettings();
+
echo '<div id="send_mail_mode2" '.(!$MA->isSMTP() || $squalo->getSqualoActive() ? ' 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 />';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="italic">'.$lang['srv_email_setting_adapter2_note'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# from - NICE
- echo '<p><label>'.$lang['srv_email_setting_from_nice'].'<input type="text" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from_nice'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'">';
+ echo ' </div>';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" class="medium" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#Username
- echo '<p><label>'.$lang['srv_email_setting_username'].'<input type="text" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_username'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'">';
+ echo ' </div>';
+
#Password
- echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_password'].'</label>';
+ echo ' <input type="password" class="medium" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#autentikacija
- echo '<p>';
- echo $lang['srv_email_setting_autentication'];
- echo '<label><input type="radio" name="SMTPAuth2" value="0" '.((int)$enkaSettings['SMTPAuth'] != 1 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_no'].'</label>';
- echo '<label><input type="radio" name="SMTPAuth2" value="1" '.((int)$enkaSettings['SMTPAuth'] == 1 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_yes'].'</label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_autentication'].':</label>';
+ echo ' <select class="dropdown medium" name="SMTPAuth2">'
+ . '<option value="0" '.((int)$enkaSettings['SMTPAuth']!="1" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_no'].'</option>'
+ . '<option value="1" '.((int)$enkaSettings['SMTPAuth']=="1" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_yes'].'</option>'
+ . '</select>';
+
+ echo ' </div>';
+
#Varnost SMTPSecure
- echo '<p>';
- echo $lang['srv_email_setting_encryption'];
- echo '<label><input type="radio" name="SMTPSecure2" value="0" '.((int)$enkaSettings['SMTPSecure'] == 0 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_none'].'</label>';
- echo '<label><input type="radio" name="SMTPSecure2" value="ssl" '.($enkaSettings['SMTPSecure'] == 'ssl' ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_ssl'].'</label>';
- echo '<label><input type="radio" name="SMTPSecure2" value="tls" '.($enkaSettings['SMTPSecure'] == 'tls' ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_tls'].'</label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_encryption'].'</label>';
+ echo ' <select class="dropdown medium" name="SMTPSecure2">'
+ . '<option value="0" '.($enkaSettings['SMTPSecure']=="0" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_none'].'</option>'
+ . '<option value="ssl" '.($enkaSettings['SMTPSecure']=="ssl" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_ssl'].'</option>'
+ . '<option value="tls" '.($enkaSettings['SMTPSecure']=="tls" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_tls'].'</option>'
+ . '</select>';
+
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#port
- echo '<p><label>'.$lang['srv_email_setting_port'].'<input type="number" min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'" style="width:80px;"></label>';
- echo ' '.$lang['srv_email_setting_port_note'];
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_port'].$lang['srv_email_setting_port_note'].':</label>';
+ echo ' <input type="number" class="medium" min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'">';
+ echo ' </div>';
+
#host
- echo '<p><label>'.$lang['srv_email_setting_host'].'<input type="text" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_host'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder half-half">';
+
#delay
- echo '<p><label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').': <select name="SMTPDelay2">'
- /*. '<option value="0" '.($enkaSettings['SMTPDelay']=="0"?'selected="selected"':'') .'>0 </option>'
- . '<option value="10000" '.($enkaSettings['SMTPDelay']=="10000"?'selected="selected"':'') .'>0.01 sec (max 100 / sec)</option>'
- . '<option value="20000" '.($enkaSettings['SMTPDelay']=="20000"?'selected="selected"':'') .'>0.02 sec (max 50 / sec)</option>'
- . '<option value="50000" '.($enkaSettings['SMTPDelay']=="50000"?'selected="selected"':'') .'>0.05 sec (max 20 / sec)</option>'
- . '<option value="100000" '.($enkaSettings['SMTPDelay']=="100000"?'selected="selected"':'') .'>0.1 sec (max 10 / sec)</option>'
- . '<option value="200000" '.($enkaSettings['SMTPDelay']=="200000"?'selected="selected"':'') .'>0.2 sec (max 5 / sec)</option>'*/
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</label>';
+ echo ' <select class="dropdown medium" name="SMTPDelay2">'
. '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
. '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
. '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
@@ -10464,27 +10586,33 @@ class SurveyInvitationsNew {
. '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
. '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
. '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
- . '</select></label>';
- echo '</p>';
+ . '</select>';
+
+ echo ' </div>';
echo '</div>';
-
+
+ echo '</div>';
+
+
+ echo '</div>';
+
echo '</form>';
-
- echo '<br class="clr" />';
+
+
+ echo '<div class="button_holder below float-right">';
// Gumb shrani
- echo '<span class="floatRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">';
- echo $lang['srv_email_setting_btn_save'] . '</a></div></span>';
+ echo '<button class="white-black medium" onclick="document.settingsanketa_'.$row['id'].'.submit(); return false;">'.$lang['srv_email_setting_btn_save'].'</button>';
// Gumb preveri nastavitve
- echo '<span id="send_mail_mode_test" class="floatRight spaceRight '.($squalo->getSqualoActive() ? ' displayNone' : '').'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_green" href="#" onclick="showTestSurveySMTP(); return false;">';
- echo $lang['srv_email_setting_btn_test'].'</a></div></span>';
+ echo '<button id="send_mail_mode_test" class="white-blue medium '.($squalo->getSqualoActive() || $MA->is1KA() ? ' displayNone' : '').'" onclick="showTestSurveySMTP(); return false;">'.$lang['srv_email_setting_btn_test'].'</button>';
+
+ echo '</div>';
- if ($_GET['s'] == '1') {
- echo '<div id="success_save" style="float:left; display:inline; margin: -2px 0 0 0;"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
}
@@ -10515,20 +10643,27 @@ class SurveyInvitationsNew {
private function showAAISmtpPopup(){
global $lang;
- echo '<div class="popup_close"><a href="#" onClick="quick_title_edit_cancel(); return false;">✕</a></div>';
+ echo '<div class="popup_close"><a href="#" onClick="smtpAAIPopupClose(); return false;">✕</a></div>';
echo '<h2>'.$lang['srv_email_setting_adapter0_aai_title'].'</h2>';
echo '<div class="popup_content">';
- echo $lang['srv_email_setting_adapter0_aai_popup'];
- echo '<br /><br />';
- echo '<input type="checkbox" id="aai_smtp_checkbox" name="aai_smtp_checkbox" class="pointer" onClick="smtpAAIAccept();">';
- echo ' <label for="aai_smtp_checkbox"><b>'.$lang['srv_email_setting_adapter0_aai_popup2'].'</b></label>';
+ echo '<p class="bottom16">'.$lang['srv_email_setting_adapter0_aai_popup'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="aai_smtp_checkbox" name="aai_smtp_checkbox" class="pointer" onClick="smtpAAIAccept();">';
+ echo '<label for="aai_smtp_checkbox" class="semi-bold">'.$lang['srv_email_setting_adapter0_aai_popup2'].'</label>';
+ echo '</div>';
+
echo '</div>';
echo '<div class="buttons_holder">';
- echo '<span class="buttonwrapper floatRight spaceLeft" id="aai_smtp_button" style="display:none;" title="'.$lang['srv_save_profile_yes'].'"><a class="ovalbutton ovalbutton_orange" href="#" onClick="smtpAAISet(); return false;"><span>'.$lang['srv_save_profile_yes'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="smtpAAIPopupClose(); return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_cancel'].'" onClick="smtpAAIPopupClose(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" id="aai_smtp_button" style="display:none;" title="'.$lang['srv_save_profile_yes'].'" onclick="smtpAAISet(); return false;">'.$lang['srv_save_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>';
}
}