本文整理汇总了PHP中Sugar_Smarty::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP Sugar_Smarty::assign方法的具体用法?PHP Sugar_Smarty::assign怎么用?PHP Sugar_Smarty::assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sugar_Smarty
的用法示例。
在下文中一共展示了Sugar_Smarty::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: browse
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;
}
示例2: display
/**
* @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");
}
示例3: getImageHtml
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');
}
示例4: display
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();
}
示例5: getAdditionsHtml
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');
}
}
示例6: display
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');
}
示例7: template_groups_chooser
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");
}
示例8: display
/**
* @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");
}
示例9: display
/**
* display
* Override the display method to support customization for the buttons that display
* a popup and allow you to copy the account's address into the selected contacts.
* The custom_code_billing and custom_code_shipping Smarty variables are found in
* include/SugarFields/Fields/Address/DetailView.tpl (default). If it's a English U.S.
* locale then it'll use file include/SugarFields/Fields/Address/en_us.DetailView.tpl.
*/
function display()
{
global $app_strings, $app_list_strings;
global $mod_strings;
parent::display();
$smarty = new Sugar_Smarty();
$smarty->assign('APP', $app_strings);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('RECORD', $this->bean->id);
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'xeBayOrderSend', 'field_to_name_array' => array('description' => 'message'));
$json = getJSONobj();
$smarty->assign('ENCODED_TEMPLATES_POPUP_REQUEST_DATA', $json->encode($popup_request_data));
$smarty->assign("TEMPLATE_SELECT", SugarThemeRegistry::current()->getImage('id-ff-select', '', null, null, '.png', $mod_strings['LBL_SELECT']));
$smarty->assign("TEMPLATE_CLEAR", SugarThemeRegistry::current()->getImage('id-ff-clear', '', null, null, '.gif', $mod_strings['LBL_ID_FF_CLEAR']));
$itemAssociation = '';
$this->bean->load_relationship('xebaytransactions');
$transactions = $this->bean->xebaytransactions->getBeans();
$first = true;
foreach ($transactions as &$transaction) {
if (!empty($transaction->item_item_id)) {
if ($first == true) {
$first = false;
$smarty->assign('ITEM_ID', $transaction->item_item_id);
$smarty->assign('SUBJECT', $transaction->name);
$itemAssociation .= "<input name='item_assocaition' id='{$transaction->name}' type='radio' value='{$transaction->item_item_id}' checked='checked' onclick=select_item_id(this) />{$transaction->name}<br>";
} else {
$itemAssociation .= "<input name='item_assocaition' id='{$transaction->name}' type='radio' value='{$transaction->item_item_id}' onclick=select_item_id(this) />{$transaction->name}<br>";
}
}
}
$smarty->assign('ITEM_ASSOCIATION', $itemAssociation);
$smarty->assign('SALUTATION', str_replace("\n", "<br>", $this->bean->get_salutation()));
$smarty->assign('SIGNATURE', str_replace("\n", "<br>", $this->bean->get_signature()));
$smarty->display("modules/xeBayOrders/tpls/send.tpl");
}
示例10: display
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();
}
}
示例11: display
function display()
{
global $mod_strings, $app_strings;
require_once 'include/connectors/utils/ConnectorUtils.php';
require_once 'include/connectors/sources/SourceFactory.php';
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('mod', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$connectors = ConnectorUtils::getConnectors(true);
$required_fields = array();
//Get required fields for first connector only
foreach ($connectors as $id => $entry) {
$s = SourceFactory::getSource($id);
$connector_strings = ConnectorUtils::getConnectorStrings($id);
$fields = $s->getRequiredConfigFields();
foreach ($fields as $field_id) {
$label = isset($connector_strings[$field_id]) ? $connector_strings[$field_id] : $field_id;
$required_fields[$id][$field_id] = $label;
}
break;
}
$sugar_smarty->assign('SOURCES', $connectors);
$sugar_smarty->assign('REQUIRED_FIELDS', $required_fields);
echo get_module_title('Connectors', $mod_strings['LBL_MODIFY_PROPERTIES_PAGE_TITLE'], true);
$sugar_smarty->display('modules/Connectors/tpls/modify_properties.tpl');
}
示例12: constructSmarty
protected function constructSmarty()
{
$smarty = new Sugar_Smarty();
$smarty->assign('translate', true);
$smarty->assign('language', "Leads");
$smarty->assign('view_module', "Leads");
$smarty->assign('module', "Leads");
$smarty->assign('helpName', 'listViewEditor');
$smarty->assign('helpDefault', 'modify');
$smarty->assign('title', 'Convert Layout');
$modules = $this->getModulesFromDefs();
$smarty->assign('modules', $this->jsonHelper->encode($modules));
require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php';
$relatableModules = DeployedRelationships::findRelatableModules();
//pull out modules that have already been chosen
foreach ($modules as $mDef) {
if (isset($relatableModules[$mDef['module']])) {
unset($relatableModules[$mDef['module']]);
}
}
$displayModules = array();
$moduleDefaults = array();
foreach ($relatableModules as $mod => $def) {
if ($this->parser->isModuleAllowedInConvert($mod)) {
$displayModules[$mod] = translate($mod);
$moduleDefaults[$mod] = $this->parser->getDefaultDefForModule($mod);
}
}
$smarty->assign('availableModules', $displayModules);
$smarty->assign('moduleDefaults', $this->jsonHelper->encode($moduleDefaults));
return $smarty;
}
示例13: snippet
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');
}
示例14: display
function display()
{
global $app_strings, $current_user, $mod_strings, $app_list_strings;
$smarty = new Sugar_Smarty();
require_once 'include/JSON.php';
//Load the field list from the target module
$selected_lang = $_SESSION['authenticated_user_language'];
$vardef = array();
//Copy app strings
$my_list_strings = array_merge($app_list_strings);
$child = $_REQUEST['field'];
//if we are using ModuleBuilder then process the following
if (!empty($_REQUEST['package']) && $_REQUEST['package'] != 'studio') {
require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
$mb = new ModuleBuilder();
$this->module = $mb->getPackageModule($_REQUEST['package'], $_REQUEST['view_module']);
$vardef = $this->module->getVardefs();
$this->module->mblanguage->generateAppStrings(false);
$my_list_strings = array_merge($my_list_strings, $this->module->mblanguage->appListStrings[$selected_lang . '.lang.php']);
} else {
$vardef = BeanFactory::getBean($_REQUEST['view_module'])->field_defs;
}
foreach ($my_list_strings as $key => $value) {
if (!is_array($value)) {
unset($my_list_strings[$key]);
}
}
$parents = $this->getParentDDs($vardef, $child, $my_list_strings);
$visibility_grid = !empty($vardef[$child]['visibility_grid']) ? $vardef[$child]['visibility_grid'] : array();
$smarty->assign('app_strings', $app_strings);
$smarty->assign('mod', $mod_strings);
$smarty->assign('parents', JSON::encode($parents));
$smarty->assign('visibility_grid', JSON::encode($visibility_grid));
$smarty->display('modules/ExpressionEngine/tpls/ddEditor.tpl');
}
示例15: getAttachmentsHtml
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');
}