summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/surveyEmails/class.SurveyAlert.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/surveyEmails/class.SurveyAlert.php')
-rw-r--r--admin/survey/classes/surveyEmails/class.SurveyAlert.php43
1 files changed, 24 insertions, 19 deletions
diff --git a/admin/survey/classes/surveyEmails/class.SurveyAlert.php b/admin/survey/classes/surveyEmails/class.SurveyAlert.php
index d36e884..4c49ce6 100644
--- a/admin/survey/classes/surveyEmails/class.SurveyAlert.php
+++ b/admin/survey/classes/surveyEmails/class.SurveyAlert.php
@@ -18,7 +18,7 @@ class SurveyAlert
// konstrutor
protected function __construct() {}
// kloniranje
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -62,7 +62,9 @@ class SurveyAlert
$ostala_sinhronizirana_polja = array('finish_respondent', 'finish_respondent_cms', 'finish_author', 'finish_other', 'finish_other_emails', 'finish_text', 'finish_subject', 'expire_days', 'expire_author', 'expire_other', 'expire_other_emails', 'expire_text', 'expire_subject', 'delete_author', 'delete_other', 'delete_other_emails', 'delete_text', 'delete_subject', 'active_author', 'active_other', 'active_other_emails', 'active_text0', 'active_subject0', 'active_text1', 'active_subject1');
foreach ($ostala_sinhronizirana_polja as $polje) {
- $result[$polje] = $rowA[$polje];
+
+ if(isset($rowA[$polje]))
+ $result[$polje] = $rowA[$polje];
}
// dodamo še podatke iz dostopa
@@ -75,11 +77,11 @@ class SurveyAlert
$sqlS = sisplet_query("SELECT active, naslov, insert_uid, expire ".$catch_expire_date." FROM srv_anketa WHERE id = '".self::getSurveyId()."'");
$rowS = mysqli_fetch_assoc($sqlS);
- $result['expire'] = $rowS['expire'];
- $result['survey_naslov'] = $rowS['naslov'];
- $result['survey_active'] = $rowS['active'];
- $result['author_uid'] = $rowS['insert_uid'];
- $result['alert_date'] = $rowS['alert_date'];
+ $result['expire'] = $rowS['expire'] ?? '';
+ $result['survey_naslov'] = $rowS['naslov'] ?? '';
+ $result['survey_active'] = $rowS['active'] ?? '';
+ $result['author_uid'] = $rowS['insert_uid'] ?? '';
+ $result['alert_date'] = $rowS['alert_date'] ?? '';
self::$data = array();
self::$data = $result;
@@ -93,7 +95,7 @@ class SurveyAlert
* se s pomočjo crontaba zaganja vsak dan samodejno.
*/
static function prepareSendExpireAlerts() {
- global $site_url, $lang, $mysql_database_name, $app_settings;
+ global $site_url, $lang, $mysql_database_name;
// napolnimo tabelo srv_alert v bazi surveycrontab
$sqlSurvey = sisplet_query("SELECT active FROM srv_anketa WHERE id='".self::getSurveyId()."'");
@@ -163,7 +165,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -185,7 +187,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -245,7 +247,7 @@ class SurveyAlert
* Funkcija pošlje emaile ob spremembi aktivnosti ankete
*/
static function sendMailActive() {
- global $lang, $site_url, $site_path, $app_settings;
+ global $lang, $site_url, $site_path;
// poiščemo vse email naslove
// poiscemo e-maile od avtorja in userjev v dostopu
@@ -306,7 +308,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -325,7 +327,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -368,7 +370,7 @@ class SurveyAlert
* Funkcija pošlje emaile ob izbrisu ankete
*/
static function sendMailDelete() {
- global $lang, $site_url, $site_path, $app_settings;
+ global $lang, $site_url, $site_path;
// poiščemo vse email naslove
// poiscemo e-maile od avtorja in userjev v dostopu
@@ -426,7 +428,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -445,7 +447,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -484,7 +486,7 @@ class SurveyAlert
}
static function setDefaultAlertBeforeExpire() {
- global $lang, $site_url, $site_path, $app_settings;
+ global $lang, $site_url, $site_path;
$turn_on_alert = false;
@@ -522,7 +524,9 @@ class SurveyAlert
#osvežimo podatke
self::loadDataFromDB();
- self::prepareSendExpireAlerts();
+
+ // Ostanek, kjer se uporablja baza surveycrontab za posiljanje obvestil o poteku
+ //self::prepareSendExpireAlerts();
$sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '".self::getSurveyId()."'");
@@ -535,7 +539,6 @@ class SurveyAlert
static function setDefaultAlertActivation() {
global $lang;
global $global_user_id;
- global $app_settings;
$anketa = self::getSurveyId();
@@ -549,6 +552,8 @@ class SurveyAlert
$alert_active_text0 = nl2br($lang['srv_alert_active_text0'].$signature);
$alert_active_subject1 = $lang['srv_alert_active_subject1'];
$alert_active_text1 = nl2br($lang['srv_alert_active_text1'].$signature);
+ $alert_active_other_emails = '';
+ $alert_active_other_emails = '';
$mySqlInsert = sisplet_query("INSERT INTO srv_alert (ank_id, active_author, active_other, active_other_emails, active_subject0, active_text0, active_subject1, active_text1) VALUES " .
"('$anketa', '$alert_active_author', '$alert_active_other', '$alert_active_other_emails', '$alert_active_subject0', '$alert_active_text0', '$alert_active_subject1', '$alert_active_text1') " .