$iItemsPerPage = 25; // All can't be saved } $oSelItemsPerPage = new cHTMLSelectElement("elemperpage"); $oSelItemsPerPage->autoFill(array(0 => i18n("-- All --", $plugin_name), 25 => 25, 50 => 50, 75 => 75, 100 => 100)); $oSelItemsPerPage->setDefault($iItemsPerPage); $oSelSortBy = new cHTMLSelectElement("sortby"); foreach ($aFields as $sKey => $aData) { if (strpos($aData["type"], "sort") !== false) { $oOption = new cHTMLOptionElement($aData["caption"], $aData["field"]); $oSelSortBy->addOptionElement($aData["field"], $oOption); } } $oSelSortBy->setDefault("name"); $oSelSortOrder = new cHTMLSelectElement("sortorder"); $oSelSortOrder->autoFill(array("ASC" => i18n("Ascending", $plugin_name), "DESC" => i18n("Descending", $plugin_name))); $oSelSortOrder->setDefault("ASC"); $oTxtFilter = new cHTMLTextbox("filter", "", 16); $oSelSearchIn = new cHTMLSelectElement("searchin"); $oOption = new cHTMLOptionElement(i18n("-- All fields --", $plugin_name), "--all--"); $oSelSearchIn->addOptionElement("all", $oOption); foreach ($aFields as $sKey => $aData) { if (strpos($aData["type"], "search") !== false) { $oOption = new cHTMLOptionElement($aData["caption"], $aData["field"]); $oSelSearchIn->addOptionElement($aData["field"], $oOption); } } $oSelSearchIn->setDefault("--all--"); $oBtnApply = new cHTMLButton("submit", i18n("Apply", $plugin_name)); $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";
$sTagInfoText .= "</div>"; $sTagInfoHTML .= "</div>"; $iTplIDArt = 0; // Used later for on change event if ($oNewsletter->get("type") == "html") { $iTplIDArt = $oNewsletter->get("template_idart"); $oSelTemplate = new cHTMLSelectElement("selTemplate"); $oSelTemplate->setEvent("change", "askSubmitOnTplChange(this);"); $aOptions = array("idcat" => $oClientLang->getProperty("newsletter", "html_template_idcat"), "start" => true, "offline" => true, "order" => "title"); $oTemplateArticles = new ArticleCollection($aOptions); $aItems = array(); $aItems[] = array(0, i18n("-- none --", $plugin_name)); while ($oArticle = $oTemplateArticles->nextArticle()) { $aItems[] = array($oArticle->get("idart"), $oArticle->get("title")); } $oSelTemplate->autoFill($aItems); $oSelTemplate->setDefault($iTplIDArt); unset($aItems); unset($oArticles); unset($oTemplateArticles); $oForm->add(i18n("HTML Template", $plugin_name), $oSelTemplate->render() . " " . i18n("Note, that changing the template discards the current html message content", $plugin_name)); 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; $oForm->add(i18n("HTML Message", $plugin_name), '<iframe width="100%" height="600" src="' . $sFrameSrc . '"></iframe><br />' . $sTagInfoHTML); } else { // 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", $plugin_name)) . "<br />"; $oForm->add(i18n("HTML Message", $plugin_name), i18n("Please choose a template first", $plugin_name)); } } $oTxtMessage = new cHTMLTextarea("txtMessage", $oNewsletter->get("message"), 80, 20);
$sSQL .= $sSQLSort . $sSQLLimit; $oOutsiders->flexSelect("", "", $sSQL, ""); $aItems = array(); while ($oRecipient = $oOutsiders->next()) { $sName = $oRecipient->get("name"); $sEMail = $oRecipient->get("email"); if (empty($sName)) { $sName = $sEMail; } $aItems[] = array($oRecipient->get("idnewsrcp"), $sName . " (" . $sEMail . ")"); } $oSelUser = new cHTMLSelectElement("adduser[]"); $oSelUser->setSize(25); $oSelUser->setStyle("width: 100%;"); $oSelUser->setMultiSelect(); $oSelUser->autoFill($aItems); // Outsider list pager (-> below data, as iOutsiders is needed) $oPagerLink = new cHTMLLink(); $oPagerLink->setLink("main.php"); $oPagerLink->setCustom("member_elemperpage", $_REQUEST["member_elemperpage"]); $oPagerLink->setCustom("member_filter", $_REQUEST["member_filter"]); $oPagerLink->setCustom("member_sortby", $_REQUEST["member_sortby"]); $oPagerLink->setCustom("member_sortorder", $_REQUEST["member_sortorder"]); $oPagerLink->setCustom("member_searchin", $_REQUEST["member_searchin"]); $oPagerLink->setCustom("outsider_elemperpage", $_REQUEST["outsider_elemperpage"]); $oPagerLink->setCustom("outsider_filter", $_REQUEST["outsider_filter"]); $oPagerLink->setCustom("outsider_sortby", $_REQUEST["outsider_sortby"]); $oPagerLink->setCustom("outsider_sortorder", $_REQUEST["outsider_sortorder"]); $oPagerLink->setCustom("outsider_searchin", $_REQUEST["outsider_searchin"]); $oPagerLink->setCustom("idrecipientgroup", $_REQUEST["idrecipientgroup"]); $oPagerLink->setCustom("frame", $frame);
$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).", $plugin_name), $iAdded, $iDublettes, $iInvalid)); if ($iAdded > 0) { $oPage->setReload(); } } } $oForm = new UI_Table_Form("properties"); $oForm->setVar("frame", $frame); $oForm->setVar("area", $area); $oForm->setVar("action", "recipients_import_exec"); $oForm->addHeader(i18n("Import recipients", $plugin_name)); $oSelDelimiter = new cHTMLSelectElement("selDelimiter"); $aItems = array(); $aItems[] = array("semicolon", i18n("Semicolon", $plugin_name)); $aItems[] = array("tab", i18n("Tab", $plugin_name)); $oSelDelimiter->autoFill($aItems); $oSelDelimiter->setDefault($_REQUEST["selDelimiter"]); $oForm->add(i18n("Delimiter", $plugin_name), $oSelDelimiter->render()); $oAreaData = new cHTMLTextarea("txtData", $_REQUEST["txtData"], 80, 20); $sInfo = '<a href="javascript:fncShowHide(\'idInfoText\');"><strong>' . i18n("Import information", $plugin_name) . '</strong></a>' . '<div id="idInfoText" style="display: none">' . '<br /><br /><strong>' . i18n("Specify colum types:", $plugin_name) . '</strong>' . i18n("<br />The first line must contain the column names; this specifies the column order.<br /><column name>[delimiter]<column name>...", $plugin_name) . '<br /><br /><strong>' . i18n("Data structure:", $plugin_name) . '</strong><br />' . i18n("The recipients have to be entered using the following format:<br /><data>[Delimiter]<data>... - each recipient in a new line.", $plugin_name) . '<br /><br /><strong>' . i18n("Example:", $plugin_name) . '</strong>' . i18n("<br />name;mail;confirmed<br />Smith;jon.smith@example.org;1", $plugin_name) . '<br /><br /><strong>' . i18n("The following column names will be recognized:", $plugin_name) . '</strong><br />' . implode("<br />\n", $aFields) . '</div>'; $oForm->add(i18n("Recipients", $plugin_name), $oAreaData->render() . "<br />" . $sInfo); unset($sInfo); $sExecScript = ' <script type="text/javascript"> /* Enabled/Disable group box */ function fncShowHide(strItemID) { objItem = document.getElementById(strItemID); if (objItem.style.display == "none") { objItem.style.display = "inline"; } else {