Skip to content

Instantly share code, notes, and snippets.

View orlybg's full-sized avatar

Orlando Briceño Gómez orlybg

View GitHub Profile
@bickart
bickart / update_via_csv.php
Last active January 28, 2016 13:20
Place this file and your CSV file into the root of your SugarCRM install and you can update data in SugarCRM from a CSV on the command line
<?php
//Use an unlimited amount of memory, we probably shouldn't do this but that is how I roll
ini_set('memory_limit', '-1');
//Our program allows us to skip over rows in the data file and only load a sub-set of rows
if (count($argv) < 3 || ! is_numeric($argv[1]) || ! is_numeric($argv[2])) {
echo "Usage php -f $argv[0] skip max" . PHP_EOL;
echo " skip - number of rows to skip when processing" . PHP_EOL;
echo " max - number of rows to import when processing" . PHP_EOL;
@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 (
@amusarra
amusarra / HasUserRoleNameExpression.php
Last active May 1, 2019 04:50
SugarCRM 7: How to make certain fields readonly
<?php
/**
* Project: SugarCRM Logic Expression for checking User role
* Original Dev: Antonio Musarra, January 2014
* @2009-2014 Antonio Musarra <antonio.musarra[at]gmail.com>
*
* Desc: SugarCRM Logic Expression ext class
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@amusarra
amusarra / GetUpcomingActivities.json
Last active April 26, 2016 12:47
A SugarCRM REST API Application
[
{
"id": "e865ab32-d695-9aca-226d-534331a99563",
"module": "Calls",
"date_due": "2014-04-16 23:15:00",
"summary": "Call for Spring Integration"
},
{
"id": "906a0565-01ab-4681-1562-534336998344",
"module": "Opportunities",
@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:5730287
Last active November 14, 2017 13:22
Sample PHP script for connecting to the new RESTful SugarCRM REST API in 6.7 and later.
<?php
// specify the REST web service to interact with
$baseurl = '<<instanceurl>>/rest/v10';
/**
* Authenicate and get back token
*/
$curl = curl_init($baseurl . "/oauth2/token");
curl_setopt($curl, CURLOPT_POST, true);
@erikfried
erikfried / JaxRsResource.java
Created February 24, 2012 10:10
Comparison Java + JAX-RS vs. Java + Playframework 2 vs. Scala + Playframework 2
package se;
import com.sun.jersey.api.NotFoundException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.CacheControl;
import javax.ws.rs.core.EntityTag;
@rich97
rich97 / gist:1308837
Created October 24, 2011 11:43
CMS concept.

Introduction

Today’s CMS systems work by providing an environment for a developer to work in. You modify the data in the admin panel and them CMS provides a method of inserting the HTML it generates into your templates.

However, therein lies the problem -- the output is generated by the CMS. The CMS should exist to provide a user friendly abstraction to the websites dynamic content. It should not tell the frontend how to represent that content.

To anyone reading this, please be aware that any examples I give will be framed within the context of the MVC pattern and more specifically the Lithium PHP framework. Why? Because these are the tools I love to use at the time of writing this document, although there is no reason that this couldn’t be adapted.

Proposed solution