Skip to content

Instantly share code, notes, and snippets.

@elchele
elchele / idx_user_del_vis.ext.php
Created Jan 2, 2018
Vardefs extension for Tracker index -- for versions prior to 7.7.2
View idx_user_del_vis.ext.php
<?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 Apr 13, 2017
Refresh of a peer subpanel upon a change occurring in a different subpanel. Ex: Add record on Notes subpanel for Accounts => refresh Leads subpanel.
View create.js
({
/* 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 Apr 12, 2017
Example demonstrating changes to createview fields upon relate field changing
View create.js
({
/* 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 Apr 4, 2017
Google News dashlet for Sugar 7.8+
View en_us.news.lang.ext.php
<?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 Dec 21, 2016
Custom controller for selection-list view, defines sorting on Assigned To list of users
View selection-list.js
({
/* 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 Aug 24, 2017
Customization for pulling external/ad-hoc data into a Sugar subpanel
View FakeLinkApi.php
<?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 Sep 2, 2016
Disabling ActivityStream on a specific module (Accounts) and global logic hooks that support functionality.
View rmas.ext.php
<?php
/* File: ./custom/Extension/modules/<Module>/Ext/Vardefs */
$dictionary['Account']['activity_enabled'] = false;
?>
@elchele
elchele / news.hbs
Last active Jul 27, 2016
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.
View news.hbs
{{!--
/* 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 Nov 23, 2020
Base C# class for interacting with Sugar 7 REST v10 API
View cw7.cs
/* 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 Mar 11, 2016
Fix to Marketo logic hook correcting issue with dates and users with non-US date format
View LogicHookController.php
<?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/
*/