Skip to content

Instantly share code, notes, and snippets.

View betobaz's full-sized avatar

Betobaz betobaz

  • Betobaz
  • Veracruz, Mexico
View GitHub Profile
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@tzi
tzi / custom-field-data.php
Created December 22, 2011 14:51
SugarCRM module layouts snippets
<?php
$viewdefs[ $module_name ][ 'EditView' ] = array(
// CONTENT
'panels' => array(
// PANEL
'lbl_panel_1' => array(
// ROW
@betobaz
betobaz / Sugarcrm:EditView modify pre display
Created November 21, 2012 23:44
Modificación del vista de edición para asignar valores antes de desplegar
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/MVC/View/views/view.edit.php');
class CustomViewEdit extends ViewEdit {
var $ev;
var $type ='edit';
var $useForSubpanel = false; //boolean variable to determine whether view can be used for subpanel creates
var $useModuleQuickCreateTemplate = false; //boolean variable to determine whether or not SubpanelQuickCreate has a separate display function
var $showTitle = true;
@jmertic
jmertic / gist:5847575
Last active May 10, 2016 12:48
Sample Node.js script using Restler for connecting to the new RESTful SugarCRM REST API in 6.7 and later.
var sys = require('util'),
rest = require('restler');
var baseurl = "<<instance URL>>/rest/v10"
// get oAuth token
var jsonData = {"grant_type":"password","username":"<<username>>","password":"<<password>>","client_id":"sugar"};
rest.postJson(baseurl+'/oauth2/token', jsonData).on('2XX', function(data) {
if ( data.error ) {
sys.puts("Error: " + data.error_message);
@jmertic
jmertic / gist:6294266
Created August 21, 2013 13:10
Silent install a package on an instance from the command line in SugarCRM with this script
#!/usr/bin/env php
<?php
function usage()
{
print("usage: -i /path/to/instance -p /path/to/expanded/module -z /path/to/zipfile\n");
exit(1);
}
$opts = getopt('i:p:z:');
<?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
@mmarum-sugarcrm
mmarum-sugarcrm / custom_clients_base_layouts_record_record.php
Last active January 30, 2018 23:21
Adding a new view to base Record layout in Sugar 7
<?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
@eggsurplus
eggsurplus / setup.php
Created February 20, 2014 16:56
SugarCRM 7 layout definition
// /modules/YOURMODULE/clients/base/layouts/setup/setup.php
$viewdefs[‘YOURMODULE’]['base']['layout']['setup'] = array(
'type' => 'simple',
'components' =>
array(
array(
'view' => 'setup',
),
),
);
@esimonetti
esimonetti / TeamSecurity.php
Created March 5, 2014 08:55
Remove Team Security filtering in SugarCRM 7 - (location: custom/data/visibility/TeamSecurity.php and remember to run a quick repair!) - Code for blog post http://enricosimonetti.com/can-i-remove-team-security-from-sugarcrm/
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class TeamSecurity extends SugarVisibility
{
public function addVisibilityFrom(&$query)
{
return $query;
}
@elchele
elchele / subpanels.js
Last active August 29, 2015 14:06
Subpanel layout controller to hide empty subpanels
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/clients/base/layouts/subpanels/subpanels.js
*
* Extended subpanels layout controller for hiding
* subpanels without data upon parent record load (Sugar 7.2+)
*
* This customization applies to all modules
*/