Skip to content

Instantly share code, notes, and snippets.

View mmarum-sugarcrm's full-sized avatar

Matt Marum mmarum-sugarcrm

View GitHub Profile
@mmarum-sugarcrm
mmarum-sugarcrm / MobileContractsMobileFilterApi.php
Last active August 29, 2015 14:22
Mobile Contracts Proxy API example
<?php
require_once 'clients/base/api/FilterApi.php';
/**
* Class MobileContractsMobileFilterApi
*
* Tested with Sugar 7.6
*
* Example of how to build a simple proxy API that can be used to make API requests to one module pull data from another module.
@mmarum-sugarcrm
mmarum-sugarcrm / sugarfield_next_step_c.php
Created June 5, 2015 18:44
Example Sugar Logic message field
<?php
// created: 2015-06-05 10:27:18
$dictionary['Lead']['fields']['next_step_c']['duplicate_merge_dom_value']=0;
$dictionary['Lead']['fields']['next_step_c']['labelValue']='Next Step';
$dictionary['Lead']['fields']['next_step_c']['full_text_search']=array (
'boost' => '0',
'enabled' => false,
);
$dictionary['Lead']['fields']['next_step_c']['calculated']='1';
$dictionary['Lead']['fields']['next_step_c']['formula']='ifElse(equal(count($tasks),0),"You must create a follow up Task for this Lead!",concat("Complete ",toString(related($tasks,"name"))))';
@mmarum-sugarcrm
mmarum-sugarcrm / addFooterAction.ext.php
Last active August 29, 2015 14:20
MyAppAction footer extension (tested on Sugar 7.5, 7.6)
<?php
// Append new View to Footer layout's list of components
$viewdefs['base']['layout']['footer']['components'][] = array (
'view' => 'my-app-action',
);
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Last active August 29, 2015 14:17
Foo view that uses detail template
$viewdefs['base']['view']['foo'] = array(
'buttons' => array(),
'type' => 'foo',
'name' => 'bar',
'template' => 'detail',
),
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Created March 25, 2015 16:23
Foo layout that uses the bar template
$viewdefs['base']['layout']['foo'] = array(
'components' => array(),
'type' => 'foo',
'name' => 'bar',
),
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Created March 25, 2015 16:12
Foo view that uses the bar controller
$viewdefs['base']['view']['foo'] = array(
'buttons' => array(
array(
'type' => 'button',
'name' => 'save',
),
),
'name' => 'bar',
),
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Last active August 29, 2015 14:17
Foo layout with a type definition that uses the foo controller
$viewdefs['base']['layout']['foo'] = array(
'components' => array(),
'type' => 'foo',
),
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Created March 25, 2015 15:52
Foo view that includes a buttons definition
$viewdefs['base']['view']['foo'] = array(
'buttons' => array( //directly include definition
array(
'type' => 'button',
'name' => 'cancel',
),
array(
'type' => 'button',
'name' => 'save',
),
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Created March 25, 2015 15:50
Foo layout with a component definition
$viewdefs['base']['layout']['foo'] = array(
'components' => array(
array(
'layout' => 'header', //reference another definition
),
array(
'layout' => array( //directly include definition
'components' => array(
array(
'view' => 'title', //reference another definition
@mmarum-sugarcrm
mmarum-sugarcrm / 1-base-layout-foo.php
Created March 25, 2015 15:45
Using Name and Type in View Definitions in Sugar 7
$viewdefs['base']['layout']['foo'] = array(
'components' => array(
array(
'layout' => 'header', //reference another definition
),
array(
'layout' => array( //directly include definition
'components' => array(
array(
'view' => 'title', //reference another definition