Skip to content

Instantly share code, notes, and snippets.

View jwhitcraft's full-sized avatar
🏠
Working from home (always)

Jon Whitcraft jwhitcraft

🏠
Working from home (always)
View GitHub Profile
<?php
// this file is upgrade safe
// location: custom/modules/Contacts/views/view.detail.php
require_once('modules/Contacts/views/view.detail.php');
class CustomContactsViewDetail extends ContactsViewDetail {
/**
* @see SugarView::display()
<?php
// this file is non-upgrade safe
// location: custom/modules/Contacts/views/view.detail.php
require_once('include/MVC/View/views/view.detail.php');
class ContactsViewDetail extends ViewDetail {
/**
* @see SugarView::display()
<?php
/**
* Custom Controller for LeadRouting Module to provide access
*/
class Customsgr_LeadRoutingController extends SugarController
{
/**
* Overwrite the preProcess() method to determin if access can be granted to this module
*
* @return null;
<?php
class CustomOpportunitiesViewDetail extends OpportunitesViewDetail {
/**
* Overwrite the code to display the subpanels
*/
protected function _displaySubPanels()
{}
<?php
// if there is a default ViewDetail Class for that module
require_once('modules/Opportunities/views/view.detail.php');
class CustomOpportunitiesViewDetail extends OpportunitiesViewDetail
{}
// if there is not a default ViewDetail Class
require_once('include/MVC/View/views/view.detail.php');
<?php
/**
* Make the primary address postalcode required when the status is "qualified"
* and the region_c equals to "Europe", "Middle East", "Africa"
*
*/
$dependencies['Leads']['primary_address_postalcode'] = array(
'hooks' => array("edit"), // this is when you want it to fire, since it's only on edit view we just have edit
'trigger' => 'true', // to fire when fields change
'triggerFields' => array('status', 'region_c'), // which fields to fire on when they change
<?php
$subMock = $this->getMock("\\Sugar\\Data\\Subscription", array('isAddonValid'));
$subMock->expects($this->once())
->method('isAddonValid')
->with($this->equalTo('mobileservertest1'))
->will($this->returnValue(true));
$subMock->expects($this->once())
->method('isAddonValid')
->with($this->equalTo('mobileclienttest1'))
Backup::Model.new(:storage_backup, 'Storage Backup') do
sync_with S3 do |s3|
s3.access_key_id = "access_key"
s3.secret_access_key = "secret_access_key"
s3.bucket = "bd_backup"
s3.path = "/macstorage"
s3.mirror = true
s3.additional_options = ['--exclude=".Spotlight-V100|.DS_Store|.fseventsd|.TemporaryItems|Movies|iMovie"']
> git checkout master
> git subtree merge --prefix=library/Zend/Log --squash subtrees/zend_log
> git subtree split --prefix=library/Zend/Log --annotate="[zend_log] " --rejoin -b subtrees/zend_log