function MyLeadsByStatusDashlet($id, $options) { global $timedate; parent::Dashlet($id); $this->isConfigurable = true; $this->isRefreshable = true; if (empty($options['myleadschart_date_start'])) { $this->myleadschart_date_start = date($timedate->get_db_date_time_format(), strtotime('2008-01-01')); } else { $this->myleadschart_date_start = $options['myleadschart_date_start']; } if (empty($options['myleadschart_date_end'])) { $this->myleadschart_date_end = date($timedate->get_db_date_time_format(), time()); } else { $this->myleadschart_date_end = $options['myleadschart_date_end']; } if (empty($options['myleadschart_status'])) { $this->myleadschart_status = array(); } else { $this->myleadschart_status = $options['myleadschart_status']; } if (empty($options['title'])) { $this->title = translate('LBL_MY_LEAD_PIPELINE_FORM_TITLE', 'Charts'); } else { $this->title = $options['title']; } }
/** * Constructor * * @global string current language * @param guid $id id for the current dashlet (assigned from Home module) * @param array $def options saved for this dashlet */ function JotPadDashlet($id, $def) { $this->loadLanguage('JotPadDashlet'); // load the language strings here if (!empty($def['savedText'])) { // load default text is none is defined $this->savedText = $def['savedText']; } else { $this->savedText = $this->dashletStrings['LBL_DEFAULT_TEXT']; } if (!empty($def['height'])) { // set a default height if none is set $this->height = $def['height']; } parent::Dashlet($id); // call parent constructor $this->isConfigurable = true; // dashlet is configurable $this->hasScript = true; // dashlet has javascript attached to it // if no custom title, use default if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } }
/** * Constructor. * * @global string current language * * @param guid $id id for the current dashlet (assigned from Home module) * @param array $def options saved for this dashlet */ public function SpotsDashlet($id, $def) { $this->loadLanguage('SpotsDashlet', 'modules/Spots/Dashlets/'); // load the language strings here $this->isRefreshable = false; if (!empty($def['spotId'])) { $this->spotId = $def['spotId']; } else { $this->spotId = ''; } if (!empty($def['showGui']) && $def['showGui'] === 'on') { $this->showGui = 1; } else { $this->showGui = 0; } parent::Dashlet($id); // call parent constructor $this->isConfigurable = true; // dashlet is configurable $this->hasScript = true; // dashlet has javascript attached to it // if no custom title, use default if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } }
function MyPipelineBySalesStageDashlet($id, $options) { global $timedate; parent::Dashlet($id); $this->isConfigurable = true; $this->isRefreshable = false; if (empty($options['mypbss_date_start'])) { $this->mypbss_date_start = date($timedate->get_date_format(), time()); } else { $this->mypbss_date_start = $options['mypbss_date_start']; } if (empty($options['mypbss_date_end'])) { $this->mypbss_date_end = date($timedate->get_date_format(), strtotime('2010-01-01')); } else { $this->mypbss_date_end = $options['mypbss_date_end']; } if (empty($options['mypbss_sales_stages'])) { $this->mypbss_sales_stages = array(); } else { $this->mypbss_sales_stages = $options['mypbss_sales_stages']; } if (empty($options['title'])) { $this->title = translate('LBL_PIPELINE_FORM_TITLE', 'Home'); } }
/** * Constructor * * @global string current language * @param guid $id id for the current dashlet (assigned from Home module) * @param array $def options saved for this dashlet */ public function __construct($id, $def) { $this->loadLanguage('RSSDashlet', 'modules/Home/Dashlets/'); // load the language strings here if (!empty($def['height'])) { // set a default height if none is set $this->height = $def['height']; } if (!empty($def['url'])) { $this->url = $def['url']; } if (!empty($def['title'])) { $this->title = $def['title']; } else { $this->title = $this->dashletStrings['LBL_TITLE']; } if (isset($def['autoRefresh'])) { $this->autoRefresh = $def['autoRefresh']; } parent::Dashlet($id); // call parent constructor $this->isConfigurable = true; // dashlet is configurable $this->hasScript = false; // dashlet has javascript attached to it }
function iFrameDashlet($id, $options = null) { parent::Dashlet($id); $this->isConfigurable = true; if (!empty($options['titleLabel'])) { $this->title = translate($options['titleLabel'], 'Home'); } else { if (empty($options['title'])) { $this->title = translate('LBL_DASHLET_TITLE', 'Home'); $this->title = translate('LBL_DASHLET_DISCOVER_SUGAR_PRO', 'Home'); } else { $this->title = $options['title']; } } if (empty($options['url'])) { $this->url = $this->defaultURL; $this->url = 'http://apps.sugarcrm.com/dashlet/go-pro.html?lang=@@LANG@@&edition=@@EDITION@@&ver=@@VER@@'; } else { $this->url = $options['url']; } $this->checkURL(); if (empty($options['height']) || (int) $options['height'] < 1) { $this->height = 315; } else { $this->height = (int) $options['height']; } if (isset($options['autoRefresh'])) { $this->autoRefresh = $options['autoRefresh']; } }
function iFrameDashlet($id, $options = null) { parent::Dashlet($id); $this->isConfigurable = true; if (!empty($options['titleLabel'])) { $this->title = translate($options['titleLabel'], 'Home'); } else { if (empty($options['title'])) { $this->title = translate('LBL_DASHLET_TITLE', 'Home'); } else { $this->title = $options['title']; } } if (empty($options['url'])) { $this->url = $this->defaultURL; } else { $this->url = $options['url']; } $this->checkURL(); if (empty($options['height']) || (int) $options['height'] < 1) { $this->height = 315; } else { $this->height = (int) $options['height']; } if (isset($options['autoRefresh'])) { $this->autoRefresh = $options['autoRefresh']; } }
/** * Constructor * * @global string current language * @param guid $id id for the current dashlet (assigned from Home module) * @param array $def options saved for this dashlet */ function TrackerDashlet($id, $def) { $this->loadLanguage('TrackerDashlet', 'modules/Trackers/Dashlets/'); // load the language strings here if (!empty($def['height'])) { // set a default height if none is set $this->height = $def['height']; } parent::Dashlet($id); // call parent constructor $this->isConfigurable = true; // dashlet is configurable $this->hasScript = true; // dashlet has javascript attached to it // if no custom title, use default if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } if (isset($def['autoRefresh'])) { $this->autoRefresh = $def['autoRefresh']; } $this->tReporter = new TrackerReporter(); }
/** * Constructor * * @param int $id * @param array $options */ public function __construct($id, array $options = null) { parent::Dashlet($id); if (isset($options)) { foreach ($options as $key => $value) { $this->{$key} = $value; } } // load searchfields $classname = get_class($this); if (is_file("modules/Charts/Dashlets/{$classname}/{$classname}.data.php")) { require "modules/Charts/Dashlets/{$classname}/{$classname}.data.php"; $this->_searchFields = $dashletData[$classname]['searchFields']; } // load language files $this->loadLanguage($classname, 'modules/Charts/Dashlets/'); if (empty($options['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } if (isset($options['autoRefresh'])) { $this->autoRefresh = $options['autoRefresh']; } $this->layoutManager = new LayoutManager(); $this->layoutManager->setAttribute('context', 'Report'); // fake a reporter object here just to pass along the db type used in many widgets. // this should be taken out when sugarwidgets change $temp = (object) array('db' => &$GLOBALS['db'], 'report_def_str' => ''); $this->layoutManager->setAttributePtr('reporter', $temp); }
function iFrameDashlet($id, $options = null) { parent::Dashlet($id); $this->isConfigurable = true; if (empty($this->title)) { $this->title = translate('LBL_DASHLET_TITLE', 'Home'); $this->title = translate('LBL_DASHLET_DISCOVER_SUGAR_PRO', 'Home'); } if (!empty($options['titleLabel'])) { $this->title = translate($options['titleLabel'], 'Home'); } elseif (!empty($options['title'])) { $this->title = $options['title']; } if (empty($options['url'])) { $this->url = $this->defaultURL; $this->url = 'https://suitecrm.com/'; } else { $this->url = $options['url']; } if (empty($options['height']) || (int) $options['height'] < 1) { $this->height = 315; } else { $this->height = (int) $options['height']; } if (isset($options['autoRefresh'])) { $this->autoRefresh = $options['autoRefresh']; } }
function ZuckerReportDisplayDashlet($id, $def) { $this->loadLanguage('ZuckerReportDisplayDashlet', 'modules/ZuckerReports/Dashlets/'); parent::Dashlet($id); global $theme; $theme_path = "themes/" . $theme . "/"; require_once $theme_path . 'layout_utils.php'; $this->isConfigurable = true; $this->hasScript = false; $this->runnable_id = $def['runnable_id']; $this->title = $this->dashletStrings['LBL_NOTITLE']; }
/** * Constructor * * @global string current language * @param guid $id id for the current dashlet (assigned from Home module) * @param report_id $report_id id of the saved report * @param array $def options saved for this dashlet */ function ChartsDashlet($id, $report_id, $def) { $this->report_id = $report_id; $this->loadLanguage('ChartsDashlet'); // load the language strings here parent::Dashlet($id); // call parent constructor $this->searchFields = array(); $this->isConfigurable = true; // dashlet is configurable $this->hasScript = true; // dashlet has javascript attached to it }
function CalendarDashlet($id, $def) { $this->loadLanguage('CalendarDashlet', 'modules/Calendar/Dashlets/'); parent::Dashlet($id); $this->isConfigurable = true; $this->hasScript = true; if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } if (!empty($def['view'])) { $this->view = $def['view']; } }
function CalendarDashlet($id, $def) { $this->loadLanguage('CalendarDashlet', 'modules/Calendar/Dashlets/'); parent::Dashlet($id); $this->isConfigurable = true; $this->hasScript = true; if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } if (!empty($def['view'])) { $this->view = $def['view']; } // seedBean is need to set the calendar icon $this->seedBean = BeanFactory::newBean('Calendar'); $this->seedBean->module_name = 'Calendar'; }
function TopCampaignsDashlet($id, $def = null) { global $current_user, $app_strings; parent::Dashlet($id); $this->isConfigurable = false; $this->isRefreshable = true; if (empty($def['title'])) { $this->title = translate('LBL_TOP_CAMPAIGNS', 'Campaigns'); } $this->seedBean = new Opportunity(); $qry = "SELECT C.name AS campaign_name, SUM(O.amount) AS revenue, C.id as campaign_id " . "FROM campaigns C, opportunities O " . "WHERE C.id = O.campaign_id " . "AND O.sales_stage = 'Closed Won' " . "GROUP BY C.name,C.id ORDER BY revenue desc"; $result = $this->seedBean->db->limitQuery($qry, 0, 10); $row = $this->seedBean->db->fetchByAssoc($result); while ($row != null) { array_push($this->top_campaigns, $row); $row = $this->seedBean->db->fetchByAssoc($result); } }
function MyClosedOpportunitiesDashlet($id, $def = null) { global $current_user, $app_strings; parent::Dashlet($id); $this->isConfigurable = false; $this->isRefreshable = true; if (empty($def['title'])) { $this->title = translate('LBL_MY_CLOSED_OPPORTUNITIES', 'Opportunities'); } $this->seedBean = new Opportunity(); $qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $current_user->id . "' AND deleted=0"; $result = $this->seedBean->db->query($this->seedBean->create_list_count_query($qry)); $row = $this->seedBean->db->fetchByAssoc($result); $this->total_opportunities = $row['c']; $qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $current_user->id . "' AND sales_stage = 'Closed Won' AND deleted=0"; $result = $this->seedBean->db->query($this->seedBean->create_list_count_query($qry)); $row = $this->seedBean->db->fetchByAssoc($result); $this->total_opportunities_won = $row['c']; }
function SugarNewsDashlet($id, $options = null) { parent::Dashlet($id); $this->isConfigurable = true; if (empty($options['title'])) { $this->title = translate('LBL_DASHLET_SUGAR_NEWS', 'iFrames'); } else { $this->title = $options['title']; } if (empty($options['url'])) { $this->url = $this->defaultURL; } else { $this->url = $options['url']; } if (empty($options['height']) || (int) $options['height'] < 1) { $this->height = 315; } else { $this->height = (int) $options['height']; } }
function ZuckerReportContainerDashlet($id, $def) { $this->loadLanguage('ZuckerReportContainerDashlet', 'modules/ZuckerReports/Dashlets/'); parent::Dashlet($id); global $theme; $theme_path = "themes/" . $theme . "/"; require_once $theme_path . 'layout_utils.php'; $this->isConfigurable = true; $this->hasScript = false; if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } if (!empty($def['container_id'])) { $this->container_id = $def['container_id']; } if (!empty($def['count'])) { $this->count = $def['count']; } }
/** * Constructor * * @global string current language * @param guid $id id for the current dashlet (assigned from Home module) * @param array $def options saved for this dashlet */ function InvadersDashlet($id, $def) { $this->loadLanguage('InvadersDashlet'); // load the language strings here if (!empty($def['height'])) { // set a default height if none is set $this->height = $def['height']; } parent::Dashlet($id); // call parent constructor $this->isConfigurable = false; // dashlet is configurable $this->hasScript = true; // dashlet has javascript attached to it // if no custom title, use default if (empty($def['title'])) { $this->title = $this->dashletStrings['LBL_TITLE']; } else { $this->title = $def['title']; } }
/** * Constructor * * @see Dashlet::Dashlet() */ public function __construct($id, $def = null) { global $current_user, $app_strings; parent::Dashlet($id); $this->isConfigurable = true; $this->isRefreshable = true; if (empty($def['title'])) { $this->title = translate('LBL_TOP_CAMPAIGNS', 'Campaigns'); } else { $this->title = $def['title']; } if (isset($def['autoRefresh'])) { $this->autoRefresh = $def['autoRefresh']; } $this->seedBean = BeanFactory::getBean('Opportunities'); $qry = "SELECT C.name AS campaign_name, SUM(O.amount) AS revenue, C.id as campaign_id " . "FROM campaigns C, opportunities O " . "WHERE C.id = O.campaign_id " . "AND O.sales_stage = '" . Opportunity::STAGE_CLOSED_WON . "' " . "AND O.deleted = 0 " . "GROUP BY C.name,C.id ORDER BY revenue desc"; $result = $this->seedBean->db->limitQuery($qry, 0, 10); $row = $this->seedBean->db->fetchByAssoc($result); while ($row != null) { array_push($this->top_campaigns, $row); $row = $this->seedBean->db->fetchByAssoc($result); } }
/** * @see Dashlet::Dashlet() */ public function __construct($id, $def = null) { global $current_user, $app_strings; parent::Dashlet($id); $this->isConfigurable = true; $this->isRefreshable = true; if (empty($def['title'])) { $this->title = translate('LBL_MY_CLOSED_OPPORTUNITIES', 'Opportunities'); } else { $this->title = $def['title']; } if (isset($def['autoRefresh'])) { $this->autoRefresh = $def['autoRefresh']; } $this->seedBean = BeanFactory::getBean('Opportunities'); $qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $current_user->id . "' AND deleted=0"; $result = $this->seedBean->db->query($this->seedBean->create_list_count_query($qry)); $row = $this->seedBean->db->fetchByAssoc($result); $this->total_opportunities = $row['c']; $qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $current_user->id . "' AND sales_stage = '" . Opportunity::STAGE_CLOSED_WON . "' AND deleted=0"; $result = $this->seedBean->db->query($this->seedBean->create_list_count_query($qry)); $row = $this->seedBean->db->fetchByAssoc($result); $this->total_opportunities_won = $row['c']; }
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(); }
public function __construct($id) { parent::Dashlet($id); $this->title = translate('LBL_MODULE_NAME', 'TeamNotices'); }
function DashletGeneric($id, $options = null) { parent::Dashlet($id); $this->isConfigurable = true; if (isset($options)) { if (!empty($options['filters'])) { $this->filters = $options['filters']; } if (!empty($options['title'])) { $this->title = $options['title']; } if (!empty($options['displayRows'])) { $this->displayRows = $options['displayRows']; } if (!empty($options['displayColumns'])) { $this->displayColumns = $options['displayColumns']; } if (isset($options['myItemsOnly'])) { $this->myItemsOnly = $options['myItemsOnly']; } if (isset($options['autoRefresh'])) { $this->autoRefresh = $options['autoRefresh']; } } $this->layoutManager = new LayoutManager(); $this->layoutManager->setAttribute('context', 'Report'); // fake a reporter object here just to pass along the db type used in many widgets. // this should be taken out when sugarwidgets change $temp = (object) array('db' => &$GLOBALS['db'], 'report_def_str' => ''); $this->layoutManager->setAttributePtr('reporter', $temp); $this->lvs = new ListViewSmarty(); }