Skip to content

Instantly share code, notes, and snippets.

@elchele
elchele / (pre-7.2) sidebartoggle.js
Last active August 29, 2015 14:00
Hiding the Sugar 7 intelligence pane by default
({
/* **** PRE-7.2 ONLY ****
place in /custom/modules/<Module>/clients/base/fields/sidebartoggle/ for module specific
place in /custom/clients/base/fields/sidebartoggle/ for global context */
extendsFrom: 'sidebartoggle',
/* Override existing _render method and call default toggle() method to mimic click of button to hide
the sidebar/intelligence pane */
_render: function() {
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/modules/Contacts/clients/base/views/record/record.js
*
* Extended RecordView controller for applying custom
* RecordView metadata at initialize time (Sugar 7.2+)
*
*/
extendsFrom: 'RecordView',
@elchele
elchele / subpanel-list.js
Created August 20, 2014 21:20
Custom controller for suppressing "edit" button functionality on Calls subpanel
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/clients/base/views/subpanel-list/subpanel-list.js
*
* Extended Subpanel List controller to suppress "Edit" functionality
* on "Calls" subpanel throughout Sugar (Sugar 7.2+)
*
*/
extendsFrom: 'SubpanelListView',
@elchele
elchele / subpanels.js
Last active August 29, 2015 14:06
Subpanel layout controller to hide empty subpanels
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/clients/base/layouts/subpanels/subpanels.js
*
* Extended subpanels layout controller for hiding
* subpanels without data upon parent record load (Sugar 7.2+)
*
* This customization applies to all modules
*/
@elchele
elchele / flex-list.hbs
Last active August 29, 2015 14:06
Expanding the default width on the Name column
{{!--
/*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then do not
* install or use this SugarCRM file.
*
* Copyright (C) SugarCRM Inc. All rights reserved.
@elchele
elchele / create-actions.js
Created October 15, 2014 22:24
Custom controller for setting a default value on a field upon record creation
({
/* file: ./custom/modules/Accounts/clients/base/views/create-actions/create-actions.js */
extendsFrom: 'CreateView',
initialize: function(options){
this._super('initialize', [options]);
/* this is where I set the default value for a given field, in this case
it is the value 'Angel Inc.' to the 'name' field in the Accounts module.
@elchele
elchele / en_us.quota_gauge.ext.php
Last active August 29, 2015 14:08
Gauge for demonstrating progress towards assigned quota within current time period.
<?php
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/Extension/application/Ext/Language/en_us.quota_gauge.ext.php
*
* labels for 'Quota Metrics' custom gauge chart for Home Dashboard
* For Sugar Ent/Ult only as it is based off RLI data
*/
$app_strings['LBL_QUOTA_GAUGE'] = 'Quota Metrics';
@elchele
elchele / record.js
Created November 18, 2014 01:14
Custom controller for RecordView, demonstrates dynamic required fields based on current user
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/modules/<Module>/clients/base/views/record/record.js
*
* Custom controller for RecordView demonstrating dynamic required attribute
* (leads module is used for the example)
*/
extendsFrom: 'RecordView',
@elchele
elchele / StockApi.php
Created March 26, 2015 21:01
Custom endpoint for Sugar REST API, uses CURL to interact with external web service.
<?php
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/modules/Accounts/clients/base/api/StockApi.php
*
* Custom Sugar REST API endpoint demonstrating use of CURL to
* interact with an external web service.
*
* Useful for circumventing XSS issues one may experience when calling
* a web service via JavaScript (e.g. Sidecar controller)
@elchele
elchele / module-list.js
Created May 15, 2015 18:55
Customization for adding "alias" NavBar links to Sugar 7
({
/* File: ./custom/clients/base/layouts/module-list/module-list.js */
extendsFrom: 'ModuleListLayout',
_addDefaultMenus: function() {
var moduleList = app.metadata.getModuleNames({filter: 'display_tab', access: 'read'});
moduleList.push('Custom1');