Skip to content

Instantly share code, notes, and snippets.

View betobaz's full-sized avatar

Betobaz betobaz

  • Betobaz
  • Veracruz, Mexico
View GitHub Profile
@betobaz
betobaz / custom__clients__base__layouts__filter__filter.js
Created February 13, 2017 18:47
SugarCRM: Default filter on search view
({
extendsFrom: "FilterLayout",
/**
* Applies filter on current contexts
* @param {String} query search string
* @param {Object} dynamicFilterDef(optional)
*/
applyFilter: function(query, dynamicFilterDef) {
// TODO: getRelevantContextList needs to be refactored to handle filterpanels in drawer layouts,
@betobaz
betobaz / manifest.php
Created January 26, 2017 23:17
SugarCRM: Create relate field by manifest
<?php
/*********************************************************************************
* By installing or using this file, you are confirming on behalf of the entity
* subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
* the SugarCRM Inc. Master Subscription Agreement (“MSA”), which is viewable at:
* http://www.sugarcrm.com/master-subscription-agreement
*
* If Company is not bound by the MSA, then by installing or using this file
* you are agreeing unconditionally that Company will be bound by the MSA and
* certifying that you have authority to bind Company accordingly.
<?php
// Documentation.- http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Architecture/Sugar_Logic/Dependency_Actions/
$dependencies['Meetings']['readonly_fields'] = array(
'hooks' => array("edit"), // values : "edit", "view", "save" and "all"
'trigger' => 'equal($status,"Held")', //Optional, the trigger for the dependency. Defaults to 'true'.
'triggerFields' => array('status'), // The list of fields to watch for change events. When changed, the trigger expressions will be recalculated.
'onload' => true, // Whether or not to trigger the dependencies when the page is loaded.
//Actions is a list of actions to fire when the trigger is true
// You could list multiple fields here each in their own array under 'actions'
'actions' => array(
@betobaz
betobaz / repair.php
Last active October 1, 2016 16:42
SugarCRM: 7.7.X: Quick Repair CLI
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
/*
* 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.
*
@betobaz
betobaz / dashlet-test.js
Last active August 2, 2016 11:15
SugarCRM:: Sidecar unit test
ddescribe("Dashlet dashlet", function () {
var viewName = 'dashlet',
view,
layout,
context,
layoutName = 'record',
moduleName = 'Opportunities',
model;
beforeEach(function () {
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*
* 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.
*
@betobaz
betobaz / custom__clients__base__views__supanel-list__subpanel-list.js
Created October 15, 2015 18:39
SugarCRM:Sidecar: Change Edit list max per page in subpanel any module
({
extendsFrom: 'SubpanelListView',
initialize: function(options) {
// `dataViewName` corresponds to the list of fields the API should retrieve.
this.dataViewName = options.name || 'subpanel-list';
this._super("initialize", [options]);
var limit = this.context.get('limit') || app.config.maxSubpanelResult;
// Setup max limit on collection's fetch options for this subpanel's context
@betobaz
betobaz / custom__modules__Contacts__clients__base__fields__link-action__link-action.js
Created October 12, 2015 23:10
SugarCRM:Sidecar:Modify list selection for "Link Existing Record"
<?php
$dictionary['Task']['visibility'] = array(
"YourVisibilityClass" => true,
);
@betobaz
betobaz / custom__include__language__es_LA.lang.php
Last active August 4, 2016 12:49
SugarCRM: Sidecar: Multi select dependent from another multi select dependent fields
<?php
$app_list_strings['promocion_region_list']=array (
'Michoacana' => 'Michoacana',
'Jaliciense' => 'Jaliciense',
'Sinaloense' => 'Sinaloense',
'Sonorense' => 'Sonorense',
);
$app_list_strings['seg_geo_com_Michoacana_list']=array (