/** * Shows the content of configuration module * compiling the configuration form and fill it with default values * * @return string The compiled content of the module. */ protected function moduleContent() { $configArray[1] = array('box-1' => $this->getLanguageService()->getLL('configure_default_headers'), 'from_email' => array('string', DirectMailUtility::fName('from_email'), $this->getLanguageService()->getLL('from_email.description') . '<br />' . $this->getLanguageService()->getLL('from_email.details')), 'from_name' => array('string', DirectMailUtility::fName('from_name'), $this->getLanguageService()->getLL('from_name.description') . '<br />' . $this->getLanguageService()->getLL('from_name.details')), 'replyto_email' => array('string', DirectMailUtility::fName('replyto_email'), $this->getLanguageService()->getLL('replyto_email.description') . '<br />' . $this->getLanguageService()->getLL('replyto_email.details')), 'replyto_name' => array('string', DirectMailUtility::fName('replyto_name'), $this->getLanguageService()->getLL('replyto_name.description') . '<br />' . $this->getLanguageService()->getLL('replyto_name.details')), 'return_path' => array('string', DirectMailUtility::fName('return_path'), $this->getLanguageService()->getLL('return_path.description') . '<br />' . $this->getLanguageService()->getLL('return_path.details')), 'organisation' => array('string', DirectMailUtility::fName('organisation'), $this->getLanguageService()->getLL('organisation.description') . '<br />' . $this->getLanguageService()->getLL('organisation.details')), 'priority' => array('select', DirectMailUtility::fName('priority'), $this->getLanguageService()->getLL('priority.description') . '<br />' . $this->getLanguageService()->getLL('priority.details'), array(3 => $this->getLanguageService()->getLL('configure_priority_normal'), 1 => $this->getLanguageService()->getLL('configure_priority_high'), 5 => $this->getLanguageService()->getLL('configure_priority_low')))); $configArray[2] = array('box-2' => $this->getLanguageService()->getLL('configure_default_content'), 'sendOptions' => array('select', DirectMailUtility::fName('sendOptions'), $this->getLanguageService()->getLL('sendOptions.description') . '<br />' . $this->getLanguageService()->getLL('sendOptions.details'), array(3 => $this->getLanguageService()->getLL('configure_plain_and_html'), 1 => $this->getLanguageService()->getLL('configure_plain_only'), 2 => $this->getLanguageService()->getLL('configure_html_only'))), 'includeMedia' => array('check', DirectMailUtility::fName('includeMedia'), $this->getLanguageService()->getLL('includeMedia.description') . '<br />' . $this->getLanguageService()->getLL('includeMedia.details')), 'flowedFormat' => array('check', DirectMailUtility::fName('flowedFormat'), $this->getLanguageService()->getLL('flowedFormat.description') . '<br />' . $this->getLanguageService()->getLL('flowedFormat.details'))); $configArray[3] = array('box-3' => $this->getLanguageService()->getLL('configure_default_fetching'), 'HTMLParams' => array('short', DirectMailUtility::fName('HTMLParams'), $this->getLanguageService()->getLL('configure_HTMLParams_description') . '<br />' . $this->getLanguageService()->getLL('configure_HTMLParams_details')), 'plainParams' => array('short', DirectMailUtility::fName('plainParams'), $this->getLanguageService()->getLL('configure_plainParams_description') . '<br />' . $this->getLanguageService()->getLL('configure_plainParams_details')), 'use_domain' => array('select', DirectMailUtility::fName('use_domain'), $this->getLanguageService()->getLL('use_domain.description') . '<br />' . $this->getLanguageService()->getLL('use_domain.details'), array(0 => ''))); $configArray[4] = array('box-4' => $this->getLanguageService()->getLL('configure_options_encoding'), 'quick_mail_encoding' => array('select', $this->getLanguageService()->getLL('configure_quickmail_encoding'), $this->getLanguageService()->getLL('configure_quickmail_encoding_description'), array('quoted-printable' => 'quoted-printable', 'base64' => 'base64', '8bit' => '8bit')), 'direct_mail_encoding' => array('select', $this->getLanguageService()->getLL('configure_directmail_encoding'), $this->getLanguageService()->getLL('configure_directmail_encoding_description'), array('quoted-printable' => 'quoted-printable', 'base64' => 'base64', '8bit' => '8bit')), 'quick_mail_charset' => array('short', $this->getLanguageService()->getLL('configure_quickmail_charset'), $this->getLanguageService()->getLL('configure_quickmail_charset_description')), 'direct_mail_charset' => array('short', $this->getLanguageService()->getLL('configure_directmail_charset'), $this->getLanguageService()->getLL('configure_directmail_charset_description'))); $configArray[5] = array('box-5' => $this->getLanguageService()->getLL('configure_options_links'), 'use_rdct' => array('check', DirectMailUtility::fName('use_rdct'), $this->getLanguageService()->getLL('use_rdct.description') . '<br />' . $this->getLanguageService()->getLL('use_rdct.details') . '<br />' . $this->getLanguageService()->getLL('configure_options_links_rdct')), 'long_link_mode' => array('check', DirectMailUtility::fName('long_link_mode'), $this->getLanguageService()->getLL('long_link_mode.description')), 'enable_jump_url' => array('check', $this->getLanguageService()->getLL('configure_options_links_jumpurl'), $this->getLanguageService()->getLL('configure_options_links_jumpurl_description')), 'jumpurl_tracking_privacy' => array('check', $this->getLanguageService()->getLL('configure_jumpurl_tracking_privacy'), $this->getLanguageService()->getLL('configure_jumpurl_tracking_privacy_description')), 'enable_mailto_jump_url' => array('check', $this->getLanguageService()->getLL('configure_options_mailto_jumpurl'), $this->getLanguageService()->getLL('configure_options_mailto_jumpurl_description')), 'authcode_fieldList' => array('short', DirectMailUtility::fName('authcode_fieldList'), $this->getLanguageService()->getLL('authcode_fieldList.description'))); $configArray[6] = array('box-6' => $this->getLanguageService()->getLL('configure_options_additional'), 'http_username' => array('short', $this->getLanguageService()->getLL('configure_http_username'), $this->getLanguageService()->getLL('configure_http_username_description') . '<br />' . $this->getLanguageService()->getLL('configure_http_username_details')), 'http_password' => array('short', $this->getLanguageService()->getLL('configure_http_password'), $this->getLanguageService()->getLL('configure_http_password_description')), 'simulate_usergroup' => array('short', $this->getLanguageService()->getLL('configure_simulate_usergroup'), $this->getLanguageService()->getLL('configure_simulate_usergroup_description') . '<br />' . $this->getLanguageService()->getLL('configure_simulate_usergroup_details')), 'userTable' => array('short', $this->getLanguageService()->getLL('configure_user_table'), $this->getLanguageService()->getLL('configure_user_table_description')), 'test_tt_address_uids' => array('short', $this->getLanguageService()->getLL('configure_test_tt_address_uids'), $this->getLanguageService()->getLL('configure_test_tt_address_uids_description')), 'test_dmail_group_uids' => array('short', $this->getLanguageService()->getLL('configure_test_dmail_group_uids'), $this->getLanguageService()->getLL('configure_test_dmail_group_uids_description')), 'testmail' => array('short', $this->getLanguageService()->getLL('configure_testmail'), $this->getLanguageService()->getLL('configure_testmail_description'))); // Set default values if (!isset($this->implodedParams['plainParams'])) { $this->implodedParams['plainParams'] = '&type=99'; } if (!isset($this->implodedParams['quick_mail_charset'])) { $this->implodedParams['quick_mail_charset'] = 'utf-8'; } if (!isset($this->implodedParams['direct_mail_charset'])) { $this->implodedParams['direct_mail_charset'] = 'iso-8859-1'; } // Set domain selection list $rootline = $this->sys_page->getRootLine($this->id); $rootlineId = array(); foreach ($rootline as $rArr) { $rootlineId[] = $rArr['uid']; } $res_domain = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,domainName', 'sys_domain', 'sys_domain.pid in (' . implode(',', $rootlineId) . ')' . BackendUtility::deleteClause('sys_domain')); while ($row_domain = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_domain)) { $configArray[3]['use_domain']['3'][$row_domain['uid']] = $row_domain['domainName']; } $GLOBALS["TYPO3_DB"]->sql_free_result($res_domain); $this->configArray_length = count($configArray); $form = ''; for ($i = 1; $i <= count($configArray); $i++) { $form .= $this->makeConfigForm($configArray[$i], $this->implodedParams, 'pageTS'); } $form .= '<input type="submit" name="submit" value="Update configuration" />'; return str_replace('Update configuration', $this->getLanguageService()->getLL('configure_update_configuration'), $form); }
/** * Show the compact information of a direct mail record * * @param array $row Direct mail record * * @return string The compact infos of the direct mail record */ function directMail_compactView($row) { // Render record: if ($row['type']) { $dmailData = $row['plainParams'] . ', ' . $row['HTMLParams']; } else { $page = BackendUtility::getRecord('pages', $row['page'], 'title'); $dmailData = $row['page'] . ', ' . htmlspecialchars($page['title']); $dmailInfo = DirectMailUtility::fName('plainParams') . ' ' . htmlspecialchars($row['plainParams'] . LF . DirectMailUtility::fName('HTMLParams') . $row['HTMLParams']) . '; ' . LF; } $dmailInfo .= $this->getLanguageService()->getLL('view_media') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'includeMedia', $row['includeMedia']) . '; ' . LF . $this->getLanguageService()->getLL('view_flowed') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'flowedFormat', $row['flowedFormat']); $dmailInfo = '<span title="' . $dmailInfo . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</span>'; $fromInfo = $this->getLanguageService()->getLL('view_replyto') . ' ' . htmlspecialchars($row['replyto_name'] . ' <' . $row['replyto_email'] . '>') . '; ' . LF . DirectMailUtility::fName('organisation') . ' ' . htmlspecialchars($row['organisation']) . '; ' . LF . DirectMailUtility::fName('return_path') . ' ' . htmlspecialchars($row['return_path']); $fromInfo = '<span title="' . $fromInfo . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</span>'; $mailInfo = DirectMailUtility::fName('priority') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'priority', $row['priority']) . '; ' . LF . DirectMailUtility::fName('encoding') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'encoding', $row['encoding']) . '; ' . LF . DirectMailUtility::fName('charset') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'charset', $row['charset']); $mailInfo = '<span title="' . $mailInfo . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</span>'; $delBegin = $row["scheduled_begin"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-'; $delEnd = $row["scheduled_end"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-'; // count total recipient from the query_info $totalRecip = 0; $idLists = unserialize($row['query_info']); foreach ($idLists['id_lists'] as $idArray) { $totalRecip += count($idArray); } $sentRecip = $GLOBALS['TYPO3_DB']->sql_num_rows($GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_dmail_maillog', 'mid=' . $row['uid'] . ' AND response_type = 0', '', 'rid ASC')); $out = '<table class="table table-striped table-hover">'; $out .= '<tr class="t3-row-header"><td colspan="3">' . $this->iconFactory->getIconForRecord('sys_dmail', $row)->render() . htmlspecialchars($row['subject']) . '</td></tr>'; $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_from') . '</td>' . '<td>' . htmlspecialchars($row['from_name'] . ' <' . htmlspecialchars($row['from_email']) . '>') . '</td>' . '<td>' . $fromInfo . '</td></tr>'; $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_dmail') . '</td>' . '<td>' . BackendUtility::getProcessedValue('sys_dmail', 'type', $row['type']) . ': ' . $dmailData . '</td>' . '<td>' . $dmailInfo . '</td></tr>'; $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_mail') . '</td>' . '<td>' . BackendUtility::getProcessedValue('sys_dmail', 'sendOptions', $row['sendOptions']) . ($row['attachment'] ? '; ' : '') . BackendUtility::getProcessedValue('sys_dmail', 'attachment', $row['attachment']) . '</td>' . '<td>' . $mailInfo . '</td></tr>'; $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_delivery_begin_end') . '</td>' . '<td>' . $delBegin . ' / ' . $delEnd . '</td>' . '<td> </td></tr>'; $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_recipient_total_sent') . '</td>' . '<td>' . $totalRecip . ' / ' . $sentRecip . '</td>' . '<td> </td></tr>'; $out .= '</table>'; $out .= '<div style="padding-top: 5px;"></div>'; return $out; }
/** * shows the infos of a directmail * record in a table * * @param array $row: DirectMail DB record * @return string the HTML output */ protected function renderRecordDetailsTable($row) { if (!$row['issent']) { if ($GLOBALS['BE_USER']->check('tables_modify', 'sys_dmail')) { $retUrl = 'returnUrl=' . rawurlencode(GeneralUtility::linkThisScript(array('sys_dmail_uid' => $row['uid'], 'createMailFrom_UID' => '', 'createMailFrom_URL' => ''))); $Eparams = '&edit[sys_dmail][' . $row['uid'] . ']=edit'; $editOnClick = 'document.location=\'' . $GLOBALS['BACK_PATH'] . 'alt_doc.php?' . $retUrl . $Eparams . '\'; return false;'; $content = '<a href="#" onClick="' . $editOnClick . '"><img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" />' . '<b>' . $GLOBALS['LANG']->getLL('dmail_edit') . '</b>' . '</a>'; } else { $content = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" />' . '(' . $GLOBALS['LANG']->getLL('dmail_noEdit_noPerms') . ')'; } } else { $content = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS['LANG']->getLL("dmail_edit") . '" />' . '(' . $GLOBALS['LANG']->getLL('dmail_noEdit_isSent') . ')'; } $content = '<tr> <td class="t3-row-header">' . DirectMailUtility::fName('subject') . ' <b>' . GeneralUtility::fixed_lgd_cs(htmlspecialchars($row['subject']), 60) . '</b></td> <td class="t3-row-header" style="text-align: right;">' . $content . '</td> </tr>'; $nameArr = explode(',', 'from_name,from_email,replyto_name,replyto_email,organisation,return_path,priority,attachment,type,page,sendOptions,includeMedia,flowedFormat,plainParams,HTMLParams,encoding,charset,issent,renderedsize'); foreach ($nameArr as $name) { $content .= ' <tr> <td>' . DirectMailUtility::fName($name) . '</td> <td>' . htmlspecialchars(BackendUtility::getProcessedValue('sys_dmail', $name, $row[$name])) . '</td> </tr>'; } $content = '<table border="0" cellpadding="1" cellspacing="1" width="460" class="typo3-dblist">' . $content . '</table>'; $sectionTitle = IconUtility::getSpriteIconForRecord('sys_dmail', $row) . ' ' . htmlspecialchars($row['subject']); return $this->doc->section($sectionTitle, $content, 1, 1, 0, TRUE); }
/** * Shows the infos of a directmail record in a table * * @param array $row DirectMail DB record * * @return string the HTML output */ protected function renderRecordDetailsTable(array $row) { if (!$row['issent']) { if ($GLOBALS['BE_USER']->check('tables_modify', 'sys_dmail')) { // $requestUri = rawurlencode(GeneralUtility::linkThisScript(array('sys_dmail_uid' => $row['uid'], 'createMailFrom_UID' => '', 'createMailFrom_URL' => ''))); $requestUri = BackendUtility::getModuleUrl('DirectMailNavFrame_DirectMail') . '&id=' . $this->id . '&CMD=info&sys_dmail_uid=' . $row['uid'] . '&fetchAtOnce=1'; $editParams = BackendUtility::editOnClick('&edit[sys_dmail][' . $row['uid'] . ']=edit', $GLOBALS['BACK_PATH'], $requestUri); $content = '<a href="#" onClick="' . $editParams . '" title="' . $this->getLanguageService()->getLL("dmail_edit") . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL) . '<b>' . $this->getLanguageService()->getLL('dmail_edit') . '</b></a>'; } else { $content = $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL) . ' (' . $this->getLanguageService()->getLL('dmail_noEdit_noPerms') . ')'; } } else { $content = $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL) . '(' . $this->getLanguageService()->getLL('dmail_noEdit_isSent') . ')'; } $content = '<thead > <th>' . DirectMailUtility::fName('subject') . ' <b>' . GeneralUtility::fixed_lgd_cs(htmlspecialchars($row['subject']), 60) . '</b></th> <th style="text-align: right;">' . $content . '</th> </thead>'; $nameArr = explode(',', 'from_name,from_email,replyto_name,replyto_email,organisation,return_path,priority,attachment,type,page,sendOptions,includeMedia,flowedFormat,sys_language_uid,plainParams,HTMLParams,encoding,charset,issent,renderedsize'); foreach ($nameArr as $name) { $content .= ' <tr class="db_list_normal"> <td>' . DirectMailUtility::fName($name) . '</td> <td>' . htmlspecialchars(BackendUtility::getProcessedValue('sys_dmail', $name, $row[$name])) . '</td> </tr>'; } $content = '<table width="460" class="table table-striped table-hover">' . $content . '</table>'; $sectionTitle = $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render() . ' ' . htmlspecialchars($row['subject']); return $this->doc->section($sectionTitle, $content, 1, 1, 0, true); }
/** * show the compact information of a direct mail record * * @param array $row: direct mail record * @return string the compact infos of the direct mail record */ function directMail_compactView($row) { // Render record: if ($row['type']) { $dmailData = $row['plainParams'] . ', ' . $row['HTMLParams']; } else { $page = BackendUtility::getRecord('pages', $row['page'], 'title'); $dmailData = $row['page'] . ', ' . htmlspecialchars($page['title']); $dmail_info = DirectMailUtility::fName('plainParams') . ' ' . htmlspecialchars($row['plainParams'] . LF . DirectMailUtility::fName('HTMLParams') . $row['HTMLParams']) . '; ' . LF; } $dmail_info .= $GLOBALS["LANG"]->getLL('view_media') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'includeMedia', $row['includeMedia']) . '; ' . LF . $GLOBALS["LANG"]->getLL('view_flowed') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'flowedFormat', $row['flowedFormat']); $dmail_info = '<img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $dmail_info . '">'; $from_info = $GLOBALS["LANG"]->getLL('view_replyto') . ' ' . htmlspecialchars($row['replyto_name'] . ' <' . $row['replyto_email'] . '>') . '; ' . LF . DirectMailUtility::fName('organisation') . ' ' . htmlspecialchars($row['organisation']) . '; ' . LF . DirectMailUtility::fName('return_path') . ' ' . htmlspecialchars($row['return_path']); $from_info = '<img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $from_info . '">'; $mail_info = DirectMailUtility::fName('priority') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'priority', $row['priority']) . '; ' . LF . DirectMailUtility::fName('encoding') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'encoding', $row['encoding']) . '; ' . LF . DirectMailUtility::fName('charset') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'charset', $row['charset']); $mail_info = '<img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/zoom2.gif', 'width="12" height="12"') . ' title="' . $mail_info . '">'; $delBegin = $row["scheduled_begin"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-'; $delEnd = $row["scheduled_end"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-'; //count total recipient from the query_info $totalRecip = 0; $id_lists = unserialize($row['query_info']); foreach ($id_lists['id_lists'] as $idArray) { $totalRecip += count($idArray); } $sentRecip = $GLOBALS['TYPO3_DB']->sql_num_rows($GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_dmail_maillog', 'mid=' . $row['uid'] . ' AND response_type = 0', '', 'rid ASC')); $out = '<table cellpadding="3" cellspacing="0" class="stats-table">'; $out .= '<tr class="bgColor2"><td colspan="3">' . IconUtility::getSpriteIconForRecord('sys_dmail', $row) . htmlspecialchars($row['subject']) . '</td></tr>'; $out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_from') . '</td><td>' . htmlspecialchars($row['from_name'] . ' <' . htmlspecialchars($row['from_email']) . '>') . '</td><td>' . $from_info . '</td></tr>'; $out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_dmail') . '</td><td>' . BackendUtility::getProcessedValue('sys_dmail', 'type', $row['type']) . ': ' . $dmailData . '</td><td>' . $dmail_info . '</td></tr>'; $out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_mail') . '</td><td>' . BackendUtility::getProcessedValue('sys_dmail', 'sendOptions', $row['sendOptions']) . ($row['attachment'] ? '; ' : '') . BackendUtility::getProcessedValue('sys_dmail', 'attachment', $row['attachment']) . '</td><td>' . $mail_info . '</td></tr>'; $out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_delivery_begin_end') . '</td><td>' . $delBegin . ' / ' . $delEnd . '</td><td> </td></tr>'; $out .= '<tr class="bgColor4"><td>' . $GLOBALS["LANG"]->getLL('view_recipient_total_sent') . '</td><td>' . $totalRecip . ' / ' . $sentRecip . '</td><td> </td></tr>'; $out .= '</table>'; $out .= $this->doc->spacer(5); return $out; }