summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/objects
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/objects')
-rw-r--r--admin/survey/classes/objects/obj.MailAdapter.php160
-rw-r--r--admin/survey/classes/objects/obj.PopUp.php39
-rw-r--r--admin/survey/classes/objects/obj.PopUpButton.php21
-rw-r--r--admin/survey/classes/objects/obj.PopUpCancelButton.php1
-rw-r--r--admin/survey/classes/objects/obj.SpremenljivkaSkala.php4
5 files changed, 120 insertions, 105 deletions
diff --git a/admin/survey/classes/objects/obj.MailAdapter.php b/admin/survey/classes/objects/obj.MailAdapter.php
index 1f13c87..e815eb1 100644
--- a/admin/survey/classes/objects/obj.MailAdapter.php
+++ b/admin/survey/classes/objects/obj.MailAdapter.php
@@ -71,8 +71,6 @@ class MailAdapter{
private function prepareSurveySettings(){
global $admin_type;
global $mysql_database_name;
- global $email_server_settings;
- global $email_server_fromSurvey;
// Polovimo nastavitve ce obstajajo v bazi
@@ -112,33 +110,34 @@ class MailAdapter{
// Pri 1ka nastavitvah lahko nastavljamo samo reply to, vse ostalo je veedno default
if($this->settings['1ka']['SMTPReplyTo'] == '')
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
- $this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
- $this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
-
- if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
- $this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
+ $this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
+ $this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
+
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
+ $this->settings['1ka']['SMTPAuth'] = 1;
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
}
- if(isset($email_server_settings['SMTPSecure']))
- $this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
+ $this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
// Pri google smtp je username vedno email
if($this->mailMode == 'google')
$this->settings['google']['SMTPUsername'] = $this->settings['google']['SMTPFrom'];
// ce posiljamo mail vabila in smo na www.1ka.si oz. virutalkah in smo admin - posiljamo preko sekundarnega maila (raziskave@1ka.si)
- if($this->type == 'invitation' && $admin_type == 0 && isset($email_server_settings['secondary_mail'])){
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
+ if($this->type == 'invitation' && $admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
+
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPPassword');
}
// Nastavimo default delay
@@ -149,20 +148,20 @@ class MailAdapter{
else{
// Nastavimo 1ka smtp
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
- $this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
- $this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
-
- if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
- $this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
+ $this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
+ $this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
+
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
+ $this->settings['1ka']['SMTPAuth'] = 1;
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
}
- if(isset($email_server_settings['SMTPSecure']))
- $this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
+ $this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
// Nastavimo default delay
$this->settings['1ka']['SMTPDelay'] = 500000;
@@ -176,9 +175,21 @@ class MailAdapter{
// Nastavimo default delay
$this->settings['google']['SMTPDelay'] = 500000;
+
+ $this->settings['smtp']['SMTPFrom'] = '';
+ $this->settings['smtp']['SMTPFromNice'] = '';
+ $this->settings['smtp']['SMTPReplyTo'] = '';
+ $this->settings['smtp']['SMTPHost'] = '';
+ $this->settings['smtp']['SMTPPort'] = '';
+ $this->settings['smtp']['SMTPUsername'] = '';
+ $this->settings['smtp']['SMTPPassword'] = '';
+ $this->settings['smtp']['SMTPAuth'] = '';
+ $this->settings['smtp']['SMTPSecure'] = '';
+ $this->settings['smtp']['SMTPDelay'] = '';
+
// Ce imamo nastavljeno, da se za posiljanje iz ankete uporabi isti smtp streznik kot za generalno posiljanje
- if($email_server_fromSurvey){
+ if(AppSettings::getInstance()->getSetting('email_server_fromSurvey') === true){
$this->prepareGeneralSettings();
}
else{
@@ -187,13 +198,13 @@ class MailAdapter{
if($this->type == 'invitation'){
// Pri vabilih je default 1ka streznik samo na www.1ka.si in to samo za admine
- if($admin_type == 0 && isset($email_server_settings['secondary_mail'])){
+ if($admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
$this->mailMode = '1ka';
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPPassword');
}
// Drugace je potrebno nastaviti smtp
else{
@@ -211,37 +222,36 @@ class MailAdapter{
// Pripravimo nastavitve splosnega posiljanja v aplikaciji glede na nastavitve v settings_optional.php
private function prepareGeneralSettings(){
- global $email_server_settings;
global $mysql_database_name;
$this->mailMode = 'smtp';
$this->settings['SMTPMailMode'] = 2;
$this->settings['smtp'] = array(
- 'SMTPFrom' => $email_server_settings['SMTPFrom'],
- 'SMTPFromNice' => $email_server_settings['SMTPFromNice'],
- 'SMTPReplyTo' => $email_server_settings['SMTPReplyTo'],
+ 'SMTPFrom' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom'),
+ 'SMTPFromNice' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice'),
+ 'SMTPReplyTo' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo'),
- 'SMTPHost' => $email_server_settings['SMTPHost'],
- 'SMTPPort' => $email_server_settings['SMTPPort']
+ 'SMTPHost' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost'),
+ 'SMTPPort' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort')
);
- if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
- $this->settings['smtp']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
- $this->settings['smtp']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
- $this->settings['smtp']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
+ $this->settings['smtp']['SMTPAuth'] = 1;
+ $this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
+ $this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
}
- if(isset($email_server_settings['SMTPSecure']))
- $this->settings['smtp']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername') !== false)
+ $this->settings['smtp']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
// ce posiljamo v povezavi s placili (racuni, predracuni...) - posiljamo preko tretjega maila (invoice@1ka.si)
- if($this->type == 'payments' && isset($email_server_settings['payments_mail']) && $mysql_database_name == 'real1kasi'){
- $this->settings['smtp']['SMTPFrom'] = $email_server_settings['payments_mail']['SMTPFrom'];
- $this->settings['smtp']['SMTPFromNice'] = $email_server_settings['payments_mail']['SMTPFromNice'];
- $this->settings['smtp']['SMTPReplyTo'] = $email_server_settings['payments_mail']['SMTPReplyTo'];
- $this->settings['smtp']['SMTPUsername'] = $email_server_settings['payments_mail']['SMTPUsername'];
- $this->settings['smtp']['SMTPPassword'] = $email_server_settings['payments_mail']['SMTPPassword'];
+ if($this->type == 'payments' && AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom') !== false && $mysql_database_name == 'real1kasi'){
+ $this->settings['smtp']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom');
+ $this->settings['smtp']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFromNice');
+ $this->settings['smtp']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPReplyTo');
+ $this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPUsername');
+ $this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPPassword');
}
// Nastavimo default delay
@@ -325,31 +335,25 @@ class MailAdapter{
// Vrnemo nastavitve za dolocen mode
public function get1KASettings(){
-
- $result = $this->settings['1ka'];
-
- if(isset($result) && is_array($result))
- return $result;
+
+ if(isset($this->settings['1ka']) && is_array($this->settings['1ka']))
+ return $this->settings['1ka'];
else
return array();
}
public function getGoogleSettings(){
-
- $result = $this->settings['google'];
-
- if(isset($result) && is_array($result))
- return $result;
+
+ if(isset($this->settings['google']) && is_array($this->settings['google']))
+ return $this->settings['google'];
else
return array();
}
public function getSMTPSettings(){
-
- $result = $this->settings['smtp'];
-
- if(isset($result) && is_array($result))
- return $result;
+
+ if(isset($this->settings['smtp']) && is_array($this->settings['smtp']))
+ return $this->settings['smtp'];
else
return array();
}
@@ -491,6 +495,14 @@ class MailAdapter{
// Dobimo nastavitve iz baze
$settings = $this->getSettings($mailModeString);
+ if(!isset($settings["SMTPHost"])
+ || !isset($settings["SMTPPort"])
+ || !isset($settings["SMTPSecure"])
+ || !isset($settings["SMTPUsername"])
+ || !isset($settings["SMTPPassword"])
+ || !isset($settings["SMTPFrom"])){
+ return false;
+ }
// Nastavimo mail server
$this->phpMailerClass->Host = $settings["SMTPHost"];
@@ -709,7 +721,7 @@ class MailAdapter{
// Pripravimo design emaila
private function prepareEmailDesign($content, $heading='', $image='', $button=''){
- global $lang, $app_settings, $site_domain;
+ global $lang, $site_domain;
// V nekaterih primerih ne designeramo maila
if(!in_array($this->type, array('account', 'payments')) || !in_array($site_domain, array('localhost', 'www.1ka.si', 'test.1ka.si', 'test2.1ka.si'))){
@@ -722,7 +734,7 @@ class MailAdapter{
$content = str_replace($signature, "", $content);
// Logo
- $logo_src = ($lang['id'] == '1') ? 'https://www.1ka.si/public/img/logo/1ka_slo.png' : 'https://www.1ka.si/public/img/logo/1ka_eng.png';
+ $logo_src = ($lang['id'] == '1') ? 'https://www.1ka.si/public/img/logo/1ka_logo_slo.jpg' : 'https://www.1ka.si/public/img/logo/1ka_logo_eng.jpg';
// Naslov
//$heading = 'Naslovček';
diff --git a/admin/survey/classes/objects/obj.PopUp.php b/admin/survey/classes/objects/obj.PopUp.php
index 836cc8e..f72ad5d 100644
--- a/admin/survey/classes/objects/obj.PopUp.php
+++ b/admin/survey/classes/objects/obj.PopUp.php
@@ -85,51 +85,50 @@ class PopUp
return $this;
}
- public function display()
- {
+ public function display(){
+
$this->_displayed = true;
#začnemo osnovni div
echo '<div';
- if ($this->_id != null)
- {
+ if ($this->_id != null){
echo ' id="'.$this->_id.'"';
}
- if (count($this->_css) > 0)
- {
+ if (count($this->_css) > 0){
echo ' class="'. implode(' ',$this->_css).'"';
}
echo '>';
+
#dodamo header
- if ($this->_headerText != null)
- {
+ if ($this->_headerText != null){
echo '<div class="divPopUp_top">';
echo $this->_headerText;
echo '</div>'; #PM_top
+
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
}
+
#dodamo vsebino - content
- echo '<div class="divPopUp_content">';
+ echo '<div class="popup_main">';
echo $this->_content;
- echo '</div>'; # class="divPopUp_content"
-
- # začnemo div z gumbi
- echo '<div class="divPopUp_btm">';
+ echo '</div>';
- # izrišemo gumbe
+
+ # div z gumbi
+ echo '<div class="button_holder">';
if (count($this->_buttons) > 0) {
- foreach ($this->_buttons AS $button)
- {
+ foreach ($this->_buttons AS $button){
echo $button;
}
}
+ echo '</div>';
- #zaključimo div z gumbi
- echo '</div>'; #class="inv_FS_btm clr"
-
- #zaključimo div z gumbi
+
+ #zaključimo osnovni div
echo '</div>';
+
return $this;
}
diff --git a/admin/survey/classes/objects/obj.PopUpButton.php b/admin/survey/classes/objects/obj.PopUpButton.php
index 5131c17..bb39d83 100644
--- a/admin/survey/classes/objects/obj.PopUpButton.php
+++ b/admin/survey/classes/objects/obj.PopUpButton.php
@@ -51,7 +51,7 @@ class PopUpButton
private $_float = 'floatLeft';
private $_space = 'spaceLeft';
- private $_buttonColor = 'gray';
+ private $_buttonColor = 'white-blue';
private $_actions = array();
public function __construct($caption = null)
@@ -99,11 +99,15 @@ class PopUpButton
{
switch ($buttonColor) {
case 'orange':
- $this->_buttonColor = 'orange';
+ $this->_buttonColor = 'blue';
break;
+ case 'white-black':
+ $this->_buttonColor = 'white-black';
+ break;
+
default:
- $this->_buttonColor = 'gray';
+ $this->_buttonColor = 'white-blue';
break;
}
@@ -121,13 +125,10 @@ class PopUpButton
}
public function __toString() {
- $str = '<div class="'.$this->_float.' '.$this->_space.'">';
- $str .= '<div class="buttonwrapper" title="'.$this->_title.'">';
- $str .= '<a class="ovalbutton ovalbutton_'.$this->_buttonColor.'" href="#" '.implode(' ', $this->_actions).'>';
- $str .= '<span>'.$this->_caption.'</span>';
- $str .= '</a>';
- $str .= '</div>';
- $str .= '</div>';
+ $str = '<button class="medium '.$this->_buttonColor.'" title="'.$this->_title.'" '.implode(' ', $this->_actions).'>';
+ $str .= $this->_caption;
+ $str .= '</button>';
+
return $str;
}
}
diff --git a/admin/survey/classes/objects/obj.PopUpCancelButton.php b/admin/survey/classes/objects/obj.PopUpCancelButton.php
index 6a0a27e..5777bcb 100644
--- a/admin/survey/classes/objects/obj.PopUpCancelButton.php
+++ b/admin/survey/classes/objects/obj.PopUpCancelButton.php
@@ -53,5 +53,6 @@ class PopUpCancelButton extends PopUpButton
global $lang;
parent::__construct($lang['srv_cancel']);
$this -> addAction('onClick',"$('#fade').fadeOut('slow');$('#fullscreen').fadeOut('slow').html(''); return false;");
+ $this -> setButtonColor('white-black');
}
} \ No newline at end of file
diff --git a/admin/survey/classes/objects/obj.SpremenljivkaSkala.php b/admin/survey/classes/objects/obj.SpremenljivkaSkala.php
index da020ad..be14205 100644
--- a/admin/survey/classes/objects/obj.SpremenljivkaSkala.php
+++ b/admin/survey/classes/objects/obj.SpremenljivkaSkala.php
@@ -133,9 +133,11 @@ class SpremenljivkaSkala {
* @return (Intiger) $this->skala
*/
function getSkala() {
- if ((int)$skala >= 0) {
+
+ if ((int)$this->skala >= 0) {
return $this->skala;
}
+
return NULL;
}