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 / README.md
Last active September 26, 2023 10:14
SugarCRM:: Filter default:: Add another fields to quick_search

#Extending quick search to default filter to search by custom field#

This customization allows to user to search by another field aside name field

@betobaz
betobaz / custom_clients_base_views_map-dashlet_map-dashlet.js
Last active December 19, 2022 02:07
SugarCRM::Sidecar::Load Google Maps Api Async
({
plugins: ['Dashlet'],
initialize: function (options) {
var self = this;
this._super('initialize', [options]);
// Escuchador que se detona cuando se ha detectado que el api de
self.context.on('google:maps:api:load', _.bind(self._googleMapsApiLoadHandler, self));
// Se define la función callback que se va a ejecutar cuando google maps api ya esta disponible
window.mapsApiCallback = function(){
console.log('hola mundo, maps api cargado');
@betobaz
betobaz / Google street view api example
Created April 20, 2012 13:46
Google street view api
var map;
var panorama;
(function() {
var tt = new google.maps.LatLng(18.851874,-97.101803);
var mapOptions = {
center: tt,
zoom: 14,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false
};
@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.
@betobaz
betobaz / custom__modules__Accounts__clients__base__views__record__record.js
Created September 14, 2015 16:08
SugarCRM: Sidecar: save new bean with id
({
events:{
'click .button': '_createMeeting',
},
_createMeeting: function(){
var meeting = app.data.createBean('Meetings');
meeting.set({
// Create its UUID
id: app.utils.generateUUID(),
name: 'Test',
@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"
@betobaz
betobaz / custom__modules__Accounts__clients__base__views__record__record.js
Created September 11, 2015 18:45
SugarCRM: Sidecar: Open create-actions layout in a drawer on demand
({
events:{
'click button': '_handlerClick',
},
_handlerClick: function(evt, el){
var modelPrefil = app.data.createBean("Accounts");
modelPrefil.set({
name: "Account name",
assigned_user_name: 1
});
@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,
<?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(
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* 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