/** * @see SugarView::display() */ public function display() { $ss = new Sugar_Smarty(); $ss->assign("MOD", $GLOBALS['mod_strings']); $ss->assign("MESSAGE", $GLOBALS['message']); echo $ss->fetch("modules/xeBaySellerLists/tpls/importfinal.tpl"); }
function getImageHtml($focus, $name, $value, $view) { if ('EditView' != $view && 'DetailView' != $view) { return ""; // skip the rest of the method if another view calls this method } global $app_list_strings; $languageStrings = $app_list_strings["oqc"]["Services"]; require_once 'include/Sugar_Smarty.php'; //1.7.6 Workaround for image display without modifying htaccess file require_once 'include/oqc/common/Configuration.php'; if (isset($focus->image_unique_filename)) { global $sugar_config; $conf = Configuration::getInstance(); $oqc_uploadDir = $conf->get('fileUploadDir'); $uploadDir = $oqc_uploadDir ? $oqc_uploadDir : $sugar_config['upload_dir']; if (file_exists($uploadDir . "th" . $focus->image_unique_filename)) { $imageurl = "oqc/GetImage.php?module=oqc_Product&id=th" . $focus->image_unique_filename; } else { $imageurl = "oqc/GetImage.php?module=oqc_Product&id=" . $focus->image_unique_filename; } } else { $imageurl = ''; } $smarty = new Sugar_Smarty(); $smarty->assign('image_url', $imageurl); $smarty->assign('languageStrings', $languageStrings); return $smarty->fetch('include/oqc/Products/Image.' . $view . '.html'); }
function template_groups_chooser(&$args) { global $mod_strings, $js_loaded; $table_style = ''; if (!empty($args['display'])) { $table_style = "display: " . $args['display'] . "\""; } $uparraow_big = SugarThemeRegistry::current()->getImage('uparrow_big', 'border="0" style="margin-bottom: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']); $downarrow_big = SugarThemeRegistry::current()->getImage('downarrow_big', 'border="0" style="margin-top: 1px;" ', null, null, '.gif', $mod_strings['LBL_SORT']); $leftarrow_big = SugarThemeRegistry::current()->getImage('leftarrow_big', 'border="0" style="margin-right: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']); $rightarrow_big = SugarThemeRegistry::current()->getImage('rightarrow_big', 'border="0" style="margin-left: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']); $smarty = new Sugar_Smarty(); $smarty->assign('args', $args); $smarty->assign('js_loaded', $js_loaded); $smarty->assign('table_style', $table_style); $smarty->assign('uparraow_big', $uparraow_big); $smarty->assign('downarrow_big', $downarrow_big); $smarty->assign('leftarrow_big', $leftarrow_big); $smarty->assign('rightarrow_big', $rightarrow_big); $smarty->assign('table_style', $table_style); //echo $smarty->fetch("modules/Reports/templates/_template_groups_chooser.tpl"); if ($js_loaded == false) { $js_loaded = true; } return $smarty->fetch("modules/Reports/templates/_template_groups_chooser.tpl"); }
function display() { $db = DBManagerFactory::getInstance(); /* <<<<<<< HEAD $sql = "SELECT p.id,p.first_name,p.last_name,p.dob FROM reg_patient p WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.next_pmp_review_due_c is not null) ORDER By p.last_name, p.first_name"; ======= */ $sql = "SELECT p.id,p.first_name,p.last_name,p.dob, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) ORDER By p.last_name, p.first_name"; // >>>>>>> 3097a71433de82fec730df252659026274347e46 $resultb = $db->query($sql, true); $final = array(); while ($row = $db->fetchByAssoc($resultb)) { $final[] = $row; } $sql1 = "SELECT p.id, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) GROUP BY provname ORDER By p.last_name, p.first_name"; $resultb1 = $db->query($sql1, true); $final1 = array(); while ($row1 = $db->fetchByAssoc($resultb1)) { $final1[] = $row1; } $sugarSmarty = new Sugar_Smarty(); $sugarSmarty->assign("data", $final); $sugarSmarty->assign("data1", $final1); $sugarSmarty->assign("title", "Patients who do not have PMP"); $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report1REG_Patient.tpl'); // parent::display(); }
/** * @see ViewQuickcreate::display() */ public function display() { $userPref = $GLOBALS['current_user']->getPreference('email_link_type'); $defaultPref = $GLOBALS['sugar_config']['email_default_client']; if ($userPref != '') { $client = $userPref; } else { $client = $defaultPref; } if ($client == 'sugar') { $eUi = new EmailUI(); if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan'))) { $fullComposeUrl = "index.php?module=Emails&action=Compose&parent_id={$this->bean->id}&parent_type={$this->bean->module_dir}"; $composeData = array('parent_id' => $this->bean->id, 'parent_type' => $this->bean->module_dir); } else { $fullComposeUrl = "index.php?module=Emails&action=Compose"; $composeData = array('parent_id' => '', 'parent_type' => ''); } $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, $fullComposeUrl); $json_obj = getJSONobj(); $opts = $json_obj->decode($j_quickComposeOptions); $opts['menu_id'] = 'dccontent'; $ss = new Sugar_Smarty(); $ss->assign('json_output', $json_obj->encode($opts)); $ss->display('modules/Emails/templates/dceMenuQuickCreate.tpl'); } else { $emailAddress = ''; if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan')) && !is_null($this->bean->emailAddress)) { $emailAddress = $this->bean->emailAddress->getPrimaryAddress($this->bean); } echo "<script>document.location.href='mailto:{$emailAddress}';lastLoadedMenu=undefined;DCMenu.closeOverlay();</script>"; die; } }
function browse() { $smarty = new Sugar_Smarty(); global $mod_strings; $smarty->assign('mod_strings', $mod_strings); $smarty->assign('view_module', $this->module); $smarty->assign('view', $this->layout); if (!empty($_REQUEST['subpanel'])) { $smarty->assign('subpanel', $_REQUEST['subpanel']); } $stamps = array(); global $timedate; $userFormat = $timedate->get_date_time_format(); $page = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0; $count = $this->history->getCount(); $ts = $this->history->getNth($page * $this->pageSize); $snapshots = array(); for ($i = 0; $i <= $this->pageSize && $ts > 0; $i++) { $dbDate = $timedate->fromTimestamp($ts)->asDb(); $displayTS = $timedate->to_display_date_time($dbDate); if ($page * $this->pageSize + $i + 1 == $count) { $displayTS = translate("LBL_MB_DEFAULT_LAYOUT"); } $snapshots[$ts] = $displayTS; $ts = $this->history->getNext(); } if (count($snapshots) > $this->pageSize) { $smarty->assign('nextPage', true); } $snapshots = array_slice($snapshots, 0, $this->pageSize, true); $smarty->assign('currentPage', $page); $smarty->assign('snapshots', $snapshots); $html = $smarty->fetch('modules/ModuleBuilder/tpls/history.tpl'); echo $html; }
function getAdditionsHtml($focus, $name, $value, $view) { if ('EditView' != $view && 'DetailView' != $view) { return ""; // skip the rest of the method if another view calls this method } global $mod_strings; global $app_list_strings; //2.2RC2 translation eroor fix $status_list = $app_list_strings["oqc_addition_status_dom"]; $additions = $focus->getAdditions(); foreach ($additions as &$addition) { $addition = $addition->toArray(); if (isset($status_list[$addition['status']])) { $addition['status'] = $status_list[$addition['status']]; } } global $sugar_version; $smarty = new Sugar_Smarty(); $smarty->assign('additions', $additions); $smarty->assign($mod_strings); if (substr($sugar_version, 0, 1) == '6') { return $smarty->fetch('include/oqc/Additions/' . $view . '.html'); } else { return $smarty->fetch('include/oqc/Additions/' . $view . '52.html'); } }
function display() { $ss = new Sugar_Smarty(); $ss->assign('lbl_campaign_name', translate('LBL_TOP_CAMPAIGNS_NAME', 'Campaigns')); $ss->assign('lbl_revenue', translate('LBL_TOP_CAMPAIGNS_REVENUE', 'Campaigns')); $ss->assign('top_campaigns', $this->top_campaigns); return parent::display() . $ss->fetch('modules/Campaigns/Dashlets/TopCampaignsDashlet/TopCampaignsDashlet.tpl'); }
function display() { global $app_strings, $current_user, $mod_strings, $theme; $smarty = new Sugar_Smarty(); $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main'; $mbt = false; $admin = false; $mb = strtolower($type); $smarty->assign('TYPE', $type); $smarty->assign('app_strings', $app_strings); $smarty->assign('mod', $mod_strings); //Replaced by javascript function "setMode" switch ($type) { case 'studio': //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); require_once 'modules/ModuleBuilder/Module/StudioTree.php'; $mbt = new StudioTree(); break; case 'mb': //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")'); require_once 'modules/ModuleBuilder/MB/MBPackageTree.php'; $mbt = new MBPackageTree(); break; case 'dropdowns': // $admin = is_admin($current_user); require_once 'modules/ModuleBuilder/Module/DropDownTree.php'; $mbt = new DropDownTree(); break; default: //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")'); require_once 'modules/ModuleBuilder/Module/MainTree.php'; $mbt = new MainTree(); } $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser()); $smarty->assign('ADMIN', is_admin($current_user)); $smarty->display('modules/ModuleBuilder/tpls/includes.tpl'); if ($mbt) { $smarty->assign('TREE', $mbt->fetch()); $smarty->assign('TREElabel', $mbt->getName()); } $userPref = $current_user->getPreference('mb_assist', 'Assistant'); if (!$userPref) { $userPref = "na"; } $smarty->assign('userPref', $userPref); /////////////////////////////////// require_once 'include/SugarTinyMCE.php'; $tiny = new SugarTinyMCE(); $tiny->defaultConfig['width'] = 300; $tiny->defaultConfig['height'] = 300; $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,\n\t justifyfull,separator,forecolor,backcolor,\n\t "; $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,"; $tiny->buttonConfig3 = ""; $ed = $tiny->getInstance(); $smarty->assign("tiny", $ed); $smarty->display('modules/ModuleBuilder/tpls/index.tpl'); }
function getAttachmentsHtml($focus, $name, $value, $view) { if ('EditView' != $view && 'DetailView' != $view) { return ""; // skip the rest of the method if another view calls this method } global $app_list_strings; $smarty = new Sugar_Smarty(); if (isset($focus->attachmentsequence)) { $c = get_all_linked_attachment_revisions($focus->attachmentsequence); // smarty mit Werten befüllen $smarty->assign('attachments', buildAttachmentsArray($c)); } else { $smarty->assign('attachments', array()); } // setup the popup link $popup_request_data = array('call_back_function' => 'popup_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom'][''])); $revision_request_data = array('call_back_function' => 'revision_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom'][''])); $json = getJSONobj(); $encoded_request_data = $json->encode($popup_request_data); $encoded_revision_request_data = $json->encode($revision_request_data); $languageStrings = $json->encode($app_list_strings["oqc"]["Attachments"]); $smarty->assign('moduleName', getCurrentModuleName()); $smarty->assign('languageStringsAttachments', $languageStrings); $smarty->assign('open_popup_encoded_request_data', $encoded_request_data); $smarty->assign('create_popup_encoded_request_data', $encoded_request_data); $smarty->assign('upload_revision_encoded_request_data', $encoded_revision_request_data); $smarty->assign('initialFilter', "\"&deleted=0\""); // Todo: Hier nur Dokumente zulassen, die für Vertragsanhänge erlaubt sind return $smarty->fetch('include/oqc/Attachments/' . $view . '.html'); }
public function testVarReplace() { $params = array('subject' => 'http://example.com/[email1]', 'use_curly' => false, 'fields' => array('email1' => array('function' => array('name' => 'getEmailAddressWidget', 'returns' => 'html'), 'value' => '<!-- html -->'))); $bean = new Account(); $bean->email1 = '*****@*****.**'; $smarty = new Sugar_Smarty(); $smarty->assign('bean', $bean); $output = smarty_function_sugar_replace_vars($params, $smarty); $this->assertContains($bean->email1, $output, 'Rendered string contains html markup.'); }
function display() { require_once "include/Expressions/Dependency.php"; require_once "include/TemplateHandler/TemplateHandler.php"; $th = new TemplateHandler(); $depScript = $th->createDependencyJavascript(array('phone_office' => array('calculated' => true, "formula" => 'add(strlen($name), $employees)', "enforced" => true)), array(), "EditView"); $smarty = new Sugar_Smarty(); $smarty->assign("dependencies", $depScript); $smarty->display('modules/ExpressionEngine/tpls/cfTest.tpl'); }
function display() { global $mod_strings, $app_strings; echo get_module_title('Connectors', $mod_strings['LBL_ADMINISTRATION_MAIN'], true); $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign('mod', $mod_strings); $sugar_smarty->assign('app', $app_strings); $sugar_smarty->assign('IMG', 'themes/default/images/'); $sugar_smarty->display('modules/Connectors/tpls/administration.tpl'); }
function display() { global $current_user, $mod_strings; $smarty = new Sugar_Smarty(); $mb = new MBPackage("packageCustom"); $mod = $mb->getCustomModules(); $modules = array(); $custom = array(); if (is_array($mod)) { foreach ($mod as $key => $value) { $modules[] = $key; $custom[] = $value; } } $nb_mod = count($modules); $smarty->assign('mod_strings', $mod_strings); $smarty->assign('modules', $mod); $smarty->assign('custom', $custom); $smarty->assign('nb_mod', $nb_mod); $smarty->assign('defaultHelp', 'exportHelp'); $smarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']); $smarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']); $ajax = new AjaxCompose(); $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); $ajax->addSection('center', $mod_strings['LBL_EC_TITLE'], $smarty->fetch($this->getCustomFilePathIfExists('modules/ModuleBuilder/tpls/exportcustomizations.tpl'))); echo $ajax->getJavascript(); }
public function displayOptions() { ob_start(); global $current_language, $app_list_strings; $mod_strings = return_module_language($current_language, 'AOR_Reports'); $optionsSmarty = new Sugar_Smarty(); $optionsSmarty->assign('MOD', $mod_strings); $optionsSmarty->assign('id', $this->id); $optionsSmarty->assign('dashletTitle', $this->title); $optionsSmarty->assign('aor_report_id', $this->report->id); $optionsSmarty->assign('aor_report_name', $this->report->name); $optionsSmarty->assign('onlyCharts', $this->onlyCharts); $charts = array(); if (!empty($this->report->id)) { foreach ($this->report->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) { $charts[$chart->id] = $chart->name; } } $conditions = getConditionsAsParameters($this->report, $this->params); $optionsSmarty->assign('parameters', $conditions); $chartOptions = get_select_options_with_id($charts, $this->charts); $optionsSmarty->assign('chartOptions', $chartOptions); $optionsTemplate = get_custom_file_if_exists('modules/AOR_Reports/Dashlets/AORReportsDashlet/dashletConfigure.tpl'); ob_clean(); return $optionsSmarty->fetch($optionsTemplate); }
function ViewDisplaydeploy() { $smarty = new Sugar_Smarty(); $smarty->assign('package', $_REQUEST['name']); $smarty->assign('message', $GLOBALS['mod_strings']['LBL_DEPLOY_IN_PROGRESS']); $ajax = new AjaxCompose(); $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); $ajax->addCrumb($_REQUEST['name'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $_REQUEST['name'] . '")'); $ajax->addCrumb(translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), ''); $ajax->addSection('center', translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/deploy.tpl')); echo $ajax->getJavascript(); }
/** * Main display function. * * @return void */ protected function display() { global $app_list_strings, $mod_strings, $locale; require_once 'modules/Studio/parsers/StudioParser.php'; $dh = new DropDownHelper(); $smarty = new Sugar_Smarty(); $smarty->assign('MOD', $GLOBALS['mod_strings']); $title = getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array("<a href='index.php?module=Administration&action=index'>" . $mod_strings['LBL_MODULE_NAME'] . "</a>", $mod_strings['LBL_RENAME_TABS']), false); $smarty->assign('title', $title); if (!empty($_REQUEST['dropdown_lang'])) { $selected_lang = $_REQUEST['dropdown_lang']; } else { $selected_lang = $locale->getAuthenticatedUserLanguage(); } if ($selected_lang == $GLOBALS['current_language']) { $my_list_strings = $GLOBALS['app_list_strings']; } else { $my_list_strings = return_app_list_strings_language($selected_lang); } $selected_dropdown = $my_list_strings['moduleList']; $selected_dropdown_singular = $my_list_strings['moduleListSingular']; foreach ($selected_dropdown as $key => $value) { $singularValue = isset($selected_dropdown_singular[$key]) ? $selected_dropdown_singular[$key] : $value; if ($selected_lang != $_SESSION['authenticated_user_language'] && !empty($app_list_strings['moduleList']) && isset($app_list_strings['moduleList'][$key])) { $selected_dropdown[$key] = array('lang' => $value, 'user_lang' => '[' . $app_list_strings['moduleList'][$key] . ']', 'singular' => $singularValue, 'module' => 'module-' . mb_strtolower($key)); } else { $selected_dropdown[$key] = array('lang' => $value, 'singular' => $singularValue, 'module' => 'module-' . mb_strtolower($key)); } } $selected_dropdown = $dh->filterDropDown('moduleList', $selected_dropdown); $smarty->assign('dropdown', $selected_dropdown); $smarty->assign('dropdown_languages', get_languages()); $buttons = array(); $buttons[] = array('text' => $mod_strings['LBL_BTN_UNDO'], 'actionScript' => "onclick='jstransaction.undo()'"); $buttons[] = array('text' => $mod_strings['LBL_BTN_REDO'], 'actionScript' => "onclick='jstransaction.redo()'"); $buttons[] = array('text' => $mod_strings['LBL_BTN_SAVE'], 'actionScript' => "onclick='if(check_form(\"editdropdown\")){document.editdropdown.submit();}'"); $buttonTxt = StudioParser::buildImageButtons($buttons); $smarty->assign('buttons', $buttonTxt); $smarty->assign('dropdown_lang', $selected_lang); $editImage = SugarThemeRegistry::current()->getImage('edit_inline', ''); $smarty->assign('editImage', $editImage); $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', ''); $smarty->assign('deleteImage', $deleteImage); $smarty->display("modules/Studio/wizards/RenameModules.tpl"); if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) { require_once 'include/language/jsLanguage.php'; jsLanguage::createAppStringsCache($GLOBALS['current_language']); } if (!is_file(sugar_cached('jsLanguage/') . 'Studio' . '/' . $GLOBALS['current_language'] . '.js')) { require_once 'include/language/jsLanguage.php'; jsLanguage::createModuleStringsCache('Studio', $GLOBALS['current_language']); } }
/** * Implement get_body function to correctly populate the template for the ModuleBuilder/Studio * Add field page. * * @param Sugar_Smarty $ss * @param array $vardef * */ function get_body(&$ss, $vardef) { global $app_list_strings, $mod_strings; $vars = $ss->get_template_vars(); $fields = $vars['module']->mbvardefs->vardefs['fields']; $fieldOptions = array(); foreach ($fields as $id => $def) { $fieldOptions[$id] = $def['name']; } $ss->assign('fieldOpts', $fieldOptions); return $ss->fetch('custom/modules/DynamicFields/templates/Fields/Forms/worklog.tpl'); }
function display() { require_once 'include/connectors/utils/ConnectorUtils.php'; require_once 'include/connectors/sources/SourceFactory.php'; global $mod_strings, $app_strings; $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign('mod', $mod_strings); $sugar_smarty->assign('APP', $app_strings); $connectors = ConnectorUtils::getConnectors(true); $sugar_smarty->assign('SOURCES', $connectors); echo get_module_title('Connectors', $mod_strings['LBL_MODIFY_MAPPING_PAGE_TITLE'], true); $sugar_smarty->display('modules/Connectors/tpls/modify_mapping.tpl'); }
/** * @see SugarView::display() */ public function display() { $offset = -1; $modules = array(); if (!empty($_REQUEST['zoom'])) { $modules = array($_REQUEST['zoom']); if (isset($_REQUEST['offset'])) { $offset = $_REQUEST['offset']; } } $limit = !empty($GLOBALS['sugar_config']['max_spotresults_initial']) ? $GLOBALS['sugar_config']['max_spotresults_initial'] : 5; if ($offset !== -1) { $limit = !empty($GLOBALS['sugar_config']['max_spotresults_more']) ? $GLOBALS['sugar_config']['max_spotresults_more'] : 20; } $options = array('current_module' => $this->module, 'modules' => $modules); $searchEngine = SugarSearchEngineFactory::getInstance('', array(), true); $trimmed_query = trim($_REQUEST['q']); $rs = $searchEngine->search($trimmed_query, $offset, $limit, $options); $formattedResults = $this->formatSearchResultsToDisplay($rs, $offset, $trimmed_query); $query_encoded = urlencode($trimmed_query); $displayMoreForModule = $formattedResults['displayMoreForModule']; $displayResults = $formattedResults['displayResults']; $ss = new Sugar_Smarty(); $ss->assign('displayResults', $displayResults); $ss->assign('displayMoreForModule', $displayMoreForModule); $ss->assign('appStrings', $GLOBALS['app_strings']); $ss->assign('appListStrings', $GLOBALS['app_list_strings']); $ss->assign('queryEncoded', $query_encoded); $ss->assign('test', "#bwc/index.php?module=Home&action=UnifiedSearch&search_form=false&advanced=false&query_string=" . $query_encoded); echo $ss->fetch(SugarAutoLoader::existingCustomOne('include/SearchForm/tpls/SugarSpot.tpl')); }
function displayOptions() { global $app_strings; $ss = new Sugar_Smarty(); $ss->assign('titleLBL', translate('LBL_DASHLET_OPT_TITLE', 'Home')); $ss->assign('urlLBL', translate('LBL_DASHLET_OPT_URL', 'Home')); $ss->assign('heightLBL', translate('LBL_DASHLET_OPT_HEIGHT', 'Home')); $ss->assign('title', $this->title); $ss->assign('url', $this->url); $ss->assign('id', $this->id); $ss->assign('height', $this->height); $ss->assign('saveLBL', $app_strings['LBL_SAVE_BUTTON_LABEL']); return $ss->fetch('modules/Home/Dashlets/iFrameDashlet/configure.tpl'); }
function display() { global $mod_strings; $smarty = new Sugar_Smarty(); $mb = new ModuleBuilder(); //if (!empty($_REQUEST['package'])) { if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) { $this->generatePackageButtons($mb->getPackageList()); $smarty->assign('buttons', $this->buttons); $smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']); $smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']); $smarty->assign("defaultHelp", "mbHelp"); $ajax = new AjaxCompose(); $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], ''); $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); echo $ajax->getJavascript(); } else { $name = !empty($_REQUEST['package']) ? $_REQUEST['package'] : ''; $mb->getPackage($name); require_once 'modules/ModuleBuilder/MB/MBPackageTree.php'; $mbt = new MBPackageTree(); $nodes = $mbt->fetchNodes(); $package_labels = array(); if (!empty($nodes['tree_data']['nodes'])) { foreach ($nodes['tree_data']['nodes'] as $entry) { if (!empty($entry['data']['label']) && $name != $entry['data']['label']) { $package_labels[] = strtoupper($entry['data']['label']); } } } $json = getJSONobj(); $smarty->assign('package_labels', $json->encode($package_labels)); $this->package =& $mb->packages[$name]; $this->loadModuleTypes(); $this->loadPackageHelp($name); $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified); $smarty->assign('package', $this->package); $smarty->assign('mod_strings', $mod_strings); $smarty->assign('package_already_deployed', 'false'); foreach ($this->package->modules as $a_module) { if (in_array($a_module->key_name, $GLOBALS['moduleList'])) { $smarty->assign('package_already_deployed', 'true'); break; } } $ajax = new AjaxCompose(); $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); if (empty($name)) { $name = $mod_strings['LBL_NEW_PACKAGE']; } $ajax->addCrumb($name, ''); $html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl'); if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') { $html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; } $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html); echo $ajax->getJavascript(); } }
/** * @see Dashlet::displayOptions() */ public function displayOptions() { $ss = new Sugar_Smarty(); $ss->assign('titleLBL', translate('LBL_DASHLET_OPT_TITLE', 'Home')); $ss->assign('title', $this->title); $ss->assign('id', $this->id); $ss->assign('saveLBL', $GLOBALS['app_strings']['LBL_SAVE_BUTTON_LABEL']); if ($this->isAutoRefreshable()) { $ss->assign('isRefreshable', true); $ss->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); $ss->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); $ss->assign('autoRefreshSelect', $this->autoRefresh); } return $ss->fetch('modules/Opportunities/Dashlets/MyClosedOpportunitiesDashlet/MyClosedOpportunitiesDashletConfigure.tpl'); }
/** * Init the Sugar_Smarty object. */ private function _initSmartyInstance() { if (!$this->ss instanceof Sugar_Smarty) { $this->ss = new Sugar_Smarty(); // TODO: Remove after MAR-1064 is merged. // Enable enhanced security for user-provided templates. This // includes disabling the {php} Smarty tag. $this->ss->security = true; if (defined('SUGAR_SHADOW_PATH')) { $this->ss->secure_dir[] = SUGAR_SHADOW_PATH; } $this->ss->assign('MOD', $GLOBALS['mod_strings']); $this->ss->assign('APP', $GLOBALS['app_strings']); } }
function display() { //$provlist = Array(); $smarty = new Sugar_Smarty(); //parent::display(); $db = DBManagerFactory::getInstance(); $queryprov = "SELECT p1b.id provid, p1b.name provname from reg_provider p1b ORDER BY provname"; $sql = $db->query($queryprov); while (($a = $db->fetchByAssoc($sql)) != null) { $provlist[] = array("provid" => $a["provid"], "provname" => $a["provname"]); } echo "here"; $smarty->assign("provlist", $provlist); $smarty->display('custom/modules/REG_Patient/tpls/ReportMain.tpl'); }
public function display() { $data = array(); $ss = new Sugar_Smarty(); $focus = BeanFactory::getBean('TeamNotices'); $today = db_convert("'" . TimeDate::getInstance()->nowDbDate() . "'", 'date'); $query = $focus->create_new_list_query("date_start", $focus->table_name . ".date_start <= {$today} and " . $focus->table_name . ".date_end >= {$today} and " . $focus->table_name . '.status=\'Visible\''); if ($result = $focus->db->query($query)) { while ($row = $focus->db->fetchByAssoc($result)) { $data[] = $row; } } $ss->assign("data", $data); return parent::display() . $ss->fetch('modules/TeamNotices/Dashlets/TeamNoticesDashlet/TeamNoticesDashlet.tpl'); }
function display() { $this->fromModuleBuilder = isset($_REQUEST['MB']) || !empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'; if ($this->fromModuleBuilder) { return; //no support for MB } global $current_user; global $mod_strings; $smarty = new Sugar_Smarty(); $smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']); $smarty->assign('question', $mod_strings['LBL_QUESTION_ADD_LAYOUT']); $smarty->assign('mod_strings', $mod_strings); $module_name = $_REQUEST['view_module']; // set up language files //$smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template //$smarty->assign('from_mb',$this->fromModuleBuilder); $mb = new ModuleBuilder(); if (!isset($_REQUEST['view_package'])) { $_REQUEST['view_package'] = 'studio'; } $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']); $package = $mb->packages[$_REQUEST['view_package']]; $package->loadModuleTitles(); $ajax = new AjaxCompose(); $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")'); $ajax->addCrumb(translate($module_name), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $module_name . '")'); $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=addlayout&layouts=1&view_module=' . $module_name . '")'); $ajax->addCrumb($mod_strings['LBL_ADD_LAYOUT'], ''); //$ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_ADD_LAYOUT'), $html = $smarty->fetch('modules/ModuleBuilder/tpls/addlayoutdone.tpl'); $html .= "<script>ModuleBuilder.treeRefresh('Studio')</script>"; $ajax->addSection('center', $mod_strings['LBL_ADD_LAYOUT'], $html); echo $ajax->getJavascript(); }
/** * Displays the dashlet * * @return string html to display dashlet */ function display() { require_once "modules/Reports/Report.php"; $chartReport = BeanFactory::getBean('Reports', $this->report_id, array('encode' => false, 'strict_retrieve' => true)); if (!empty($chartReport)) { $title = getReportNameTranslation($chartReport->name); $this->title = $title; $reporter = new Report($chartReport->content); $reporter->is_saved_report = true; $reporter->saved_report_id = $chartReport->id; $reporter->get_total_header_row(); $reporter->run_chart_queries(); ob_start(); require_once "include/SugarCharts/ChartDisplay.php"; $chartDisplay = new ChartDisplay(); $chartDisplay->setReporter($reporter); echo $chartDisplay->legacyDisplay($this->id, true); $str = ob_get_contents(); ob_end_clean(); $xmlFile = $chartDisplay->get_cache_file_name($reporter); $html = parent::display() . "<div align='center'>" . $str . "</div>" . "<br />"; // return parent::display for title and such $ss = new Sugar_Smarty(); $ss->assign('chartName', $this->id); $ss->assign('chartXMLFile', $xmlFile); $script = $ss->fetch('modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl'); $json = getJSONobj(); return parent::display() . "<div align='center'>" . $str . "</div>" . "<br />"; // return parent::display for title and such } }
function display() { global $mod_strings; $ajax = new AjaxCompose(); $smarty = new Sugar_Smarty(); if (isset($_REQUEST['MB']) && $_REQUEST['MB'] == "1") { $smarty->assign("MB", $_REQUEST['MB']); $smarty->assign("view_package", $_REQUEST['view_package']); } $selected_lang = !empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']; if (empty($selected_lang)) { $selected_lang = $GLOBALS['sugar_config']['default_language']; } $smarty->assign('available_languages', get_languages()); $smarty->assign('selected_lang', $selected_lang); ksort($this->properties); $smarty->assign("properties", $this->properties); // $smarty->assign("id",$this->id); $smarty->assign("mod_strings", $mod_strings); $smarty->assign('APP', $GLOBALS['app_strings']); $smarty->assign("view_module", $this->editModule); $smarty->assign("subpanel", $this->subpanel); if (isset($this->editPackage)) { $smarty->assign("view_package", $this->editPackage); } $ajax->addSection('east', translate('LBL_SECTION_PROPERTIES', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/editProperty.tpl')); echo $ajax->getJavascript(); }
/** * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. * * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd. * Copyright (C) 2011 - 2016 SalesAgility Ltd. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not * reasonably feasible for technical reasons, the Appropriate Legal Notices must * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". */ function displaySpots() { global $mod_strings, $app_strings; $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign('MOD', $mod_strings); $sugar_smarty->assign('APP', $app_strings); return $sugar_smarty->fetch('modules/Spots/tpl/ShowSpots.tpl'); }