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 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'); }
/** * @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 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() { $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 $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(); } }
public function display() { if (!SugarOAuthServer::enabled()) { sugar_die($GLOBALS['mod_strings']['LBL_OAUTH_DISABLED']); } global $current_user; if (!isset($_REQUEST['token']) && isset($_REQUEST['oauth_token'])) { $_REQUEST['token'] = $_REQUEST['oauth_token']; } $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign('APP', $GLOBALS['app_strings']); $sugar_smarty->assign('MOD', $GLOBALS['mod_strings']); $sugar_smarty->assign('token', $_REQUEST['token']); $sugar_smarty->assign('sid', session_id()); $token = OAuthToken::load($_REQUEST['token']); if (empty($token) || empty($token->consumer) || $token->tstate != OAuthToken::REQUEST || empty($token->consumer_obj)) { sugar_die('Invalid token'); } if (empty($_REQUEST['confirm'])) { $sugar_smarty->assign('consumer', sprintf($GLOBALS['mod_strings']['LBL_OAUTH_CONSUMERREQ'], $token->consumer_obj->name)); // SM: roles disabled for now // $roles = array('' => ''); // $allroles = ACLRole::getAllRoles(); // foreach($allroles as $role) { // $roles[$role->id] = $role->name; // } // $sugar_smarty->assign('roles', $roles); $hash = md5(rand()); $_SESSION['oauth_hash'] = $hash; $sugar_smarty->assign('hash', $hash); echo $sugar_smarty->fetch('modules/OAuthTokens/tpl/authorize.tpl'); } else { if ($_REQUEST['sid'] != session_id() || $_SESSION['oauth_hash'] != $_REQUEST['hash']) { sugar_die('Invalid request'); } $verify = $token->authorize(array("user" => $current_user->id)); if (!empty($token->callback_url)) { $redirect_url = $token->callback_url; if (strchr($redirect_url, "?") !== false) { $redirect_url .= '&'; } else { $redirect_url .= '?'; } $redirect_url .= "oauth_verifier=" . $verify . '&oauth_token=' . $_REQUEST['token']; SugarApplication::redirect($redirect_url); } $sugar_smarty->assign('VERIFY', $verify); $sugar_smarty->assign('token', ''); echo $sugar_smarty->fetch('modules/OAuthTokens/tpl/authorized.tpl'); } }
function display() { //turn off all error reporting so that PHP warnings don't munge the PDF code error_reporting(E_ALL); set_time_limit(1800); //Create new page $this->AddPage(); $this->SetFont(PDF_FONT_NAME_MAIN, '', 8); if (!empty($this->templateLocation)) { $str = $this->ss->fetch($this->templateLocation); $this->writeHTML($str, $this->smartyLn, $this->smartyFill, $this->smartyReseth, $this->smartyCell, $this->smartyAlign); } else { $this->Error('The class SugarpdfSmarty has to be extended and you have to set a location for the Smarty template.'); } }
function snippet() { /* get sort order from session */ //session_start(); // Make a reference to the current session object,set order //$_SESSION['regnamesort']= 'test' ; Set a value in a session variable //$GLOBALS['log']->fatal('start display'); //var_dump($this->bean); $smarty = new Sugar_Smarty(); //parent::display(); $db = DBManagerFactory::getInstance(); $myquery = "SELECT tab4a.first_name fname, tab4a.last_name lname, tab5a.mrn_c mrn, tab4a.gender gender FROM reg_patient tab4a , reg_patient_cstm tab5a WHERE tab4a.id = tab5a.id_c AND tab4a.id = '" . $_REQUEST['patid'] . "'"; $result = $db->query($myquery); $patdata = null; $row = $db->fetchRow($result); $smarty->assign("patdata", $row); $risk = new RiskEvaluation(); //when week filter need to add week interval //get patient risk if exists //if ($_POST['mysort'] == 'week') if (!empty($_REQUEST['patid'])) { $risk->getRisk($_REQUEST['patid']); $smarty->assign("pid", $_REQUEST['patid']); } //echo 'request'.$_REQUEST['patid']; //else return false; //param not found //var_dump($risk); $smarty->assign("myrisk", $risk); global $current_user; $smarty->assign("myuser", $current_user); $smarty->assign("test", "test"); return $smarty->fetch('custom/modules/REG_Patient/tpls/RiskEvaluationREG_Patient.tpl'); }
/** * @see SugarView::display() */ public function display() { $ss = new Sugar_Smarty(); $ss->assign("MOD", $GLOBALS['mod_strings']); $ss->assign("INSTRUCTION", "<h1>Retrieve seller list from ebay</h1>"); $bean = BeanFactory::getBean('xeBayAccounts'); $resp = $bean->get_list("", "ebay_auth_token<>''", 0, -1, -1, 0, false, array('name')); if ($resp['row_count'] > 0) { $ebay_account_options = "<select name='ebay_account_name' id='ebay_account_name' title=''>"; if ($resp['row_count'] > 1) { $ebay_account_options .= "<option value='All'>All</option>"; } foreach ($resp['list'] as &$account) { $name = $account->name; $ebay_account_options .= "<option value='{$name}'>{$name}</option>"; } $ebay_account_options .= "</select>"; $ss->assign("EBAY_ACCOUNT_OPTIONS", $ebay_account_options); } $javascript = <<<EOQ function ImportConfirm() { \t\treturn confirm("Do you want to retrieve seller list now ?"); } EOQ; $ss->assign("JAVASCRIPT", $javascript); echo $ss->fetch("modules/xeBaySellerLists/tpls/import.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(); }
/** * @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 display() { $smarty = new Sugar_Smarty(); $smarty->assign('welcome', $GLOBALS['mod_strings']['LBL_SYNCP_WELCOME']); $smarty->assign('mod', $GLOBALS['mod_strings']); if (isset($_REQUEST['label'])) { $smarty->assign('label', $_REQUEST['label']); } $options = !empty($GLOBALS['system_config']->settings['system_portal_url']) ? $GLOBALS['system_config']->settings['system_portal_url'] : 'https://'; $smarty->assign('options', $options); $ajax = new AjaxCompose(); $ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")'); $ajax->addCrumb(translate('LBL_SYNCPORTAL', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=portalsync")'); $ajax->addSection('center', translate('LBL_SYNCPORTAL', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/portalsync.tpl')); $GLOBALS['log']->debug($smarty->fetch('modules/ModuleBuilder/tpls/portalsync.tpl')); echo $ajax->getJavascript(); }
function display() { $ss = new Sugar_Smarty(); $ss->assign('lblTotalOpportunities', translate('LBL_TOTAL_OPPORTUNITIES', 'Opportunities')); $ss->assign('lblClosedWonOpportunities', translate('LBL_CLOSED_WON_OPPORTUNITIES', 'Opportunities')); $ss->assign('total_opportunities', $this->total_opportunities); $ss->assign('total_opportunities_won', $this->total_opportunities_won); return parent::display() . $ss->fetch('modules/Opportunities/Dashlets/MyClosedOpportunitiesDashlet/MyClosedOpportunitiesDashlet.tpl'); }
/** * This function loads portal config vars from db and sets them for the view * @see SugarView::display() for more info */ function display() { $portalFields = array('appStatus' => 'offline', 'logoURL' => '', 'maxQueryResult' => '20', 'maxSearchQueryResult' => '5', 'defaultUser' => ''); $userList = get_user_array(); $userList[''] = ''; require_once "modules/MySettings/TabController.php"; $controller = new TabController(); $disabledModulesFlag = false; $disabledModules = array_diff($controller->getAllPortalTabs(), $controller->getPortalTabs()); if (!empty($disabledModules)) { $disabledModulesFlag = true; array_walk($disabledModules, function (&$item) { $item = translate($item); }); } $admin = Administration::getSettings(); $portalConfig = $admin->getConfigForModule('portal', 'support', true); $portalConfig['appStatus'] = !empty($portalConfig['on']) ? 'online' : 'offline'; $smarty = new Sugar_Smarty(); $smarty->assign('disabledDisplayModulesList', $disabledModules); $smarty->assign('disabledDisplayModules', $disabledModulesFlag); foreach ($portalFields as $fieldName => $fieldDefault) { if (isset($portalConfig[$fieldName])) { $smarty->assign($fieldName, html_entity_decode($portalConfig[$fieldName])); } else { $smarty->assign($fieldName, $fieldDefault); } } $smarty->assign('userList', $userList); $smarty->assign('welcome', $GLOBALS['mod_strings']['LBL_SYNCP_WELCOME']); $smarty->assign('mod', $GLOBALS['mod_strings']); $smarty->assign('siteURL', $GLOBALS['sugar_config']['site_url']); if (isset($_REQUEST['label'])) { $smarty->assign('label', $_REQUEST['label']); } $options = !empty($GLOBALS['system_config']->settings['system_portal_url']) ? $GLOBALS['system_config']->settings['system_portal_url'] : 'https://'; $smarty->assign('options', $options); $ajax = new AjaxCompose(); $ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")'); $ajax->addCrumb(ucwords(translate('LBL_PORTAL_CONFIGURE')), ''); $ajax->addSection('center', translate('LBL_SUGARPORTAL', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl')); $GLOBALS['log']->debug($smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl')); echo $ajax->getJavascript(); }
function getPreviousVersionsHtml($focus, $name, $value, $view) { if ('EditView' != $view && 'DetailView' != $view) { return ""; // skip the rest of the method if another view calls this method } global $sugar_version; global $mod_strings; global $app_list_strings; //2.2RC2 translation eroor fix //Detect module name and select appropriate status list $moduleName = $focus->object_name; if ($moduleName == 'oqc_Product') { $status_list = $app_list_strings["oqc_product_status_list"]; } elseif ($moduleName == 'oqc_Contract') { $status_list = $app_list_strings["oqc_contract_status_dom"]; } elseif ($moduleName == 'oqc_Offering') { $status_list = $app_list_strings["oqc_offering_status_dom"]; } elseif ($moduleName == 'oqc_Addition') { $status_list = $app_list_strings["oqc_addition_status_dom"]; } elseif ($moduleName == 'oqc_ExternalContract') { $status_list = $app_list_strings["oqc_externalcontract_status_dom"]; } else { $status_list = $app_list_strings["issue_status_dom"]; } $previousContracts = $focus->getSevenPreviousRevisions(); foreach ($previousContracts as &$contract) { $contract = $contract->toArray(); if (isset($status_list[$contract['status']])) { $contract['status'] = $status_list[$contract['status']]; } } $smarty = new Sugar_Smarty(); $smarty->assign('moduleName', $moduleName); $smarty->assign('previousContracts', array_reverse($previousContracts)); $smarty->assign($mod_strings); // $smarty->assign('numberOfPreviousContracts', count($previousContracts)); if (substr($sugar_version, 0, 1) == '6') { return $smarty->fetch('include/oqc/PreviousVersions/' . $view . '.html'); } else { return $smarty->fetch('include/oqc/PreviousVersions/' . $view . '52.html'); } }
function displayOptions() { global $app_strings, $mod_strings; $ss = new Sugar_Smarty(); $ss->assign('MOD', $this->dashletStrings); $ss->assign('title', $this->title); $ss->assign('view', $this->view); $ss->assign('id', $this->id); return parent::displayOptions() . $ss->fetch('modules/Calendar/Dashlets/CalendarDashlet/CalendarDashletOptions.tpl'); }
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(); }
/** * 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() { 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); $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); $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(); } }
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'); }
/** * searchAndDisplay * * Performs the search and returns the HTML widget containing the results * * @param $query string what we are searching for * @param $modules array modules we are searching in * @param $offset int search result offset * @return string HTML code containing results * * @deprecated deprecated since 6.5 */ public function searchAndDisplay($query, $modules, $offset = -1) { $query_encoded = urlencode($query); $formattedResults = $this->formatSearchResultsToDisplay($query, $modules, $offset); $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); return $ss->fetch(SugarAutoLoader::existingCustomOne('include/SearchForm/tpls/SugarSpot.tpl')); }
function oqc_replaceVariables($input, $variables) { $smarty = new Sugar_Smarty(); $smarty->left_delimiter = '{{'; $smarty->right_delimiter = '}}'; $smarty->register_resource('string', array('oqc_string_get_template', 'oqc_string_get_timestamp', 'oqc_string_get_secure', 'oqc_string_get_trusted')); if (!array_key_exists('language', $variables)) { global $app_list_strings; $variables['language'] = $app_list_strings['oqc']; } $smarty->assign($variables); $output = $smarty->fetch('string:' . $input); //$GLOBALS['log']->error('replaceVariables: output is: '. var_export($output,true)); return $output; }
/** * @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'); }
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 snippet($patid) { //echo("here"); $pm = new PatientMedList($patid); $pm->GetMedsDB(); //echo("there"); $sugarSmarty = new Sugar_Smarty(); $sugarSmarty->assign("duration", $duration); $sugarSmarty->assign("med", $pm->medlist); $sugarSmarty->assign("patid", $pm->patid); $sugarSmarty->assign("title", "Test med"); //return (""); return $sugarSmarty->fetch('custom/modules/REG_Patient/tpls/testmed.tpl'); // parent::display(); }
function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') { global $app_list_strings; if (!file_exists('cache/modules/unified_search_modules.php')) { $this->buildCache(); } include 'cache/modules/unified_search_modules.php'; global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $image_path, $beanList; $users_modules = $current_user->getPreference('globalSearch', 'search'); if (!isset($users_modules)) { // preferences are empty, select all $users_modules = array(); foreach ($unified_search_modules as $module => $data) { $users_modules[$module] = $beanList[$module]; } $current_user->setPreference('globalSearch', $users_modules, 0, 'search'); } $sugar_smarty = new Sugar_Smarty(); $modules_to_search = array(); foreach ($unified_search_modules as $module => $data) { if (array_key_exists($module, $modListHeader)) { if (ACLController::checkAccess($module, 'list')) { $modules_to_search[$module] = array('translated' => $app_list_strings['moduleList'][$module]); if (array_key_exists($module, $users_modules)) { $modules_to_search[$module]['checked'] = true; } else { $modules_to_search[$module]['checked'] = false; } } } } if (!empty($_REQUEST['query_string'])) { $sugar_smarty->assign('query_string', $_REQUEST['query_string']); } else { $sugar_smarty->assign('query_string', ''); } $sugar_smarty->assign('IMAGE_PATH', $image_path); if (file_exists($image_path . 'searchButton.gif')) { $sugar_smarty->assign('USE_SEARCH_GIF', 1); $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']); } else { $sugar_smarty->assign('USE_SEARCH_GIF', 0); $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_GO_BUTTON_LABEL']); } $sugar_smarty->assign('MODULES_TO_SEARCH', $modules_to_search); $sugar_smarty->debugging = true; return $sugar_smarty->fetch($tpl); }
/** * 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() { $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(); }
/** * 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'); }