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 / record.php
Created February 18, 2015 19:42
SugarCRM sidecar retrieve fields' value that aren't visible in a view
<?php
$viewdefs['Leads']['base']['view']['record'] = array(
'buttons' => array(
.
.
.
),
'panels' => array(
.
.
<?php
$dictionary['Account']['visibility'] = array(
"OwnedByTeamField" => true,
);
@betobaz
betobaz / custom_modules_Activities_ActivitiesLogicHookCustom.php
Created November 5, 2014 02:20
SugarCRM Notifications like facebook
<?php
class ActivitiesLogicHookCustom{
public function notifyActivity($bean, $event, $arguments){
if($bean->module_name == 'Activities'){
global $current_user;
$data = json_decode($bean->data);
$message = preg_replace('/(\@)\[\w+\:[a-f0-9-]{36}\:([\w ]+)\]/u', '$1$2', $data->value);
foreach($data->tags as $tag){
if($tag->module == 'Users'){
$notification = BeanFactory::newBean('Notifications');
<?php
$viewdefs['Accounts']['base']['layout']['nrfm'] = array(
'type' => 'simple',
'components' => array(
array(
'view' => 'nrfm',
),
),
);
?>
({
extendsFrom: 'RecordView',
initialize: function (options) {
this._super('initialize', arguments);
debugger;
this.model.on("change:solucion_c",this.calculate, this);
},
calculate:function() {
var solucion_c = this.model.get('solucion_c');
@betobaz
betobaz / existencias.hbs
Last active August 29, 2015 14:04
SugarCRM::Dashlet existencias
<style>
.table-existencia td:nth-child(4),
.table-existencia td:nth-child(6),
.table-existencia td:nth-child(7),
.table-existencia th:nth-child(4),
.table-existencia th:nth-child(6),
.table-existencia th:nth-child(7){
text-align:right;
}
@betobaz
betobaz / sugarquery_join_custom_module.php
Created July 15, 2014 16:08
SugarCRM::SugarQuery:: Join with custom module
<?php
$sugarQuery = new SugarQuery();
$sugarQuery->select(array('id', 'name', 'precio'));
$precioBean = BeanFactory::newBean('MXC06_Precio');
$sugarQuery->from($precioBean);
$sugarQuery->join('mxc06_precio_accounts');
$sugarQuery->join('mxc06_precio_producttemplates');
$sugarQuery->where()
@betobaz
betobaz / Request
Created May 27, 2014 16:33
SugarCRM::ApiRest::Filter Or
https://<sugarinstance>/rest/v10/Accounts/filter/?
filter[1][date_entered][$dateBetween][]=2014-05-24
&filter[1][date_entered][$dateBetween][]=2014-05-27
&fields=id,no_cliente_c
&filter[0][$or][][no_cliente_c]=1563
&filter[0][$or][][no_cliente_c]=1280
&filter[0][$or][][no_cliente_c]=1443
&filter[0][$or][][no_cliente_c]=3078
&filter[0][$or][][no_cliente_c]=10266
&filter[0][$or][][no_cliente_c]=1654
<?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
@betobaz
betobaz / metadata.php
Created March 13, 2014 18:14
fill_dropdown_custom
<?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.