localization FS#172

Dieser Commit ist enthalten in:
oldperl 2017-08-01 12:52:06 +00:00
Ursprung 520f406556
Commit bdf5a43d06
23 geänderte Dateien mit 4792 neuen und 2737 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,7 +29,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -36,22 +36,20 @@ if (!defined('CON_FRAMEWORK')) {
/** /**
* Recipient group management class * Recipient group management class
*/ */
class RecipientGroupCollection extends ItemCollection class RecipientGroupCollection extends ItemCollection {
{
/** /**
* Constructor Function * Constructor Function
* @param none * @param none
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_groups"], "idnewsgroup"); parent::__construct($cfg["tab"]["news_groups"], "idnewsgroup");
$this->_setItemClass("RecipientGroup"); $this->_setItemClass("RecipientGroup");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroupCollection() public function RecipientGroupCollection() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
@ -61,8 +59,7 @@ class RecipientGroupCollection extends ItemCollection
* @param $groupname string Specifies the groupname * @param $groupname string Specifies the groupname
* @param $defaultgroup integer Specfies, if group is default group (optional) * @param $defaultgroup integer Specfies, if group is default group (optional)
*/ */
public function create($groupname, $defaultgroup = 0) public function create($groupname, $defaultgroup = 0) {
{
global $client, $lang; global $client, $lang;
$client = Contenido_Security::toInteger($client); $client = Contenido_Security::toInteger($client);
@ -99,8 +96,7 @@ class RecipientGroupCollection extends ItemCollection
* *
* @param $itemID int specifies the newsletter recipient group * @param $itemID int specifies the newsletter recipient group
*/ */
public function delete($itemID) public function delete($itemID) {
{
$oAssociations = new RecipientGroupMemberCollection; $oAssociations = new RecipientGroupMemberCollection;
$oAssociations->setWhere("idnewsgroup", $itemID); $oAssociations->setWhere("idnewsgroup", $itemID);
$oAssociations->query(); $oAssociations->query();
@ -110,20 +106,19 @@ class RecipientGroupCollection extends ItemCollection
} }
parent::delete($itemID); parent::delete($itemID);
} }
}
}
/** /**
* Single RecipientGroup Item * Single RecipientGroup Item
*/ */
class RecipientGroup extends Item class RecipientGroup extends Item {
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_groups"], "idnewsgroup"); parent::__construct($cfg["tab"]["news_groups"], "idnewsgroup");
if ($mId !== false) { if ($mId !== false) {
@ -132,17 +127,15 @@ class RecipientGroup extends Item
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroup($mId = false) public function RecipientGroup($mId = false) {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId); $this->__construct($mId);
} }
/** /**
* Overriden store() method to ensure, that there is only one default group * Overriden store() method to ensure, that there is only one default group
**/ * */
public function store() public function store() {
{
global $client, $lang; global $client, $lang;
$client = Contenido_Security::toInteger($client); $client = Contenido_Security::toInteger($client);
@ -163,30 +156,28 @@ class RecipientGroup extends Item
} }
parent::store(); parent::store();
} }
}
}
/** /**
* Recipient group member management class * Recipient group member management class
*/ */
class RecipientGroupMemberCollection extends ItemCollection class RecipientGroupMemberCollection extends ItemCollection {
{
/** /**
* Constructor Function * Constructor Function
* @param none * @param none
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_groupmembers"], "idnewsgroupmember"); parent::__construct($cfg["tab"]["news_groupmembers"], "idnewsgroupmember");
$this->_setJoinPartner ('RecipientGroupCollection'); $this->_setJoinPartner('RecipientGroupCollection');
$this->_setJoinPartner ('RecipientCollection'); $this->_setJoinPartner('RecipientCollection');
$this->_setItemClass("RecipientGroupMember"); $this->_setItemClass("RecipientGroupMember");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroupMemberCollection() public function RecipientGroupMemberCollection() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
@ -196,8 +187,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* @param $idrecipientgroup int specifies the newsletter group * @param $idrecipientgroup int specifies the newsletter group
* @param $idrecipient int specifies the newsletter user * @param $idrecipient int specifies the newsletter user
*/ */
public function create($idrecipientgroup, $idrecipient) public function create($idrecipientgroup, $idrecipient) {
{
$idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup); $idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup);
$idrecipient = Contenido_Security::toInteger($idrecipient); $idrecipient = Contenido_Security::toInteger($idrecipient);
@ -223,8 +213,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* @param $idrecipientgroup int specifies the newsletter group * @param $idrecipientgroup int specifies the newsletter group
* @param $idrecipient int specifies the newsletter user * @param $idrecipient int specifies the newsletter user
*/ */
public function remove($idrecipientgroup, $idrecipient) public function remove($idrecipientgroup, $idrecipient) {
{
$idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup); $idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup);
$idrecipient = Contenido_Security::toInteger($idrecipient); $idrecipient = Contenido_Security::toInteger($idrecipient);
@ -241,8 +230,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* Removes all associations from any newsletter group * Removes all associations from any newsletter group
* @param $idrecipient int specifies the newsletter recipient * @param $idrecipient int specifies the newsletter recipient
*/ */
public function removeRecipientFromGroups($idrecipient) public function removeRecipientFromGroups($idrecipient) {
{
$idrecipient = Contenido_Security::toInteger($idrecipient); $idrecipient = Contenido_Security::toInteger($idrecipient);
$this->setWhere("idnewsrcp", $idrecipient); $this->setWhere("idnewsrcp", $idrecipient);
@ -257,8 +245,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* Removes all associations of a newsletter group * Removes all associations of a newsletter group
* @param $idgroup int specifies the newsletter recipient group * @param $idgroup int specifies the newsletter recipient group
*/ */
public function removeGroup($idgroup) public function removeGroup($idgroup) {
{
$idgroup = Contenido_Security::toInteger($idgroup); $idgroup = Contenido_Security::toInteger($idgroup);
$this->setWhere("idnewsgroup", $idgroup); $this->setWhere("idnewsgroup", $idgroup);
@ -275,8 +262,7 @@ class RecipientGroupMemberCollection extends ItemCollection
* @param $asObjects boolean specifies if the function should return objects * @param $asObjects boolean specifies if the function should return objects
* @return array RecipientRecipient items * @return array RecipientRecipient items
*/ */
public function getRecipientsInGroup($idrecipientgroup, $asObjects = true) public function getRecipientsInGroup($idrecipientgroup, $asObjects = true) {
{
$idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup); $idrecipientgroup = Contenido_Security::toInteger($idrecipientgroup);
$this->setWhere("idnewsgroup", $idrecipientgroup); $this->setWhere("idnewsgroup", $idrecipientgroup);
@ -297,20 +283,19 @@ class RecipientGroupMemberCollection extends ItemCollection
return ($aObjects); return ($aObjects);
} }
}
}
/** /**
* Single RecipientGroup Item * Single RecipientGroup Item
*/ */
class RecipientGroupMember extends Item class RecipientGroupMember extends Item {
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_groupmembers"], "idnewsgroupmember"); parent::__construct($cfg["tab"]["news_groupmembers"], "idnewsgroupmember");
if ($mId !== false) { if ($mId !== false) {
@ -319,11 +304,11 @@ class RecipientGroupMember extends Item
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientGroupMember($mId = false) public function RecipientGroupMember($mId = false) {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId); $this->__construct($mId);
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,31 +29,27 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
/** /**
* Collection management class * Collection management class
*/ */
class cNewsletterJobCollection extends ItemCollection class cNewsletterJobCollection extends ItemCollection {
{
/** /**
* Constructor Function * Constructor Function
* @param none * @param none
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_jobs"], "idnewsjob"); parent::__construct($cfg["tab"]["news_jobs"], "idnewsjob");
$this->_setItemClass("cNewsletterJob"); $this->_setItemClass("cNewsletterJob");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterJobCollection() public function cNewsletterJobCollection() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
@ -62,8 +59,7 @@ class cNewsletterJobCollection extends ItemCollection
* @param $name string Specifies the name of the newsletter, the same name may be used more than once * @param $name string Specifies the name of the newsletter, the same name may be used more than once
* @param $idnews integer Newsletter id * @param $idnews integer Newsletter id
*/ */
public function create($iIDNews, $iIDCatArt, $sName = "") public function create($iIDNews, $iIDCatArt, $sName = "") {
{
global $client, $lang, $cfg, $cfgClient, $auth; global $client, $lang, $cfg, $cfgClient, $auth;
$oNewsletter = new Newsletter; $oNewsletter = new Newsletter;
@ -90,13 +86,13 @@ class cNewsletterJobCollection extends ItemCollection
$oLang = new cApiLanguage($lang); $oLang = new cApiLanguage($lang);
$oItem->set("encoding", $oLang->get("encoding")); $oItem->set("encoding", $oLang->get("encoding"));
unset ($oLang); unset($oLang);
$oItem->set("idart", $oNewsletter->get("idart")); $oItem->set("idart", $oNewsletter->get("idart"));
$oItem->set("subject", $oNewsletter->get("subject")); $oItem->set("subject", $oNewsletter->get("subject"));
// Precompile messages // Precompile messages
$sPath = $cfgClient[$client]["path"]["htmlpath"]."front_content.php?changelang=".$lang."&idcatart=".$iIDCatArt."&"; $sPath = $cfgClient[$client]["path"]["htmlpath"] . "front_content.php?changelang=" . $lang . "&idcatart=" . $iIDCatArt . "&";
$sMessageText = $oNewsletter->get("message"); $sMessageText = $oNewsletter->get("message");
@ -105,10 +101,10 @@ class cNewsletterJobCollection extends ItemCollection
$sMessageText = str_replace("\r\n", "\n", $sMessageText); $sMessageText = str_replace("\r\n", "\n", $sMessageText);
} }
$oNewsletter->_replaceTag($sMessageText, false, "unsubscribe", $sPath."unsubscribe={KEY}"); $oNewsletter->_replaceTag($sMessageText, false, "unsubscribe", $sPath . "unsubscribe={KEY}");
$oNewsletter->_replaceTag($sMessageText, false, "change", $sPath."change={KEY}"); $oNewsletter->_replaceTag($sMessageText, false, "change", $sPath . "change={KEY}");
$oNewsletter->_replaceTag($sMessageText, false, "stop", $sPath."stop={KEY}"); $oNewsletter->_replaceTag($sMessageText, false, "stop", $sPath . "stop={KEY}");
$oNewsletter->_replaceTag($sMessageText, false, "goon", $sPath."goon={KEY}"); $oNewsletter->_replaceTag($sMessageText, false, "goon", $sPath . "goon={KEY}");
$oItem->set("message_text", $sMessageText); $oItem->set("message_text", $sMessageText);
@ -125,22 +121,22 @@ class cNewsletterJobCollection extends ItemCollection
$oNewsletter->_replaceTag($sMessageHTML, true, "date", "MAIL_DATE"); $oNewsletter->_replaceTag($sMessageHTML, true, "date", "MAIL_DATE");
$oNewsletter->_replaceTag($sMessageHTML, true, "time", "MAIL_TIME"); $oNewsletter->_replaceTag($sMessageHTML, true, "time", "MAIL_TIME");
$oNewsletter->_replaceTag($sMessageHTML, true, "unsubscribe", $sPath."unsubscribe={KEY}"); $oNewsletter->_replaceTag($sMessageHTML, true, "unsubscribe", $sPath . "unsubscribe={KEY}");
$oNewsletter->_replaceTag($sMessageHTML, true, "change", $sPath."change={KEY}"); $oNewsletter->_replaceTag($sMessageHTML, true, "change", $sPath . "change={KEY}");
$oNewsletter->_replaceTag($sMessageHTML, true, "stop", $sPath."stop={KEY}"); $oNewsletter->_replaceTag($sMessageHTML, true, "stop", $sPath . "stop={KEY}");
$oNewsletter->_replaceTag($sMessageHTML, true, "goon", $sPath."goon={KEY}"); $oNewsletter->_replaceTag($sMessageHTML, true, "goon", $sPath . "goon={KEY}");
// Replace plugin tags by simple MAIL_ tags // Replace plugin tags by simple MAIL_ tags
if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true") { if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true") {
if (is_array($cfg['plugins']['recipients'])) { if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $sPlugin) { foreach ($cfg['plugins']['recipients'] as $sPlugin) {
plugin_include("recipients", $sPlugin."/".$sPlugin.".php"); plugin_include("recipients", $sPlugin . "/" . $sPlugin . ".php");
if (function_exists("recipients_".$sPlugin."_wantedVariables")) { if (function_exists("recipients_" . $sPlugin . "_wantedVariables")) {
$aPluginVars = array(); $aPluginVars = array();
$aPluginVars = call_user_func("recipients_".$sPlugin."_wantedVariables"); $aPluginVars = call_user_func("recipients_" . $sPlugin . "_wantedVariables");
foreach ($aPluginVars as $sPluginVar) { foreach ($aPluginVars as $sPluginVar) {
$oNewsletter->_replaceTag($sMessageHTML, true, $sPluginVar, "MAIL_".strtoupper($sPluginVar)); $oNewsletter->_replaceTag($sMessageHTML, true, $sPluginVar, "MAIL_" . strtoupper($sPluginVar));
} }
} }
} }
@ -182,8 +178,8 @@ class cNewsletterJobCollection extends ItemCollection
$aSendInfo[] = $oGroup->get("groupname"); $aSendInfo[] = $oGroup->get("groupname");
} }
unset ($oGroup); unset($oGroup);
unset ($oGroups); unset($oGroups);
break; break;
case "single": case "single":
if (is_numeric($oNewsletter->get("send_ids"))) { if (is_numeric($oNewsletter->get("send_ids"))) {
@ -206,12 +202,11 @@ class cNewsletterJobCollection extends ItemCollection
$oItem->set("created", date("Y-m-d H:i:s"), false); $oItem->set("created", date("Y-m-d H:i:s"), false);
$oItem->set("author", $auth->auth["uid"]); $oItem->set("author", $auth->auth["uid"]);
$oItem->set("authorname", $auth->auth["uname"]); $oItem->set("authorname", $auth->auth["uname"]);
unset ($oNewsletter); // Not needed anymore unset($oNewsletter); // Not needed anymore
// Adds log items for all recipients and returns recipient count // Adds log items for all recipients and returns recipient count
$oLogs = new cNewsletterLogCollection(); $oLogs = new cNewsletterLogCollection();
$iRecipientCount = $oLogs->initializeJob($oItem->get($oItem->primaryKey), $iIDNews); $iRecipientCount = $oLogs->initializeJob($oItem->get($oItem->primaryKey), $iIDNews);
unset ($oLogs); unset($oLogs);
$oItem->set("rcpcount", $iRecipientCount); $oItem->set("rcpcount", $iRecipientCount);
$oItem->set("sendcount", 0); $oItem->set("sendcount", 0);
@ -231,27 +226,25 @@ class cNewsletterJobCollection extends ItemCollection
* *
* @param $iItemID int specifies the frontend user group * @param $iItemID int specifies the frontend user group
*/ */
public function delete($iItemID) public function delete($iItemID) {
{
$oLogs = new cNewsletterLogCollection(); $oLogs = new cNewsletterLogCollection();
$oLogs->delete($iItemID); $oLogs->delete($iItemID);
parent::delete($iItemID); parent::delete($iItemID);
} }
}
}
/** /**
* Single NewsletterJob Item * Single NewsletterJob Item
*/ */
class cNewsletterJob extends Item class cNewsletterJob extends Item {
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_jobs"], "idnewsjob"); parent::__construct($cfg["tab"]["news_jobs"], "idnewsjob");
if ($mId !== false) { if ($mId !== false) {
@ -260,14 +253,12 @@ class cNewsletterJob extends Item
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterJob($mId = false) public function cNewsletterJob($mId = false) {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId); $this->__construct($mId);
} }
public function runJob() public function runJob() {
{
global $cfg, $recipient; global $cfg, $recipient;
$iCount = 0; $iCount = 0;
@ -305,7 +296,7 @@ class cNewsletterJob extends Item
$oLanguage = new cApiLanguage($this->get("idlang")); $oLanguage = new cApiLanguage($this->get("idlang"));
$sFormatDate = $oLanguage->getProperty("dateformat", "date"); $sFormatDate = $oLanguage->getProperty("dateformat", "date");
$sFormatTime = $oLanguage->getProperty("dateformat", "time"); $sFormatTime = $oLanguage->getProperty("dateformat", "time");
unset ($oLanguage); unset($oLanguage);
if ($sFormatDate == "") { if ($sFormatDate == "") {
$sFormatDate = "%d.%m.%Y"; $sFormatDate = "%d.%m.%Y";
@ -353,9 +344,9 @@ class cNewsletterJob extends Item
if (is_array($cfg['plugins']['recipients'])) { if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $sPlugin) { foreach ($cfg['plugins']['recipients'] as $sPlugin) {
plugin_include("recipients", $sPlugin."/".$sPlugin.".php"); plugin_include("recipients", $sPlugin . "/" . $sPlugin . ".php");
if (function_exists("recipients_".$sPlugin."_wantedVariables")) { if (function_exists("recipients_" . $sPlugin . "_wantedVariables")) {
$aPlugins[$sPlugin] = call_user_func("recipients_".$sPlugin."_wantedVariables"); $aPlugins[$sPlugin] = call_user_func("recipients_" . $sPlugin . "_wantedVariables");
} }
} }
} }
@ -410,11 +401,11 @@ class cNewsletterJob extends Item
foreach ($aPlugins as $sPlugin => $aPluginVar) { foreach ($aPlugins as $sPlugin => $aPluginVar) {
foreach ($aPluginVar as $sPluginVar) { foreach ($aPluginVar as $sPluginVar) {
// Replace tags in text message // Replace tags in text message
$sRcpMsgText = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar), $sRcpMsgText); $sRcpMsgText = str_replace("MAIL_" . strtoupper($sPluginVar), call_user_func("recipients_" . $sPlugin . "_getvalue", $sPluginVar), $sRcpMsgText);
// Replace tags in html message // Replace tags in html message
if ($bIsHTML && $bSendHTML) { if ($bIsHTML && $bSendHTML) {
$sRcpMsgHTML = str_replace("MAIL_".strtoupper($sPluginVar), call_user_func("recipients_".$sPlugin."_getvalue", $sPluginVar), $sRcpMsgHTML); $sRcpMsgHTML = str_replace("MAIL_" . strtoupper($sPluginVar), call_user_func("recipients_" . $sPlugin . "_getvalue", $sPluginVar), $sRcpMsgHTML);
} }
} }
} }
@ -432,9 +423,9 @@ class cNewsletterJob extends Item
if ($bIsHTML && $bSendHTML) { if ($bIsHTML && $bSendHTML) {
$oMail->Body = $sRcpMsgHTML; $oMail->Body = $sRcpMsgHTML;
$oMail->AltBody = $sRcpMsgText."\n\n"; $oMail->AltBody = $sRcpMsgText . "\n\n";
} else { } else {
$oMail->Body = $sRcpMsgText."\n\n"; $oMail->Body = $sRcpMsgText . "\n\n";
} }
if ($oMail->Send()) { if ($oMail->Send()) {
@ -486,8 +477,7 @@ class cNewsletterJob extends Item
/** /**
* Overriden store() method to set status to finished if rcpcount is 0 * Overriden store() method to set status to finished if rcpcount is 0
*/ */
public function store() public function store() {
{
if ($this->get("rcpcount") == 0) { if ($this->get("rcpcount") == 0) {
// No recipients, job finished // No recipients, job finished
$this->set("status", 9); $this->set("status", 9);
@ -499,6 +489,7 @@ class cNewsletterJob extends Item
parent::store(); parent::store();
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,31 +29,27 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
/** /**
* Collection management class * Collection management class
*/ */
class cNewsletterLogCollection extends ItemCollection class cNewsletterLogCollection extends ItemCollection {
{
/** /**
* Constructor Function * Constructor Function
* @param none * @param none
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_log"], "idnewslog"); parent::__construct($cfg["tab"]["news_log"], "idnewslog");
$this->_setItemClass("cNewsletterLog"); $this->_setItemClass("cNewsletterLog");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterLogCollection() public function cNewsletterLogCollection() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
@ -64,8 +61,7 @@ class cNewsletterLogCollection extends ItemCollection
* @param $rcp_name string Name of the recipient (-> recipient may be deleted) * @param $rcp_name string Name of the recipient (-> recipient may be deleted)
* @param $rcp_email string E-Mail of the recipient (-> recipient may be deleted) * @param $rcp_email string E-Mail of the recipient (-> recipient may be deleted)
*/ */
public function create($idnewsjob, $idnewsrcp) public function create($idnewsjob, $idnewsrcp) {
{
global $client, $lang, $auth; global $client, $lang, $auth;
$idnewsjob = Contenido_Security::toInteger($idnewsjob); $idnewsjob = Contenido_Security::toInteger($idnewsjob);
@ -118,8 +114,7 @@ class cNewsletterLogCollection extends ItemCollection
* @param integer $idnews ID of newsletter * @param integer $idnews ID of newsletter
* @return integer Recipient count * @return integer Recipient count
*/ */
public function initializeJob($idnewsjob, $idnews) public function initializeJob($idnewsjob, $idnews) {
{
global $cfg; global $cfg;
$idnewsjob = Contenido_Security::toInteger($idnewsjob); $idnewsjob = Contenido_Security::toInteger($idnewsjob);
@ -135,34 +130,34 @@ class cNewsletterLogCollection extends ItemCollection
case "all" : case "all" :
$sDistinct = ""; $sDistinct = "";
$sFrom = ""; $sFrom = "";
$sSQL = "deactivated='0' AND confirmed='1' AND idclient='".$iIDClient."' AND idlang='".$iIDLang."'"; $sSQL = "deactivated='0' AND confirmed='1' AND idclient='" . $iIDClient . "' AND idlang='" . $iIDLang . "'";
break; break;
case "default" : case "default" :
$sDistinct = "distinct"; $sDistinct = "distinct";
$sFrom = $cfg["tab"]["news_groups"]." AS groups, ".$cfg["tab"]["news_groupmembers"]." AS groupmembers "; $sFrom = $cfg["tab"]["news_groups"] . " AS groups, " . $cfg["tab"]["news_groupmembers"] . " AS groupmembers ";
$sSQL = "recipientcollection.idclient = '".$iIDClient."' AND ". $sSQL = "recipientcollection.idclient = '" . $iIDClient . "' AND " .
"recipientcollection.idlang = '".$iIDLang."' AND ". "recipientcollection.idlang = '" . $iIDLang . "' AND " .
"recipientcollection.deactivated = '0' AND ". "recipientcollection.deactivated = '0' AND " .
"recipientcollection.confirmed = '1' AND ". "recipientcollection.confirmed = '1' AND " .
"recipientcollection.idnewsrcp = groupmembers.idnewsrcp AND ". "recipientcollection.idnewsrcp = groupmembers.idnewsrcp AND " .
"groupmembers.idnewsgroup = groups.idnewsgroup AND ". "groupmembers.idnewsgroup = groups.idnewsgroup AND " .
"groups.defaultgroup = '1' AND groups.idclient = '".$iIDClient."' AND ". "groups.defaultgroup = '1' AND groups.idclient = '" . $iIDClient . "' AND " .
"groups.idlang = '".$iIDLang."'"; "groups.idlang = '" . $iIDLang . "'";
break; break;
case "selection" : case "selection" :
$aGroups = unserialize ($oNewsletter->get("send_ids")); $aGroups = unserialize($oNewsletter->get("send_ids"));
if (is_array($aGroups) && count($aGroups) > 0) { if (is_array($aGroups) && count($aGroups) > 0) {
$sGroups = "'" . implode("','", $aGroups) . "'"; $sGroups = "'" . implode("','", $aGroups) . "'";
$sDistinct = "distinct"; $sDistinct = "distinct";
$sFrom = $cfg["tab"]["news_groupmembers"]." AS groupmembers "; $sFrom = $cfg["tab"]["news_groupmembers"] . " AS groupmembers ";
$sSQL = "recipientcollection.idclient = '".$iIDClient."' AND ". $sSQL = "recipientcollection.idclient = '" . $iIDClient . "' AND " .
"recipientcollection.idlang = '".$iIDLang."' AND ". "recipientcollection.idlang = '" . $iIDLang . "' AND " .
"recipientcollection.deactivated = '0' AND ". "recipientcollection.deactivated = '0' AND " .
"recipientcollection.confirmed = '1' AND ". "recipientcollection.confirmed = '1' AND " .
"recipientcollection.idnewsrcp = groupmembers.idnewsrcp AND ". "recipientcollection.idnewsrcp = groupmembers.idnewsrcp AND " .
"groupmembers.idnewsgroup IN (".$sGroups.")"; "groupmembers.idnewsgroup IN (" . $sGroups . ")";
} else { } else {
$sDestination = "unknown"; $sDestination = "unknown";
} }
@ -172,7 +167,7 @@ class cNewsletterLogCollection extends ItemCollection
if (is_numeric($iID)) { if (is_numeric($iID)) {
$sDistinct = ""; $sDistinct = "";
$sFrom = ""; $sFrom = "";
$sSQL = "idnewsrcp = '".$iID."'"; $sSQL = "idnewsrcp = '" . $iID . "'";
} else { } else {
$sDestination = "unknown"; $sDestination = "unknown";
} }
@ -180,7 +175,7 @@ class cNewsletterLogCollection extends ItemCollection
default: default:
$sDestination = "unknown"; $sDestination = "unknown";
} }
unset ($oNewsletter); unset($oNewsletter);
if ($sDestination == "unknown") { if ($sDestination == "unknown") {
return 0; return 0;
@ -205,8 +200,7 @@ class cNewsletterLogCollection extends ItemCollection
* Overriden delete function to update recipient count if removing recipient from the list * Overriden delete function to update recipient count if removing recipient from the list
* @param integer $idnewslog ID * @param integer $idnewslog ID
*/ */
public function delete($idnewslog) public function delete($idnewslog) {
{
$idnewslog = Contenido_Security::toInteger($idnewslog); $idnewslog = Contenido_Security::toInteger($idnewslog);
$oLog = new cNewsletterLog($idnewslog); $oLog = new cNewsletterLog($idnewslog);
@ -216,13 +210,12 @@ class cNewsletterLogCollection extends ItemCollection
$oJob = new cNewsletterJob($iIDNewsJob); $oJob = new cNewsletterJob($iIDNewsJob);
$oJob->set("rcpcount", $oJob->get("rcpcount") - 1); $oJob->set("rcpcount", $oJob->get("rcpcount") - 1);
$oJob->store(); $oJob->store();
unset ($oJob); unset($oJob);
parent::delete($idnewslog); parent::delete($idnewslog);
} }
public function deleteJob($idnewsjob) public function deleteJob($idnewsjob) {
{
$idnewsjob = Contenido_Security::toInteger($idnewsjob); $idnewsjob = Contenido_Security::toInteger($idnewsjob);
$this->setWhere("idnewsjob", $idnewsjob); $this->setWhere("idnewsjob", $idnewsjob);
$this->query(); $this->query();
@ -233,20 +226,19 @@ class cNewsletterLogCollection extends ItemCollection
return true; return true;
} }
}
}
/** /**
* Single NewsletterLog Item * Single NewsletterLog Item
*/ */
class cNewsletterLog extends Item class cNewsletterLog extends Item {
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_log"], "idnewslog"); parent::__construct($cfg["tab"]["news_log"], "idnewslog");
if ($mId !== false) { if ($mId !== false) {
@ -255,11 +247,11 @@ class cNewsletterLog extends Item
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function cNewsletterLog($mId = false) public function cNewsletterLog($mId = false) {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId); $this->__construct($mId);
} }
} }
?> ?>

Datei anzeigen

@ -118,7 +118,7 @@ class NewsletterCollection extends ItemCollection
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") { if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
$iIDArt = conCopyArticle($oBaseItem->get("idart"), $iIDArt = conCopyArticle($oBaseItem->get("idart"),
$oClientLang->getProperty("newsletter", "html_newsletter_idcat"), $oClientLang->getProperty("newsletter", "html_newsletter_idcat"),
sprintf(i18n("Newsletter: %s"), $oItem->get("name"))); sprintf(i18n("Newsletter: %s", "newsletter"), $oItem->get("name")));
conMakeOnline($iIDArt, $lang); // Article has to be online for sending... conMakeOnline($iIDArt, $lang); // Article has to be online for sending...
} }
unset ($oClientLang); unset ($oClientLang);
@ -564,7 +564,7 @@ class Newsletter extends Item
$sReturn = $sHTML; $sReturn = $sHTML;
} else { } else {
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sErrorText = i18n("There was a problem getting the newsletter article using http. Error: %s (%s)"); $sErrorText = i18n("There was a problem getting the newsletter article using http. Error: %s (%s)", "newsletter");
} else { } else {
$sErrorText = "There was a problem getting the newsletter article using http. Error: %s (%s)"; $sErrorText = "There was a problem getting the newsletter article using http. Error: %s (%s)";
} }
@ -671,7 +671,7 @@ class Newsletter extends Item
// deleted). Exit with error instead of sending as text message only // deleted). Exit with error instead of sending as text message only
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: No html message available"); $sError = i18n("Newsletter to %s could not be sent: No html message available", "newsletter");
} else { } else {
$sError = "Newsletter to %s could not be sent: No html message available"; $sError = "Newsletter to %s could not be sent: No html message available";
} }
@ -742,7 +742,7 @@ class Newsletter extends Item
if (!isValidMail($sEMail) || strtolower($sEMail) == "sysadmin@ihresite.de") { if (!isValidMail($sEMail) || strtolower($sEMail) == "sysadmin@ihresite.de") {
// No valid destination mail address specified // No valid destination mail address specified
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: No valid e-mail address"); $sError = i18n("Newsletter to %s could not be sent: No valid e-mail address", "newsletter");
} else { } else {
$sError = "Newsletter to %s could not be sent: No valid e-mail address"; $sError = "Newsletter to %s could not be sent: No valid e-mail address";
} }
@ -767,7 +767,7 @@ class Newsletter extends Item
if (!$oMail->Send()) { if (!$oMail->Send()) {
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent"); $sError = i18n("Newsletter to %s could not be sent", "newsletter");
} else { } else {
$sError = "Newsletter to %s could not be sent"; $sError = "Newsletter to %s could not be sent";
} }
@ -830,7 +830,7 @@ class Newsletter extends Item
// deleted). Exit with error instead of sending as text message only // deleted). Exit with error instead of sending as text message only
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter could not be sent: No html message available"); $sError = i18n("Newsletter could not be sent: No html message available", "newsletter");
} else { } else {
$sError = "Newsletter could not be sent: No html message available"; $sError = "Newsletter could not be sent: No html message available";
} }
@ -942,14 +942,14 @@ class Newsletter extends Item
if (strlen($sKey) != 30) { // Prevents sending without having a key if (strlen($sKey) != 30) { // Prevents sending without having a key
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: Recipient has an incompatible or empty key"); $sError = i18n("Newsletter to %s could not be sent: Recipient has an incompatible or empty key", "newsletter");
} else { } else {
$sError = "Newsletter to %s could not be sent: Recipient has an incompatible or empty key"; $sError = "Newsletter to %s could not be sent: Recipient has an incompatible or empty key";
} }
$aMessages[] = $sName." (".$sEMail."): ".sprintf($sError, $sEMail); $aMessages[] = $sName." (".$sEMail."): ".sprintf($sError, $sEMail);
} else if (!isValidMail($sEMail)) { } else if (!isValidMail($sEMail)) {
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent: No valid e-mail address specified"); $sError = i18n("Newsletter to %s could not be sent: No valid e-mail address specified", "newsletter");
} else { } else {
$sError = "Newsletter to %s could not be sent: No valid e-mail address specified"; $sError = "Newsletter to %s could not be sent: No valid e-mail address specified";
} }
@ -975,7 +975,7 @@ class Newsletter extends Item
$aSendRcps[] = $sName." (".$sEMail.")"; $aSendRcps[] = $sName." (".$sEMail.")";
} else { } else {
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("Newsletter to %s could not be sent"); $sError = i18n("Newsletter to %s could not be sent", "newsletter");
} else { } else {
$sError = "Newsletter to %s could not be sent"; $sError = "Newsletter to %s could not be sent";
} }
@ -985,7 +985,7 @@ class Newsletter extends Item
} }
} else { } else {
if ($contenido) { // Use i18n only in backend if ($contenido) { // Use i18n only in backend
$sError = i18n("No recipient with specified recipient/group id %s/%s found"); $sError = i18n("No recipient with specified recipient/group id %s/%s found", "newsletter");
} else { } else {
$sError = "No recipient with specified recpient/group id %s/%s found"; $sError = "No recipient with specified recpient/group id %s/%s found";
} }

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,31 +29,27 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
/** /**
* Recipient management class * Recipient management class
*/ */
class RecipientCollection extends ItemCollection class RecipientCollection extends ItemCollection {
{
/** /**
* Constructor Function * Constructor Function
* @param none * @param none
*/ */
public function __construct() public function __construct() {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_rcp"], "idnewsrcp"); parent::__construct($cfg["tab"]["news_rcp"], "idnewsrcp");
$this->_setItemClass("Recipient"); $this->_setItemClass("Recipient");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function RecipientCollection() public function RecipientCollection() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
@ -65,12 +62,11 @@ class RecipientCollection extends ItemCollection
* @param string $sJoinID Specifies additional recipient group ids to join (optional, e.g. 47,12,...) * @param string $sJoinID Specifies additional recipient group ids to join (optional, e.g. 47,12,...)
* @param int $iMessageType Specifies the message type for the recipient (0 = text, 1 = html) * @param int $iMessageType Specifies the message type for the recipient (0 = text, 1 = html)
*/ */
public function create($sEMail, $sName = "", $iConfirmed = 0, $sJoinID = "", $iMessageType = 0) public function create($sEMail, $sName = "", $iConfirmed = 0, $sJoinID = "", $iMessageType = 0) {
{
global $client, $lang, $auth; global $client, $lang, $auth;
$iConfirmed = (int)$iConfirmed; $iConfirmed = (int) $iConfirmed;
$iMessageType = (int)$iMessageType; $iMessageType = (int) $iMessageType;
/* Check if the e-mail adress already exists */ /* Check if the e-mail adress already exists */
$email = strtolower($email); // e-mail always lower case $email = strtolower($email); // e-mail always lower case
@ -80,14 +76,14 @@ class RecipientCollection extends ItemCollection
$this->query(); $this->query();
if ($this->next()) { if ($this->next()) {
return $this->create($sEMail."_".substr(md5(rand()),0,10), $sName, 0, $sJoinID, $iMessageType); // 0: Deactivate 'confirmed' return $this->create($sEMail . "_" . substr(md5(rand()), 0, 10), $sName, 0, $sJoinID, $iMessageType); // 0: Deactivate 'confirmed'
} }
$oItem = parent::createNewItem(); $oItem = parent::createNewItem();
$oItem->set("idclient", $client); $oItem->set("idclient", $client);
$oItem->set("idlang", $lang); $oItem->set("idlang", $lang);
$oItem->set("name", $sName); $oItem->set("name", $sName);
$oItem->set("email", $sEMail); $oItem->set("email", $sEMail);
$oItem->set("hash", substr(md5(rand()),0,17) . uniqid("")); // Generating UID, 30 characters $oItem->set("hash", substr(md5(rand()), 0, 17) . uniqid("")); // Generating UID, 30 characters
$oItem->set("confirmed", $iConfirmed); $oItem->set("confirmed", $iConfirmed);
$oItem->set("news_type", $iMessageType); $oItem->set("news_type", $iMessageType);
@ -100,7 +96,6 @@ class RecipientCollection extends ItemCollection
$oItem->store(); $oItem->store();
$iIDRcp = $oItem->get("idnewsrcp"); // Getting internal id of new recipient $iIDRcp = $oItem->get("idnewsrcp"); // Getting internal id of new recipient
// Add this recipient to the default recipient group (if available) // Add this recipient to the default recipient group (if available)
$oGroups = new RecipientGroupCollection(); $oGroups = new RecipientGroupCollection();
$oGroupMembers = new RecipientGroupMemberCollection(); $oGroupMembers = new RecipientGroupMemberCollection();
@ -135,8 +130,7 @@ class RecipientCollection extends ItemCollection
* *
* @param $itemID int specifies the recipient * @param $itemID int specifies the recipient
*/ */
public function delete($itemID) public function delete($itemID) {
{
$oAssociations = new RecipientGroupMemberCollection(); $oAssociations = new RecipientGroupMemberCollection();
$oAssociations->setWhere("idnewsrcp", $itemID); $oAssociations->setWhere("idnewsrcp", $itemID);
$oAssociations->query(); $oAssociations->query();
@ -152,8 +146,7 @@ class RecipientCollection extends ItemCollection
* @param $timeframe int Days after creation a not confirmed recipient will be removed * @param $timeframe int Days after creation a not confirmed recipient will be removed
* @return int Count of deleted recipients * @return int Count of deleted recipients
*/ */
public function purge($timeframe) public function purge($timeframe) {
{
global $client, $lang; global $client, $lang;
$oRecipientCollection = new RecipientCollection(); $oRecipientCollection = new RecipientCollection();
@ -172,14 +165,12 @@ class RecipientCollection extends ItemCollection
return $oRecipientCollection->count(); return $oRecipientCollection->count();
} }
/** /**
* checkEMail returns true, if there is no recipient with the same e-mail address; otherwise false * checkEMail returns true, if there is no recipient with the same e-mail address; otherwise false
* @param $email string e-mail * @param $email string e-mail
* @return recpient item if item with e-mail exists, false otherwise * @return recpient item if item with e-mail exists, false otherwise
*/ */
public function emailExists($sEmail) public function emailExists($sEmail) {
{
global $client, $lang; global $client, $lang;
$oRecipientCollection = new RecipientCollection(); $oRecipientCollection = new RecipientCollection();
@ -200,33 +191,31 @@ class RecipientCollection extends ItemCollection
* Sets a key for all recipients without key or an old key (len(key) <> 30) * Sets a key for all recipients without key or an old key (len(key) <> 30)
* @param none * @param none
*/ */
public function updateKeys() public function updateKeys() {
{
$this->setWhere("LENGTH(hash)", 30, "<>"); $this->setWhere("LENGTH(hash)", 30, "<>");
$this->query(); $this->query();
$iUpdated = $this->count(); $iUpdated = $this->count();
while ($oItem = $this->next()) { while ($oItem = $this->next()) {
$oItem->set("hash", substr(md5(rand()),0,17) . uniqid("")); /* Generating UID, 30 characters */ $oItem->set("hash", substr(md5(rand()), 0, 17) . uniqid("")); /* Generating UID, 30 characters */
$oItem->store(); $oItem->store();
} }
return $iUpdated; return $iUpdated;
} }
}
}
/** /**
* Single Recipient Item * Single Recipient Item
*/ */
class Recipient extends Item class Recipient extends Item {
{
/** /**
* Constructor Function * Constructor Function
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) public function __construct($mId = false) {
{
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["news_rcp"], "idnewsrcp"); parent::__construct($cfg["tab"]["news_rcp"], "idnewsrcp");
if ($mId !== false) { if ($mId !== false) {
@ -235,8 +224,7 @@ class Recipient extends Item
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
public function Recipient($mId = false) public function Recipient($mId = false) {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct($mId); $this->__construct($mId);
} }
@ -247,8 +235,7 @@ class Recipient extends Item
* @return boolean True if the hash matches, false otherwise * @return boolean True if the hash matches, false otherwise
* @deprecated 4.6.15 - 10.08.2006 * @deprecated 4.6.15 - 10.08.2006
*/ */
public function checkMD5Email($md5email) public function checkMD5Email($md5email) {
{
if ($md5email == md5($this->get("email"))) { if ($md5email == md5($this->get("email"))) {
return true; return true;
} else { } else {
@ -256,8 +243,7 @@ class Recipient extends Item
} }
} }
public function store() public function store() {
{
global $auth; global $auth;
$this->set("lastmodified", date("Y-m-d H:i:s"), false); $this->set("lastmodified", date("Y-m-d H:i:s"), false);
@ -284,6 +270,7 @@ class Recipient extends Item
$oLog->store(); $oLog->store();
} }
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,8 +29,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -43,14 +43,13 @@ $oNewsletters = new NewsletterCollection;
// Include plugins // Include plugins
if (is_array($cfg['plugins']['newsletters'])) { if (is_array($cfg['plugins']['newsletters'])) {
foreach ($cfg['plugins']['newsletters'] as $plugin) { foreach ($cfg['plugins']['newsletters'] as $plugin) {
plugin_include("newsletters", $plugin."/".$plugin.".php"); plugin_include("newsletters", $plugin . "/" . $plugin . ".php");
} }
} }
if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create")) if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create")) {
{
// Create new newsletter // Create new newsletter
$oNewsletter = $oNewsletters->create(i18n("-- new newsletter --")); $oNewsletter = $oNewsletters->create(i18n("-- new newsletter --", "newsletter"));
$idnewsletter = $oNewsletter->get("idnews"); $idnewsletter = $oNewsletter->get("idnews");
$oPage->setSubnav("idnewsletter=$idnewsletter", "news"); $oPage->setSubnav("idnewsletter=$idnewsletter", "news");
$oPage->setReload(); $oPage->setReload();
@ -96,7 +95,7 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
$oNewsletter = $oNewsletters->duplicate($idnewsletter); $oNewsletter = $oNewsletters->duplicate($idnewsletter);
// Update subnav with new ID // Update subnav with new ID
$oPage->setSubnav("idnewsletter=".$oNewsletter->get("idnews"), "news"); $oPage->setSubnav("idnewsletter=" . $oNewsletter->get("idnews"), "news");
$oPage->setReload(); $oPage->setReload();
} else if ($action == "news_delete" && $perm->have_perm_area_action($area, "news_delete")) { } else if ($action == "news_delete" && $perm->have_perm_area_action($area, "news_delete")) {
// Delete newsletter // Delete newsletter
@ -110,7 +109,6 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
// Delete newsletter // Delete newsletter
$oNewsletters->delete($idnewsletter); $oNewsletters->delete($idnewsletter);
$oNewsletter = new Newsletter; // Generate empty newsletter object $oNewsletter = new Newsletter; // Generate empty newsletter object
// Setting blank subnav - "blank" doesn't mean anything special, it just can't be empty // Setting blank subnav - "blank" doesn't mean anything special, it just can't be empty
// and must not contain "idnewsletter" as this is checked in the _subnav file. // and must not contain "idnewsletter" as this is checked in the _subnav file.
$oPage->setSubnav("blank", "news"); $oPage->setSubnav("blank", "news");
@ -119,12 +117,12 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
// Create job // Create job
$oJobs = new cNewsletterJobCollection; $oJobs = new cNewsletterJobCollection;
$oJob = $oJobs->create($idnewsletter, $oClientLang->getProperty("newsletter", "idcatart")); $oJob = $oJobs->create($idnewsletter, $oClientLang->getProperty("newsletter", "idcatart"));
unset ($oJobs); unset($oJobs);
if ($oJob) { if ($oJob) {
$notis = $notification->returnNotification("info", i18n("Newsletter dispatch job has been added for this newsletter")) . "<br>"; $notis = $notification->returnNotification("info", i18n("Newsletter dispatch job has been added for this newsletter", "newsletter")) . "<br>";
} else { } else {
$notis = $notification->returnNotification("error", i18n("Newsletter dispatch job has been not been added! Please check newsletter details")) . "<br>"; $notis = $notification->returnNotification("error", i18n("Newsletter dispatch job has been not been added! Please check newsletter details", "newsletter")) . "<br>";
} }
$oNewsletter = new Newsletter($idnewsletter); $oNewsletter = new Newsletter($idnewsletter);
@ -140,7 +138,7 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
// Get test destination // Get test destination
if ($perm->have_perm_area_action($area, "news_send_test")) { if ($perm->have_perm_area_action($area, "news_send_test")) {
$iTestIDNewsGroup = (int)$oUser->getProperty("newsletter", "test_idnewsgrp_lang" . $lang); $iTestIDNewsGroup = (int) $oUser->getProperty("newsletter", "test_idnewsgrp_lang" . $lang);
} else { } else {
$iTestIDNewsGroup = 0; // If user doesn't have the news_send_test right, just send to himself $iTestIDNewsGroup = 0; // If user doesn't have the news_send_test right, just send to himself
} }
@ -148,13 +146,12 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
// Get encoding // Get encoding
$oLang = new cApiLanguage($lang); $oLang = new cApiLanguage($lang);
$sEncoding = $oLang->get("encoding"); $sEncoding = $oLang->get("encoding");
unset ($oLang); unset($oLang);
// Send test newsletter // Send test newsletter
$oNewsletter = new Newsletter($idnewsletter); $oNewsletter = new Newsletter($idnewsletter);
$aRecipients = array(); $aRecipients = array();
if ($iTestIDNewsGroup == 0) if ($iTestIDNewsGroup == 0) {
{
// Send test newsletter to current user email address // Send test newsletter to current user email address
$sName = $oUser->get("realname"); $sName = $oUser->get("realname");
$sEMail = $oUser->get("email"); $sEMail = $oUser->get("email");
@ -163,7 +160,7 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
if ($bSend) { if ($bSend) {
$aRecipients[] = $sName . " (" . $sEMail . ")"; $aRecipients[] = $sName . " (" . $sEMail . ")";
} else { } else {
$aRecipients[] = i18n("None"); $aRecipients[] = i18n("None", "newsletter");
} }
} else { } else {
$bSend = $oNewsletter->sendDirect($oClientLang->getProperty("newsletter", "idcatart"), 0, $iTestIDNewsGroup, $aRecipients, $sEncoding); $bSend = $oNewsletter->sendDirect($oClientLang->getProperty("newsletter", "idcatart"), 0, $iTestIDNewsGroup, $aRecipients, $sEncoding);
@ -171,19 +168,18 @@ if ($action == "news_create" && $perm->have_perm_area_action($area, "news_create
unset($oUser); unset($oUser);
if ($bSend) { if ($bSend) {
$notis = $notification->returnNotification("info", i18n("Test newsletter has been sent to:") . "<br />" . implode("<br />", $aRecipients) . "<br />"); $notis = $notification->returnNotification("info", i18n("Test newsletter has been sent to:", "newsletter") . "<br />" . implode("<br />", $aRecipients) . "<br />");
} else { } else {
$notis = $notification->returnNotification("warning", i18n("Test newsletter has not been sent (partly or completely):") . "<br />" . $notis = $notification->returnNotification("warning", i18n("Test newsletter has not been sent (partly or completely):", "newsletter") . "<br />" .
i18n("Successful:") . "<br />" . implode("<br />", $aRecipients) . "<br />" . i18n("Successful:", "newsletter") . "<br />" . implode("<br />", $aRecipients) . "<br />" .
i18n("Error messages:") . "<br />" . $oNewsletter->_sError); i18n("Error messages:", "newsletter") . "<br />" . $oNewsletter->_sError);
} }
} else { } else {
// No action, just get selected newsletter // No action, just get selected newsletter
$oNewsletter = new Newsletter($idnewsletter); $oNewsletter = new Newsletter($idnewsletter);
} }
if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client && $oNewsletter->get("idlang") == $lang) if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client && $oNewsletter->get("idlang") == $lang) {
{
// Check and set values // Check and set values
if ($_REQUEST["optSendTo"] == "") { if ($_REQUEST["optSendTo"] == "") {
$_REQUEST["optSendTo"] = $oNewsletter->get("send_to"); $_REQUEST["optSendTo"] = $oNewsletter->get("send_to");
@ -208,8 +204,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$_REQUEST["selTemplate"] = 0; $_REQUEST["selTemplate"] = 0;
} }
if ($action == "news_save" && $perm->have_perm_area_action($area, $action)) if ($action == "news_save" && $perm->have_perm_area_action($area, $action)) {
{
// Save changes // Save changes
$aMessages = array(); $aMessages = array();
@ -221,14 +216,12 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
if ($oNewsletter->get("name") != $sName || if ($oNewsletter->get("name") != $sName ||
$oNewsletter->get("welcome") != $_REQUEST["ckbWelcome"] || $oNewsletter->get("welcome") != $_REQUEST["ckbWelcome"] ||
!isValidMail($oNewsletter->get("newsfrom")) && isValidMail($sFromEMail)) !isValidMail($oNewsletter->get("newsfrom")) && isValidMail($sFromEMail)) {
{
// Only reload, if something visible has changed // Only reload, if something visible has changed
$oPage->setReload(); $oPage->setReload();
} }
if ($oNewsletter->get("name") != $sName) if ($oNewsletter->get("name") != $sName) {
{
// Check, if item with same name exists // Check, if item with same name exists
$oNewsletters->setWhere("name", $sName); $oNewsletters->setWhere("name", $sName);
$oNewsletters->setWhere("idclient", $client); $oNewsletters->setWhere("idclient", $client);
@ -236,31 +229,27 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oNewsletters->setWhere($oNewsletter->primaryKey, $oNewsletter->get($oNewsletter->primaryKey), "!="); $oNewsletters->setWhere($oNewsletter->primaryKey, $oNewsletter->get($oNewsletter->primaryKey), "!=");
$oNewsletters->query(); $oNewsletters->query();
if ($oNewsletters->next()) if ($oNewsletters->next()) {
{ $aMessages[] = i18n("Could not set new newsletter name: name already exists", "newsletter");
$aMessages[] = i18n("Could not set new newsletter name: name already exists");
} else { } else {
$oNewsletter->set("name", $sName); $oNewsletter->set("name", $sName);
if ($oNewsletter->get("idart") > 0) if ($oNewsletter->get("idart") > 0) {
{
// Update also HTML newsletter article title, if newsletter name has been changed // Update also HTML newsletter article title, if newsletter name has been changed
$oArticles = new cApiArticleLanguageCollection; $oArticles = new cApiArticleLanguageCollection;
$oArticles->setWhere("idlang", $lang); $oArticles->setWhere("idlang", $lang);
$oArticles->setWhere("idart", $oNewsletter->get("idart")); $oArticles->setWhere("idart", $oNewsletter->get("idart"));
$oArticles->query(); $oArticles->query();
if ($oArticle = $oArticles->next()) if ($oArticle = $oArticles->next()) {
{ $oArticle->set("title", sprintf(i18n("Newsletter: %s", "newsletter"), $oNewsletter->get("name")));
$oArticle->set("title", sprintf(i18n("Newsletter: %s"), $oNewsletter->get("name")));
$oArticle->store(); $oArticle->store();
} }
unset ($oArticle); unset($oArticle);
unset ($oArticles); unset($oArticles);
} }
} }
} }
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
{
$oNewsletter->set("type", $selType); $oNewsletter->set("type", $selType);
} else { } else {
$oNewsletter->set("type", "text"); $oNewsletter->set("type", "text");
@ -273,23 +262,19 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oNewsletter->set("welcome", $_REQUEST["ckbWelcome"]); $oNewsletter->set("welcome", $_REQUEST["ckbWelcome"]);
// Check out if there are any plugins // Check out if there are any plugins
if (is_array($cfg['plugins']['newsletters'])) if (is_array($cfg['plugins']['newsletters'])) {
{ foreach ($cfg['plugins']['newsletters'] as $plugin) {
foreach ($cfg['plugins']['newsletters'] as $plugin) if (function_exists("newsletters_" . $plugin . "_wantedVariables") && function_exists("newsletters_" . $plugin . "_store")) {
{ $wantVariables = call_user_func("newsletters_" . $plugin . "_wantedVariables");
if (function_exists("newsletters_".$plugin."_wantedVariables") && function_exists("newsletters_".$plugin."_store"))
{
$wantVariables = call_user_func("newsletters_".$plugin."_wantedVariables");
if (is_array($wantVariables)) if (is_array($wantVariables)) {
{
$varArray = array(); $varArray = array();
foreach ($wantVariables as $value) { foreach ($wantVariables as $value) {
$varArray[$value] = stripslashes($GLOBALS[$value]); $varArray[$value] = stripslashes($GLOBALS[$value]);
} }
} }
$store = call_user_func("newsletters_".$plugin."_store", $varArray); $store = call_user_func("newsletters_" . $plugin . "_store", $varArray);
} }
} }
} }
@ -297,14 +282,13 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
// If "selected groups" have been selected and no group specified, set // If "selected groups" have been selected and no group specified, set
// selection to "all" // selection to "all"
if ($_REQUEST["optSendTo"] == "selection" && !is_array($_REQUEST["selGroup"])) { if ($_REQUEST["optSendTo"] == "selection" && !is_array($_REQUEST["selGroup"])) {
$aMessages[] = i18n("'Send to recipients in selected groups' has been selected, but no group has been specified. Selection has been set to 'Send to all recipients'"); $aMessages[] = i18n("'Send to recipients in selected groups' has been selected, but no group has been specified. Selection has been set to 'Send to all recipients'", "newsletter");
$_REQUEST["optSendTo"] = "all"; $_REQUEST["optSendTo"] = "all";
} }
$oNewsletter->set("send_to", $_REQUEST["optSendTo"]); $oNewsletter->set("send_to", $_REQUEST["optSendTo"]);
$oNewsletter->set("send_ids", serialize($_REQUEST["selGroup"])); $oNewsletter->set("send_ids", serialize($_REQUEST["selGroup"]));
if (getEffectiveSetting("newsletter", "option-cronjob-available", "false") == "true") if (getEffectiveSetting("newsletter", "option-cronjob-available", "false") == "true") {
{
// Only store changes, if cronjob option is available // Only store changes, if cronjob option is available
if (isset($_REQUEST["ckbCronJob"])) { if (isset($_REQUEST["ckbCronJob"])) {
$oNewsletter->set("use_cronjob", 1); $oNewsletter->set("use_cronjob", 1);
@ -323,10 +307,8 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oNewsletter->set("dispatch_delay", $_REQUEST["txtDispatchDelay"]); $oNewsletter->set("dispatch_delay", $_REQUEST["txtDispatchDelay"]);
$oNewsletter->store(); // Note, that the properties are stored, anyway $oNewsletter->store(); // Note, that the properties are stored, anyway
// Storing from (e-mail), from (name) and options as default // Storing from (e-mail), from (name) and options as default
if ($_REQUEST["ckbSetDefault"]) if ($_REQUEST["ckbSetDefault"]) {
{
$oClientLang->setProperty("newsletter", "newsfrom", $sFromEMail); $oClientLang->setProperty("newsletter", "newsfrom", $sFromEMail);
$oClientLang->setProperty("newsletter", "newsfromname", $sFromName); $oClientLang->setProperty("newsletter", "newsfromname", $sFromName);
$oClientLang->setProperty("newsletter", "sendto", $_REQUEST["optSendTo"]); $oClientLang->setProperty("newsletter", "sendto", $_REQUEST["optSendTo"]);
@ -349,9 +331,8 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$notis .= $notification->returnNotification("warning", implode("<br>", $aMessages)) . "<br>"; $notis .= $notification->returnNotification("warning", implode("<br>", $aMessages)) . "<br>";
} }
} else { } else {
$_REQUEST["selGroup"] = unserialize ($oNewsletter->get("send_ids")); $_REQUEST["selGroup"] = unserialize($oNewsletter->get("send_ids"));
if (!is_array($_REQUEST["selGroup"])) if (!is_array($_REQUEST["selGroup"])) {
{
$_REQUEST["selGroup"] = unserialize($oClientLang->getProperty("newsletter", "sendgroups")); $_REQUEST["selGroup"] = unserialize($oClientLang->getProperty("newsletter", "sendgroups"));
if (!is_array($_REQUEST["selGroup"])) { if (!is_array($_REQUEST["selGroup"])) {
$_REQUEST["selGroup"] = array(); $_REQUEST["selGroup"] = array();
@ -372,16 +353,16 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oForm->setVar("action", "news_save"); $oForm->setVar("action", "news_save");
$oForm->setVar("idnewsletter", $oNewsletter->get("idnews")); $oForm->setVar("idnewsletter", $oNewsletter->get("idnews"));
$oForm->addHeader(i18n("Edit newsletter")); $oForm->addHeader(i18n("Edit newsletter", "newsletter"));
$oTxtName = new cHTMLTextbox("txtName", $oNewsletter->get("name"),40); $oTxtName = new cHTMLTextbox("txtName", $oNewsletter->get("name"), 40);
$oForm->add(i18n("Name"), $oTxtName->render()); $oForm->add(i18n("Name", "newsletter"), $oTxtName->render());
$oSelType = new cHTMLSelectElement("selType"); $oSelType = new cHTMLSelectElement("selType");
$aItems = array(); $aItems = array();
$aItems[] = array("text", i18n("Text only")); $aItems[] = array("text", i18n("Text only", "newsletter"));
if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") { if ($oClientLang->getProperty("newsletter", "html_newsletter") == "true") {
$aItems[] = array("html", i18n("HTML and text")); $aItems[] = array("html", i18n("HTML and text", "newsletter"));
} else { } else {
$oNewsletter->set("type", "text"); // just in case the global setting was switched off $oNewsletter->set("type", "text"); // just in case the global setting was switched off
// TODO: Should this setting be stored? // TODO: Should this setting be stored?
@ -389,15 +370,15 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oSelType->autoFill($aItems); $oSelType->autoFill($aItems);
$oSelType->setDefault($oNewsletter->get("type")); $oSelType->setDefault($oNewsletter->get("type"));
$oForm->add(i18n("Type"), $oSelType->render()); $oForm->add(i18n("Type", "newsletter"), $oSelType->render());
$oTxtFromEMail = new cHTMLTextbox("txtFromEMail", $oNewsletter->get("newsfrom"), 40); $oTxtFromEMail = new cHTMLTextbox("txtFromEMail", $oNewsletter->get("newsfrom"), 40);
$oTxtFromName = new cHTMLTextbox("txtFromName", $oNewsletter->get("newsfromname"), 40); $oTxtFromName = new cHTMLTextbox("txtFromName", $oNewsletter->get("newsfromname"), 40);
$oTxtSubject = new cHTMLTextarea("txtSubject", $oNewsletter->get("subject"), 80, 2); $oTxtSubject = new cHTMLTextarea("txtSubject", $oNewsletter->get("subject"), 80, 2);
$oForm->add(i18n("From (E-Mail)"), $oTxtFromEMail->render()); $oForm->add(i18n("From (E-Mail)", "newsletter"), $oTxtFromEMail->render());
$oForm->add(i18n("From (Name)"), $oTxtFromName->render()."&nbsp;".i18n("optional")); $oForm->add(i18n("From (Name)", "newsletter"), $oTxtFromName->render() . "&nbsp;" . i18n("optional", "newsletter"));
$oForm->add(i18n("Subject"), $oTxtSubject->render()); $oForm->add(i18n("Subject", "newsletter"), $oTxtSubject->render());
// Send options // Send options
$oSendToAll = new cHTMLRadiobutton("optSendTo", "all"); $oSendToAll = new cHTMLRadiobutton("optSendTo", "all");
@ -413,8 +394,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oRcpGroups->query(); $oRcpGroups->query();
$aItems = array(); $aItems = array();
while ($oRcpGroup = $oRcpGroups->next()) while ($oRcpGroup = $oRcpGroups->next()) {
{
$sGroupName = $oRcpGroup->get("groupname"); $sGroupName = $oRcpGroup->get("groupname");
if ($oRcpGroup->get("defaultgroup")) { if ($oRcpGroup->get("defaultgroup")) {
$sGroupName = $sGroupName . "*"; $sGroupName = $sGroupName . "*";
@ -422,23 +402,21 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$aItems[] = array($oRcpGroup->get("idnewsgroup"), $sGroupName); $aItems[] = array($oRcpGroup->get("idnewsgroup"), $sGroupName);
} }
$oSelGroup = new cHTMLSelectElement("selGroup[]","","groupselect"); $oSelGroup = new cHTMLSelectElement("selGroup[]", "", "groupselect");
$oSelGroup->setSize(10); $oSelGroup->setSize(10);
$oSelGroup->setStyle("width: 350px; margin-top: 5px; margin-bottom: 5px; margin-left: 25px;"); $oSelGroup->setStyle("width: 350px; margin-top: 5px; margin-bottom: 5px; margin-left: 25px;");
$oSelGroup->setMultiSelect(); $oSelGroup->setMultiSelect();
$oSelGroup->setAlt(i18n("Note: Hold <Ctrl> to select multiple items.")); $oSelGroup->setAlt(i18n("Note: Hold <Ctrl> to select multiple items.", "newsletter"));
$oSelGroup->autoFill($aItems); $oSelGroup->autoFill($aItems);
// No groups in the list, sendToGroups and group listbox disabled // No groups in the list, sendToGroups and group listbox disabled
if (count($aItems) == 0) if (count($aItems) == 0) {
{
$oSendToGroups->setDisabled(true); $oSendToGroups->setDisabled(true);
if ($_REQUEST["optSendTo"] == "selection") { if ($_REQUEST["optSendTo"] == "selection") {
$_REQUEST["optSendTo"] == "all"; $_REQUEST["optSendTo"] == "all";
} }
} else if (is_array($_REQUEST["selGroup"])) { } else if (is_array($_REQUEST["selGroup"])) {
foreach ($_REQUEST["selGroup"] as $sValue) foreach ($_REQUEST["selGroup"] as $sValue) {
{
if (array_key_exists($sValue, $oSelGroup->_options)) { if (array_key_exists($sValue, $oSelGroup->_options)) {
// only select, if item still exists // only select, if item still exists
$oSelGroup->_options[$sValue]->setSelected(true); $oSelGroup->_options[$sValue]->setSelected(true);
@ -446,8 +424,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
} }
} }
switch ($_REQUEST["optSendTo"]) switch ($_REQUEST["optSendTo"]) {
{
case "default": case "default":
$oSendToDefault->setChecked(true); $oSendToDefault->setChecked(true);
$oSelGroup->setDisabled(true); $oSelGroup->setDisabled(true);
@ -461,10 +438,9 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
} }
// Recipients // Recipients
$oForm->add(i18n("Recipients"), $oForm->add(i18n("Recipients", "newsletter"), $oSendToAll->toHTML(false) . "&nbsp;" . i18n("Send newsletter to all recipients", "newsletter") . "<br />" . chr(10) .
$oSendToAll->toHTML(false)."&nbsp;".i18n("Send newsletter to all recipients")."<br />".chr(10). $oSendToDefault->toHTML(false) . "&nbsp;" . i18n("Send newsletter to the members of the default group", "newsletter") . "<br />" . chr(10) .
$oSendToDefault->toHTML(false)."&nbsp;".i18n("Send newsletter to the members of the default group")."<br />".chr(10). $oSendToGroups->toHTML(false) . "&nbsp;" . i18n("Send newsletter to the members of the selected group(s):", "newsletter") . "<br />" . chr(10) .
$oSendToGroups->toHTML(false)."&nbsp;".i18n("Send newsletter to the members of the selected group(s):")."<br />".chr(10).
$oSelGroup->render()); $oSelGroup->render());
/* TODO: Work in progress /* TODO: Work in progress
@ -536,26 +512,25 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$ckbCronJob->setDisabled(""); $ckbCronJob->setDisabled("");
} else { } else {
// Give the user a hint // Give the user a hint
$ckbCronJob->setAlt(i18n("Option has to be enabled as client setting - see techref for details")); $ckbCronJob->setAlt(i18n("Option has to be enabled as client setting - see techref for details", "newsletter"));
} }
$oCkbDispatch = new cHTMLCheckbox("ckbDispatch", "enabled"); $oCkbDispatch = new cHTMLCheckbox("ckbDispatch", "enabled");
$oCkbDispatch->setChecked($oNewsletter->get("dispatch")); $oCkbDispatch->setChecked($oNewsletter->get("dispatch"));
$oTxtDispatchCount = new cHTMLTextbox("txtDispatchCount", $oNewsletter->get("dispatch_count"), 4); $oTxtDispatchCount = new cHTMLTextbox("txtDispatchCount", $oNewsletter->get("dispatch_count"), 4);
$oTxtDispatchDelay = new cHTMLTextbox("txtDispatchDelay", $oNewsletter->get("dispatch_delay"), 4); $oTxtDispatchDelay = new cHTMLTextbox("txtDispatchDelay", $oNewsletter->get("dispatch_delay"), 4);
$oTxtDispatchDelay->setAlt(i18n("Note: Set to 0 to send chunks manually.")); $oTxtDispatchDelay->setAlt(i18n("Note: Set to 0 to send chunks manually.", "newsletter"));
$oCkbSaveAsDefault = new cHTMLCheckbox("ckbSetDefault", "1"); $oCkbSaveAsDefault = new cHTMLCheckbox("ckbSetDefault", "1");
$oForm->add(i18n("Options"), $oForm->add(i18n("Options", "newsletter"), $ckbWelcome->toHTML(false) . "&nbsp;" . i18n("Welcome-Newsletter", "newsletter") . "<br />" .
$ckbWelcome->toHTML(false)."&nbsp;".i18n("Welcome-Newsletter")."<br />". $ckbCronJob->toHTML(false) . "&nbsp;" . i18n("Use cronjob", "newsletter") . "<br />" .
$ckbCronJob->toHTML(false)."&nbsp;".i18n("Use cronjob")."<br />". $oCkbDispatch->toHTML(false) . "&nbsp;" . i18n("Send in blocks:", "newsletter") . "&nbsp;&nbsp;&nbsp;" .
$oCkbDispatch->toHTML(false)."&nbsp;".i18n("Send in blocks:")."&nbsp;&nbsp;&nbsp;". i18n("Recipients per block:", "newsletter") . "&nbsp;" . $oTxtDispatchCount->render() . "&nbsp;" .
i18n("Recipients per block:")."&nbsp;".$oTxtDispatchCount->render()."&nbsp;". i18n("Delay between blocks:", "newsletter") . "&nbsp;" . $oTxtDispatchDelay->render() . "&nbsp;" . i18n("sec.", "newsletter") . "<br />" .
i18n("Delay between blocks:")."&nbsp;".$oTxtDispatchDelay->render()."&nbsp;".i18n("sec.")."<br />". $oCkbSaveAsDefault->toHTML(false) . "&nbsp;" . i18n("Save option settings as default", "newsletter"));
$oCkbSaveAsDefault->toHTML(false)."&nbsp;".i18n("Save option settings as default"));
$oForm->add(i18n("Author"), $classuser->getUserName($oNewsletter->get("author")) . " (". $oNewsletter->get("created").")" ); $oForm->add(i18n("Author", "newsletter"), $classuser->getUserName($oNewsletter->get("author")) . " (" . $oNewsletter->get("created") . ")");
$oForm->add(i18n("Last modified by"), $classuser->getUserName($oNewsletter->get("modifiedby")). " (". $oNewsletter->get("modified").")" ); $oForm->add(i18n("Last modified by", "newsletter"), $classuser->getUserName($oNewsletter->get("modifiedby")) . " (" . $oNewsletter->get("modified") . ")");
$sExecScript = ' $sExecScript = '
<script type="text/javascript"> <script type="text/javascript">
@ -578,5 +553,4 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
} }
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,13 +28,11 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
cInclude("includes", "functions.con.php"); // For conDeleteArt and conCopyArt cInclude("includes", "functions.con.php"); // For conDeleteArt and conCopyArt
// Initialization // Initialization
$oPage = new cPage; $oPage = new cPage;
$oClientLang = new cApiClientLanguage(false, $client, $lang); $oClientLang = new cApiClientLanguage(false, $client, $lang);
@ -41,7 +40,7 @@ $oClientLang = new cApiClientLanguage(false, $client, $lang);
// Include plugins // Include plugins
if (is_array($cfg['plugins']['newsletters'])) { if (is_array($cfg['plugins']['newsletters'])) {
foreach ($cfg['plugins']['newsletters'] as $plugin) { foreach ($cfg['plugins']['newsletters'] as $plugin) {
plugin_include("newsletters", $plugin."/".$plugin.".php"); plugin_include("newsletters", $plugin . "/" . $plugin . ".php");
} }
} }
@ -59,28 +58,22 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
// text message he may still have the right to change the html article. To prevent // text message he may still have the right to change the html article. To prevent
// changing the html article, give the user only read access right for the newsletter // changing the html article, give the user only read access right for the newsletter
// article category - the article will be shown also, if he doesn't have any rights at all... // article category - the article will be shown also, if he doesn't have any rights at all...
if ($action == "news_save" && $perm->have_perm_area_action("news", $action)) // Don't use $area! if ($action == "news_save" && $perm->have_perm_area_action("news", $action)) { // Don't use $area!
{
// Changing e.g. \' back to ' (magic_quotes) // Changing e.g. \' back to ' (magic_quotes)
$sMessage = Contenido_Security::unescapeDB($_REQUEST["txtMessage"]); $sMessage = Contenido_Security::unescapeDB($_REQUEST["txtMessage"]);
$oNewsletter->set("message", $sMessage); $oNewsletter->set("message", $sMessage);
if ($oNewsletter->get("template_idart") != $_REQUEST["selTemplate"]) if ($oNewsletter->get("template_idart") != $_REQUEST["selTemplate"]) {
{ if ($oNewsletter->get("idart") > 0) {
if ($oNewsletter->get("idart") > 0)
{
// Template has been changed: Delete old article // Template has been changed: Delete old article
// (this discards the current html content as it deletes the existing newsletter article) // (this discards the current html content as it deletes the existing newsletter article)
conDeleteArt($oNewsletter->get("idart")); conDeleteArt($oNewsletter->get("idart"));
$iIDArt = 0; $iIDArt = 0;
} }
if ($_REQUEST["selTemplate"] > 0) if ($_REQUEST["selTemplate"] > 0) {
{
// Template has been changed, but specified: Store template article as new newsletter article // Template has been changed, but specified: Store template article as new newsletter article
$iIDArt = conCopyArticle($_REQUEST["selTemplate"], $iIDArt = conCopyArticle($_REQUEST["selTemplate"], $oClientLang->getProperty("newsletter", "html_newsletter_idcat"), sprintf(i18n("Newsletter: %s", "newsletter"), $oNewsletter->get("name")));
$oClientLang->getProperty("newsletter", "html_newsletter_idcat"),
sprintf(i18n("Newsletter: %s"), $oNewsletter->get("name")));
conMakeOnline($iIDArt, $lang); // Article has to be online for sending... conMakeOnline($iIDArt, $lang); // Article has to be online for sending...
} }
@ -96,10 +89,9 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oArticles->setWhere("idart", $oNewsletter->get("idart")); $oArticles->setWhere("idart", $oNewsletter->get("idart"));
$oArticles->query(); $oArticles->query();
if ($oArticles->count() == 0) if ($oArticles->count() == 0) {
{
// Ups, article lost, reset idart and template_idart for newsletter // Ups, article lost, reset idart and template_idart for newsletter
$notis = $notification->returnNotification("error", sprintf(i18n("The html newsletter article has been deleted (idart: %s), the html message is lost"), $oNewsletter->get("idart"))) . "<br>"; $notis = $notification->returnNotification("error", sprintf(i18n("The html newsletter article has been deleted (idart: %s), the html message is lost", "newsletter"), $oNewsletter->get("idart"))) . "<br>";
$oNewsletter->set("idart", 0); $oNewsletter->set("idart", 0);
$oNewsletter->set("template_idart", 0); $oNewsletter->set("template_idart", 0);
@ -110,14 +102,11 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oArticles->setWhere("idart", $oNewsletter->get("template_idart")); $oArticles->setWhere("idart", $oNewsletter->get("template_idart"));
$oArticles->query(); $oArticles->query();
if ($oArticles->count() == 0) if ($oArticles->count() == 0) {
{
// Ups, template has been deleted: Restore from current newsletter message article // Ups, template has been deleted: Restore from current newsletter message article
$notis = $notification->returnNotification("warning", i18n("The html newsletter template article has been deleted, it has been restored using the html message article of this newsletter")) . "<br>"; $notis = $notification->returnNotification("warning", i18n("The html newsletter template article has been deleted, it has been restored using the html message article of this newsletter", "newsletter")) . "<br>";
$iIDArt = conCopyArticle($oNewsletter->get("idart"), $iIDArt = conCopyArticle($oNewsletter->get("idart"), $oClientLang->getProperty("newsletter", "html_template_idcat"), sprintf(i18n("%s (Template restored)", "newsletter"), $oNewsletter->get("name")));
$oClientLang->getProperty("newsletter", "html_template_idcat"),
sprintf(i18n("%s (Template restored)"), $oNewsletter->get("name")));
$oNewsletter->set("template_idart", $iIDArt); $oNewsletter->set("template_idart", $iIDArt);
$oNewsletter->store(); $oNewsletter->store();
} }
@ -131,51 +120,46 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$oForm->setVar("idnewsletter", $idnewsletter); $oForm->setVar("idnewsletter", $idnewsletter);
$oForm->setWidth("100%"); $oForm->setWidth("100%");
$oForm->addHeader(sprintf(i18n("Edit newsletter message (%s)"), $oNewsletter->get("name"))); $oForm->addHeader(sprintf(i18n("Edit newsletter message (%s)", "newsletter"), $oNewsletter->get("name")));
$oForm->add(i18n("Subject"), $oNewsletter->get("subject")); $oForm->add(i18n("Subject"), $oNewsletter->get("subject"));
$sTagInfoText = '<a href="javascript:fncShowHide(\'idTagInfoText\');"><strong>'.i18n("Tag information").'</strong></a>'. $sTagInfoText = '<a href="javascript:fncShowHide(\'idTagInfoText\');"><strong>' . i18n("Tag information", "newsletter") . '</strong></a>' .
'<div id="idTagInfoText" style="display: none"><br /><b>'. i18n("Special message tags (will be replaced when sending)").':</b><br>'. '<div id="idTagInfoText" style="display: none"><br /><b>' . i18n("Special message tags (will be replaced when sending)", "newsletter") . ':</b><br>' .
'MAIL_NAME: '.i18n("Name of the recipient").'<br />'. 'MAIL_NAME: ' . i18n("Name of the recipient", "newsletter") . '<br />' .
'MAIL_DATE: '.i18n("Date, when the mail has been sent").'<br />'. 'MAIL_DATE: ' . i18n("Date, when the mail has been sent", "newsletter") . '<br />' .
'MAIL_TIME: '.i18n("Time, when the mail has been sent").'<br />'. 'MAIL_TIME: ' . i18n("Time, when the mail has been sent", "newsletter") . '<br />' .
'MAIL_NUMBER: '.i18n("Number of recipients").'<br />'. 'MAIL_NUMBER: ' . i18n("Number of recipients", "newsletter") . '<br />' .
#'MAIL_CHANGE: '.i18n("Link to change the e-mail adress").'<br />'. #'MAIL_CHANGE: '.i18n("Link to change the e-mail adress", "newsletter").'<br />'.
'MAIL_UNSUBSCRIBE: '.i18n("Link to unsubscribe").'<br />'. 'MAIL_UNSUBSCRIBE: ' . i18n("Link to unsubscribe", "newsletter") . '<br />' .
'MAIL_STOP: '.i18n("Link to pause the subscription").'<br />'. 'MAIL_STOP: ' . i18n("Link to pause the subscription", "newsletter") . '<br />' .
'MAIL_GOON: '.i18n("Link to resume the subscription"); 'MAIL_GOON: ' . i18n("Link to resume the subscription", "newsletter");
$sTagInfoHTML = '<a href="javascript:fncShowHide(\'idTagInfoHTML\');"><strong>'.i18n("Tag information").'</strong></a>'. $sTagInfoHTML = '<a href="javascript:fncShowHide(\'idTagInfoHTML\');"><strong>' . i18n("Tag information", "newsletter") . '</strong></a>' .
'<div id="idTagInfoHTML" style="display: none"><br /><b>'.i18n("Special message tags (will be replaced when sending, {..} = optional)").":</b><br />". '<div id="idTagInfoHTML" style="display: none"><br /><b>' . i18n("Special message tags (will be replaced when sending, {..} = optional)", "newsletter") . ":</b><br />" .
'[mail name="name" type="text"]{text}MAIL_NAME{text}[/mail]: '.i18n("Name of the recipient")."<br />". '[mail name="name" type="text"]{text}MAIL_NAME{text}[/mail]: ' . i18n("Name of the recipient", "newsletter") . "<br />" .
'[mail name="date" type="text"]{text}MAIL_DATE{text}[/mail]: '.i18n("Date, when the mail has been sent")."<br />". '[mail name="date" type="text"]{text}MAIL_DATE{text}[/mail]: ' . i18n("Date, when the mail has been sent", "newsletter") . "<br />" .
'[mail name="time" type="text"]{text}MAIL_TIME{text}[/mail]: '.i18n("Time, when the mail has been sent")."<br />". '[mail name="time" type="text"]{text}MAIL_TIME{text}[/mail]: ' . i18n("Time, when the mail has been sent", "newsletter") . "<br />" .
'[mail name="number" type="text"]{text}MAIL_NUMBER{text}[/mail]: '.i18n("Number of recipients")."<br />". '[mail name="number" type="text"]{text}MAIL_NUMBER{text}[/mail]: ' . i18n("Number of recipients", "newsletter") . "<br />" .
#'[mail name="change" type="link" {text="'.i18n("Link text").'"}]{text}MAIL_CHANGE{text}[/mail]: '.i18n("Link to change the e-mail adress")."<br />". #'[mail name="change" type="link" {text="'.i18n("Link text", "newsletter").'"}]{text}MAIL_CHANGE{text}[/mail]: '.i18n("Link to change the e-mail adress", "newsletter")."<br />".
'[mail name="unsubscribe" type="link" {text="'.i18n("Link text").'" }]{text}MAIL_UNSUBSCRIBE{text}[/mail]: '.i18n("Link to unsubscribe")."<br />". '[mail name="unsubscribe" type="link" {text="' . i18n("Link text", "newsletter") . '" }]{text}MAIL_UNSUBSCRIBE{text}[/mail]: ' . i18n("Link to unsubscribe", "newsletter") . "<br />" .
'[mail name="stop" type="link" {text="'.i18n("Link text").'" }]{text}MAIL_STOP{text}[/mail]: '.i18n("Link to pause the subscription")."<br />". '[mail name="stop" type="link" {text="' . i18n("Link text", "newsletter") . '" }]{text}MAIL_STOP{text}[/mail]: ' . i18n("Link to pause the subscription", "newsletter") . "<br />" .
'[mail name="goon" type="link" {text="'.i18n("Link text").'" }]{text}MAIL_GOON{text}[/mail]: '.i18n("Link to resume the subscription"); '[mail name="goon" type="link" {text="' . i18n("Link text", "newsletter") . '" }]{text}MAIL_GOON{text}[/mail]: ' . i18n("Link to resume the subscription", "newsletter");
// Mention plugin interface // Mention plugin interface
if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true") if (getSystemProperty("newsletter", "newsletter-recipients-plugin") == "true") {
{ $sTagInfoText .= "<br /><br /><strong>" . i18n("Additional message tags from recipients plugins:", "newsletter") . "</strong><br />";
$sTagInfoText .= "<br /><br /><strong>".i18n("Additional message tags from recipients plugins:")."</strong><br />"; $sTagInfoHTML .= "<br /><br /><strong>" . i18n("Additional message tags from recipients plugins:", "newsletter") . "</strong><br />";
$sTagInfoHTML .= "<br /><br /><strong>".i18n("Additional message tags from recipients plugins:")."</strong><br />";
if (is_array($cfg['plugins']['recipients'])) if (is_array($cfg['plugins']['recipients'])) {
{ foreach ($cfg['plugins']['recipients'] as $plugin) {
foreach ($cfg['plugins']['recipients'] as $plugin) plugin_include("recipients", $plugin . "/" . $plugin . ".php");
{
plugin_include("recipients", $plugin."/".$plugin.".php");
if (function_exists("recipients_".$plugin."_wantedVariables")) if (function_exists("recipients_" . $plugin . "_wantedVariables")) {
{ $aPluginVars = call_user_func("recipients_" . $plugin . "_wantedVariables");
$aPluginVars = call_user_func("recipients_".$plugin."_wantedVariables");
foreach ($aPluginVars as $sPluginVar) foreach ($aPluginVars as $sPluginVar) {
{ $sTagInfoText .= 'MAIL_' . strtoupper($sPluginVar) . '<br />';
$sTagInfoText .= 'MAIL_'.strtoupper($sPluginVar).'<br />'; $sTagInfoHTML .= '[mail name="' . strtolower($sPluginVar) . '" type="text"][/mail]<br />';
$sTagInfoHTML .= '[mail name="'.strtolower($sPluginVar).'" type="text"][/mail]<br />';
} }
} }
} }
@ -187,46 +171,43 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
$sTagInfoHTML .= "</div>"; $sTagInfoHTML .= "</div>";
$iTplIDArt = 0; // Used later for on change event $iTplIDArt = 0; // Used later for on change event
if ($oNewsletter->get("type") == "html") if ($oNewsletter->get("type") == "html") {
{
$iTplIDArt = $oNewsletter->get("template_idart"); $iTplIDArt = $oNewsletter->get("template_idart");
$oSelTemplate = new cHTMLSelectElement("selTemplate"); $oSelTemplate = new cHTMLSelectElement("selTemplate");
$oSelTemplate->setEvent("change", "askSubmitOnTplChange(this);"); $oSelTemplate->setEvent("change", "askSubmitOnTplChange(this);");
$aOptions = array( "idcat" => $oClientLang->getProperty("newsletter", "html_template_idcat"), $aOptions = array("idcat" => $oClientLang->getProperty("newsletter", "html_template_idcat"),
"start" => true, "start" => true,
"offline" => true, "offline" => true,
"order" => "title"); "order" => "title");
$oTemplateArticles = new ArticleCollection($aOptions); $oTemplateArticles = new ArticleCollection($aOptions);
$aItems = array(); $aItems = array();
$aItems[] = array(0, i18n("-- none --")); $aItems[] = array(0, i18n("-- none --", "newsletter"));
while ($oArticle = $oTemplateArticles->nextArticle()) while ($oArticle = $oTemplateArticles->nextArticle()) {
{
$aItems[] = array($oArticle->get("idart"), $oArticle->get("title")); $aItems[] = array($oArticle->get("idart"), $oArticle->get("title"));
} }
$oSelTemplate->autoFill($aItems); $oSelTemplate->autoFill($aItems);
$oSelTemplate->setDefault($iTplIDArt); $oSelTemplate->setDefault($iTplIDArt);
unset ($aItems); unset($aItems);
unset ($oArticles); unset($oArticles);
unset ($oTemplateArticles); unset($oTemplateArticles);
$oForm->add(i18n("HTML Template"), $oSelTemplate->render()."&nbsp;".i18n("Note, that changing the template discards the current html message content")); $oForm->add(i18n("HTML Template", "newsletter"), $oSelTemplate->render() . "&nbsp;" . i18n("Note, that changing the template discards the current html message content", "newsletter"));
if ($iTplIDArt != 0) if ($iTplIDArt != 0) {
{ $sFrameSrc = $cfgClient[$client]["path"]["htmlpath"] . "front_content.php?changeview=edit&action=con_editart&idart=" . $oNewsletter->get("idart") . "&idcat=" . $oClientLang->getProperty("newsletter", "html_newsletter_idcat") . "&lang=" . $lang . "&contenido=" . $sess->id;
$sFrameSrc = $cfgClient[$client]["path"]["htmlpath"]."front_content.php?changeview=edit&action=con_editart&idart=".$oNewsletter->get("idart")."&idcat=".$oClientLang->getProperty("newsletter", "html_newsletter_idcat")."&lang=".$lang."&contenido=".$sess->id; $oForm->add(i18n("HTML Message", "newsletter"), '<iframe width="100%" height="600" src="' . $sFrameSrc . '"></iframe><br />' . $sTagInfoHTML);
$oForm->add(i18n("HTML Message"), '<iframe width="100%" height="600" src="'.$sFrameSrc.'"></iframe><br />'.$sTagInfoHTML);
} else { } else {
// Add a real note, that a template has to be specified // Add a real note, that a template has to be specified
$notis .= $notification->returnNotification("warning", i18n("Newsletter type has been set to HTML/text, please remember to select an html template")) . "<br />"; $notis .= $notification->returnNotification("warning", i18n("Newsletter type has been set to HTML/text, please remember to select an html template", "newsletter")) . "<br />";
$oForm->add(i18n("HTML Message"), i18n("Please choose a template first")); $oForm->add(i18n("HTML Message", "newsletter"), i18n("Please choose a template first", "newsletter"));
} }
} }
$oTxtMessage = new cHTMLTextarea("txtMessage", $oNewsletter->get("message"), 80, 20); $oTxtMessage = new cHTMLTextarea("txtMessage", $oNewsletter->get("message"), 80, 20);
$oForm->add(i18n("Text Message"), $oTxtMessage->render()."<br />".$sTagInfoText); $oForm->add(i18n("Text Message", "newsletter"), $oTxtMessage->render() . "<br />" . $sTagInfoText);
$sExecScript = ' $sExecScript = '
<script type="text/javascript"> <script type="text/javascript">
@ -248,7 +229,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
// if he/she may like to save this change (e.g. to get an html // if he/she may like to save this change (e.g. to get an html
// newsletter immediately) // newsletter immediately)
function askSubmitOnTplChange(oSelectObject) { function askSubmitOnTplChange(oSelectObject) {
iOriginalTplIDArt = '.$iTplIDArt.'; iOriginalTplIDArt = ' . $iTplIDArt . ';
if (iOriginalTplIDArt != oSelectObject.options[oSelectObject.selectedIndex].value) { if (iOriginalTplIDArt != oSelectObject.options[oSelectObject.selectedIndex].value) {
if (iOriginalTplIDArt == 0) { if (iOriginalTplIDArt == 0) {
@ -256,7 +237,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
submitForm(); submitForm();
} else { } else {
// You may loose information, warn! // You may loose information, warn!
box.confirm("'.i18n("HTML newsletter template changed").'", "'.i18n("HTML template has been changed. Do you like to save now to apply changes?<br /><br /><b>Note, that existing HTML newsletter content will get lost!</b>").'", "submitForm()"); box.confirm("' . i18n("HTML newsletter template changed", "newsletter") . '", "' . i18n("HTML template has been changed. Do you like to save now to apply changes?<br /><br /><b>Note, that existing HTML newsletter content will get lost!</b>", "newsletter") . '", "submitForm()");
} }
} }
} }
@ -265,7 +246,7 @@ if ($oNewsletter->virgin == false && $oNewsletter->get("idclient") == $client &&
document.frmNewsletterMsg.submit(); document.frmNewsletterMsg.submit();
} }
</script>'; </script>';
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>'); $oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>');
$oPage->addScript('execscript', $sExecScript); $oPage->addScript('execscript', $sExecScript);
$oPage->setContent($notis . $oForm->render(true)); $oPage->setContent($notis . $oForm->render(true));
} else { } else {

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -43,7 +43,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
if ($oJob->get("dispatch") == 1 && $oJob->get("sendcount") < $oJob->get("rcpcount")) { if ($oJob->get("dispatch") == 1 && $oJob->get("sendcount") < $oJob->get("rcpcount")) {
// Send in chunks // Send in chunks
$sPathNext = $sess->url("main.php?area=$area&action=news_job_run&frame=4&idnewsjob=".$_REQUEST["idnewsjob"]); $sPathNext = $sess->url("main.php?area=$area&action=news_job_run&frame=4&idnewsjob=" . $_REQUEST["idnewsjob"]);
// Calculating some statistics // Calculating some statistics
$iChunk = ceil($oJob->get("sendcount") / $oJob->get("dispatch_count")); $iChunk = ceil($oJob->get("sendcount") / $oJob->get("dispatch_count"));
@ -60,34 +60,32 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
if ($oJob->get("dispatch_delay") == 0) { if ($oJob->get("dispatch_delay") == 0) {
// Send manually // Send manually
$oForm = new UI_Table_Form("properties", $sPathNext); $oForm = new UI_Table_Form("properties", $sPathNext);
$oForm->addHeader(i18n("Report:")); $oForm->addHeader(i18n("Report:", "newsletter"));
$oForm->add("", ""); $oForm->add("", "");
$oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)"), $oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)", "newsletter"), $iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml']."images/but_cancel.gif", i18n("Stop sending"), "c"); $oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml'] . "images/but_cancel.gif", i18n("Stop sending", "newsletter"), "c");
$oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml']."images/but_ok.gif", i18n("Send next chunk"), "s", "news_job_run"); $oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml'] . "images/but_ok.gif", i18n("Send next chunk", "newsletter"), "s", "news_job_run");
} else { } else {
// Send automatically // Send automatically
$oForm = new UI_Table_Form("properties"); $oForm = new UI_Table_Form("properties");
$oForm->addHeader(i18n("Report:")); $oForm->addHeader(i18n("Report:", "newsletter"));
$oForm->add("", ""); $oForm->add("", "");
$oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)"), $oForm->add("", sprintf(i18n("Sending newsletter ... (chunk %s of %s, recipients: %s, sent: %s)", "newsletter"), $iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$iChunk, $iChunks, $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oPage->addScript("Refresh", '<meta http-equiv="refresh" content="'.$oJob->get("dispatch_delay").'; URL='.$sPathNext.'">'); $oPage->addScript("Refresh", '<meta http-equiv="refresh" content="' . $oJob->get("dispatch_delay") . '; URL=' . $sPathNext . '">');
$oForm->unsetActionButton("submit"); $oForm->unsetActionButton("submit");
$oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml']."images/but_cancel.gif", i18n("Stop sending"), "c"); $oForm->setActionButton("cancel", $cfg['path']['contenido_fullhtml'] . "images/but_cancel.gif", i18n("Stop sending", "newsletter"), "c");
} }
} else { } else {
// All newsletters should have been sent // All newsletters should have been sent
$oForm = new UI_Table_Form("properties"); $oForm = new UI_Table_Form("properties");
$oForm->addHeader(i18n("Report:")); $oForm->addHeader(i18n("Report:", "newsletter"));
$oForm->add("", ""); $oForm->add("", "");
$oForm->add("", sprintf(i18n("The newsletter has been sent to %s recipients"), $oJob->get("sendcount"))); $oForm->add("", sprintf(i18n("The newsletter has been sent to %s recipients", "newsletter"), $oJob->get("sendcount")));
$oPage->setReload(); $oPage->setReload();
} }
@ -105,8 +103,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oLogs = new cNewsletterLogCollection; $oLogs = new cNewsletterLogCollection;
// Remove recipient from a job // Remove recipient from a job
if ($action == "news_job_detail_delete" && is_numeric($_REQUEST["idnewslog"]) && $perm->have_perm_area_action($area, "news_job_detail_delete")) if ($action == "news_job_detail_delete" && is_numeric($_REQUEST["idnewslog"]) && $perm->have_perm_area_action($area, "news_job_detail_delete")) {
{
$oLogs->delete($_REQUEST["idnewslog"]); $oLogs->delete($_REQUEST["idnewslog"]);
} }
@ -125,14 +122,14 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
// Set default values // Set default values
$oUser = new cApiUser($auth->auth["uid"]); $oUser = new cApiUser($auth->auth["uid"]);
if (!isset($_REQUEST["elemperpage"]) || !is_numeric($_REQUEST["elemperpage"]) || $_REQUEST["elemperpage"] < 0) { if (!isset($_REQUEST["elemperpage"]) || !is_numeric($_REQUEST["elemperpage"]) || $_REQUEST["elemperpage"] < 0) {
$_REQUEST["elemperpage"] = $oUser->getProperty("itemsperpage", $area."_job_details"); $_REQUEST["elemperpage"] = $oUser->getProperty("itemsperpage", $area . "_job_details");
} }
if (!is_numeric($_REQUEST["elemperpage"])) { if (!is_numeric($_REQUEST["elemperpage"])) {
$_REQUEST["elemperpage"] = 50; $_REQUEST["elemperpage"] = 50;
} }
if ($_REQUEST["elemperpage"] > 0) { if ($_REQUEST["elemperpage"] > 0) {
// - All - will not be saved // - All - will not be saved
$oUser->setProperty("itemsperpage", $area."_job_details", $_REQUEST["elemperpage"]); $oUser->setProperty("itemsperpage", $area . "_job_details", $_REQUEST["elemperpage"]);
} }
$oFrmOptions = new UI_Table_Form("frmOptions"); $oFrmOptions = new UI_Table_Form("frmOptions");
@ -145,19 +142,18 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oFrmOptions->setVar("idnewsjob", $_REQUEST["idnewsjob"]); $oFrmOptions->setVar("idnewsjob", $_REQUEST["idnewsjob"]);
//$oFrmOptions->setVar("startpage", $startpage); //$oFrmOptions->setVar("startpage", $startpage);
//$oFrmOptions->setVar("appendparameters", $appendparameters); //$oFrmOptions->setVar("appendparameters", $appendparameters);
$oFrmOptions->addHeader(i18n("List options")); $oFrmOptions->addHeader(i18n("List options", "newsletter"));
$oSelElements = new cHTMLSelectElement("elemperpage"); $oSelElements = new cHTMLSelectElement("elemperpage");
$oSelElements->setEvent("onchange", "document.forms.frmOptions.submit();"); $oSelElements->setEvent("onchange", "document.forms.frmOptions.submit();");
$aData = Array("0" => i18n("-All-"), $aData = Array("0" => i18n("-All-", "newsletter"),
"50" => "50", "50" => "50",
"100" => "100", "100" => "100",
"250" => "250", "250" => "250",
"500" => "500"); "500" => "500");
foreach ($aData as $sKey => $sValue) foreach ($aData as $sKey => $sValue) {
{
$oOption = new cHTMLOptionElement($sValue, $sKey); $oOption = new cHTMLOptionElement($sValue, $sKey);
$oSelElements->addOptionElement($sKey, $oOption); $oSelElements->addOptionElement($sKey, $oOption);
} }
@ -165,16 +161,16 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oSelElements->setDefault($_REQUEST["elemperpage"]); $oSelElements->setDefault($_REQUEST["elemperpage"]);
//$oSelElements->setStyle('border:1px;border-style:solid;border-color:black;'); //$oSelElements->setStyle('border:1px;border-style:solid;border-color:black;');
$oFrmOptions->add(i18n("Items per page:"), $oSelElements->render()); $oFrmOptions->add(i18n("Items per page:", "newsletter"), $oSelElements->render());
// Ouput data // Ouput data
$oList = new cScrollList (true, "news_job_details"); $oList = new cScrollList(true, "news_job_details");
$oList->setCustom("idnewsjob", $_REQUEST["idnewsjob"]); $oList->setCustom("idnewsjob", $_REQUEST["idnewsjob"]);
$oList->setCustom("nextpage", $iNextPage); $oList->setCustom("nextpage", $iNextPage);
$oList->setCustom("elemperpage", $_REQUEST["elemperpage"]); $oList->setCustom("elemperpage", $_REQUEST["elemperpage"]);
$aCols = array("rcpname", "rcpemail", "", "status", "sent"); $aCols = array("rcpname", "rcpemail", "", "status", "sent");
$oList->setHeader(i18n("Recipient"), i18n("E-Mail"), i18n("Type"), i18n("Status"), i18n("Sent"), i18n("Actions")); $oList->setHeader(i18n("Recipient", "newsletter"), i18n("E-Mail", "newsletter"), i18n("Type", "newsletter"), i18n("Status", "newsletter"), i18n("Sent", "newsletter"), i18n("Actions", "newsletter"));
$oList->setSortable(0, true); $oList->setSortable(0, true);
$oList->setSortable(1, true); $oList->setSortable(1, true);
$oList->setSortable(2, false); $oList->setSortable(2, false);
@ -186,28 +182,24 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oLogs->setWhere("idnewsjob", $_REQUEST["idnewsjob"]); $oLogs->setWhere("idnewsjob", $_REQUEST["idnewsjob"]);
$sBrowseLinks = "1"; $sBrowseLinks = "1";
if ($_REQUEST["elemperpage"] > 0) if ($_REQUEST["elemperpage"] > 0) {
{
// First, get total data count // First, get total data count
$oLogs->query(); $oLogs->query();
$iRecipients = $oLogs->count(); // Getting item count without limit (for page function) - better idea anybody (performance)? $iRecipients = $oLogs->count(); // Getting item count without limit (for page function) - better idea anybody (performance)?
if ($iRecipients > 0 && $iRecipients > $_REQUEST["elemperpage"]) if ($iRecipients > 0 && $iRecipients > $_REQUEST["elemperpage"]) {
{
$sBrowseLinks = ""; $sBrowseLinks = "";
for ($i = 1; $i <= ceil($iRecipients / $_REQUEST["elemperpage"]); $i++) for ($i = 1; $i <= ceil($iRecipients / $_REQUEST["elemperpage"]); $i++) {
{
//$iNext = (($i - 1) * $_REQUEST["elemperpage"]) + 1; //$iNext = (($i - 1) * $_REQUEST["elemperpage"]) + 1;
if ($sBrowseLinks !== "") { if ($sBrowseLinks !== "") {
$sBrowseLinks .= "&nbsp;"; $sBrowseLinks .= "&nbsp;";
} }
if ($iNextPage == $i) if ($iNextPage == $i) {
{ $sBrowseLinks .= $i . "\n"; // I'm on the current page, no link
$sBrowseLinks .= $i."\n"; // I'm on the current page, no link
} else { } else {
$sBrowseLinks .= '<a href="'.$sess->url("main.php?area=$area&action=$action&frame=$frame&idnewsjob=" . $sBrowseLinks .= '<a href="' . $sess->url("main.php?area=$area&action=$action&frame=$frame&idnewsjob=" .
$_REQUEST["idnewsjob"] . "&nextpage=$i&sortmode=" . $_REQUEST["idnewsjob"] . "&nextpage=$i&sortmode=" .
$_REQUEST["sortmode"] . "&sortby=" . $_REQUEST["sortby"]) . '">'.$i.'</a>'."\n"; $_REQUEST["sortmode"] . "&sortby=" . $_REQUEST["sortby"]) . '">' . $i . '</a>' . "\n";
} }
} }
} }
@ -222,32 +214,30 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oLogs->query(); $oLogs->query();
$oImgDelete = new cHTMLImage("images/delete.gif"); $oImgDelete = new cHTMLImage("images/delete.gif");
$oImgDelete->setAlt(i18n("Delete item")); $oImgDelete->setAlt(i18n("Delete item", "newsletter"));
$sImgDelete = $oImgDelete->render(); $sImgDelete = $oImgDelete->render();
unset ($oImgDelete); unset($oImgDelete);
$iCount = 0; $iCount = 0;
$aNewsType[] = array(); // Performance $aNewsType[] = array(); // Performance
$aNewsType[0] = i18n("Text only"); $aNewsType[0] = i18n("Text only", "newsletter");
$aNewsType[1] = i18n("HTML/Text"); $aNewsType[1] = i18n("HTML/Text", "newsletter");
while ($oLog = $oLogs->next()) while ($oLog = $oLogs->next()) {
{
$sName = $oLog->get("rcpname"); $sName = $oLog->get("rcpname");
$sEMail = $oLog->get("rcpemail"); $sEMail = $oLog->get("rcpemail");
switch ($oLog->get("status")) switch ($oLog->get("status")) {
{
case "pending": case "pending":
$sStatus = i18n("Waiting for sending"); $sStatus = i18n("Waiting for sending", "newsletter");
break; break;
case "sending": case "sending":
$sStatus = i18n("Sending"); $sStatus = i18n("Sending", "newsletter");
break; break;
case "successful": case "successful":
$sStatus = i18n("Successful"); $sStatus = i18n("Successful", "newsletter");
break; break;
default: default:
$sStatus = sprintf(i18n("Error: %s"), $oLog->get("status")); $sStatus = sprintf(i18n("Error: %s", "newsletter"), $oLog->get("status"));
} }
if ($oLog->get("sent") == "0000-00-00 00:00:00") { if ($oLog->get("sent") == "0000-00-00 00:00:00") {
@ -257,8 +247,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
} }
$sLnkRemove = ""; $sLnkRemove = "";
if ($oLog->get("status") == "pending" && $perm->have_perm_area_action($area, "news_job_detail_delete")) if ($oLog->get("status") == "pending" && $perm->have_perm_area_action($area, "news_job_detail_delete")) {
{
$oLnkRemove = new cHTMLLink; $oLnkRemove = new cHTMLLink;
$oLnkRemove->setCLink("news_jobs", 4, "news_job_detail_delete"); $oLnkRemove->setCLink("news_jobs", 4, "news_job_detail_delete");
$oLnkRemove->setCustom("idnewsjob", $_REQUEST["idnewsjob"]); $oLnkRemove->setCustom("idnewsjob", $_REQUEST["idnewsjob"]);
@ -286,7 +275,7 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
</tr> </tr>
<tr class="text_medium" style="background-color: #ffffff;"> <tr class="text_medium" style="background-color: #ffffff;">
<td style="border: 1px; border-color: #B3B3B3; border-style: solid; background-color: #E2E2E2; color:#666666"> ' . <td style="border: 1px; border-color: #B3B3B3; border-style: solid; background-color: #E2E2E2; color:#666666"> ' .
sprintf(i18n("Go to page: %s"), $sBrowseLinks) . '</td> sprintf(i18n("Go to page: %s", "newsletter"), $sBrowseLinks) . '</td>
</tr> </tr>
</table>'; </table>';
@ -301,98 +290,90 @@ if ($action == "news_job_run" && $perm->have_perm_area_action($area, $action) &&
$oForm->setVar("action", ""); $oForm->setVar("action", "");
$oForm->setVar("idnewsjob", $idnewsjob); $oForm->setVar("idnewsjob", $idnewsjob);
$oForm->addHeader(i18n("Newsletter Dispatch Job")); $oForm->addHeader(i18n("Newsletter Dispatch Job", "newsletter"));
$oForm->add(i18n("Name"), $oJob->get("name")); $oForm->add(i18n("Name", "newsletter"), $oJob->get("name"));
$sDateFormat = getEffectiveSetting("backend", "timeformat", "d.m.Y H:i"); $sDateFormat = getEffectiveSetting("backend", "timeformat", "d.m.Y H:i");
switch ($oJob->get("status")) switch ($oJob->get("status")) {
{
case 1: case 1:
$oForm->add(i18n("Status"), i18n("Pending")); $oForm->add(i18n("Status", "newsletter"), i18n("Pending", "newsletter"));
break; break;
case 2: case 2:
$oForm->add(i18n("Status"), sprintf(i18n("Sending (started: %s)"), $oForm->add(i18n("Status", "newsletter"), sprintf(i18n("Sending (started: %s)", "newsletter"), date($sDateFormat, strtotime($oJob->get("started")))));
date($sDateFormat, strtotime($oJob->get("started")))));
break; break;
case 9: case 9:
$oForm->add(i18n("Status"), sprintf(i18n("Finished (started: %s, finished: %s)"), $oForm->add(i18n("Status", "newsletter"), sprintf(i18n("Finished (started: %s, finished: %s)", "newsletter"), date($sDateFormat, strtotime($oJob->get("started"))), date($sDateFormat, strtotime($oJob->get("finished")))));
date($sDateFormat, strtotime($oJob->get("started"))),
date($sDateFormat, strtotime($oJob->get("finished")))));
break; break;
} }
$oForm->add(i18n("Statistics"), sprintf(i18n("Planned: %s, Send: %s"), $oJob->get("rcpcount"), $oJob->get("sendcount"))); $oForm->add(i18n("Statistics", "newsletter"), sprintf(i18n("Planned: %s, Send: %s", "newsletter"), $oJob->get("rcpcount"), $oJob->get("sendcount")));
$oForm->add(i18n("From"), $oJob->get("newsfrom") . " (" . $oJob->get("newsfromname") . ")"); $oForm->add(i18n("From", "newsletter"), $oJob->get("newsfrom") . " (" . $oJob->get("newsfromname") . ")");
$oForm->add(i18n("Subject"), $oJob->get("subject")); $oForm->add(i18n("Subject", "newsletter"), $oJob->get("subject"));
if ($oJob->get("type") == "html") if ($oJob->get("type") == "html") {
{ $oForm->add(i18n("Type", "newsletter"), i18n("HTML and text", "newsletter"));
$oForm->add(i18n("Type"), i18n("HTML and text"));
$txtMessageHTML = new cHTMLTextarea("txtMessageHTML", $oJob->get("message_html"), 80, 20); $txtMessageHTML = new cHTMLTextarea("txtMessageHTML", $oJob->get("message_html"), 80, 20);
$txtMessageHTML->setDisabled("disabled"); $txtMessageHTML->setDisabled("disabled");
$oForm->add(i18n("HTML Message"), $txtMessageHTML->render()); $oForm->add(i18n("HTML Message", "newsletter"), $txtMessageHTML->render());
} else { } else {
$oForm->add(i18n("Type"), i18n("Text only")); $oForm->add(i18n("Type", "newsletter"), i18n("Text only", "newsletter"));
} }
$txtMessageText = new cHTMLTextarea("txtMessageText", $oJob->get("message_text"), 80, 20); $txtMessageText = new cHTMLTextarea("txtMessageText", $oJob->get("message_text"), 80, 20);
$txtMessageText->setDisabled("disabled"); $txtMessageText->setDisabled("disabled");
$oForm->add(i18n("Text Message"), $txtMessageText->render()); $oForm->add(i18n("Text Message", "newsletter"), $txtMessageText->render());
$aSendTo = unserialize($oJob->get("send_to")); $aSendTo = unserialize($oJob->get("send_to"));
switch ($aSendTo[0]) switch ($aSendTo[0]) {
{
case "all": case "all":
$sSendToInfo = i18n("Send newsletter to all recipients"); $sSendToInfo = i18n("Send newsletter to all recipients", "newsletter");
break; break;
case "default": case "default":
$sSendToInfo = i18n("Send newsletter to the members of the default group"); $sSendToInfo = i18n("Send newsletter to the members of the default group", "newsletter");
break; break;
case "selection": case "selection":
$sSendToInfo = i18n("Send newsletter to the members of the selected group(s):"); $sSendToInfo = i18n("Send newsletter to the members of the selected group(s):", "newsletter");
unset ($aSendTo[0]); unset($aSendTo[0]);
foreach ($aSendTo as $sGroup) foreach ($aSendTo as $sGroup) {
{
$sSendToInfo .= "<br />" . $sGroup; $sSendToInfo .= "<br />" . $sGroup;
} }
break; break;
case "single": case "single":
$sSendToInfo = i18n("Send newsletter to single recipient:"); $sSendToInfo = i18n("Send newsletter to single recipient:", "newsletter");
$sSendToInfo .= "<br />" . $aSendTo[1] . " (" . $aSendTo[2] . ")"; $sSendToInfo .= "<br />" . $aSendTo[1] . " (" . $aSendTo[2] . ")";
break; break;
default: default:
} }
unset ($aSendTo); unset($aSendTo);
$oForm->add(i18n("Recipients"), $sSendToInfo); $oForm->add(i18n("Recipients", "newsletter"), $sSendToInfo);
if ($oJob->get("use_cronjob") == 1) { if ($oJob->get("use_cronjob") == 1) {
$sOptionsInfo = i18n("Use cronjob: Enabled"); $sOptionsInfo = i18n("Use cronjob: Enabled", "newsletter");
} else { } else {
$sOptionsInfo = i18n("Use cronjob: Not enabled"); $sOptionsInfo = i18n("Use cronjob: Not enabled", "newsletter");
} }
if ($oJob->get("dispatch")) { if ($oJob->get("dispatch")) {
$sOptionsInfo .= "<br />" . sprintf(i18n("Dispatch: Enabled (block size: %s, delay: %s sec.)"), $oJob->get("dispatch_count"), $oJob->get("dispatch_delay")); $sOptionsInfo .= "<br />" . sprintf(i18n("Dispatch: Enabled (block size: %s, delay: %s sec.)", "newsletter"), $oJob->get("dispatch_count"), $oJob->get("dispatch_delay"));
} else { } else {
$sOptionsInfo .= "<br />" . i18n("Dispatch: Disabled"); $sOptionsInfo .= "<br />" . i18n("Dispatch: Disabled", "newsletter");
} }
$oForm->add(i18n("Options"), $sOptionsInfo); $oForm->add(i18n("Options", "newsletter"), $sOptionsInfo);
$oForm->add(i18n("Author"), $oJob->get("authorname")); $oForm->add(i18n("Author", "newsletter"), $oJob->get("authorname"));
$oForm->add(i18n("Created"), $oJob->get("created")); $oForm->add(i18n("Created", "newsletter"), $oJob->get("created"));
// Just remove the "save changes" message (as it is not possible to remove the image completely in ui_table_form) // Just remove the "save changes" message (as it is not possible to remove the image completely in ui_table_form)
$oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml']."images/but_ok.gif", "", "s"); $oForm->setActionButton("submit", $cfg['path']['contenido_fullhtml'] . "images/but_ok.gif", "", "s");
$oPage->setContent($oForm->render(true)); $oPage->setContent($oForm->render(true));
} }
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -50,9 +50,9 @@ $oUser = new cApiUser($auth->auth["uid"]);
// sort: Element can be used to be sorted by // sort: Element can be used to be sorted by
// search: Element can be used to search in // search: Element can be used to search in
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["created"] = array("field" => "created", "caption" => i18n("Created"), "type" => "base,sort"); $aFields["created"] = array("field" => "created", "caption" => i18n("Created", "newsletter"), "type" => "base,sort");
$aFields["status"] = array("field" => "status", "caption" => i18n("Status"), "type" => "base,sort"); $aFields["status"] = array("field" => "status", "caption" => i18n("Status", "newsletter"), "type" => "base,sort");
// Not needed, as no sort/search, but keep as memo: $aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob"), "type" => "base"); // Not needed, as no sort/search, but keep as memo: $aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob"), "type" => "base");
################################## ##################################
@ -158,11 +158,11 @@ $sDateFormat = getEffectiveSetting("backend", "timeformat", "d.m.Y H:i");
// Store messages for repeated use (speeds performance, as i18n translation is only needed once) // Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array(); $aMsg = array();
$aMsg["DelTitle"] = i18n("Delete dispatch job"); $aMsg["DelTitle"] = i18n("Delete dispatch job", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter dispatch job:<br>"); $aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter dispatch job:<br>", "newsletter");
$aMsg["SendTitle"] = i18n("Run job"); $aMsg["SendTitle"] = i18n("Run job", "newsletter");
$aMsg["SendDescr"] = i18n("Do you really want to run the following job:<br>"); $aMsg["SendDescr"] = i18n("Do you really want to run the following job:<br>", "newsletter");
// Prepare "send link" template // Prepare "send link" template
$sTplSend = '<a title="'.$aMsg["SendTitle"].'" href="javascript://" onclick="showSendMsg(\'{ID}\',\'{NAME}\')"><img src="'.$cfg['path']['images'].'newsletter_16.gif" border="0" title="'.$aMsg["SendTitle"].'" alt="'.$aMsg["SendTitle"].'"></a>'; $sTplSend = '<a title="'.$aMsg["SendTitle"].'" href="javascript://" onclick="showSendMsg(\'{ID}\',\'{NAME}\')"><img src="'.$cfg['path']['images'].'newsletter_16.gif" border="0" title="'.$aMsg["SendTitle"].'" alt="'.$aMsg["SendTitle"].'"></a>';

Datei anzeigen

@ -36,7 +36,7 @@ if (!defined('CON_FRAMEWORK')) {
if (isset($_GET['idnewsjob']) && (int)$_GET['idnewsjob'] > 0) if (isset($_GET['idnewsjob']) && (int)$_GET['idnewsjob'] > 0)
{ {
$sCaption = i18n("View"); $sCaption = i18n("View", "newsletter");
$tmp_area = "foo2"; $tmp_area = "foo2";
# Set template data # Set template data
@ -46,7 +46,7 @@ if (isset($_GET['idnewsjob']) && (int)$_GET['idnewsjob'] > 0)
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="'.$sess->url("main.php?area=news_jobs&frame=4&idnewsjob=$idnewsjob").'">'.$sCaption.'</a>'); $tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="'.$sess->url("main.php?area=news_jobs&frame=4&idnewsjob=$idnewsjob").'">'.$sCaption.'</a>');
$tpl->next(); $tpl->next();
$sCaption = i18n("Details"); $sCaption = i18n("Details", "newsletter");
$tmp_area = "foo2"; $tmp_area = "foo2";
# Set template data # Set template data

Datei anzeigen

@ -56,7 +56,7 @@ $sId = 'img_newsletter';
$oTpl->set('s', 'INEWSLETTER', $sId); $oTpl->set('s', 'INEWSLETTER', $sId);
if ($perm->have_perm_area_action('news')) { if ($perm->have_perm_area_action('news')) {
$sButtonRow = '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.newsletter_listoptionsform);">'; $sButtonRow = '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.newsletter_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Newsletter").'" title="'.i18n("Newsletter").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_on.gif"/>'; $sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'. i18n("Newsletter", "newsletter").'" title="'.i18n("Newsletter", "newsletter").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_on.gif"/>';
$sButtonRow .= '</a>'; $sButtonRow .= '</a>';
} }
@ -65,7 +65,7 @@ $sId = 'img_dispatch';
$oTpl->set('s', 'IDISPATCH', $sId); $oTpl->set('s', 'IDISPATCH', $sId);
if ($perm->have_perm_area_action('news_jobs')) { if ($perm->have_perm_area_action('news_jobs')) {
$sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.dispatch_listoptionsform);">'; $sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.dispatch_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Dispatch").'" title="'.i18n("Dispatch").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_dispatch_on.gif"/>'; $sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Dispatch", "newsletter").'" title="'.i18n("Dispatch", "newsletter").'" name="'.$sId.'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_dispatch_on.gif"/>';
$sButtonRow .= '</a>'; $sButtonRow .= '</a>';
} }
@ -74,7 +74,7 @@ $sId = 'img_recipient';
$oTpl->set('s', 'IRECIPIENTS', $sId); $oTpl->set('s', 'IRECIPIENTS', $sId);
if ($perm->have_perm_area_action('recipients')) { if ($perm->have_perm_area_action('recipients')) {
$sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.recipients_listoptionsform);">'; $sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(document.recipients_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipients").'" title="'.i18n("Recipients").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipients_on.gif"/>'; $sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipients", "newsletter").'" title="'.i18n("Recipients", "newsletter").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipients_on.gif"/>';
$sButtonRow .= '</a>'; $sButtonRow .= '</a>';
} }
@ -83,7 +83,7 @@ $sId = 'img_recipientgroup';
$oTpl->set('s', 'IRECIPIENTGROUP', $sId); $oTpl->set('s', 'IRECIPIENTGROUP', $sId);
if ($perm->have_perm_area_action('recipientgroups')) { if ($perm->have_perm_area_action('recipientgroups')) {
$sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(groups_listoptionsform);">'; $sButtonRow .= '<a style="margin-right:5px;" href="javascript://" onclick="toggleContainer(\''.$sId.'\');reloadLeftBottomAndTransportFormVars(groups_listoptionsform);">';
$sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipient groups").'" title="'.i18n("Recipient groups").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipientgroups_on.gif"/>'; $sButtonRow .= '<img onmouseover="hoverEffect(\''.$sId.'\', \'in\')" onmouseout="hoverEffect(\''.$sId.'\', \'out\')" alt="'.i18n("Recipient groups", "newsletter").'" title="'.i18n("Recipient groups", "newsletter").'" id="'.$sId.'" src="'.$cfg["path"]["images"].'newsletter_recipientgroups_on.gif"/>';
$sButtonRow .= '</a>'; $sButtonRow .= '</a>';
} }
@ -98,7 +98,7 @@ unset($sButtonRow);
# 1.1 Newsletter: Actions folding row # 1.1 Newsletter: Actions folding row
###################################### ######################################
$sLink = "actionlink"; // ID for HTML element $sLink = "actionlink"; // ID for HTML element
$oActionsRow = new cFoldingRow("28cf9b31-e6d7-4657-a9a7-db31478e7a5c",i18n("Actions"), $sLink); $oActionsRow = new cFoldingRow("28cf9b31-e6d7-4657-a9a7-db31478e7a5c",i18n("Actions", "newsletter"), $sLink);
$oTpl->set('s', 'ACTIONLINK', $sLink); $oTpl->set('s', 'ACTIONLINK', $sLink);
if ($perm->have_perm_area_action("news", "news_create")) if ($perm->have_perm_area_action("news", "news_create"))
@ -108,7 +108,7 @@ if ($perm->have_perm_area_action("news", "news_create"))
$oLink = new cHTMLLink; $oLink = new cHTMLLink;
$oLink->setMultiLink("news", "", "news", "news_create"); $oLink->setMultiLink("news", "", "news", "news_create");
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create newsletter")); $oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create newsletter", "newsletter"));
$sContent .= $oLink->render() . '</div>'."\n"; $sContent .= $oLink->render() . '</div>'."\n";
$oActionsRow->setContentData($sContent); $oActionsRow->setContentData($sContent);
@ -120,7 +120,7 @@ if ($perm->have_perm_area_action("news", "news_create"))
# 1.2 Newsletter: Settings folding row # 1.2 Newsletter: Settings folding row
###################################### ######################################
$sLink = "settingslink"; $sLink = "settingslink";
$oSettingsRow = new cFoldingRow("d64baf0a-aea9-47b3-8490-54a00fce02b5",i18n("Settings"), $sLink); $oSettingsRow = new cFoldingRow("d64baf0a-aea9-47b3-8490-54a00fce02b5",i18n("Settings", "newsletter"), $sLink);
$oTpl->set('s', 'SETTINGSLINK', $sLink); $oTpl->set('s', 'SETTINGSLINK', $sLink);
// HTML Newsletter: Template and newsletter category // HTML Newsletter: Template and newsletter category
@ -132,9 +132,9 @@ $oSelHTMLTemplateIDCat->setStyle("width: 220px;");
$oSelHTMLNewsletterIDCat = new cHTMLSelectElement("selHTMLNewsletterCat"); $oSelHTMLNewsletterIDCat = new cHTMLSelectElement("selHTMLNewsletterCat");
$oSelHTMLNewsletterIDCat->setStyle("width: 220px;"); $oSelHTMLNewsletterIDCat->setStyle("width: 220px;");
$oOptionTemplate = new cHTMLOptionElement("--".i18n("Please select")."--", 0); $oOptionTemplate = new cHTMLOptionElement("--".i18n("Please select", "newsletter")."--", 0);
$oSelHTMLTemplateIDCat->addOptionElement(0, $oOptionTemplate); $oSelHTMLTemplateIDCat->addOptionElement(0, $oOptionTemplate);
$oOptionNewsletter = new cHTMLOptionElement("--".i18n("Please select")."--", 0); $oOptionNewsletter = new cHTMLOptionElement("--".i18n("Please select", "newsletter")."--", 0);
$oSelHTMLNewsletterIDCat->addOptionElement(0, $oOptionNewsletter); $oSelHTMLNewsletterIDCat->addOptionElement(0, $oOptionNewsletter);
$sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, tblCatTree.level AS level, "; $sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, tblCatTree.level AS level, ";
@ -200,7 +200,7 @@ if (!$perm->have_perm_area_action($area, "news_html_settings"))
$oSelTestDestination = new cHTMLSelectElement("selTestDestination"); $oSelTestDestination = new cHTMLSelectElement("selTestDestination");
$oSelTestDestination->setStyle("width: 220px;"); $oSelTestDestination->setStyle("width: 220px;");
$oOption = new cHTMLOptionElement(i18n("My mail address"), 0); $oOption = new cHTMLOptionElement(i18n("My mail address", "newsletter"), 0);
$oSelTestDestination->addOptionElement(0, $oOption); $oSelTestDestination->addOptionElement(0, $oOption);
$oRcpGroups = new RecipientGroupCollection; $oRcpGroups = new RecipientGroupCollection;
@ -237,7 +237,7 @@ if (!$perm->have_perm_area_action($area, "news_send_test"))
} }
$oSelTestDestination->setDefault($iTestDestination); $oSelTestDestination->setDefault($iTestDestination);
$oBtnSave = new cHTMLButton("submit", i18n("Save")); $oBtnSave = new cHTMLButton("submit", i18n("Save", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left:17px; background: '.$cfg['color']['table_dark'].';">'."\n"; $sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left:17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= ' <form target="left_bottom" onsubmit="append_registered_parameters(this);" id="htmlnewsletter" name="htmlnewsletter" method="get" action="main.php?1">'."\n"; $sContent .= ' <form target="left_bottom" onsubmit="append_registered_parameters(this);" id="htmlnewsletter" name="htmlnewsletter" method="get" action="main.php?1">'."\n";
@ -253,16 +253,16 @@ $sContent .= ' <input type="hidden" name="searchin" value="'.$_REQUEST["search
$sContent .= ' <input type="hidden" name="action_html" value="save_newsletter_properties">'."\n"; $sContent .= ' <input type="hidden" name="action_html" value="save_newsletter_properties">'."\n";
$sContent .= ' <table>'."\n"; $sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.$oCkbHTMLNewsletter->toHTML(false).' '.i18n("Enable HTML Newsletter").'</td>'."\n"; $sContent .= ' <td>'.$oCkbHTMLNewsletter->toHTML(false).' '.i18n("Enable HTML Newsletter", "newsletter").'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.i18n("HTML Template Category:").'<br />'.$oSelHTMLTemplateIDCat->render().'</td>'."\n"; $sContent .= ' <td>'.i18n("HTML Template Category:", "newsletter").'<br />'.$oSelHTMLTemplateIDCat->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.i18n("HTML Newsletter Category:").'<br />'.$oSelHTMLNewsletterIDCat->render().'</td>'."\n"; $sContent .= ' <td>'.i18n("HTML Newsletter Category:", "newsletter").'<br />'.$oSelHTMLNewsletterIDCat->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'.i18n("Send test destination:").'<br />'.$oSelTestDestination->render().'</td>'."\n"; $sContent .= ' <td>'.i18n("Send test destination:", "newsletter").'<br />'.$oSelTestDestination->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td style="text-align: right;">'.$oBtnSave->render().'</td>'."\n"; $sContent .= ' <td style="text-align: right;">'.$oBtnSave->render().'</td>'."\n";
@ -282,7 +282,7 @@ if ($iItemsPerPage == 0) {
} }
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage"); $oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage); $oSelItemsPerPage->setDefault($iItemsPerPage);
// Sort By // Sort By
$oSelSortBy = new cHTMLSelectElement("sortby"); $oSelSortBy = new cHTMLSelectElement("sortby");
@ -291,19 +291,19 @@ $oSelSortBy->addOptionElement($sKey, $oOption);
$oSelSortBy->setDefault("name"); $oSelSortBy->setDefault("name");
// Sort Order // Sort Order
$oSelSortOrder = new cHTMLSelectElement("sortorder"); $oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending"))); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("ASC"); $oSelSortOrder->setDefault("ASC");
// Search For // Search For
$oTextboxFilter = new cHTMLTextbox("filter", "", 16); $oTextboxFilter = new cHTMLTextbox("filter", "", 16);
// Search In // Search In
$oSelSearchIn = new cHTMLSelectElement("searchin"); $oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption); $oSelSearchIn->addOptionElement("all", $oOption);
$oOption = new cHTMLOptionElement("Name", "name"); $oOption = new cHTMLOptionElement("Name", "name");
$oSelSearchIn->addOptionElement($sKey, $oOption); $oSelSearchIn->addOptionElement($sKey, $oOption);
$oSelSearchIn->setDefault("name"); $oSelSearchIn->setDefault("name");
// Apply button // Apply button
$oBtnApply = new cHTMLButton("submit", i18n("Apply")); $oBtnApply = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n"; $sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="newsletter_listoptionsform" name="newsletter_listoptionsform" method="get" action="">'."\n"; $sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="newsletter_listoptionsform" name="newsletter_listoptionsform" method="get" action="">'."\n";
@ -312,23 +312,23 @@ $sContent .= ' <input type="hidden" name="frame" value="2">'."\n";
$sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n"; $sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n";
$sContent .= ' <table>'."\n"; $sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Items / page").'</td>'."\n"; $sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTextboxFilter->render().'</td>'."\n"; $sContent .= ' <td>'.$oTextboxFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
@ -341,7 +341,7 @@ $sContent .= '</div>'."\n";
// To template // To template
$sLink = "listoption"; $sLink = "listoption";
$oListOptionsRow = new cFoldingRow("9d0968be-601d-44f8-a666-99d51c9c777d",i18n("List options"), $sLink); $oListOptionsRow = new cFoldingRow("9d0968be-601d-44f8-a666-99d51c9c777d",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent); $oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINK', $sLink); $oTpl->set('s', 'LISTOPTIONLINK', $sLink);
@ -400,10 +400,10 @@ $oTpl->set('s', 'ID_CNEWSLETTER', $sContainerId);
// sort: Element can be used to be sorted by // sort: Element can be used to be sorted by
// search: Element can be used to search in // search: Element can be used to search in
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["created"] = array("field" => "created", "caption" => i18n("Created"), "type" => "base,sort"); $aFields["created"] = array("field" => "created", "caption" => i18n("Created", "newsletter"), "type" => "base,sort");
$aFields["status"] = array("field" => "status", "caption" => i18n("Status"), "type" => "base,sort"); $aFields["status"] = array("field" => "status", "caption" => i18n("Status", "newsletter"), "type" => "base,sort");
$aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob"), "type" => "base"); $aFields["cronjob"] = array("field" => "use_cronjob", "caption" => i18n("Use cronjob", "newsletter"), "type" => "base");
###################################### ######################################
# 2.1 Job dispatch: List options folding row # 2.1 Job dispatch: List options folding row
@ -441,7 +441,7 @@ if ($iItemsPerPage == 0) {
} }
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage"); $oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage); $oSelItemsPerPage->setDefault($iItemsPerPage);
// Sort by // Sort by
@ -457,7 +457,7 @@ $oSelSortBy->setDefault("created");
// Sort order // Sort order
$oSelSortOrder = new cHTMLSelectElement("sortorder"); $oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending"))); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("DESC"); $oSelSortOrder->setDefault("DESC");
// Filter // Filter
@ -465,7 +465,7 @@ $oTxtFilter = new cHTMLTextbox("filter", "", 16);
//Search in //Search in
$oSelSearchIn = new cHTMLSelectElement("searchin"); $oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption); $oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) foreach ($aFields as $sKey => $aData)
@ -478,7 +478,7 @@ foreach ($aFields as $sKey => $aData)
} }
$oSelSearchIn->setDefault("--all--"); $oSelSearchIn->setDefault("--all--");
$oBtnApply = new cHTMLButton("submit", i18n("Apply")); $oBtnApply = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n"; $sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="dispatch_listoptionsform" name="dispatch_listoptionsform" method="get" action="">'."\n"; $sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="dispatch_listoptionsform" name="dispatch_listoptionsform" method="get" action="">'."\n";
@ -487,27 +487,27 @@ $sContent .= ' <input type="hidden" name="frame" value="2">'."\n";
$sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n"; $sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n";
$sContent .= ' <table>'."\n"; $sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Author").'</td>'."\n"; $sContent .= ' <td>'. i18n("Author", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelAuthor->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelAuthor->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Items / page").'</td>'."\n"; $sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n"; $sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
@ -520,7 +520,7 @@ $sContent .= '</div>'."\n";
// To template // To template
$sLink = "listoptiondisp"; $sLink = "listoptiondisp";
$oListOptionsRow = new cFoldingRow("dfa6cc00-0acf-11db-9cd8-0800200c9a66",i18n("List options"), $sLink); $oListOptionsRow = new cFoldingRow("dfa6cc00-0acf-11db-9cd8-0800200c9a66",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent); $oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINKDISP', $sLink); $oTpl->set('s', 'LISTOPTIONLINKDISP', $sLink);
@ -565,10 +565,10 @@ $oTpl->set('s', 'ID_CDISPATCH', $sContainerId);
###################################### ######################################
// See comment at 2. Job dispatch // See comment at 2. Job dispatch
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"),"type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail"), "type" => "base,sort,search"); $aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail", "newsletter"),"type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed"), "type" => "base"); $aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed", "newsletter"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated"), "type" => "base"); $aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated", "newsletter"), "type" => "base");
###################################### ######################################
# 3.1 Recipients: Actions folding row # 3.1 Recipients: Actions folding row
@ -580,7 +580,7 @@ if ($perm->have_perm_area_action("recipients", "recipients_create"))
{ {
$oLink = new cHTMLLink; $oLink = new cHTMLLink;
$oLink->setMultiLink("recipients","","recipients","recipients_create"); $oLink->setMultiLink("recipients","","recipients","recipients_create");
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create recipient").'</a>'); $oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create recipient", "newsletter").'</a>');
$sContent .= $oLink->render().'<br />'."\n"; $sContent .= $oLink->render().'<br />'."\n";
} }
@ -590,7 +590,7 @@ if ($perm->have_perm_area_action("recipients", "recipients_create"))
{ {
$oLink = new cHTMLLink; $oLink = new cHTMLLink;
$oLink->setMultiLink("recipients", "", "recipients_import", "recipients_import"); $oLink->setMultiLink("recipients", "", "recipients_import", "recipients_import");
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'importieren.gif" align="middle">'.i18n("Import recipients").'</a>'); $oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'importieren.gif" align="middle">'.i18n("Import recipients", "newsletter").'</a>');
$sContent .= $oLink->render().'<br />'."\n"; $sContent .= $oLink->render().'<br />'."\n";
} }
@ -604,9 +604,9 @@ if ($iTimeframe <= 0) {
if ($perm->have_perm_area_action("recipients", "recipients_delete")) if ($perm->have_perm_area_action("recipients", "recipients_delete"))
{ {
$oLink = new cHTMLLink; $oLink = new cHTMLLink;
$oLink->setLink('javascript:showPurgeMsg("'.i18n('Purge recipients').'", "'.sprintf(i18n("Do you really want to remove recipients, that have not been confirmed since %s days and over?"), '"+purgetimeframe+"').'")'); $oLink->setLink('javascript:showPurgeMsg("'.i18n('Purge recipients', "newsletter").'", "'.sprintf(i18n("Do you really want to remove recipients, that have not been confirmed since %s days and over?", "newsletter"), '"+purgetimeframe+"').'")');
$oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'delete.gif" align="middle">'.i18n("Purge recipients").'</a>'); $oLink->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'delete.gif" align="middle">'.i18n("Purge recipients", "newsletter").'</a>');
$sContent .= $oLink->render(); $sContent .= $oLink->render();
} }
@ -615,7 +615,7 @@ $oTpl->set('s', 'VALUE_PURGETIMEFRAME', $iTimeframe);
// To template // To template
$sLink = "actionrec"; $sLink = "actionrec";
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a66", i18n("Actions"), $sLink); $oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a66", i18n("Actions", "newsletter"), $sLink);
$oListActionsRow->setContentData($sContent); $oListActionsRow->setContentData($sContent);
$oTpl->set('s', 'ACTIONLINKREC', $sLink); $oTpl->set('s', 'ACTIONLINKREC', $sLink);
@ -623,7 +623,7 @@ $oTpl->set('s', 'ACTIONLINKREC', $sLink);
# 3.2 Recipients: Settings folding row # 3.2 Recipients: Settings folding row
###################################### ######################################
$oTxtTimeframe = new cHTMLTextbox("txtPurgeTimeframe", $iTimeframe, 5); $oTxtTimeframe = new cHTMLTextbox("txtPurgeTimeframe", $iTimeframe, 5);
$oBtnSave = new cHTMLButton("submit", i18n("Save")); $oBtnSave = new cHTMLButton("submit", i18n("Save", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n"; $sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= '<form target="left_bottom" onsubmit="purgetimeframe = document.options.txtPurgeTimeframe.value; append_registered_parameters(this);" id="options" name="options" method="get" action="main.php?1">'."\n"; $sContent .= '<form target="left_bottom" onsubmit="purgetimeframe = document.options.txtPurgeTimeframe.value; append_registered_parameters(this);" id="options" name="options" method="get" action="main.php?1">'."\n";
@ -638,8 +638,8 @@ $sContent .= ' <input type="hidden" name="filter" value="'.$_REQUEST["filter"]
$sContent .= ' <input type="hidden" name="searchin" value="'.$_REQUEST["searchin"].'">'."\n"; $sContent .= ' <input type="hidden" name="searchin" value="'.$_REQUEST["searchin"].'">'."\n";
$sContent .= ' <table>'."\n"; $sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Purge timeframe").':</td>'."\n"; $sContent .= ' <td>'. i18n("Purge timeframe", "newsletter").':</td>'."\n";
$sContent .= ' <td>'.$oTxtTimeframe->render().'&nbsp;'.i18n("days").'</td>'."\n"; $sContent .= ' <td>'.$oTxtTimeframe->render().'&nbsp;'.i18n("days", "newsletter").'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>&nbsp;</td>'."\n"; $sContent .= ' <td>&nbsp;</td>'."\n";
@ -651,7 +651,7 @@ $sContent .= '</div>'."\n";
// To template // To template
$sLink = "settingsrec"; $sLink = "settingsrec";
$oSettingsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a69",i18n("Settings"), $sLink); $oSettingsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a69",i18n("Settings", "newsletter"), $sLink);
$oSettingsRow->setContentData($sContent); $oSettingsRow->setContentData($sContent);
$oTpl->set('s', 'SETTINGSLINKREC', $sLink); $oTpl->set('s', 'SETTINGSLINKREC', $sLink);
@ -664,7 +664,7 @@ if ($iItemsPerPage == 0) {
} }
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage"); $oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage); $oSelItemsPerPage->setDefault($iItemsPerPage);
$oSelSortBy = new cHTMLSelectElement("sortby"); $oSelSortBy = new cHTMLSelectElement("sortby");
@ -678,11 +678,11 @@ foreach ($aFields as $sKey => $aData)
$oSelSortBy->setDefault("name"); $oSelSortBy->setDefault("name");
$oSelSortOrder = new cHTMLSelectElement("sortorder"); $oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending"))); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("ASC"); $oSelSortOrder->setDefault("ASC");
$oSelRestrictGroup = new cHTMLSelectElement("restrictgroup"); $oSelRestrictGroup = new cHTMLSelectElement("restrictgroup");
$oOption = new cHTMLOptionElement(i18n("-- All groups --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All groups --", "newsletter"), "--all--");
$oSelRestrictGroup->addOptionElement("all", $oOption); $oSelRestrictGroup->addOptionElement("all", $oOption);
// Fetch recipient groups // Fetch recipient groups
@ -710,7 +710,7 @@ $oSelRestrictGroup->setDefault("--all--");
$oTxtFilter = new cHTMLTextbox("filter", "", 16); $oTxtFilter = new cHTMLTextbox("filter", "", 16);
$oSelSearchIn = new cHTMLSelectElement("searchin"); $oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption); $oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) { foreach ($aFields as $sKey => $aData) {
@ -730,27 +730,27 @@ $sContent .= ' <input type="hidden" name="frame" value="2">'."\n";
$sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n"; $sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n";
$sContent .= ' <table>'."\n"; $sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Items / page").'</td>'."\n"; $sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Show group").'</td>'."\n"; $sContent .= ' <td>'. i18n("Show group", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelRestrictGroup->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelRestrictGroup->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n"; $sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
@ -763,7 +763,7 @@ $sContent .= '</div>'."\n";
// To template // To template
$sLink = "listoptionsrec"; $sLink = "listoptionsrec";
$oListOptionsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a66",i18n("List options"), $sLink); $oListOptionsRow = new cFoldingRow("5ddbe820-e6f1-11d9-8cd6-0800200c9a66",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent); $oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINKREC', $sLink); $oTpl->set('s', 'LISTOPTIONLINKREC', $sLink);
@ -812,7 +812,7 @@ $oTpl->set('s', 'ID_CRECIPIENTS', $sContainerId);
###################################### ######################################
// See comment at 2. Job dispatch // See comment at 2. Job dispatch
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "groupname", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
###################################### ######################################
# 4.1 Recipient groups: Actions # 4.1 Recipient groups: Actions
@ -824,14 +824,14 @@ if ($perm->have_perm_area_action("recipientgroups", "recipientgroup_create"))
{ {
$oLnk = new cHTMLLink; $oLnk = new cHTMLLink;
$oLnk->setMultiLink("recipientgroups","","recipientgroups","recipientgroup_create"); $oLnk->setMultiLink("recipientgroups","","recipientgroups","recipientgroup_create");
$oLnk->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create group").'</a>'); $oLnk->setContent('<img style="margin-right: 4px;" src="'.$cfg["path"]["images"] . 'folder_new.gif" align="middle">'.i18n("Create group", "newsletter").'</a>');
$sContent .= $oLnk->render().'<br />'."\n"; $sContent .= $oLnk->render().'<br />'."\n";
} }
$sContent .= '</div>'."\n"; $sContent .= '</div>'."\n";
$sLink = "actiongroup"; $sLink = "actiongroup";
$oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a67",i18n("Actions"), $sLink); $oListActionsRow = new cFoldingRow("f0d7bf80-e73e-11d9-8cd6-0800200c9a67",i18n("Actions", "newsletter"), $sLink);
$oListActionsRow->setContentData($sContent); $oListActionsRow->setContentData($sContent);
$oTpl->set('s', 'ACTIONLINKGROUP', $sLink); $oTpl->set('s', 'ACTIONLINKGROUP', $sLink);
@ -844,7 +844,7 @@ if ($iItemsPerPage == 0) {
} }
$oSelItemsPerPage = new cHTMLSelectElement("elemperpage"); $oSelItemsPerPage = new cHTMLSelectElement("elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($iItemsPerPage); $oSelItemsPerPage->setDefault($iItemsPerPage);
$oSelSortBy = new cHTMLSelectElement("sortby"); $oSelSortBy = new cHTMLSelectElement("sortby");
@ -857,13 +857,13 @@ foreach ($aFields as $sKey => $aData) {
$oSelSortBy->setDefault("name"); $oSelSortBy->setDefault("name");
$oSelSortOrder = new cHTMLSelectElement("sortorder"); $oSelSortOrder = new cHTMLSelectElement("sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending"))); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault("ASC"); $oSelSortOrder->setDefault("ASC");
$oTxtFilter = new cHTMLTextbox("filter", "", 16); $oTxtFilter = new cHTMLTextbox("filter", "", 16);
$oSelSearchIn = new cHTMLSelectElement("searchin"); $oSelSearchIn = new cHTMLSelectElement("searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption); $oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) { foreach ($aFields as $sKey => $aData) {
@ -874,7 +874,7 @@ foreach ($aFields as $sKey => $aData) {
} }
$oSelSearchIn->setDefault("--all--"); $oSelSearchIn->setDefault("--all--");
$oBtnApply = new cHTMLButton("submit", i18n("Apply")); $oBtnApply = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n"; $sContent = '<div style="border-bottom: 0px solid #B3B3B3; padding-left: 17px; background: '.$cfg['color']['table_dark'].';">'."\n";
$sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="groups_listoptionsform" name="groups_listoptionsform" method="get" action="">'."\n"; $sContent .= '<form target="left_bottom" onsubmit="reloadLeftBottomAndTransportFormVars(this);" id="groups_listoptionsform" name="groups_listoptionsform" method="get" action="">'."\n";
@ -883,23 +883,23 @@ $sContent .= ' <input type="hidden" name="frame" value="2">'."\n";
$sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n"; $sContent .= ' <input type="hidden" name="contenido" value="'.$sess->id.'">'."\n";
$sContent .= ' <table>'."\n"; $sContent .= ' <table>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Items / page").'</td>'."\n"; $sContent .= ' <td>'. i18n("Items / page", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort by").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort by", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortBy->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Sort order").'</td>'."\n"; $sContent .= ' <td>'. i18n("Sort order", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSortOrder->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search for").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search for", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n"; $sContent .= ' <td>'.$oTxtFilter->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
$sContent .= ' <td>'. i18n("Search in").'</td>'."\n"; $sContent .= ' <td>'. i18n("Search in", "newsletter").'</td>'."\n";
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n"; $sContent .= ' <td>'.$oSelSearchIn->render().'</td>'."\n";
$sContent .= ' </tr>'."\n"; $sContent .= ' </tr>'."\n";
$sContent .= ' <tr>'."\n"; $sContent .= ' <tr>'."\n";
@ -912,7 +912,7 @@ $sContent .= '</div>'."\n";
// To template // To template
$sLink = "listoptionsgroup"; $sLink = "listoptionsgroup";
$oListOptionsRow = new cFoldingRow("79efc1fc-111d-11dc-8314-0800200c9a66",i18n("List options"), $sLink); $oListOptionsRow = new cFoldingRow("79efc1fc-111d-11dc-8314-0800200c9a66",i18n("List options", "newsletter"), $sLink);
$oListOptionsRow->setContentData($sContent); $oListOptionsRow->setContentData($sContent);
$oTpl->set('s', 'LISTOPTIONLINKGROUP', $sLink); $oTpl->set('s', 'LISTOPTIONLINKGROUP', $sLink);

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -41,7 +41,7 @@ $oUser = new cApiUser($auth->auth["uid"]);
$oClientLang = new cApiClientLanguage(false, $client, $lang); $oClientLang = new cApiClientLanguage(false, $client, $lang);
// Get idCatArt to check, if we may send a test newsletter // Get idCatArt to check, if we may send a test newsletter
$lIDCatArt = (int)$oClientLang->getProperty("newsletter", "idcatart"); $lIDCatArt = (int) $oClientLang->getProperty("newsletter", "idcatart");
// Specify fields for search, sort and validation. Design makes enhancements // Specify fields for search, sort and validation. Design makes enhancements
// using plugins possible (currently not implemented). If you are changing things here, // using plugins possible (currently not implemented). If you are changing things here,
@ -52,7 +52,7 @@ $lIDCatArt = (int)$oClientLang->getProperty("newsletter", "idcatart");
// sort: Element can be used to be sorted by // sort: Element can be used to be sorted by
// search: Element can be used to search in // search: Element can be used to search in
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
################################## ##################################
# Store settings/Get basic data # Store settings/Get basic data
@ -64,15 +64,15 @@ if (isset($_REQUEST['action_html']) && $_REQUEST['action_html'] == 'save_newslet
} else { } else {
$oClientLang->setProperty("newsletter", "html_newsletter", "false"); $oClientLang->setProperty("newsletter", "html_newsletter", "false");
} }
$oClientLang->setProperty("newsletter", "html_template_idcat", (int)$_REQUEST["selHTMLTemplateCat"]); $oClientLang->setProperty("newsletter", "html_template_idcat", (int) $_REQUEST["selHTMLTemplateCat"]);
$oClientLang->setProperty("newsletter", "html_newsletter_idcat", (int)$_REQUEST["selHTMLNewsletterCat"]); $oClientLang->setProperty("newsletter", "html_newsletter_idcat", (int) $_REQUEST["selHTMLNewsletterCat"]);
$oUser->setProperty("newsletter", "test_idnewsgrp_lang" . $lang, (int)$_REQUEST["selTestDestination"]); $oUser->setProperty("newsletter", "test_idnewsgrp_lang" . $lang, (int) $_REQUEST["selTestDestination"]);
} else { } else {
// No settings to be stored, get current settings (language sepcific, as lang is client specific, lang is sufficient) // No settings to be stored, get current settings (language sepcific, as lang is client specific, lang is sufficient)
$_REQUEST["selTestDestination"] = (int)$oUser->getProperty("newsletter", "test_idnewsgrp_lang" . $lang); $_REQUEST["selTestDestination"] = (int) $oUser->getProperty("newsletter", "test_idnewsgrp_lang" . $lang);
} }
// Default value: Current user mail // Default value: Current user mail
$sSendTestTarget = $oUser->get("realname"). " (" . $oUser->get("email") . ")"; $sSendTestTarget = $oUser->get("realname") . " (" . $oUser->get("email") . ")";
################################## ##################################
# Check external input # Check external input
@ -89,7 +89,7 @@ if ($_REQUEST["elemperpage"] > 0) {
// -- All -- will not be stored, as it may be impossible to change this back to something more useful // -- All -- will not be stored, as it may be impossible to change this back to something more useful
$oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]); $oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]);
} }
$_REQUEST["page"] = (int)$_REQUEST["page"]; $_REQUEST["page"] = (int) $_REQUEST["page"];
if ($_REQUEST["page"] <= 0 || $_REQUEST["elemperpage"] == 0) { if ($_REQUEST["page"] <= 0 || $_REQUEST["elemperpage"] == 0) {
$_REQUEST["page"] = 1; $_REQUEST["page"] = 1;
} }
@ -101,8 +101,7 @@ if ($_REQUEST["sortorder"] != "DESC") {
// Check sort by and search in criteria // Check sort by and search in criteria
$bSortByFound = false; $bSortByFound = false;
$bSearchInFound = false; $bSearchInFound = false;
foreach ($aFields as $sKey => $aData) foreach ($aFields as $sKey => $aData) {
{
if ($aData["field"] == $_REQUEST["sortby"] && strpos($aData["type"], "sort") !== false) { if ($aData["field"] == $_REQUEST["sortby"] && strpos($aData["type"], "sort") !== false) {
$bSortByFound = true; $bSortByFound = true;
} }
@ -119,8 +118,8 @@ if (!$bSearchInFound) {
} }
// Free memory // Free memory
unset ($oClientLang); unset($oClientLang);
unset ($oUser); unset($oUser);
################################## ##################################
# Get data # Get data
@ -129,12 +128,9 @@ $oNewsletters = new NewsletterCollection;
$oNewsletters->setWhere("idclient", $client); $oNewsletters->setWhere("idclient", $client);
$oNewsletters->setWhere("idlang", $lang); $oNewsletters->setWhere("idlang", $lang);
if ($_REQUEST["filter"] != "") if ($_REQUEST["filter"] != "") {
{ if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") {
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") foreach ($aFields as $sKey => $aData) {
{
foreach ($aFields as $sKey => $aData)
{
if (strpos($aData["type"], "search") !== false) { if (strpos($aData["type"], "search") !== false) {
$oNewsletters->setWhereGroup("filter", $aData["field"], $_REQUEST["filter"], "LIKE"); $oNewsletters->setWhereGroup("filter", $aData["field"], $_REQUEST["filter"], "LIKE");
} }
@ -145,14 +141,13 @@ if ($_REQUEST["filter"] != "")
} }
} }
if ($_REQUEST["elemperpage"] > 0) if ($_REQUEST["elemperpage"] > 0) {
{
// Getting item count without limit (for page function) - better idea anyone (performance)? // Getting item count without limit (for page function) - better idea anyone (performance)?
$oNewsletters->query(); $oNewsletters->query();
$iItemCount = $oNewsletters->count(); $iItemCount = $oNewsletters->count();
if ($_REQUEST["elemperpage"]*($_REQUEST["page"]) >= $iItemCount+$_REQUEST["elemperpage"] && $_REQUEST["page"] != 1) { if ($_REQUEST["elemperpage"] * ($_REQUEST["page"]) >= $iItemCount + $_REQUEST["elemperpage"] && $_REQUEST["page"] != 1) {
$_REQUEST["page"]--; $_REQUEST["page"] --;
} }
$oNewsletters->setLimit($_REQUEST["elemperpage"] * ($_REQUEST["page"] - 1), $_REQUEST["elemperpage"]); $oNewsletters->setLimit($_REQUEST["elemperpage"] * ($_REQUEST["page"] - 1), $_REQUEST["elemperpage"]);
@ -169,17 +164,16 @@ $iMenu = 0;
// Store messages for repeated use (speeds performance, as i18n translation is only needed once) // Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array(); $aMsg = array();
$aMsg["DelTitle"] = i18n("Delete newsletter"); $aMsg["DelTitle"] = i18n("Delete newsletter", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter:<br>"); $aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter:<br>", "newsletter");
$aMsg["SendTestTitle"] = i18n("Send test newsletter"); $aMsg["SendTestTitle"] = i18n("Send test newsletter", "newsletter");
$aMsg["SendTestTitleOff"] = i18n("Send test newsletter (disabled, check newsletter sender e-mail address and handler article selection)"); $aMsg["SendTestTitleOff"] = i18n("Send test newsletter (disabled, check newsletter sender e-mail address and handler article selection)", "newsletter");
$aMsg["AddJobTitle"] = i18n("Add newsletter dispatch job"); $aMsg["AddJobTitle"] = i18n("Add newsletter dispatch job", "newsletter");
$aMsg["AddJobTitleOff"] = i18n("Add newsletter dispatch job (disabled, check newsletter sender e-mail address and handler article selection)"); $aMsg["AddJobTitleOff"] = i18n("Add newsletter dispatch job (disabled, check newsletter sender e-mail address and handler article selection)", "newsletter");
$aMsg["CopyTitle"] = i18n("Duplicate newsletter"); $aMsg["CopyTitle"] = i18n("Duplicate newsletter", "newsletter");
while ($oNewsletter = $oNewsletters->next()) while ($oNewsletter = $oNewsletters->next()) {
{
$idnewsletter = $oNewsletter->get("idnews"); $idnewsletter = $oNewsletter->get("idnews");
$iMenu++; $iMenu++;
@ -198,58 +192,52 @@ while ($oNewsletter = $oNewsletters->next())
if ($perm->have_perm_area_action($area, "news_add_job") || if ($perm->have_perm_area_action($area, "news_add_job") ||
$perm->have_perm_area_action($area, "news_create") || $perm->have_perm_area_action($area, "news_create") ||
$perm->have_perm_area_action($area, "news_save")) $perm->have_perm_area_action($area, "news_save")) {
{
// Rights: If you are able to add a job, you should be able to test it // Rights: If you are able to add a job, you should be able to test it
// If you are able to add or change a newsletter, you should be able to test it // If you are able to add or change a newsletter, you should be able to test it
// Usability: If no e-mail has been specified, you can't send a test newsletter // Usability: If no e-mail has been specified, you can't send a test newsletter
if (isValidMail($oNewsletter->get("newsfrom")) && $lIDCatArt > 0) { if (isValidMail($oNewsletter->get("newsfrom")) && $lIDCatArt > 0) {
$sLnkSendTest = '<a title="'.$aMsg["SendTestTitle"].'" href="javascript://" onclick="showSendTestMsg('.$idnewsletter.')"><img src="'.$cfg['path']['images'].'newsletter_sendtest_16.gif" border="0" title="'.$aMsg["SendTestTitle"].'" alt="'.$aMsg["SendTestTitle"].'" /></a>'; $sLnkSendTest = '<a title="' . $aMsg["SendTestTitle"] . '" href="javascript://" onclick="showSendTestMsg(' . $idnewsletter . ')"><img src="' . $cfg['path']['images'] . 'newsletter_sendtest_16.gif" border="0" title="' . $aMsg["SendTestTitle"] . '" alt="' . $aMsg["SendTestTitle"] . '" /></a>';
} else { } else {
$sLnkSendTest = '<img src="'.$cfg['path']['images'].'newsletter_sendtest_16_off.gif" border="0" title="'.$aMsg["SendTestTitleOff"].'" alt="'.$aMsg["SendTestTitleOff"].'" />'; $sLnkSendTest = '<img src="' . $cfg['path']['images'] . 'newsletter_sendtest_16_off.gif" border="0" title="' . $aMsg["SendTestTitleOff"] . '" alt="' . $aMsg["SendTestTitleOff"] . '" />';
} }
$oMenu->setActions($iMenu, 'test', $sLnkSendTest); $oMenu->setActions($iMenu, 'test', $sLnkSendTest);
} }
if ($perm->have_perm_area_action($area, "news_add_job")) if ($perm->have_perm_area_action($area, "news_add_job")) {
{ if (isValidMail($oNewsletter->get("newsfrom")) && $lIDCatArt > 0) {
if (isValidMail($oNewsletter->get("newsfrom")) && $lIDCatArt > 0)
{
$oLnkAddJob = new Link; $oLnkAddJob = new Link;
$oLnkAddJob->setMultiLink("news","","news","news_add_job"); $oLnkAddJob->setMultiLink("news", "", "news", "news_add_job");
$oLnkAddJob->setCustom("idnewsletter", $idnewsletter); $oLnkAddJob->setCustom("idnewsletter", $idnewsletter);
$oLnkAddJob->setAlt($aMsg["AddJobTitle"]); $oLnkAddJob->setAlt($aMsg["AddJobTitle"]);
$oLnkAddJob->setContent('<img src="'.$cfg['path']['images'].'newsletter_dispatch_16.gif" border="0" title="'.$aMsg["AddJobTitle"].'" alt="'.$aMsg["AddJobTitle"].'">'); $oLnkAddJob->setContent('<img src="' . $cfg['path']['images'] . 'newsletter_dispatch_16.gif" border="0" title="' . $aMsg["AddJobTitle"] . '" alt="' . $aMsg["AddJobTitle"] . '">');
$sLnkAddJob = $oLnkAddJob->render(); $sLnkAddJob = $oLnkAddJob->render();
} else { } else {
$sLnkAddJob = '<img src="'.$cfg['path']['images'].'newsletter_dispatch_16_off.gif" border="0" title="'.$aMsg["AddJobTitleOff"].'" alt="'.$aMsg["AddJobTitleOff"].'" />'; $sLnkAddJob = '<img src="' . $cfg['path']['images'] . 'newsletter_dispatch_16_off.gif" border="0" title="' . $aMsg["AddJobTitleOff"] . '" alt="' . $aMsg["AddJobTitleOff"] . '" />';
} }
$oMenu->setActions($iMenu, 'dispatch', $sLnkAddJob); $oMenu->setActions($iMenu, 'dispatch', $sLnkAddJob);
} }
if ($perm->have_perm_area_action($area, "news_create")) if ($perm->have_perm_area_action($area, "news_create")) {
{
$oLnkCopy = new Link; $oLnkCopy = new Link;
$oLnkCopy->setMultiLink("news", "", "news", "news_duplicate"); $oLnkCopy->setMultiLink("news", "", "news", "news_duplicate");
$oLnkCopy->setCustom("idnewsletter", $idnewsletter); $oLnkCopy->setCustom("idnewsletter", $idnewsletter);
$oLnkCopy->setAlt($aMsg["CopyTitle"]); $oLnkCopy->setAlt($aMsg["CopyTitle"]);
$oLnkCopy->setContent('<img src="'.$cfg['path']['images'].'but_copy.gif" border="0" title="'.$aMsg["CopyTitle"].'" alt="'.$aMsg["CopyTitle"].'">'); $oLnkCopy->setContent('<img src="' . $cfg['path']['images'] . 'but_copy.gif" border="0" title="' . $aMsg["CopyTitle"] . '" alt="' . $aMsg["CopyTitle"] . '">');
$oMenu->setActions($iMenu, 'copy', $oLnkCopy->render()); $oMenu->setActions($iMenu, 'copy', $oLnkCopy->render());
} }
if ($perm->have_perm_area_action($area, "news_delete")) if ($perm->have_perm_area_action($area, "news_delete")) {
{ $sDelete = '<a title="' . $aMsg["DelTitle"] . '" href="javascript://" onclick="showDelMsg(' . $idnewsletter . ',\'' . addslashes($sName) . '\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $aMsg["DelTitle"] . '" alt="' . $aMsg["DelTitle"] . '"></a>';
$sDelete = '<a title="'.$aMsg["DelTitle"].'" href="javascript://" onclick="showDelMsg('.$idnewsletter.',\''.addslashes($sName).'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$aMsg["DelTitle"].'" alt="'.$aMsg["DelTitle"].'"></a>';
$oMenu->setActions($iMenu, 'delete', $sDelete); $oMenu->setActions($iMenu, 'delete', $sDelete);
} }
} }
// Check destination for sending test newsletter // Check destination for sending test newsletter
if ($_REQUEST["selTestDestination"] > 0 && $perm->have_perm_area_action($area, "news_send_test")) if ($_REQUEST["selTestDestination"] > 0 && $perm->have_perm_area_action($area, "news_send_test")) {
{
$oRcpGroups = new RecipientGroupCollection; $oRcpGroups = new RecipientGroupCollection;
$oRcpGroups->setWhere("idclient", $client); $oRcpGroups->setWhere("idclient", $client);
$oRcpGroups->setWhere("idlang", $lang); $oRcpGroups->setWhere("idlang", $lang);
@ -257,26 +245,26 @@ if ($_REQUEST["selTestDestination"] > 0 && $perm->have_perm_area_action($area, "
$oRcpGroups->query(); $oRcpGroups->query();
if ($oRcpGroup = $oRcpGroups->next()) { if ($oRcpGroup = $oRcpGroups->next()) {
$sSendTestTarget = sprintf(i18n("Recipient group: %s"), $oRcpGroup->get("groupname")); $sSendTestTarget = sprintf(i18n("Recipient group: %s", "newsletter"), $oRcpGroup->get("groupname"));
} }
unset ($oRcpGroups); unset($oRcpGroups);
} }
$aMsg["SendTestDescr"] = sprintf(i18n("Do you really want to send the newsletter to:<br><strong>%s</strong>"), $sSendTestTarget); $aMsg["SendTestDescr"] = sprintf(i18n("Do you really want to send the newsletter to:<br><strong>%s</strong>", "newsletter"), $sSendTestTarget);
$sExecScript = ' $sExecScript = '
<script type="text/javascript"> <script type="text/javascript">
var sid = "'.$sess->id.'"; var sid = "' . $sess->id . '";
// Create messageBox instance // Create messageBox instance
box = new messageBox("", "", "", 0, 0); box = new messageBox("", "", "", 0, 0);
function showSendTestMsg(lngId) { function showSendTestMsg(lngId) {
box.confirm("'.$aMsg["SendTestTitle"].'", "'.$aMsg["SendTestDescr"].'", "sendTestNewsletter(\'" + lngId + "\')"); box.confirm("' . $aMsg["SendTestTitle"] . '", "' . $aMsg["SendTestDescr"] . '", "sendTestNewsletter(\'" + lngId + "\')");
} }
function showDelMsg(lngId, strElement) { function showDelMsg(lngId, strElement) {
box.confirm("'.$aMsg["DelTitle"].'", "'.$aMsg["DelDescr"].'<b>" + strElement + "</b>", "deleteNewsletter(\'" + lngId + "\')"); box.confirm("' . $aMsg["DelTitle"] . '", "' . $aMsg["DelDescr"] . '<b>" + strElement + "</b>", "deleteNewsletter(\'" + lngId + "\')");
} }
// //
@ -331,7 +319,7 @@ $sExecScript = '
$oPage->setMargin(0); $oPage->setMargin(0);
// Messagebox JS has to be included before ExecScript! // Messagebox JS has to be included before ExecScript!
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>'); $oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>');
$oPage->addScript('exec', $sExecScript); $oPage->addScript('exec', $sExecScript);
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>'); $oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
@ -366,7 +354,7 @@ $oPage->addScript('setpager', '<script type="text/javascript" src="scripts/setPa
$sRefreshPager = ' $sRefreshPager = '
<script type="text/javascript"> <script type="text/javascript">
var sNavigation = \''.$sPagerContent.'\'; var sNavigation = \'' . $sPagerContent . '\';
// Activate time to refresh pager folding row in left top // Activate time to refresh pager folding row in left top
var oTimer = window.setInterval("fncSetPager(\'' . $sPagerId . '\',\'' . $_REQUEST["page"] . '\')", 200); var oTimer = window.setInterval("fncSetPager(\'' . $sPagerId . '\',\'' . $_REQUEST["page"] . '\')", 200);
@ -376,5 +364,4 @@ $oPage->addScript('refreshpager', $sRefreshPager);
$oPage->setContent($oMenu->render(false)); $oPage->setContent($oMenu->render(false));
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -37,7 +37,7 @@ if (!defined('CON_FRAMEWORK')) {
if (isset($_GET['idnewsletter'])) if (isset($_GET['idnewsletter']))
{ {
# Set template data # Set template data
$sCaption = i18n("Edit"); $sCaption = i18n("Edit", "newsletter");
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt); $tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt);
$tpl->set("d", "CLASS", ''); $tpl->set("d", "CLASS", '');
@ -46,7 +46,7 @@ if (isset($_GET['idnewsletter']))
$tpl->next(); $tpl->next();
# Set template data # Set template data
$sCaption = i18n("Edit Message"); $sCaption = i18n("Edit Message", "newsletter");
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt); $tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt);
$tpl->set("d", "CLASS", ''); $tpl->set("d", "CLASS", '');

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,37 +29,35 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
if (isset($_GET['idrecipientgroup']) && (int)$_GET['idrecipientgroup'] > 0) if (isset($_GET['idrecipientgroup']) && (int) $_GET['idrecipientgroup'] > 0) {
{ $caption = i18n("Overview", "newsletter");
$caption = i18n("Overview");
$tmp_area = "foo2"; $tmp_area = "foo2";
# Set template data # Set template data
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt); $tpl->set("d", "ID", 'c_' . $tpl->dyn_cnt);
$tpl->set("d", "CLASS", ''); $tpl->set("d", "CLASS", '');
$tpl->set("d", "OPTIONS", ''); $tpl->set("d", "OPTIONS", '');
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="'.$sess->url("main.php?area=$area&frame=4&idrecipientgroup=$idrecipientgroup").'">'.$caption.'</a>'); $tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="' . $sess->url("main.php?area=$area&frame=4&idrecipientgroup=$idrecipientgroup") . '">' . $caption . '</a>');
$tpl->next(); $tpl->next();
if (is_array($cfg['plugins']['recipientslogic'])) { if (is_array($cfg['plugins']['recipientslogic'])) {
foreach ($cfg['plugins']['recipientslogic'] as $plugin) { foreach ($cfg['plugins']['recipientslogic'] as $plugin) {
cInclude("plugins", "recipientslogic/$plugin/".$plugin.".php"); cInclude("plugins", "recipientslogic/$plugin/" . $plugin . ".php");
$className = "recipientslogic_".$plugin; $className = "recipientslogic_" . $plugin;
$class = new $className; $class = new $className;
$caption = $class->getFriendlyName(); $caption = $class->getFriendlyName();
$tmp_area = "foo2"; $tmp_area = "foo2";
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt); $tpl->set("d", "ID", 'c_' . $tpl->dyn_cnt);
$tpl->set("d", "CLASS", ''); $tpl->set("d", "CLASS", '');
$tpl->set("d", "OPTIONS", ''); $tpl->set("d", "OPTIONS", '');
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="'.$sess->url("main.php?area=recipientgroup_rights&frame=4&useplugin=$plugin&idrecipientgroup=$idrecipientgroup").'">'.$caption.'</a>'); $tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="' . $sess->url("main.php?area=recipientgroup_rights&frame=4&useplugin=$plugin&idrecipientgroup=$idrecipientgroup") . '">' . $caption . '</a>');
$tpl->next(); $tpl->next();
} }
} }
@ -68,7 +67,6 @@ if (isset($_GET['idrecipientgroup']) && (int)$_GET['idrecipientgroup'] > 0)
# Generate the third navigation layer # Generate the third navigation layer
$tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]); $tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]);
} else { } else {
include ($cfg["path"]["contenido"].$cfg["path"]["templates"] . $cfg["templates"]["right_top_blank"]); include ($cfg["path"]["contenido"] . $cfg["path"]["templates"] . $cfg["templates"]["right_top_blank"]);
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -40,21 +40,20 @@ $oRGroupMembers = new RecipientGroupMemberCollection;
$oRGroup = new RecipientGroup; $oRGroup = new RecipientGroup;
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail"), "type" => "base,sort,search"); $aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail", "newsletter"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed"), "type" => "base"); $aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed", "newsletter"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated"), "type" => "base"); $aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated", "newsletter"), "type" => "base");
if ($action == "recipientgroup_create" && $perm->have_perm_area_action($area, $action)) if ($action == "recipientgroup_create" && $perm->have_perm_area_action($area, $action)) {
{ $oRGroup = $oRGroups->create(" " . i18n("-- new group --", "newsletter"));
$oRGroup = $oRGroups->create(" ".i18n("-- new group --"));
$_REQUEST["idrecipientgroup"] = $oRGroup->get("idnewsgroup"); $_REQUEST["idrecipientgroup"] = $oRGroup->get("idnewsgroup");
$oPage->setReload(); $oPage->setReload();
$sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\''.$_REQUEST["idrecipientgroup"].'\', \'add\')</script>'; $sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\'' . $_REQUEST["idrecipientgroup"] . '\', \'add\')</script>';
$oPage->addScript('refreshlefttop', $sRefreshLeftTopScript); $oPage->addScript('refreshlefttop', $sRefreshLeftTopScript);
} elseif ($action == "recipientgroup_delete" && $perm->have_perm_area_action($area, $action)) { } elseif ($action == "recipientgroup_delete" && $perm->have_perm_area_action($area, $action)) {
$oRGroups->delete($_REQUEST["idrecipientgroup"]); $oRGroups->delete($_REQUEST["idrecipientgroup"]);
$sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\''.$_REQUEST["idrecipientgroup"].'\', \'remove\')</script>'; $sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\'' . $_REQUEST["idrecipientgroup"] . '\', \'remove\')</script>';
$oPage->addScript('refreshlefttop', $sRefreshLeftTopScript); $oPage->addScript('refreshlefttop', $sRefreshLeftTopScript);
$_REQUEST["idrecipientgroup"] = 0; $_REQUEST["idrecipientgroup"] = 0;
@ -64,17 +63,14 @@ if ($action == "recipientgroup_create" && $perm->have_perm_area_action($area, $a
$oRGroup->loadByPrimaryKey($_REQUEST["idrecipientgroup"]); $oRGroup->loadByPrimaryKey($_REQUEST["idrecipientgroup"]);
} }
if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGroup->get("idlang") == $lang) if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGroup->get("idlang") == $lang) {
{ if ($action == "recipientgroup_save_group" && $perm->have_perm_area_action($area, $action)) {
if ($action == "recipientgroup_save_group" && $perm->have_perm_area_action($area, $action))
{
// Saving changes // Saving changes
$aMessages = array(); $aMessages = array();
$bReload = false; $bReload = false;
$sGroupName = stripslashes($_REQUEST["groupname"]); $sGroupName = stripslashes($_REQUEST["groupname"]);
if ($oRGroup->get("groupname") != $sGroupName) if ($oRGroup->get("groupname") != $sGroupName) {
{
$oRGroups->resetQuery(); $oRGroups->resetQuery();
$oRGroups->setWhere("groupname", $sGroupName); $oRGroups->setWhere("groupname", $sGroupName);
$oRGroups->setWhere("idclient", $client); $oRGroups->setWhere("idclient", $client);
@ -83,7 +79,7 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oRGroups->query(); $oRGroups->query();
if ($oRGroups->next()) { if ($oRGroups->next()) {
$aMessages[] = i18n("Could not set new group name: Group already exists"); $aMessages[] = i18n("Could not set new group name: Group already exists", "newsletter");
} else { } else {
$bReload = true; $bReload = true;
@ -91,18 +87,15 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
} }
} }
if (count($_REQUEST["adduser"]) > 0) if (count($_REQUEST["adduser"]) > 0) {
{ foreach ($_REQUEST["adduser"] as $iRcpID) {
foreach ($_REQUEST["adduser"] as $iRcpID)
{
if (is_numeric($iRcpID)) { if (is_numeric($iRcpID)) {
$oRGroupMembers->create($_REQUEST["idrecipientgroup"], $iRcpID); $oRGroupMembers->create($_REQUEST["idrecipientgroup"], $iRcpID);
} }
} }
} }
if ($oRGroup->get("defaultgroup") != (int)$_REQUEST["defaultgroup"]) if ($oRGroup->get("defaultgroup") != (int) $_REQUEST["defaultgroup"]) {
{
$bReload = true; $bReload = true;
$oRGroup->set("defaultgroup", $_REQUEST["defaultgroup"]); $oRGroup->set("defaultgroup", $_REQUEST["defaultgroup"]);
} }
@ -115,10 +108,8 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
// Removing users from group (if specified) // Removing users from group (if specified)
//print_r ($_REQUEST["deluser"]); //print_r ($_REQUEST["deluser"]);
if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete") && is_array($_REQUEST["deluser"])) if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete") && is_array($_REQUEST["deluser"])) {
{ foreach ($_REQUEST["deluser"] as $iRcpID) {
foreach ($_REQUEST["deluser"] as $iRcpID)
{
if (is_numeric($iRcpID)) { if (is_numeric($iRcpID)) {
echo "yo: " . $iRcpID; echo "yo: " . $iRcpID;
$oRGroupMembers->remove($_REQUEST["idrecipientgroup"], $iRcpID); $oRGroupMembers->remove($_REQUEST["idrecipientgroup"], $iRcpID);
@ -126,8 +117,8 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
} }
} }
$sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\''.$_REQUEST["idrecipientgroup"].'\', \'remove\'); $sRefreshLeftTopScript = '<script type="text/javascript">top.content.left.left_top.refreshGroupOption(\'' . $_REQUEST["idrecipientgroup"] . '\', \'remove\');
top.content.left.left_top.refreshGroupOption(\''.$_REQUEST["idrecipientgroup"].'\', \'add\', \''.$sGroupName.'\');</script>'; top.content.left.left_top.refreshGroupOption(\'' . $_REQUEST["idrecipientgroup"] . '\', \'add\', \'' . $sGroupName . '\');</script>';
$oPage->addScript('refreshlefttop', $sRefreshLeftTopScript); $oPage->addScript('refreshlefttop', $sRefreshLeftTopScript);
} }
@ -138,27 +129,27 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
// Set default values // Set default values
$oUser = new cApiUser($auth->auth["uid"]); $oUser = new cApiUser($auth->auth["uid"]);
if (!isset($_REQUEST["member_elemperpage"]) || !is_numeric($_REQUEST["member_elemperpage"]) || $_REQUEST["member_elemperpage"] < 0) { if (!isset($_REQUEST["member_elemperpage"]) || !is_numeric($_REQUEST["member_elemperpage"]) || $_REQUEST["member_elemperpage"] < 0) {
$_REQUEST["member_elemperpage"] = $oUser->getProperty("itemsperpage", $area."_edit_member"); $_REQUEST["member_elemperpage"] = $oUser->getProperty("itemsperpage", $area . "_edit_member");
} }
if (!is_numeric($_REQUEST["member_elemperpage"])) { if (!is_numeric($_REQUEST["member_elemperpage"])) {
$_REQUEST["member_elemperpage"] = 25; $_REQUEST["member_elemperpage"] = 25;
} }
if ($_REQUEST["member_elemperpage"] > 0) { if ($_REQUEST["member_elemperpage"] > 0) {
// -- All -- will not be stored, as it may be impossible to change this back to something more useful // -- All -- will not be stored, as it may be impossible to change this back to something more useful
$oUser->setProperty("itemsperpage", $area."_edit_member", $_REQUEST["member_elemperpage"]); $oUser->setProperty("itemsperpage", $area . "_edit_member", $_REQUEST["member_elemperpage"]);
} }
if (!isset($_REQUEST["outsider_elemperpage"]) || !is_numeric($_REQUEST["outsider_elemperpage"]) || $_REQUEST["outsider_elemperpage"] < 0) { if (!isset($_REQUEST["outsider_elemperpage"]) || !is_numeric($_REQUEST["outsider_elemperpage"]) || $_REQUEST["outsider_elemperpage"] < 0) {
$_REQUEST["outsider_elemperpage"] = $oUser->getProperty("itemsperpage", $area."_edit_outsider"); $_REQUEST["outsider_elemperpage"] = $oUser->getProperty("itemsperpage", $area . "_edit_outsider");
} }
if (!is_numeric($_REQUEST["outsider_elemperpage"])) { if (!is_numeric($_REQUEST["outsider_elemperpage"])) {
$_REQUEST["outsider_elemperpage"] = 25; $_REQUEST["outsider_elemperpage"] = 25;
} }
if ($_REQUEST["outsider_elemperpage"] > 0) { if ($_REQUEST["outsider_elemperpage"] > 0) {
// -- All -- will not be stored, as it may be impossible to change this back to something more useful // -- All -- will not be stored, as it may be impossible to change this back to something more useful
$oUser->setProperty("itemsperpage", $area."_edit_outsider", $_REQUEST["outsider_elemperpage"]); $oUser->setProperty("itemsperpage", $area . "_edit_outsider", $_REQUEST["outsider_elemperpage"]);
} }
unset ($oUser); unset($oUser);
if (!isset($_REQUEST["member_page"]) || !is_numeric($_REQUEST["member_page"]) || $_REQUEST["member_page"] <= 0 || $_REQUEST["member_elemperpage"] == 0) { if (!isset($_REQUEST["member_page"]) || !is_numeric($_REQUEST["member_page"]) || $_REQUEST["member_page"] <= 0 || $_REQUEST["member_elemperpage"] == 0) {
$_REQUEST["member_page"] = 1; $_REQUEST["member_page"] = 1;
@ -181,20 +172,20 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oForm->setVar("idrecipientgroup", $_REQUEST["idrecipientgroup"]); $oForm->setVar("idrecipientgroup", $_REQUEST["idrecipientgroup"]);
$oForm->setSubmitJS("append_registered_parameters(this);"); $oForm->setSubmitJS("append_registered_parameters(this);");
$oForm->addHeader(i18n("Edit group")); $oForm->addHeader(i18n("Edit group", "newsletter"));
$oTxtGroupName = new cHTMLTextbox("groupname", $oRGroup->get("groupname"),40); $oTxtGroupName = new cHTMLTextbox("groupname", $oRGroup->get("groupname"), 40);
$oForm->add(i18n("Group name"), $oTxtGroupName->render()); $oForm->add(i18n("Group name", "newsletter"), $oTxtGroupName->render());
$oCkbDefault = new cHTMLCheckbox("defaultgroup", "1"); $oCkbDefault = new cHTMLCheckbox("defaultgroup", "1");
$oCkbDefault->setChecked($oRGroup->get("defaultgroup")); $oCkbDefault->setChecked($oRGroup->get("defaultgroup"));
$oForm->add(i18n("Default group"), $oCkbDefault->toHTML(false)); $oForm->add(i18n("Default group", "newsletter"), $oCkbDefault->toHTML(false));
// Member list options folding row // Member list options folding row
$oMemberListOptionRow = new cFoldingRow("a91f5540-52db-11db-b0de-0800200c9a66",i18n("Member list options")); $oMemberListOptionRow = new cFoldingRow("a91f5540-52db-11db-b0de-0800200c9a66", i18n("Member list options", "newsletter"));
$oSelItemsPerPage = new cHTMLSelectElement("member_elemperpage"); $oSelItemsPerPage = new cHTMLSelectElement("member_elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($_REQUEST["member_elemperpage"]); $oSelItemsPerPage->setDefault($_REQUEST["member_elemperpage"]);
$oSelSortBy = new cHTMLSelectElement("member_sortby"); $oSelSortBy = new cHTMLSelectElement("member_sortby");
@ -210,13 +201,13 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oSelSortBy->setDefault($_REQUEST["member_sortby"]); $oSelSortBy->setDefault($_REQUEST["member_sortby"]);
$oSelSortOrder = new cHTMLSelectElement("member_sortorder"); $oSelSortOrder = new cHTMLSelectElement("member_sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending"))); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault($_REQUEST["member_sortorder"]); $oSelSortOrder->setDefault($_REQUEST["member_sortorder"]);
$oTxtFilter = new cHTMLTextbox("member_filter", $_REQUEST["member_filter"], 16); $oTxtFilter = new cHTMLTextbox("member_filter", $_REQUEST["member_filter"], 16);
$oSelSearchIn = new cHTMLSelectElement("member_searchin"); $oSelSearchIn = new cHTMLSelectElement("member_searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption); $oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) { foreach ($aFields as $sKey => $aData) {
@ -227,36 +218,36 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
} }
$oSelSearchIn->setDefault($_REQUEST["member_searchin"]); $oSelSearchIn->setDefault($_REQUEST["member_searchin"]);
$oSubmit = new cHTMLButton("submit", i18n("Apply")); $oSubmit = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$sContent = '<div style="border-bottom: 1px solid black; background: '.$cfg['color']['table_dark'].';">'.chr(10); $sContent = '<div style="border-bottom: 1px solid black; background: ' . $cfg['color']['table_dark'] . ';">' . chr(10);
$sContent .= ' <table>'.chr(10); $sContent .= ' <table>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Items / page").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Items / page", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelItemsPerPage->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort by").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Sort by", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelSortBy->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort order").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Sort order", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelSortOrder->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search for").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Search for", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'.chr(10); $sContent .= ' <td>' . $oTxtFilter->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search in").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Search in", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelSearchIn->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>&nbsp;</td>'.chr(10); $sContent .= ' <td>&nbsp;</td>' . chr(10);
$sContent .= ' <td>'.$oSubmit->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSubmit->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' </table>'.chr(10); $sContent .= ' </table>' . chr(10);
$sContent .= '</div>'.chr(10); $sContent .= '</div>' . chr(10);
$oMemberListOptionRow->setContentData($sContent); $oMemberListOptionRow->setContentData($sContent);
// Members // Members
@ -264,9 +255,9 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oAddedRecipientList->setWidth("100%"); $oAddedRecipientList->setWidth("100%");
$oAddedRecipientList->setBorder(1); $oAddedRecipientList->setBorder(1);
$oAddedRecipientList->setCell(0, 1, "<strong>".i18n("Name")."</strong>"); $oAddedRecipientList->setCell(0, 1, "<strong>" . i18n("Name", "newsletter") . "</strong>");
$oImgDel = new cHTMLImage("images/but_invert_selection.gif"); $oImgDel = new cHTMLImage("images/but_invert_selection.gif");
$sLnkDelIcon = '<a title="'.i18n("Check all").'" href="javascript://" onclick="fncCheckDel(\'deluser[]\');">'.$oImgDel->render().'</a>'; $sLnkDelIcon = '<a title="' . i18n("Check all", "newsletter") . '" href="javascript://" onclick="fncCheckDel(\'deluser[]\');">' . $oImgDel->render() . '</a>';
$oAddedRecipientList->setCell(0, 2, $sLnkDelIcon); $oAddedRecipientList->setCell(0, 2, $sLnkDelIcon);
$oAddedRecipientList->setCellAlignment(0, 2, "right"); $oAddedRecipientList->setCellAlignment(0, 2, "right");
@ -282,10 +273,8 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oInsiders->query(); $oInsiders->query();
$aInsiders = array(); $aInsiders = array();
if ($oInsiders->count() > 0) if ($oInsiders->count() > 0) {
{ while ($oInsider = $oInsiders->next()) {
while ($oInsider = $oInsiders->next())
{
$aInsiders[] = $oInsider->get($oInsider->primaryKey); $aInsiders[] = $oInsider->get($oInsider->primaryKey);
} }
} }
@ -295,12 +284,12 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
if ($_REQUEST["member_searchin"] == "--all--" || $_REQUEST["member_searchin"] == "") { if ($_REQUEST["member_searchin"] == "--all--" || $_REQUEST["member_searchin"] == "") {
foreach ($aFields as $sKey => $aData) { foreach ($aFields as $sKey => $aData) {
if (strpos($aData["type"], "search") !== false) { if (strpos($aData["type"], "search") !== false) {
$oInsiders->setWhereGroup("filter", "recipientcollection.".$aData["field"], $_REQUEST["member_filter"], "LIKE"); $oInsiders->setWhereGroup("filter", "recipientcollection." . $aData["field"], $_REQUEST["member_filter"], "LIKE");
} }
} }
$oInsiders->setInnerGroupCondition("filter", "OR"); $oInsiders->setInnerGroupCondition("filter", "OR");
} else { } else {
$oInsiders->setWhere("recipientcollection.".$_REQUEST["member_searchin"], $_REQUEST["member_filter"], "LIKE"); $oInsiders->setWhere("recipientcollection." . $_REQUEST["member_searchin"], $_REQUEST["member_filter"], "LIKE");
} }
} }
@ -315,11 +304,10 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
} }
// Get data // Get data
$sSortSQL = "recipientcollection.".$_REQUEST["member_sortby"]." ".$_REQUEST["member_sortorder"]; $sSortSQL = "recipientcollection." . $_REQUEST["member_sortby"] . " " . $_REQUEST["member_sortorder"];
if ($_REQUEST["member_sortby"] == "name") if ($_REQUEST["member_sortby"] == "name") {
{
// Name field may be empty, add email as sort criteria // Name field may be empty, add email as sort criteria
$sSortSQL .= ", email ".$_REQUEST["member_sortorder"]; $sSortSQL .= ", email " . $_REQUEST["member_sortorder"];
} }
$oInsiders->setOrder($sSortSQL); $oInsiders->setOrder($sSortSQL);
@ -327,14 +315,13 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$iItems = $oInsiders->count(); $iItems = $oInsiders->count();
if ($iItems == 0 && $_REQUEST["member_filter"] == "" && ($_REQUEST["member_elemperpage"] == 0 || $iMembers == 0)) { if ($iItems == 0 && $_REQUEST["member_filter"] == "" && ($_REQUEST["member_elemperpage"] == 0 || $iMembers == 0)) {
$oAddedRecipientList->setCell(1, 1, i18n("No recipients are added to this group yet")); $oAddedRecipientList->setCell(1, 1, i18n("No recipients are added to this group yet", "newsletter"));
$oAddedRecipientList->setCell(1, 2, '&nbsp;'); $oAddedRecipientList->setCell(1, 2, '&nbsp;');
} else if ($iItems == 0) { } else if ($iItems == 0) {
$oAddedRecipientList->setCell(1, 1, i18n("No recipients found")); $oAddedRecipientList->setCell(1, 1, i18n("No recipients found", "newsletter"));
$oAddedRecipientList->setCell(1, 2, '&nbsp;'); $oAddedRecipientList->setCell(1, 2, '&nbsp;');
} else { } else {
while ($oRcp = $oInsiders->next()) while ($oRcp = $oInsiders->next()) {
{
$iID = $oRcp->get("idnewsrcp"); $iID = $oRcp->get("idnewsrcp");
$sName = $oRcp->get("name"); $sName = $oRcp->get("name");
@ -342,10 +329,9 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
if (empty($sName)) { if (empty($sName)) {
$sName = $sEMail; $sName = $sEMail;
} }
$oAddedRecipientList->setCell($iID, 1, $sName." (".$sEMail.")"); $oAddedRecipientList->setCell($iID, 1, $sName . " (" . $sEMail . ")");
if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete")) if ($perm->have_perm_area_action($area, "recipientgroup_recipient_delete")) {
{
$oCkbDel = new cHTMLCheckbox("deluser[]", $iID); $oCkbDel = new cHTMLCheckbox("deluser[]", $iID);
$oAddedRecipientList->setCell($iID, 2, $oCkbDel->toHTML(false)); $oAddedRecipientList->setCell($iID, 2, $oCkbDel->toHTML(false));
} else { } else {
@ -375,23 +361,23 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oPagerLink->setCustom("contenido", $sess->id); $oPagerLink->setCustom("contenido", $sess->id);
$oMemberPager = new cObjectPager("d82a3ff0-52d9-11db-b0de-0800200c9a66", $iMembers, $_REQUEST["member_elemperpage"], $_REQUEST["member_page"], $oPagerLink, "member_page"); $oMemberPager = new cObjectPager("d82a3ff0-52d9-11db-b0de-0800200c9a66", $iMembers, $_REQUEST["member_elemperpage"], $_REQUEST["member_page"], $oPagerLink, "member_page");
$oMemberPager->setCaption(i18n("Member navigation")); $oMemberPager->setCaption(i18n("Member navigation", "newsletter"));
$oForm->add(i18n("Recipients in group"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">'. $oForm->add(i18n("Recipients in group", "newsletter"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">' .
$oMemberListOptionRow->render(). $oMemberListOptionRow->render() .
$oMemberPager->render(). $oMemberPager->render() .
'<tr><td>'.$oAddedRecipientList->render().'</td></tr></table>'); '<tr><td>' . $oAddedRecipientList->render() . '</td></tr></table>');
unset ($oInsiders); unset($oInsiders);
unset ($oMemberListOptionRow); unset($oMemberListOptionRow);
unset ($oMemberPager); unset($oMemberPager);
unset ($oAddedRecipientList); unset($oAddedRecipientList);
// Outsiders // Outsiders
// Outsider list options folding row // Outsider list options folding row
$oOutsiderListOptionRow = new cFoldingRow("ca633b00-52e9-11db-b0de-0800200c9a66",i18n("Outsider list options")); $oOutsiderListOptionRow = new cFoldingRow("ca633b00-52e9-11db-b0de-0800200c9a66", i18n("Outsider list options", "newsletter"));
$oSelItemsPerPage = new cHTMLSelectElement("outsider_elemperpage"); $oSelItemsPerPage = new cHTMLSelectElement("outsider_elemperpage");
$oSelItemsPerPage->autoFill(array(0 => i18n("-- All --"), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", "newsletter"), 25 => 25, 50 => 50, 75 => 75, 100 => 100));
$oSelItemsPerPage->setDefault($_REQUEST["outsider_elemperpage"]); $oSelItemsPerPage->setDefault($_REQUEST["outsider_elemperpage"]);
$oSelSortBy = new cHTMLSelectElement("outsider_sortby"); $oSelSortBy = new cHTMLSelectElement("outsider_sortby");
@ -407,13 +393,13 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oSelSortBy->setDefault($_REQUEST["outsider_sortby"]); $oSelSortBy->setDefault($_REQUEST["outsider_sortby"]);
$oSelSortOrder = new cHTMLSelectElement("outsider_sortorder"); $oSelSortOrder = new cHTMLSelectElement("outsider_sortorder");
$oSelSortOrder->autoFill(array("ASC" => i18n("Ascending"), "DESC" => i18n("Descending"))); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", "newsletter"), "DESC" => i18n("Descending", "newsletter")));
$oSelSortOrder->setDefault($_REQUEST["outsider_sortorder"]); $oSelSortOrder->setDefault($_REQUEST["outsider_sortorder"]);
$oTxtFilter = new cHTMLTextbox("outsider_filter", $_REQUEST["outsider_filter"], 16); $oTxtFilter = new cHTMLTextbox("outsider_filter", $_REQUEST["outsider_filter"], 16);
$oSelSearchIn = new cHTMLSelectElement("outsider_searchin"); $oSelSearchIn = new cHTMLSelectElement("outsider_searchin");
$oOption = new cHTMLOptionElement(i18n("-- All fields --"), "--all--"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", "newsletter"), "--all--");
$oSelSearchIn->addOptionElement("all", $oOption); $oSelSearchIn->addOptionElement("all", $oOption);
foreach ($aFields as $sKey => $aData) { foreach ($aFields as $sKey => $aData) {
@ -424,36 +410,36 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
} }
$oSelSearchIn->setDefault($_REQUEST["outsider_searchin"]); $oSelSearchIn->setDefault($_REQUEST["outsider_searchin"]);
$oSubmit = new cHTMLButton("submit", i18n("Apply")); $oSubmit = new cHTMLButton("submit", i18n("Apply", "newsletter"));
$sContent = '<div style="border-bottom: 1px solid black; background: '.$cfg['color']['table_dark'].';">'.chr(10); $sContent = '<div style="border-bottom: 1px solid black; background: ' . $cfg['color']['table_dark'] . ';">' . chr(10);
$sContent .= ' <table>'.chr(10); $sContent .= ' <table>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Items / page").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Items / page", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelItemsPerPage->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelItemsPerPage->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort by").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Sort by", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelSortBy->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelSortBy->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Sort order").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Sort order", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelSortOrder->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelSortOrder->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search for").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Search for", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oTxtFilter->render().'</td>'.chr(10); $sContent .= ' <td>' . $oTxtFilter->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>'. i18n("Search in").'</td>'.chr(10); $sContent .= ' <td>' . i18n("Search in", "newsletter") . '</td>' . chr(10);
$sContent .= ' <td>'.$oSelSearchIn->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSelSearchIn->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' <tr>'.chr(10); $sContent .= ' <tr>' . chr(10);
$sContent .= ' <td>&nbsp;</td>'.chr(10); $sContent .= ' <td>&nbsp;</td>' . chr(10);
$sContent .= ' <td>'.$oSubmit->render().'</td>'.chr(10); $sContent .= ' <td>' . $oSubmit->render() . '</td>' . chr(10);
$sContent .= ' </tr>'.chr(10); $sContent .= ' </tr>' . chr(10);
$sContent .= ' </table>'.chr(10); $sContent .= ' </table>' . chr(10);
$sContent .= '</div>'.chr(10); $sContent .= '</div>' . chr(10);
$oOutsiderListOptionRow->setContentData($sContent); $oOutsiderListOptionRow->setContentData($sContent);
// TODO: Try to enhance genericdb to get this working with the usual objects... // TODO: Try to enhance genericdb to get this working with the usual objects...
@ -463,11 +449,10 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
# TODO: Add mySQL server version switch # TODO: Add mySQL server version switch
#$sSQL = "idclient = '".$client."' AND idlang = '".$lang."' AND ". #$sSQL = "idclient = '".$client."' AND idlang = '".$lang."' AND ".
# "idnewsrcp NOT IN (SELECT idnewsrcp FROM ".$cfg["tab"]["news_groupmembers"]." WHERE idnewsgroup = '".$_REQUEST["idrecipientgroup"]."')"; # "idnewsrcp NOT IN (SELECT idnewsrcp FROM ".$cfg["tab"]["news_groupmembers"]." WHERE idnewsgroup = '".$_REQUEST["idrecipientgroup"]."')";
// TODO: This works with every mySQL version but may be problematic, if a group // TODO: This works with every mySQL version but may be problematic, if a group
// contains a lot of members (e.g. Oracle can't handle more than 1000 items in the brackets) // contains a lot of members (e.g. Oracle can't handle more than 1000 items in the brackets)
$sSQL = "idclient = '".$client."' AND idlang = '".$lang."' AND ". $sSQL = "idclient = '" . $client . "' AND idlang = '" . $lang . "' AND " .
"idnewsrcp NOT IN ('" . implode ("','", $aInsiders) . "')"; "idnewsrcp NOT IN ('" . implode("','", $aInsiders) . "')";
if ($_REQUEST["outsider_filter"] != "") { if ($_REQUEST["outsider_filter"] != "") {
$sSQLSearchIn = ""; $sSQLSearchIn = "";
@ -498,26 +483,24 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
} }
// Get data // Get data
$sSQLSort = " ORDER BY ".urlencode($_REQUEST["outsider_sortby"])." ".$_REQUEST["outsider_sortorder"]; $sSQLSort = " ORDER BY " . urlencode($_REQUEST["outsider_sortby"]) . " " . $_REQUEST["outsider_sortorder"];
if ($_REQUEST["outsider_sortby"] == "name") if ($_REQUEST["outsider_sortby"] == "name") {
{
// Name field may be empty, add email as sort criteria // Name field may be empty, add email as sort criteria
$sSQLSort .= ", email ".$_REQUEST["outsider_sortorder"]; $sSQLSort .= ", email " . $_REQUEST["outsider_sortorder"];
} }
$sSQL .= $sSQLSort . $sSQLLimit; $sSQL .= $sSQLSort . $sSQLLimit;
$oOutsiders->flexSelect("", "", $sSQL, ""); $oOutsiders->flexSelect("", "", $sSQL, "");
$aItems = array(); $aItems = array();
while ($oRecipient = $oOutsiders->next()) while ($oRecipient = $oOutsiders->next()) {
{
$sName = $oRecipient->get("name"); $sName = $oRecipient->get("name");
$sEMail = $oRecipient->get("email"); $sEMail = $oRecipient->get("email");
if (empty($sName)) { if (empty($sName)) {
$sName = $sEMail; $sName = $sEMail;
} }
$aItems[] = array($oRecipient->get("idnewsrcp"), $sName." (".$sEMail.")"); $aItems[] = array($oRecipient->get("idnewsrcp"), $sName . " (" . $sEMail . ")");
} }
$oSelUser = new cHTMLSelectElement("adduser[]"); $oSelUser = new cHTMLSelectElement("adduser[]");
@ -546,15 +529,15 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oPagerLink->setCustom("contenido", $sess->id); $oPagerLink->setCustom("contenido", $sess->id);
$oOutsiderPager = new cObjectPager("4d3a7330-52eb-11db-b0de-0800200c9a66", $iOutsiders, $_REQUEST["outsider_elemperpage"], $_REQUEST["outsider_page"], $oPagerLink, "outsider_page"); $oOutsiderPager = new cObjectPager("4d3a7330-52eb-11db-b0de-0800200c9a66", $iOutsiders, $_REQUEST["outsider_elemperpage"], $_REQUEST["outsider_page"], $oPagerLink, "outsider_page");
$oOutsiderPager->setCaption(i18n("Outsider navigation")); $oOutsiderPager->setCaption(i18n("Outsider navigation", "newsletter"));
$oForm->add(i18n("Add recipients"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">'. $oForm->add(i18n("Add recipients", "newsletter"), '<table border="0" cellspacing="0" cellpadding="0" width="100%">' .
$oOutsiderListOptionRow->render(). $oOutsiderListOptionRow->render() .
$oOutsiderPager->render(). $oOutsiderPager->render() .
'<tr><td>'.$oSelUser->render().'<br />'.i18n("Note: Hold &lt;Ctrl&gt; to<br>select multiple items.").'</td></tr></table>'); '<tr><td>' . $oSelUser->render() . '<br />' . i18n("Note: Hold &lt;Ctrl&gt; to<br>select multiple items.", "newsletter") . '</td></tr></table>');
unset ($oOutsiders); unset($oOutsiders);
unset ($oOutsiderListOptionRow); unset($oOutsiderListOptionRow);
unset ($oOutsiderPager); unset($oOutsiderPager);
$sDelMarkScript = ' <script type="text/javascript"> $sDelMarkScript = ' <script type="text/javascript">
/* Function to select all ckbDel boxes */ /* Function to select all ckbDel boxes */
@ -577,10 +560,9 @@ if ($oRGroup->virgin == false && $oRGroup->get("idclient") == $client && $oRGrou
$oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>'); $oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>');
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>'); $oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
$oPage->setContent($sNotis.$oForm->render(true)); $oPage->setContent($sNotis . $oForm->render(true));
} else { } else {
$oPage->setContent($sNotis.""); $oPage->setContent($sNotis . "");
} }
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -49,7 +49,7 @@ $oUser = new cApiUser($auth->auth["uid"]);
// sort: Element can be used to be sorted by // sort: Element can be used to be sorted by
// search: Element can be used to search in // search: Element can be used to search in
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "groupname", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "groupname", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
################################## ##################################
# Check external input # Check external input
@ -66,7 +66,7 @@ if ($_REQUEST["elemperpage"] > 0) {
// -- All -- will not be stored, as it may be impossible to change this back to something more useful // -- All -- will not be stored, as it may be impossible to change this back to something more useful
$oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]); $oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]);
} }
$_REQUEST["page"] = (int)$_REQUEST["page"]; $_REQUEST["page"] = (int) $_REQUEST["page"];
if ($_REQUEST["page"] <= 0 || $_REQUEST["elemperpage"] == 0) { if ($_REQUEST["page"] <= 0 || $_REQUEST["elemperpage"] == 0) {
$_REQUEST["page"] = 1; $_REQUEST["page"] = 1;
} }
@ -80,8 +80,8 @@ $_REQUEST["sortby"] = "groupname"; // Default sort by field, possible values se
$_REQUEST["searchin"] = "--all--"; $_REQUEST["searchin"] = "--all--";
// Free memory // Free memory
unset ($oUser); unset($oUser);
unset ($oClient); unset($oClient);
################################## ##################################
# Get data # Get data
@ -90,12 +90,9 @@ $oRcpGroups = new RecipientGroupCollection;
$oRcpGroups->setWhere("idclient", $client); $oRcpGroups->setWhere("idclient", $client);
$oRcpGroups->setWhere("idlang", $lang); $oRcpGroups->setWhere("idlang", $lang);
if ($_REQUEST["filter"] != "") if ($_REQUEST["filter"] != "") {
{ if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") {
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") foreach ($aFields as $sKey => $aData) {
{
foreach ($aFields as $sKey => $aData)
{
if (strpos($aData["type"], "search") !== false) { if (strpos($aData["type"], "search") !== false) {
$oRcpGroups->setWhereGroup("filter", $aData["field"], $_REQUEST["filter"], "LIKE"); $oRcpGroups->setWhereGroup("filter", $aData["field"], $_REQUEST["filter"], "LIKE");
} }
@ -106,14 +103,13 @@ if ($_REQUEST["filter"] != "")
} }
} }
if ($_REQUEST["elemperpage"] > 0) if ($_REQUEST["elemperpage"] > 0) {
{
// Getting item count without limit (for page function) - better idea anyone (performance)? // Getting item count without limit (for page function) - better idea anyone (performance)?
$oRcpGroups->query(); $oRcpGroups->query();
$iItemCount = $oRcpGroups->count(); $iItemCount = $oRcpGroups->count();
if ($_REQUEST["elemperpage"]*($_REQUEST["page"]) >= $iItemCount+$_REQUEST["elemperpage"] && $_REQUEST["page"] != 1) { if ($_REQUEST["elemperpage"] * ($_REQUEST["page"]) >= $iItemCount + $_REQUEST["elemperpage"] && $_REQUEST["page"] != 1) {
$_REQUEST["page"]--; $_REQUEST["page"] --;
} }
$oRcpGroups->setLimit($_REQUEST["elemperpage"] * ($_REQUEST["page"] - 1), $_REQUEST["elemperpage"]); $oRcpGroups->setLimit($_REQUEST["elemperpage"] * ($_REQUEST["page"] - 1), $_REQUEST["elemperpage"]);
@ -121,7 +117,7 @@ if ($_REQUEST["elemperpage"] > 0)
$iItemCount = 0; $iItemCount = 0;
} }
$oRcpGroups->setOrder("defaultgroup DESC, ".$_REQUEST["sortby"]." ".$_REQUEST["sortorder"]); $oRcpGroups->setOrder("defaultgroup DESC, " . $_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]);
$oRcpGroups->query(); $oRcpGroups->query();
// Output data // Output data
@ -130,11 +126,10 @@ $iMenu = 0;
// Store messages for repeated use (speeds performance, as i18n translation is only needed once) // Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array(); $aMsg = array();
$aMsg["DelTitle"] = i18n("Delete recipient group"); $aMsg["DelTitle"] = i18n("Delete recipient group", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter recipient group:<br>"); $aMsg["DelDescr"] = i18n("Do you really want to delete the following newsletter recipient group:<br>", "newsletter");
while ($oRcpGroup = $oRcpGroups->next()) while ($oRcpGroup = $oRcpGroups->next()) {
{
$iMenu++; $iMenu++;
$iIDGroup = $oRcpGroup->get("idnewsgroup"); $iIDGroup = $oRcpGroup->get("idnewsgroup");
@ -145,7 +140,7 @@ while ($oRcpGroup = $oRcpGroups->next())
// Create the link to show/edit the recipient group // Create the link to show/edit the recipient group
$oLnk = new cHTMLLink; $oLnk = new cHTMLLink;
$oLnk->setMultiLink("recipientgroups","","recipientgroups",""); $oLnk->setMultiLink("recipientgroups", "", "recipientgroups", "");
$oLnk->setCustom("idrecipientgroup", $iIDGroup); $oLnk->setCustom("idrecipientgroup", $iIDGroup);
#$oMenu->setImage($iMenu, $cfg["path"]["images"] . "groups.gif"); #$oMenu->setImage($iMenu, $cfg["path"]["images"] . "groups.gif");
@ -153,20 +148,20 @@ while ($oRcpGroup = $oRcpGroups->next())
$oMenu->setLink($iMenu, $oLnk); $oMenu->setLink($iMenu, $oLnk);
if ($perm->have_perm_area_action($area, recipientgroup_delete)) { if ($perm->have_perm_area_action($area, recipientgroup_delete)) {
$oMenu->setActions($iMenu, 'delete', '<a title="'.$aMsg["DelTitle"].'" href="javascript://" onclick="showDelMsg('.$iIDGroup.',\''.addslashes($sName).'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$aMsg["DelTitle"].'" alt="'.$aMsg["DelTitle"].'"></a>'); $oMenu->setActions($iMenu, 'delete', '<a title="' . $aMsg["DelTitle"] . '" href="javascript://" onclick="showDelMsg(' . $iIDGroup . ',\'' . addslashes($sName) . '\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $aMsg["DelTitle"] . '" alt="' . $aMsg["DelTitle"] . '"></a>');
} }
} }
$sExecScript = ' $sExecScript = '
<script type="text/javascript"> <script type="text/javascript">
// Session-ID // Session-ID
var sid = "'.$sess->id.'"; var sid = "' . $sess->id . '";
// Create messageBox instance // Create messageBox instance
box = new messageBox("", "", "", 0, 0); box = new messageBox("", "", "", 0, 0);
function showDelMsg(lngId, strElement) { function showDelMsg(lngId, strElement) {
box.confirm("'.$aMsg["DelTitle"].'", "'.$aMsg["DelDescr"].'<b>" + strElement + "</b>", "deleteRecipientGroup(\'" + lngId + "\')"); box.confirm("' . $aMsg["DelTitle"] . '", "' . $aMsg["DelDescr"] . '<b>" + strElement + "</b>", "deleteRecipientGroup(\'" + lngId + "\')");
} }
// Function for deleting recipient groups // Function for deleting recipient groups
@ -190,7 +185,7 @@ $sExecScript = '
</script>'; </script>';
$oPage->setMargin(0); $oPage->setMargin(0);
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>'); $oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>');
$oPage->addScript('delete', $sExecScript); $oPage->addScript('delete', $sExecScript);
//$oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>'); //$oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>');
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>'); $oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
@ -225,7 +220,7 @@ $oPage->addScript('setpager', '<script type="text/javascript" src="scripts/setPa
$sRefreshPager = ' $sRefreshPager = '
<script type="text/javascript"> <script type="text/javascript">
var sNavigation = \''.$sPagerContent.'\'; var sNavigation = \'' . $sPagerContent . '\';
// Activate time to refresh pager folding row in left top // Activate time to refresh pager folding row in left top
var oTimer = window.setInterval("fncSetPager(\'' . $sPagerId . '\',\'' . $_REQUEST["page"] . '\')", 200); var oTimer = window.setInterval("fncSetPager(\'' . $sPagerId . '\',\'' . $_REQUEST["page"] . '\')", 200);
@ -236,5 +231,4 @@ $oPage->addScript('refreshpager', $sRefreshPager);
//$oPage->setContent(array('<table border="0" cellspacing="0" cellpadding="0" width="100%">', '</table>', $oMenu->render(false))); //$oPage->setContent(array('<table border="0" cellspacing="0" cellpadding="0" width="100%">', '</table>', $oMenu->render(false)));
$oPage->setContent($oMenu->render(false)); $oPage->setContent($oMenu->render(false));
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -38,13 +38,13 @@ $oRecipients = new RecipientCollection;
if (is_array($cfg['plugins']['recipients'])) { if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $plugin) { foreach ($cfg['plugins']['recipients'] as $plugin) {
plugin_include("recipients", $plugin."/".$plugin.".php"); plugin_include("recipients", $plugin . "/" . $plugin . ".php");
} }
} }
// Note, that the object name has to be $recipient for plugins // Note, that the object name has to be $recipient for plugins
if ($action == "recipients_create" && $perm->have_perm_area_action($area, $action)) { if ($action == "recipients_create" && $perm->have_perm_area_action($area, $action)) {
$recipient = $oRecipients->create("mail@domain.tld"," ".i18n("-- new recipient --")); $recipient = $oRecipients->create("mail@domain.tld", " " . i18n("-- new recipient --", "newsletter"));
$oPage->setReload(); $oPage->setReload();
} elseif ($action == "recipients_delete" && $perm->have_perm_area_action($area, $action)) { } elseif ($action == "recipients_delete" && $perm->have_perm_area_action($area, $action)) {
$oRecipients->delete($idrecipient); $oRecipients->delete($idrecipient);
@ -59,9 +59,9 @@ if ($action == "recipients_create" && $perm->have_perm_area_action($area, $actio
$purgedrecipients = $oRecipients->purge($timeframe); $purgedrecipients = $oRecipients->purge($timeframe);
/* backslashdollar: There is a problem translating \$ - it is either not recognized or translated correctly (using poEdit) */ /* backslashdollar: There is a problem translating \$ - it is either not recognized or translated correctly (using poEdit) */
if ($purgedrecipients > 0) { if ($purgedrecipients > 0) {
$sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("%1backslashdollard recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.")),$purgedrecipients,$timeframe),0); $sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("%1backslashdollard recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.", "newsletter")), $purgedrecipients, $timeframe), 0);
} else { } else {
$sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("There are no recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.")), 0, $timeframe),0); $sNotis = $notification->messageBox("info", sprintf(str_replace("backslashdollar", "\$", i18n("There are no recipients, which hasn't been confirmed since more than %2backslashdollard days has been removed.", "newsletter")), 0, $timeframe), 0);
} }
$recipient = new Recipient; $recipient = new Recipient;
@ -77,15 +77,14 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$name = stripslashes($name); $name = stripslashes($name);
$email = stripslashes($email); $email = stripslashes($email);
$confirmed = (int)$confirmed; $confirmed = (int) $confirmed;
$deactivated = (int)$deactivated; $deactivated = (int) $deactivated;
$newstype = (int)$newstype; $newstype = (int) $newstype;
$recipient->set("name", $name); $recipient->set("name", $name);
if (!isValidMail($email)) if (!isValidMail($email)) {
{ $aMessages[] = i18n("Please specify a valid e-mail address", "newsletter");
$aMessages[] = i18n("Please specify a valid e-mail address");
} else { } else {
$email = strtolower($email); // e-mail always in lower case $email = strtolower($email); // e-mail always in lower case
if ($recipient->get("email") != $email) { if ($recipient->get("email") != $email) {
@ -97,7 +96,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oRecipients->query(); $oRecipients->query();
if ($oRecipients->next()) { if ($oRecipients->next()) {
$aMessages[] = i18n("Could not set new e-mail adress: Other recipient with same e-mail address already exists"); $aMessages[] = i18n("Could not set new e-mail adress: Other recipient with same e-mail address already exists", "newsletter");
} else { } else {
$recipient->set("email", $email); $recipient->set("email", $email);
} }
@ -116,8 +115,8 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
// Check out if there are any plugins // Check out if there are any plugins
if (is_array($cfg['plugins']['recipients'])) { if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $plugin) { foreach ($cfg['plugins']['recipients'] as $plugin) {
if (function_exists("recipients_".$plugin."_wantedVariables") && function_exists("recipients_".$plugin."_store")) { if (function_exists("recipients_" . $plugin . "_wantedVariables") && function_exists("recipients_" . $plugin . "_store")) {
$wantVariables = call_user_func("recipients_".$plugin."_wantedVariables"); $wantVariables = call_user_func("recipients_" . $plugin . "_wantedVariables");
if (is_array($wantVariables)) { if (is_array($wantVariables)) {
$varArray = array(); $varArray = array();
@ -126,7 +125,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$varArray[$value] = stripslashes($GLOBALS[$value]); $varArray[$value] = stripslashes($GLOBALS[$value]);
} }
} }
$store = call_user_func("recipients_".$plugin."_store", $varArray); $store = call_user_func("recipients_" . $plugin . "_store", $varArray);
} }
} }
} }
@ -155,7 +154,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oForm->setVar("action", "recipients_save"); $oForm->setVar("action", "recipients_save");
$oForm->setVar("idrecipient", $recipient->get("idnewsrcp")); $oForm->setVar("idrecipient", $recipient->get("idnewsrcp"));
$oForm->addHeader(i18n("Edit recipient")); $oForm->addHeader(i18n("Edit recipient", "newsletter"));
$oTxtName = new cHTMLTextbox("name", $recipient->get("name"), 40); $oTxtName = new cHTMLTextbox("name", $recipient->get("name"), 40);
$oTxtEMail = new cHTMLTextbox("email", $recipient->get("email"), 40); $oTxtEMail = new cHTMLTextbox("email", $recipient->get("email"), 40);
@ -165,27 +164,27 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oCkbDeactivated->setChecked($recipient->get("deactivated")); $oCkbDeactivated->setChecked($recipient->get("deactivated"));
$oSelNewsType = new cHTMLSelectElement("newstype"); $oSelNewsType = new cHTMLSelectElement("newstype");
$oOption = new cHTMLOptionElement(i18n("Text only"), "0"); $oOption = new cHTMLOptionElement(i18n("Text only", "newsletter"), "0");
$oSelNewsType->addOptionElement(0, $oOption); $oSelNewsType->addOptionElement(0, $oOption);
$oOption = new cHTMLOptionElement(i18n("HTML and text"), "1"); $oOption = new cHTMLOptionElement(i18n("HTML and text", "newsletter"), "1");
$oSelNewsType->addOptionElement(1, $oOption); $oSelNewsType->addOptionElement(1, $oOption);
$oSelNewsType->setDefault($recipient->get("news_type")); $oSelNewsType->setDefault($recipient->get("news_type"));
$oForm->add(i18n("Name"), $oTxtName->render()); $oForm->add(i18n("Name", "newsletter"), $oTxtName->render());
$oForm->add(i18n("E-Mail"), $oTxtEMail->render()); $oForm->add(i18n("E-Mail", "newsletter"), $oTxtEMail->render());
$oForm->add(i18n("Confirmed"), $oCkbConfirmed->toHTML(false) . " (" . $recipient->get("confirmeddate") . ")"); $oForm->add(i18n("Confirmed", "newsletter"), $oCkbConfirmed->toHTML(false) . " (" . $recipient->get("confirmeddate") . ")");
$oForm->add(i18n("Deactivated"), $oCkbDeactivated->toHTML(false)); $oForm->add(i18n("Deactivated", "newsletter"), $oCkbDeactivated->toHTML(false));
$oForm->add(i18n("Message type"), $oSelNewsType->render()); $oForm->add(i18n("Message type", "newsletter"), $oSelNewsType->render());
$aPluginOrder = trim_array(explode(",",getSystemProperty("plugin", "recipients-pluginorder"))); $aPluginOrder = trim_array(explode(",", getSystemProperty("plugin", "recipients-pluginorder")));
// Check out if there are any plugins // Check out if there are any plugins
if (is_array($aPluginOrder)) { if (is_array($aPluginOrder)) {
foreach ($aPluginOrder as $sPlugin) { foreach ($aPluginOrder as $sPlugin) {
if (function_exists("recipients_".$sPlugin."_getTitle") && if (function_exists("recipients_" . $sPlugin . "_getTitle") &&
function_exists("recipients_".$sPlugin."_display")) { function_exists("recipients_" . $sPlugin . "_display")) {
$aPluginTitle = call_user_func("recipients_".$sPlugin."_getTitle"); $aPluginTitle = call_user_func("recipients_" . $sPlugin . "_getTitle");
$aPluginDisplay = call_user_func("recipients_".$sPlugin."_display", $recipient); $aPluginDisplay = call_user_func("recipients_" . $sPlugin . "_display", $recipient);
if (is_array($aPluginTitle) && is_array($aPluginDisplay)) { if (is_array($aPluginTitle) && is_array($aPluginDisplay)) {
foreach ($aPluginTitle as $sKey => $sValue) { foreach ($aPluginTitle as $sKey => $sValue) {
@ -193,7 +192,7 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
} }
} else { } else {
if (is_array($aPluginTitle) || is_array($aPluginDisplay)) { if (is_array($aPluginTitle) || is_array($aPluginDisplay)) {
$oForm->add(i18n("WARNING"), sprintf(i18n("The plugin %s delivered an array for the displayed titles, but did not return an array for the contents."), $sPlugin)); $oForm->add(i18n("WARNING", "newsletter"), sprintf(i18n("The plugin %s delivered an array for the displayed titles, but did not return an array for the contents.", "newsletter"), $sPlugin));
} else { } else {
$oForm->add($aPluginTitle, $aPluginDisplay); $oForm->add($aPluginTitle, $aPluginDisplay);
} }
@ -212,19 +211,17 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
$oAssocGroups->setOrder("recipientgroupcollection.groupname"); $oAssocGroups->setOrder("recipientgroupcollection.groupname");
$oAssocGroups->query(); $oAssocGroups->query();
if ($oAssocGroups->count() == 0) if ($oAssocGroups->count() == 0) {
{ $oGroupList->setCell(0, 1, i18n("Recipient is not member of any group", "newsletter"));
$oGroupList->setCell(0, 1, i18n("Recipient is not member of any group"));
} else { } else {
// Headline // Headline
$oGroupList->setCell(0, 1, "<strong>".i18n("Groupname")."</strong>"); $oGroupList->setCell(0, 1, "<strong>" . i18n("Groupname", "newsletter") . "</strong>");
$oImgDel = new cHTMLImage("images/delete.gif"); $oImgDel = new cHTMLImage("images/delete.gif");
$oGroupList->setCell(0, 2, $oImgDel->render()); $oGroupList->setCell(0, 2, $oImgDel->render());
$oGroupList->setCellAlignment(0, 2, "right"); $oGroupList->setCellAlignment(0, 2, "right");
// Data // Data
while ($oAssocGroup = $oAssocGroups->next()) while ($oAssocGroup = $oAssocGroups->next()) {
{
$oGroup = $oAssocGroups->fetchObject("RecipientGroupCollection"); $oGroup = $oAssocGroups->fetchObject("RecipientGroupCollection");
$oCkbRemove = new cHTMLCheckbox("ckbRemove[]", $oAssocGroup->get("idnewsgroupmember")); $oCkbRemove = new cHTMLCheckbox("ckbRemove[]", $oAssocGroup->get("idnewsgroupmember"));
@ -235,10 +232,10 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
} }
} }
$oForm->add(i18n("Associated Groups"), $oGroupList->render()); $oForm->add(i18n("Associated Groups", "newsletter"), $oGroupList->render());
$oForm->add(i18n("Author"), $classuser->getUserName($recipient->get("author")) . " (". $recipient->get("created").")" ); $oForm->add(i18n("Author", "newsletter"), $classuser->getUserName($recipient->get("author")) . " (" . $recipient->get("created") . ")");
$oForm->add(i18n("Last modified by"), $classuser->getUserName($recipient->get("modifiedby")). " (". $recipient->get("lastmodified").")" ); $oForm->add(i18n("Last modified by", "newsletter"), $classuser->getUserName($recipient->get("modifiedby")) . " (" . $recipient->get("lastmodified") . ")");
$oPage->setContent($sNotis . $oForm->render(true)); $oPage->setContent($sNotis . $oForm->render(true));
} else { } else {
@ -246,5 +243,4 @@ if ($recipient->virgin == false && $recipient->get("idclient") == $client && $re
} }
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -38,7 +38,7 @@ $oRecipients = new RecipientCollection;
if (is_array($cfg['plugins']['recipients'])) { if (is_array($cfg['plugins']['recipients'])) {
foreach ($cfg['plugins']['recipients'] as $plugin) { foreach ($cfg['plugins']['recipients'] as $plugin) {
plugin_include("recipients", $plugin."/".$plugin.".php"); plugin_include("recipients", $plugin . "/" . $plugin . ".php");
} }
} }
@ -49,37 +49,37 @@ if ($_REQUEST["selDelimiter"] == "") {
$aFields = array(); $aFields = array();
$aFieldDetails = array(); $aFieldDetails = array();
$aFields["name"] = strtolower(i18n("Name")); $aFields["name"] = strtolower(i18n("Name", "newsletter"));
$aFieldDetails["name"]["fieldtype"] = "field"; // field, plugin or group $aFieldDetails["name"]["fieldtype"] = "field"; // field, plugin or group
$aFieldDetails["name"]["mandatory"] = false; // true or false $aFieldDetails["name"]["mandatory"] = false; // true or false
$aFieldDetails["name"]["type"] = "string"; // string, boolean or date $aFieldDetails["name"]["type"] = "string"; // string, boolean or date
$aFieldDetails["name"]["link"] = false; // plugin name for plugins, recipient group id for groups $aFieldDetails["name"]["link"] = false; // plugin name for plugins, recipient group id for groups
$aFieldDetails["name"]["col"] = -1; // Stores column index where this field has been found $aFieldDetails["name"]["col"] = -1; // Stores column index where this field has been found
$aFields["email"] = strtolower(i18n("Mail")); $aFields["email"] = strtolower(i18n("Mail", "newsletter"));
$aFieldDetails["email"]["fieldtype"] = "field"; $aFieldDetails["email"]["fieldtype"] = "field";
$aFieldDetails["email"]["mandatory"] = true; $aFieldDetails["email"]["mandatory"] = true;
$aFieldDetails["email"]["type"] = "string"; $aFieldDetails["email"]["type"] = "string";
$aFieldDetails["email"]["link"] = false; $aFieldDetails["email"]["link"] = false;
$aFieldDetails["email"]["col"] = -1; $aFieldDetails["email"]["col"] = -1;
$aFields["deactivated"] = strtolower(i18n("Deactivated")); $aFields["deactivated"] = strtolower(i18n("Deactivated", "newsletter"));
$aFieldDetails["deactivated"]["fieldtype"] = "field"; $aFieldDetails["deactivated"]["fieldtype"] = "field";
$aFieldDetails["deactivated"]["mandatory"] = false; $aFieldDetails["deactivated"]["mandatory"] = false;
$aFieldDetails["deactivated"]["type"] = "boolean"; $aFieldDetails["deactivated"]["type"] = "boolean";
$aFieldDetails["deactivated"]["link"] = false; $aFieldDetails["deactivated"]["link"] = false;
$aFieldDetails["deactivated"]["col"] = -1; $aFieldDetails["deactivated"]["col"] = -1;
$aFields["confirmed"] = strtolower(i18n("Confirmed")); $aFields["confirmed"] = strtolower(i18n("Confirmed", "newsletter"));
$aFieldDetails["confirmed"]["fieldtype"] = "field"; $aFieldDetails["confirmed"]["fieldtype"] = "field";
$aFieldDetails["confirmed"]["mandatory"] = false; $aFieldDetails["confirmed"]["mandatory"] = false;
$aFieldDetails["confirmed"]["type"] = "boolean"; $aFieldDetails["confirmed"]["type"] = "boolean";
$aFieldDetails["confirmed"]["link"] = false; $aFieldDetails["confirmed"]["link"] = false;
$aFieldDetails["confirmed"]["col"] = -1; $aFieldDetails["confirmed"]["col"] = -1;
$aFields["confirmeddate"] = strtolower(i18n("Confirmed Date")); $aFields["confirmeddate"] = strtolower(i18n("Confirmed Date", "newsletter"));
$aFieldDetails["confirmeddate"]["fieldtype"]= "field"; $aFieldDetails["confirmeddate"]["fieldtype"] = "field";
$aFieldDetails["confirmeddate"]["mandatory"]= false; $aFieldDetails["confirmeddate"]["mandatory"] = false;
$aFieldDetails["confirmeddate"]["type"] = "date"; $aFieldDetails["confirmeddate"]["type"] = "date";
$aFieldDetails["confirmeddate"]["link"] = false; $aFieldDetails["confirmeddate"]["link"] = false;
$aFieldDetails["confirmeddate"]["col"] = -1; $aFieldDetails["confirmeddate"]["col"] = -1;
$aFields["news_type"] = strtolower(i18n("Message type")); $aFields["news_type"] = strtolower(i18n("Message type", "newsletter"));
$aFieldDetails["news_type"]["fieldtype"] = "field"; $aFieldDetails["news_type"]["fieldtype"] = "field";
$aFieldDetails["news_type"]["mandatory"] = false; $aFieldDetails["news_type"]["mandatory"] = false;
$aFieldDetails["news_type"]["type"] = "boolean"; $aFieldDetails["news_type"]["type"] = "boolean";
@ -87,20 +87,16 @@ $aFieldDetails["news_type"]["link"] = false;
$aFieldDetails["news_type"]["col"] = -1; $aFieldDetails["news_type"]["col"] = -1;
// Check out if there are any plugins // Check out if there are any plugins
if (is_array($cfg['plugins']['recipients'])) if (is_array($cfg['plugins']['recipients'])) {
{ foreach ($cfg['plugins']['recipients'] as $sPlugin) {
foreach ($cfg['plugins']['recipients'] as $sPlugin) if (function_exists("recipients_" . $sPlugin . "_wantedVariables") && function_exists("recipients_" . $sPlugin . "_canonicalVariables")) {
{ $aPluginTitles = call_user_func("recipients_" . $sPlugin . "_canonicalVariables");
if (function_exists("recipients_".$sPlugin."_wantedVariables") && function_exists("recipients_".$sPlugin."_canonicalVariables")) $aPluginFields = call_user_func("recipients_" . $sPlugin . "_wantedVariables");
{ foreach ($aPluginFields as $sField) {
$aPluginTitles = call_user_func("recipients_".$sPlugin."_canonicalVariables");
$aPluginFields = call_user_func("recipients_".$sPlugin."_wantedVariables");
foreach ($aPluginFields as $sField)
{
//if ($_REQUEST["ckb".$sField]) { //if ($_REQUEST["ckb".$sField]) {
$aFields[$sField] = strtolower(str_replace(" ","", $aPluginTitles[$sField])); $aFields[$sField] = strtolower(str_replace(" ", "", $aPluginTitles[$sField]));
$aFieldDetails[$sField]["fieldtype"]= "plugin"; $aFieldDetails[$sField]["fieldtype"] = "plugin";
$aFieldDetails[$sField]["mandatory"]= false; $aFieldDetails[$sField]["mandatory"] = false;
$aFieldDetails[$sField]["type"] = "string"; $aFieldDetails[$sField]["type"] = "string";
$aFieldDetails[$sField]["link"] = $sPlugin; $aFieldDetails[$sField]["link"] = $sPlugin;
$aFieldDetails[$sField]["col"] = -1; $aFieldDetails[$sField]["col"] = -1;
@ -117,8 +113,7 @@ $oRcpGroups->setWhere("idlang", $lang);
$oRcpGroups->setOrder("groupname"); $oRcpGroups->setOrder("groupname");
$oRcpGroups->query(); $oRcpGroups->query();
while ($oRcpGroup = $oRcpGroups->next()) while ($oRcpGroup = $oRcpGroups->next()) {
{
$sField = "g" . $oRcpGroup->get($oRcpGroup->primaryKey); $sField = "g" . $oRcpGroup->get($oRcpGroup->primaryKey);
$sGroupName = $oRcpGroup->get("groupname"); $sGroupName = $oRcpGroup->get("groupname");
@ -132,9 +127,9 @@ while ($oRcpGroup = $oRcpGroups->next())
// Only PHP5! // Only PHP5!
//$sGroupName = str_replace(str_split(" \t\n\r\0\x0B;"), "", $oRcpGroup->get("groupname")); //$sGroupName = str_replace(str_split(" \t\n\r\0\x0B;"), "", $oRcpGroup->get("groupname"));
$aFields[$sField] = strtolower(clHtmlEntities(trim(i18n("Group") . "_" . $sGroupName))); $aFields[$sField] = strtolower(clHtmlEntities(trim(i18n("Group", "newsletter") . "_" . $sGroupName)));
$aFieldDetails[$sField]["fieldtype"]= "group"; $aFieldDetails[$sField]["fieldtype"] = "group";
$aFieldDetails[$sField]["mandatory"]= false; $aFieldDetails[$sField]["mandatory"] = false;
$aFieldDetails[$sField]["type"] = "string"; $aFieldDetails[$sField]["type"] = "string";
$aFieldDetails[$sField]["link"] = $oRcpGroup->get($oRcpGroup->primaryKey); $aFieldDetails[$sField]["link"] = $oRcpGroup->get($oRcpGroup->primaryKey);
$aFieldDetails[$sField]["col"] = -1; $aFieldDetails[$sField]["col"] = -1;
@ -144,8 +139,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
$_REQUEST["txtData"] = trim(stripslashes($_REQUEST["txtData"])); $_REQUEST["txtData"] = trim(stripslashes($_REQUEST["txtData"]));
if ($_REQUEST["txtData"]) { if ($_REQUEST["txtData"]) {
switch ($_REQUEST["selDelimiter"]) switch ($_REQUEST["selDelimiter"]) {
{
case "semicolon": case "semicolon":
$sDelimiter = ";"; $sDelimiter = ";";
break; break;
@ -166,7 +160,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
$aInvalidLines = array(); $aInvalidLines = array();
$oGroupMembers = new RecipientGroupMemberCollection; $oGroupMembers = new RecipientGroupMemberCollection;
foreach($aLines as $sLine) { foreach ($aLines as $sLine) {
$iRow++; $iRow++;
$aParts = explode($sDelimiter, trim($sLine)); $aParts = explode($sDelimiter, trim($sLine));
@ -177,7 +171,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
foreach ($aParts as $sHeader) { foreach ($aParts as $sHeader) {
$sKey = array_search(strtolower(clHtmlEntities(trim($sHeader))), $aFields); $sKey = array_search(strtolower(clHtmlEntities(trim($sHeader))), $aFields);
if ($sKey === false) { if ($sKey === false) {
$aMessage[] = sprintf(i18n("Given column header '%s' unknown, column ignored"), $sHeader); $aMessage[] = sprintf(i18n("Given column header '%s' unknown, column ignored", "newsletter"), $sHeader);
} else { } else {
$aFieldDetails[$sKey]["col"] = $iCol; $aFieldDetails[$sKey]["col"] = $iCol;
$iCol++; $iCol++;
@ -185,7 +179,7 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
} }
foreach ($aFieldDetails as $sKey => $aDetails) { foreach ($aFieldDetails as $sKey => $aDetails) {
if ($aDetails["mandatory"] && $aDetails["col"] == -1) { if ($aDetails["mandatory"] && $aDetails["col"] == -1) {
$aMessage[] = sprintf(i18n("Mandatory column '%s' wasn't found, import stopped"), $aDetails[$sKey]); $aMessage[] = sprintf(i18n("Mandatory column '%s' wasn't found, import stopped", "newsletter"), $aDetails[$sKey]);
$bStop = true; $bStop = true;
} }
} }
@ -205,47 +199,41 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
$sName = $sEMail; $sName = $sEMail;
} }
if ($sEMail == "") { if ($sEMail == "") {
$aMessage[] = sprintf(i18n("Item with empty mail address found, item ignored (name: %s, row: %s)"), $sName, $iRow); $aMessage[] = sprintf(i18n("Item with empty mail address found, item ignored (name: %s, row: %s)", "newsletter"), $sName, $iRow);
$aInvalidLines[] = $sLine; $aInvalidLines[] = $sLine;
$iInvalid++; $iInvalid++;
} else if (!isValidMail($sEMail)) { } else if (!isValidMail($sEMail)) {
$aMessage[] = sprintf(i18n("Mail address '%s' is invalid, item ignored (row: %s)"), $sEMail, $iRow); $aMessage[] = sprintf(i18n("Mail address '%s' is invalid, item ignored (row: %s)", "newsletter"), $sEMail, $iRow);
$aInvalidLines[] = $sLine; $aInvalidLines[] = $sLine;
$iInvalid++; $iInvalid++;
} else if ($oRecipients->emailExists($sEMail)) { } else if ($oRecipients->emailExists($sEMail)) {
$aMessage[] = sprintf(i18n("Recipient with mail address '%s' already exists, item skipped (row: %s)"), $sEMail, $iRow); $aMessage[] = sprintf(i18n("Recipient with mail address '%s' already exists, item skipped (row: %s)", "newsletter"), $sEMail, $iRow);
$aInvalidLines[] = $sLine; $aInvalidLines[] = $sLine;
$iDublettes++; $iDublettes++;
} else { } else {
unset ($sLine); unset($sLine);
// Must be $recipient for plugins // Must be $recipient for plugins
if ($recipient = $oRecipients->create($sEMail, $sName)) if ($recipient = $oRecipients->create($sEMail, $sName)) {
{
$iID = $recipient->get($recipient->primaryKey); $iID = $recipient->get($recipient->primaryKey);
$iAdded++; $iAdded++;
unset($aPluginValue); unset($aPluginValue);
$aPluginValue = array(); $aPluginValue = array();
foreach ($aFieldDetails as $sKey => $aDetails) foreach ($aFieldDetails as $sKey => $aDetails) {
{ if ($aDetails["col"] > -1) {
if ($aDetails["col"] > -1) switch ($aDetails["fieldtype"]) {
{
switch ($aDetails["fieldtype"])
{
case "field": case "field":
switch ($aDetails["type"]) switch ($aDetails["type"]) {
{
case "boolean": case "boolean":
$sValue = strtolower(trim($aParts[$aDetails["col"]])); $sValue = strtolower(trim($aParts[$aDetails["col"]]));
// html is only treated as "true", to get html messages for recipients // html is only treated as "true", to get html messages for recipients
// - quick and dirty... // - quick and dirty...
if ($sValue == "yes" || $sValue == i18n("yes") || $sValue == "true" || if ($sValue == "yes" || $sValue == i18n("yes", "newsletter") || $sValue == "true" ||
(is_numeric($sValue) && $sValue > 0) || (is_numeric($sValue) && $sValue > 0) ||
$sValue == "html") $sValue == "html") {
{
$recipient->set($sKey, 1); $recipient->set($sKey, 1);
if ($sKey == "confirmed") { if ($sKey == "confirmed") {
@ -271,7 +259,6 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
case "plugin": case "plugin":
// type may be mentioned here, also, but as plugins currently can't // type may be mentioned here, also, but as plugins currently can't
// specify the type, just treat everything as string // specify the type, just treat everything as string
// There may be plugins which store more than one value per plugin_store- // There may be plugins which store more than one value per plugin_store-
// function. As the plugin_store parameter is an array of values, collect // function. As the plugin_store parameter is an array of values, collect
// all values in an array for later storing... unfortunately, that means, // all values in an array for later storing... unfortunately, that means,
@ -282,9 +269,8 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
// Add recipient to group // Add recipient to group
$sValue = strtolower(trim($aParts[$aDetails["col"]])); $sValue = strtolower(trim($aParts[$aDetails["col"]]));
if ($sValue == "yes" || $sValue == i18n("yes") || if ($sValue == "yes" || $sValue == i18n("yes", "newsletter") ||
$sValue == "true" || (is_numeric($sValue) && $sValue > 0)) $sValue == "true" || (is_numeric($sValue) && $sValue > 0)) {
{
$oGroupMembers->create($aDetails["link"], $iID); $oGroupMembers->create($aDetails["link"], $iID);
} }
break; break;
@ -297,15 +283,13 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
// Store plugin data (to store plugin data, only, where the column has been found in the data // Store plugin data (to store plugin data, only, where the column has been found in the data
// should be faster than going through all plugins and store mostly empty arrays) // should be faster than going through all plugins and store mostly empty arrays)
$sCurrentPlugin = ""; $sCurrentPlugin = "";
foreach ($aFieldDetails as $sKey => $aDetails) foreach ($aFieldDetails as $sKey => $aDetails) {
{
if ($aDetails["col"] > -1 && if ($aDetails["col"] > -1 &&
$aDetails["fieldtype"] == "plugin" && $aDetails["fieldtype"] == "plugin" &&
$aDetails["link"] !== $sCurrentPlugin) $aDetails["link"] !== $sCurrentPlugin) {
{
$sCurrentPlugin = $aDetails["link"]; $sCurrentPlugin = $aDetails["link"];
call_user_func("recipients_".$sCurrentPlugin."_store", $aPluginValue[$sCurrentPlugin]); call_user_func("recipients_" . $sCurrentPlugin . "_store", $aPluginValue[$sCurrentPlugin]);
} }
} }
} }
@ -316,9 +300,9 @@ if ($action == "recipients_import_exec" && $perm->have_perm_area_action("recipie
$_REQUEST["txtData"] = implode("\n", $aInvalidLines); $_REQUEST["txtData"] = implode("\n", $aInvalidLines);
} }
if (count($aMessage) > 0) { if (count($aMessage) > 0) {
$sMessage = $notification->returnNotification("warning", implode("<br />", $aMessage))."<br />"; $sMessage = $notification->returnNotification("warning", implode("<br />", $aMessage)) . "<br />";
} }
$sMessage .= $notification->returnNotification("info", sprintf(i18n("%d recipients added, %d recipients skipped (email already exists) and %d invalid recipients/e-mail adresses ignored. Invalid recipients are shown (if any)."), $iAdded, $iDublettes, $iInvalid)); $sMessage .= $notification->returnNotification("info", sprintf(i18n("%d recipients added, %d recipients skipped (email already exists) and %d invalid recipients/e-mail adresses ignored. Invalid recipients are shown (if any).", "newsletter"), $iAdded, $iDublettes, $iInvalid));
if ($iAdded > 0) { if ($iAdded > 0) {
$oPage->setReload(); $oPage->setReload();
} }
@ -330,31 +314,31 @@ $oForm->setVar("frame", $frame);
$oForm->setVar("area", $area); $oForm->setVar("area", $area);
$oForm->setVar("action", "recipients_import_exec"); $oForm->setVar("action", "recipients_import_exec");
$oForm->addHeader(i18n("Import recipients")); $oForm->addHeader(i18n("Import recipients", "newsletter"));
$oSelDelimiter = new cHTMLSelectElement("selDelimiter"); $oSelDelimiter = new cHTMLSelectElement("selDelimiter");
$aItems = array(); $aItems = array();
$aItems[] = array("tab", i18n("Tab")); $aItems[] = array("tab", i18n("Tab", "newsletter"));
$aItems[] = array("semicolon", i18n("Semicolon")); $aItems[] = array("semicolon", i18n("Semicolon", "newsletter"));
$oSelDelimiter->autoFill($aItems); $oSelDelimiter->autoFill($aItems);
$oSelDelimiter->setDefault($_REQUEST["selDelimiter"]); $oSelDelimiter->setDefault($_REQUEST["selDelimiter"]);
$oForm->add(i18n("Delimiter"), $oSelDelimiter->render()); $oForm->add(i18n("Delimiter", "newsletter"), $oSelDelimiter->render());
$oAreaData = new cHTMLTextarea("txtData", $_REQUEST["txtData"], 80, 20); $oAreaData = new cHTMLTextarea("txtData", $_REQUEST["txtData"], 80, 20);
$sInfo = '<a href="javascript:fncShowHide(\'idInfoText\');"><strong>'.i18n("Import information").'</strong></a>'. $sInfo = '<a href="javascript:fncShowHide(\'idInfoText\');"><strong>' . i18n("Import information", "newsletter") . '</strong></a>' .
'<div id="idInfoText" style="display: none">'. '<div id="idInfoText" style="display: none">' .
'<br /><br /><strong>'.i18n("Specify colum types:").'</strong>'. '<br /><br /><strong>' . i18n("Specify colum types:", "newsletter") . '</strong>' .
i18n("<br />The first line must contain the column names; this specifies the column order.<br />&lt;column name&gt;[delimiter]&lt;column name&gt;..."). i18n("<br />The first line must contain the column names; this specifies the column order.<br />&lt;column name&gt;[delimiter]&lt;column name&gt;...", "newsletter") .
'<br /><br /><strong>'.i18n("Data structure:").'</strong><br />'. '<br /><br /><strong>' . i18n("Data structure:", "newsletter") . '</strong><br />' .
i18n("The recipients have to be entered using the following format:<br />&lt;data&gt;[Delimiter]&lt;data&gt;... - each recipient in a new line."). i18n("The recipients have to be entered using the following format:<br />&lt;data&gt;[Delimiter]&lt;data&gt;... - each recipient in a new line.", "newsletter") .
'<br /><br /><strong>'.i18n("Example:").'</strong>'. '<br /><br /><strong>' . i18n("Example:", "newsletter") . '</strong>' .
i18n("<br />name;mail;confirmed<br />Smith;jon.smith@example.org;1"). i18n("<br />name;mail;confirmed<br />Smith;jon.smith@example.org;1", "newsletter") .
'<br /><br /><strong>'.i18n("The following column names will be recognized:").'</strong><br />'. '<br /><br /><strong>' . i18n("The following column names will be recognized:", "newsletter") . '</strong><br />' .
implode("<br />\n", $aFields); implode("<br />\n", $aFields);
$oForm->add(i18n("Recipients"), $oAreaData->render()."<br />".$sInfo); $oForm->add(i18n("Recipients", "newsletter"), $oAreaData->render() . "<br />" . $sInfo);
unset ($sInfo); unset($sInfo);
$sExecScript = ' $sExecScript = '
<script type="text/javascript"> <script type="text/javascript">
@ -371,7 +355,6 @@ $sExecScript = '
</script>'; </script>';
$oPage->addScript('execscript', $sExecScript); $oPage->addScript('execscript', $sExecScript);
$oPage->setContent($sMessage.$oForm->render(true)); $oPage->setContent($sMessage . $oForm->render(true));
$oPage->render(); $oPage->render();
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,8 +28,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -41,7 +41,6 @@ $oMenu = new UI_Menu;
$oClient = new cApiClient($client); $oClient = new cApiClient($client);
$oUser = new cApiUser($auth->auth["uid"]); $oUser = new cApiUser($auth->auth["uid"]);
//$sLocation = $sess->url("main.php?area=$area&frame=$frame"); //$sLocation = $sess->url("main.php?area=$area&frame=$frame");
// Specify fields for search, sort and validation. Design makes enhancements // Specify fields for search, sort and validation. Design makes enhancements
// using plugins possible (currently not implemented). If you are changing things here, // using plugins possible (currently not implemented). If you are changing things here,
// remember to update include.newsletter_left_top.php, also. // remember to update include.newsletter_left_top.php, also.
@ -51,10 +50,10 @@ $oUser = new cApiUser($auth->auth["uid"]);
// sort: Element can be used to be sorted by // sort: Element can be used to be sorted by
// search: Element can be used to search in // search: Element can be used to search in
$aFields = array(); $aFields = array();
$aFields["name"] = array("field" => "name", "caption" => i18n("Name"), "type" => "base,sort,search"); $aFields["name"] = array("field" => "name", "caption" => i18n("Name", "newsletter"), "type" => "base,sort,search");
$aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail"), "type" => "base,sort,search"); $aFields["email"] = array("field" => "email", "caption" => i18n("E-Mail", "newsletter"), "type" => "base,sort,search");
$aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed"), "type" => "base"); $aFields["confirmed"] = array("field" => "confirmed", "caption" => i18n("Confirmed", "newsletter"), "type" => "base");
$aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated"), "type" => "base"); $aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Deactivated", "newsletter"), "type" => "base");
################################## ##################################
# Store settings # Store settings
@ -62,9 +61,7 @@ $aFields["deactivated"] = array("field" => "deactivated", "caption" => i18n("Dea
//Update purgetimeframe if submitted //Update purgetimeframe if submitted
//$sRefreshTop = ''; //$sRefreshTop = '';
$iTimeframe = $oClient->getProperty("newsletter", "purgetimeframe"); $iTimeframe = $oClient->getProperty("newsletter", "purgetimeframe");
if (isset($_REQUEST["txtPurgeTimeframe"]) && $_REQUEST["txtPurgeTimeframe"] > 0 if (isset($_REQUEST["txtPurgeTimeframe"]) && $_REQUEST["txtPurgeTimeframe"] > 0 && $_REQUEST["txtPurgeTimeframe"] != $iTimeframe && $perm->have_perm_area_action($area, "recipients_delete")) {
&& $_REQUEST["txtPurgeTimeframe"] != $iTimeframe && $perm->have_perm_area_action($area, "recipients_delete"))
{
$oClient->setProperty("newsletter", "purgetimeframe", $_REQUEST["txtPurgeTimeframe"]); $oClient->setProperty("newsletter", "purgetimeframe", $_REQUEST["txtPurgeTimeframe"]);
//$sRefreshTop = '<script language="JavaScript">parent.left_top.purgetimeframe = '.$_REQUEST["txtPurgeTimeframe"].'</script>'; //$sRefreshTop = '<script language="JavaScript">parent.left_top.purgetimeframe = '.$_REQUEST["txtPurgeTimeframe"].'</script>';
} }
@ -85,11 +82,11 @@ if ($_REQUEST["elemperpage"] > 0) {
$oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]); $oUser->setProperty("itemsperpage", $area, $_REQUEST["elemperpage"]);
} }
$_REQUEST["restrictgroup"] = (int)$_REQUEST["restrictgroup"]; $_REQUEST["restrictgroup"] = (int) $_REQUEST["restrictgroup"];
if ($_REQUEST["restrictgroup"] == 0) { if ($_REQUEST["restrictgroup"] == 0) {
$_REQUEST["restrictgroup"] = "--all--"; $_REQUEST["restrictgroup"] = "--all--";
} }
$_REQUEST["page"] = (int)$_REQUEST["page"]; $_REQUEST["page"] = (int) $_REQUEST["page"];
if ($_REQUEST["page"] <= 0 || $_REQUEST["elemperpage"] == 0) { if ($_REQUEST["page"] <= 0 || $_REQUEST["elemperpage"] == 0) {
$_REQUEST["page"] = 1; $_REQUEST["page"] = 1;
} }
@ -101,8 +98,7 @@ if ($_REQUEST["sortorder"] != "DESC") {
// Check sort by and search in criteria // Check sort by and search in criteria
$bSortByFound = false; $bSortByFound = false;
$bSearchInFound = false; $bSearchInFound = false;
foreach ($aFields as $sKey => $aData) foreach ($aFields as $sKey => $aData) {
{
if ($aData["field"] == $_REQUEST["sortby"] && strpos($aData["type"], "sort") !== false) { if ($aData["field"] == $_REQUEST["sortby"] && strpos($aData["type"], "sort") !== false) {
$bSortByFound = true; $bSortByFound = true;
} }
@ -119,8 +115,8 @@ if (!$bSearchInFound) {
} }
// Free memory // Free memory
unset ($oUser); unset($oUser);
unset ($oClient); unset($oClient);
################################## ##################################
# Get data # Get data
@ -129,10 +125,9 @@ $oRecipients = new RecipientCollection;
// Updating keys, if activated; all recipients of all clients! // Updating keys, if activated; all recipients of all clients!
$sMsg = ""; $sMsg = "";
if (getSystemProperty("newsletter", "updatekeys")) if (getSystemProperty("newsletter", "updatekeys")) {
{
$iUpdatedRecipients = $oRecipients->updateKeys(); $iUpdatedRecipients = $oRecipients->updateKeys();
$sMsg = $notification->returnNotification("info", sprintf(i18n("%d recipients, with no or incompatible key has been updated. Deactivate update function."), $iUpdatedRecipients)); $sMsg = $notification->returnNotification("info", sprintf(i18n("%d recipients, with no or incompatible key has been updated. Deactivate update function.", "newsletter"), $iUpdatedRecipients));
} }
$oRecipients->setWhere("recipientcollection.idclient", $client); $oRecipients->setWhere("recipientcollection.idclient", $client);
@ -142,37 +137,32 @@ $oRecipients->setWhere("recipientcollection.idlang", $lang);
$oRecipients->setOrder("recipientcollection." . $_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]); $oRecipients->setOrder("recipientcollection." . $_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]);
// Show group // Show group
if ($_REQUEST["restrictgroup"] != "--all--") if ($_REQUEST["restrictgroup"] != "--all--") {
{
$oRecipients->link("RecipientGroupMemberCollection"); $oRecipients->link("RecipientGroupMemberCollection");
$oRecipients->setWhere("RecipientGroupMemberCollection.idnewsgroup", $_REQUEST["restrictgroup"]); $oRecipients->setWhere("RecipientGroupMemberCollection.idnewsgroup", $_REQUEST["restrictgroup"]);
} }
// Search for // Search for
if ($_REQUEST["filter"] != "") if ($_REQUEST["filter"] != "") {
{ if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") {
if ($_REQUEST["searchin"] == "--all--" || $_REQUEST["searchin"] == "") foreach ($aFields as $sKey => $aData) {
{
foreach ($aFields as $sKey => $aData)
{
if (strpos($aData["type"], "search") !== false) { if (strpos($aData["type"], "search") !== false) {
$oRecipients->setWhereGroup("filter", "recipientcollection.".$aData["field"], $_REQUEST["filter"], "LIKE"); $oRecipients->setWhereGroup("filter", "recipientcollection." . $aData["field"], $_REQUEST["filter"], "LIKE");
} }
} }
$oRecipients->setInnerGroupCondition("filter", "OR"); $oRecipients->setInnerGroupCondition("filter", "OR");
} else { } else {
$oRecipients->setWhere("recipientcollection.".$_REQUEST["searchin"], $_REQUEST["filter"], "LIKE"); $oRecipients->setWhere("recipientcollection." . $_REQUEST["searchin"], $_REQUEST["filter"], "LIKE");
} }
} }
// Items / page // Items / page
if ($_REQUEST["elemperpage"] > 0) if ($_REQUEST["elemperpage"] > 0) {
{
// Getting item count without limit (for page function) - better idea anyone (performance)? // Getting item count without limit (for page function) - better idea anyone (performance)?
$oRecipients->query(); $oRecipients->query();
$iItemCount = $oRecipients->count(); $iItemCount = $oRecipients->count();
if ($_REQUEST["elemperpage"]*($_REQUEST["page"]) >= $iItemCount+$_REQUEST["elemperpage"] && $_REQUEST["page"] != 1) { if ($_REQUEST["elemperpage"] * ($_REQUEST["page"]) >= $iItemCount + $_REQUEST["elemperpage"] && $_REQUEST["page"] != 1) {
$_REQUEST["page"]--; $_REQUEST["page"] --;
} }
$oRecipients->setLimit($_REQUEST["elemperpage"] * ($_REQUEST["page"] - 1), $_REQUEST["elemperpage"]); $oRecipients->setLimit($_REQUEST["elemperpage"] * ($_REQUEST["page"] - 1), $_REQUEST["elemperpage"]);
@ -188,11 +178,10 @@ $iMenu = 0;
// Store messages for repeated use (speeds performance, as i18n translation is only needed once) // Store messages for repeated use (speeds performance, as i18n translation is only needed once)
$aMsg = array(); $aMsg = array();
$aMsg["DelTitle"] = i18n("Delete recipient"); $aMsg["DelTitle"] = i18n("Delete recipient", "newsletter");
$aMsg["DelDescr"] = i18n("Do you really want to delete the following recipient:<br>"); $aMsg["DelDescr"] = i18n("Do you really want to delete the following recipient:<br>", "newsletter");
while ($oRecipient = $oRecipients->next()) while ($oRecipient = $oRecipients->next()) {
{
$iMenu++; $iMenu++;
$idnewsrcp = $oRecipient->get("idnewsrcp"); $idnewsrcp = $oRecipient->get("idnewsrcp");
@ -213,20 +202,20 @@ while ($oRecipient = $oRecipients->next())
$oMenu->setLink($iMenu, $oLnk); $oMenu->setLink($iMenu, $oLnk);
if ($perm->have_perm_area_action("recipients", "recipients_delete")) { if ($perm->have_perm_area_action("recipients", "recipients_delete")) {
$oMenu->setActions($iMenu, "delete", '<a title="'.$aMsg["DelTitle"].'" href="javascript://" onclick="showDelMsg('.$idnewsrcp.',\''.addslashes($sName).'\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$aMsg["DelTitle"].'" alt="'.$aMsg["DelTitle"].'"></a>'); $oMenu->setActions($iMenu, "delete", '<a title="' . $aMsg["DelTitle"] . '" href="javascript://" onclick="showDelMsg(' . $idnewsrcp . ',\'' . addslashes($sName) . '\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $aMsg["DelTitle"] . '" alt="' . $aMsg["DelTitle"] . '"></a>');
} }
} }
$sExecScript = ' $sExecScript = '
<script type="text/javascript"> <script type="text/javascript">
// Session-ID // Session-ID
var sid = "'.$sess->id.'"; var sid = "' . $sess->id . '";
// Create messageBox instance // Create messageBox instance
box = new messageBox("", "", "", 0, 0); box = new messageBox("", "", "", 0, 0);
function showDelMsg(lngId, strElement) { function showDelMsg(lngId, strElement) {
box.confirm("'.$aMsg["DelTitle"].'", "'.$aMsg["DelDescr"].'<b>" + strElement + "</b>", "deleteRecipient(\'" + lngId + "\')"); box.confirm("' . $aMsg["DelTitle"] . '", "' . $aMsg["DelDescr"] . '<b>" + strElement + "</b>", "deleteRecipient(\'" + lngId + "\')");
} }
// Function for deleting recipients // Function for deleting recipients
@ -250,12 +239,11 @@ $sExecScript = '
</script>'; </script>';
$oPage->setMargin(0); $oPage->setMargin(0);
$oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>'); $oPage->addScript('messagebox', '<script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>');
$oPage->addScript('exec', $sExecScript); $oPage->addScript('exec', $sExecScript);
//$oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>'); //$oPage->addScript('cfoldingrow.js', '<script language="JavaScript" src="scripts/cfoldingrow.js"></script>');
$oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>'); $oPage->addScript('parameterCollector.js', '<script language="JavaScript" src="scripts/parameterCollector.js"></script>');
//$oPage->addScript('refreshTop', $sRefreshTop); //$oPage->addScript('refreshTop', $sRefreshTop);
//generate current content for Object Pager<65> //generate current content for Object Pager<65>
$sPagerId = '0ed6d632-6adf-4f09-a0c6-1e38ab60e304'; $sPagerId = '0ed6d632-6adf-4f09-a0c6-1e38ab60e304';
$oPagerLink = new cHTMLLink; $oPagerLink = new cHTMLLink;
@ -286,7 +274,7 @@ $oPage->addScript('setpager', '<script type="text/javascript" src="scripts/setPa
$sRefreshPager = ' $sRefreshPager = '
<script type="text/javascript"> <script type="text/javascript">
var sNavigation = \''.$sPagerContent.'\'; var sNavigation = \'' . $sPagerContent . '\';
// Activate time to refresh pager folding row in left top // Activate time to refresh pager folding row in left top
var oTimer = window.setInterval("fncSetPager(\'' . $sPagerId . '\',\'' . $_REQUEST["page"] . '\')", 200); var oTimer = window.setInterval("fncSetPager(\'' . $sPagerId . '\',\'' . $_REQUEST["page"] . '\')", 200);
@ -297,5 +285,4 @@ $oPage->addScript('refreshpager', $sRefreshPager);
//$oPage->setContent(array('<table border="0" cellspacing="0" cellpadding="0" width="100%">', '</table>', $sMsg . $oMenu->render(false))); //$oPage->setContent(array('<table border="0" cellspacing="0" cellpadding="0" width="100%">', '</table>', $sMsg . $oMenu->render(false)));
$oPage->setContent($sMsg . $oMenu->render(false)); $oPage->setContent($sMsg . $oMenu->render(false));
$oPage->render(); $oPage->render();
?> ?>

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,21 @@
./includes/include.newsletter_jobs_menu.php
./includes/include.newsletter_edit.php
./includes/include.recipients_menu.php
./includes/include.newsletter_left_top.php
./includes/include.newsletter_subnav.php
./includes/config.autoloader.php
./includes/include.newsletter_jobs_details.php
./includes/include.recipients.group_menu.php
./includes/include.recipients.group.subnav.php
./includes/include.newsletter_jobs_subnav.php
./includes/include.recipients.group_edit.php
./includes/include.newsletter_menu.php
./includes/include.recipients_edit.php
./includes/include.newsletter_edit_message.php
./includes/include.recipients_import.php
./includes/config.plugin.php
./classes/class.newsletter.php
./classes/class.newsletter.groups.php
./classes/class.newsletter.recipients.php
./classes/class.newsletter.logs.php
./classes/class.newsletter.jobs.php