Skip to content

Instantly share code, notes, and snippets.

@elchele
elchele / idx_user_del_vis.ext.php
Created January 2, 2018 18:53
Vardefs extension for Tracker index -- for versions prior to 7.7.2
<?php
/* File: ./custom/Extension/modules/Trackers/Ext/Vardefs/idx_user_del_vis.ext.php */
$dictionary['Tracker']['indices'][] = array (
'name' => 'idx_tracker_userid_del_vis',
'type' => 'index',
'fields' =>
array (
0 => 'user_id',
@elchele
elchele / create.js
Created April 13, 2017 02:29
Refresh of a peer subpanel upon a change occurring in a different subpanel. Ex: Add record on Notes subpanel for Accounts => refresh Leads subpanel.
({
/* File: ./custom/modules/Notes/clients/base/views/create/create.js */
extendsFrom: 'CreateView',
save: function(){
this._super('save');
//TODO: Add logic to check if parent model exists to verify if being created via subpanel or other means.
@elchele
elchele / create.js
Created April 12, 2017 16:51
Example demonstrating changes to createview fields upon relate field changing
({
/* File: ./custom/modules/Contacts/clients/base/views/create/create.js */
extendsFrom:'CreateView',
initialize: function(options){
this._super('initialize', [options]);
this.model.on('change:account_id', this.test, this);
@elchele
elchele / en_us.news.lang.ext.php
Created April 4, 2017 22:48
Google News dashlet for Sugar 7.8+
<?php
/* File: ./custom/Extension/application/Ext/Language/en_us.news.lang.ext.php */
$app_strings['LBL_DASHLET_NEWS_NAME'] = 'Google News';
$app_strings['LBL_DASHLET_NEWS_DESC'] = 'Google News search results for the current Account record.';
?>
@elchele
elchele / selection-list.js
Created December 21, 2016 21:40
Custom controller for selection-list view, defines sorting on Assigned To list of users
({
/* File: ./custom/modules/Users/clients/base/views/selection-list/selection-list.js */
extendsFrom: 'SelectionListView',
initialize: function(options){
this._super('initialize', [options]);
this.collection.orderBy = {'field':'full_name', 'direction':'asc'};
@elchele
elchele / FakeLinkApi.php
Last active August 24, 2017 04:25
Customization for pulling external/ad-hoc data into a Sugar subpanel
<?php
/* File: ./custom/clients/base/api/FakeLinkApi.php */
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class FakeLinkApi extends SugarApi {
public function registerApiRest() {
return array(
'filterRelatedRecords' => array(
@elchele
elchele / rmas.ext.php
Created September 2, 2016 18:27
Disabling ActivityStream on a specific module (Accounts) and global logic hooks that support functionality.
<?php
/* File: ./custom/Extension/modules/<Module>/Ext/Vardefs */
$dictionary['Account']['activity_enabled'] = false;
?>
@elchele
elchele / news.hbs
Last active July 27, 2016 21:18
Adjustment to controller for News dashlet to switch from using Google API to Google News RSS feed. Google API was retired and no longer functional.
{{!--
/* File: ./custom/clients/base/views/news/news.hbs
*
* Date: July 27, 2016
*
* Author: Angel Magaña
*
* Description: Adjustment to News dashlet Handlebars template
*
*/
@elchele
elchele / cw7.cs
Last active November 23, 2020 06:20
Base C# class for interacting with Sugar 7 REST v10 API
/* SugarCRM v7 REST API Wrapper
*
* Date: May 13, 2014
*
* Author: Angel Magaña
*
* Contact: cheleguanaco[at]cheleguanaco.com
* cheleguanaco.com
*
*
@elchele
elchele / LogicHookController.php
Last active March 11, 2016 01:28
Fix to Marketo logic hook correcting issue with dates and users with non-US date format
<?php
/* File: ./custom/include/externalAPI/Marketo/LogicHookController.php */
/*
* Copyright (c) 2014-2015 SugarCRM Inc. This product is licensed by SugarCRM
* pursuant to the terms of the End User License Agreement available at
* http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/10_Marketo/
*/