/** * Overrides the generic process to include custom logic for email addresses, * since they are no longer stored in a list view friendly manner. * (A record may have an undetermined number of email addresses). * * @param array $lvsParams */ function process($lvsParams = array()) { if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) { $lvsParams['custom_select'] = ', email_address as email1'; $lvsParams['custom_from'] = "LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = 'Accounts' " . "AND eabr.bean_id = accounts.id AND primary_address = 1 " . "LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id"; } parent::process($lvsParams); }
function process($lvsParams = array()) { global $current_language, $app_list_strings, $current_user; $mod_strings = return_module_language($current_language, 'Meetings'); // handle myitems only differently -- set the custom query to show assigned meetings and invitee meetings if ($this->myItemsOnly) { //join with meeting_users table to process related users $this->seedBean->listview_inner_join = array('LEFT JOIN meetings_users m_u on m_u.meeting_id = meetings.id'); //set the custom query to retrieve invitees AND assigned meetings $lvsParams['custom_where'] = ' AND (meetings.assigned_user_id = \'' . $current_user->id . '\' OR (m_u.user_id = \'' . $current_user->id . '\' AND m_u.deleted=0)) '; } $this->myItemsOnly = false; //query needs to be distinct to avoid multiple records being returned for the same meeting (one for each invited user), //so we need to make sure date entered is also set so the sort can work with the group by $lvsParams['custom_select'] = ', meetings.date_entered '; $lvsParams['distinct'] = true; parent::process($lvsParams); $keys = array(); foreach ($this->lvs->data['data'] as $num => $row) { $keys[] = $row['ID']; } // grab meeting status if (!empty($keys)) { $query = "SELECT meeting_id, accept_status FROM meetings_users WHERE deleted = 0 AND user_id = '" . $current_user->id . "' AND meeting_id IN ('" . implode("','", $keys) . "')"; $result = $GLOBALS['db']->query($query); while ($row = $GLOBALS['db']->fetchByAssoc($result)) { $rowNums = $this->lvs->data['pageData']['idIndex'][$row['meeting_id']]; // figure out which rows have this guid foreach ($rowNums as $rowNum) { $this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] = $row['accept_status']; } } } foreach ($this->lvs->data['data'] as $rowNum => $row) { if (empty($this->lvs->data['data'][$rowNum]['DURATION_HOURS'])) { $this->lvs->data['data'][$rowNum]['DURATION'] = '0' . $mod_strings['LBL_HOURS_ABBREV']; } else { $this->lvs->data['data'][$rowNum]['DURATION'] = $this->lvs->data['data'][$rowNum]['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV']; } if (empty($this->lvs->data['data'][$rowNum]['DURATION_MINUTES']) || empty($this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']])) { $this->lvs->data['data'][$rowNum]['DURATION'] .= '00'; } else { $this->lvs->data['data'][$rowNum]['DURATION'] .= $this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']]; } $this->lvs->data['data'][$rowNum]['DURATION'] .= $mod_strings['LBL_MINSS_ABBREV']; if (!empty($this->lvs->data['data'][$rowNum]['STATUS']) && $this->lvs->data['data'][$rowNum]['STATUS'] == $app_list_strings['meeting_status_dom']['Planned']) { if ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == '') { //if no status has been set, then do not show accept options $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\" class=\"acceptMeeting\"></div>"; } elseif ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == 'none') { $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept" . $this->id . "\" class=\"acceptMeeting\"><a title=\"" . $app_list_strings['dom_meeting_accept_options']['accept'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=accept', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("accept_inline", "border='0'", null, null, '.gif', $app_list_strings['dom_meeting_accept_options']['accept']) . "</a> <a title=\"" . $app_list_strings['dom_meeting_accept_options']['tentative'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=tentative', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("tentative_inline", "border='0'", null, null, '.gif', $app_list_strings['dom_meeting_accept_options']['tentative']) . "</a> <a title=\"" . $app_list_strings['dom_meeting_accept_options']['decline'] . "\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=" . $this->id . "&object_type=Meeting&object_id=" . $this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=decline', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">" . SugarThemeRegistry::current()->getImage("decline_inline", "border='0'", null, null, '.gif', $app_list_strings['dom_meeting_accept_options']['decline']) . "</a></div>"; } else { $this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS']]; } } } $this->displayColumns[] = "set_accept_links"; }
function process($lvsParams = array()) { if (!empty($this->displayColumns)) { if (array_search('amount', $this->displayColumns)) { $this->displayColumns[array_search('amount', $this->displayColumns)] = 'amount_usdollar'; } } parent::process($lvsParams); }
function process() { global $current_language, $app_list_strings, $image_path, $current_user; //$where = 'emails.deleted = 0 AND emails.assigned_user_id = \''.$current_user->id.'\' AND emails.type = \'inbound\' AND emails.status = \'unread\''; $mod_strings = return_module_language($current_language, 'Emails'); $this->filters['assigned_user_id'] = $current_user->id; $this->filters['type'] = array("inbound"); $this->filters['status'] = array("unread"); parent::process(); }
function MyCasesDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_LIST_MY_CASES', 'Cases'); } $this->searchFields = $dashletData['MyCasesDashlet']['searchFields']; $this->columns = $dashletData['MyCasesDashlet']['columns']; $this->seedBean = new aCase(); }
function MyAccountsDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'Accounts'); } $this->searchFields = $dashletData['MyAccountsDashlet']['searchFields']; $this->columns = $dashletData['MyAccountsDashlet']['columns']; $this->seedBean = new Account(); }
function jjwg_Address_CacheDashlet($id, $def = null) { require 'modules/jjwg_Address_Cache/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'jjwg_Address_Cache'); } $this->searchFields = $dashletData['jjwg_Address_CacheDashlet']['searchFields']; $this->columns = $dashletData['jjwg_Address_CacheDashlet']['columns']; $this->seedBean = new jjwg_Address_Cache(); }
function MyOpportunitiesDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_TOP_OPPORTUNITIES', 'Opportunities'); } $this->searchFields = $dashletData['MyOpportunitiesDashlet']['searchFields']; $this->columns = $dashletData['MyOpportunitiesDashlet']['columns']; $this->seedBean = new Opportunity(); }
function MyProjectTaskDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_LIST_MY_PROJECT_TASKS', 'ProjectTask'); } $this->searchFields = $dashletData['MyProjectTaskDashlet']['searchFields']; $this->columns = $dashletData['MyProjectTaskDashlet']['columns']; $this->seedBean = new ProjectTask(); }
function __construct($id, $def = null) { require 'modules/jjwg_Maps/metadata/dashletviewdefs.php'; parent::__construct($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'jjwg_Maps'); } $this->searchFields = $dashletData['jjwg_MapsDashlet']['searchFields']; $this->columns = $dashletData['jjwg_MapsDashlet']['columns']; $this->seedBean = new jjwg_Maps(); }
function AllContractsDashlet($id, $def = null) { require_once "modules/oqc_Contract/Dashlets/AllContractsDashlet/AllContractsDashlet.data.php"; parent::DashletGeneric($id, $def); $this->searchFields = $dashletData['AllContractsDashlet']['searchFields']; $this->columns = $dashletData['AllContractsDashlet']['columns']; // not only showing my contracts (that are contracts where assigned_user_id == my_user_id) $this->myItemsOnly = false; // make sure that DashletGeneric::buildWhere is called // for more filters see include/generic/SugarWidgets/SugarWidgetFielddate.php $this->seedBean = new oqc_Contract(); }
function MyBugsDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/Bugs/Dashlets/MyBugsDashlet/MyBugsDashlet.data.php'; parent::DashletGeneric($id, $def); $this->searchFields = $dashletData['MyBugsDashlet']['searchFields']; $this->columns = $dashletData['MyBugsDashlet']['columns']; if (empty($def['title'])) { $this->title = translate('LBL_LIST_MY_BUGS', 'Bugs'); } $this->seedBean = new Bug(); }
function __construct($id, $def = null) { global $current_user, $app_strings; require 'modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.data.php'; parent::__construct($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_LIST_MY_TASKS', 'Tasks'); } $this->searchFields = $dashletData['MyTasksDashlet']['searchFields']; $this->columns = $dashletData['MyTasksDashlet']['columns']; $this->seedBean = new Task(); }
function opalo_items_solicitud_cotizacionDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/opalo_items_solicitud_cotizacion/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'opalo_items_solicitud_cotizacion'); } $this->searchFields = $dashletData['opalo_items_solicitud_cotizacionDashlet']['searchFields']; $this->columns = $dashletData['opalo_items_solicitud_cotizacionDashlet']['columns']; $this->seedBean = new opalo_items_solicitud_cotizacion(); }
function anmol_University_listDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/anmol_University_list/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'anmol_University_list'); } $this->searchFields = $dashletData['anmol_University_listDashlet']['searchFields']; $this->columns = $dashletData['anmol_University_listDashlet']['columns']; $this->seedBean = new anmol_University_list(); }
function ins_p_insurance_policyDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/ins_p_insurance_policy/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'ins_p_insurance_policy'); } $this->searchFields = $dashletData['ins_p_insurance_policyDashlet']['searchFields']; $this->columns = $dashletData['ins_p_insurance_policyDashlet']['columns']; $this->seedBean = new ins_p_insurance_policy(); }
function __construct($id, $def = null) { global $current_user, $app_strings; require 'modules/AOK_Knowledge_Base_Categories/metadata/dashletviewdefs.php'; parent::__construct($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'AOK_Knowledge_Base_Categories'); } $this->searchFields = $dashletData['AOK_Knowledge_Base_CategoriesDashlet']['searchFields']; $this->columns = $dashletData['AOK_Knowledge_Base_CategoriesDashlet']['columns']; $this->seedBean = new AOK_Knowledge_Base_Categories(); }
function d1_The_possible_transactionDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/d1_The_possible_transaction/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'd1_The_possible_transaction'); } $this->searchFields = $dashletData['d1_The_possible_transactionDashlet']['searchFields']; $this->columns = $dashletData['d1_The_possible_transactionDashlet']['columns']; $this->seedBean = new d1_The_possible_transaction(); }
function MyProjectDashlet($id, $def = null) { global $current_user, $app_strings; require 'custom/modules/Project/Dashlets/MyProjectDashlet/MyProjectDashlet.data.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_LIST_MY_PROJECT', 'Project'); } $this->searchFields = $dashletData['MyProjectDashlet']['searchFields']; $this->columns = $dashletData['MyProjectDashlet']['columns']; $this->seedBean = new Project(); }
function __construct($id, $def = null) { global $current_user, $app_strings; require 'modules/OutboundEmailAccounts/metadata/dashletviewdefs.php'; parent::__construct($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'OutboundEmailAccounts'); } $this->searchFields = $dashletData['OutboundEmailAccountsDashlet']['searchFields']; $this->columns = $dashletData['OutboundEmailAccountsDashlet']['columns']; $this->seedBean = new OutboundEmailAccounts(); }
function sel_Selkirk_PartnerDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/sel_Selkirk_Partener_Contribution/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'sel_Selkirk_Partener_Contribution'); } $this->searchFields = $dashletData['sel_Selkirk_PartnerDashlet']['searchFields']; $this->columns = $dashletData['sel_Selkirk_PartnerDashlet']['columns']; $this->seedBean = new sel_Selkirk_Partener_Contribution(); }
function MyQuotesDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/Quotes/Dashlets/MyQuotesDashlet/MyQuotesDashlet.data.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_LIST_MY_QUOTES', 'Quotes'); } $this->searchFields = $dashletData['MyQuotesDashlet']['searchFields']; $this->columns = $dashletData['MyQuotesDashlet']['columns']; $this->seedBean = BeanFactory::getBean('Quotes'); }
function __construct($id, $def = null) { global $current_user, $app_strings; require 'modules/My_Custom_Issue/metadata/dashletviewdefs.php'; parent::__construct($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'My_Custom_Issue'); } $this->searchFields = $dashletData['My_Custom_IssueDashlet']['searchFields']; $this->columns = $dashletData['My_Custom_IssueDashlet']['columns']; $this->seedBean = new My_Custom_Issue(); }
function __construct($id, $def = null) { global $current_user, $app_strings; require 'modules/glam_Glam_Envio_Informacion/metadata/dashletviewdefs.php'; parent::__construct($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'glam_Glam_Envio_Informacion'); } $this->searchFields = $dashletData['glam_Glam_Envio_InformacionDashlet']['searchFields']; $this->columns = $dashletData['glam_Glam_Envio_InformacionDashlet']['columns']; $this->seedBean = new glam_Glam_Envio_Informacion(); }
function MyNotesDashlet($id, $def = null) { global $current_user, $app_strings, $dashletData; require 'modules/Notes/Dashlets/MyNotesDashlet/MyNotesDashlet.data.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_MY_NOTES_DASHLETNAME', 'Notes'); } $this->searchFields = $dashletData['MyNotesDashlet']['searchFields']; $this->columns = $dashletData['MyNotesDashlet']['columns']; $this->seedBean = new Note(); }
function MyContactsDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/Contacts/Dashlets/MyContactsDashlet/MyContactsDashlet.data.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'Contacts'); } $this->searchFields = $dashletData['MyContactsDashlet']['searchFields']; $this->columns = $dashletData['MyContactsDashlet']['columns']; $this->seedBean = new Contact(); }
/** * Overrides the generic process to include custom logic for email addresses, * since they are no longer stored in a list view friendly manner. * (A record may have an undetermined number of email addresses). * * @param array $lvsParams */ function process($lvsParams = array()) { if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) { $lvsParams['custom_select'] = ', email_address as email1'; $lvsParams['custom_from'] = ' LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = \'Accounts\'' . ' AND eabr.bean_id = accounts.id AND primary_address = 1' . ' LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id'; } if (isset($this->displayColumns) && array_search('parent_name', $this->displayColumns) !== false) { $lvsParams['custom_select'] = empty($lvsParams['custom_select']) ? ', a1.name as parent_name ' : $lvsParams['custom_select'] . ', a1.name as parent_name '; $lvsParams['custom_from'] = empty($lvsParams['custom_from']) ? ' LEFT JOIN accounts a1 on a1.id = accounts.parent_id' : $lvsParams['custom_from'] . ' LEFT JOIN accounts a1 on a1.id = accounts.parent_id'; } parent::process($lvsParams); }
function legal_eventsDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/legal_events/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'legal_events'); } $this->searchFields = $dashletData['legal_eventsDashlet']['searchFields']; $this->columns = $dashletData['legal_eventsDashlet']['columns']; $this->seedBean = new legal_events(); }
function fs_fourniseurDashlet($id, $def = null) { global $current_user, $app_strings; require 'modules/fs_company/metadata/dashletviewdefs.php'; parent::DashletGeneric($id, $def); if (empty($def['title'])) { $this->title = translate('LBL_HOMEPAGE_TITLE', 'fs_company'); } $this->searchFields = $dashletData['fs_fourniseurDashlet']['searchFields']; $this->columns = $dashletData['fs_fourniseurDashlet']['columns']; $this->seedBean = new fs_company(); }
function process() { global $current_language, $app_list_strings, $image_path, $current_user; //$where = 'emails.deleted = 0 AND emails.assigned_user_id = \''.$current_user->id.'\' AND emails.type = \'inbound\' AND emails.status = \'unread\''; $mod_strings = return_module_language($current_language, 'Emails'); $this->filters['assigned_user_id'] = $current_user->id; $this->filters['type'] = array("inbound"); $this->filters['status'] = array("unread"); $lvsParams = array(); $lvsParams['custom_select'] = " ,emails_text.from_addr as from_addr "; $lvsParams['custom_from'] = " join emails_text on emails.id = emails_text.email_id "; parent::process($lvsParams); }