本文整理汇总了PHP中insert_popup_header函数的典型用法代码示例。如果您正苦于以下问题:PHP insert_popup_header函数的具体用法?PHP insert_popup_header怎么用?PHP insert_popup_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了insert_popup_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_page
/**
*
*/
function process_page()
{
global $theme;
global $mod_strings;
global $app_strings;
global $currentModule;
global $sugar_version, $sugar_config;
$output_html = '';
$where = '';
$where = $this->_get_where_clause();
$first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
$last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
$user_name = empty($_REQUEST['user_name']) ? '' : $_REQUEST['user_name'];
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
if (!$hide_clear_button) {
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value=' " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . " ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/Employees/Popup_picker.html');
$form->assign('MOD', $mod_strings);
$form->assign('APP', $app_strings);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('FIRST_NAME', $first_name);
$form->assign('LAST_NAME', $last_name);
$form->assign('USER_NAME', $user_name);
$form->assign('request_data', $request_data);
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
// create the listview
$seed_bean = BeanFactory::getBean('Employees');
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', 'user_name', 'EMPLOYEE');
$ListView->setModStrings($mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', 'EMPLOYEE');
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= insert_popup_footer();
return $output_html;
}
示例2: testinsert_popup_header
public function testinsert_popup_header()
{
//execute the method and test if it returns html/JS
//with includeJS true, generates more html
ob_start();
insert_popup_header();
$renderedContent1 = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0, strlen($renderedContent1));
//with includeJS false, generates less html
ob_start();
insert_popup_header('', false);
$renderedContent2 = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0, strlen($renderedContent2));
$this->assertGreaterThan(strlen($renderedContent2), strlen($renderedContent1));
}
示例3: process_page
/**
*
*/
function process_page()
{
global $theme;
global $focus;
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $currentModule;
global $odd_bg;
global $even_bg;
global $audit;
global $current_language;
$audit_list = Audit::get_audit_list();
$xtpl = new XTemplate('modules/Audit/Popup_picker.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
insert_popup_header($theme);
//output header
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>";
$mod_strings = return_module_language($current_language, $focus->module_dir);
$printImageURL = SugarThemeRegistry::current()->getImageURL('print.gif');
$titleExtra = <<<EOHTML
<a href="javascript:void window.open('index.php?{$GLOBALS['request_string']}','printwin','menubar=1,status=0,resizable=1,scrollbars=1,toolbar=0,location=1')" class='utilsLink'>
<!--not_in_theme!--><img src="{$printImageURL}" alt="{$GLOBALS['app_strings']['LNK_PRINT']}"></a>
<a href="javascript:void window.open('index.php?{$GLOBALS['request_string']}','printwin','menubar=1,status=0,resizable=1,scrollbars=1,toolbar=0,location=1')" class='utilsLink'>
{$GLOBALS['app_strings']['LNK_PRINT']}
</a>
EOHTML;
$params = array();
$params[] = translate('LBL_MODULE_NAME', $focus->module_dir);
$params[] = $focus->get_summary_text();
$params[] = translate('LBL_CHANGE_LOG', 'Audit');
echo str_replace('</div>', "<span class='utils'>{$titleExtra}</span></div>", getClassicModuleTitle($focus->module_dir, $params, false));
$oddRow = true;
$audited_fields = $focus->getAuditEnabledFieldDefinitions();
asort($audited_fields);
$fields = '';
$field_count = count($audited_fields);
$start_tag = "<table><tr><td >";
$end_tag = "</td></tr></table>";
if ($field_count > 0) {
$index = 0;
foreach ($audited_fields as $key => $value) {
$index++;
$vname = '';
if (isset($value['vname'])) {
$vname = $value['vname'];
} else {
if (isset($value['label'])) {
$vname = $value['label'];
}
}
$fields .= str_replace(':', '', translate($vname, $focus->module_dir));
if ($index < $field_count) {
$fields .= ", ";
}
}
echo $start_tag . translate('LBL_AUDITED_FIELDS', 'Audit') . $fields . $end_tag;
} else {
echo $start_tag . translate('LBL_AUDITED_FIELDS', 'Audit') . $end_tag;
}
foreach ($audit_list as $audit) {
if (empty($audit['before_value_string']) && empty($audit['after_value_string'])) {
$before_value = $audit['before_value_text'];
$after_value = $audit['after_value_text'];
} else {
$before_value = $audit['before_value_string'];
$after_value = $audit['after_value_string'];
}
// Let's run the audit data through the sugar field system
if (isset($audit['data_type'])) {
require_once 'include/SugarFields/SugarFieldHandler.php';
$vardef = array('name' => 'audit_field', 'type' => $audit['data_type']);
$field = SugarFieldHandler::getSugarField($audit['data_type']);
$before_value = $field->getChangeLogSmarty(array($vardef['name'] => $before_value), $vardef, array(), $vardef['name']);
$after_value = $field->getChangeLogSmarty(array($vardef['name'] => $after_value), $vardef, array(), $vardef['name']);
}
$activity_fields = array('ID' => $audit['id'], 'NAME' => $audit['field_name'], 'BEFORE_VALUE' => $before_value, 'AFTER_VALUE' => $after_value, 'CREATED_BY' => $audit['created_by'], 'DATE_CREATED' => $audit['date_created']);
$xtpl->assign("ACTIVITY", $activity_fields);
if ($oddRow) {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
} else {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("audit.row");
// Put the rows in.
}
//end foreach
$xtpl->parse("audit");
$xtpl->out("audit");
insert_popup_footer();
}
示例4: process_page
//.........这里部分代码省略.........
}
$history_list[] = array('name' => $email->name, 'id' => $email->id, 'type' => "Email", 'direction' => '', 'module' => "Emails", 'status' => '', 'parent_id' => $email->parent_id, 'parent_type' => $email->parent_type, 'parent_name' => $email->parent_name, 'contact_id' => $email->contact_id, 'contact_name' => $email->contact_name, 'date_modified' => $email->date_start . " " . $email->time_start, 'description' => $this->getEmailDetails($email), 'date_type' => $app_strings['DATA_TYPE_SENT'], 'sort_value' => strtotime($email->fetched_row['date_sent'] . ' GMT'));
}
//end Emails
// Bug 46439 'No email archived when clicking on View Summary' (All condition)
if (method_exists($focus, 'get_unlinked_email_query')) {
$queryArray = $focus->get_unlinked_email_query(array('return_as_array' => 'true'));
$query = $queryArray['select'];
$query .= $queryArray['from'];
if (!empty($queryArray['join_tables'])) {
foreach ($queryArray['join_tables'] as $join_table) {
if ($join_table != '') {
$query .= ', ' . $join_table . ' ';
}
}
}
$query .= $queryArray['join'];
$query .= $queryArray['where'];
$emails = new Email();
$focus_unlinked_emails_list = $emails->process_list_query($query, 0);
$focus_unlinked_emails_list = $focus_unlinked_emails_list['list'];
foreach ($focus_unlinked_emails_list as $email) {
$email->retrieve($email->id);
$history_list[] = array('name' => $email->name, 'id' => $email->id, 'type' => "Email", 'direction' => '', 'module' => "Emails", 'status' => '', 'parent_id' => $email->parent_id, 'parent_type' => $email->parent_type, 'parent_name' => $email->parent_name, 'contact_id' => $email->contact_id, 'contact_name' => $email->contact_name, 'date_modified' => $email->date_start . " " . $email->time_start, 'description' => $this->getEmailDetails($email), 'date_type' => $app_strings['DATA_TYPE_SENT'], 'sort_value' => strtotime($email->fetched_row['date_sent'] . ' GMT'));
}
}
//end Unlinked Emails
foreach ($focus_notes_list as $note) {
$history_list[] = array('name' => $note->name, 'id' => $note->id, 'type' => "Note", 'direction' => '', 'module' => "Notes", 'status' => '', 'parent_id' => $note->parent_id, 'parent_type' => $note->parent_type, 'parent_name' => $note->parent_name, 'contact_id' => $note->contact_id, 'contact_name' => $note->contact_name, 'date_modified' => $note->date_modified, 'description' => $this->formatDescription($note->description), 'date_type' => $app_strings['DATA_TYPE_MODIFIED'], 'sort_value' => strtotime($note->fetched_row['date_modified'] . ' GMT'));
if (!empty($note->filename)) {
$count = count($history_list);
$count--;
$history_list[$count]['filename'] = $note->filename;
$history_list[$count]['fileurl'] = UploadFile::get_url($note->filename, $note->id);
}
}
// end Notes
$xtpl = new XTemplate('modules/Activities/Popup_picker.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
insert_popup_header();
//output header
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>";
echo getClassicModuleTitle($focus->module_dir, array(translate('LBL_MODULE_NAME', $focus->module_dir), $focus->name), false);
echo "</td><td align='right' class='moduleTitle'>";
echo "<A href='javascript:print();' class='utilsLink'><img src='" . SugarThemeRegistry::current()->getImageURL("print.gif") . "' width='13' height='13' alt='" . $app_strings['LNK_PRINT'] . "' border='0' align='absmiddle'></a> <A href='javascript:print();' class='utilsLink'>" . $app_strings['LNK_PRINT'] . "</A>\n";
echo "</td></tr></table>";
$oddRow = true;
if (count($history_list) > 0) {
$history_list = array_csort($history_list, 'sort_value', SORT_DESC);
}
foreach ($history_list as $activity) {
$activity_fields = array('ID' => $activity['id'], 'NAME' => $activity['name'], 'MODULE' => $activity['module'], 'CONTACT_NAME' => $activity['contact_name'], 'CONTACT_ID' => $activity['contact_id'], 'PARENT_TYPE' => $activity['parent_type'], 'PARENT_NAME' => $activity['parent_name'], 'PARENT_ID' => $activity['parent_id'], 'DATE' => $activity['date_modified'], 'DESCRIPTION' => $activity['description'], 'DATE_TYPE' => $activity['date_type']);
if (empty($activity['direction'])) {
$activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
} else {
$activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']] . ' ' . $app_list_strings['activity_dom'][$activity['type']];
}
switch ($activity['type']) {
case 'Call':
$activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']];
break;
case 'Meeting':
$activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']];
break;
case 'Task':
$activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']];
break;
}
if (isset($activity['location'])) {
$activity_fields['LOCATION'] = $activity['location'];
}
if (isset($activity['filename'])) {
$activity_fields['ATTACHMENT'] = "<a href='index.php?entryPoint=download&id=" . $activity['id'] . "&type=Notes' target='_blank'>" . SugarThemeRegistry::current()->getImage("attachment", "alt='" . $activity['filename'] . "' border='0' align='absmiddle'") . "</a>";
}
if (isset($activity['parent_type'])) {
$activity_fields['PARENT_MODULE'] = $activity['parent_type'];
}
$xtpl->assign("ACTIVITY", $activity_fields);
$xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'] . '', 'border="0" alt="' . $activity_fields['NAME'] . '"'));
if ($oddRow) {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
} else {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
if (!empty($activity_fields['DESCRIPTION'])) {
$xtpl->parse("history.row.description");
}
$xtpl->parse("history.row");
// Put the rows in.
}
$xtpl->parse("history");
$xtpl->out("history");
insert_popup_footer();
}
示例5: process_page
//.........这里部分代码省略.........
$form->assign('APP', $app_strings);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('request_data', $request_data);
// CREATE STUFF
if ($this->_create) {
$form->assign('CREATEBUTTON', $createButton);
$form->assign('ADDFORMHEADER', $addformheader);
$form->assign('ADDFORM', $addform);
}
// CREATE STUFF
if (isset($this->_popupMeta['className'])) {
$seed_bean = new $this->_popupMeta['className']();
} else {
$seed_bean = new $this->_popupMeta['moduleMain']();
}
// assign search inputs to xtemplates
foreach (array_keys($searchInputs) as $key) {
if (!empty($_REQUEST[$key]) && (isset($seed_bean->field_name_map[$key]['type']) && $seed_bean->field_name_map[$key]['type'] == 'bool')) {
$form->assign(strtoupper($key), ' checked ');
} else {
$form->assign(strtoupper($key), $searchInputs[$key]);
}
}
if ($this->_create) {
$form->assign('CREATE', 'true');
} else {
$form->assign('CREATE', 'false');
}
// fill any doms
if (isset($this->_popupMeta['selectDoms'])) {
foreach ($this->_popupMeta['selectDoms'] as $key => $value) {
$form->assign($key, get_select_options_with_id($app_list_strings[$value['dom']], $value['searchInput']));
}
}
$form->assign('MULTI_SELECT', !empty($_REQUEST['mode']) ? strtoupper($_REQUEST['mode']) : '');
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
$ListView = new ListView();
$ListView->show_select_menu = false;
$ListView->show_delete_button = false;
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->multi_select_popup = $multi_select;
$ListView->xTemplate->assign('TAG_TYPE', 'A');
if (isset($this->_popupMeta['listTitle'])) {
$ListView->setHeaderTitle($this->_popupMeta['listTitle']);
} else {
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
}
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', $this->_popupMeta['orderBy'], $this->_popupMeta['varName']);
$ListView->setModStrings($mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', $this->_popupMeta['varName']);
$output_html .= ob_get_contents();
ob_end_clean();
$json = getJSONobj();
// decode then encode to escape "'s
$output_html .= "</form>\n\t\t<script type=\"text/javascript\">\n\t\tfunction save_checks(offset) {\n\t\t\tchecked_ids = Array();\n\t\t\tfor (i = 0; i < document.MassUpdate.elements.length; i++){\n\t\t\t\tif(document.MassUpdate.elements[i].name == 'mass[]' && document.MassUpdate.elements[i].checked) {\n\t\t\t\t\ttemp_string = '';\n\t\t\t\t\ttemp_string += '\"' + document.MassUpdate.elements[i].value + '\": {';\n\t\t\t\t\tfor(the_key in associated_javascript_data[document.MassUpdate.elements[i].value]) {\n\t\t\t\t\t\ttemp_string += '\"' + the_key + '\":\"' + associated_javascript_data[document.MassUpdate.elements[i].value][the_key] + '\",'; \n\t\t\t\t\t}\n\t\t\t\t\ttemp_string = temp_string.substring(0,temp_string.length - 1);\n\t\t\t\t\ttemp_string += '}';\n\t\t\t\t\tchecked_ids.push(temp_string);\n\t\t\t\t}\t\t\t\t \n\t\t\t}\n\t\t\tdocument.MassUpdate.saved_associated_data.value = escape('{' + checked_ids.join(',') + '}');\n\n\t\t\tdocument.MassUpdate.action.value = \"Popup\";\n\t\t\tdocument.MassUpdate.{$currentModule}" . '_' . strtoupper($this->_popupMeta['moduleMain']) . '_offset.value = offset;
document.MassUpdate.submit();
}
// reassigned the saved data from the saved checks
if(typeof(document.MassUpdate) != \'undefined\' && document.MassUpdate.saved_associated_data.value != \'\') {
temp_array = ' . (!empty($_REQUEST['saved_associated_data']) ? $json->encode($json->decode(urldecode($_REQUEST['saved_associated_data']))) : '\'\'') . ';
for(the_key in temp_array) {
associated_javascript_data[the_key] = temp_array[the_key];
}
}
// save checks across pages for multiselects
if(typeof(document.MassUpdate) != "undefined") {
checked_items = Array();
inputs_array = document.MassUpdate.elements;
for(wp = 0 ; wp < inputs_array.length; wp++) {
if(inputs_array[wp].name == "mass[]" && inputs_array[wp].style.display == "none") {
checked_items.push(inputs_array[wp].value);
}
}
for(i in checked_items) {
for(wp = 0 ; wp < inputs_array.length; wp++) {
if(inputs_array[wp].name == "mass[]" && inputs_array[wp].value == checked_items[i]) {
inputs_array[wp].checked = true;
}
}
}
}
</script>';
$output_html .= insert_popup_footer();
return $output_html;
}
示例6: process_page_for_address
/**
*
*/
function process_page_for_address()
{
global $theme;
global $mod_strings;
global $app_strings;
global $currentModule;
global $sugar_version, $sugar_config;
$output_html = '';
$where = '';
$where = $this->_get_where_clause();
$image_path = 'themes/' . $theme . '/images/';
$formBase = new ContactFormBase();
if (isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'save') {
$formBase->handleSave('', false, true);
}
$first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
$last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
$account_name = empty($_REQUEST['account_name']) ? '' : $_REQUEST['account_name'];
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
// TODO: cleanup the construction of $addform
$formbody = $formBase->getFormBody('', '', 'EmailEditView');
$addform = '<table><tr><td nowrap="nowrap" valign="top">' . str_replace('<br>', '</td><td nowrap="nowrap" valign="top"> ', $formbody) . '</td></tr></table>' . '<input type="hidden" name="action" value="Popup" />';
$formSave = <<<EOQ
\t\t<input type="submit" name="button" class="button" title="{$lbl_save_button_title}" accesskey="{$lbl_save_button_key}" value=" {$lbl_save_button_label} " />
\t\t<input type="button" name="button" class="button" title="{$app_strings['LBL_CANCEL_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_CANCEL_BUTTON_KEY']}" value="{$app_strings['LBL_CANCEL_BUTTON_LABEL']}" onclick="toggleDisplay('addform');" />
EOQ;
$createContact = <<<EOQ
\t\t<input type="button" name="showAdd" class="button" value="{$mod_strings['LNK_NEW_CONTACT']}" onclick="toggleDisplay('addform');" />
EOQ;
$addformheader = get_form_header($mod_strings['LNK_NEW_CONTACT'], $formSave, false);
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
if (!$hide_clear_button) {
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CLEAR_BUTTON_KEY'] . "' value=' " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . " ' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value=' " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . " ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/Contacts/Address_picker.html');
$form->assign('MOD', $mod_strings);
$form->assign('APP', $app_strings);
//$form->assign('CREATECONTACT', $createContact);
$form->assign('ADDFORMHEADER', $addformheader);
$form->assign('ADDFORM', $addform);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('FIRST_NAME', $first_name);
$form->assign('LAST_NAME', $last_name);
$form->assign('ACCOUNT_NAME', $account_name);
$form->assign('request_data', $request_data);
// fill in for mass update
$button = "<input type='hidden' name='module' value='Contacts'><input type='hidden' id='form_action' name='action' value='index'><input type='hidden' name='massupdate' value='true'><input type='hidden' name='delete' value='false'><input type='hidden' name='mass' value='Array'><input type='hidden' name='Update' value='Update'>";
if (isset($_REQUEST['mass']) && is_array($_REQUEST['mass'])) {
foreach (array_unique($_REQUEST['mass']) as $record) {
$button .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
}
}
$button .= "<input type='hidden' name='saved_associated_data' value=''>";
$button .= "<input type='hidden' name='query' value='true'>";
$button .= "<input type='hidden' name='close_window' value='true'>";
$button .= "<input type='hidden' name='html' value='change_address'>";
$button .= "<input type='hidden' name='account_name' value='{$account_name}'>";
$button .= "<span style='display: none'><textarea name='primary_address_street'>" . str_replace("<br>", "\n", $_REQUEST["primary_address_street"]) . "</textarea></span>";
$button .= "<input type='hidden' name='primary_address_city' value='" . $_REQUEST["primary_address_city"] . "'>";
$button .= "<input type='hidden' name='primary_address_state' value='" . $_REQUEST["primary_address_state"] . "'>";
$button .= "<input type='hidden' name='primary_address_postalcode' value='" . $_REQUEST["primary_address_postalcode"] . "'>";
$button .= "<input type='hidden' name='primary_address_country' value='" . $_REQUEST["primary_address_country"] . "'>";
$button .= "<input type='hidden' name='Contacts_CONTACT_offset' value=''>";
$button .= "<input title='" . $mod_strings['LBL_COPY_ADDRESS_CHECKED'] . "' class='button' LANGUAGE=javascript type='submit' name='button' value=' " . $mod_strings['LBL_COPY_ADDRESS_CHECKED'] . " '>\n";
$button .= "<input title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accessKey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' class='button' LANGUAGE=javascript onclick=\"window.close()\" type='submit' name='button' value=' " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . " '>\n";
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
//$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
//$form->parse('main.SearchHeader');
//$output_html .= $form->text('main.SearchHeader');
$output_html .= get_form_footer();
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
// create the listview
$seed_bean = new Contact();
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', '', 'CONTACT');
$ListView->setModStrings($mod_strings);
// Added
$ListView->process_for_popups = true;
ob_start();
$ListView->processListViewMulti($seed_bean, 'main', 'CONTACT');
$output_html .= ob_get_contents();
ob_end_clean();
//.........这里部分代码省略.........
示例7: process_page
/**
*
*/
function process_page()
{
global $theme;
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $currentModule;
global $sugar_version, $sugar_config;
$output_html = '';
$where = '';
$where = $this->_get_where_clause();
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
$status = empty($_REQUEST['status']) ? '' : $_REQUEST['status'];
$campaign_type = empty($_REQUEST['campaign_type']) ? '' : $_REQUEST['campaign_type'];
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
//START:FOR MULTI-SELECT
$multi_select = false;
if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
$multi_select = true;
$button .= "<input type='button' name='button' class='button' onclick=\"send_back_selected('Prospects',document.MassUpdate,'mass[]','" . $app_strings['ERR_NOTHING_SELECTED'] . "');\" title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_SELECT_BUTTON_KEY'] . "' value=' " . $app_strings['LBL_SELECT_BUTTON_LABEL'] . " ' />\n";
}
//END:FOR MULTI-SELECT
if (!$hide_clear_button) {
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CLEAR_BUTTON_KEY'] . "' value=' " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . " ' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value=' " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . " ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/Campaigns/Popup_picker.html');
$form->assign('MOD', $mod_strings);
$form->assign('APP', $app_strings);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('request_data', $request_data);
$form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
// Reset the sections that are already in the page so that they do not print again later.
$form->reset('main.SearchHeader');
// create the listview
$seed_bean = new Campaign();
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->multi_select_popup = $multi_select;
//FOR MULTI-SELECT
$ListView->xTemplate->assign("TAG_TYPE", "A");
//FOR MULTI-SELECT
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
//FOR MULTI-SELECT
$ListView->setHeaderText($button);
//FOR MULTI-SELECT
$ListView->setQuery($where, '', 'name', 'CAMPAIGN');
$ListView->setModStrings($mod_strings);
ob_start();
//$output_html .= get_form_header($mod_strings['LBL_LIST_FORM_TITLE'], $button, false); //FOR MULTI-SELECT
$ListView->processListView($seed_bean, 'main', 'CAMPAIGN');
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= insert_popup_footer();
return $output_html;
}
示例8: display
//.........这里部分代码省略.........
} else {
if (empty($searchdefs) && file_exists('custom/modules/' . $this->module . '/metadata/searchdefs.php')) {
require_once 'custom/modules/' . $this->module . '/metadata/searchdefs.php';
} else {
if (empty($searchdefs) && file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
}
}
}
//if you click the pagination button, it will populate the search criteria here
if (!empty($this->bean) && isset($_REQUEST[$this->module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
if (!empty($_REQUEST['current_query_by_page'])) {
$blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page');
$current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
foreach ($current_query_by_page as $search_key => $search_value) {
if ($search_key != $this->module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
if (!is_array($search_value)) {
$_REQUEST[$search_key] = securexss($search_value);
} else {
foreach ($search_value as $key => &$val) {
$val = securexss($val);
}
$_REQUEST[$search_key] = $search_value;
}
}
}
}
}
if (!empty($listViewDefs) && !empty($searchdefs)) {
require_once 'include/Popups/PopupSmarty.php';
$displayColumns = array();
$filter_fields = array();
$popup = new PopupSmarty($this->bean, $this->module);
foreach ($listViewDefs[$this->module] as $col => $params) {
$filter_fields[strtolower($col)] = true;
if (!empty($params['related_fields'])) {
foreach ($params['related_fields'] as $field) {
//id column is added by query construction function. This addition creates duplicates
//and causes issues in oracle. #10165
if ($field != 'id') {
$filter_fields[$field] = true;
}
}
}
if (!empty($params['default']) && $params['default']) {
$displayColumns[$col] = $params;
}
}
$popup->displayColumns = $displayColumns;
$popup->filter_fields = $filter_fields;
$popup->mergeDisplayColumns = true;
//check to see if popupdefs contains searchdefs
$popup->_popupMeta = $popupMeta;
$popup->listviewdefs = $listViewDefs;
$popup->searchdefs = $searchdefs;
if (isset($_REQUEST['query'])) {
$popup->searchForm->populateFromRequest();
}
$massUpdateData = '';
if (isset($_REQUEST['mass'])) {
foreach (array_unique($_REQUEST['mass']) as $record) {
$massUpdateData .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
}
}
$popup->massUpdateData = $massUpdateData;
$tpl = 'include/Popups/tpls/PopupGeneric.tpl';
if (file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupGeneric.tpl"))) {
$tpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupGeneric.tpl");
}
if (file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupHeader.tpl"))) {
$popup->headerTpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupHeader.tpl");
}
if (file_exists($this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupFooter.tpl"))) {
$popup->footerTpl = $this->getCustomFilePathIfExists("modules/{$this->module}/tpls/popupFooter.tpl");
}
$popup->setup($tpl);
//We should at this point show the header and javascript even if to_pdf is true.
//The insert_popup_header javascript is incomplete and shouldn't be relied on.
if (isset($this->options['show_all']) && $this->options['show_all'] == false) {
unset($this->options['show_all']);
$this->options['show_javascript'] = true;
$this->options['show_header'] = true;
$this->_displayJavascript();
}
insert_popup_header(null, false);
if (isset($this->override_popup['template_data']) && is_array($this->override_popup['template_data'])) {
$popup->th->ss->assign($this->override_popup['template_data']);
}
echo $popup->display();
} else {
if (file_exists('modules/' . $this->module . '/Popup_picker.php')) {
require_once 'modules/' . $this->module . '/Popup_picker.php';
} else {
require_once 'include/Popups/Popup_picker.php';
}
$popup = new Popup_Picker();
$popup->_hide_clear_button = true;
echo $popup->process_page();
}
}
示例9: process_page
/**
*
*/
function process_page()
{
global $theme;
global $focus;
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $currentModule;
global $odd_bg;
global $even_bg;
global $audit;
global $current_language;
$audit_list = Audit::get_audit_list();
$xtpl = new XTemplate('modules/Audit/Popup_picker.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
insert_popup_header($theme);
//output header
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>";
$focus_mod_strings = return_module_language($current_language, $focus->module_dir);
echo get_module_title($focus->module_dir, translate('LBL_MODULE_NAME', $focus->module_dir) . ": " . $focus->name, false);
echo "</td><td align='right' class='moduleTitle'>";
echo "<A href='javascript:print();' class='utilsLink'><img src='" . SugarThemeRegistry::current()->getImageURL("print.gif") . "' width='13' height='13' alt='" . $app_strings['LNK_PRINT'] . "' border='0' align='absmiddle'></a> <A href='javascript:print();' class='utilsLink'>" . $app_strings['LNK_PRINT'] . "</A>\n";
echo "</td></tr></table>";
$oddRow = true;
$audited_fields = $focus->getAuditEnabledFieldDefinitions();
asort($audited_fields);
$fields = '';
$field_count = count($audited_fields);
$start_tag = "<table><tr><td >";
$end_tag = "</td></tr></table>";
if ($field_count > 0) {
$index = 0;
foreach ($audited_fields as $key => $value) {
$index++;
$vname = '';
if (isset($value['vname'])) {
$vname = $value['vname'];
} else {
if (isset($value['label'])) {
$vname = $value['label'];
}
}
$fields .= str_replace(':', '', translate($vname, $focus->module_dir));
if ($index < $field_count) {
$fields .= ", ";
}
}
echo $start_tag . translate('LBL_AUDITED_FIELDS', 'Audit') . $fields . $end_tag;
} else {
echo $start_tag . translate('LBL_AUDITED_FIELDS', 'Audit') . $end_tag;
}
foreach ($audit_list as $audit) {
if (empty($audit['before_value_string']) && empty($audit['after_value_string'])) {
$before_value = $audit['before_value_text'];
$after_value = $audit['after_value_text'];
} else {
$before_value = $audit['before_value_string'];
$after_value = $audit['after_value_string'];
}
$activity_fields = array('ID' => $audit['id'], 'NAME' => $audit['field_name'], 'BEFORE_VALUE' => $before_value, 'AFTER_VALUE' => $after_value, 'CREATED_BY' => $audit['created_by'], 'DATE_CREATED' => $audit['date_created']);
$xtpl->assign("ACTIVITY", $activity_fields);
if ($oddRow) {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
} else {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("audit.row");
// Put the rows in.
}
//end foreach
$xtpl->parse("audit");
$xtpl->out("audit");
insert_popup_footer();
}
示例10: process_page
/**
*
*/
function process_page()
{
global $theme;
global $focus;
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $currentModule;
global $odd_bg;
global $even_bg;
global $image_path;
$theme_path = "themes/" . $theme . "/";
$image_path = 'themes/' . $theme . '/images/';
require_once $theme_path . 'layout_utils.php';
$history_list = array();
if (!empty($_REQUEST['record'])) {
$result = $focus->retrieve($_REQUEST['record']);
if ($result == null) {
sugar_die($app_strings['ERROR_NO_RECORD']);
}
}
if ($focus->object_name == "ProjectTask" || $focus->object_name == "Project") {
$focus_tasks_list = array();
} else {
$focus_tasks_list = $focus->get_linked_beans('tasks', 'Task');
}
$focus_meetings_list = $focus->get_linked_beans('meetings', 'Meeting');
$focus_calls_list = $focus->get_linked_beans('calls', 'Call');
$focus_emails_list = $focus->get_linked_beans('emails', 'Email');
$focus_notes_list = $focus->get_linked_beans('notes', 'Note');
foreach ($focus_tasks_list as $task) {
if ($task->date_due == '0000-00-00') {
$date_due = '';
} else {
$date_due = $task->date_due;
}
if ($task->status != "Not Started" && $task->status != "In Progress" && $task->status != "Pending Input") {
$history_list[] = array('name' => $task->name, 'id' => $task->id, 'type' => "Task", 'direction' => '', 'module' => "Tasks", 'status' => $task->status, 'parent_id' => $task->parent_id, 'parent_type' => $task->parent_type, 'parent_name' => $task->parent_name, 'contact_id' => $task->contact_id, 'contact_name' => $task->contact_name, 'date_modified' => $date_due, 'description' => $this->getTaskDetails($task), 'date_type' => 'Due:');
} else {
$open_activity_list[] = array('name' => $task->name, 'id' => $task->id, 'type' => "Task", 'direction' => '', 'module' => "Tasks", 'status' => $task->status, 'parent_id' => $task->parent_id, 'parent_type' => $task->parent_type, 'parent_name' => $task->parent_name, 'contact_id' => $task->contact_id, 'contact_name' => $task->contact_name, 'date_due' => $date_due, 'description' => $this->getTaskDetails($task), 'date_type' => 'Due:');
}
}
// end Tasks
foreach ($focus_meetings_list as $meeting) {
if ($meeting->status != "Planned") {
$history_list[] = array('name' => $meeting->name, 'id' => $meeting->id, 'type' => "Meeting", 'direction' => '', 'module' => "Meetings", 'status' => $meeting->status, 'parent_id' => $meeting->parent_id, 'parent_type' => $meeting->parent_type, 'parent_name' => $meeting->parent_name, 'contact_id' => $meeting->contact_id, 'contact_name' => $meeting->contact_name, 'date_modified' => $meeting->date_start, 'description' => $this->formatDescription($meeting->description), 'date_type' => 'Start:');
} else {
$open_activity_list[] = array('name' => $meeting->name, 'id' => $meeting->id, 'type' => "Meeting", 'direction' => '', 'module' => "Meetings", 'status' => $meeting->status, 'parent_id' => $meeting->parent_id, 'parent_type' => $meeting->parent_type, 'parent_name' => $meeting->parent_name, 'contact_id' => $meeting->contact_id, 'contact_name' => $meeting->contact_name, 'date_due' => $meeting->date_start, 'description' => $this->formatDescription($meeting->description), 'date_type' => 'Start:');
}
}
// end Meetings
foreach ($focus_calls_list as $call) {
if ($call->status != "Planned") {
$history_list[] = array('name' => $call->name, 'id' => $call->id, 'type' => "Call", 'direction' => $call->direction, 'module' => "Calls", 'status' => $call->status, 'parent_id' => $call->parent_id, 'parent_type' => $call->parent_type, 'parent_name' => $call->parent_name, 'contact_id' => $call->contact_id, 'contact_name' => $call->contact_name, 'date_modified' => $call->date_start, 'description' => $this->formatDescription($call->description), 'date_type' => 'Start:');
} else {
$open_activity_list[] = array('name' => $call->name, 'id' => $call->id, 'direction' => $call->direction, 'type' => "Call", 'module' => "Calls", 'status' => $call->status, 'parent_id' => $call->parent_id, 'parent_type' => $call->parent_type, 'parent_name' => $call->parent_name, 'contact_id' => $call->contact_id, 'contact_name' => $call->contact_name, 'date_due' => $call->date_start, 'description' => $this->formatDescription($call->description), 'date_type' => 'Start:');
}
}
// end Calls
foreach ($focus_emails_list as $email) {
$history_list[] = array('name' => $email->name, 'id' => $email->id, 'type' => "Email", 'direction' => '', 'module' => "Emails", 'status' => '', 'parent_id' => $email->parent_id, 'parent_type' => $email->parent_type, 'parent_name' => $email->parent_name, 'contact_id' => $email->contact_id, 'contact_name' => $email->contact_name, 'date_modified' => $email->date_start . " " . $email->time_start, 'description' => $this->getEmailDetails($email), 'date_type' => 'Sent:');
}
//end Emails
foreach ($focus_notes_list as $note) {
$history_list[] = array('name' => $note->name, 'id' => $note->id, 'type' => "Note", 'direction' => '', 'module' => "Notes", 'status' => '', 'parent_id' => $note->parent_id, 'parent_type' => $note->parent_type, 'parent_name' => $note->parent_name, 'contact_id' => $note->contact_id, 'contact_name' => $note->contact_name, 'date_modified' => $note->date_modified, 'description' => $this->formatDescription($note->description), 'date_type' => 'Modified:');
if (!empty($note->filename)) {
$count = count($history_list);
$count--;
$history_list[$count]['filename'] = $note->filename;
$history_list[$count]['fileurl'] = UploadFile::get_url($note->filename, $note->id);
}
}
// end Notes
$xtpl = new XTemplate('modules/Activities/Popup_picker.html');
$xtpl->assign('THEME', $theme);
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
insert_popup_header($theme);
//output header
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>";
echo get_module_title($focus->module_dir, $focus->module_dir . ": " . $focus->name, false);
echo "</td><td align='right' class='moduleTitle'>";
echo "<A href='javascript:print();' class='utilsLink'><img src='" . $image_path . "print.gif' width='13' height='13' alt='" . $app_strings['LNK_PRINT'] . "' border='0' align='absmiddle'></a> <A href='javascript:print();' class='utilsLink'>" . $app_strings['LNK_PRINT'] . "</A>\n";
echo "</td></tr></table>";
$oddRow = true;
if (count($history_list) > 0) {
$history_list = array_csort($history_list, 'date_modified', SORT_DESC);
}
foreach ($history_list as $activity) {
$activity_fields = array('ID' => $activity['id'], 'NAME' => $activity['name'], 'MODULE' => $activity['module'], 'CONTACT_NAME' => $activity['contact_name'], 'CONTACT_ID' => $activity['contact_id'], 'PARENT_TYPE' => $activity['parent_type'], 'PARENT_NAME' => $activity['parent_name'], 'PARENT_ID' => $activity['parent_id'], 'DATE' => $activity['date_modified'], 'DESCRIPTION' => $activity['description'], 'DATE_TYPE' => $activity['date_type']);
if (empty($activity['direction'])) {
$activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
} else {
$activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']] . ' ' . $app_list_strings['activity_dom'][$activity['type']];
}
switch ($activity['type']) {
case 'Call':
//.........这里部分代码省略.........
示例11: process_page
/**
*
*/
function process_page()
{
global $theme;
global $focus;
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $currentModule;
global $odd_bg;
global $even_bg;
global $image_path;
global $audit;
global $current_language;
global $sugar_version;
$theme_path = "themes/" . $theme . "/";
$image_path = 'themes/' . $theme . '/images/';
if (floatval(substr($sugar_version, 0, 3)) < 6.0) {
require_once $theme_path . 'layout_utils.php';
} else {
require_once 'include/utils/layout_utils.php';
}
$audit_list = Audit::get_audit_list();
$xtpl = new XTemplate('modules/Audit/Popup_picker.html');
$xtpl->assign('THEME', $theme);
$xtpl->assign('MOD', return_module_language($current_language, 'Audit'));
$xtpl->assign('APP', $app_strings);
insert_popup_header($theme);
//output header
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>";
$focus_mod_strings = return_module_language($current_language, $focus->module_dir);
echo get_module_title($focus->module_dir, translate('LBL_MODULE_NAME', $focus->module_dir) . ": " . $focus->name, false);
echo "</td><td align='right' class='moduleTitle'>";
echo "<A href='javascript:print();' class='utilsLink'><img src='" . $image_path . "print.gif' width='13' height='13' alt='" . $app_strings['LNK_PRINT'] . "' border='0' align='absmiddle'></a> <A href='javascript:print();' class='utilsLink'>" . $app_strings['LNK_PRINT'] . "</A>\n";
echo "</td></tr></table>";
$oddRow = true;
$audited_fields = $focus->getAuditEnabledFieldDefinitions();
asort($audited_fields);
$fields = '';
$field_count = count($audited_fields);
$start_tag = "<table><tr><td class=\"listViewPaginationLinkS1\">";
$end_tag = "</td></tr></table>";
if ($field_count > 0) {
$index = 0;
foreach ($audited_fields as $key => $value) {
$index++;
$vname = '';
if (isset($value['vname'])) {
$vname = $value['vname'];
} else {
if (isset($value['label'])) {
$vname = $value['label'];
}
}
$fields .= str_replace(':', '', translate($vname, $focus->module_dir));
if ($index < $field_count) {
$fields .= ", ";
}
}
echo $start_tag . translate('LBL_AUDITED_FIELDS', 'Audit') . $fields . $end_tag;
} else {
echo $start_tag . translate('LBL_AUDITED_FIELDS', 'Audit') . $end_tag;
}
foreach ($audit_list as $audit) {
if (isset($audit['before_value_string']) || isset($audit['after_value_string'])) {
$before_value = $audit['before_value_string'];
$after_value = $audit['after_value_string'];
} else {
// show textblocks correctly formatted.
// TODO: be careful of security implications
$before_value = from_html($audit['before_value_text']);
$after_value = from_html($audit['after_value_text']);
}
$activity_fields = array('ID' => $audit['id'], 'NAME' => $audit['field_name'], 'BEFORE_VALUE' => $before_value, 'AFTER_VALUE' => $after_value, 'CREATED_BY' => $audit['created_by'], 'DATE_CREATED' => $audit['date_created']);
$xtpl->assign("ACTIVITY", $activity_fields);
if ($oddRow) {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
$xtpl->assign("BG_COLOR", $odd_bg);
} else {
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
$xtpl->assign("BG_COLOR", $even_bg);
}
$oddRow = !$oddRow;
$xtpl->parse("audit.row");
// Put the rows in.
}
//end foreach
$xtpl->parse("audit");
$xtpl->out("audit");
insert_popup_footer();
}
示例12: display
function display()
{
global $popupMeta, $mod_strings;
if (isset($_REQUEST['metadata']) && strpos($_REQUEST['metadata'], "..") !== false) {
die("Directory navigation attack denied.");
}
if (!empty($_REQUEST['metadata']) && $_REQUEST['metadata'] != 'undefined' && file_exists('modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php')) {
// if custom metadata is requested
require_once 'modules/' . $this->module . '/metadata/' . $_REQUEST['metadata'] . '.php';
} elseif (file_exists('custom/modules/' . $this->module . '/metadata/popupdefs.php')) {
require_once 'custom/modules/' . $this->module . '/metadata/popupdefs.php';
} elseif (file_exists('modules/' . $this->module . '/metadata/popupdefs.php')) {
require_once 'modules/' . $this->module . '/metadata/popupdefs.php';
}
if (!empty($popupMeta) && !empty($popupMeta['listviewdefs'])) {
if (is_array($popupMeta['listviewdefs'])) {
//if we have an array, then we are not going to include a file, but rather the
//listviewdefs will be defined directly in the popupdefs file
$listViewDefs[$this->module] = $popupMeta['listviewdefs'];
} else {
//otherwise include the file
require_once $popupMeta['listviewdefs'];
}
} elseif (file_exists('custom/modules/' . $this->module . '/metadata/listviewdefs.php')) {
require_once 'custom/modules/' . $this->module . '/metadata/listviewdefs.php';
} elseif (file_exists('modules/' . $this->module . '/metadata/listviewdefs.php')) {
require_once 'modules/' . $this->module . '/metadata/listviewdefs.php';
}
//check for searchdefs as well
if (!empty($popupMeta) && !empty($popupMeta['searchdefs'])) {
if (is_array($popupMeta['searchdefs'])) {
//if we have an array, then we are not going to include a file, but rather the
//searchdefs will be defined directly in the popupdefs file
$searchdefs[$this->module]['layout']['advanced_search'] = $popupMeta['searchdefs'];
} else {
//otherwise include the file
require_once $popupMeta['searchdefs'];
}
} else {
if (empty($searchdefs) && file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
}
}
if (!empty($this->bean) && isset($_REQUEST[$this->module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
//if you click the pagination button, it will poplate the search criteria here
if (!empty($_REQUEST['current_query_by_page'])) {
$blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'lvso', 'sortOrder', 'orderBy', 'request_data', 'current_query_by_page');
$current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
foreach ($current_query_by_page as $search_key => $search_value) {
if ($search_key != $this->module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
$_REQUEST[$search_key] = $search_value;
}
}
}
}
if (!empty($listViewDefs) && !empty($searchdefs)) {
require_once 'include/Popups/PopupSmarty.php';
$displayColumns = array();
$filter_fields = array();
$popup = new PopupSmarty($this->bean, $this->module);
foreach ($listViewDefs[$this->module] as $col => $params) {
$filter_fields[strtolower($col)] = true;
if (!empty($params['related_fields'])) {
foreach ($params['related_fields'] as $field) {
//id column is added by query construction function. This addition creates duplicates
//and causes issues in oracle. #10165
if ($field != 'id') {
$filter_fields[$field] = true;
}
}
}
if (!empty($params['default']) && $params['default'] && $col != 'TEAM_NAME') {
$displayColumns[$col] = $params;
}
}
$popup->displayColumns = $displayColumns;
$popup->filter_fields = $filter_fields;
//check to see if popupdes contains searchdefs
$popup->_popupMeta = $popupMeta;
$popup->listviewdefs = $listViewDefs;
$popup->searchdefs = $searchdefs;
if (isset($_REQUEST['query'])) {
$popup->searchForm->populateFromRequest();
}
$massUpdateData = '';
if (isset($_REQUEST['mass'])) {
foreach (array_unique($_REQUEST['mass']) as $record) {
$massUpdateData .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
}
}
$popup->massUpdateData = $massUpdateData;
$popup->setup('include/Popups/tpls/PopupGeneric.tpl');
insert_popup_header();
echo $popup->display();
} else {
if (file_exists('modules/' . $this->module . '/Popup_picker.php')) {
require_once 'modules/' . $this->module . '/Popup_picker.php';
} else {
require_once 'include/Popups/Popup_picker.php';
}
//.........这里部分代码省略.........
示例13: display
//.........这里部分代码省略.........
if (isset($_REQUEST['isPopup']) && $_REQUEST['isPopup'] == 1 && !empty($_REQUEST['elemBaseName'])) {
$isPopup = true;
} else {
$isPopup = false;
}
// bug50952 - must actually make sure we can log in, not just that we've got a EAPM record
// getLoginInfo only checks to see if user has logged in correctly ONCE to ExternalAPI
// Need to manually attempt to fetch the EAPM record, we don't want to give them the signup screen when they just have a deactivated account.
$eapmBean = EAPM::getLoginInfo($apiName, true);
$api = ExternalAPIFactory::loadAPI($apiName, true);
$validSession = true;
if (!empty($eapmBean)) {
try {
$api->loadEAPM($eapmBean);
// $api->checkLogin() does the same thing as quickCheckLogin plus actually makes sure the user CAN log in to the API currently
$loginCheck = $api->checkLogin($eapmBean);
if (isset($loginCheck['success']) && !$loginCheck['success']) {
$validSession = false;
}
} catch (Exception $ex) {
$validSession = false;
Log::error(string_format($mod_strings['ERR_INVALID_EXTERNAL_API_LOGIN'], [$apiName]));
}
}
if (!$validSession || empty($eapmBean)) {
// Bug #49987 : Documents view.extdoc.php doesn't allow custom override
$tpl_file = get_custom_file_if_exists('include/externalAPI/' . $apiName . '/' . $apiName . 'Signup.' . $GLOBALS['current_language'] . '.tpl');
if (file_exists($tpl_file)) {
$smarty = new Sugar_Smarty();
echo $smarty->fetch($tpl_file);
} else {
$output = string_format(translate('LBL_ERR_FAILED_QUICKCHECK', 'EAPM'), [$apiName]);
$output .= '<form method="POST" target="_EAPM_CHECK" action="index.php">';
$output .= '<input type="hidden" name="module" value="EAPM">';
$output .= '<input type="hidden" name="action" value="Save">';
$output .= '<input type="hidden" name="record" value="' . $eapmBean->id . '">';
$output .= '<input type="hidden" name="active" value="1">';
$output .= '<input type="hidden" name="closeWhenDone" value="1">';
$output .= '<input type="hidden" name="refreshParentWindow" value="1">';
$output .= '<br><input type="submit" value="' . $GLOBALS['app_strings']['LBL_EMAIL_OK'] . '"> ';
$output .= '<input type="button" onclick="lastLoadedMenu=undefined;DCMenu.closeOverlay();return false;" value="' . $GLOBALS['app_strings']['LBL_CANCEL_BUTTON_LABEL'] . '">';
$output .= '</form>';
echo $output;
}
return;
}
$searchDataLower = $api->searchDoc($file_search, true);
// In order to emulate the list views for the SugarFields, I need to uppercase all of the key names.
$searchData = [];
if (is_array($searchDataLower)) {
foreach ($searchDataLower as $row) {
$newRow = [];
foreach ($row as $key => $value) {
$newRow[strtoupper($key)] = $value;
}
if ($isPopup) {
// We are running as a popup window, we need to replace the direct url with some javascript
$newRow['DOC_URL'] = "javascript:window.opener.SUGAR.field.file.populateFromPopup('" . addslashes($_REQUEST['elemBaseName']) . "','" . addslashes($newRow['ID']) . "','" . addslashes($newRow['NAME']) . "','" . addslashes($newRow['URL']) . "','" . addslashes($newRow['URL']) . "'); window.close();";
} else {
$newRow['DOC_URL'] = $newRow['URL'];
}
$searchData[] = $newRow;
}
}
$displayColumns = ['NAME' => ['label' => 'LBL_LIST_EXT_DOCUMENT_NAME', 'type' => 'varchar', 'link' => true], 'DATE_MODIFIED' => ['label' => 'LBL_DATE', 'type' => 'date']];
$ss = new Sugar_Smarty();
$ss->assign('searchFieldLabel', translate('LBL_SEARCH_EXTERNAL_DOCUMENT', 'Documents'));
$ss->assign('displayedNote', translate('LBL_EXTERNAL_DOCUMENT_NOTE', 'Documents'));
$ss->assign('APP', $GLOBALS['app_strings']);
$ss->assign('MOD', $GLOBALS['mod_strings']);
$ss->assign('data', $searchData);
$ss->assign('displayColumns', $displayColumns);
$ss->assign('imgPath', SugarThemeRegistry::current()->getImageURL($apiName . '_image_inline.png'));
if ($isPopup) {
$ss->assign('linkTarget', '');
$ss->assign('isPopup', 1);
$ss->assign('elemBaseName', $_REQUEST['elemBaseName']);
} else {
$ss->assign('linkTarget', '_new');
$ss->assign('isPopup', 0);
$ss->assign('elemBaseName', '');
}
$ss->assign('apiName', $apiName);
$ss->assign('DCSEARCH', $file_search);
if ($isPopup) {
// Need the popup header... I feel so dirty.
ob_start();
echo '<div class="dccontent">';
insert_popup_header($GLOBALS['theme'], false);
$output_html = ob_get_contents();
ob_end_clean();
$output_html .= get_form_header(translate('LBL_SEARCH_FORM_TITLE', 'Documents'), '', false);
echo $output_html;
}
$ss->display('modules/Documents/tpls/view.extdoc.tpl');
if ($isPopup) {
// Close the dccontent div
echo '</div>';
}
}
示例14: display
public function display()
{
if (isset($_REQUEST['name_basic'])) {
$file_search = trim($_REQUEST['name_basic']);
} else {
$file_search = '';
}
if (!isset($_REQUEST['apiName'])) {
$apiName = 'LotusLive';
} else {
$tmpApi = ExternalAPIFactory::loadAPI($_REQUEST['apiName'], true);
if ($tmpApi === false) {
$GLOBALS['log']->error('The user attempted to access an invalid external API (' . $_REQUEST['apiName'] . ')');
return;
}
$apiName = $_REQUEST['apiName'];
}
// See if we are running as a popup window
if (isset($_REQUEST['isPopup']) && $_REQUEST['isPopup'] == 1 && !empty($_REQUEST['elemBaseName'])) {
$isPopup = true;
} else {
$isPopup = false;
}
// Need to manually attempt to fetch the EAPM record, we don't want to give them the signup screen when they just have a deactivated account.
if (!($eapmBean = EAPM::getLoginInfo($apiName, true))) {
$smarty = new Sugar_Smarty();
echo $smarty->fetch('include/externalAPI/' . $apiName . '/' . $apiName . 'Signup.' . $GLOBALS['current_language'] . '.tpl');
return;
}
$api = ExternalAPIFactory::loadAPI($apiName, true);
$api->loadEAPM($eapmBean);
$quickCheck = $api->quickCheckLogin();
if (!$quickCheck['success']) {
$errorMessage = string_format(translate('LBL_ERR_FAILED_QUICKCHECK', 'EAPM'), array($apiName));
$errorMessage .= '<form method="POST" target="_EAPM_CHECK" action="index.php">';
$errorMessage .= '<input type="hidden" name="module" value="EAPM">';
$errorMessage .= '<input type="hidden" name="action" value="Save">';
$errorMessage .= '<input type="hidden" name="record" value="' . $eapmBean->id . '">';
$errorMessage .= '<input type="hidden" name="active" value="1">';
$errorMessage .= '<input type="hidden" name="closeWhenDone" value="1">';
$errorMessage .= '<input type="hidden" name="refreshParentWindow" value="1">';
$errorMessage .= '<br><input type="submit" value="' . $GLOBALS['app_strings']['LBL_EMAIL_OK'] . '"> ';
$errorMessage .= '<input type="button" onclick="lastLoadedMenu=undefined;DCMenu.closeOverlay();return false;" value="' . $GLOBALS['app_strings']['LBL_CANCEL_BUTTON_LABEL'] . '">';
$errorMessage .= '</form>';
echo $errorMessage;
return;
}
$searchDataLower = $api->searchDoc($file_search, true);
// In order to emulate the list views for the SugarFields, I need to uppercase all of the key names.
$searchData = array();
if (is_array($searchDataLower)) {
foreach ($searchDataLower as $row) {
$newRow = array();
foreach ($row as $key => $value) {
$newRow[strtoupper($key)] = $value;
}
if ($isPopup) {
// We are running as a popup window, we need to replace the direct url with some javascript
$newRow['DOC_URL'] = "javascript:window.opener.SUGAR.field.file.populateFromPopup('" . addslashes($_REQUEST['elemBaseName']) . "','" . addslashes($newRow['ID']) . "','" . addslashes($newRow['NAME']) . "','" . addslashes($newRow['URL']) . "','" . addslashes($newRow['URL']) . "'); window.close();";
} else {
$newRow['DOC_URL'] = $newRow['URL'];
}
$searchData[] = $newRow;
}
}
$displayColumns = array('NAME' => array('label' => 'LBL_LIST_EXT_DOCUMENT_NAME', 'type' => 'varchar', 'link' => true), 'DATE_MODIFIED' => array('label' => 'LBL_DATE', 'type' => 'date'));
$ss = new Sugar_Smarty();
$ss->assign('searchFieldLabel', translate('LBL_SEARCH_EXTERNAL_DOCUMENT', 'Documents'));
$ss->assign('displayedNote', translate('LBL_EXTERNAL_DOCUMENT_NOTE', 'Documents'));
$ss->assign('APP', $GLOBALS['app_strings']);
$ss->assign('MOD', $GLOBALS['mod_strings']);
$ss->assign('data', $searchData);
$ss->assign('displayColumns', $displayColumns);
$ss->assign('imgPath', SugarThemeRegistry::current()->getImageURL($apiName . '_image_inline.png'));
if ($isPopup) {
$ss->assign('linkTarget', '');
$ss->assign('isPopup', 1);
$ss->assign('elemBaseName', $_REQUEST['elemBaseName']);
} else {
$ss->assign('linkTarget', '_new');
$ss->assign('isPopup', 0);
$ss->assign('elemBaseName', '');
}
$ss->assign('apiName', $apiName);
$ss->assign('DCSEARCH', $file_search);
if ($isPopup) {
// Need the popup header... I feel so dirty.
ob_start();
echo '<div class="dccontent">';
insert_popup_header($GLOBALS['theme']);
$output_html = ob_get_contents();
ob_end_clean();
$output_html .= get_form_header(translate('LBL_SEARCH_FORM_TITLE', 'Documents'), '', false);
echo $output_html;
}
$ss->display('modules/Documents/tpls/view.extdoc.tpl');
if ($isPopup) {
// Close the dccontent div
echo '</div>';
}
//.........这里部分代码省略.........
示例15: return_module_language
require_once 'modules/Users/UserSignature.php';
global $app_strings;
global $app_list_strings;
global $curent_language;
$mod_strings = return_module_language($current_language, $currentModule);
$focus = new UserSignature();
if (isset($_REQUEST['record']) && !empty($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
}
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
$GLOBALS['log']->info('EmailTemplate detail view');
///////////////////////////////////////////////////////////////////////////////
//// OUTPUT
echo insert_popup_header();
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SIGNATURE'] . ' ' . $focus->name, true);
$xtpl = new XTemplate('modules/Users/UserSignatureEditView.html');
$xtpl->assign('MOD', $mod_strings);
$xtpl->assign('APP', $app_strings);
$xtpl->assign('CANCEL_SCRIPT', 'window.close()');
if (isset($_REQUEST['return_module'])) {
$xtpl->assign('RETURN_MODULE', $_REQUEST['return_module']);
}
if (isset($_REQUEST['return_action'])) {
$xtpl->assign('RETURN_ACTION', $_REQUEST['return_action']);
}
if (isset($_REQUEST['return_id'])) {
$xtpl->assign('RETURN_ID', $_REQUEST['return_id']);
}
// handle Create $module then Cancel