Esempio n. 1
0
global $mod_strings;
global $app_list_strings;
global $current_user;
$focus = new InboundEmail();
$focus->checkImap();
///////////////////////////////////////////////////////////////////////////////
////	I-E SYSTEM SETTINGS
////	handle saving settings
if (isset($_REQUEST['save']) && $_REQUEST['save'] == 'true') {
    $focus->saveInboundEmailSystemSettings('Case', $_REQUEST['inbound_email_case_macro']);
}
////	END I-E SYSTEM SETTINGS
///////////////////////////////////////////////////////////////////////////////
if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $ListView->setHeaderText("<a href='index.php?action=index&module=DynamicLayout&from_action=ListView&from_module=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT']) . "</a>");
}
$where = '';
$limit = '0';
$orderBy = 'date_entered';
$varName = $focus->object_name;
$allowByOverride = true;
$listView = new ListView();
$listView->initNewXTemplate('modules/InboundEmail/ListView.html', $mod_strings);
$listView->setHeaderTitle($mod_strings['LBL_MODULE_TITLE']);
echo $focus->getSystemSettingsForm();
$listView->show_export_button = false;
$listView->ignorePopulateOnly = TRUE;
//Always show all records, ignore save_query performance setting.
$listView->setQuery($where, $limit, $orderBy, 'InboundEmail', $allowByOverride);
$listView->xTemplateAssign("EDIT_INLINE_IMG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
$listView->processListView($focus, "main", "InboundEmail");
 public function testgetSystemSettingsForm()
 {
     $inboundEmail = new InboundEmail();
     $expected = "\t\t\t<form action=\"index.php\" method=\"post\" name=\"Macro\" id=\"form\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"module\" value=\"InboundEmail\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"ListView\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"save\" value=\"true\">\n\n\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input \ttitle=\"Save\"\n\t\t\t\t\t\t\t\taccessKey=\"a\"\n\t\t\t\t\t\t\t\tclass=\"button\"\n\t\t\t\t\t\t\t\tonclick=\"this.form.return_module.value='InboundEmail'; this.form.return_action.value='ListView';\"\n\t\t\t\t\t\t\t\ttype=\"submit\" name=\"Edit\" value=\"  Save  \">\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\n\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"detail view\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\" width='10%' NOWRAP scope=\"row\">\n\t\t\t\t\t\t<slot>\n\t\t\t\t\t\t\t<b>:</b>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td valign=\"top\" width='20%'>\n\t\t\t\t\t\t<slot>\n\t\t\t\t\t\t\t<input name=\"inbound_email_case_macro\" type=\"text\" value=\"[CASE:%1]\">\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td valign=\"top\" width='70%'>\n\t\t\t\t\t\t<slot>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t<i></i>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</form>";
     $result = $inboundEmail->getSystemSettingsForm();
     $this->assertSame($expected, $result);
 }