本文整理汇总了PHP中Dashlet类的典型用法代码示例。如果您正苦于以下问题:PHP Dashlet类的具体用法?PHP Dashlet怎么用?PHP Dashlet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dashlet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: addDashlet
public function addDashlet(Dashlet $dashlet)
{
$dashlet->ParentID = $this->ID;
// get all dashlets and figure out a posX and posY
$all = $this->Widgets();
$maxY = 0;
foreach ($all as $d) {
if ($d->PosY > $maxY) {
$maxY = $d->PosY + 1;
}
}
$dashlet->PosY = $maxY > 1 ? $maxY : 1;
$dashlet->write();
}
示例3: getDashletFields
public function getDashletFields()
{
$fields = parent::getDashletFields();
$fields->push(MultiSelect2Field::create('Calendars', 'Calendars')->setSource(Calendar::get()->map()->toArray())->setMultiple(true));
$fields->push(CheckboxField::create('OnlyUpcoming'));
return $fields;
}
示例4: getDashletFields
public function getDashletFields()
{
$fields = parent::getDashletFields();
$all = PostTag::get()->map('Title', 'Title')->toArray();
$fields->insertAfter(MultiValueTextField::create('FilterTags', 'Tags to filter by', $all), 'Title');
return $fields;
}
示例5: getDashletFields
public function getDashletFields()
{
$fields = parent::getDashletFields();
$input = new TextField('Days', 'Past Number of Days');
$input->setAttribute('Placeholder', 'Days');
$fields->push($input);
return $fields;
}
示例6: display
/**
* @see Dashlet::display()
*/
public 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');
}
示例7: displayOptions
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');
}
示例8: getDashletFields
public function getDashletFields()
{
$fields = parent::getDashletFields();
$input = new TextField('PageName', 'Page');
$input->setAttribute('Placeholder', 'Page Name');
$fields->push($input);
$static = new CheckboxField('DisplayLinks', 'Display Selected Links?');
$fields->push($static);
return $fields;
}
示例9: getDashletFields
public function getDashletFields()
{
$fields = parent::getDashletFields();
if (Permission::check('ADMIN')) {
$types = ClassInfo::subclassesFor('Page');
$types = array_combine($types, $types);
ksort($types);
$fields->push(new DropdownField('ListType', _t('RecentDashlet.LIST_TYPE', 'List Items of Type'), $types));
}
return $fields;
}
示例10: display
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');
}
示例11: displayOptions
function displayOptions()
{
global $app_strings;
$ss = new Sugar_Smarty();
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
$ss->assign('countLbl', $this->dashletStrings['LBL_CONFIGURE_COUNT']);
$ss->assign('containerLbl', $this->dashletStrings['LBL_CONFIGURE_CONTAINER']);
$ss->assign('saveLbl', $app_strings['LBL_SAVE_BUTTON_LABEL']);
$ss->assign('title', $this->title);
$container = ReportContainer::get_category_select_options();
asort($container);
$ss->assign('containerSelect', get_select_options_with_id($container, $this->container_id));
$ss->assign('count', $this->count);
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/ZuckerReports/Dashlets/ZuckerReportContainerDashlet/ZuckerReportContainerDashletOptions.tpl');
}
示例12: displayOptions
/**
* Displays the configuration form for the dashlet
*
* @return string html to display form
*/
public function displayOptions()
{
global $app_strings;
$ss = new Sugar_Smarty();
$this->dashletStrings['LBL_SAVE'] = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$ss->assign('lang', $this->dashletStrings);
$ss->assign('id', $this->id);
$ss->assign('title', $this->title);
$ss->assign('titleLbl', $this->dashletStrings['LBL_CONFIGURE_TITLE']);
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);
}
$str = $ss->fetch('modules/SugarFavorites/Dashlets/SugarFavoritesDashlet/SugarFavoritesDashletOptions.tpl');
return Dashlet::displayOptions() . $str;
}
示例13: displayOptions
function displayOptions()
{
global $app_strings;
$seed = new RunnableReport();
$list = $seed->get_full_list("name", "report_result_type='INLINE'");
$select = array();
if (!empty($list)) {
foreach ($list as $bean) {
$select[$bean->id] = $bean->get_summary_text();
}
}
asort($select);
$ss = new Sugar_Smarty();
$ss->assign('runnableLbl', $this->dashletStrings['LBL_CONFIGURE_RUNNABLE']);
$ss->assign('runnableSelect', get_select_options_with_id($select, $this->runnable_id));
$ss->assign('id', $this->id);
return parent::displayOptions() . $ss->fetch('modules/ZuckerReports/Dashlets/ZuckerReportDisplayDashlet/ZuckerReportDisplayDashletOptions.tpl');
}
示例14: AORReportsDashlet
function AORReportsDashlet($id, $def = array())
{
global $current_user, $app_strings;
parent::Dashlet($id);
$this->isConfigurable = true;
$this->def = $def;
if (empty($def['dashletTitle'])) {
$this->title = translate('LBL_AOR_REPORTS_DASHLET', 'AOR_Reports');
} else {
$this->title = $def['dashletTitle'];
}
$this->params = array();
if (!empty($def['parameter_id'])) {
foreach ($def['parameter_id'] as $key => $parameterId) {
$this->params[$parameterId] = array('id' => $parameterId, 'operator' => $def['parameter_operator'][$key], 'type' => $def['parameter_type'][$key], 'value' => $def['parameter_value'][$key]);
}
}
if (!empty($def['aor_report_id'])) {
$this->report = BeanFactory::getBean('AOR_Reports', $def['aor_report_id']);
$this->report->user_parameters = $this->params;
}
$this->onlyCharts = !empty($def['onlyCharts']);
$this->charts = !empty($def['charts']) ? $def['charts'] : array();
}
示例15: display
/**
* Displays the dashlet
*
* @return string html to display dashlet
*/
function display()
{
require_once "modules/Reports/Report.php";
// ini_set('display_errors', 'false');
$chartReport = new SavedReport();
$chartExists = $chartReport->retrieve($this->report_id, false);
if (!is_null($chartExists)) {
$this->title = $chartReport->name;
$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();
require_once "modules/Reports/templates/templates_chart.php";
ob_start();
template_chart($reporter, true, true, $this->id);
$str = ob_get_contents();
ob_end_clean();
$xmlFile = 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
}
}