Skip to content

Instantly share code, notes, and snippets.

@cmourizard
cmourizard / PDF Template.html
Created March 13, 2016 10:42
Dealing with PDF Manager
<h1>Meeting Summary</h1>
Topic:&nbsp;{$fields.name}<br />
Description:&nbsp;{$fields.description}<br />
{if isset($contacts) and $contacts|@count gt 0}
<br />
<h2>Contact Guests</h2>
<table style="width: 100%;" border="0">
<tbody>
<tr>
<td><strong>Name</strong></td>
@cmourizard
cmourizard / SugarElasticsearchConfgWithAsciifolding.php
Created August 13, 2015 12:42
Elasticsearch configuration to enable asciifolding
<?php
$sugar_config['full_text_engine']['Elastic']['index_settings']['default']['index'] = array(
'analysis' => array(
'analyzer' => array(
'core_email_lowercase' => array(
'type' => 'custom',
'tokenizer' => 'uax_url_email',
'filter' => array(
'lowercase',
@cmourizard
cmourizard / vardefs.ext.php
Created July 16, 2015 13:08
Sugar 7 - Force auto populate without the confirm box
<?php
// Add fields in the mapping
$dictionary['Contact']['fields']['account_name']['populate_list']['team_id'] = 'team_id';
$dictionary['Contact']['fields']['account_name']['populate_list']['team_name'] = 'team_name';
$dictionary['Contact']['fields']['account_name']['populate_list']['team_set_id'] = 'team_set_id';
// Force the auto populate without the confirm box
$dictionary['Contact']['fields']['account_name']['auto_populate'] = true;
// Or add your custom alert mersssage
@cmourizard
cmourizard / Font Awesome mapping from Sugar 7.5 to 7.6.md
Last active August 29, 2015 14:22
Font Awesome mapping from Sugar 7.5 to 7.6

Context

With the upgrade from Sugar 7.5 to Sugar 7.5, the engineering team upgrade the Font Awesome library like mentioned on post http://developer.sugarcrm.com/2015/05/28/upgrade-to-font-awesome-4-2-in-sugar-7-6/ and post http://developer.sugarcrm.com/2015/05/28/upgrade-to-font-awesome-4-2-in-sugar-7-6/

Mapping

In articles mentioned previously you can find a link the the official mapping from Fant Awesome (https://github.com/FortAwesome/Font-Awesome/wiki/Upgrading-from-3.2.1-to-4). You can also use the Administration > Styleguide section available in the application to know which icons are available.

However it's not really easy to switch and search on both page and that is the main reason about this cheat sheet. It is the migration mapping using to make some metadata (like panel-top and menu) compatible in both version:

@cmourizard
cmourizard / custom_Company_Helper_Logger.php
Created October 1, 2014 19:06
Custom SugarCRM logger to log messages in your own log file
<?php
require_once 'include/SugarLogger/SugarLogger.php';
class custom_Company_Helper_Logger extends SugarLogger
{
protected $logfile = 'company_logger';
protected $ext = '.log';
protected $dateFormat = '%c';
protected $logSize = '10MB';
@cmourizard
cmourizard / README.md
Created July 22, 2014 20:56
Tumblr widget for Dashing

##Preview

Description

Simple Dashing widget (and associated job) to display quote from Tumblr blog. Uses Tumblr's API.

##Usage

@cmourizard
cmourizard / Sugar 7 managing custom buttons
Created January 7, 2014 12:32
Managing custom buttons (render and action) with custom logic on Sugar 7
Managing custom buttons (render and action) with custom logic on Sugar 7
* Step 1: Add button to the metadata
* Step 2: Define a new field which contains:
* Rendering logic in method _render
* Action logic in method rowActionSelect
@cmourizard
cmourizard / SugarCRM Subpanel lazy loadding.rst
Last active December 25, 2015 02:59
SugarCRM Subpanel lazy loadding
@cmourizard
cmourizard / composer.json
Created June 26, 2013 07:13
Sugar 7 Web Service with Unirest
{
"require" : {
"mashape/unirest-php" : "dev-master"
}
}
@cmourizard
cmourizard / SugarCRM custom form validation with UnderscoreJS.rst
Last active October 27, 2018 14:14
SugarCRM custom form validation with UnderscoreJS

Steps to add custom form validation with UnderscoreJS:

  • Step 1: Include underscoreJS and custom validation in your metadata (current example: custom/modules/Contacts/metadata/editviewdefs.php)
  • Step 2: Use _.wrap function to add your custom validation before of after Sugar original check_form function which validates the form with Sugar rules (current example: custom/modules/Contacts/js/customValidation.js)
  • Step 3: Make a Quick Repair & Rebuild :-)

Additional links: