function display_error_import() { $message = $_SESSION['import_error']; global $import_mod_strings; global $theme; global $mod_strings; global $app_strings; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; require_once $theme_path . 'layout_utils.php'; $GLOBALS['log']->info("Upload Error"); $xtpl = new XTemplate('modules/Import/error.html'); $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'], true); echo "\n</p>\n"; if (isset($_REQUEST['return_module'])) { $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']); } if (isset($_REQUEST['return_action'])) { $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']); } $xtpl->assign("THEME", $theme); $xtpl->assign("IMAGE_PATH", $image_path); $xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']); $xtpl->assign("MODULE", $_REQUEST['module']); $xtpl->assign("MESSAGE", $message); $xtpl->parse("main"); $xtpl->out("main"); }
function printShow(XTemplate &$tpl) { $rows = SingleDB::getInstance()->getAllOrders(); if (count($rows) == 0) { echo EMPTY_TABLE; $tpl->parse("page.showPage.backForm"); $tpl->parse("page.showPage"); $tpl->parse("page"); $tpl->out("page"); } else { $tpl->parse("page.showPage.backForm"); foreach ($rows as $row) { $showArray = array("ind" => $row[0], "order" => $row[1], "cost" => $row[2], "rubSel" => $row[3] == 1 ? "selected" : "", "usdSel" => $row[3] == 2 ? "selected" : "", "card_num" => $row[4], "card_holder" => $row[5], "card_expMonth" => $row[6], "card_expYear" => $row[7], "card_cvv" => $row[8]); $tpl->assign("showArray", $showArray); $tpl->parse("page.showPage.showForm.payRow"); } $tpl->parse("page.showPage.showForm"); $tpl->parse("page.showPage"); $tpl->parse("page"); $tpl->out("page"); } }
public function Display($cur_pg = null) { $xtemp = new XTemplate("header.html", __PATH_HTML__); if (is_array($cur_pg)) { $xtemp->assign('MENU_' . $cur_pg[0], 'current'); $xtemp->assign('SUBMENU_' . $cur_pg[1], 'current'); } else { $xtemp->assign('MENU_' . $cur_pg, 'current'); } $xtemp->assign("SITE_ROOT", __SITE__); $xtemp->assign("IMAGE_PATH", __PATH_IMAGES__); $xtemp->parse("MAIN"); $xtemp->out("MAIN"); }
public function Display($scripts, $css) { $xtemp = new XTemplate("meta.html", __PATH_HTML__); $xtemp->assign("SCRIPT_ROOT", __PATH_JAVASCRIPT__); $xtemp->assign("STYLE_ROOT", __PATH_CSS__); foreach ($scripts as $script) { $xtemp->assign("FILE", $script); $xtemp->parse("MAIN.JAVASCRIPT"); } foreach ($css as $stylesheet) { $xtemp->assign("FILE", $stylesheet); $xtemp->parse("MAIN.STYLESHEET"); } $xtemp->parse("MAIN"); $xtemp->out("MAIN"); }
function mostrar_pagina($archivo, $contenido) { global $_lang; global $_languages; global $_roles; global $_titles; $page = array(); $page['CONTENT'] = $contenido->text('content'); // Creamos la template de la pagina, y le asignamos el titulo y contenido $pagina = new XTemplate(ROOT_FOLDER . "/templates/{$_lang}/layout.html"); $pagina->assign('PAGE', arrayUpper($page)); $pagina->assign('TITULOLINK', arrayUpper($_titles['links'])); $pagina->assign('TITULONOMBRE', arrayUpper($_titles['nombres'])); // Le asignamos el codigo javascript si lo tiene if (file_exists("scripts/{$archivo}.js")) { $pagina->assign('JAVASCRIPT', $archivo); $pagina->parse('page.javascript'); } /// Incluimos los idiomas restantes unset($_languages[$_lang]); $i = 0; foreach ($_languages as $key => $value) { // Only for the first language if ($i++) { $pagina->parse('page.idioma.siguiente'); } $pagina->assign('LANG', array('VALUE' => $value, 'URL' => url(null, array('lang' => $key)))); $pagina->parse('page.idioma'); } // Rellena los datos de la sesiones si está logueado if (isset($_SESSION['id_miembro'])) { // Obtiene el rol del usuario $pagina->assign('ROL', array('NAME' => $_SESSION['privilegios'] === INVITADO ? $_roles[MIEMBRO] : $_roles[INVITADO], 'URL' => url(null, array('rol' => 1)))); $pagina->assign('MIEMBRO', array('ID' => $_SESSION['id_miembro'], 'NOMBRE' => $_SESSION['nombre'], 'URL' => url('miembro_ver_ficha.php', array('id_miembro', $_SESSION['id_miembro'])))); $pagina->parse('page.miembro'); if ($_SESSION['privilegios'] === ADMIN) { $pagina->parse('page.administracion'); } } else { // Si no esta logueado muestra el acceso $pagina->parse('page.acceder'); } // Parsea la pagina e imprime la pagina $pagina->parse('page'); $pagina->out('page'); die; }
public function Display($footer_images = array()) { $xtemp = new XTemplate("footer.html", __PATH_HTML__); $xtemp->assign("IMAGE_PATH", __PATH_IMAGES__); if (!empty($footer_images)) { $this->footer_images = $footer_images; $images = array(); for ($i = 0; $i <= 4; $i++) { $images[$i] = $this->getFooterImage($images); } $xtemp->assign('IMAGE_LIST', json_encode($this->footer_images)); $xtemp->assign('FOOTER_IMG', $images); $xtemp->parse('MAIN.PHOTOS'); } $xtemp->assign('YEAR', date('Y')); $xtemp->parse("MAIN"); $xtemp->out("MAIN"); }
/** * nv_site_theme() * * @param mixed $step * @param mixed $titletheme * @param mixed $contenttheme * @return */ function nv_site_theme($step, $titletheme, $contenttheme) { global $lang_module, $languageslist, $language_array, $global_config; $xtpl = new XTemplate('theme.tpl', NV_ROOTDIR . '/install/tpl/'); $xtpl->assign('BASE_SITEURL', NV_BASE_SITEURL); $xtpl->assign('NV_FILES_DIR', NV_FILES_DIR); $xtpl->assign('LANG_VARIABLE', NV_LANG_VARIABLE); $xtpl->assign('LANG_DATA', NV_LANG_DATA); $xtpl->assign('MAIN_TITLE', $titletheme); $xtpl->assign('MAIN_STEP', $step); $xtpl->assign('LANG', $lang_module); $xtpl->assign('VERSION', 'v' . $global_config['version']); $step_bar = array($lang_module['select_language'], $lang_module['check_chmod'], $lang_module['license'], $lang_module['check_server'], $lang_module['config_database'], $lang_module['website_info'], $lang_module['done']); foreach ($step_bar as $i => $step_bar_i) { $n = $i + 1; $class = ''; if ($step >= $n) { $class = " class=\""; $class .= $step > $n ? 'passed_step' : ''; $class .= $step == $n ? 'current_step' : ''; $class .= "\""; } $xtpl->assign('CLASS_STEP', $class); $xtpl->assign('STEP_BAR', $step_bar_i); $xtpl->assign('NUM', $n); $xtpl->parse('main.step_bar.loop'); } $xtpl->assign('LANGTYPESL', NV_LANG_DATA); $langname = $language_array[NV_LANG_DATA]['name']; $xtpl->assign('LANGNAMESL', $langname); foreach ($languageslist as $languageslist_i) { if (!empty($languageslist_i) and NV_LANG_DATA != $languageslist_i) { $xtpl->assign('LANGTYPE', $languageslist_i); $langname = $language_array[$languageslist_i]['name']; $xtpl->assign('LANGNAME', $langname); $xtpl->parse('main.looplang'); } } $xtpl->parse('main.step_bar'); $xtpl->assign('MAIN_CONTENT', $contenttheme); $xtpl->parse('main'); $xtpl->out('main'); }
include $pl; } /* ===== */ $out['head'] .= $R['code_noindex']; $out['subtitle'] = $title; require_once $cfg['system_dir'] . '/header.php'; $tpl_type = defined('COT_ADMIN') ? 'core' : 'module'; $t = new XTemplate(cot_tplfile('message', $tpl_type)); if (COT_AJAX) { $t->assign('AJAX_MODE', true); } $errmsg = $title; $title .= $usr['isadmin'] ? ' (#' . $msg . ')' : ''; $t->assign('MESSAGE_TITLE', $title); $t->assign('MESSAGE_BODY', $body); if ($msg == '920') { $confirm_no_url = preg_match("/^.+" . preg_quote($sys['domain'] . "/"), $_SERVER['HTTP_REFERER']) ? str_replace('&', '&', $_SERVER['HTTP_REFERER']) : cot_url('index'); if (preg_match('#[ "\':]#', base64_decode($redirect))) { $redirect = ''; } $t->assign(array('MESSAGE_CONFIRM_YES' => base64_decode($redirect), 'MESSAGE_CONFIRM_NO' => $confirm_no_url)); $t->parse('MAIN.MESSAGE_CONFIRM'); } /* === Hook === */ foreach (cot_getextplugins('message.tags') as $pl) { include $pl; } /* ===== */ $t->parse('MAIN'); $t->out('MAIN'); require_once $cfg['system_dir'] . '/footer.php';
$xtpl->assign('PTITLE', sprintf($lang_module['users_in_group_caption'], $groupsList[$id]['title'], $users)); $xtpl->assign('GID', $id); if (!empty($groupsList[$id]['users'])) { $sql = "SELECT `userid`, `username`, `full_name`, `email` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid` IN (" . $groupsList[$id]['users'] . ")"; $sql = $db->sql_query($sql); $a = 0; while ($row = $db->sql_fetchrow($sql, 2)) { $xtpl->assign('LOOP', $row); $xtpl->assign('CLASS', $a % 2 ? " class=\"second\"" : ""); $xtpl->parse('listUsers.ifExists.loop'); ++$a; } $xtpl->parse('listUsers.ifExists'); } $xtpl->parse('listUsers'); $xtpl->out('listUsers'); exit; } //Danh sach thanh vien if ($nv_Request->isset_request('userlist', 'get')) { $id = $nv_Request->get_int('userlist', 'get', 0); if (!isset($groupsList[$id])) { Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op); die; } $xtpl->assign('GID', $id); $xtpl->parse('userlist'); $contents = $xtpl->text('userlist'); include NV_ROOTDIR . "/includes/header.php"; echo nv_admin_theme($contents); include NV_ROOTDIR . "/includes/footer.php";
$email = $_POST['email']; $phone = $_POST['phone']; $cmt = $_POST['cmtnd']; $address = $_POST['address']; $p = $a->xl(); $date = $a->ngay(); $query = "INSERT INTO hoadon VALUES ('','{$name}','{$email}','{$phone}','{$cmt}','{$address}','','{$p}','','{$date}')"; mysql_query($query) or die(mysql_error()); $ht = new XTemplate("ht.php"); $ht->parse("main"); $content = $ht->text("main"); } break; case 'xoa': $query = "SELECT * FROM sanpham"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { if (isset($_SESSION[".{$row['id']}."]) == true) { unset($_SESSION[".{$row['id']}."]); } } break; } } $index = new XTemplate("home21.php"); $index->assign("content", $content); //$index->parse("main"); $index->assign("page", $phantrang); $index->parse("main"); $index->out("main");
/** * nv_info_die() * * @param string $page_title * @param mixed $info_title * @param mixed $info_content * @return */ function nv_info_die($page_title = "", $info_title, $info_content, $adminlink = 0) { global $lang_global, $global_config; if (empty($page_title)) { $page_title = $global_config['site_description']; } if (defined('NV_ADMIN') and isset($global_config['admin_theme']) and file_exists(NV_ROOTDIR . "/themes/" . $global_config['admin_theme'] . "/system/info_die.tpl")) { $tpl_path = NV_ROOTDIR . "/themes/" . $global_config['admin_theme'] . "/system"; } elseif (defined('NV_ADMIN') and file_exists(NV_ROOTDIR . "/themes/admin_default/system/info_die.tpl")) { $tpl_path = NV_ROOTDIR . "/themes/admin_default/system"; } elseif (isset($global_config['module_theme']) and file_exists(NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/system/info_die.tpl")) { $tpl_path = NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/system"; } elseif (isset($global_config['site_theme']) and file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/system/info_die.tpl")) { $tpl_path = NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/system"; } else { $tpl_path = NV_ROOTDIR . "/themes/default/system"; } $size = @getimagesize(NV_ROOTDIR . '/images/' . $global_config['site_logo']); $xtpl = new XTemplate("info_die.tpl", $tpl_path); $xtpl->assign('SITE_CHERSET', $global_config['site_charset']); $xtpl->assign('PAGE_TITLE', $page_title); $xtpl->assign('HOME_LINK', $global_config['site_url']); $xtpl->assign('LOGO', NV_BASE_SITEURL . "images/" . $global_config['site_logo']); $xtpl->assign('WIDTH', $size[0]); $xtpl->assign('HEIGHT', $size[1]); $xtpl->assign('INFO_TITLE', $info_title); $xtpl->assign('INFO_CONTENT', $info_content); $xtpl->assign('GO_HOMEPAGE', $lang_global['go_homepage']); if (defined('NV_IS_ADMIN')) { $xtpl->assign('ADMIN_LINK', NV_BASE_SITEURL . NV_ADMINDIR . "/index.php"); $xtpl->assign('GO_ADMINPAGE', $lang_global['admin_page']); $xtpl->parse('main.adminlink'); } $xtpl->parse('main'); include NV_ROOTDIR . "/includes/header.php"; $xtpl->out('main'); include NV_ROOTDIR . "/includes/footer.php"; die; }
} if (isset($_POST['handle']) && $_POST['handle'] == 'Save') { require_once 'modules/Contacts/ContactFormBase.php'; $contactForm = new ContactFormBase(); require_once 'modules/Accounts/AccountFormBase.php'; $accountForm = new AccountFormBase(); require_once 'modules/Opportunities/OpportunityFormBase.php'; $oppForm = new OpportunityFormBase(); if (!isset($_POST['selectedContact']) && !isset($_POST['ContinueContact'])) { $duplicateContacts = $contactForm->checkForDuplicates('Contacts'); if (isset($duplicateContacts)) { $formBody = $contactForm->buildTableForm($duplicateContacts); $xtpl->assign('FORMBODY', $formBody); $xtpl->parse('main.formnoborder'); $xtpl->parse('main'); $xtpl->out('main'); return; } } if (empty($_POST['selectedAccount']) && empty($_POST['ContinueAccount'])) { $duplicateAccounts = $accountForm->checkForDuplicates('Accounts'); if (isset($duplicateAccounts)) { $xtpl->assign('FORMBODY', $accountForm->buildTableForm($duplicateAccounts)); $xtpl->parse('main.formnoborder'); $xtpl->parse('main'); $xtpl->out('main'); return; } } if (isset($_POST['newopportunity']) && $_POST['newopportunity'] == 'on' && !isset($_POST['selectedOpportunity']) && !isset($_POST['ContinueOpportunity'])) { $duplicateOpps = $oppForm->checkForDuplicates('Opportunities');
header("Location: http://" . $_SERVER['HTTP_HOST'] . "/zayavki/auto/"); $template->parse("main.menu.newHelp"); break; case "panorama": panorama(); $template->parse("main.menu.oldHelp"); break; case "test": panorama(); break; default: allRequestsRequests(); $template->parse("main.menu.newHelp"); break; } } else { header("Location: http://" . $_SERVER['HTTP_HOST'] . "/zayavki/"); } } else { if ($client->isRegistered()) { allRequestsList(); $template->parse("main.menu.newHelp"); } else { header("Location: http://" . $_SERVER['HTTP_HOST'] . "/zayavki/"); } } //print_r($client); $template->parse("main.menu"); $template->parse("main"); $template->out("main");
$activity_fields['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$activity['accept_status']]; } } $activity_fields['TITLE'] = ''; if (!empty($activity['contact_name'])) { $activity_fields['TITLE'] .= $current_module_strings['LBL_LIST_CONTACT'] . ": " . $activity['contact_name']; } if (!empty($activity['parent_name'])) { $activity_fields['TITLE'] .= "\n" . $app_list_strings['record_type_display'][$activity['parent_type']] . ": " . $activity['parent_name']; } $xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'] . '', 'border="0" alt="' . $activity_fields['NAME'] . '"')); $xtpl->assign("ACTIVITY", $activity_fields); $xtpl->assign("BG_HILITE", $hilite_bg); $xtpl->assign("BG_CLICK", $click_bg); if ($oddRow) { $xtpl->assign("ROW_COLOR", 'oddListRow'); $xtpl->assign("BG_COLOR", $odd_bg); } else { $xtpl->assign("ROW_COLOR", 'evenListRow'); $xtpl->assign("BG_COLOR", $even_bg); } $oddRow = !$oddRow; $xtpl->parse("open_activity.row"); } // END FOREACH() $xtpl->parse("open_activity"); if (count($open_activity_list) > 0) { $xtpl->out("open_activity"); } else { echo "<i>" . $current_module_strings['NTC_NONE_SCHEDULED'] . "</i>"; }
echo "\n<p>\n"; echo ReportContainer::get_root_line_links($_REQUEST['record']); echo "<a href='index.php?module=ZuckerReportContainer&action=EditView&record=" . $_REQUEST['record'] . "'> (" . $app_strings['LBL_EDIT_BUTTON_LABEL'] . ")</a>"; echo "\n</p>\n"; } $xtpl = new XTemplate('modules/ZuckerReportContainer/DetailView.html'); $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); $xtpl->assign("THEME", $theme); $xtpl->assign("GRIDLINE", $gridline); $xtpl->assign("IMAGE_PATH", $image_path); if (!empty($container->description)) { $xtpl->assign("NAME", $container->name); $xtpl->assign("DESCRIPTION", nl2br($container->description)); $xtpl->parse("detail"); $xtpl->out("detail"); echo "<p/>\n"; } /* if(!empty($_REQUEST['createcontainername'])) { $newone = new ReportContainer(); $newone->name = $_REQUEST['createcontainername']; $newone->parent_id = $container->id; $newone->assigned_user_id = $current_user->id; $newone->team_id = $container->team_id; $newone->save(); } */ $button = ""; $button .= "<form action='index.php' method='post'>\n"; $button .= "<input type='hidden' name='module' value='ZuckerReportContainer'>\n";
/** * */ function process_page() { global $focus; global $mod_strings; global $app_strings; global $app_list_strings; global $currentModule; global $odd_bg; global $even_bg; global $timedate; $history_list = array(); if (!empty($_REQUEST['record'])) { $result = $focus->retrieve($_REQUEST['record']); if ($result == null) { sugar_die($app_strings['ERROR_NO_RECORD']); } } $activitiesRels = array('tasks' => 'Task', 'meetings' => 'Meeting', 'calls' => 'Call', 'emails' => 'Email', 'notes' => 'Note'); //Setup the arrays to store the linked records. foreach ($activitiesRels as $relMod => $beanName) { $varname = "focus_" . $relMod . "_list"; ${$varname} = array(); } foreach ($focus->get_linked_fields() as $field => $def) { if ($focus->load_relationship($field)) { $relTable = $focus->{$field}->getRelatedTableName(); if (in_array($relTable, array_keys($activitiesRels))) { $varname = "focus_" . $relTable . "_list"; ${$varname} = sugarArrayMerge(${$varname}, $focus->get_linked_beans($field, $activitiesRels[$relTable])); } } } foreach ($focus_tasks_list as $task) { $sort_date_time = ''; if (empty($task->date_due) || $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' => $app_strings['DATA_TYPE_DUE'], 'sort_value' => strtotime($task->fetched_row['date_due'] . ' GMT')); } 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' => $app_strings['DATA_TYPE_DUE']); } } // end Tasks foreach ($focus_meetings_list as $meeting) { if (empty($meeting->contact_id) && empty($meeting->contact_name)) { $meeting_contacts = $meeting->get_linked_beans('contacts', 'Contact'); if (!empty($meeting_contacts[0]->id) && !empty($meeting_contacts[0]->name)) { $meeting->contact_id = $meeting_contacts[0]->id; $meeting->contact_name = $meeting_contacts[0]->name; } } 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' => $app_strings['DATA_TYPE_START'], 'sort_value' => strtotime($meeting->fetched_row['date_start'] . ' GMT')); } 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' => $app_strings['DATA_TYPE_START']); } } // end Meetings foreach ($focus_calls_list as $call) { if (empty($call->contact_id) && empty($call->contact_name)) { $call_contacts = $call->get_linked_beans('contacts', 'Contact'); if (!empty($call_contacts[0]->id) && !empty($call_contacts[0]->name)) { $call->contact_id = $call_contacts[0]->id; $call->contact_name = $call_contacts[0]->name; } } 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' => $app_strings['DATA_TYPE_START'], 'sort_value' => strtotime($call->fetched_row['date_start'] . ' GMT')); } 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' => $app_strings['DATA_TYPE_START']); } } // end Calls foreach ($focus_emails_list as $email) { if (empty($email->contact_id) && empty($email->contact_name)) { $email_contacts = $email->get_linked_beans('contacts', 'Contact'); if (!empty($email_contacts[0]->id) && !empty($email_contacts[0]->name)) { $email->contact_id = $email_contacts[0]->id; $email->contact_name = $email_contacts[0]->name; } } $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(); }
/** * */ 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(); }
foreach ($focus_users_list as $user) { $user_fields = array('USER_NAME' => $user->user_name, 'FULL_NAME' => $user->first_name . " " . $user->last_name, 'ID' => $user->id, 'EMAIL' => $user->email1, 'PHONE_WORK' => $user->phone_work); $xtpl->assign("USER", $user_fields); if ($oddRow) { //todo move to themes $xtpl->assign("ROW_COLOR", 'oddListRow'); } else { //todo move to themes $xtpl->assign("ROW_COLOR", 'evenListRow'); } $oddRow = !$oddRow; $xtpl->parse("users.row"); // Put the rows in. } $xtpl->parse("users"); $xtpl->out("users"); $oddRow = true; print count($focus_contacts_list); foreach ($focus_contacts_list as $contact) { $contact_fields = array('FIRST_NAME' => $contact->first_name, 'LAST_NAME' => $contact->last_name, 'ACCOUNT_NAME' => $contact->account_name, 'ID' => $contact->id, 'EMAIL' => $contact->email1, 'PHONE_WORK' => $contact->phone_work); $xtpl->assign("CONTACT", $contact_fields); if ($oddRow) { //todo move to themes $xtpl->assign("ROW_COLOR", 'oddListRow'); } else { //todo move to themes $xtpl->assign("ROW_COLOR", 'evenListRow'); } $oddRow = !$oddRow; $xtpl->parse("contacts.row"); // Put the rows in.
// Quick search. echo get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], "", false); if (isset($_REQUEST['num'])) { $last_search['NUM'] = $_REQUEST['num']; } if (isset($_REQUEST['name'])) { $last_search['NAME'] = $_REQUEST['name']; } if (isset($_REQUEST['category'])) { $last_search['CATEGORY'] = $_REQUEST['category']; } if (isset($last_search)) { $form->assign("LAST_SEARCH", $last_search); } $form->parse("main.SearchHeader"); $form->out("main.SearchHeader"); echo get_form_footer(); $form->parse("main.SearchHeaderEnd"); $form->out("main.SearchHeaderEnd"); // Reset the sections that are already in the page so that they do not print again later. $form->reset("main.SearchHeader"); $form->reset("main.SearchHeaderEnd"); // Stick the form header out there. $ListView = new ListView(); $ListView->setXTemplate($form); $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']); $ListView->setHeaderText($button); $ListView->setQuery($where, "", "num, name", "MATERIAL"); $ListView->setModStrings($mod_strings); $ListView->process_for_popups = true; $ListView->processListView($seed_object, "main", "MATERIAL");
$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("open_activity.row"); // Put the rows in. } $xtpl->parse("open_activity"); $xtpl->out("open_activity"); echo "<BR>"; //requestdata $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array()); $json = getJSONobj(); $encoded_popup_request_data = $json->encode($popup_request_data); $button = "<form border='0' action='index.php' method='post' name='form' id='form'>\n"; $button .= "<input type='hidden' name='module'>\n"; $button .= "<input type='hidden' name='type' value='archived'>\n"; if ($currentModule == 'Accounts') { $button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='{$focus->id}'>\n<input type='hidden' name='parent_name' value='{$focus->name}'>\n"; } if ($currentModule == 'Opportunities') { $button .= "<input type='hidden' name='parent_type' value='Opportunities'>\n<input type='hidden' name='parent_id' value='{$focus->id}'>\n<input type='hidden' name='parent_name' value='{$focus->name}'>\n"; } elseif ($currentModule == 'Cases') { $button .= "<input type='hidden' name='parent_type' value='Cases'>\n<input type='hidden' name='parent_id' value='{$focus->id}'>\n<input type='hidden' name='parent_name' value='{$focus->name}'>\n";
/** * */ function process_page() { global $focus; global $mod_strings; global $app_strings; global $app_list_strings; global $currentModule; global $odd_bg; global $even_bg; global $timedate; $history_list = array(); if (!empty($_REQUEST['record'])) { $result = $focus->retrieve($_REQUEST['record']); if ($result == null) { sugar_die($app_strings['ERROR_NO_RECORD']); } } $activitiesRels = array('tasks' => 'Task', 'meetings' => 'Meeting', 'calls' => 'Call', 'emails' => 'Email', 'notes' => 'Note'); //Setup the arrays to store the linked records. foreach ($activitiesRels as $relMod => $beanName) { $varname = "focus_" . $relMod . "_list"; ${$varname} = array(); } foreach ($focus->get_linked_fields() as $field => $def) { if ($focus->load_relationship($field)) { $relTable = $focus->{$field}->getRelatedTableName(); if (in_array($relTable, array_keys($activitiesRels))) { $varname = "focus_" . $relTable . "_list"; ${$varname} = sugarArrayMerge(${$varname}, $focus->get_linked_beans($field, $activitiesRels[$relTable])); } } } foreach ($focus_tasks_list as $task) { $sort_date_time = ''; if ($task->date_due == '0000-00-00') { $date_due = ''; } else { $date_due = $task->date_due; } if (!empty($task->date_due) and !empty($task->time_due)) { $sort_date_time = $timedate->to_db_date_time($task->date_due, $task->time_due); $sort_date_time = implode(' ', $sort_date_time); // kbrill - Bug #16714 //$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true); } 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' => $app_strings['DATA_TYPE_DUE'], 'sort_value' => $sort_date_time); } 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' => $app_strings['DATA_TYPE_DUE']); } } // end Tasks foreach ($focus_meetings_list as $meeting) { if ($meeting->status != "Planned") { $sort_date_time = ''; if (!empty($meeting->date_start) and !empty($meeting->time_start)) { $sort_date_time = $timedate->to_db_date_time($meeting->date_start, $meeting->time_start); $sort_date_time = implode(' ', $sort_date_time); // kbrill - Bug #16714 //$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true); } $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' => $app_strings['DATA_TYPE_START'], 'sort_value' => $sort_date_time); } 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' => $app_strings['DATA_TYPE_START']); } } // end Meetings foreach ($focus_calls_list as $call) { if ($call->status != "Planned") { $sort_date_time = ''; if (!empty($call->date_start) and !empty($call->time_start)) { $sort_date_time = $timedate->to_db_date_time($call->date_start, $call->time_start); $sort_date_time = implode(' ', $sort_date_time); // kbrill - Bug #16714 //$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true); } elseif (!empty($call->date_start) && empty($call->time_start)) { //jc - Bug#19862 //for some reason the calls module does not populate the time_start variable in //this case, so the date_start attribute contains the information we need //to determine where in the history this call belongs. //using swap_formats to get from the format '03/31/2008 09:45pm' to the format //'2008-03-31 09:45:00' $sort_date_time = $timedate->swap_formats($call->date_start, $timedate->get_date_time_format(), $timedate->get_db_date_time_format()); } $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' => $app_strings['DATA_TYPE_START'], 'sort_value' => $sort_date_time); } 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' => $app_strings['DATA_TYPE_START']); } } // end Calls foreach ($focus_emails_list as $email) { $sort_date_time = ''; if (!empty($email->date_start) and !empty($email->time_start)) { $sort_date_time = $timedate->to_db_date_time($email->date_start, $email->time_start); $sort_date_time = implode(' ', $sort_date_time); // kbrill - Bug #16714 //$sort_date_time=$timedate->handle_offset($sort_date_time,'Y-m-d H:i:s',true); } $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' => $sort_date_time); } //end Emails foreach ($focus_notes_list as $note) { if (!empty($note->date_modified)) { $sort_date_time = $timedate->swap_formats($note->date_modified, $timedate->get_date_time_format(), $timedate->get_db_date_time_format()); } $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' => $sort_date_time); 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 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; 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; $xtpl->parse("history.row"); // Put the rows in. } $xtpl->parse("history"); $xtpl->out("history"); insert_popup_footer(); }
/** * emailChannel * * build the email channel * * @since version 1.0 * @access public */ public function emailChannel() { require_once 'xtemplate.php'; $tpl = new XTemplate('/web/pscpages/webapp/portal/channel/email/templates/index.tpl'); $tpl->parse('main.transition'); $total_messages = 0; $unread_messages = 0; $messages = $this->getMessages('in:inbox'); if (is_array($messages)) { $more = $messages['more']; foreach ($messages['m'] as $message) { $clean_message = array(); $clean_message['subject'] = isset($message['su'][0]) && $message['su'][0] != '' ? htmlentities($message['su'][0]) : '[None]'; $clean_message['subject'] = strlen($clean_message['subject']) > 20 ? substr($clean_message['subject'], 0, 17) . '...' : $clean_message['subject']; $clean_message['body_fragment'] = $message['fr'][0]; $clean_message['from_email'] = $message['e_attribute_a'][0]; $clean_message['from'] = $message['e_attribute_p'][0] ? htmlspecialchars($message['e_attribute_p'][0]) : $clean_message['from_email']; $clean_message['size'] = $this->makeBytesPretty($message['s'], 40 * 1024 * 1024); $clean_message['date'] = date('n/j/y', $message['d'] / 1000); $clean_message['id'] = $message['id']; $clean_message['url'] = 'http://go.plymouth.edu/mymail/msg/' . $clean_message['id']; $clean_message['attachment'] = false; $clean_message['status'] = 'read'; $clean_message['deleted'] = false; $clean_message['flagged'] = false; if (isset($message['f'])) { $clean_message['attachment'] = strpos($message['f'], 'a') !== false ? true : false; $clean_message['status'] = strpos($message['f'], 'u') !== false ? 'unread' : 'read'; $clean_message['deleted'] = strpos($message['f'], '2') !== false ? true : false; $clean_message['flagged'] = strpos($message['f'], 'f') !== false ? true : false; } $tpl->assign('message', $clean_message); $tpl->parse('main.message'); } $inbox = $this->getFolder(array('l' => 2)); $total_messages = (int) $inbox['n']; $unread_messages = (int) $inbox['u']; } $tpl->assign('total_messages', $total_messages); $tpl->assign('unread_messages', $unread_messages); $info = $this->getInfo(array('sections' => 'mbox')); if (is_array($info['attrs'][0]['attr_attribute_name'])) { $quota = $info['attrs'][0]['attr'][array_search('zimbraMailQuota', $info['attrs'][0]['attr_attribute_name'])]; $size_text = $this->makeBytesPretty($info['used'][0], $quota * 0.75) . ' out of ' . $this->makeBytesPretty($quota); $tpl->assign('size', $size_text); } /* include_once 'portal_functions.php'; $roles = getRoles($this->_username); if(in_array('faculty', $roles) || in_array('employee', $roles)) { $tpl->parse('main.away_message'); } */ $tpl->parse('main'); $tpl->out('main'); }
} //Add Custom Fields require_once 'modules/DynamicFields/templates/Files/EditView.php'; global $current_user; if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) { $record = ''; if (!empty($_REQUEST['record'])) { $record = $_REQUEST['record']; } $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>"); } if ($focus->parent_bean == "ClientRequest") { $xtpl->parse("client_request.format"); $xtpl->parse("client_request.base_format_clientrequest"); $xtpl->parse("client_request"); $xtpl->out("client_request"); } else { $xtpl->parse("main.base_format_main"); $xtpl->parse("main.pressformat_format"); $xtpl->parse("main"); $xtpl->out("main"); } require_once 'include/javascript/javascript.php'; $javascript = new javascript(); $javascript->setFormName('EditView'); $javascript->setSugarBean($focus); $javascript->addAllFields(''); $javascript->addToValidateBinaryDependency('parent_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_PARENT_ID'], 'false', '', 'parent_id'); $javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id'); echo $javascript->getScript(); $validation_script .= '</script>';
********************************************************************************/ require_once 'include/ListView/ListViewSmarty.php'; global $app_strings, $app_list_strings, $current_language, $currentModule, $mod_strings; echo getClassicModuleTitle('SavedSearch', array($mod_strings['LBL_MODULE_TITLE']), false); echo get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false); $search_form = new XTemplate('modules/SavedSearch/SearchForm.html'); $search_form->assign('MOD', $mod_strings); $search_form->assign('APP', $app_strings); $search_form->assign('JAVASCRIPT', get_clear_form_js()); if (isset($_REQUEST['name'])) { $search_form->assign('name', to_html($_REQUEST['name'])); } if (isset($_REQUEST['search_module'])) { $search_form->assign('search_module', to_html($_REQUEST['search_module'])); } $search_form->parse('main'); $search_form->out('main'); if (!isset($where)) { $where = "assigned_user_id = {$current_user->id}"; } echo '<br />' . get_form_header($mod_strings['LBL_LIST_FORM_TITLE'], '', false); $savedSearch = new SavedSearch(); $lv = new ListViewSmarty(); if (file_exists('custom/modules/SavedSearch/metadata/listviewdefs.php')) { require_once 'custom/modules/SavedSearch/metadata/listviewdefs.php'; } else { require_once 'modules/SavedSearch/metadata/listviewdefs.php'; } $lv->displayColumns = $listViewDefs['SavedSearch']; $lv->setup($savedSearch, 'include/ListView/ListViewGeneric.tpl', $where); $lv->display(true);
$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 if (empty($_REQUEST['return_id'])) { $xtpl->assign('RETURN_ACTION', 'index'); } $xtpl->assign('INPOPUPWINDOW', 'true'); $xtpl->assign('PRINT_URL', 'index.php?' . $GLOBALS['request_string']); $xtpl->assign('JAVASCRIPT', get_set_focus_js()); $xtpl->assign('ID', $focus->id); $xtpl->assign('NAME', $focus->name); $xtpl->assign('SIGNATURE_TEXT', !empty($focus->signature_html) ? $focus->signature_html : $focus->signature); if (isset($_REQUEST['the_user_id'])) { $xtpl->assign('THE_USER_ID', $_REQUEST['the_user_id']); } $tiny = new SugarTinyMCE(); $xtpl->assign("tinyjs", $tiny->getInstance('sigText')); $xtpl->parse('main.textarea'); //Add Custom Fields $xtpl->parse('main'); $xtpl->out('main');
/** * nv_info_die() * * @param string $page_title * @param mixed $info_title * @param mixed $info_content * @param string $admin_link * @param string $admin_title * @param string $site_link * @param string $site_title * @return */ function nv_info_die($page_title = '', $info_title, $info_content, $admin_link = NV_BASE_ADMINURL, $admin_title = '', $site_link = NV_BASE_SITEURL, $site_title = '') { global $lang_global, $global_config; if (empty($page_title)) { $page_title = $global_config['site_description']; } // Get theme $template = ''; if (defined('NV_ADMIN') and isset($global_config['admin_theme']) and file_exists(NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/system/info_die.tpl')) { $tpl_path = NV_ROOTDIR . '/themes/' . $global_config['admin_theme'] . '/system'; $template = $global_config['admin_theme']; } elseif (defined('NV_ADMIN') and file_exists(NV_ROOTDIR . '/themes/admin_default/system/info_die.tpl')) { $tpl_path = NV_ROOTDIR . '/themes/admin_default/system'; $template = 'admin_default'; } elseif (isset($global_config['module_theme']) and file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/system/info_die.tpl')) { $tpl_path = NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/system'; $template = $global_config['module_theme']; } elseif (isset($global_config['site_theme']) and file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/system/info_die.tpl')) { $tpl_path = NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/system'; $template = $global_config['site_theme']; } else { $tpl_path = NV_ROOTDIR . '/themes/default/system'; $template = 'default'; } $size = @getimagesize(NV_ROOTDIR . '/' . $global_config['site_logo']); $xtpl = new XTemplate('info_die.tpl', $tpl_path); $xtpl->assign('SITE_CHARSET', $global_config['site_charset']); $xtpl->assign('PAGE_TITLE', $page_title); $xtpl->assign('HOME_LINK', $global_config['site_url']); $xtpl->assign('LANG', $lang_global); $xtpl->assign('TEMPLATE', $template); $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL); $xtpl->assign('SITE_NAME', $global_config['site_name']); if (isset($size[1])) { if ($size[0] > 490) { $size[1] = ceil(490 * $size[1] / $size[0]); $size[0] = 490; } $xtpl->assign('LOGO', NV_BASE_SITEURL . $global_config['site_logo']); $xtpl->assign('WIDTH', $size[0]); $xtpl->assign('HEIGHT', $size[1]); if (isset($size['mime']) and $size['mime'] == 'application/x-shockwave-flash') { $xtpl->parse('main.swf'); } else { $xtpl->parse('main.image'); } } $xtpl->assign('INFO_TITLE', $info_title); $xtpl->assign('INFO_CONTENT', $info_content); if (defined('NV_IS_ADMIN') and !empty($admin_link)) { $xtpl->assign('ADMIN_LINK', $admin_link); $xtpl->assign('GO_ADMINPAGE', empty($admin_title) ? $lang_global['admin_page'] : $admin_title); $xtpl->parse('main.adminlink'); } if (!empty($site_link)) { $xtpl->assign('SITE_LINK', $site_link); $xtpl->assign('GO_SITEPAGE', empty($site_title) ? $lang_global['go_homepage'] : $site_title); $xtpl->parse('main.sitelink'); } $xtpl->parse('main'); $global_config['mudim_active'] = 0; include NV_ROOTDIR . '/includes/header.php'; $xtpl->out('main'); include NV_ROOTDIR . '/includes/footer.php'; die; }
$form->assign("BASE_MODULE", $workflow_object->base_module); $form->assign("WORKFLOW_ID", $workflow_object->id); $form->assign("ID", $focus->id); $form->assign("REL_MODULE", $focus->rel_module); $form->assign("PARENT_ID", $workflow_object->id); $form->assign("TRIGGER_TYPE", $workflow_object->type); $form->assign("TYPE", $focus->type); //Check multi_trigger filter conditions if (!empty($_REQUEST['frame_type'])) { $form->assign("FRAME_TYPE", $_REQUEST['frame_type']); } else { $form->assign("FRAME_TYPE", $focus->frame_type); } insert_popup_header($theme); $form->parse("embeded"); $form->out("embeded"); ////////Middle Items///////////////////////////// /* //SET Previous Display Text require_once('include/ListView/ProcessView.php'); $ProcessView = new ProcessView($workflow_object, $focus); $prev_display_text = $ProcessView->get_prev_text("TriggersCreateStep1", $focus->type); $form->assign("PREV_DISPLAY_TEXT", $prev_display_text); */ /////Top secondary items//////////////// if ($focus->type == "filter_rel_field") { //process out the actual name of the rel module ///Build the relationship information using the Relationship handler require_once 'modules/Relationships/RelationshipHandler.php'; $rel_handler = $workflow_object->call_relationship_handler("base_module", true); $rel_handler->set_rel_vardef_fields(strtolower($focus->rel_module));
if (isset($name)) { $search_form->assign("FNAME", to_html($fname)); } if (isset($pnum)) { $search_form->assign("PNAME", to_html($pname)); } //if (isset($type)) $search_form->assign("TYPE", to_html($type)); //if (isset($spec)) $search_form->assign("SPEC", to_html($spec)); if (isset($current_user_only)) { $search_form->assign("CURRENT_USER_ONLY", "checked"); } //if(isset($subordinate_only)) $search_form->assign("SUBORDINATE_ONLY", "checked"); $header_text = ''; if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) { $header_text = "<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=" . $_REQUEST['module'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>"; } echo get_form_header($current_module_strings['LBL_SEARCH_FORM_TITLE'], $header_text, false); $search_form->parse("main"); $search_form->out("main"); echo get_form_footer(); echo "\n<BR>\n"; } $ListView = new ListView(); $ListView->initNewXTemplate('modules/Paper/ListView.html', $current_module_strings); $ListView->setHeaderTitle($current_module_strings['LBL_LIST_FORM_TITLE']); global $current_user; 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'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>"); } $ListView->setQuery($where, "", "date_modified desc", "PAPER"); $ListView->processListView($seedPaper, "main", "PAPER");
global $mod_strings; global $current_user; echo SugarThemeRegistry::current()->getCSS(); echo getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_NAME'], $_REQUEST['module_name']), true); $xtpl = new XTemplate('modules/LabelEditor/EditView.html'); $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); $xtpl->assign("MODULE_NAME", $_REQUEST['module_name']); $xtpl->assign("STYLE", $style); if (isset($_REQUEST['sugar_body_only'])) { $xtpl->assign("SUGAR_BODY_ONLY", $_REQUEST['sugar_body_only']); } if (isset($_REQUEST['record'])) { $xtpl->assign("NO_EDIT", "readonly"); $xtpl->assign("KEY", $_REQUEST['record']); if (isset($the_strings[$_REQUEST['record']])) { $xtpl->assign("VALUE", $the_strings[$_REQUEST['record']]); } else { if (isset($_REQUEST['value'])) { $xtpl->assign("VALUE", $_REQUEST['value']); } } } if ($style == 'popup') { $xtpl->parse("main.popup"); } $xtpl->parse("main"); $xtpl->out("main"); } else { echo 'No Module Selected'; }
$footer_text = str_replace('{date}', $date, $mod->settings['footer_text']); $footer_text = str_replace('{spam}', $spam, $footer_text); $xtpl->assign('footer_text', $footer_text); $copyright_terms = str_replace('{year}', $year, $mod->settings['copyright_terms']); $xtpl->assign('copyright_terms', $copyright_terms); $open = $mod->settings['site_open']; if (!$open && $mod->user['user_level'] < USER_ADMIN) { $xtpl->assign('page_title', $mod->title); $xtpl->assign('meta_desc', $mod->meta_description); $xtpl->assign('style_link', $style_link); $xtpl->assign('random_quote', 'Greetings Professor Falken'); $xtpl->assign('closed_message', $mod->settings['site_closedmessage']); $xtpl->parse('Index.RandomQuote'); $xtpl->parse('Index.Closed'); $xtpl->parse('Index'); $xtpl->out('Index'); } else { if ($missing) { $module_output = $mod->error('The page you requested does not exist.', 404); } else { $module_output = $mod->execute(); } if ($mod->nohtml) { echo $module_output; } else { ob_start('ob_gzhandler'); $xtpl->assign('meta_desc', $mod->meta_description); $xtpl->assign('page_title', $mod->title); // Users in privledged class or above can use their own style sheet for the skin. if ($mod->user['user_level'] > USER_MEMBER && !empty($mod->user['user_stylesheet'])) { $style_link = $mod->user['user_stylesheet'];